Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.137.189.236
<?php
require_once('DbConnect.php');
ini_set('display_errors', 'on');
include("sendnotif.php");
ini_set('memory_limit','900M');
ini_set('max_execution_time',1800);
//$fmobileno = $_GET['fmobileno'];
$query = "SELECT fid, fmobappid, ftitle,fmobileno, fbody FROM pushnotif
where ifnull(fmobileno,'') <> '' and fenttype in('RE') and funivcode = '023'
and ifnull(fstatus,'') <> 'T'";
$result = mysqli_query($conn, $query);
$count = mysqli_num_rows($result);
if ($count > 0) {
$i = 0;
while ($row = mysqli_fetch_assoc($result)) {
// $to = $row['mobileno'];
// $text = $row['fmessage'];
$fmobileno = $row['fmobileno'];
$registrationIds = array($row['fmobappid']);
// var_dump($registrationIds);
$msg = array(
'title' => $row['ftitle'],
'body' => $row['fbody'],
'icon' => 'ic_launcher'
);
$notifresp = sendNotification($registrationIds, $msg);
echo $notifresp;
echo $fmobileno;
$rgTrimedMobs[$i] = $fmobileno;
if($i == 50)
{
$srtImplodedMobs = implode("','",$rgTrimedMobs);
$strUpdateQuery = "update pushnotif set fstatus = 'T' where fmobileno in ('{$srtImplodedMobs}')";
// var_dump($strUpdateQuery);
$result2 = mysqli_query($conn,$strUpdateQuery);
unset($rgInsert);
$rgInsert = array();
unset($rgTrimedMobs);
$rgTrimedMobs = array();
$i = 0;
}
$i++;
}
$srtImplodedMobs = implode("','",$rgTrimedMobs);
$strUpdateQuery = "update pushnotif set fstatus = 'T' where fmobileno in ('{$srtImplodedMobs}')";
$result2 = mysqli_query($conn,$strUpdateQuery);
echo "SMS Sent";
}
|