course details changes done
This commit is contained in:
parent
a5846a6a73
commit
e121523fd0
@ -121,6 +121,7 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
}
|
||||
$result_array['feesDetails']=$CourseFeesArray;
|
||||
$result_array['getFeesUpdateStatus']=$this->getFeesUpdateStatus(FEESUPDATE);
|
||||
$result_array['getExistStudentFeesDetails']=$this->existStudentFeesDetails($student);
|
||||
|
||||
}
|
||||
@ -131,7 +132,23 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
return $result_array;
|
||||
}
|
||||
/*
|
||||
* get fees update status
|
||||
* created by kms
|
||||
* */
|
||||
|
||||
public function getFeesUpdateStatus($feesID=null)
|
||||
{
|
||||
$this->db->select('PLD.ListCode,PLD.ListName');
|
||||
$this->db->from(DEFAULTACTIVITY.' as DA');
|
||||
$this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = DA.StatusCode');
|
||||
$this->db->where('StudentActivityCode',$feesID);
|
||||
$this->db->where('DA.IsActive','1');
|
||||
$this->db->where('PLD.IsActive','1');
|
||||
$this->db->order_by('ListCode','ASC');
|
||||
$status = $this->db->get();
|
||||
return $status->result();
|
||||
}
|
||||
/*
|
||||
* get exist student fees details
|
||||
* created by kms
|
||||
@ -184,7 +201,7 @@ class Fees_status_model extends CI_Model
|
||||
* created by kms
|
||||
* */
|
||||
|
||||
public function updateFees($feesDetails=null,$feesPaidDetails=null)
|
||||
public function updateFees($feesDetails=null,$feesPaidDetails=null,$trackDetails=null)
|
||||
{
|
||||
$this->db->select('BillNO');
|
||||
$this->db->where('BillNO', $feesPaidDetails['BillNO']);
|
||||
@ -215,6 +232,8 @@ class Fees_status_model extends CI_Model
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$result['paidStatus'] = true;
|
||||
$result['message'] = "Successfully course details added";
|
||||
$entryOfCallTrack = $this->updateInCallTrack($trackDetails);
|
||||
|
||||
}
|
||||
else{
|
||||
$this -> db -> where('FeesId', $feesPaidDetails['FeesId']);
|
||||
@ -234,6 +253,116 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* update followup details
|
||||
* created by kms
|
||||
* */
|
||||
public function updateInCallTrack($arrayDetails=null){
|
||||
// create activity in call tracking
|
||||
$this->db->select('ActivityID,ActivityName');
|
||||
$this->db->like('ActivityName', 'Fees', 'after');
|
||||
$this->db->where('IsActive', '1');
|
||||
$activityDetails=$this->db->get(ACTIVITY)->last_row();
|
||||
if($activityDetails){
|
||||
$this->db->select('LD.LeadID,LT.TrackingID');
|
||||
$this->db->from(LEAD_DETAILS.' as LD');
|
||||
$this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID');
|
||||
$this->db->where('LD.MobileNumber',$arrayDetails['MobileNumber']);
|
||||
$this->db->where('LT.ActivityStatus',$activityDetails->ActivityID);
|
||||
$this->db->like('LT.University',$arrayDetails['University'],'after');
|
||||
$this->db->like('LT.Course',$arrayDetails['Course'],'after');
|
||||
$leadDet=$this->db->get()->last_row();
|
||||
|
||||
if($leadDet){
|
||||
$this->db->select('FollowupOn');
|
||||
$this->db->where('TrackingID',$leadDet->TrackingID);
|
||||
$this->db->order_by('InteractionId','DESC');
|
||||
$existFollowupOn = $this->db->get(LEAD_TRACKING_FOLLOWUP)->last_row();
|
||||
// upate tracking status
|
||||
$changeStatusCode['StatusCode'] = $arrayDetails['StatusCode'];
|
||||
$this->db->where('TrackingID',$leadDet->TrackingID);
|
||||
$this->db->update(LEAD_TRACKING, $changeStatusCode);
|
||||
// end update status
|
||||
$updateTrackDetails['TrackingID'] = $leadDet->TrackingID;
|
||||
$updateTrackDetails['FollowupOn'] = $existFollowupOn->FollowupOn;
|
||||
$updateTrackDetails['FollowupComments'] = $arrayDetails['FollowupComments'];
|
||||
$updateTrackDetails['CreatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$updateTrackDetails['CreatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$this->db->insert(LEAD_TRACKING_FOLLOWUP, $updateTrackDetails);
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
$this->db->select('LeadID');
|
||||
$this->db->where('MobileNumber',$arrayDetails['MobileNumber']);
|
||||
$checkLeadDet=$this->db->get(LEAD_DETAILS)->last_row();
|
||||
if($checkLeadDet){
|
||||
$updateLeadDetails['LeadID'] = $checkLeadDet->LeadID;
|
||||
$updateLeadDetails['ActivityStatus'] = $activityDetails->ActivityID;
|
||||
$updateLeadDetails['University'] = $arrayDetails['University'];
|
||||
$updateLeadDetails['Course'] = $arrayDetails['Course'];
|
||||
$updateLeadDetails['AssignedTo'] = $arrayDetails['CreatedBy'];
|
||||
$updateLeadDetails['StatusCode'] = $arrayDetails['StatusCode'];
|
||||
$updateLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$updateLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$this->db->insert(LEAD_TRACKING, $updateLeadDetails);
|
||||
// this if for insert tracking details
|
||||
if($this->db->affected_rows() == '1'){
|
||||
$followup_Details['TrackingID']=$this->db->insert_id();
|
||||
$followup_Details['FollowupOn']=$arrayDetails['FollowupOn'];
|
||||
$followup_Details['FollowupComments']=$arrayDetails['FollowupComments'];
|
||||
$followup_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$followup_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$this->db->insert(LEAD_TRACKING_FOLLOWUP, $followup_Details);
|
||||
// this if for insert follow up details
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber'];
|
||||
$newLeadDetails['LeadName'] = $arrayDetails['LeadName'];
|
||||
$newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$this->db->insert(LEAD_DETAILS, $newLeadDetails);
|
||||
// this if for insert lead details
|
||||
if($this->db->affected_rows() == '1'){
|
||||
// get and store insert id from db
|
||||
$track_Details['LeadID']=$this->db->insert_id();
|
||||
$track_Details['ActivityStatus'] = $activityDetails->ActivityID;
|
||||
$track_Details['University'] = $arrayDetails['University'];
|
||||
$track_Details['Course'] = $arrayDetails['Course'];
|
||||
$track_Details['AssignedTo'] = $arrayDetails['CreatedBy'];
|
||||
$track_Details['StatusCode'] = $arrayDetails['StatusCode'];
|
||||
$track_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$track_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$this->db->insert(LEAD_TRACKING, $track_Details);
|
||||
// this if for insert tracking details
|
||||
if($this->db->affected_rows() == '1'){
|
||||
$insertfollowup_Details['TrackingID']=$this->db->insert_id();
|
||||
$insertfollowup_Details['FollowupOn']=$arrayDetails['FollowupOn'];
|
||||
$insertfollowup_Details['FollowupComments']=$arrayDetails['FollowupComments'];
|
||||
$insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details);
|
||||
// this if for insert follow up details
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* get university details
|
||||
* created by kms
|
||||
|
||||
Loading…
Reference in New Issue
Block a user