1688 calltracking send mgs

This commit is contained in:
rajasekar 2019-02-28 18:12:44 +05:30
parent 39c2eaf31a
commit 12d02d4876
4 changed files with 42 additions and 11 deletions

View File

@ -101,6 +101,7 @@ class Call_Tracking_Controller extends REST_Controller {
$tracking_details['Course'] = $this->post('courseName'); $tracking_details['Course'] = $this->post('courseName');
$tracking_details['ActivityStatus'] = $this->post('activity'); $tracking_details['ActivityStatus'] = $this->post('activity');
$tracking_details['AssignedTo'] = $this->post('assignedTo'); $tracking_details['AssignedTo'] = $this->post('assignedTo');
// echo $tracking_details['AssignedTo'];
$tracking_details['StatusCode'] = $this->post('status'); $tracking_details['StatusCode'] = $this->post('status');
$tracking_details['ReferredBy'] = $this->post('referedBy'); $tracking_details['ReferredBy'] = $this->post('referedBy');
$tracking_details['AlternateMobile'] = $this->post('alterMobile'); $tracking_details['AlternateMobile'] = $this->post('alterMobile');
@ -118,14 +119,20 @@ class Call_Tracking_Controller extends REST_Controller {
$tracking_followup_details['CreatedOn'] = $now->format('Y-m-d H:i:s'); $tracking_followup_details['CreatedOn'] = $now->format('Y-m-d H:i:s');
$tracking_followup_details['StatusName'] = $this->post('status'); $tracking_followup_details['StatusName'] = $this->post('status');
$tracking_followup_details['AssignedStaff'] = $this->post('assignedTo'); $tracking_followup_details['AssignedStaff'] = $this->post('assignedTo');
// echo $tracking_followup_details['AssignedStaff'];
$message = $this->post('msgactivity'); $AssignedTo = $this->post('assignedTo');
// $MobileNo = $this->post('MobileNo');
//echo $AssignedTo;
// echo $MobileNo;
$message = $this->post('msgactivity');
// echo $message;die(); // echo $message;die();
$leadDetails = $this->Calltracking_model->addleadDetails($lead_details,$tracking_details,$tracking_followup_details,$message);// Check if the users data store contains users (in case the database result returns NULL) $leadDetails = $this->Calltracking_model->addleadDetails($AssignedTo,$lead_details,$tracking_details,$tracking_followup_details,$message);
// Check if the users data store contains users (in case the database result returns NULL)
if ($leadDetails) if ($leadDetails)
{ {
$leadDetails['status'] = REST_Controller::HTTP_OK; $leadDetails['status'] = REST_Controller::HTTP_OK;

View File

@ -284,6 +284,7 @@ class Calltracking_model extends CI_Model {
// $this->db->where('LO.ID',$requestedBy); // $this->db->where('LO.ID',$requestedBy);
// } // }
$staffDetails=$this->db->get(); $staffDetails=$this->db->get();
if($staffDetails){ if($staffDetails){
$result_staff = array(); $result_staff = array();
foreach ($staffDetails->result() as $row) foreach ($staffDetails->result() as $row)
@ -320,7 +321,7 @@ class Calltracking_model extends CI_Model {
}*/ }*/
// print_r($this->db->last_query());die(); // print_r($this->db->last_query());die();
return $result_staff; return $result_staff;
} }
@ -362,9 +363,27 @@ class Calltracking_model extends CI_Model {
* created by kms * created by kms
* */ * */
public function addleadDetails($lead_Details=null,$track_Details=null,$followup_Details=null,$messagecheck=null) public function addleadDetails($AssignedTo =null,$lead_Details=null,$track_Details=null,$followup_Details=null,$messagecheck=null)
{ {
$Sname ='';
$SMobileno ='';
$this->db->select('ST.Firstname,ST.MobileNumber');
$this->db->from(LOGIN.' as LO');
$this->db->join(STAFF_BRANCH.' as STB', 'STB.StaffID = LO.StaffID');
$this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID');
$this->db->where('LO.ID',$AssignedTo);
$staffs=$this->db->get();
$staffsarray = $staffs->result();
//print_r($staffsarray);
foreach($staffsarray as $em)
{
$Sname = $em->Firstname;
$SMobileno =$em->MobileNumber;
}
// print_r($lead_Details);die(); // print_r($lead_Details);die();
$this->db->insert(LEAD_DETAILS, $lead_Details); $this->db->insert(LEAD_DETAILS, $lead_Details);
@ -396,10 +415,12 @@ class Calltracking_model extends CI_Model {
// $msg='Dear '.$name.', Thank for Enquiring with Apollo Distance Education College for the course '.$CourseName.'. Pls Feel free to call us for more information 9962012985,9962012982.Thanks.'; // $msg='Dear '.$name.', Thank for Enquiring with Apollo Distance Education College for the course '.$CourseName.'. Pls Feel free to call us for more information 9962012985,9962012982.Thanks.';
$msg='Dear '.$name.', Thank you for enquiring with Apollo Distance Education College for the course '.$CourseName.'. Pls feel free to call us for more information at 9962012985 or 9962012982.'; // $msg='Dear '.$name.', Thank you for enquiring with Apollo Distance Education College for the course '.$CourseName.'. Pls feel free to call us for more information at '.$Sname.'- '.$SMobileno.'';
$msg='Dear '.$name.', Thank you for enquiring with Apollo Distance Education College for the course '.$CourseName.'. Pls feel free to call '.$Sname.' for more information at '.$SMobileno.'.';
//echo $msg;
$messa = urlencode($msg); $messa = urlencode($msg);
//echo $messa ;
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3&MobileNo=" . $number . "&SenderID=APODEC&Message=" . $messa . "&ServiceName=TEMPLATE_BASED"); curl_setopt($ch, CURLOPT_URL, "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3&MobileNo=" . $number . "&SenderID=APODEC&Message=" . $messa . "&ServiceName=TEMPLATE_BASED");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
@ -407,6 +428,7 @@ class Calltracking_model extends CI_Model {
curl_close($ch); curl_close($ch);
$arrss = explode('<br>', $output); $arrss = explode('<br>', $output);
// print_r($arrss);
$time = date('Y-m-d H:i:s'); $time = date('Y-m-d H:i:s');
$dateTime = $time; $dateTime = $time;
@ -426,7 +448,7 @@ class Calltracking_model extends CI_Model {
$msgId = $a[1]; $msgId = $a[1];
$msgNumb = $a[2]; $msgNumb = $a[2];
$msgStatus = $a[4]; $msgStatus = $a[4];
$data[] = array('MsgId' => $msgId, 'MobileNumber' => $msgNumb, 'MsgBody' => $msg, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup); $data[] = array( 'MsgId' => $msgId,'MobileNumber' => $msgNumb, 'MsgBody' => $msg, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
continue; continue;
} }
} }

View File

@ -1651,6 +1651,7 @@ return true;
} }
$sql.="order by T_CourseMaster.CourseName,T_Hallticket_Student_Details.Sem_Year";
$res = $this->db->query($sql,array($UID,$batch,$branchId,$centerName['CenterID'],$examDate)); $res = $this->db->query($sql,array($UID,$batch,$branchId,$centerName['CenterID'],$examDate));
$result = $res->result(); $result = $res->result();
//print_r($this->db->last_query());die(); //print_r($this->db->last_query());die();

View File

@ -482,6 +482,7 @@
<select class="form-control" name="assigned" id="Box2" tabindex="8" <select class="form-control" name="assigned" id="Box2" tabindex="8"
ng-model="myModel.assignedTo" ng-model="myModel.assignedTo"
ng-options="emp.loginId as emp.staffName for emp in staffDetails" ng-options="emp.loginId as emp.staffName for emp in staffDetails"
required> required>