notification list

This commit is contained in:
venbatechnologies@gmail.com 2018-10-13 16:21:00 +05:30
parent 2441f0ef6e
commit 78036cc366
10 changed files with 407 additions and 3 deletions

View File

@ -212,6 +212,9 @@ $route['getAllDayBookDetails'] = 'DayBook_Controller/getAllDayBookDetails';
$route['update_DayBookDetails'] = 'DayBook_Controller/update_DayBookDetailsData';
$route['Getnotificcations'] = 'Student_Controller/Getnotificcations';
$route['AllgetUniversity'] = 'Report/getAllUniversity';
$route['NewregDetails'] = 'Report/NewregDetails';

View File

@ -689,4 +689,29 @@ class Student_Controller extends REST_Controller {
}
public function Getnotificcations_post()
{
$det['StudentID']=$this->post('StudentID');
$det['Phone']= $this->post('Phone');
$det['Email']=$this->post('Email');
$det['loginBranch']= $this->post('loginBranch');
$det['createdBy']=$this->post('createdBy');
$getnotifications = $this->student_model->GetStudentNotifications($det);
if ($getnotifications) {
$getnotifications['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getnotifications, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
}

View File

@ -376,7 +376,7 @@ class Calltracking_model extends CI_Model {
$msgId = $a[1];
$msgNumb = $a[2];
$msgStatus = $a[4];
$data[] = array('MsgId' => $msgId, 'MobileNumber' => $msgNumb, 'MsgBody' => $messa, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
$data[] = array('MsgId' => $msgId, 'MobileNumber' => $msgNumb, 'MsgBody' => $msg, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
continue;
}
}
@ -455,6 +455,17 @@ class Calltracking_model extends CI_Model {
$this->email->message($htmlContent);
//Send email 1
$result = $this->email->send();
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$msgGroup = date('YmdHis');
$data[] = array('MobileNumber' => $list, 'MsgBody' => $htmlContent, 'Status' => 'success', 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
$this->db->insert_batch('T_BroadcastStatus', $data);
// echo $this->email->print_debugger(); exit();
return $result;

View File

@ -1650,6 +1650,44 @@ $REGID='';
// print_r($output);exit();
curl_close($ch);
$arrss = explode('<br>', $output);
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$msgGroup = date('YmdHis');
//print_r($arrss);
for ($i = 0, $c = count($arrss);$i < $c;$i++)
{
if ($arrss[$i] === '')
{
break;
}
else
{
$a = explode(':', $arrss[$i]);
$msgIdState = $a[0];
$msgId = $a[1];
$msgNumb = $a[2];
$msgStatus = $a[4];
$data = array('MsgId' => $msgId, 'MobileNumber' => $msgNumb, 'MsgBody' => $data, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
continue;
}
}
// print_r($data);die();
$this->db->insert('T_BroadcastStatus',$data);
return $output;
}

View File

@ -623,11 +623,45 @@ $latestappstatus='';
}
$mobile = implode(',', $number);
$message = urlencode($msg);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3&MobileNo=" . $mobile . "&SenderID=APODEC&Message=" . $message . "&ServiceName=TEMPLATE_BASED");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$output = curl_exec($ch);
curl_close($ch);
$arrss = explode('<br>', $output);
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$msgGroup = date('YmdHis');
for ($i = 0, $c = count($arrss);$i < $c;$i++)
{
if ($arrss[$i] === '')
{
break;
}
else
{
$a = explode(':', $arrss[$i]);
$msgIdState = $a[0];
$msgId = $a[1];
$msgNumb = $a[2];
$msgStatus = $a[4];
$data[] = array('MsgId' => $msgId, 'MobileNumber' => $msgNumb, 'MsgBody' => $msg, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
continue;
}
}
$this->db->insert_batch('T_BroadcastStatus', $data);
return $output;
}
@ -666,6 +700,24 @@ $latestappstatus='';
$this->email->message($htmlContent);
//Send email 1
$result = $this->email->send();
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$msgGroup = date('YmdHis');
$data[] = array('MobileNumber' => $list, 'MsgBody' => $htmlContent, 'Status' => 'success', 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
$this->db->insert_batch('T_BroadcastStatus', $data);
// echo $this->email->print_debugger(); exit();
return $result;

View File

@ -1651,6 +1651,37 @@ class Student_model extends CI_Model {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$output = curl_exec($ch);
curl_close($ch);
$arrss = explode('<br>', $output);
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$msgGroup = date('YmdHis');
for ($i = 0, $c = count($arrss);$i < $c;$i++)
{
if ($arrss[$i] === '')
{
break;
}
else
{
$a = explode(':', $arrss[$i]);
$msgIdState = $a[0];
$msgId = $a[1];
$msgNumb = $a[2];
$msgStatus = $a[4];
$data[] = array('MsgId' => $msgId, 'MobileNumber' => $msgNumb, 'MsgBody' => $msg, 'Status' => $msgStatus, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
continue;
}
}
$this->db->insert_batch('T_BroadcastStatus', $data);
return $output;
}
@ -1725,4 +1756,72 @@ class Student_model extends CI_Model {
}
public function GetStudentNotifications($det)
{
$this->db->select('*');
$this->db->from('T_BroadcastStatus');
$this->db->like('MobileNumber', $det['Phone'], 'before');
$messagedet = $this->db->get();
if($messagedet ->result())
{
$result_array['msgStatus'] = true;
$result_array['msgdetails'] = $messagedet->result();
}
else
{
$result_array['msgStatus'] = false;
$result_array['msgdetails'] = 'No Records Found';
}
$this->db->select('*');
$this->db->from('T_BroadcastStatus');
$this->db->where('MobileNumber', $det['Email']);
$maildet = $this->db->get();
if($maildet ->result())
{
$result_array['mailStatus'] = true;
$result_array['maildetails'] = $maildet->result();
}
else
{
$result_array['mailStatus'] = false;
$result_array['maildetails'] = 'No Records Found';
}
$this->db->select('StudentID');
$this->db->from('T_StudentDetails');
$this->db->where('MobileNumber', $det['Phone']);
$studentID = $this->db->get();
if($studentID ->result())
{
$result_array['stuidStatus'] = true;
$result_array['StudentID'] = $studentID->result();
}
else
{
$result_array['stuidStatus'] = false;
$result_array['StudentID'] = 'No Records Found';
}
return $result_array;
}
}

View File

@ -241,10 +241,10 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
$scope.trackForm = {
submit: function (form, myModel,loading) {
console.log(myModel.activity.activityName);
//console.log(myModel.activity.activityName);
var string = myModel.activity.activityName;
var Upperstring = string.toUpperCase();
var checkresult = Upperstring.search("STATUS");
var checkresult = Upperstring.search("ADMISSION");
var msgactivity = 0;
if(checkresult != -1)
{

View File

@ -1834,12 +1834,14 @@ $scope.allcourselist ='';
$scope.editId = -1;
$scope.editCourseId = -1;
$scope.editTrackingId=-1;
$scope.msgdetID = -1;
$scope.setEditId = function (uniqe_id ,id) {
// alert()
$scope.editId = uniqe_id;
$scope.editCourseId = -1;
$scope.editTrackingId=-1;
$scope.msgdetID = -1;
}
$scope.setEditCourseId = function (uniqe_id ,id) {
@ -1871,6 +1873,66 @@ $scope.allcourselist ='';
}
$scope.cancelnotification = function()
{
$scope.msgdetID = '-1';
}
$scope.MailDetails='';
$scope.MessageDetails = '';
$scope.StudentIDDet = '';
$scope.msgdetID = -1;
$scope.setmessageId = function (student)
{
//console.log(student);return false;
var studentID= student.StudentID;
var phonenumber = student.MobileNumber;
var email = student.EmailID;
var sentnotification = {
method: 'POST',
url: apiPoint.url + 'Getnotificcations/',
headers: {
'Content-Type': 'application/json'
},
data: {
StudentID: studentID,
Phone: phonenumber,
Email:email,
loginBranch: localDetails.localBranchID,
createdBy: localDetails.localUserID,
}
};
$http(sentnotification).then(function (response) {
if(response.data.status == 200)
{
$scope.MailDetails=response.data.maildetails;
$scope.MessageDetails = response.data.msgdetails;
$scope.StudentIDDet = response.data.StudentID;
$scope.msgdetID = $scope.StudentIDDet[0].StudentID;
//console.log($scope.msgdetID);
}
});
}
$scope.cancel = function () {
$scope.getStudentList();
$scope.editId = -1;

View File

@ -0,0 +1,106 @@
<div class="row">
<div class="col-md-12">
<div ng-if="trackingEditLoading == true" class="text-center">
<!-- <img src="assets/images/ajax_loader_blue.gif" style="width: 5%; height: 30%"> -->
<h3>Fetching ...</h3>
</div>
<div ng-if="trackingdetails == false" class="text-center">
<h3>No Records Found</h3>
</div>
<div class="col-md-12">
<fieldset>
<legend>
Email Details
</legend>
<!--list of course details : start-->
<div>
<table class="table">
<thead>
<tr>
<th> Mail </th>
<th>Email ID</th>
<th> Sent On </th>
</tr>
</thead>
<tbody >
<tr ng-repeat="ma in MailDetails">
<td>{{ma.MsgBody}}
<td>{{ma.MobileNumber}}</td>
<td>{{ma.CreatedOn}}</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<!-- <button type="reset" id="addCourseBtn" class="btn btn-into btn-wide" tabindex="100" ng-click="addStudentCourse()"> -->
<!-- Add Course -->
<!-- </button> -->
<!-- <button type="reset" class="btn btn-warning btn-wide" tabindex="101" ng-click="cancel()">
Cancel
</button> -->
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>
Message Details
</legend>
<!--list of course details : start-->
<div>
<table class="table">
<thead>
<tr>
<th> Message </th>
<th>Mobile No</th>
<th> Sent On </th>
</tr>
</thead>
<tbody >
<tr ng-repeat="me in MessageDetails">
<td ><div class="containersPara"><span style="white-space:pre-wrap;">{{me.MsgBody}}</span></div></td>
<td>{{me.MobileNumber}}</td>
<td>{{me.CreatedOn}}</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<!-- <button type="reset" id="addCourseBtn" class="btn btn-into btn-wide" tabindex="100" ng-click="addStudentCourse()"> -->
<!-- Add Course -->
<!-- </button> -->
<!-- <button type="reset" class="btn btn-warning btn-wide" tabindex="101" ng-click="cancel()">
Cancel
</button> -->
</div>
</div>
</div>
</div>
</fieldset>
<div style="float: right;">
<button type="reset" class="btn btn-warning btn-wide" tabindex="101" ng-click="cancelnotification()">
Cancel
</button>
</div>
</div>
<!-- class="editRowTd" -->

View File

@ -222,6 +222,7 @@
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover" ng-controller="studentModalDemoCtrl">
<thead>
@ -278,6 +279,8 @@
<!--<input type=button class="btn btn-blue btn-xs" id="editCourseRowBtn{{p.StaffID}}" value="Course Details" ng-click="setEditCourseId(p.StudentID);">-->
<i class="ti-write" tooltip="Course Details" ng-click="setEditCourseId(p.Student_Course_id, p.StudentID);"></i>
<i class="ti-timer" tooltip="Tracking Details" ng-click="setEditTrackingId(p.Student_Course_id,p.CourseID,p.UniversityID, p.MobileNumber);"></i>
<i class="fa fa-envelope-o" tooltip="Sent Message/Email Details" ng-click="setmessageId(p);"></i>
</td>
</tr>
<tr ng-show="editId === p.Student_Course_id" ng-if="editId === p.Student_Course_id">
@ -290,8 +293,13 @@
<td colspan="8" ng-include src="'assets/views/student/editTrackingDetails.html'"></td>
</tr>
<tr ng-show="p.StudentID ==msgdetID" ng-if="p.StudentID ==msgdetID">
<td colspan="8" ng-include src="'assets/views/student/messageDetails.html'"></td>
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" tabindex="7" direction-links="true" boundary-links="true">
</dir-pagination-controls>