D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
admission
/
application
/
models
/
admin
/
Filename :
ReportManagement.php
back
Copy
<?php /** * Description of ReportManagement * * @author Softpro India Pvt. Ltd */ class ReportManagement extends CI_Model { function getAllAdmissionFormsWithDetails($formno = '', $formStatus = '', $startDate = '', $endDate = '', $course = '', $session_id = '') { $this->db->select("*,TFBIM.tfbi_name as mother,TFBI.tfbi_name as father"); $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 sess", "sess.session_id=univ.session_id"); $this->db->join("transaction_mst ad", "ad.regno=tspi.tspi_id"); $this->db->join('tbl_family_background_info TFBI', "TFBI.tfbi_mapping_id=tspi.tspi_id"); $this->db->join('tbl_relation_master TRM', 'TFBI.tfbi_relation = TRM.rel_id'); $this->db->join('tbl_family_background_info TFBIM', "TFBIM.tfbi_mapping_id=tspi.tspi_id"); $this->db->join('tbl_relation_master TRMM', 'TFBIM.tfbi_relation = TRMM.rel_id'); $this->db->where("TFBIM.tfbi_user_type_flag", "S"); $this->db->where("TFBIM.tfbi_designation", "NA"); $this->db->where("TFBIM.tfbi_organization", "NA"); $this->db->where("TRMM.rel_code", 1); $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); if ($formno != '') { $this->db->where("tspi.tspi_form_no", $formno); } if ($course != '') { $this->db->where("c.course_id", $course); } if ($formStatus != '') { $this->db->where("ad.status", $formStatus); } if ($startDate != '' && $endDate != '') { $this->db->where("tspi.tspi_added_on BETWEEN '" . $startDate . "' AND '" . $endDate . "'"); } if ($startDate == '' && $endDate != '') { $this->db->where("tspi.tspi_added_on <= '" . $endDate . "'"); } if ($startDate != '' && $endDate == '') { $this->db->where("tspi.tspi_added_on >= '" . $startDate . "'"); } if ($session_id != '') { $this->db->where("sess.session_id ",$session_id); } $this->db->order_by("tspi.tspi_added_on","DESC"); return $this->db->get(); } }