Merge branch 'master' of https://bitbucket.org/venbainformationtechnology/apollodec
This commit is contained in:
commit
9042fb8e21
@ -170,7 +170,7 @@ class StatusUpdation_Controller extends REST_Controller {
|
||||
);
|
||||
}
|
||||
|
||||
$updateAnswerBookletStat = $this->statusupdation_model->update_answerbooklet($data);// Check if the employee exist
|
||||
$updateAnswerBookletStat = $this->statusupdation_model->update_answerbooklet($data,$reqDetails);// Check if the employee exist
|
||||
if ($updateAnswerBookletStat)
|
||||
{
|
||||
$updateAnswerBookletStat['status'] = REST_Controller::HTTP_OK;
|
||||
@ -280,7 +280,7 @@ class StatusUpdation_Controller extends REST_Controller {
|
||||
);
|
||||
}
|
||||
|
||||
$updateApplicationStatus = $this->statusupdation_model->update_applicationStatus($data);// Check if the employee exist
|
||||
$updateApplicationStatus = $this->statusupdation_model->update_applicationStatus($data,$reqDetails);// Check if the employee exist
|
||||
if ($updateApplicationStatus)
|
||||
{
|
||||
$updateApplicationStatus['status'] = REST_Controller::HTTP_OK;
|
||||
|
||||
@ -988,13 +988,44 @@ class Fees_status_model extends CI_Model
|
||||
$this->db->where('SFS.CourseID',$row1->CourseID);
|
||||
$this->db->where('SFS.StudentID',$row1->StudentID);
|
||||
$getStudentPaiDetails1 = $this->db->get()->result();
|
||||
if($row->Amount < $getStudentPaiDetails1[0]->BillAmount){
|
||||
if($row1->Amount < $getStudentPaiDetails1[0]->BillAmount){
|
||||
$this->smssend($row1->StudentID,$row1->DueDate);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// this is for update details in call track after due date
|
||||
$yesterdayDate = new DateTime(date("d-m-Y"));
|
||||
$yesterdayDate->modify('-1 day');
|
||||
$preDATE = $yesterdayDate->format('d-m-Y');
|
||||
$this->db->distinct();
|
||||
$this->db->select('FIN.ID,FIN.Name,FIN.FeesID,FIN.Amount,FIN.DueDate,SFS.StudentID,SFS.CourseID');
|
||||
$this->db->from(FEES_INSTALLMENT.' as FIN');
|
||||
$this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'FIN.FeesID = SFS.FeesID');
|
||||
$this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = FIN.FeesID','left');
|
||||
$this->db->where('FIN.DueDate',$preDATE);
|
||||
$getStudentDetails2 = $this->db->get();
|
||||
if ($getStudentDetails2->result()){
|
||||
foreach ($getStudentDetails2->result() as $row2){
|
||||
$this->db->select('ifnull(SUM((SFP.BillAmount)),0) as BillAmount');
|
||||
$this->db->from(STUDENTS_FEES_PAID.' as SFP');
|
||||
$this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFP.FeesId = SFS.FeesID');
|
||||
$this->db->where('SFS.CourseID',$row2->CourseID);
|
||||
$this->db->where('SFS.StudentID',$row2->StudentID);
|
||||
$getStudentPaiDetails2 = $this->db->get()->result();
|
||||
|
||||
if($row2->Amount > $getStudentPaiDetails2[0]->BillAmount){
|
||||
|
||||
|
||||
$this->updateFeesStatusInCallTrack($row2->StudentID,$row2->CourseID);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1033,6 +1064,194 @@ class Fees_status_model extends CI_Model
|
||||
$roleDetails = $this->db->get()->first_row();
|
||||
return $roleDetails;
|
||||
}
|
||||
/*
|
||||
* update followup details for fees pending in call tracking
|
||||
* created by kms
|
||||
* */
|
||||
public function updateFeesStatusInCallTrack($studentID=null,$courseID=null){
|
||||
$now = new DateTime();
|
||||
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
||||
$currentDate = new DateTime(date("d-m-Y"));
|
||||
$afterFormatedDate = $currentDate->format('d-m-Y');
|
||||
// get student details
|
||||
|
||||
$this->db->select('PLD.ListCode');
|
||||
$this->db->from(PICK_LIST_DETAILS.' as PLD');
|
||||
$this->db->where('PLD.ListName','PENDING');
|
||||
$this->db->where('PLD.IsActive','1');
|
||||
$checkStatus=$this->db->get()->last_row();
|
||||
if($checkStatus){
|
||||
|
||||
|
||||
$studentDetails = $this->studentInfoForFeesStatus($studentID,$courseID);
|
||||
|
||||
if($studentDetails){
|
||||
$arrayDetails['MobileNumber']=$studentDetails->MobileNumber;
|
||||
$arrayDetails['LeadName']=$studentDetails->Firstname;
|
||||
$arrayDetails['University']=$studentDetails->UniversityName;
|
||||
$arrayDetails['Course']=$studentDetails->CourseName;
|
||||
$arrayDetails['StatusCode']=$checkStatus->ListCode;
|
||||
$arrayDetails['CreatedBranch']=$studentDetails->BranchID;
|
||||
$arrayDetails['CreatedOn']=$now->format('Y-m-d H:i:s');
|
||||
$arrayDetails['FollowupOn']=$afterFormatedDate;
|
||||
$arrayDetails['FollowupComments']="Fees payment for your course is falling.";
|
||||
// get created by with branch id
|
||||
|
||||
$this->db->select('LO.ID');
|
||||
$this->db->from(STAFF_BRANCH.' as STB');
|
||||
$this->db->join(LOGIN.' as LO', 'LO.StaffID = STB.StaffID');
|
||||
$this->db->where('STB.BranchCode',$studentDetails->BranchID);
|
||||
$this->db->where('LO.ListCode',ADMIN);
|
||||
$this->db->where('STB.IsActive','1');
|
||||
$this->db->where('LO.IsActive','1');
|
||||
$assignDet=$this->db->get()->last_row();
|
||||
if($assignDet){
|
||||
$arrayDetails['CreatedBy']=$assignDet->ID;
|
||||
}
|
||||
else{
|
||||
$arrayDetails['CreatedBy']='';
|
||||
}
|
||||
|
||||
// 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);
|
||||
$existFollowupOn = $this->db->get(LEAD_TRACKING_FOLLOWUP)->last_row();
|
||||
|
||||
// upate tracking status
|
||||
$changeStatusCode['StatusCode'] = $arrayDetails['StatusCode'];
|
||||
$changeStatusCode['UpdatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$changeStatusCode['UpdatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$changeStatusCode['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
|
||||
$this->db->where('TrackingID',$leadDet->TrackingID);
|
||||
$this->db->update(LEAD_TRACKING, $changeStatusCode);
|
||||
// end update status
|
||||
$updateTrackDetails['TrackingID'] = $leadDet->TrackingID;
|
||||
$updateTrackDetails['FollowupOn'] = $arrayDetails['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'];
|
||||
$updateLeadDetails['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
$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'];
|
||||
$track_Details['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
$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;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* get student info for fees due updates
|
||||
* created by kms
|
||||
* */
|
||||
public function studentInfoForFeesStatus($studentID=null,$courseID=null){
|
||||
|
||||
$this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName,STC.BranchID');
|
||||
$this->db->from(STUDENTCOURSE.' as STC');
|
||||
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID');
|
||||
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID');
|
||||
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID');
|
||||
$this->db->where('ST.StudentID',$studentID);
|
||||
$this->db->where('STC.CourseID',$courseID);
|
||||
$leadDet=$this->db->get()->last_row();
|
||||
if($leadDet){
|
||||
return $leadDet;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -65,7 +65,8 @@ class StatusUpdation_model extends CI_Model
|
||||
}
|
||||
|
||||
// update Application status
|
||||
public function update_applicationStatus($arr) {
|
||||
public function update_applicationStatus($arr,$reqDetails) {
|
||||
|
||||
$this->db->insert_batch(APPLICATION_STATUS, $arr);
|
||||
if ($this->db->affected_rows() >= 1) {
|
||||
if($this->get_ListCode_status($arr[0]['ListCode'])){
|
||||
@ -78,6 +79,7 @@ class StatusUpdation_model extends CI_Model
|
||||
}
|
||||
// $result['addStatus'] = true;
|
||||
// $result['message'] = "Successfully Certification Status Updated";
|
||||
$this->updateDocumentStatusInCallTrack($arr,$reqDetails);
|
||||
$result['addStatus'] = true;
|
||||
$result['message'] = "Successfully Documents Status Updated";
|
||||
} else {
|
||||
@ -273,10 +275,13 @@ class StatusUpdation_model extends CI_Model
|
||||
}
|
||||
|
||||
// update answer booklet status
|
||||
public function update_answerbooklet($arr) {
|
||||
public function update_answerbooklet($arr,$reqDetails) {
|
||||
|
||||
|
||||
// print_r($arr);exit();
|
||||
$this->db->insert_batch(ANSWER_BOOKLET, $arr);
|
||||
if ($this->db->affected_rows() >= 1) {
|
||||
$this->updateBookletStatusInCallTrack($arr,$reqDetails);
|
||||
// $this->smssend($arr);
|
||||
$result['addStatus'] = true;
|
||||
$result['message'] = "Successfully Answer Booklet Status Updated";
|
||||
@ -491,6 +496,380 @@ class StatusUpdation_model extends CI_Model
|
||||
// //Send email
|
||||
// $this->email->send();
|
||||
// }
|
||||
|
||||
/*
|
||||
* update followup details for booklet details in call tracking
|
||||
* created by kms
|
||||
* */
|
||||
public function updateBookletStatusInCallTrack($fromDetails=null,$reqDetails=null){
|
||||
// get student details
|
||||
$this->db->select('PLD.ListCode');
|
||||
$this->db->from(PICK_LIST_DETAILS.' as PLD');
|
||||
$this->db->where('PLD.ListName','ISSUED');
|
||||
$this->db->where('PLD.ListCode',$fromDetails[0]['ListCode']);
|
||||
$this->db->where('PLD.IsActive','1');
|
||||
$checkStatus=$this->db->get()->last_row();
|
||||
if($checkStatus){
|
||||
|
||||
|
||||
$studentDetails = $this->studentInfo($fromDetails);
|
||||
if($studentDetails){
|
||||
$arrayDetails['MobileNumber']=$studentDetails->MobileNumber;
|
||||
$arrayDetails['LeadName']=$studentDetails->Firstname;
|
||||
$arrayDetails['University']=$studentDetails->UniversityName;
|
||||
$arrayDetails['Course']=$studentDetails->CourseName;
|
||||
$arrayDetails['StatusCode']=$fromDetails[0]['ListCode'];
|
||||
$arrayDetails['CreatedBranch']=$fromDetails[0]['BranchCode'];
|
||||
$arrayDetails['CreatedOn']=$fromDetails[0]['CreatedOn'];
|
||||
$arrayDetails['FollowupOn']=$fromDetails[0]['AnsDate'];
|
||||
$arrayDetails['FollowupComments']=$fromDetails[0]['Comments'];
|
||||
if($reqDetails['localType']==SUPER_ADMIN){
|
||||
$this->db->select('LO.ID');
|
||||
$this->db->from(STAFF_BRANCH.' as STB');
|
||||
$this->db->join(LOGIN.' as LO', 'LO.StaffID = STB.StaffID');
|
||||
$this->db->where('STB.BranchCode',$fromDetails[0]['BranchCode']);
|
||||
$this->db->where('LO.ListCode',ADMIN);
|
||||
$this->db->where('STB.IsActive','1');
|
||||
$this->db->where('LO.IsActive','1');
|
||||
$assignDet=$this->db->get()->last_row();
|
||||
if($assignDet){
|
||||
$arrayDetails['CreatedBy']=$assignDet->ID;
|
||||
}
|
||||
else{
|
||||
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy'];
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy'];
|
||||
}
|
||||
|
||||
// create activity in call tracking
|
||||
$this->db->select('ActivityID,ActivityName');
|
||||
$this->db->like('ActivityName', 'Answer Booklet', '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'];
|
||||
$changeStatusCode['UpdatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$changeStatusCode['UpdatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$changeStatusCode['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
|
||||
$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'];
|
||||
$updateLeadDetails['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
$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'];
|
||||
$track_Details['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
$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;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* update followup details for application status in call tracking
|
||||
* created by kms
|
||||
* */
|
||||
public function updateDocumentStatusInCallTrack($fromDetails=null,$reqDetails=null){
|
||||
|
||||
// get student details
|
||||
$this->db->select('PLD.ListCode');
|
||||
$this->db->from(PICK_LIST_DETAILS.' as PLD');
|
||||
$this->db->where('PLD.ListName','PENDING');
|
||||
$this->db->where('PLD.ListCode',$fromDetails[0]['ListCode']);
|
||||
$this->db->where('PLD.IsActive','1');
|
||||
$checkStatus=$this->db->get()->last_row();
|
||||
if($checkStatus){
|
||||
|
||||
$studentDetails = $this->studentInfoForDocumentStatus($fromDetails);
|
||||
if($studentDetails){
|
||||
$arrayDetails['MobileNumber']=$studentDetails->MobileNumber;
|
||||
$arrayDetails['LeadName']=$studentDetails->Firstname;
|
||||
$arrayDetails['University']=$studentDetails->UniversityName;
|
||||
$arrayDetails['Course']=$studentDetails->CourseName;
|
||||
$arrayDetails['StatusCode']=$fromDetails[0]['ListCode'];
|
||||
$arrayDetails['CreatedBranch']=$fromDetails[0]['BranchCode'];
|
||||
$arrayDetails['CreatedOn']=$fromDetails[0]['CreatedOn'];
|
||||
$arrayDetails['FollowupOn']=$fromDetails[0]['AppDate'];
|
||||
$arrayDetails['FollowupComments']=$fromDetails[0]['Comments'];
|
||||
if($reqDetails['localType']==SUPER_ADMIN){
|
||||
$this->db->select('LO.ID');
|
||||
$this->db->from(STAFF_BRANCH.' as STB');
|
||||
$this->db->join(LOGIN.' as LO', 'LO.StaffID = STB.StaffID');
|
||||
$this->db->where('STB.BranchCode',$fromDetails[0]['BranchCode']);
|
||||
$this->db->where('LO.ListCode',ADMIN);
|
||||
$this->db->where('STB.IsActive','1');
|
||||
$this->db->where('LO.IsActive','1');
|
||||
$assignDet=$this->db->get()->last_row();
|
||||
if($assignDet){
|
||||
$arrayDetails['CreatedBy']=$assignDet->ID;
|
||||
}
|
||||
else{
|
||||
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy'];
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy'];
|
||||
}
|
||||
|
||||
// create activity in call tracking
|
||||
$this->db->select('ActivityID,ActivityName');
|
||||
$this->db->like('ActivityName', 'Document', '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'];
|
||||
$changeStatusCode['UpdatedBy'] = $arrayDetails['CreatedBy'];
|
||||
$changeStatusCode['UpdatedOn'] = $arrayDetails['CreatedOn'];
|
||||
$changeStatusCode['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
|
||||
$this->db->where('TrackingID',$leadDet->TrackingID);
|
||||
$this->db->update(LEAD_TRACKING, $changeStatusCode);
|
||||
// end update status
|
||||
$updateTrackDetails['TrackingID'] = $leadDet->TrackingID;
|
||||
$updateTrackDetails['FollowupOn'] = $arrayDetails['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'];
|
||||
$updateLeadDetails['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
$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'];
|
||||
$track_Details['CreatedBranch']=$arrayDetails['CreatedBranch'];
|
||||
$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;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* get student info
|
||||
* created by kms
|
||||
* */
|
||||
public function studentInfo($details=null){
|
||||
|
||||
$this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName');
|
||||
$this->db->from(COURSE_FEES.' as CF');
|
||||
$this->db->join(STUDENTCOURSE.' as STC', 'STC.CourseID = CF.CourseID');
|
||||
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID');
|
||||
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID');
|
||||
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID');
|
||||
$this->db->where('ST.StudentID',$details[0]['StudentID']);
|
||||
$this->db->where('CF.ID',$details[0]['CourseID']);
|
||||
$leadDet=$this->db->get()->last_row();
|
||||
if($leadDet){
|
||||
return $leadDet;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* get student info for documet updates
|
||||
* created by kms
|
||||
* */
|
||||
public function studentInfoForDocumentStatus($details=null){
|
||||
|
||||
$this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName');
|
||||
$this->db->from(STUDENTCOURSE.' as STC');
|
||||
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID');
|
||||
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID');
|
||||
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID');
|
||||
$this->db->where('ST.StudentID',$details[0]['StudentID']);
|
||||
$this->db->where('STC.CourseID',$details[0]['CourseID']);
|
||||
$leadDet=$this->db->get()->last_row();
|
||||
if($leadDet){
|
||||
return $leadDet;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user