From 1be9249ef40a9457241f1c80a9ebe9a8b05d0374 Mon Sep 17 00:00:00 2001 From: Sanjeev Date: Sat, 12 Dec 2020 17:56:19 +0530 Subject: [PATCH] setFeesForStudent : ps --- .../controllers/Fees_Status_Controller.php | 1 - .../application/models/Fees_status_model.php | 180 +++++++++--------- .../api/application/models/Student_model.php | 15 +- .../application/models/Studentview_model.php | 5 + .../views/student/studentDetailsModal.html | 33 ++-- 5 files changed, 123 insertions(+), 111 deletions(-) diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index 3ced61b3..e3b7c6e8 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -255,7 +255,6 @@ class Fees_Status_Controller extends REST_Controller { $details['BranchCode'] = $this->post('branchCode'); $details['Comments'] = $this->post('comments'); $jsonInstallmenData = $this->post('installmentItems'); - //print_r($details); $updateDetails = $this->Fees_model->setFees($details,$jsonInstallmenData);// Check if the users data store contains users (in case the database result returns NULL) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 565e202e..72353937 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -1196,38 +1196,34 @@ class Fees_status_model extends CI_Model * */ public function setFees($details=null,$jsonData=null){ - // echo 'i am Here'; + // echo 'Set Fee Function ** '; // print_r($details); // print_r($jsonData); - // die(); + $RollNo= $details['RollNo']; + //Existing Or Not using RollNo + if($RollNo !='') + { - if($RollNo !='') - { + $this->db->select('*'); + $this->db->from('T_Students_Fees_Status'); + $this->db->where('RollNo',$RollNo); + $this->db->where('CourseID',$details['CourseID']); + $this->db->where('StudentID !=',$details['StudentID']); + $qry=$this->db->get(); + $qry=$qry->result(); -$this->db->select('*'); -$this->db->from('T_Students_Fees_Status'); -$this->db->where('RollNo',$RollNo); -$this->db->where('CourseID',$details['CourseID']); -$this->db->where('StudentID !=',$details['StudentID']); -$qry=$this->db->get(); -$qry=$qry->result(); + if(count($qry)>0) + { + $result['setStatus'] = false; + $result['message'] = "RollNo Already Exists"; -//print_r($this->db->last_query());die(); -//echo count($qry);die(); + return $result; -if(count($qry)>0) -{ - $result['setStatus'] = false; - $result['message'] = "RollNo Already Exists"; - - return $result; - - -} -} + } + } @@ -1236,6 +1232,13 @@ if(count($qry)>0) $this->db->where('StudentID', $details['StudentID']); $this->db->where('FeesType', $details['FeesType']); $checkExist=$this->db->get(STUDENTS_FEES_STATUS); + $checkwithstatus = count($checkExist->result())<=0; + + // select cf.Sem_Year + // from T_Students_Fees_Status sfs + // left join T_Course_Fees_Details cf on sfs.CourseID = cf.CourseID + // where sfs.StudentID = 4101 and cf.CourseID = 22 and cf.ID =748; + // If $checkExist->result() has value means Updating the Details. No Value means Inserting (in else part) if($checkExist->result()){ $feesId = $checkExist->result(); $updateDetails['CourseFees'] = $details['CourseFees']; @@ -1285,6 +1288,7 @@ if(count($qry)>0) } else{ + $this->db->insert(STUDENTS_FEES_STATUS, $details); $this->db->select('FeesID,BatchCode,StudentID,CourseID,FeesType'); @@ -1331,45 +1335,42 @@ if(count($qry)>0) } -$fromd= date("d-m-Y",strtotime($details['CreatedOn'])); + $fromd= date("d-m-Y",strtotime($details['CreatedOn'])); + if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['FeesType']=='MC')|| ($details['FeesType'] == 'DC')) + { -if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['FeesType']=='MC') - || ($details['FeesType'] == 'DC')) -{ + $this->db->select('ListCode'); + $this->db->from('T_PickListDetails'); + $this->db->where('ListName','EXPECTED'); + $this->db->where('BranchCode',$details['BranchCode']); - $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(); - $searchDetails = $this->db->get(); - $getId=$searchDetails->result(); + $listcode=''; - $listcode=''; + foreach($getId as $ge) + { + $listcode=$ge->ListCode; + } - // Expected Remove because mentioned ON Apollo XL sheet(30.11.2020) - // foreach($getId as $ge) - // { - // $listcode=$ge->ListCode; - // } - - $appstatus['StudentID'] = $details['StudentID']; - $appstatus['CourseID'] = $details['CourseID']; - $appstatus['BranchCode'] = $details['BranchCode']; - $appstatus['ListCode'] = $listcode; - $appstatus['AppDate'] = $fromd; - $appstatus['Comments'] = 'Fees for the student has been set'; - $appstatus['CreatedBy']= $details['CreatedBy']; - $appstatus['CreatedOn'] = $details['CreatedOn']; - $appstatus['CertificationType'] =$details['FeesType']; - $this->db->insert('T_ApplicationStatus', $appstatus); + $appstatus['StudentID'] = $details['StudentID']; + $appstatus['CourseID'] = $details['CourseID']; + $appstatus['BranchCode'] = $details['BranchCode']; + $appstatus['ListCode'] = $listcode; + $appstatus['AppDate'] = $fromd; + $appstatus['Comments'] = 'Fees for the student has been set'; + $appstatus['CreatedBy']= $details['CreatedBy']; + $appstatus['CreatedOn'] = $details['CreatedOn']; + $appstatus['CertificationType'] =$details['FeesType']; + $this->db->insert('T_ApplicationStatus', $appstatus); - } + } // update registration details if($jsonData){ - $this->updateRegistrationDetails($details,$installmentFeesID); + $this->updateRegistrationDetails($details,$installmentFeesID,$checkwithstatus); } return $result; @@ -1379,7 +1380,7 @@ if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['Fe * insert registration details while set fees * created by kms * */ - public function updateRegistrationDetails($details=null,$feesStatusID=null){ + public function updateRegistrationDetails($details=null,$feesStatusID=null,$checkwithstatus=null){ $regId=''; @@ -1387,21 +1388,28 @@ if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['Fe $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']; - $inserRegistartion['CourseID']=$details['CourseID']; - $inserRegistartion['FeeType']=$details['FeesType']; - $inserRegistartion['RegistrationMode']=1; - $inserRegistartion['RegistrationType']=NEWREGISTRATION_CONST; - $inserRegistartion['BranchCode']=$details['BranchCode']; - $inserRegistartion['CreatedBy']=$details['CreatedBy']; - $inserRegistartion['CreatedOn']=$details['CreatedOn']; - $getlastid= $this->db->insert(REGISTRATIONDETAILS, $inserRegistartion); + // $sql = "select cf.Sem_Year + // from T_Students_Fees_Status sfs + // left join T_Course_Fees_Details cf on sfs.CourseID = cf.CourseID + // where sfs.StudentID = ? and cf.CourseID = ? and cf.ID = ?" ; + // $late = $this->db->query($sql); + + 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']; + $inserRegistartion['CourseID']=$details['CourseID']; + $inserRegistartion['FeeType']=$details['FeesType']; + $inserRegistartion['RegistrationMode']=1; + $inserRegistartion['RegistrationType']=NEWREGISTRATION_CONST; + $inserRegistartion['BranchCode']=$details['BranchCode']; + $inserRegistartion['CreatedBy']=$details['CreatedBy']; + $inserRegistartion['CreatedOn']=$details['CreatedOn']; + $getlastid= $this->db->insert(REGISTRATIONDETAILS, $inserRegistartion); } @@ -1415,32 +1423,30 @@ if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['Fe $updateRegistration['UpdatedBy']=$details['CreatedBy']; $updateRegistration['UpdatedOn']=$details['CreatedOn']; $this->db->where('Student_Fee_Status_Id',$feesStatusID); - $getlastid= $this->db->update(REGISTRATIONDETAILS, $updateRegistration); + $getlastid= $this->db->update(REGISTRATIONDETAILS, $updateRegistration); - // $regId= $feesStatusID; - - - + // $regId= $feesStatusID; } else{ + $reRegistartion['Student_Fee_Status_Id']=$feesStatusID; $reRegistartion['BatchCode']=$details['BatchCode']; $reRegistartion['StudentID']=$details['StudentID']; $reRegistartion['CourseID']=$details['CourseID']; $reRegistartion['FeeType']=$details['FeesType']; - $reRegistartion['RegistrationMode']=0; - $reRegistartion['RegistrationType']=RE_REGISTRATION_CONST; + $reRegistartion['RegistrationMode']= ($checkwithstatus!=0) ? 1 : 0; + $reRegistartion['RegistrationType']= ($checkwithstatus!=0) ? NEWREGISTRATION_CONST : RE_REGISTRATION_CONST ; $reRegistartion['BranchCode']=$details['BranchCode']; $reRegistartion['CreatedBy']=$details['CreatedBy']; $reRegistartion['CreatedOn']=$details['CreatedOn']; - $getlastid= $this->db->insert(REGISTRATIONDETAILS, $reRegistartion); + $getlastid= $this->db->insert(REGISTRATIONDETAILS, $reRegistartion); // $regId= $feesStatusID; } } -$REGID=''; + $REGID=''; if($getlastid) { $this->db->select('max(ID) as ID'); @@ -1459,11 +1465,6 @@ $REGID=''; } -// print_r($getlastid); - - - // echo 'in'; -// die(); $this->db->select('ListCode'); $this->db->from('T_PickListDetails'); $this->db->where('ListName','EXPECTED'); @@ -1472,17 +1473,16 @@ $REGID=''; $searchDetails = $this->db->get(); $getId=$searchDetails->result(); - $listcode=''; - - foreach($getId as $ge) - { - $listcode=$ge->ListCode; - } - + // $listcode=''; + // Expected Remove because mentioned ON Apollo XL sheet(30.11.2020) + // foreach($getId as $ge) + // { + // $listcode=$ge->ListCode; + // } + $listcode=null; - - $fromd= date("d-m-Y",strtotime($details['CreatedOn'])); + $fromd= date("d-m-Y",strtotime($details['CreatedOn'])); $upappform['BranchCode']=$details['BranchCode']; $upappform['AppFormDate']=$fromd; diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 55fca512..bb37e0c3 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -37,7 +37,8 @@ class Student_model extends CI_Model { } public function get_student_tracking_details($universityid,$courseid,$MobileNumber,$loginBranch,$userType,$createdBy) { - + // echo $universityid.'-'.$courseid.'-'.$MobileNumber.'-'.$loginBranch.'-'.$userType.'-'.$createdBy; + // die(); $sql="SELECT LTF.FollowupOn,LD.LeadID,LTF.InteractionId, LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry, LT.TrackingID, LT.ActivityStatus,LT.AssignedTo, LT.StatusCode, LT.University, LT.Course, LT.AlternateMobile, LT.Address,LT.Flag, ST.StaffID, ST.Firstname, PLD1.ListCode as statusListCode, PLD1.ListName as statusListName, AV.ActivityID ,AV.ActivityName, LTF.FollowupComments FROM T_Lead_Tracking_Followup as LTF JOIN T_Lead_Tracking as LT ON LT.TrackingID=LTF.TrackingID @@ -73,11 +74,13 @@ class Student_model extends CI_Model { // } $sql.=" group by LTF.TrackingID"; - print_r($sql); - die(); + // print_r($sql); + // die(); $b=$this->db->query($sql); $trackingDetails = $b->result(); - $result =$trackingDetails; + $result =$trackingDetails; + // print_r($result); + // die(); return $result; } // get student list based on login user @@ -1916,7 +1919,7 @@ if(count($qry)>0) $this->db->from('T_BroadcastStatus'); $this->db->like('MobileNumber', $det['Phone'], 'before'); $messagedet = $this->db->get(); - + if($messagedet ->result()) { @@ -1934,7 +1937,7 @@ if(count($qry)>0) $this->db->from('T_BroadcastStatus'); $this->db->where('MobileNumber', $det['Email']); $maildet = $this->db->get(); - + if($maildet ->result()) { diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index 98a78f0e..770c783c 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -507,6 +507,7 @@ class Studentview_model extends CI_Model $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = SMS.ListCode'); $this->db->where('CU.CourseID', $courseID); $this->db->where('SMS.StudentID', $studentID); + // $this->db->group_by('SMS.ID'); $this->db->order_by('SMS.ID', 'DESC'); $getMaterialDetails = $this->db->get(); if ($getMaterialDetails->result()){ @@ -533,6 +534,7 @@ class Studentview_model extends CI_Model $this->db->where('CU.CourseID', $courseID); $this->db->where('AS.StudentID', $studentID); $this->db->where('CM.CertificateName !=', APPLICATION_CONST); + $this->db->group_by('AS.ID'); $this->db->order_by('AS.ID', 'DESC'); $getCertDetails = $this->db->get(); @@ -589,8 +591,10 @@ class Studentview_model extends CI_Model $this->db->where('CU.CourseID', $courseID); $this->db->where('CS.StudentID', $studentID); $this->db->where_in('CS.CertificationType', 'MARK CARD'); + $this->db->group_by('CS.ID'); $this->db->order_by('CS.ID', 'DESC'); $getMarkDetails = $this->db->get(); + // print_r($this->db->last_query());die(); if ($getMarkDetails->result()){ return $getMarkDetails->result(); } @@ -610,6 +614,7 @@ class Studentview_model extends CI_Model $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = ABT.ListCode'); $this->db->where('CU.CourseID', $courseID); $this->db->where('ABT.StudentID', $studentID); + // $this->db->group_by('ABT.ID'); $this->db->order_by('ABT.ID', 'DESC'); $getBookletDetails = $this->db->get(); if ($getBookletDetails->result()){ diff --git a/Apollo/assets/views/student/studentDetailsModal.html b/Apollo/assets/views/student/studentDetailsModal.html index 35a65744..7df009b9 100755 --- a/Apollo/assets/views/student/studentDetailsModal.html +++ b/Apollo/assets/views/student/studentDetailsModal.html @@ -416,7 +416,8 @@ - + + {{booklet.AnsDate}} @@ -467,6 +468,7 @@ + @@ -518,8 +520,10 @@ - - + + + + {{mark.CDate}} @@ -541,7 +545,7 @@ - + + -> {{mark.ListName}} @@ -564,7 +568,7 @@ - + --> + + {{study.SDate}} @@ -614,7 +619,7 @@ - + + + {{study.SDate}}-> {{study.ListName}} @@ -633,7 +638,7 @@ - + -->