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 : 18.188.218.134
<?php
//lib16107 lib16103
ini_set('display_errors', 'on');
include("sendsmsapi.php");
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);
$univcode = trim($_GET['funivcode']);
$univcode = '027';
//ST180220202 041 photocopy
if($univcode == '')
{
die();
}
//connect to database
$servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
$username = "admin";
$password = "Logisys2104";
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$commondb = "logisys3_comexam";
$query = "select funivcode, fregno, fenttype, fmobileno as mobileno,
concat(fmessage, ' Sent Time: ',time(now())) as fmessage
from {$commondb}.sendsms
where ifnull(fstatus, 'F') = 'F' and fenttype = 'st20032020'
and funivcode = '{$univcode}'
and fmobileno is not null";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
$username = 'logisyhttp';
$password = 'Logis986';
$from = 'UNISOL';
$category = '';
if($count >0)
{
$i = 0;
$text = "";
while($row = mysqli_fetch_assoc($result))
{
$to = $row['mobileno'];
$text = $row['fmessage'];
$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);
echo $i." - ".$to."<br>";
$rgInsert[] = "('".$row['funivcode']."','".$row['fregno']."','{$to}','0','{$smsresp}','".$row['fenttype']."','T', DATE_FORMAT(NOW(),'%Y-%m-%d'), DATE_FORMAT(NOW(),'%T'))";
$rgTrimedMobs[$i] = $to;
echo $i.$to."<br>";
if($i == 50)
{
$strInsertQuery = "insert into {$commondb}.smslog(funivcode, fregno,fmobileno, freasoncode, fguid, fenttype, fstatus,fackdate, facktime) values".implode(',',$rgInsert);
//var_dump($strInsertQuery);
$result1 = mysqli_query($conn,$strInsertQuery);
$srtImplodedMobs = implode("','",$rgTrimedMobs);
$strUpdateQuery = "update {$commondb}.sendsms set fstatus = 'T' where fenttype = 'st20032020'
and fmobileno in ('{$srtImplodedMobs}')";
//var_dump($strUpdateQuery);
$result2 = mysqli_query($conn,$strUpdateQuery);
unset($rgInsert);
$rgInsert = array();
unset($rgTrimedMobs);
$rgTrimedMobs = array();
$i = 0;
}
$i++;
}
$strInsertQuery = "insert into {$commondb}.smslog(funivcode,fregno,fmobileno, freasoncode, fguid, fenttype, fstatus,fackdate, facktime) values".implode(',',$rgInsert);
//var_dump($strInsertQuery);
$result1 = mysqli_query($conn,$strInsertQuery);
$srtImplodedMobs = implode("','",$rgTrimedMobs);
$strUpdateQuery = "update {$commondb}.sendsms set fstatus = 'T'
where fenttype = 'st20032020' and fmobileno in ('{$srtImplodedMobs}')";
//var_dump($strUpdateQuery);
$result2 = mysqli_query($conn,$strUpdateQuery);
$username = 'logisyhttp';
$password = 'Logis986';
$from = 'UNISOL';
$category = 'bulk';
//pg test
//$to = "919741089633,918277684424,919844020272,919845532688,919480278729,919886494428,919900120447,919986554632";
//PHD
//$to = "919741089633,918277684424,919844020272,919845532688,919480278729,919449259058,919986554632";
//Arun and Prashant, mohan, ramesh, mahesh
//$to = "919741089633,918277684424,919845532688,919844020272,919986554632";
//BCU : Arun and Prashant, mohan, ramesh, mahesh,RE
// $to = "919741089633,918277684424,919845532688,919844020272,919986554632,919448419939";
//Arun and Prashant, mohan, niranjan,RE Madam
//$to = "919741089633,918277684424,919845532688,919964040441,919845559557";
//rcub
$to = "918277684424,919845532688,919844020272,919844059406,919741089633,919538618751,919449575108,919448238385,919448008278,919844218894,919036948843";
$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);
echo $smsresp;
}
?>
|