D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
cas
/
application
/
models
/
admin
/
Filename :
ScholarshipManagement.php
back
Copy
<?php /** * Model Class For Handling All DB Operations Related To Student Scholarship Info * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class ScholarshipManagement extends CI_Model { function createNewScholarshipEntry(array $newScholarshipInfo) { $this->db->insert('student_scholarship_mst', $newScholarshipInfo); return $this->db->insert_id(); } function getAllScholarshipsBy($tspi_id) { $this->db->select('*'); $this->db->from('student_scholarship_mst SSM'); $this->db->join('tbl_session_master TSM', 'SSM.session_id = TSM.session_id'); $this->db->join('tbl_student_personal_info TSPI', 'SSM.tspi_id = TSPI.tspi_id'); $this->db->where('SSM.ssm_delete_status', "F"); $this->db->where('SSM.tspi_id', $tspi_id); $this->db->order_by('SSM.ssm_added_on', "desc"); return $this->db->get(); } function getScholarshipInfoBy($reg_no) { $this->db->select('*'); $this->db->from('student_scholarship_mst'); $this->db->where('ssm_reg_no', $reg_no); return $this->db->get(); } function getScholarshipInfoById($ssm_id) { $this->db->select('*'); $this->db->from('student_scholarship_mst'); $this->db->where('ssm_id', $ssm_id); return $this->db->get(); } function isRegisrationNoSafeUpdate($ssm_Id, $reg_no) { $this->db->select("*"); $this->db->from('student_scholarship_mst'); $this->db->where('ssm_reg_no', $reg_no); $this->db->where('ssm_id != ' . $ssm_Id); $result = $this->db->get()->result(); if (sizeof($result)) { return FALSE; } else { return TRUE; } } function getStudentScholarshipReport($course = '', $session = '', $entryType = '', $appliedForSession = '', $schDeleteStatus = '') { $this->db->select("*,TSMSSM.session_name appliedForSession, TSM.session_name enrollSession"); $this->db->from('student_scholarship_mst SSM'); $this->db->join('tbl_session_master TSMSSM', 'SSM.session_id = TSMSSM.session_id'); $this->db->join('tbl_student_personal_info TSPI', 'SSM.tspi_id = TSPI.tspi_id'); $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'); /* Course Wise Filter */ if ($course != '') { $this->db->where("TCM.course_id", $course); } /* Course Wise Filter */ /* Session Wise Filter */ if ($session != '') { $this->db->where("TSM.session_id", $session); } /* Session Wise Filter */ /* Entry Type Wise Filter */ if ($entryType != '') { $this->db->where("TSPI.ucs_map_id", $entryType); } /* Entry Type Wise Filter */ /* Session Wise Filter */ if ($appliedForSession != '') { $this->db->where("SSM.session_id", $appliedForSession); } /* Session Wise Filter */ /* Scholarship Record Delete Status Wise Filter */ if ($schDeleteStatus != '') { $this->db->where("SSM.ssm_delete_status", $schDeleteStatus); } /* Scholarship Record Delete Status Wise Filter */ return $this->db->get(); } function updateScholarshipInfo(array $scholarshipUpdatedInfo) { $this->db->where('ssm_id', $scholarshipUpdatedInfo['ssm_id']); return $this->db->update('student_scholarship_mst', $scholarshipUpdatedInfo); } }