0xV3NOMx
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.129.70.138


Current Path : /var/www/html/dud/
Upload File :
Current File : /var/www/html/dud/admcollsum_college.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 fcollcode, fprincipalname, CONCAT(FCOLLNAME,', ',FTOWN) AS fcollname,
IFNULL(fmobile,''),IFNULL(femail,'') as femail
FROM {$admdb}.college WHERE fdeleted <> 'T' AND IFNULL(femail,'') <> '' and ifnull(fadmstatus,'') = 'A' order by fcollcode";
*/
$query = "SELECT fcollcode, fprincipalname, CONCAT(FCOLLNAME,', ',FTOWN) AS fcollname,
IFNULL(fmobile,''),IFNULL(femail,'') as femail
FROM {$admdb}.college WHERE ffaculty like 'UG%' 
and ifnull(fdeleted,'') <> 'T' order by fcollcode";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);



if($count >0)
{
	$i = 0;
	$y = 1;
	$table = '<center><h2>Bengaluru Central University</h2>
						<h2>Admission Statistics</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="40%" align="left"><b>College Name</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>
				<div style = "height:100%; overflow:auto;">
				<table tyle="margin-left:2px;text-align: left;width: 100%;height:100%; overflow:auto;"  border="1" cellpadding="10" cellspacing="0">
				<tbody >';	
	echo $table;
	while($row = mysqli_fetch_assoc($result))
	{
		$fcollcode = $row['fcollcode'];
		$femail = $row['femail'];
		$fcollname = $row['fcollname'];
		//$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(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, fdegree 
		FROM {$admdb}.studadm 
		WHERE fcollcode = '{$fcollcode}'  and ifnull(fdeleted,'') <> 'T'
		GROUP BY fdegree) d ON c.fcollcode = d.fcollcode 
		AND c.fdegree = d.fdegree LEFT JOIN (SELECT COUNT(fappno) AS finsubdone, fcollcode, fdegree 
		FROM {$admdb}.studadm 
		WHERE fcollcode = '{$fcollcode}' AND IFNULL(ffinsub,'') = 'T' and ifnull(fdeleted,'') <> 'T'
		GROUP BY fdegree) e ON c.fcollcode = e.fcollcode 
		AND c.fdegree = e.fdegree LEFT JOIN (SELECT IFNULL(COUNT(fappno),0) AS fackdone, fcollcode, fdegree 
		FROM {$admdb}.studadm WHERE fcollcode = '{$fcollcode}' AND IFNULL(ffinsub,'') = 'T' 
		AND IFNULL(fappstatus,'') = 'verified' and ifnull(fdeleted,'') <> 'T'
		GROUP BY fdegree) f ON c.fcollcode = f.fcollcode AND c.fdegree = f.fdegree 
		LEFT JOIN (SELECT IFNULL(COUNT(fappno),0) AS fackpending, fcollcode, fdegree 
		FROM {$admdb}.studadm WHERE fcollcode = '{$fcollcode}' AND IFNULL(ffinsub,'') = 'T' 
		AND IFNULL(fappstatus,'') <> 'verified' and ifnull(fdeleted,'') <> 'T'
		GROUP BY fdegree) x ON c.fcollcode = x.fcollcode AND c.fdegree = x.fdegree 
		WHERE c.fcollcode = '{$fcollcode}' 
		GROUP BY c.fcollcode";	

		$result1 = mysqli_query($conn,$query1);
	//	var_dump($result1);

		$count = mysqli_num_rows($result);
		if($count > 0)
		{	
			
			$totfcount = 0;
			$totfactive = 0;
			$totfentered = 0;
			$totffinsubdone = 0;
			$totfackdone = 0;
			$fackpending = 0;

			while($row = mysqli_fetch_assoc($result1))
			{
				$totfcount += intval($row['fcount']);
				$totfactive += intval($row['factive']);
				$row['fentered'] = intval($row['fcount']) - intval($row['ffinsubdone']); 
				$totfentered += intval($row['fentered']);
				$totffinsubdone += intval($row['ffinsubdone']);
				$totfackdone += intval($row['fackdone']);
				$fackpending += intval($row['fackpending']);


				$table = '<tr>
					<td width="5%" align="center">'.$y.'</td>
					<td  width="8%" align="center">'.$fcollcode.'</td>
					<td width="40%"  align="left">'.$fcollname.'</td>
					<td  align="center">'.$row ['fcount'].'</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  align="center">'.$row ['fackpending'].'</td>
				</tr>';
				$y++;
				echo $table;
			}
		}	

	}	
	
}

?>