sms to fee balance students- issue no 1621
This commit is contained in:
parent
99514d6b45
commit
a14b2433a6
@ -392,6 +392,7 @@ $route['getUniversityCourseDetailsforms'] = 'Reregister_Controller/getUniversity
|
||||
|
||||
$route['CourseSemDetails'] = 'HallTickets_Controller/CourseSemDetails';
|
||||
|
||||
$route['SendMessagetoFeeBalance'] = 'HallTickets_Controller/SendMessagetoFeeBalance';
|
||||
///PROMOTE BATCH AND
|
||||
$route['getUniversityBatchDetails'] = 'Reregister_Controller/getUniversityBatchDetails';
|
||||
$route['getStudentListForPromoteBatch'] = 'Reregister_Controller/getStudentListForPromoteBatch';
|
||||
|
||||
@ -681,6 +681,32 @@ class HallTickets_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
|
||||
public function SendMessagetoFeeBalance_post()
|
||||
{
|
||||
$mobileno = $this->post('mobileno');
|
||||
$branchId = $this->post('branchId');
|
||||
|
||||
$sendsms = $this->Hallticket_model->SendFeeBalanceSMS($mobileno);
|
||||
|
||||
if($sendsms)
|
||||
{
|
||||
//$sendsms['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($sendsms, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response([
|
||||
'message' => 'No records found!',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1628,4 +1628,38 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId)
|
||||
return $result_array;
|
||||
}
|
||||
|
||||
|
||||
public function SendFeeBalanceSMS($mobileno)
|
||||
{
|
||||
|
||||
$mobile = "91$mobileno";
|
||||
$msg = 'Dear Student, Your Fee Payment is pending. So we are unable to generate the Hall Ticket, Please pay the balance immediately';
|
||||
|
||||
$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=PROMOTIONAL_HIGH");
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
$output =curl_exec($ch);
|
||||
|
||||
// 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);
|
||||
|
||||
|
||||
$data = array( 'MobileNumber' => $mobile, 'MsgBody' => $msg, 'CreatedOn' => $dateTime,'MsgGroup' => $msgGroup);
|
||||
//print_r($data);die();
|
||||
|
||||
$this->db->insert('T_BroadcastStatus',$data);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
@ -162,6 +162,40 @@ $scope.generateButtonStatus = false;
|
||||
$scope.studentInfo = response.data.studentDetails;
|
||||
$scope.isLoaderShow = false;
|
||||
$scope.isTblShow = true;
|
||||
|
||||
//console.log($scope.studentInfo);
|
||||
|
||||
|
||||
angular.forEach(($scope.studentInfo),function(studentInfo,key)
|
||||
{
|
||||
console.log($scope.studentInfo);
|
||||
if(studentInfo.balpayable != 0)
|
||||
{
|
||||
var mobileno = studentInfo.MobileNumber;
|
||||
var sendmsg =
|
||||
{
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'SendMessagetoFeeBalance/',
|
||||
headers:
|
||||
{
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data:
|
||||
{
|
||||
mobileno:mobileno,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
}
|
||||
};
|
||||
|
||||
$http(sendmsg).then(function (response)
|
||||
{
|
||||
console.log(response.data);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
//break;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user