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.191.192.113
Current Path : /var/www/html/gug/ |
| Current File : /var/www/html/gug/admcollsum.php |
<?php
//lib16107 lib16103
ini_set('display_errors', 'on');
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);
$servername = "97.74.228.93";
$username = "logisys3_logu";
$password = "Logisys@2106";
/*$servername = "localhost";
$username = "root";
$password = "";*/
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$admdb = "logisys3_bcu";
$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 fcollcode, fprincipalname, CONCAT(FCOLLNAME,', ',FTOWN) AS fcollname,
IFNULL(fmobile,'') as fmobile,IFNULL(femail,'') as femail,ifnull(FPHONE,'') as FPHONE
FROM {$admdb}.college WHERE ifnull(fdeleted,'') <> 'T' and ffaculty like 'UG%' order by fcollcode";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count >0)
{
$i = 0;
$y = 1;
$table = '<center><h2>'.$funivname.'</h2>
<h2>Admission 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%" align="center"><b>Sl. No.</b></th>
<th width="8%" align="center"><b>College Code</b></th>
<th width="35%" align="left"><b>College Name</b></th>
<th width="10%" align="center"><b>College No.</b></th>
<th align="center"><b>No. of Students</b></th>
<th align="center"><b>Students Registered</b></th>
<th align="center"><b>Adm. Uploaded</b></th>
<th align="center"><b>Adm. Pending</b></th>
<th align="center"><b>Ack. Done</b></th>
<th align="center"><b>Ack. Pending</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))
{
$fcollcode = $row['fcollcode'];
$femail = $row['femail'];
$fcollname = $row['fcollname'];
$fmobile = $row['fmobile'];
$FPHONE = $row['FPHONE'];
//$femail = "mohanlyrix@gmail.com";
//$femail = "arun.v@logisys.org";
$cc = "bcureply@gmail.com";
$query1 = "SELECT c.fcollcode, COUNT(c.fmobileno) AS fcount,
SUM(IF(IFNULL(c.factive,'') = 'T',1,0)) AS factive,IFNULL(fentered,0) AS fentered, ifnull(fenterednb,0) as fenterednb,
IFNULL(finsubdone,0) AS ffinsubdone, IFNULL(fackdone,0) AS fackdone,ifnull(fackpending,0) as fackpending
FROM {$admdb}.collstud c
LEFT JOIN (SELECT COUNT(fappno) AS fentered, fcollcode
FROM {$admdb}.studadm
WHERE fcollcode = '{$fcollcode}' and ifnull(fdeleted,'') <> 'T'
) d ON c.fcollcode = d.fcollcode
LEFT JOIN (SELECT COUNT(fappno) AS fenterednb, fcollcode
FROM {$admdb}.studadm
WHERE fcontact_no in(select fid from {$admdb}.collstudnb where fcollcode = '{$fcollcode}')
and fcollcode = '{$fcollcode}' and ifnull(fdeleted,'') <> 'T'
) g ON c.fcollcode = d.fcollcode
LEFT JOIN (SELECT COUNT(fappno) AS finsubdone, fcollcode
FROM {$admdb}.studadm
WHERE fcollcode = '{$fcollcode}' AND IFNULL(ffinsub,'') = 'T' and ifnull(fdeleted,'') <> 'T'
) e ON c.fcollcode = e.fcollcode
LEFT JOIN (SELECT IFNULL(COUNT(fappno),0) AS fackdone, fcollcode
FROM {$admdb}.studadm WHERE fcollcode = '{$fcollcode}' AND IFNULL(ffinsub,'') = 'T'
AND IFNULL(fappstatus,'') = 'verified' and ifnull(fdeleted,'') <> 'T'
) f ON c.fcollcode = f.fcollcode
LEFT JOIN (SELECT IFNULL(COUNT(fappno),0) AS fackpending, fcollcode
FROM {$admdb}.studadm WHERE fcollcode = '{$fcollcode}' AND IFNULL(ffinsub,'') = 'T'
AND IFNULL(fappstatus,'') <> 'verified' and ifnull(fdeleted,'') <> 'T'
) x ON c.fcollcode = x.fcollcode
WHERE c.fcollcode = '{$fcollcode}'
and ifnull(c.fdeleted,'') <> 'T'
GROUP BY c.fcollcode";
$result1 = mysqli_query($conn,$query1);
//echo $query1; die();
$count = mysqli_num_rows($result1);
if($count > 0)
{
$ackpnd = 0;
while($row = mysqli_fetch_assoc($result1))
{
//$tota$row ['fcount'];
$ltr='<tr>';
$ackpnd = intval($row ['fcount']) + intval($row ['fenterednb']) - intval($row ['fackdone']);
if(($ackpnd * 100/intval($row ['fcount'])) < 10)
{
$ltr='<tr style = "background-color:#8acc51">';
}
if($admdb = "logisys3_bcu")
{
$ltr='<tr>';
}
/*
if(($ackpnd * 100/intval($row ['fcount'])) > 90)
{
$ltr='<tr style = "background-color:#f4a442">';
}*/
$ltd='';
/*if(($ackpnd * 100/intval($row ['fcount'])) < 10)
{
$ltd=' style = "background-color:#8acc51" ';
}*/
$row ['fentered'] = intval($row ['fcount']) + intval($row ['fenterednb']) - intval($row ['ffinsubdone']);
$table = ''.$ltr.'
<td width="5%" align="center">'.$y.'</td>
<td width="8%" align="center">'.$fcollcode.'</td>
<td width="35%" align="left">'.$fcollname.'</td>
<td width="10%" align="center">'.$fmobile.' /'.$FPHONE.'</td>
<td align="center">'.(intval($row ['fcount']) + intval($row ['fenterednb'])).'</td>
<td align="center">'.$row ['factive'].'</td>
<td align="center">'.$row ['ffinsubdone'].'</td>
<td align="center">'.$row ['fentered'].'</td>
<td align="center">'.$row ['fackdone'].'</td>
<td'.$ltd.' align="center">'.$ackpnd.'</td>
</tr>';
$y++;
echo $table;
}
}
else
{
$table = '<tr style = "background-color:#f4a442">
<td width="5%" align="center">'.$y.'</td>
<td width="8%" align="center">'.$fcollcode.'</td>
<td width="35%" align="left">'.$fcollname.'</td>
<td width="10%" align="center">'.$fmobile.' /'.$FPHONE.'</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
</tr>';
$y++;
echo $table;
}
}
}
?>
|