| Server IP : 172.64.80.1 / Your IP : 172.70.50.63 Web Server : Apache System : Linux mail.federalpolyede.edu.ng 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 User : federalpolyede.edu.ng_idh35skikv ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/federalpolyede.edu.ng/httpdocs/ |
Upload File : |
<?php
//$username = 'aspoa';
//$password = 'aepies12';
$count=0;
$noCount=0;
$start=0;
$end=0;
//if (isset($_GET['id'])){
// $id=$_GET['id'];
//}else{
// die('ID Error');
//}
require_once('connect.php');
$db=db_connect();
//for($i=1;$i)
$k= "SELECT * FROM `stddata` where formNo not like '%delete%' and smsSent=0 and computedScore=0 limit 0,5";
//2010801751
$sql=$db->query($k);
$sql_num=$sql->rowCount();
while ($row=$sql->fetch(PDO::FETCH_BOTH)){
//start echoing
// echo "am here";
$formNo=$row['formNo'];
$formType=$row['level'];
$gsm='234'.substr($row['gsm'],1);
echo '<br>';
//$trans=substr($phoneNumber,7);
//finishing echoing
if ($formType=='dptForm'){
$message2='Dear Applicant,
Kindly upload and re-confirm your olevel results and register for JAMB PT on or before Fri 11 Nov., 2022 for Screening Exercise.';
}
if ($formType=='utmeForm'){
$message2='Dear Applicant,
Kindly upload your O\'level result(s) scanned copy on or before Fri 11 Nov., 2022 for Screening Exercise.';
}
if ($formType=='hndForm'){
$message2='Dear Applicant,
Kindly upload your ND and O\'level result(s) scanned copy on or before Fri 11 Nov., 2022 for Screening Exercise.';
}
$message2='<b>Screening Details:</b> Date :'.$day.', Venue: '.$venue.', Time: '.$sTime. ', Kindly Come with the REPRINTED copy of your App Form';
// echo $message='You have been invited for an entrance Exam on '. $day .' by '.$sTime. ' @ '. $venue.' also advised to reprint your completed form and bring it along';
// echo $row['sn'];
//==========================
$message = $message2;
$senderid = 'FedPolyEde';
// $to=$gsm;
$to = $gsm;
// $token = 'DdyxDgGoJURC0W88O73e2e5Ymts6S6LlRtuWVdAhnk8oJ0WQep7sXMBBTutLdlbG6fLv3QgRitauRuUnelwjYP2DX7VurbHPe1j1';
$token = 'R3W0ASfjM1bxptBvFTKORf2s1qBMONjTNxAWmOOAHV62cdR4rY';
// $baseurl = 'https://smartsmssolutions.com/api/json.php?';
$baseurl = 'https://app.smartsmssolutions.com/io/api/client/v1/sms/';
$sms_array = array
(
'sender' => $senderid,
'to' => $to,
'message' => $message,
'type' => '0',
'routing' => 3,
'token' => $token
);
$params = http_build_query($sms_array);
$ch = curl_init();
// $curl = curl_init();
//
// curl_setopt_array($curl, array(
// CURLOPT_URL => 'https://app.smartsmssolutions.com/io/api/client/v1/sms/',
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => '',
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => 'POST',
// CURLOPT_POSTFIELDS => array('token' => 'your-apix-token','sender' => 'sender-id','to' => '080xxxxxxxx','message' => 'message-content','type' => 'mesasge-type','routing' => 'routing','ref_id' => 'unique-ref-id','simserver_token' => 'simserver-token','dlr_timeout' => 'dlr-timeout','schedule' => 'time-in-future'),
// ));
//
// $response = curl_exec($curl);
//
// curl_close($curl);
// echo $response;
//
curl_setopt($ch, CURLOPT_URL, $baseurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
echo curl_error($ch);
curl_close($ch);
$decoded_result = json_decode($response);
//echo "<pre>";
//var_dump($decoded_result);
//echo "</pre>";
$codeID= $decoded_result->code; // response code
//$arrObj = json_decode($response,true);
//$dept=$arrObj['$response'][0]['code'];
//if
// echo $codeID;
//============================
//$get_sms = sendsms_get($username, $password, $message2, $senderid, $recipients);
if ($codeID==1000){
$count+=1;
$db->query("UPDATE `stddata` SET `smsSent` = '1' WHERE `formNo` = '$formNo'");
}else{
$noCount+=1;
}
// die();
}
echo $count.'Messages Sent<br>';
echo $noCount. 'Message rejected '.$codeID;
?>