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.144.227.73
<?php
//lib16107 lib16103
ini_set('display_errors', 'on');
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
/*$servername = "97.74.228.93";
$username = "logisys3_logu";
$password = "Logisys@2106";*/
$servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
$username = 'admin';
$password = 'Logisys2104';
/*$servername = "localhost";
$username = "root";
$password = "";*/
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$admdb = "logisys3_bnu";
$query = "select DATE_FORMAT(sysdate(), '%M %d %Y, %h : %m %p') as ftime, funivname from {$admdb}.control";
$result = mysqli_query($conn,$query);
while($row = mysqli_fetch_assoc($result))
{
$ftime=$row['ftime'];
$funivname=$row['funivname'];
}
$query="select d.forder,d.fdegree,d.fdescpn,count(o.fappno) appcnt,ifnull(e.subapp,0) finalsub,ifnull(e.feeapp,0) feepaid from {$admdb}.entdeg d
left join {$admdb}.entoptdeg o on d.fdegree=o.fdegree
left join (select e1.fdegree,
sum(case when e2.ffinsub='T' then 1 else 0 end) subapp,
sum(case when e2.fpaystatus='success' then 1 else 0 end) feeapp
from {$admdb}.entoptdeg e1,{$admdb}.entstudadm e2 where e1.fappno=e2.fappno group by e1.fdegree) e
on e.fdegree=d.fdegree
group by d.fdegree,d.fdescpn
order by d.forder";
/*$query = "select c.fcollcode, concat(c.fcollname, ', ', c.ftown) as fcollname, c.fmobile, c.fphone, c.femail, ifnull(fcount,0) + ifnull(fenterednb,0) as fcount,
ifnull(factive,0) as factive,
IFNULL(finsubdone,0) AS ffinsubdone,
ifnull(fcount,0) + ifnull(fenterednb,0)-IFNULL(finsubdone,0) as fadmpend,
IFNULL(fackdone,0) AS fackdone,
ifnull(fcount,0) + ifnull(fenterednb,0)-IFNULL(fackdone,0) as fackpend,
ifnull(h.fapprdone,0) as fapprdone, (ifnull(fackdone,0) - ifnull(h.fapprdone,0)) as fapprpend
from {$admdb}.college c
LEFT JOIN(SELECT COUNT(fmobileno) AS fcount, SUM(IF(IFNULL(factive,'') = 'T',1,0)) AS factive, fcollcode
from {$admdb}.collstud
WHERE ifnull(fdeleted,'') <> 'T' and fdegree like 'b%'
group by fcollcode) s
ON c.fcollcode = s.fcollcode
LEFT JOIN (SELECT COUNT(fappno) AS fenterednb, fcollcode
from {$admdb}.studadm
WHERE ifnull(fcontact_no,'') in(select fid from {$admdb}.collstudnb)
and ifnull(fdeleted,'') <> 'T' and fdegree like 'b%'
group by fcollcode
) g ON c.fcollcode = g.fcollcode
LEFT JOIN (SELECT COUNT(fappno) AS finsubdone, fcollcode
from {$admdb}.studadm
WHERE IFNULL(ffinsub,'') = 'T' and ifnull(fdeleted,'') <> 'T' and fdegree like 'b%'
group by fcollcode
) e ON c.fcollcode = e.fcollcode
LEFT JOIN (SELECT IFNULL(COUNT(fappno),0) AS fackdone, fcollcode
from {$admdb}.studadm WHERE IFNULL(ffinsub,'') = 'T'
AND IFNULL(fappstatus,'') = 'verified' and ifnull(fdeleted,'') <> 'T' and fdegree like 'b%'
group by fcollcode
) f ON c.fcollcode = f.fcollcode
LEFT JOIN (SELECT IFNULL(COUNT(fappno),0) AS fapprdone, fcollcode
from {$admdb}.studadm WHERE IFNULL(ffinsub,'') = 'T'
AND IFNULL(fappstatus,'') = 'verified' and fapprstatus = 'approved' and ifnull(fdeleted,'') <> 'T'
and fdegree like 'b%'
group by fcollcode
) h ON c.fcollcode = h.fcollcode
WHERE ifnull(c.fdeleted,'') <> 'T' and c.ffaculty like '%UG%'
GROUP BY c.fcollcode
order by c.fcollcode";
*/
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count >0)
{
$i = 0;
$y = 1;
$nodata=0;
$apprready=0;
$c1=0;
$c2=0;
$c3=0;
$c4=0;
$c5=0;
$c6=0;
$c7=0;
$c8=0;
$table = '<center><h2>'.$funivname.'</h2>
<h2>PG Application Statistics as on '.$ftime.'</h2>';
echo $table;
$table = '
<style>
table{
width:100%;
table-layout: fixed;
}
</style>
<table style="text-align: left;width: 100%;" border="1" cellpadding="10" cellspacing="0">
<thead style = "">
<tr style = "background-color:#8acc51">
<th width="5.5%" align="center"><b>Sl. No.</b></th>
<th width="6.5%" align="center"><b>Degree</b></th>
<th width="40%" align="left"><b>Description</b></th>
<th width="8%" align="center"><b>No. of Application</b></th>
<th width="8%" align="center"><b>Final Submission</b></th>
<th width="8%" align="center"><b>Fee Paid</b></th>
</tr>
</thead>
</table>
<table style="text-align: left;width: 100%;" border="1" cellpadding="10" cellspacing="0">
<tbody >';
echo $table;
while($row = mysqli_fetch_assoc($result))
{
$forder = $row['forder'];
$fdegree = $row['fdegree'];
$fdescpn = $row['fdescpn'];
$appcnt = $row['appcnt'];
$finalsub = $row['finalsub'];
$feepaid = $row['feepaid'];
$ltr='<tr>';
/*
if($appcnt > 0)
{
/*if(($fackpend * 100/intval($row ['fcount'])) < 10)
{
$ltr='<tr style = "background-color:#c1f28a">';
$apprready++;
}*//*
if($fapprdone > 0)
{
$ltr='<tr style = "background-color:#c1f28a">';
$apprready++;
}
}
else
{
$ltr='<tr style = "background-color:#f4a442">';
$nodata++;
}*/
$table = ''.$ltr.'
<td width="7%" align="center">'.$forder.'</td>
<td width="9%" align="center">'.$fdegree.'</td>
<td width="53%" align="left">'.$fdescpn.'</td>
<td width="10.5%" align="center">'.$appcnt.'</td>
<td width="11%" align="center">'.$finalsub.'</td>
<td width="10.5%" align="center">'.$feepaid.'</td>
</tr>';
echo $table;
$y++;
$c1=$c1+$appcnt;
$c2=$c2+$finalsub;
$c3=$c3+$feepaid;
}
$ltr='<tr style = "background-color:#8acc51">';
$table = ''.$ltr.'
<td width="5%" align="center"></td>
<td width="5%" align="center"></td>
<td width="30%" align="left"><b>Total</b></td>
<td align="center"><b>'.$c1.'</b></td>
<td align="center"><b>'.$c2.'</b></td>
<td align="center"><b>'.$c3.'</b></td>
</tr>';
echo $table;
$y--;
$ltr='</table><br><table style="text-align: left;width: 25%;" border="1" cellpadding="10" cellspacing="0"><tr>';
$table = ''.$ltr.'
<td width="40%" align="left"><b>Total Courses</b></td>
<td width="10%" align="center"><b>'.$y.'</b></td>
</tr>';
echo $table;
$table = '
<td width="40%" align="left"><b>No. of Application</b></td>
<td width="10%" align="center"><b>'.$c1.'</b></td>
</tr>';
echo $table;
//$inprogress = intval($y)-(intval($nodata) + intval($apprready));
$table = '
<td width="40%" align="left"><b>Submission Done</b></td>
<td width="10%" align="center"><b>'.$c2.'</b></td>
</tr>';
echo $table;
$table = '
<td width="40%" align="left"><b>Submission with Fee paid</b></td>
<td width="10%" align="center"><b>'.$c3.'</b></td>
</tr>';
echo $table;
}
?>
|