diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index b02c55bd..782a3037 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -144,8 +144,7 @@ class Fees_Status_Controller extends REST_Controller { $detailsChild['CreatedBy'] = $this->post('createdBy'); $detailsChild['CreatedOn'] = $now->format('Y-m-d H:i:s'); $detailsChild['UpdatedBy'] = $this->post('requestedBranch'); - - $updateDetails = $this->Fees_model->updateFees($detailsChild);// Check if the users data store contains users (in case the database result returns NULL) + $updateDetails = $this->Fees_model->updateFees($detailsChild,$this->post('courseID'));// Check if the users data store contains users (in case the database result returns NULL) if ($updateDetails) { $updateDetails['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 37aca292..b1d85fbd 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -406,10 +406,6 @@ class Fees_status_model extends CI_Model $feesPaidDetails['UpdatedBy'] = $getStudentBranch[0]->BranchID; } - - // $this->entryForAllStatus($feesPaidDetails,$courseID); - // die(); - $this->db->select('BillNO'); $this->db->where('UpdatedBy', $feesPaidDetails['UpdatedBy']); @@ -457,6 +453,7 @@ class Fees_status_model extends CI_Model } // Entry for all status screen except fees + $this->entryForAllStatus($feesPaidDetails,$courseID); @@ -1565,37 +1562,126 @@ class Fees_status_model extends CI_Model * */ public function entryForAllStatus($feesDetails=null,$courseID=null){ $singleFeesDetails=["SEM1","SEM2","SEM3","SEM4","SEM5","SEM6","SEM7","SEM8"]; - $this->db->select('SFS.FeesID'); - $this->db->from(STUDENTS_FEES_PAID.' as SFP'); - $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId'); - $this->db->where('SFS.CourseID',$courseID); - $this->db->where('SFS.StudentID',$feesDetails['StudentID']); - $existDetails = $this->db->get(); - if($existDetails->result()){ - return true; - } - else{ - $this->db->select('ID,FeesType,ProgramType'); - $this->db->where('CourseID',$courseID); - $getFeesTypeDetails = $this->db->get(COURSE_FEES); + // get pick list expected status + $this->db->select('ListCode,ListName'); + $this->db->where('ListName','EXPECTED'); + $this->db->where('IsActive','1'); + $existStatusDetails = $this->db->get(PICK_LIST_DETAILS)->last_row(); + if($existStatusDetails){ + //check if exist + $this->db->select('SFS.FeesID,SFS.FeesType'); + $this->db->from(STUDENTS_FEES_PAID.' as SFP'); + $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId'); + $this->db->where('SFS.CourseID',$courseID); + $this->db->where('SFS.StudentID',$feesDetails['StudentID']); + $this->db->where('SFP.FeesId',$feesDetails['FeesId']); + $existDetails = $this->db->get(); + if($existDetails->num_rows()>1){ + return true; + } + else{ + $fetchData = $existDetails->result(); + if($fetchData[0]->FeesType!=PC AND $fetchData[0]->FeesType!=DC AND $fetchData[0]->FeesType!=TC AND $fetchData[0]->FeesType!=MC AND $fetchData[0]->FeesType!=OTHER) { + $this->db->select('SFS.FeesType,CF.Sem_Year,CF.ProgramType'); + $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); + $this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); + $this->db->where('SFS.CourseID',$courseID); + $this->db->where('SFS.StudentID',$feesDetails['StudentID']); + $this->db->where('SFS.FeesID',$feesDetails['FeesId']); + $getFeesTypeDetails = $this->db->get(); + + if($getFeesTypeDetails->result()){ + $insertDetails=array(); + + foreach ($getFeesTypeDetails->result() as $row){ + + // this array for study material and answer booklet update + $insertStudyBook['StudentID']=$feesDetails['StudentID']; + $insertStudyBook['CourseID']=$row->FeesType; + $insertStudyBook['BranchCode']=$feesDetails['UpdatedBy']; + $insertStudyBook['ListCode']=$existStatusDetails->ListCode; + $insertStudyBook['Comments']=$feesDetails['CommentsForStudent']; + $insertStudyBook['Coursedetail']=$feesDetails['StudentID']; + $insertStudyBook['CreatedBy']=$feesDetails['CreatedBy']; + $insertStudyBook['CreatedOn']=$feesDetails['CreatedOn']; + // this array for mark card updates + $insertMark['StudentID']=$feesDetails['StudentID']; + $insertMark['CourseID']=$row->FeesType; + $insertMark['BranchCode']=$feesDetails['UpdatedBy']; + $insertMark['ListCode']=$existStatusDetails->ListCode; + $insertMark['Comments']=$feesDetails['CommentsForStudent']; + $insertMark['Coursedetail']=$feesDetails['StudentID']; + $insertMark['CreatedBy']=$feesDetails['CreatedBy']; + $insertMark['CreatedOn']=$feesDetails['CreatedOn']; + $insertMark['CertificationType']="MARK CARD"; + + if($row->ProgramType==REGULARFEES OR $row->ProgramType==LATERALFEES){ + foreach ($singleFeesDetails as $Fees){ + + $insertStudyBook['Sem']=$Fees; + // insert study material details + $this->db->insert(STUDY_MATERIAL_STATUS, $insertStudyBook); + // insert answer booklet details + $this->db->insert(ANSWER_BOOKLET, $insertStudyBook); + + // insert mark card details + $insertMark['Sem']=$Fees; + $this->db->insert(CERTIFICATION_STATUS, $insertMark); + } + + + } + else{ + $insertStudyBook['Sem']=$row->Sem_Year; + // insert study material details + $this->db->insert(STUDY_MATERIAL_STATUS, $insertStudyBook); + // insert answer booklet details + $this->db->insert(ANSWER_BOOKLET, $insertStudyBook); + // insert mark card details + $insertMark['Sem']=$row->Sem_Year; + $this->db->insert(CERTIFICATION_STATUS, $insertMark); + + } + + } + + } + } + + else{ + $this->db->select('CertificationID'); + $this->db->where('CertificateName',$fetchData[0]->FeesType); + $this->db->where('IsActive','1'); + $getEndFeesDetails = $this->db->get(CERTIFICATION_MASTER)->last_row(); + if($getEndFeesDetails){ + // this array for document update + $insertDocs['StudentID']=$feesDetails['StudentID']; + $insertDocs['CourseID']=$courseID; + $insertDocs['BranchCode']=$feesDetails['UpdatedBy']; + $insertDocs['ListCode']=$existStatusDetails->ListCode; + $insertDocs['Comments']=$feesDetails['CommentsForStudent']; + $insertDocs['CreatedBy']=$feesDetails['CreatedBy']; + $insertDocs['CreatedOn']=$feesDetails['CreatedOn']; + $insertDocs['CertificationType']=$getEndFeesDetails->CertificationID; + // insert application details + $this->db->insert(APPLICATION_STATUS,$insertDocs); + + } - if($getFeesTypeDetails->result()){ - foreach ($getFeesTypeDetails->result() as $row){ - if($row->ProgramType==REGULARFEES OR $row->ProgramType==LATERALFEES){ - $insertDetails['StudentID']=$feesDetails['StudentID']; - $insertDetails['CourseID']=$row->ID; - $insertDetails['BranchCode']=""; - $insertDetails['ListCode']=""; - $insertDetails['StudentID']=""; - } } + + } + return true; } + else{ + return false; + } } diff --git a/Apollo/assets/views/student/studentView.html b/Apollo/assets/views/student/studentView.html index 1e253e7c..2731765f 100755 --- a/Apollo/assets/views/student/studentView.html +++ b/Apollo/assets/views/student/studentView.html @@ -196,7 +196,7 @@ - +
@@ -208,7 +208,7 @@

{{course.UniversityName}} / {{course.CourseName}}

--> -

{{course.UniversityName}}

+

{{course.UniversityName}}

@@ -253,6 +253,7 @@ Fees Name + Batch Session From/Session To Session Roll Number @@ -267,7 +268,11 @@ - {{fees.FeesName}} + {{fees.FeesName}} + + + {{fees.BatchName}} ({{fees.BatchDate}}) + {{fees.SessionName}}/{{fees.ToSessionName}} {{fees.SessionName}} @@ -382,7 +387,7 @@ {{cert.CertificateName}} - {{cert.ListName}}   ON   {{cert.AppDate}} + {{cert.ListName}}   ON   {{cert.AppDate}} {{cert.Comments}} @@ -428,7 +433,7 @@ {{mark.CertificateName}} --> - {{mark.ListName}}   ON   {{mark.CDate}} + {{mark.ListName}}   ON   {{mark.CDate}} {{mark.Comments}} @@ -448,7 +453,7 @@ {{mark.CertificateName}} --> - {{mark.ListName}}   ON   {{mark.CDate}} + {{mark.ListName}}   ON    {{mark.CDate}} {{mark.Comments}} @@ -492,7 +497,7 @@ - {{study.ListName}}   ON   {{study.SDate}} + {{study.ListName}}   ON   {{study.SDate}} {{study.Comments}} @@ -507,7 +512,7 @@ - {{study.ListName}}   ON   {{study.SDate}} + {{study.ListName}}   ON    {{study.SDate}} {{study.Comments}}