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 : 13.59.58.68
<?php
//lib16107 lib16103
ini_set('display_errors', 'on');
include("sendsmsapi.php");
include("sendGridMail.php");
$servername = "97.74.228.93";
$username = "logisys3_logu";
$password = "Logisys@2106";
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$admdb = "logisys3_bcu";
$query = "select a.ftotstud, a.flogincted, a.floginpend,
(a.ftotstud - b.ffinsubcnt) as fregnpend,
b.fregncnt, b.ffinsubcnt, b.ffinsubpendcnt, b.fackcnt,
(a.ftotstud - b.fackcnt) as fackpend,
c.fgrvcnt, c.fgrvcleared, c.fgrvpend,
control.funivmobile, date_format(now(), '%d/%m/%Y %r') as fdate from
(select '1' as id, count(fmobileno) as ftotstud,
sum(if(ifnull(factive,'') = 'T',1,0)) as flogincted,
sum(if(ifnull(factive,'') <> 'T',1,0)) as floginpend from {$admdb}.collstud) a
inner join ( select '1' as id, count(fcontact_no) as fregncnt,
sum(if(ifnull(ffinsub,'') = 'T', 1, 0)) as ffinsubcnt,
sum(if(ifnull(ffinsub,'') <> 'T', 1, 0)) as ffinsubpendcnt,
sum(if(ifnull(fappstatus,'') = 'verified', 1, 0)) as fackcnt from {$admdb}.studadm) b
on a.id = b.id inner join (select '1' as id, count(*) as fgrvcnt,
sum(if(ifnull(fgrvstatus,'') = 'C',1,0)) as fgrvcleared,
sum(if(ifnull(fgrvstatus,'') <> 'C',1,0)) as fgrvpend from {$admdb}.grvhead) c
on b.id = c.id inner join {$admdb}.control";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
$username = 'logisyhttp';
$password = 'Logis986';
$from = 'UNISOL';
$category = 'bulk';
if($count >0)
{
$i = 0;
$row = mysqli_fetch_assoc($result);
$to = $row['funivmobile'];
$text = "Bengaluru Central University, Admission Statistics
Total Students Data Recieved from Colleges : {$row['ftotstud']}".chr(13)."
Students registered in the portal : {$row['flogincted']}".chr(13)."
Admission registration completed : {$row['ffinsubcnt']}".chr(13)."
Admission registration pending : {$row['fregnpend']}".chr(13)."
Acknowledgement Done by Colleges : {$row['fackcnt']}".chr(13)."
Acknowledgement Pending by Colleges : {$row['fackpend']}".chr(13)."
Grievance received from students : {$row['fgrvcnt']}".chr(13)."
Grievance cleared / answered : {$row['fgrvcleared']}";
$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);
// var_dump($smsresp);
$table = '<center><h2>Bengaluru Central University <br> Admission Statistics as on '.$row['fdate'].'</center></h2><center><table style="margin-left:2px;text-align: left;width: 60%;font-size:14px;margin: auto;" align-self="middle" cellspacing="1" cellpadding="5" border="0" align="center" bgcolor="#505151">
<thead>
<tr style = "background-color:#8acc51">
<th width="8%"><center>Sl. No.</center></th>
<th><center>Title</center></th>
<th width="15%"><center>Count</center></th>
</tr>
</thead>';
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Total Students Data Recieved from Colleges</td>";
$table .= "<td align='right'>".moneyFormatIndia( $row['ftotstud'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Students registered in the portal</td>";
$table .= "<td align='right'>".moneyFormatIndia($row['flogincted'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Admission registration completed</td>";
$table .= "<td align='right'>".moneyFormatIndia($row['ffinsubcnt'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Admission registration pending </td>";
$table .= "<td align='right'>".moneyFormatIndia($row['fregnpend'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Acknowledgement Done by Colleges</td>";
$table .= "<td align='right'>".moneyFormatIndia($row['fackcnt'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Acknowledgement Pending by Colleges</td>";
$table .= "<td align='right'>".moneyFormatIndia($row['fackpend'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Grievance received from students</td>";
$table .= "<td align='right'>".moneyFormatIndia($row['fgrvcnt'])."</td>";
$table .= "</tr>";
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".++$i."</center></td>";
$table .= "<td>Grievance cleared / answered</td>";
$table .= "<td align='right'>".moneyFormatIndia($row['fgrvcleared'])."</td>";
$table .= "</tr>";
$table.="</table></center>";
$subject = "Bengaluru Central University Admission Statistics as on ".$row['fdate'];
echo $table;
$emails = ['prashanth.k@logisys.org','arun.v@logisys.org', 'mohanlyrix@gmail.com', 'hnnagaraj@lordshire.com', 'hnramesh@logisys.org', 'registrarevlubcu@gmail.com', 'registrarbcu@gmail.com', 'nausheen@lordshire.com'];
$cc = '';
for($i=0;$i< count($emails); $i++)
{
$emailid = $emails[$i];
$resp = sendGridMail($emailid,$subject,$table,'');
echo $resp;
}
}
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.
}
?>
|