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.133.113.24
Current Path : /var/www/html/sms/ |
| Current File : /var/www/html/sms/vskub_pget_smsstat.php |
<?php
//lib16107 lib16103
ini_set('display_errors', 'on');
include("sendsmsapiv1.php");
include("../consts.php");
ini_set('memory_limit','900M');
ini_set('max_execution_time',900);
$conn = new mysqli(SERVERNAME,USERNAME,PASSWORD);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$query = "select concat(group_concat(fdegree, ':', fcnt separator ', '), ', Total:', sum(fcnt)) as fmsg,
date_format(now(),'%d.%m.%y') as fdate
from (
select b.fdegree, count(a.fappno) as fcnt from logisys3_vku.entstudadm a, logisys3_vku.entoptdeg b
where a.fappno = b.fappno and ifnull(a.fpaystatus,'') = 'success'
group by b.fdegree) a";
$result3 = mysqli_query($conn,$query);
$count3 = mysqli_num_rows($result3);
$query = "select sum(FTOTFEE) as totfee from logisys3_vku.entstudadm where ifnull(fpaystatus,'') = 'success'";
$res = mysqli_query($conn,$query);
$row = mysqli_fetch_assoc($res);
$totfee = $row['totfee'];
if($count3 >0)
{
$row3 = mysqli_fetch_assoc($result3);
$text = "VSKUB PG Applications Received as on ".$row3['fdate']." : ";
$text .= $row3['fmsg']." Tot. Fee Rec.: ".moneyFormatIndia($totfee);
$univcode = "026";
$fevent = "PGETSTAT";
$to = "919741089633,918277684424,919845532688,918050332452,919448640369,919916621078,917892474292";
//$to = "919741089633,918277684424,919845532688";
$usertype = "600";
$sentuser = "PGET_STAT";
$sms = new SMS($univcode, $fevent);
$sms->sendBulkSms($to, $text, $usertype, $sentuser);
}
function moneyFormatIndia($num) {
$explrestunits = "" ;
if(strlen($num)>3) {
$lastthree = substr($num, strlen($num)-3, strlen($num));
$restunits = substr($num, 0, strlen($num)-3); // extracts the last three digits
$restunits = (strlen($restunits)%2 == 1)?"0".$restunits:$restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping.
$expunit = str_split($restunits, 2);
for($i=0; $i<sizeof($expunit); $i++) {
// creates each of the 2's group and adds a comma to the end
if($i==0) {
$explrestunits .= (int)$expunit[$i].","; // if is first value , convert into integer
} else {
$explrestunits .= $expunit[$i].",";
}
}
$thecash = $explrestunits.$lastthree;
} else {
$thecash = $num;
}
return $thecash; // writes the final format where $currency is the currency symbol.
}
?>
|