GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 18.218.38.67
Web Server : Apache
System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : jnclnmuac ( 1026)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/jnclnmuac/public_html/web/../admission/../admission/application/controllers/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../admission/../admission/application/controllers/admin/Payment.php
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Payment
 *
 * @author Softpro India Pvt. Ltd
 */
class Payment extends CI_Controller {

    //put your code here
    public function __construct() {
        parent::__construct();
        $this->load->model("admin/PaymentManagement");
        $this->load->model("admin/CourseManagement");
        $this->load->model("admin/SessionManagement");
        $this->load->model("admin/ReportManagement");
        $this->load->model("user/StudentManagement");
    }

    public function offlinePayment() {
        if ($this->sessionvalidator->validateSession()) {
            $viewData["courses"] = $this->CourseManagement->getCoursesBySessionAndFormFee('T', 'F')->result();
            
            $viewData["sessions"] = $this->SessionManagement->getSessions('T', "F")->result();         
            if (isset($_POST["filterSubmitBtn"])) {
                $mobile = $this->input->post("mobile");
                $session_id = $this->input->post("session_id");
                $email = $this->input->post("email");
                $dob = trim($this->input->post("dob")) == "" ? "" : date('Y-m-d', strtotime(str_replace('/', '-', $this->input->post("dob"))));
                $course = $this->input->post("course");
                $viewData["co"] = $course;
                $viewData["app_email"] = $email;
                $viewData["app_mobile"] = $mobile;
                $viewData["admissionForms"] = $this->PaymentManagement->getCompleteAdmissionFormsWithpaymentDetails('F','', $session_id, $email, $mobile, $dob, $course)->result();
                
                $this->load->view("admin/offlinePayement", $viewData);
            } else {
                $viewData["co"] = "";
                $viewData["fno"] = "";
                $session_id = "";
                $viewData["f_status"] = "";
                $viewData["admissionForms"] = $this->PaymentManagement->getCompleteAdmissionFormsWithpaymentDetails('F')->result();
                $this->load->view("admin/offlinePayement", $viewData);
            }
        } else {
            redirect("admin/");
        }
    }

    public function updatePayment($tspi_id) {
        if ($this->sessionvalidator->validateSession()) {
            $viewData["admissionForm"] = $this->PaymentManagement->getCompleteAdmissionFormsWithpaymentDetails($tspi_id)->result()[0];
            $this->load->view("admin/updatePayment", $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function savePayment() {
        $tspi_id = $this->input->post("tspi_id");
        if ($this->sessionvalidator->validateSession()) {
            $this->form_validation->set_rules("receiptno", "Receipt Number", "required", array("required" => "Enter Receipt Number."));
            $this->form_validation->set_rules("pmode", "Payement Mode", "required", array("required" => "Select Payement Mode."));
            $this->form_validation->set_rules("remark", "Remark", "required", array("required" => "Enter Remarks."));
            if ($this->form_validation->run() == false) {
                $this->updatePayment($tspi_id);
            } else {
                $course = $this->input->post("course");
                $receiptno = $this->input->post("receiptno");
                $pmode = $this->input->post("pmode");
                $remark = $this->input->post("remark");
                $transactionArray = array(
                    "gateway_txnid" => $pmode,
                    "bank_ref_no" => $receiptno,
                    "tdate" => date("Y-m-d H:i:s"),
                    "status" => "T",
                    "error_desc" => "OFFLINE_TRANSACTION",
                    "tran_details" => "ADMISSION",
                    "tran_dt" => date("Y-m-d"),
                    "remark" => $remark
                );

                $this->db->trans_start();
                $this->PaymentManagement->updatePaymentDetails($tspi_id,$transactionArray);
                $admissionFrmNoArray = array("regno" => $tspi_id);
                $formno = $this->StudentManagement->insertAdmissionForm($admissionFrmNoArray);
                $tspi_form_no = $course . "-" . $formno;
                $persoanlDetailsArray = array(
                    "tspi_form_no" => $tspi_form_no, 
                    "tspi_id" => $tspi_id,
                    "tspi_updated_on"=>date("Y-m-d H"),
                    "tspi_updated_by"=>"");
                $this->StudentManagement->updateStudentPersonalInfo($persoanlDetailsArray);
                $this->db->trans_complete();
                $this->session->set_flashdata("successMessage","Payment Details Updated Successfully");
                redirect("admin/Payment/offlinePayment");
            }
        } else {
            redirect("admin/");
        }
    }

}

KBHT - 2023