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.149.27.153


Current Path : /proc/thread-self/root/var/www/html/bcu/
Upload File :
Current File : //proc/thread-self/root/var/www/html/bcu/admStatisticstot.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(FPHONE,'') as fphone, IFNULL(femail,'') as femail
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;
	$table = '<center><h2>'.$funivname.'</h2>
						<h3>Admission Statistics as on '.$ftime.'</h3>';
	echo  $table;					
	while($row = mysqli_fetch_assoc($result))
	{
		$fcollcode = $row['fcollcode'];
		$femail = $row['femail'];
		$fcollname = $row['fcollname'];
		$fmobile = $row['fmobile'];
		$fphone = $row['fphone'];
		$cc = "bcureply@gmail.com";

		$subject = $fcollcode." - Admission Statistics (2018)";

		$query1 = "SELECT c.fcollcode, c.fdegree, a.fdescpn AS fdescpn, 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 
		INNER JOIN {$admdb}.degree a ON c.fdegree = a.fdegree AND a.fexamno = 'A' 
		WHERE c.fcollcode = '{$fcollcode}' 
		and ifnull(c.fdeleted,'') <> 'T' 
		GROUP BY c.fcollcode, c.fdegree";	

		$result1 = mysqli_query($conn,$query1);
		//var_dump($result1);
		$count = mysqli_num_rows($result);
		if($count > 0)
		{	
			
			$table = '<h4><center>'.$fcollcode.' - '.$fcollname.'</center></h4>
			<table style="margin-left:2px;text-align: left;width: 50%"  border="1" cellpadding="10" cellspacing="0" >
				<thead>
					<tr style = "background-color:#8acc51">
						<th width="5%" align="center"><b>Sl. No.</b></th>
						<th width="8%" align="center"><b>Degree Code</b></th>
						<th width="70%" align="left"><b>Degree Name</b></th>
						<th width="20%" align="center"><b>No. of Students</b></th>
					</tr>
				</thead>
				<tbody>';
			$y = 1;
			$totfcount = 0;
			$totfactive = 0;
			$totfentered = 0;
			$totffinsubdone = 0;
			$totfackdone = 0;
			$fackpending = 0;
			$ackpnd = 0;
			while($row = mysqli_fetch_assoc($result1))
			{
				$ackpnd = intval($row ['fcount']) - intval($row ['fackdone']);
				$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($ackpnd);


				$table .= '<tr>
					<th align="center">'.$y.'</th>
					<th  align="center">'.$row ['fdegree'].'</th>
					<th  align="left">'.$row ['fdescpn'].'</th>
					<th  align="center">'.$row ['fackdone'].'</th>
				</tr>';
				$y++;
			}

			$table .= '<tr>
					<td  align="center" colspan="3"><b>Total</b></td>
					<td  align="center"><b>'.$totfackdone.'</b></td>
				</tr></tbody></table>';
			echo $table;
		}	

	}	
}

?>