controller and model changes fo fees compare
This commit is contained in:
parent
c04b4483b0
commit
a557f99528
@ -32,6 +32,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller {
|
||||
// Configure limits on our controller methods
|
||||
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
|
||||
$this->methods['receiveEnrolmentFromUniv_post']['limit'] = 500; // 500 requests per hour per user/key
|
||||
$this->methods['formIDFeeCompareDetails_post']['limit'] = 500;
|
||||
// load the model
|
||||
$this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model');
|
||||
|
||||
@ -98,6 +99,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
public function getStudentUnivFeeCompareDetails_post(){
|
||||
|
||||
$searchData = $this->post('search');
|
||||
|
||||
$univID = $searchData['University'];
|
||||
@ -120,4 +122,29 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* get form id bases get fees comparsion details
|
||||
* created by kms
|
||||
* */
|
||||
public function formIDFeeCompareDetails_post(){
|
||||
$formData['FormID'] = $this->post('formId');;
|
||||
$formData['EnrolmentNo'] = $this->post('enrolmentId');;
|
||||
|
||||
$getDetails = $this->receive_model->getFormIDFeeDetails($formData);
|
||||
if ($getDetails['Status']=true)
|
||||
{
|
||||
$getDetails['status'] =REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($getDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'Something went wrong.please try again!',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -779,4 +779,93 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
|
||||
}
|
||||
return $resultArr;
|
||||
}
|
||||
/*
|
||||
* form id bases get fees compare details
|
||||
* created by kms
|
||||
* */
|
||||
public function getFormIDFeeDetails($serachForm=null){
|
||||
// create array for find sem value
|
||||
$keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4');
|
||||
$valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4");
|
||||
if($serachForm['FormID']!=''){
|
||||
$this->db->select("ENU.FormID,ENU.SemesterYear,STC.StudentID,STC.BranchID,CF.ID,CF.ProgramType,CF.Sem_Year,FFRU.Amount as UniversityPaidAmount");
|
||||
$this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU');
|
||||
$this->db->join(STUDENTCOURSE.' as STC', 'STC.EnrollmentID = ENU.EnrolmentNo');
|
||||
$this->db->join(COURSE_FEES.' as CF', 'CF.CourseID = STC.CourseID');
|
||||
$this->db->join(FORMFEESRECEIVEDFROMUNIV.' as FFRU', 'FFRU.FormID = ENU.FormID');
|
||||
$this->db->where('ENU.FormID',$serachForm['FormID']);
|
||||
$this->db->where('ENU.EnrolmentNo',$serachForm['EnrolmentNo']);
|
||||
$studentCourseDetails = $this->db->get();
|
||||
|
||||
//this is for sem year type check fees
|
||||
if($studentCourseDetails->num_rows()>1){
|
||||
foreach ($studentCourseDetails->result() as $fetchRow){
|
||||
$serachKey= array_search(strtoupper($fetchRow->Sem_Year),$keyArray);
|
||||
if($valueArray[$serachKey]==$fetchRow->SemesterYear){
|
||||
$this->db->select("SUM(BillAMount) as StudentPaidAmount");
|
||||
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
|
||||
$this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID');
|
||||
$this->db->where('SFS.FeesType',$fetchRow->ID);
|
||||
$this->db->where('SFP.IsActive','1');
|
||||
$feesDetails = $this->db->get()->last_row();
|
||||
if($feesDetails){
|
||||
$feesArray['Status']=true;
|
||||
$feesArray['Message']="Fees paid both student and university";
|
||||
$feesArray['Type']=$fetchRow->Sem_Year;
|
||||
$feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount;
|
||||
$feesArray['StudentPaidAmount']=$feesDetails->StudentPaidAmount;
|
||||
break;
|
||||
}
|
||||
else{
|
||||
$feesArray['Status']=true;
|
||||
$feesArray['Message']="University fees paid and student fees pending";
|
||||
$feesArray['Type']=$fetchRow->Sem_Year;
|
||||
$feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount;
|
||||
$feesArray['StudentPaidAmount']=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if($studentCourseDetails->num_rows()==1){
|
||||
foreach ($studentCourseDetails->result() as $fetchRow){
|
||||
$this->db->select("SUM(BillAMount) as StudentPaidAmount");
|
||||
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
|
||||
$this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID');
|
||||
$this->db->where('SFS.FeesType',$fetchRow->ID);
|
||||
$this->db->where('SFP.IsActive','1');
|
||||
$feesDetails = $this->db->get()->last_row();
|
||||
if($feesDetails){
|
||||
$feesArray['Status']=true;
|
||||
$feesArray['Message']="Fees paid both student and university";
|
||||
$feesArray['Type']=$fetchRow->Sem_Year;
|
||||
$feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount;
|
||||
$feesArray['StudentPaidAmount']=$feesDetails->StudentPaidAmount;
|
||||
break;
|
||||
}
|
||||
else{
|
||||
$feesArray['Status']=true;
|
||||
$feesArray['Message']="University fees paid and student fees pending";
|
||||
$feesArray['Type']=$fetchRow->Sem_Year;
|
||||
$feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount;
|
||||
$feesArray['StudentPaidAmount']=0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
$feesArray['Status']=false;
|
||||
$feesArray['Message']="Student record is mismatch because of enrolment number is not registered in student course details";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
$feesArray['Status']=false;
|
||||
$feesArray['Message']="Please check form id";
|
||||
}
|
||||
return $feesArray;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user