diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 5914596d..8e0915a0 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -1265,12 +1265,17 @@ class Fees_status_model extends CI_Model * created by kms * */ public function updateRegistrationDetails($details=null,$feesStatusID=null){ + + + $regId=''; $this->db->select('Student_Fee_Status_Id,RegistrationMode'); $this->db->where('CourseID', $details['CourseID']); $this->db->where('StudentID', $details['StudentID']); $checkCourseFees=$this->db->get(REGISTRATIONDETAILS); if($checkCourseFees->num_rows()<=0){ // insert registration details table + + // $regId= $feesStatusID; $inserRegistartion['Student_Fee_Status_Id']=$feesStatusID; $inserRegistartion['BatchCode']=$details['BatchCode']; $inserRegistartion['StudentID']=$details['StudentID']; @@ -1281,7 +1286,8 @@ class Fees_status_model extends CI_Model $inserRegistartion['BranchCode']=$details['BranchCode']; $inserRegistartion['CreatedBy']=$details['CreatedBy']; $inserRegistartion['CreatedOn']=$details['CreatedOn']; - $this->db->insert(REGISTRATIONDETAILS, $inserRegistartion); + $getlastid= $this->db->insert(REGISTRATIONDETAILS, $inserRegistartion); + } else if($checkCourseFees->num_rows()>=1){ @@ -1294,7 +1300,13 @@ class Fees_status_model extends CI_Model $updateRegistration['UpdatedBy']=$details['CreatedBy']; $updateRegistration['UpdatedOn']=$details['CreatedOn']; $this->db->where('Student_Fee_Status_Id',$feesStatusID); - $this->db->update(REGISTRATIONDETAILS, $updateRegistration); + $getlastid= $this->db->update(REGISTRATIONDETAILS, $updateRegistration); + + + // $regId= $feesStatusID; + + + } else{ $reRegistartion['Student_Fee_Status_Id']=$feesStatusID; @@ -1307,9 +1319,65 @@ class Fees_status_model extends CI_Model $reRegistartion['BranchCode']=$details['BranchCode']; $reRegistartion['CreatedBy']=$details['CreatedBy']; $reRegistartion['CreatedOn']=$details['CreatedOn']; - $this->db->insert(REGISTRATIONDETAILS, $reRegistartion); + $getlastid= $this->db->insert(REGISTRATIONDETAILS, $reRegistartion); + + // $regId= $feesStatusID; } } + +$REGID=''; + if($getlastid) + { + $this->db->select('max(ID) as ID'); + $this->db->from('T_Registration_Details'); + $getmaxID= $this->db->get(); + $maxID = $getmaxID->result(); + + //print_r($maxID); + + foreach($maxID as $ma) + { + $REGID = $ma->ID; + } + + + } + + +// print_r($getlastid); +// die(); + $this->db->select('ListCode'); + $this->db->from('T_PickListDetails'); + $this->db->where('ListName','EXPECTED'); + $this->db->where('BranchCode',$details['BranchCode']); + + $searchDetails = $this->db->get(); + $getId=$searchDetails->result(); + + $listcode=''; + + foreach($getId as $ge) + { + $listcode=$ge->ListCode; + } + + + + + $fromd= date("d-m-Y",strtotime($details['CreatedOn'])); + + $upappform['BranchCode']=$details['BranchCode']; + $upappform['AppFormDate']=$fromd; + $upappform['Registration_Details_ID']=$REGID; + $upappform['ListCode']=$listcode; + $upappform['CreatedBy']=$details['CreatedBy']; + $upappform['CreatedOn']=$details['CreatedOn']; + $upappform['Comments']='Fees for the student has been set'; + $this->db->insert('T_ApplicationFormStatus', $upappform); + + + + return true; } /*