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B%$gtЏ򤵍zHNuЯ-'40;_3 !01"@AQa2Pq#3BR?ʩcaen^8F<7;EA{EÖ1U/#d1an.1ě0ʾRh|RAo3m3 % 28Q yφHTo7lW>#i`qca m,B-j݋'mR1Ήt>Vps0IbIC.1Rea]H64B>o]($Bma!=?B KǾ+Ծ"nK*+[T#{EJSQs5:U\wĐf3܆&)IԆwE TlrTf6Q|Rh:[K zc֧GC%\_a84HcObiؖV7H )*ģK~Xhչ04?0 E<}3#u? |gS6ꊤ|I#Hڛ աwX97Ŀ%SLy6č|Fa 8b$sקhb9RAu7˨pČ_\*w묦F 4D~f|("mNKiS>$d7SlA/²SL|6N}S˯g]6; #. 403WebShell
403Webshell
Server IP : 43.205.77.33  /  Your IP : 216.73.216.84
Web Server : Apache
System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els13.x86_64 #1 SMP Fri Nov 22 06:29:45 UTC 2024 x86_64
User : dbcollege ( 1086)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/dbcollege/www/cas/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/dbcollege/www/cas/application/controllers/admin/Reports.php
<?php

/**
 * Controller For Handling All Requests Related To Reporting
 *
 * @author Softpro India Pvt. Ltd..
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class Reports extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('admin/StudentManagement');
        $this->load->model('admin/BranchManagement');
        $this->load->model('admin/CourseManagement');
        $this->load->model('admin/StaffManagement');
        $this->load->model('admin/DocumentInfoManagement');
        $this->load->model('admin/DocumentManagement');
        $this->load->model('admin/RelationManagement');
        $this->load->model('admin/DesignationManagement');
        $this->load->model('admin/DepartmentManagement');
        $this->load->model('admin/StockAndPurchaseManagement');
        $this->load->model('admin/InventoryManagement');
        $this->load->model('admin/LocationManagement');
        $this->load->model('admin/AttendanceManagement');
        $this->load->model('admin/SessionManagement');
        $this->load->model('admin/SubjectManagement');
        $this->load->model('admin/FeeManagement');
        $this->load->model('admin/AllotmentManagement');
        $this->load->model('admin/AchievementManagement');
        $this->load->model('admin/ScholarshipManagement');
        $this->load->model('admin/LeaveManagement');
    }

    public function studentMiscellaneousReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $reqName = trim($this->input->post("stuName"));
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedGender = trim($this->input->post("stuGender"));
                $selectedCategory = trim($this->input->post("stuCategory"));
                $selectedReligion = trim($this->input->post("stuReligion"));
                $selectedDisability = trim($this->input->post("stuDisability"));
                $selectedOperator = trim($this->input->post("stuEntryOprtr"));
                $selectedStatus = trim($this->input->post("stuStatus"));
                $selectedEnrollSession = trim($this->input->post("enrollSession"));
                $selectedStartDate = (trim($this->input->post("entryStartDate")) == "") ? "" : date("Y-m-d 00:00:00", strtotime(str_replace('/', '-', trim($this->input->post("entryStartDate")))));
                $selectedEndDate = (trim($this->input->post("entryEndDate")) == "") ? "" : date("Y-m-d 23:59:59", strtotime(str_replace('/', '-', trim($this->input->post("entryEndDate")))));
                $selectedRangeAppliedWith = (trim($this->input->post("entryDateRangeAppliedWith")) == "") ? "" : trim($this->input->post("entryDateRangeAppliedWith"));
                $filteredRecords = $this->StudentManagement->getStudentMiscellaneousReport($reqName, $selectedCourse, $selectedSession, $selectedEntryType, $selectedGender, $selectedCategory, $selectedReligion, $selectedDisability, $selectedOperator, $selectedEnrollSession, $selectedStartDate, $selectedEndDate, $selectedRangeAppliedWith, $selectedStatus)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('O', 'C'))->result();
            $viewData['categories'] = json_decode(file_get_contents(base_url('assets/admin/json/categories.json')), true);
            $viewData['religions'] = json_decode(file_get_contents(base_url('assets/admin/json/religions.json')), true);
            $viewData['operators'] = $this->StaffManagement->getAllDistinctStudentEntryOperators()->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/student/studentMiscellaneousReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentDeficitDocsReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                if ($selectedCourse == "") {
                    $this->session->set_flashdata('errorMessage', "Please Select Course To Fetch Deficit Documents Report.");
                } else {
                    $this->session->set_flashdata('errorMessage', NULL);
                    $courseCategory = $this->CourseManagement->getCoursesBy($selectedCourse)->result()[0]->course_category;
                    $allApplicableDoumentsByCourseCategory = $this->DocumentManagement->getAllDocumentsUptoCategory($courseCategory)->result();
                    $filteredRecordsForDeficitDocsReport = $this->StudentManagement->getStudentPersonalInfoByCourseSessionAndEntryType($selectedCourse, $selectedSession, $selectedEntryType)->result();
                    for ($i = 0; $i < sizeof($filteredRecordsForDeficitDocsReport); $i++) {
                        $thisStudent = $filteredRecordsForDeficitDocsReport[$i];
                        $fatherRelId = $this->RelationManagement->getRelationInfoByName("FATHER")->result()[0]->rel_id;
                        $fatherName = $this->RelationManagement->getRelativeInfoBy($thisStudent->tspi_id, $fatherRelId, "S")->result()[0]->tfbi_name;
                        if ($thisStudent->tspi_status == 'CE') {
                            $ten_marks = 'N';
                            $ten_cert = 'N';
                            $twelve_marks = 'N';
                            $twelve_cert = 'N';
                            $tc = 'N';
                            $grad_marks = "N";
                            $mig = 'N';
                            $cc = 'N';
                            $ygc = ($thisStudent->tspi_ygap_applied == "T") ? "N" : "";
                            $enrlmtn_form = 'N';
                            for ($j = 0; $j < sizeof($allApplicableDoumentsByCourseCategory); $j++) {
                                $thisDocument = $allApplicableDoumentsByCourseCategory[$j];
                                if ($this->DocumentInfoManagement->isDocumentUploaded($thisStudent->tspi_id, $thisDocument->doc_id, "S")) {
                                    switch ($thisDocument->doc_flag) {
                                        case 'XM':
                                            $ten_marks = '';
                                            break;
                                        case 'XC':
                                            $ten_cert = '';
                                            break;
                                        case 'XIIM':
                                            $twelve_marks = '';
                                            break;
                                        case 'XIIC':
                                            $twelve_cert = '';
                                            break;
                                        case 'GM':
                                            $grad_marks = "";
                                            break;
                                        case 'TC':
                                            $tc = '';
                                            break;
                                        case 'MG':
                                            $mig = '';
                                            break;
                                        case 'CC':
                                            $cc = '';
                                            break;
                                        case 'YGC':
                                            $ygc = ($ygc == "N") ? "" : "Not Applicable";
                                            break;
                                        case 'SCE':
                                            $enrlmtn_form = '';
                                            break;
                                        default:break;
                                    }
                                }
                            }
                            $grad_marks = ($courseCategory == "UG") ? "" : $grad_marks;
                            if ($ten_marks == 'N' || $ten_cert == 'N' || $twelve_marks == 'N' || $twelve_cert == 'N' || $grad_marks == 'N' || $tc == 'N' || $mig == 'N' || $cc == 'N' || $ygc == 'N' || $enrlmtn_form == 'N') {
                                $grad_marks = ($courseCategory == "UG") ? "Not Applicable" : $grad_marks;
                                $thisStudentDeficitDocInfo = array(
                                    'stu_form_no' => stripslashes($thisStudent->tspi_form_no),
                                    'stu_enrollment_no' => stripslashes($thisStudent->tspi_enrollment_no),
                                    'stu_roll_no' => stripslashes($thisStudent->tspi_rollNumber),
                                    'stu_name' => stripslashes($thisStudent->tspi_name),
                                    'stu_mob' => $thisStudent->tspi_mobile,
                                    'stu_email' => stripslashes($thisStudent->tspi_email),
                                    'stu_gender' => $thisStudent->tspi_gender,
                                    'stu_father_name' => $fatherName,
                                    'stu_course' => stripslashes($thisStudent->course_name),
                                    'stu_session' => stripslashes($thisStudent->session_name),
                                    'stu_entry_type' => stripslashes($thisStudent->tcsm_course_type),
                                    'ten_marks' => $ten_marks,
                                    'ten_cert' => $ten_cert,
                                    'twelwe_marks' => $twelve_marks,
                                    'twelve_cert' => $twelve_cert,
                                    'tc' => $tc,
                                    'grad_marks' => $grad_marks,
                                    'mig' => $mig,
                                    'cc' => $cc,
                                    'ygc' => $ygc,
                                    'enrlmtn_form' => $enrlmtn_form
                                );
                                array_push($filteredRecords, $thisStudentDeficitDocInfo);
                            }
                        } else {
                            continue;
                        }
                    }
                }
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/student/studentDeficitDocsReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentTCReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedPattern = "";
            $selectedSession = "";
            $selectedEntryType = "";
            $tcReport = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $filterPattern = $this->input->post('filterPattern');
                $selectedPattern = $filterPattern;
                if ($filterPattern != "") {
                    if ($filterPattern == 'FNW') {
                        $reqFormNumber = trim($this->input->post('stuFormNo'));
                        if ($reqFormNumber == "") {
                            $this->session->set_flashdata('errorMessage', "Enter Form Number To Search.");
                        } else {
                            $this->session->set_flashdata('errorMessage', NULL);
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByFormNumber($reqFormNumber)->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentTCDocId = $this->DocumentManagement->getDocumentByFlag("TC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $tcInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentTCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($tcInfo)) {
                                        for ($j = 0; $j < sizeof($tcInfo); $j++) {
                                            array_push($tcReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_tc_issued' => true,
                                                'is_tc_duplicate' => ($tcInfo[$j]->tdii_duplicate_status == "F") ? 'Original' : 'Duplicate',
                                                'tc_id' => $tcInfo[$j]->tdii_id,
                                                'tc_issue_date' => date("d-m-Y", strtotime($tcInfo[$j]->tdii_doc_issued_on)),
                                                'tc_sr_no' => stripslashes($tcInfo[$j]->tdii_doc_unique_code),
                                                'tc_issued_by' => stripslashes($tcInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($tcReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_tc_issued' => false,
                                            'is_tc_duplicate' => "NA",
                                            'tc_id' => 0,
                                            'tc_issue_date' => "NA",
                                            'tc_sr_no' => "NA",
                                            'tc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "Invalid Form Number. No Student Record Is Available On This Form Number.");
                            }
                        }
                    } else if ($filterPattern == 'RNW') {
                        $reqRollNumber = trim($this->input->post('stuRollNo'));
                        if ($reqRollNumber == "") {
                            $this->session->set_flashdata('errorMessage', "Enter Roll Number/College Id To Search.");
                        } else {
                            $this->session->set_flashdata('errorMessage', NULL);
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByRollNumberOrEnrollmentNo($reqRollNumber)->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentTCDocId = $this->DocumentManagement->getDocumentByFlag("TC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $tcInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentTCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($tcInfo)) {
                                        for ($j = 0; $j < sizeof($tcInfo); $j++) {
                                            array_push($tcReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_tc_issued' => true,
                                                'is_tc_duplicate' => ($tcInfo[$j]->tdii_duplicate_status == "F") ? 'Original' : 'Duplicate',
                                                'tc_id' => $tcInfo[$j]->tdii_id,
                                                'tc_issue_date' => date("d-m-Y", strtotime($tcInfo[$j]->tdii_doc_issued_on)),
                                                'tc_sr_no' => stripslashes($tcInfo[$j]->tdii_doc_unique_code),
                                                'tc_issued_by' => stripslashes($tcInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($tcReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_tc_issued' => false,
                                            'is_tc_duplicate' => "NA",
                                            'tc_id' => 0,
                                            'tc_issue_date' => "NA",
                                            'tc_sr_no' => "NA",
                                            'tc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "Invalid College Id/Roll Number. No Student Record Is Available On This Roll Number.");
                            }
                        }
                    } else {
                        $reqCourse = trim($this->input->post('stuCourse'));
                        if ($reqCourse == "") {
                            $this->session->set_flashdata('errorMessage', "Please Select Course To Search Students.");
                        } else {
                            $selectedSession = $this->input->post('stuSession');
                            $selectedEntryType = $this->input->post('stuEntryType');
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByCourseSessionAndEntryType($reqCourse, trim($selectedSession), trim($selectedEntryType))->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentTCDocId = $this->DocumentManagement->getDocumentByFlag("TC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $tcInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentTCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($tcInfo)) {
                                        for ($j = 0; $j < sizeof($tcInfo); $j++) {
                                            array_push($tcReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_tc_issued' => true,
                                                'is_tc_duplicate' => ($tcInfo[$j]->tdii_duplicate_status == "F") ? 'Original' : 'Duplicate',
                                                'tc_id' => $tcInfo[$j]->tdii_id,
                                                'tc_issue_date' => date("d-m-Y", strtotime($tcInfo[$j]->tdii_doc_issued_on)),
                                                'tc_sr_no' => stripslashes($tcInfo[$j]->tdii_doc_unique_code),
                                                'tc_issued_by' => stripslashes($tcInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($tcReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_tc_issued' => false,
                                            'is_tc_duplicate' => "NA",
                                            'tc_id' => 0,
                                            'tc_issue_date' => "NA",
                                            'tc_sr_no' => "NA",
                                            'tc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "No Students Exists In The Selected Course/Session.");
                            }
                        }
                    }
                } else {
                    $tcReport = array();
                }
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['selectedPattern'] = $selectedPattern;
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['tcReport'] = $tcReport;
            $this->load->view('admin/reports/student/tcReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentCCReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedPattern = "";
            $selectedSession = "";
            $selectedEntryType = "";
            $ccReport = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $filterPattern = $this->input->post('filterPattern');
                $selectedPattern = $filterPattern;
                if ($filterPattern != "") {
                    if ($filterPattern == 'FNW') {
                        $reqFormNumber = trim($this->input->post('stuFormNo'));
                        if ($reqFormNumber == "") {
                            $this->session->set_flashdata('errorMessage', "Enter Form Number To Search.");
                        } else {
                            $this->session->set_flashdata('errorMessage', NULL);
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByFormNumber($reqFormNumber)->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentCCDocId = $this->DocumentManagement->getDocumentByFlag("CC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $ccInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentCCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($ccInfo)) {
                                        for ($j = 0; $j < sizeof($ccInfo); $j++) {
                                            array_push($ccReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_cc_issued' => true,
                                                'is_cc_duplicate' => ($ccInfo[$j]->tdii_duplicate_status == "F") ? 'Original' : 'Duplicate',
                                                'cc_id' => $ccInfo[$j]->tdii_id,
                                                'cc_issue_date' => date("d-m-Y", strtotime($ccInfo[$j]->tdii_doc_issued_on)),
                                                'cc_sr_no' => stripslashes($ccInfo[$j]->tdii_doc_unique_code),
                                                'cc_issued_by' => stripslashes($ccInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($ccReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_cc_issued' => false,
                                            'is_cc_duplicate' => "NA",
                                            'cc_id' => 0,
                                            'cc_issue_date' => "NA",
                                            'cc_sr_no' => "NA",
                                            'cc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "Invalid Form Number. No Student Record Is Available On This Form Number.");
                            }
                        }
                    } else if ($filterPattern == 'RNW') {
                        $reqRollNumber = trim($this->input->post('stuRollNo'));
                        if ($reqRollNumber == "") {
                            $this->session->set_flashdata('errorMessage', "Enter Roll Number/College Id To Search.");
                        } else {
                            $this->session->set_flashdata('errorMessage', NULL);
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByRollNumberOrEnrollmentNo($reqRollNumber)->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentCCDocId = $this->DocumentManagement->getDocumentByFlag("CC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $ccInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentCCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($ccInfo)) {
                                        for ($j = 0; $j < sizeof($ccInfo); $j++) {
                                            array_push($ccReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_cc_issued' => true,
                                                'is_cc_duplicate' => ($ccInfo[$j]->tdii_duplicate_status == "F") ? 'Original' : 'Duplicate',
                                                'cc_id' => $ccInfo[$j]->tdii_id,
                                                'cc_issue_date' => date("d-m-Y", strtotime($ccInfo[$j]->tdii_doc_issued_on)),
                                                'cc_sr_no' => stripslashes($ccInfo[$j]->tdii_doc_unique_code),
                                                'cc_issued_by' => stripslashes($ccInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($ccReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_cc_issued' => false,
                                            'is_cc_duplicate' => "NA",
                                            'cc_id' => 0,
                                            'cc_issue_date' => "NA",
                                            'cc_sr_no' => "NA",
                                            'cc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "Invalid College Id/Roll Number. No Student Record Is Available On This Roll Number.");
                            }
                        }
                    } else {
                        $reqCourse = trim($this->input->post('stuCourse'));
                        if ($reqCourse == "") {
                            $this->session->set_flashdata('errorMessage', "Please Select Course To Search Students.");
                        } else {
                            $selectedSession = $this->input->post('stuSession');
                            $selectedEntryType = $this->input->post('stuEntryType');
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByCourseSessionAndEntryType($reqCourse, trim($selectedSession), trim($selectedEntryType))->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentCCDocId = $this->DocumentManagement->getDocumentByFlag("CC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $ccInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentCCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($ccInfo)) {
                                        for ($j = 0; $j < sizeof($ccInfo); $j++) {
                                            array_push($ccReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_cc_issued' => true,
                                                'is_cc_duplicate' => ($ccInfo[$j]->tdii_duplicate_status == "F") ? 'Original' : 'Duplicate',
                                                'cc_id' => $ccInfo[$j]->tdii_id,
                                                'cc_issue_date' => date("d-m-Y", strtotime($ccInfo[$j]->tdii_doc_issued_on)),
                                                'cc_sr_no' => stripslashes($ccInfo[$j]->tdii_doc_unique_code),
                                                'cc_issued_by' => stripslashes($ccInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($ccReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_cc_issued' => false,
                                            'is_cc_duplicate' => "NA",
                                            'cc_id' => 0,
                                            'cc_issue_date' => "NA",
                                            'cc_sr_no' => "NA",
                                            'cc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "No Students Exists In The Selected Course/Session.");
                            }
                        }
                    }
                } else {
                    $ccReport = array();
                }
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['selectedPattern'] = $selectedPattern;
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['ccReport'] = $ccReport;
            $this->load->view('admin/reports/student/ccReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentBCReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedPattern = "";
            $selectedSession = "";
            $selectedEntryType = "";
            $bcReport = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $filterPattern = $this->input->post('filterPattern');
                $selectedPattern = $filterPattern;
                if ($filterPattern != "") {
                    if ($filterPattern == 'FNW') {
                        $reqFormNumber = trim($this->input->post('stuFormNo'));
                        if ($reqFormNumber == "") {
                            $this->session->set_flashdata('errorMessage', "Enter Form Number To Search.");
                        } else {
                            $this->session->set_flashdata('errorMessage', NULL);
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByFormNumber($reqFormNumber)->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentBCDocId = $this->DocumentManagement->getDocumentByFlag("BC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $bcInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentBCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($bcInfo)) {
                                        for ($j = 0; $j < sizeof($bcInfo); $j++) {
                                            array_push($bcReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_bc_issued' => true,
                                                'is_bc_duplicate' => '-',
                                                'bc_id' => $bcInfo[$j]->tdii_id,
                                                'bc_issue_date' => date("d-m-Y", strtotime($bcInfo[$j]->tdii_doc_issued_on)),
                                                'bc_sr_no' => stripslashes($bcInfo[$j]->tdii_doc_unique_code),
                                                'bc_issued_by' => stripslashes($bcInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($bcReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_bc_issued' => false,
                                            'is_bc_duplicate' => "-",
                                            'bc_id' => 0,
                                            'bc_issue_date' => "NA",
                                            'bc_sr_no' => "NA",
                                            'bc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "Invalid Form Number. No Student Record Is Available On This Form Number.");
                            }
                        }
                    } else if ($filterPattern == 'RNW') {
                        $reqRollNumber = trim($this->input->post('stuRollNo'));
                        if ($reqRollNumber == "") {
                            $this->session->set_flashdata('errorMessage', "Enter Roll Number/College Id To Search.");
                        } else {
                            $this->session->set_flashdata('errorMessage', NULL);
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByRollNumberOrEnrollmentNo($reqRollNumber)->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentBCDocId = $this->DocumentManagement->getDocumentByFlag("BC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $bcInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentBCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($bcInfo)) {
                                        for ($j = 0; $j < sizeof($bcInfo); $j++) {
                                            array_push($bcReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_bc_issued' => true,
                                                'is_bc_duplicate' => "-",
                                                'bc_id' => $bcInfo[$j]->tdii_id,
                                                'bc_issue_date' => date("d-m-Y", strtotime($bcInfo[$j]->tdii_doc_issued_on)),
                                                'bc_sr_no' => stripslashes($bcInfo[$j]->tdii_doc_unique_code),
                                                'bc_issued_by' => stripslashes($bcInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($bcReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_bc_issued' => false,
                                            'is_bc_duplicate' => "-",
                                            'bc_id' => 0,
                                            'bc_issue_date' => "NA",
                                            'bc_sr_no' => "NA",
                                            'bc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "Invalid College Id/Roll Number. No Student Record Is Available On This Roll Number.");
                            }
                        }
                    } else {
                        $reqCourse = trim($this->input->post('stuCourse'));
                        if ($reqCourse == "") {
                            $this->session->set_flashdata('errorMessage', "Please Select Course To Search Students.");
                        } else {
                            $selectedSession = $this->input->post('stuSession');
                            $selectedEntryType = $this->input->post('stuEntryType');
                            $studentInfo = $this->StudentManagement->getStudentPersonalInfoByCourseSessionAndEntryType($reqCourse, trim($selectedSession), trim($selectedEntryType))->result();
                            if (sizeof($studentInfo)) {
                                $studentFatherName = $this->StudentManagement->getStudentFatherInfoBy($studentInfo[0]->tspi_id)->result()[0]->tfbi_name;
                                $studentBCDocId = $this->DocumentManagement->getDocumentByFlag("BC")->result()[0]->doc_id;
                                for ($i = 0; $i < sizeof($studentInfo); $i++) {
                                    $thisRecord = $studentInfo[$i];
                                    $bcInfo = $this->DocumentInfoManagement->getIssuedDocumentInfoBy($studentBCDocId, $thisRecord->tspi_id)->result();
                                    if (sizeof($bcInfo)) {
                                        for ($j = 0; $j < sizeof($bcInfo); $j++) {
                                            array_push($bcReport, array(
                                                'stu_id' => $thisRecord->tspi_id,
                                                'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                                'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                                'stu_name' => stripslashes($thisRecord->tspi_name),
                                                'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                                'stu_father_name' => stripslashes($studentFatherName),
                                                'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                                'stu_status' => $thisRecord->tspi_status,
                                                'stu_course' => stripslashes($thisRecord->course_name),
                                                'stu_session' => stripslashes($thisRecord->session_name),
                                                'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                                'is_bc_issued' => true,
                                                'is_bc_duplicate' => "-",
                                                'bc_id' => $bcInfo[$j]->tdii_id,
                                                'bc_issue_date' => date("d-m-Y", strtotime($bcInfo[$j]->tdii_doc_issued_on)),
                                                'bc_sr_no' => stripslashes($bcInfo[$j]->tdii_doc_unique_code),
                                                'bc_issued_by' => stripslashes($bcInfo[$j]->issuedByAdmin)
                                            ));
                                        }
                                    } else {
                                        array_push($bcReport, array(
                                            'stu_id' => $thisRecord->tspi_id,
                                            'stu_roll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_rollNumber) ? "-" : stripslashes($thisRecord->tspi_rollNumber),
                                            'stu_enroll_number' => ($thisRecord->tspi_form_no == $thisRecord->tspi_enrollment_no) ? "-" : stripslashes($thisRecord->tspi_enrollment_no),
                                            'stu_name' => stripslashes($thisRecord->tspi_name),
                                            'stu_gender' => stripslashes($thisRecord->tspi_gender),
                                            'stu_father_name' => stripslashes($studentFatherName),
                                            'stu_dob' => date("d-m-Y", strtotime($thisRecord->tspi_dob)),
                                            'stu_status' => $thisRecord->tspi_status,
                                            'stu_course' => stripslashes($thisRecord->course_name),
                                            'stu_session' => stripslashes($thisRecord->session_name),
                                            'stu_entry_type' => stripslashes($thisRecord->tcsm_course_type),
                                            'is_bc_issued' => false,
                                            'is_bc_duplicate' => "-",
                                            'bc_id' => 0,
                                            'bc_issue_date' => "NA",
                                            'bc_sr_no' => "NA",
                                            'bc_issued_by' => "NA"
                                        ));
                                    }
                                }
                            } else {
                                $this->session->set_flashdata('errorMessage', "No Students Exists In The Selected Course/Session.");
                            }
                        }
                    }
                } else {
                    $bcReport = array();
                }
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['selectedPattern'] = $selectedPattern;
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['bcReport'] = $bcReport;
            $this->load->view('admin/reports/student/bcReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentAchievementReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedAchievementSession = trim($this->input->post("achvSession"));
                $selectedAchievementHead = trim($this->input->post("achvHead"));
                $filteredRecords = $this->AchievementManagement->getStudentAchievementReport($selectedCourse, $selectedSession, $selectedEntryType, $selectedAchievementSession, $selectedAchievementHead)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('O', 'C'))->result();
            $viewData['achievementHeads'] = $this->AchievementManagement->getNonDeletedActiveAchievementHeads('S')->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/student/studentAchievementReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentSemesterYearReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedCourse = "";
            $selectedSession = "";
            $selectedEntryType = "";
            $selectedStatus = "";
            $filteredRecords = array();
            $colHeads = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedStatus = trim($this->input->post("stuStatus"));
                if ($selectedCourse == "") {
                    $this->session->set_flashdata('errorMessage', "Course Selection Is Mandatory To Fetch Report.");
                } else if ($selectedSession == "") {
                    $this->session->set_flashdata('errorMessage', "Please Select Session.");
                } else {
                    $studentsList = $this->StudentManagement->getStudentMiscellaneousReport('', $selectedCourse, $selectedSession, $selectedEntryType, '', '', '', '', '', '', '', '', '', $selectedStatus)->result();
                    $courseInfo = $this->CourseManagement->getCoursesBy($selectedCourse)->result()[0];
                    $course_time_mgmt_flag = ($courseInfo->course_time_mgmt_flag == 'Y') ? "Yr." : "Sem.";
                    if (sizeof($studentsList)) {
                        $sem_year_start_from = $studentsList[0]->tcsm_sem_start_from;
                        for ($head = $sem_year_start_from; $head <= $courseInfo->course_no_of_sems; $head++) {
                            array_push($colHeads, $head . " " . $course_time_mgmt_flag);
                        }
                        $tspi_ids = array();
                        for ($i = 0; $i < sizeof($studentsList); $i++) {
                            array_push($tspi_ids, $studentsList[$i]->tspi_id);
                        }
                        $allStudentsSemesterInfo = $this->StudentManagement->getSemesterInfoOfStudentsBy($tspi_ids)->result();
                        if (sizeof($allStudentsSemesterInfo)) {
                            for ($i = 0; $i < sizeof($studentsList); $i++) {
                                $sem_or_year_marks = array();
                                $totalObtainedMarks = 0;
                                $totalMaxMarks = 0;
                                for ($j = $sem_year_start_from; $j <= $courseInfo->course_no_of_sems; $j++) {
                                    $ifFound = 0;
                                    for ($k = 0; $k < sizeof($allStudentsSemesterInfo); $k++) {
                                        if (($allStudentsSemesterInfo[$k]->tspi_id == $studentsList[$i]->tspi_id) && ($allStudentsSemesterInfo[$k]->tssi_semester == $j)) {
                                            $totalObtainedMarks += $allStudentsSemesterInfo[$k]->tssi_marks_obt;
                                            $totalMaxMarks += $allStudentsSemesterInfo[$k]->tssi_max_marks;
                                            array_push($sem_or_year_marks, $allStudentsSemesterInfo[$k]->tssi_marks_obt . "/" . $allStudentsSemesterInfo[$k]->tssi_max_marks);
                                            $ifFound = 1;
                                            break;
                                        }
                                    }
                                    if (!$ifFound) {
                                        array_push($sem_or_year_marks, "-");
                                    }
                                }
                                $thisArray = array(
                                    'tspi_id' => $studentsList[$i]->tspi_id,
                                    'tspi_rollNumber' => ($studentsList[$i]->tspi_rollNumber == $studentsList[$i]->tspi_form_no) ? "-" : "<a href='" . site_url("admin/Student/viewStudent/" . $studentsList[$i]->tspi_id) . "' target='_blank'>" . stripslashes($studentsList[$i]->tspi_rollNumber) . "</a>",
                                    'tspi_name' => "<a href='" . site_url("admin/Student/viewStudent/" . $studentsList[$i]->tspi_id) . "' target='_blank'>" . stripslashes($studentsList[$i]->tspi_name) . "</a>",
                                    'course_name' => stripslashes($studentsList[$i]->course_name),
                                    'session' => stripslashes($studentsList[$i]->session_name),
                                    'entry_type' => stripslashes($studentsList[$i]->tcsm_course_type),
                                    'tspi_status' => stripslashes($studentsList[$i]->status_text),
                                    'sem_year_marks' => $sem_or_year_marks,
                                    'grand_total' => ($totalMaxMarks == 0) ? "-" : $totalObtainedMarks . "/" . $totalMaxMarks,
                                    'percentage' => ($totalMaxMarks != 0) ? round((($totalObtainedMarks / $totalMaxMarks) * 100), 2) . "%" : "-"
                                );
                                array_push($filteredRecords, $thisArray);
                            }
                        } else {
                            $sem_or_year_marks = array();
                            for ($i = $sem_year_start_from; $i <= $courseInfo->course_no_of_sems; $i++) {
                                array_push($sem_or_year_marks, "-");
                            }
                            for ($i = 0; $i < sizeof($studentsList); $i++) {
                                $thisArray = array(
                                    'tspi_id' => $studentsList[$i]->tspi_id,
                                    'tspi_rollNumber' => ($studentsList[$i]->tspi_rollNumber == $studentsList[$i]->tspi_form_no) ? "-" : "<a href='" . site_url("admin/Student/viewStudent/" . $studentsList[$i]->tspi_id) . "' target='_blank'>" . stripslashes($studentsList[$i]->tspi_rollNumber) . "</a>",
                                    'tspi_name' => "<a href='" . site_url("admin/Student/viewStudent/" . $studentsList[$i]->tspi_id) . "' target='_blank'>" . stripslashes($studentsList[$i]->tspi_name) . "</a>",
                                    'course_name' => stripslashes($studentsList[$i]->course_name),
                                    'session' => stripslashes($studentsList[$i]->session_name),
                                    'entry_type' => stripslashes($studentsList[$i]->tcsm_course_type),
                                    'tspi_status' => stripslashes($studentsList[$i]->status_text),
                                    'sem_year_marks' => $sem_or_year_marks,
                                    'grand_total' => '-',
                                    'percentage' => '-',
                                );
                                array_push($filteredRecords, $thisArray);
                            }
                        }
                    }
                }
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('O', 'C'))->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['tableColumnFeeHeads'] = $colHeads;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/student/studentSemesterYearReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function studentScholarshipReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedAppliedForSession = trim($this->input->post("appliedForSession"));
                $selectedDeleteStatus = trim($this->input->post("schDeleteStatus"));
                $filteredRecords = $this->ScholarshipManagement->getStudentScholarshipReport($selectedCourse, $selectedSession, $selectedEntryType, $selectedAppliedForSession, $selectedDeleteStatus)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('O', 'C'))->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/student/studentScholarshipReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    /* Request Handlers For Staff & Related Reports */

    public function staffReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSubDept = "";
            $selectedDesig = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $empCodeId = trim($this->input->post("empCodeId"));
                $empFirstName = trim($this->input->post("empFirstName"));
                $empLastName = trim($this->input->post("empLastName"));
                $selectedEmpGender = trim($this->input->post("empGender"));
                $selectedDept = trim($this->input->post("empDept"));
                $selectedSubDept = trim($this->input->post("empSubDept"));
                $selectedDesigCat = trim($this->input->post("empDesigCat"));
                $selectedDesig = trim($this->input->post("empDesig"));
                $selectedUGCNETStatus = trim($this->input->post("empUGCNETStatus"));
                $selectedPHDStatus = trim($this->input->post("empPHDStatus"));
                $selectedAppntType = trim($this->input->post("empAppType"));
                $selectedStartDate = (trim($this->input->post("startDate")) == "") ? "" : date("Y-m-d 00:00:00", strtotime(str_replace('/', '-', trim($this->input->post("startDate")))));
                $selectedEndDate = (trim($this->input->post("endDate")) == "") ? "" : date("Y-m-d 23:59:59", strtotime(str_replace('/', '-', trim($this->input->post("endDate")))));
                $selectedRangeAppliedWith = (trim($this->input->post("dateRangeAppliedWith")) == "") ? "" : trim($this->input->post("dateRangeAppliedWith"));
                $filteredRecords = $this->StaffManagement->getStaffMiscellaneousReport($empCodeId, $empFirstName, $empLastName, $selectedEmpGender, $selectedDept, $selectedSubDept, $selectedDesigCat, $selectedDesig, $selectedUGCNETStatus, $selectedPHDStatus, $selectedAppntType, $selectedStartDate, $selectedEndDate, $selectedRangeAppliedWith)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['departments'] = $this->DepartmentManagement->getActiveNonDeletedDepartments()->result();
            $viewData['desigCategories'] = $this->DesignationManagement->getActiveNonDeletedDesignationCategories()->result();
            $viewData['selectedSubDepartment'] = $selectedSubDept;
            $viewData['selectedDesignation'] = $selectedDesig;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/staff/staffReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function staffAchievementReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSubDept = "";
            $selectedDesig = "";
            $selectedEmp = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedDept = trim($this->input->post("empDept"));
                $selectedSubDept = trim($this->input->post("empSubDept"));
                $selectedDesigCat = trim($this->input->post("empDesigCat"));
                $selectedDesig = trim($this->input->post("empDesig"));
                $selectedSession = trim($this->input->post("session"));
                $selectedAchievementHead = (trim($this->input->post("achvHead")));
                $filteredRecords = $this->AchievementManagement->getStaffAchievementReport($selectedDept, $selectedSubDept, $selectedDesigCat, $selectedDesig, $selectedSession, $selectedAchievementHead)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('O', 'C'))->result();
            $viewData['achievementHeads'] = $this->AchievementManagement->getNonDeletedActiveAchievementHeads('E')->result();
            $viewData['departments'] = $this->DepartmentManagement->getActiveNonDeletedDepartments()->result();
            $viewData['desigCategories'] = $this->DesignationManagement->getActiveNonDeletedDesignationCategories()->result();
            $viewData['selectedSubDepartment'] = $selectedSubDept;
            $viewData['selectedDesignation'] = $selectedDesig;
            $viewData['selectedEmployee'] = $selectedEmp;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/staff/staffAchievementReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    /* Request Handlers For Staff Reports */

    /* Request Handlers For Staff Leave Report */

    public function leaveReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedSubDept = "";
            $selectedDesig = "";
            $selectedEmployee = "";
            $filteredRecords = array();
            $leaveFilteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedSession = trim($this->input->post("appliedForSession"));
                $selectedLeaveType = trim($this->input->post("leaveType"));
                $selectedStatus = trim($this->input->post("leaveStatus"));
                $selectedStartDate = (trim($this->input->post("startDate")) == "") ? "" : date("Y-m-d 00:00:00", strtotime(str_replace('/', '-', trim($this->input->post("startDate")))));
                $selectedEndDate = (trim($this->input->post("endDate")) == "") ? "" : date("Y-m-d 23:59:59", strtotime(str_replace('/', '-', trim($this->input->post("endDate")))));
                $selectedRangeAppliedWith = trim($this->input->post("dateRangeAppliedWith"));
                $selectedDept = trim($this->input->post("empDept"));
                $selectedSubDept = trim($this->input->post("empSubDept"));
                $selectedDesigCat = trim($this->input->post("empDesigCat"));
                $selectedDesig = trim($this->input->post("empDesig"));
                $selectedGender = trim($this->input->post("empGender"));
                $selectedEmployee = trim($this->input->post("employee"));
                $leaveFilteredRecords = $this->LeaveManagement->getAppliedLeaveReport($selectedEmployee, $selectedDept, $selectedSubDept, $selectedDesigCat, $selectedDesig, $selectedGender, $selectedLeaveType, $selectedSession, $selectedStartDate, $selectedEndDate, $selectedRangeAppliedWith, $selectedStatus)->result();
            }
            for ($i = 0; $i < sizeof($leaveFilteredRecords); $i++) {
                $adminActionBy = "-";
                if ($leaveFilteredRecords[$i]->slm_admin_updated_by != "" || $leaveFilteredRecords[$i]->slm_admin_updated_by != NULL) {
                    $adminInfo = $this->StaffManagement->getEmployeeInfoBy($leaveFilteredRecords[$i]->slm_admin_updated_by)->result()[0];
                    $adminActionBy = (stripslashes($adminInfo->tprfl_firstname . " " . $adminInfo->tprfl_lastname)) . " On " . date("d-m-Y h:i:s A", strtotime($leaveFilteredRecords[$i]->slm_admin_update_on));
                }
                array_push($filteredRecords, array(
                    'slm_id' => $leaveFilteredRecords[$i]->slm_id,
                    'smember_id' => $leaveFilteredRecords[$i]->smember_id,
                    'smember_code' => ($leaveFilteredRecords[$i]->smember_code == "") ? "-" : stripslashes($leaveFilteredRecords[$i]->smember_code),
                    'tprfl_firstname' => stripslashes($leaveFilteredRecords[$i]->tprfl_firstname),
                    'tprfl_lastname' => stripslashes($leaveFilteredRecords[$i]->tprfl_lastname),
                    'sub_dept_name' => stripslashes($leaveFilteredRecords[$i]->sub_dept_name),
                    'dept_name' => stripslashes($leaveFilteredRecords[$i]->dept_name),
                    'dcm_short_name' => stripslashes($leaveFilteredRecords[$i]->dcm_short_name),
                    'desig_name' => stripslashes($leaveFilteredRecords[$i]->desig_name),
                    'slm_from' => date("d-m-Y", strtotime($leaveFilteredRecords[$i]->slm_from)),
                    'slm_to' => date("d-m-Y", strtotime($leaveFilteredRecords[$i]->slm_to)),
                    'slm_no_of_days' => $leaveFilteredRecords[$i]->slm_no_of_days,
                    'tltm_name' => $leaveFilteredRecords[$i]->tltm_name,
                    'tltm_short_name' => $leaveFilteredRecords[$i]->tltm_short_name,
                    'slm_duration' => $leaveFilteredRecords[$i]->slm_duration,
                    'slm_status' => $leaveFilteredRecords[$i]->slm_status,
                    'slm_admin_remark_by' => $adminActionBy,
                    'slm_admin_remark_on' => ($leaveFilteredRecords[$i]->slm_admin_updated_by == "" || $leaveFilteredRecords[$i]->slm_admin_updated_by == NULL) ? "-" : date("d-m-Y h:i:s A", strtotime($leaveFilteredRecords[$i]->slm_admin_update_on)),
                    'slm_admin_remark' => ($leaveFilteredRecords[$i]->slm_admin_updated_by == "" || $leaveFilteredRecords[$i]->slm_admin_updated_by == NULL) ? "-" : stripslashes($leaveFilteredRecords[$i]->slm_admin_remarks),
                ));
            }
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('O', 'C'))->result();
            $viewData['leaveTypes'] = $this->LeaveManagement->getNonDeletedActiveLeaveTypes()->result();
            $viewData['departments'] = $this->DepartmentManagement->getActiveNonDeletedDepartments()->result();
            $viewData['desigCategories'] = $this->DesignationManagement->getActiveNonDeletedDesignationCategories()->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedSubDepartment'] = $selectedSubDept;
            $viewData['selectedDesignation'] = $selectedDesig;
            $viewData['selectedEmployee'] = $selectedEmployee;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/leave/leaveReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    /* Request Handlers For Staff Leave Report */

    /* Request Handlers For Inventory & Payment Related Reports */

    public function pendingPayments() {
        if ($this->sessionvalidator->isLoggedIn()) {
            $viewData['pendingPayments'] = $this->StockAndPurchaseManagement->pendingPaymentsReport()->result();
            $this->load->view('admin/reports/stockAndInventory/pendingPaymentsReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function issuedStock() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $viewData['purchaseHeads'] = $this->InventoryManagement->getNonDeletedActivePurchaseHeads()->result();
            $viewData['allPurchases'] = $this->StockAndPurchaseManagement->getAllPurchases()->result();
            $viewData['inventoryCategories'] = $this->InventoryManagement->getAllNonDeletedActiveInventoryCategories()->result();
            $viewData['allItems'] = $this->StockAndPurchaseManagement->getAllPurchaseItems()->result();
            $viewData['issuedStocks'] = $this->StockAndPurchaseManagement->issuedStocksReport()->result();
            $viewData['departments'] = $this->DepartmentManagement->getActiveNonDeletedDepartments()->result();
            $viewData['locations'] = $this->LocationManagement->getNonDeletedActiveLocations()->result();
            $viewData['selectedSubDepartment'] = "";
            $viewData['selectedEmployee'] = "";
            $viewData['selectedAsset'] = "";
            if (isset($_POST['filterSubmitBtn'])) {
                $reqPurchaseHead = trim($this->input->post("pHead"));
                $reqInvoice = trim($this->input->post("invoice"));
                $reqDepartment = trim($this->input->post("dept"));
                $reqSubDepartment = trim($this->input->post("subDept"));
                $reqEmployee = trim($this->input->post('emp'));
                $reqInventoryCategory = trim($this->input->post("invCategory"));
                $reqAssetItem = trim($this->input->post("itemAssets"));
                $reqLocation = trim($this->input->post("location"));
                $reqStartDate = (trim($this->input->post("startIssueDate")) == "") ? "" : date("Y-m-d", strtotime(str_replace('/', '-', trim($this->input->post("startIssueDate")))));
                $reqEndDate = (trim($this->input->post("endIssueDate")) == "") ? "" : date("Y-m-d", strtotime(str_replace('/', '-', trim($this->input->post("endIssueDate")))));
                $reqUIDOrSrNo = trim($this->input->post("uidOrSrNo"));
                $viewData['selectedSubDepartment'] = $reqSubDepartment;
                $viewData['selectedEmployee'] = $reqEmployee;
                $viewData['issuedStocks'] = $this->StockAndPurchaseManagement->issuedStocksReport($reqUIDOrSrNo, $reqPurchaseHead, $reqInvoice, $reqDepartment, $reqSubDepartment, $reqEmployee, $reqInventoryCategory, $reqLocation, $reqAssetItem, $reqStartDate, $reqEndDate)->result();
                $this->load->view('admin/reports/stockAndInventory/issuedStockReport', $viewData);
            } else {
                $this->load->view('admin/reports/stockAndInventory/issuedStockReport', $viewData);
            }
        } else {
            redirect("admin/");
        }
    }

    public function stockVerificationReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $viewData['purchaseHeads'] = $this->InventoryManagement->getNonDeletedActivePurchaseHeads()->result();
            $viewData['allPurchases'] = $this->StockAndPurchaseManagement->getAllPurchases()->result();
            $viewData['inventoryCategories'] = $this->InventoryManagement->getAllNonDeletedActiveInventoryCategories()->result();
            $viewData['allItems'] = $this->StockAndPurchaseManagement->getAllPurchaseItems()->result();
            $viewData['verifiedStocks'] = array();
            $viewData['departments'] = $this->DepartmentManagement->getActiveNonDeletedDepartments()->result();
            $viewData['locations'] = $this->LocationManagement->getNonDeletedActiveLocations()->result();
            $viewData['verificationTitle'] = $this->StockAndPurchaseManagement->getNonDeletedActiveVerificationTitles()->result();
            $viewData['pageTitle'] = "Verified Stock/Item Report";
            $viewData['selectedSubDepartment'] = "";
            $viewData['selectedEmployee'] = "";
            if (isset($_POST['filterSubmitBtn'])) {
                $reqVerificationTitle = trim($this->input->post('verificationTitle'));
                if ($reqVerificationTitle != "") {
                    $reqPurchaseHead = trim($this->input->post("pHead"));
                    $reqInvoice = trim($this->input->post("invoice"));
                    $reqDepartment = trim($this->input->post("dept"));
                    $reqSubDepartment = trim($this->input->post("subDept"));
                    $reqEmployee = trim($this->input->post('emp'));
                    $reqInventoryCategory = trim($this->input->post("invCategory"));
                    $reqAssetItem = trim($this->input->post("itemAssets"));
                    $reqLocation = trim($this->input->post("location"));
                    $reqStartDate = (trim($this->input->post("startIssueDate")) == "") ? "" : date("Y-m-d", strtotime(str_replace('/', '-', trim($this->input->post("startIssueDate")))));
                    $reqEndDate = (trim($this->input->post("endIssueDate")) == "") ? "" : date("Y-m-d", strtotime(str_replace('/', '-', trim($this->input->post("endIssueDate")))));
                    $reqUIDOrSrNo = trim($this->input->post("uidOrSrNo"));
                    $viewData['selectedSubDepartment'] = $reqSubDepartment;
                    $viewData['selectedEmployee'] = $reqEmployee;
                    $viewData['pageTitle'] = stripslashes($this->StockAndPurchaseManagement->getVerificationTitleInfoBy($reqVerificationTitle)->result()[0]->svtm_name);
                    $viewData['verifiedStocks'] = $this->StockAndPurchaseManagement->verifiedStocksReport($reqVerificationTitle, $reqUIDOrSrNo, $reqPurchaseHead, $reqInvoice, $reqDepartment, $reqSubDepartment, $reqEmployee, $reqInventoryCategory, $reqLocation, $reqAssetItem, $reqStartDate, $reqEndDate)->result();
                    $this->session->set_flashdata('errorMessage', NULL);
                    $this->load->view('admin/reports/stockAndInventory/verifiedStockReport', $viewData);
                } else {
                    $this->session->set_flashdata('errorMessage', "Please Select Verification Title To Fetch Report.");
                    $this->load->view('admin/reports/stockAndInventory/verifiedStockReport', $viewData);
                }
            } else {
                $this->load->view('admin/reports/stockAndInventory/verifiedStockReport', $viewData);
            }
        } else {
            redirect("admin/");
        }
    }

    /* Request Handlers For Inventory & Payment Related Reports */

    /* Request Handlers For Attendance Related Report */

    public function attendanceReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $viewData['sessions'] = $this->SessionManagement->getNonDeletedActiveSessions()->result();
            $allotedCourse = $this->AllotmentManagement->getAllCourseAllotment($this->session->userdata("adminData")['smember_id'])->result();
            if (sizeof($allotedCourse)) {
                $viewData['courses'] = $allotedCourse;
            } else {
                $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            }
            $viewData["selectedCourse"] = "";
            $viewData["selectedSession"] = "";
            $viewData["selectedSemester"] = "";
            $viewData["selectedFrom"] = "";
            $viewData["selectedTo"] = "";
            $attendanceReportArray = array();
            if (isset($_POST["filterAttendanceBtn"])) {
                $session = $this->input->post("session");
                $course = $this->input->post("subjectCourse");
                $semester = $this->input->post("subjectCourseSemOrYear");
                $from = $this->input->post("from");
                $to = $this->input->post("to");
                $viewData["selectedCourse"] = $course;
                $viewData["selectedSession"] = $session;
                $viewData["selectedSemester"] = $semester;
                $viewData["selectedFrom"] = $from;
                $viewData["selectedTo"] = $to;
                $allDistinctAllottedSubjectToStudent = $this->SubjectManagement->getDistinctSubjectBy($semester, $course, $session)->result();
                $viewData["selectedCourseDetail"] = $this->CourseManagement->getCoursesBy($course)->result()[0];
                $viewData["selectedSessionDetails"] = $this->SessionManagement->getSessionInfoBy($session)->result()[0];
                if (sizeof($allDistinctAllottedSubjectToStudent)) {
                    $studentsSemesterWise = $this->StudentManagement->getAllEnrolledStudentsForSetAllotmentBy($course, $semester)->result();
                    for ($i = 0; $i < sizeof($studentsSemesterWise); $i++) {
                        $student = $studentsSemesterWise[$i];
                        $totalClassAttendedInSemester = 0;
                        $totalClassHeldInSemester = 0;
                        $subjectWiseAttendanceDetails = array();
                        for ($j = 0; $j < sizeof($allDistinctAllottedSubjectToStudent); $j++) {
                            $sub = $allDistinctAllottedSubjectToStudent[$j];
                            $teacherSubjectStudentAllotmentDetails = $this->SubjectManagement->getTeacherSubjectStudentAllotementDetailsBy($sub->sm_id, $student->tspi_id, $session)->result()[0];
                            $totalClasses = $this->AttendanceManagement->getTotalClasesCountBy($teacherSubjectStudentAllotmentDetails->sta_id, ($from == "" || $from == null ) ? "" : date('Y-m-d', strtotime(str_replace('/', '-', $from))), ($to == "" || $to == null ) ? "" : date('Y-m-d', strtotime(str_replace('/', '-', $to))))->result()[0];
                            $presentCount = $this->AttendanceManagement->getTotalAttendanceOfStudentBy($teacherSubjectStudentAllotmentDetails->stta_id, ($from == "" || $from == null ) ? "" : date('Y-m-d', strtotime(str_replace('/', '-', $from))), ($to == "" || $to == null ) ? "" : date('Y-m-d', strtotime(str_replace('/', '-', $to))))->result()[0];
                            $subjectWiseAttendanceArray = array(
                                'presentCount' => $presentCount->present_count,
                                'total_class_held' => $totalClasses->total_classes
                            );
                            array_push($subjectWiseAttendanceDetails, $subjectWiseAttendanceArray);
                            $totalClassAttendedInSemester = $totalClassAttendedInSemester + $presentCount->present_count;
                            $totalClassHeldInSemester = $totalClassHeldInSemester + $totalClasses->total_classes;
                        }
                        $studentData = array(
                            'tspi_name' => $student->tspi_name,
                            'tspi_rollNumber' => $student->tspi_enrollment_no,
                            'avgPercent' => ($totalClassHeldInSemester == 0 || $totalClassAttendedInSemester == 0) ? 0 : ceil(($totalClassAttendedInSemester / $totalClassHeldInSemester) * 100),
                            'subjectWiseAttendanceDetails' => $subjectWiseAttendanceDetails
                        );

                        array_push($attendanceReportArray, $studentData);
                    }
                }
                $viewData["subjects"] = $allDistinctAllottedSubjectToStudent;
                $viewData["attendanceData"] = $attendanceReportArray;
                $this->load->view("admin/reports/academics/attendanceReport", $viewData);
            } else {
                $viewData["selectedCourseDetail"] = "";
                $viewData["selectedSessionDetails"] = "";
                $viewData["attendanceData"] = array();
                $viewData["subjects"] = array();
                $this->load->view("admin/reports/academics/attendanceReport", $viewData);
            }
        } else {
            redirect("admin/");
        }
    }

    /* Request Hanlders For Fee Related Reports */

    public function miscellaneousFeeReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $reqFormEnrlRoll = trim($this->input->post("stuFormEnrlRoll"));
                $reqReceiptNo = trim($this->input->post("receiptNo"));
                $selectedMode = trim($this->input->post("paymentMode"));
                $selectedFeeHead = trim($this->input->post("feeHead"));
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedCollectedForSession = trim($this->input->post("collectionForSession"));
                $selectedOperator = trim($this->input->post("stuEntryOprtr"));
                $selectedStartDate = (trim($this->input->post("entryStartDate")) == "") ? "" : date("Y-m-d 00:00:00", strtotime(str_replace('/', '-', trim($this->input->post("entryStartDate")))));
                $selectedEndDate = (trim($this->input->post("entryEndDate")) == "") ? "" : date("Y-m-d 23:59:59", strtotime(str_replace('/', '-', trim($this->input->post("entryEndDate")))));
                $selectedRangeAppliedWith = (trim($this->input->post("entryDateRangeAppliedWith")) == "") ? "" : trim($this->input->post("entryDateRangeAppliedWith"));
                $filteredRecords = $this->FeeManagement->getMiscellaneousFeeReport($reqReceiptNo, $reqFormEnrlRoll, $selectedMode, $selectedFeeHead, $selectedCourse, $selectedSession, $selectedEntryType, $selectedCollectedForSession, $selectedOperator, $selectedStartDate, $selectedEndDate, $selectedRangeAppliedWith)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['feeHeads'] = $this->FeeManagement->getNonDeletedFeeHeads()->result();
            $viewData['feeModes'] = $this->FeeManagement->getNonDeletedActiveFeeModes()->result();
            $viewData['operators'] = $this->StaffManagement->getAllDistinctFeeEntryOperators()->result();
            $viewData['collectionSessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('C', 'N'))->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/fee/feeMiscellaneousReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function miscellaneousDefaulterReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedPattern = "";
            $selectedSession = "";
            $selectedEntryType = "";
            $selectedSemester = "";
            $filteredRecords = array();
            $colHeads = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedSemester = trim($this->input->post("stuSemester"));
                $reqFormEnrlRoll = trim($this->input->post("stuFormEnrlRoll"));
                $selectedFeeHead = trim($this->input->post("feeHead"));
                if ($selectedCourse == "") {
                    $this->session->set_flashdata('errorMessage', "Please Select Any Course.");
                } else if ($selectedSession == "") {
                    $this->session->set_flashdata('errorMessage', "Please Select Any Session.");
                } else if ($selectedEntryType == "") {
                    $this->session->set_flashdata('errorMessage', "Please Select Any Entry Type.");
                } else if ($selectedSemester == "") {
                    $this->session->set_flashdata('errorMessage', "Please Select Any Semester/Year.");
                } else {
                    $this->session->set_flashdata('errorMessage', NULL);
                    if ($selectedFeeHead != "") {
                        $applicableStructureForHeads = $this->FeeManagement->getFeeStructureInfoBy($selectedFeeHead, $selectedSession, $selectedEntryType, $selectedSemester)->result();
                    } else {
                        $applicableStructureForHeads = $this->FeeManagement->getFeeStructureForFeePaymentBy($selectedSession, $selectedEntryType, $selectedSemester)->result();
                    }
                    for ($head = 0; $head < sizeof($applicableStructureForHeads); $head++) {
                        array_push($colHeads, stripslashes($applicableStructureForHeads[$head]->fhm_name));
                    }
                    $enrolledStudentInCourse = $this->StudentManagement->getEnrolledStudentPersonalInfoByCourseSessionAndEntryType($selectedCourse, $selectedSession, $selectedEntryType, $reqFormEnrlRoll)->result();
                    for ($i = 0; $i < sizeof($enrolledStudentInCourse); $i++) {
                        $dueFeeDetails = array();
                        $isCounsellingFeeAdjusted = FALSE;
                        /* Getting Student Wise Structure */
                        if ($selectedFeeHead != "") {
                            $applicableStructure = $this->FeeManagement->getFeeStructureDetailsOfStudentBy($enrolledStudentInCourse[$i]->tspi_id, $selectedFeeHead, $selectedSession, $selectedEntryType, $selectedSemester)->result();
                        } else {
                            $applicableStructure = $this->FeeManagement->getFeeStructureOfStudentForFeePaymentBy($enrolledStudentInCourse[$i]->tspi_id, $selectedSession, $selectedEntryType, $selectedSemester)->result();
                        }
                        /* Getting Student Wise Structure */
                        if (sizeof($applicableStructure)) {
                            $cousellingFeeInfo = $this->FeeManagement->getPaidCouncellingFeeDetailsByStudent($enrolledStudentInCourse[$i]->tspi_id)->result();
                            for ($j = 0; $j < sizeof($applicableStructure); $j++) {
                                $paidFeeDetails = $this->FeeManagement->getPaidFeeDetailsByStructure($enrolledStudentInCourse[$i]->tspi_id, $selectedSemester, $applicableStructure[$j]->fssm_id)->result();
                                if (sizeof($paidFeeDetails)) {
                                    $paidAmount = 0.0;
                                    for ($k = 0; $k < sizeof($paidFeeDetails); $k++) {
                                        $paidAmount += $paidFeeDetails[$k]->fcm_amount;
                                    }
                                    if (sizeof($cousellingFeeInfo) && ($isCounsellingFeeAdjusted == FALSE)) {
                                        if ($applicableStructure[$j]->fhm_type == "R") {
                                            array_push($dueFeeDetails, array(
                                                'fee_head' => stripslashes($applicableStructure[$j]->fhm_name),
                                                'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-",
                                                'paid_amount' => "<i class='fa fa-inr'></i>" . $paidAmount . "/- + <i class='fa fa-inr'></i>" . $cousellingFeeInfo[0]->fcnm_amount . "/- (C.F.)",
                                                'due_amount' => "<i class='fa fa-inr'></i>" . round((($applicableStructure[$j]->fssm_amount) - $paidAmount), 2) . "/-"
                                            ));
                                            $isCounsellingFeeAdjusted = TRUE;
                                        } else {
                                            array_push($dueFeeDetails, array(
                                                'fee_head' => stripslashes($applicableStructure[$j]->fhm_name),
                                                'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-",
                                                'paid_amount' => "<i class='fa fa-inr'></i>" . $paidAmount . "/-",
                                                'due_amount' => "<i class='fa fa-inr'></i>" . round((($applicableStructure[$j]->fssm_amount) - $paidAmount), 2) . "/-"
                                            ));
                                        }
                                    } else {
                                        array_push($dueFeeDetails, array(
                                            'fee_head' => stripslashes($applicableStructure[$j]->fhm_name),
                                            'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-",
                                            'paid_amount' => "<i class='fa fa-inr'></i>" . $paidAmount . "/-",
                                            'due_amount' => "<i class='fa fa-inr'></i>" . round((($applicableStructure[$j]->fssm_amount) - $paidAmount), 2) . "/-"
                                        ));
                                    }
                                } else {
                                    if (sizeof($cousellingFeeInfo) && ($isCounsellingFeeAdjusted == FALSE)) {
                                        if ($applicableStructure[$j]->fhm_type == "R") {
                                            array_push($dueFeeDetails, array(
                                                'fee_head' => stripslashes($applicableStructure[$j]->fhm_name),
                                                'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-",
                                                'paid_amount' => "<i class='fa fa-inr'></i>" . $cousellingFeeInfo[0]->fcnm_amount . "/- (C.F.)",
                                                'due_amount' => "<i class='fa fa-inr'></i>" . round((($applicableStructure[$j]->fssm_amount) - $cousellingFeeInfo[0]->fcnm_amount), 2) . "/-"
                                            ));
                                            $isCounsellingFeeAdjusted = TRUE;
                                        } else {
                                            array_push($dueFeeDetails, array(
                                                'fee_head' => stripslashes($applicableStructure[$j]->fhm_name),
                                                'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-",
                                                'paid_amount' => "<i class='fa fa-inr'></i>" . 0.0 . "/-",
                                                'due_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-"
                                            ));
                                        }
                                    } else {
                                        array_push($dueFeeDetails, array(
                                            'fee_head' => stripslashes($applicableStructure[$j]->fhm_name),
                                            'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-",
                                            'paid_amount' => "<i class='fa fa-inr'></i>" . 0.0 . "/-",
                                            'due_amount' => "<i class='fa fa-inr'></i>" . $applicableStructure[$j]->fssm_amount . "/-"
                                        ));
                                    }
                                }
                            }
                        } else {
                            for ($j = 0; $j < sizeof($applicableStructureForHeads); $j++) {
                                array_push($dueFeeDetails, array(
                                    'fee_head' => stripslashes($applicableStructureForHeads[$j]->fhm_name),
                                    'app_amount' => "<i class='fa fa-inr'></i>" . $applicableStructureForHeads[$j]->fsm_amount . "/-",
                                    'paid_amount' => "<i class='fa fa-inr'></i>" . 0.0 . "/-",
                                    'due_amount' => "<i class='fa fa-inr'></i>" . $applicableStructureForHeads[$j]->fsm_amount . "/-"
                                ));
                            }
                        }
                        $stuFatherName = $this->StudentManagement->getStudentFatherInfoBy($enrolledStudentInCourse[$i]->tspi_id)->result()[0]->tfbi_name;
                        array_push($filteredRecords, array(
                            'stu_id' => $enrolledStudentInCourse[$i]->tspi_id,
                            'stu_form_no' => "<a href='" . site_url("admin/Student/viewStudent/" . $enrolledStudentInCourse[$i]->tspi_id) . "' target='_blank'>" . stripslashes($enrolledStudentInCourse[$i]->tspi_form_no) . "</a>",
                            'stu_enroll_no' => ($enrolledStudentInCourse[$i]->tspi_enrollment_no == $enrolledStudentInCourse[$i]->tspi_form_no) ? "-" : "<a href='" . site_url("admin/Student/viewStudent/" . $enrolledStudentInCourse[$i]->tspi_id) . "' target='_blank'>" . stripslashes($enrolledStudentInCourse[$i]->tspi_enrollment_no) . "</a>",
                            'stu_roll_no' => ($enrolledStudentInCourse[$i]->tspi_rollNumber == $enrolledStudentInCourse[$i]->tspi_form_no) ? "-" : "<a href='" . site_url("admin/Student/viewStudent/" . $enrolledStudentInCourse[$i]->tspi_id) . "' target='_blank'>" . stripslashes($enrolledStudentInCourse[$i]->tspi_rollNumber) . "</a>",
                            'stu_name' => "<a href='" . site_url("admin/Student/viewStudent/" . $enrolledStudentInCourse[$i]->tspi_id) . "' target='_blank'>" . stripslashes($enrolledStudentInCourse[$i]->tspi_name) . "</a>",
                            'stu_father_name' => stripslashes($stuFatherName),
                            'stu_course' => stripslashes($enrolledStudentInCourse[$i]->course_name),
                            'stu_session' => stripslashes($enrolledStudentInCourse[$i]->session_name),
                            'stu_entry_type' => stripslashes($enrolledStudentInCourse[$i]->tcsm_course_type),
                            'fee_due_for' => ($enrolledStudentInCourse[$i]->course_time_mgmt_flag == 'Y') ? $selectedSemester . " Year" : $selectedSemester . " Sem.",
                            'due_fee_details' => $dueFeeDetails
                        ));
                    }
                }
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['feeHeads'] = $this->FeeManagement->getNonDeletedFeeHeads()->result();
            $viewData['tableColumnFeeHeads'] = $colHeads;
            $viewData['selectedPattern'] = $selectedPattern;
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['selectedSemester'] = $selectedSemester;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/fee/feeMiscellaneousDefaulterReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function feeReimbursementReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCollectedForSession = trim($this->input->post("collectionForSession"));
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedReceiptStatus = trim($this->input->post("frmStatus"));
                $selectedRmbStatus = trim($this->input->post("rmbStatus"));
                $filteredRecords = $this->FeeManagement->getReimbursementCounsellingFeeReport($selectedCollectedForSession, $selectedCourse, $selectedReceiptStatus, $selectedRmbStatus)->result();
            }
            $viewData['collectionSessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('C', 'N'))->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/fee/feeReimbursementReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    /* Request Handlers For Hostel Fee Reports And Related Stuffs */

    public function miscellaneousHostelFeeReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $reqFormEnrlRoll = trim($this->input->post("stuFormEnrlRoll"));
                $reqReceiptNo = trim($this->input->post("receiptNo"));
                $selectedMode = trim($this->input->post("paymentMode"));
                $selectedFeeHead = trim($this->input->post("feeHead"));
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedCollectedForSession = trim($this->input->post("collectionForSession"));
                $selectedOperator = trim($this->input->post("stuEntryOprtr"));
                $selectedStartDate = (trim($this->input->post("entryStartDate")) == "") ? "" : date("Y-m-d 00:00:00", strtotime(str_replace('/', '-', trim($this->input->post("entryStartDate")))));
                $selectedEndDate = (trim($this->input->post("entryEndDate")) == "") ? "" : date("Y-m-d 23:59:59", strtotime(str_replace('/', '-', trim($this->input->post("entryEndDate")))));
                $selectedRangeAppliedWith = (trim($this->input->post("entryDateRangeAppliedWith")) == "") ? "" : trim($this->input->post("entryDateRangeAppliedWith"));
                $filteredRecords = $this->FeeManagement->getMiscellaneousHostelFeeReport($reqReceiptNo, $reqFormEnrlRoll, $selectedMode, $selectedFeeHead, $selectedCourse, $selectedSession, $selectedEntryType, $selectedCollectedForSession, $selectedOperator, $selectedStartDate, $selectedEndDate, $selectedRangeAppliedWith)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['feeHeads'] = $this->FeeManagement->getNonDeletedOptionalFeeHeadsBy('H')->result();
            $viewData['feeModes'] = $this->FeeManagement->getNonDeletedActiveFeeModes()->result();
            $viewData['operators'] = $this->StaffManagement->getAllDistinctFeeEntryOperators()->result();
            $viewData['collectionSessions'] = $this->SessionManagement->getNonDeletedActiveSessions(array('C', 'N'))->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/fee/feeMiscellaneousHostelReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    public function miscellaneousHostelFeeDefaulterReport() {
        if ($this->sessionvalidator->isLoggedIn() && $this->sessionvalidator->isAccessGranted()) {
            $selectedPattern = "";
            $selectedSession = "";
            $selectedEntryType = "";
            $selectedSemester = "";
            $filteredRecords = array();
            $colHeads = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post("stuCourse"));
                $selectedSession = trim($this->input->post("stuSession"));
                $selectedEntryType = trim($this->input->post("stuEntryType"));
                $selectedSemester = trim($this->input->post("stuSemester"));
                $reqFormEnrlRoll = trim($this->input->post("stuFormEnrlRoll"));
                $selectedFeeHead = trim($this->input->post("feeHead"));
                $filteredRecords = $this->FeeManagement->getHostelFeeDefaulterLIst($reqFormEnrlRoll, $selectedFeeHead, $selectedEntryType, $selectedSession, $selectedCourse)->result();
            }

            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['feeHeads'] = $this->FeeManagement->getNonDeletedOptionalFeeHeadsBy('H')->result();
            $viewData['tableColumnFeeHeads'] = $colHeads;
            $viewData['selectedPattern'] = $selectedPattern;
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['selectedSemester'] = $selectedSemester;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/fee/feeMiscellaneousHostelDefaulterReport', $viewData);
        } else {
            redirect("admin/");
        }
    }

    /* Request Hanlders For Course Profile Report & Related Stuffs */

    public function courseProfileReport() {
        if ($this->sessionvalidator->isLoggedIn()) {
            $selectedSession = "";
            $selectedEntryType = "";
            $selectedSemOrYear = "";
            $filteredRecords = array();
            if (isset($_POST['filterSubmitBtn'])) {
                $selectedCourse = trim($this->input->post('course'));
                $selectedSession = trim($this->input->post('session'));
                $selectedEntryType = trim($this->input->post('entryType'));
                $selectedSemOrYear = trim($this->input->post('semOrYear'));
                $filteredRecords = $this->CourseManagement->getCourseProfilesReport($selectedCourse, $selectedSession, $selectedEntryType, $selectedSemOrYear)->result();
            }
            $viewData['branches'] = $this->BranchManagement->getAllNonDeletedActiveBrances()->result();
            $viewData['courses'] = $this->CourseManagement->getActiveAndNonDeletedCourses()->result();
            $viewData['selectedSession'] = $selectedSession;
            $viewData['selectedEntryType'] = $selectedEntryType;
            $viewData['selectedSemOrYear'] = $selectedSemOrYear;
            $viewData['filteredRecords'] = $filteredRecords;
            $this->load->view('admin/reports/academics/viewCourseProfiles', $viewData);
        } else {
            redirect("admin/");
        }
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit