MMCT TEAM
Server IP : 2a02:4780:3:1493:0:3736:a38e:7  /  Your IP : 216.73.216.139
Web Server : LiteSpeed
System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.40.1.lve.el8.x86_64 #1 SMP Wed Feb 12 18:54:57 UTC 2025 x86_64
User : u926327694 ( 926327694)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u926327694/domains/smsoft.in/public_html/demo/src/../accounts/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/src/../accounts/../dashboard.php
<?php 
    // First we execute our common code to connection to the database and start the session 
    require("common.php"); 
     
    // At the top of the page we check to see whether the user is logged in or not 
    if(!isset($_SESSION['user']) && !isset($_SESSION['Mng_User'])) 
    { 
        // If they are not, we redirect them to the login page. 
        header("Location: login.php"); 
         
        // Remember that this die statement is absolutely critical.  Without it, 
        // people can view your members-only content without logging in. 
        die("Redirecting to login.php"); 
    } 
    if(isset($_SESSION['user']))
    {
     $test=$_SESSION['user'];
     if($test['type']=="Student_Management")
     {
         
         header("Location: student_management_system/pages/dashboard.php");
         exit;
     }
    }
     
     
     
    // Everything below this point in the file is secured by the login system 
     
    // We can display the user's username to them by reading it from the session array.  Remember that because 
    // a username is user submitted content we must use htmlentities on it before displaying it to the user. 
    session_start();
    include"config/dbconnect.php";
    $SchoolCode=$_SESSION['code'];
    $sel_school=mysqli_query($con,"select schoolname,smsAPI from schools where schoolCode='$SchoolCode'");
    $SchoolName="";
    $secret = "";
    while($school_row=mysqli_fetch_array($sel_school))
    {
        $SchoolName=$school_row['schoolname'];
        $secret = $school_row['smsAPI'];
    }
    mysqli_close($con);

?>

<?php


        	
include './config/config.php';
mysqli_query($con,"ALTER TABLE `stud_basic` ADD `bus_info` VARCHAR(500) NULL AFTER `status`");
mysqli_query($con,"ALTER TABLE `stud_basic2` ADD `year` VARCHAR(20) NULL DEFAULT NULL AFTER `discription`");
if(!$total_students_res=mysqli_query($con,"SELECT COUNT(`Stud_Id`) FROM `stud_basic` where Class!='' and division!=''"))
{
	echo("Error description: " . mysqli_error($con));
}
$total_students=mysqli_fetch_array($total_students_res);

$padi_pre_year = date("Y");
$paid_current_year = date("Y") + 1;

/*$paid_amount_res=mysqli_query($con,"SELECT sum(Grand_Total) FROM `paid_fees` where Paid_date between '$padi_pre_year-04-01' and '$paid_current_year-03-31'");
$paid_amount=mysqli_fetch_array($paid_amount_res);*/


$paid_amount_res=mysqli_query($con,"SELECT SUM(`Paid`) FROM `stud_basic2`");
$total_amount=mysqli_fetch_array($total_amount_res);

$paid_amount_res1=mysqli_query($con,"SELECT IFNULL(SUM(`Paid`), 0) FROM `stud_basic2` inner join stud_basic on stud_basic.Stud_Id = stud_basic2.Stud_Id where year is null");
$paid_amount=mysqli_fetch_array($paid_amount_res1);

$paid_amount_res1_2023=mysqli_query($con,"SELECT IFNULL(SUM(`Paid`), 0) FROM `stud_basic2` inner join stud_basic on stud_basic.Stud_Id = stud_basic2.Stud_Id where year=2023");
$paid_amount_2023=mysqli_fetch_array($paid_amount_res1_2023);

$todaydate=Date('Y-m-d');

$paid_amount_today=mysqli_query($con,"SELECT SUM(`Grand_Total`) FROM `paid_fees` where Paid_date='$todaydate'");

$TodayCollection=mysqli_fetch_array($paid_amount_today);

$balance_amount_res=mysqli_query($con,"SELECT IFNULL(SUM(`Balance`), 0) FROM `stud_basic2` inner join stud_basic on stud_basic.Stud_Id = stud_basic2.Stud_Id where year is null");
$balance_amount=mysqli_fetch_array($balance_amount_res);

$balance_amount_res_2023=mysqli_query($con,"SELECT IFNULL(SUM(`Balance`), 0) FROM `stud_basic2` inner join stud_basic on stud_basic.Stud_Id = stud_basic2.Stud_Id where year=2023");
$balance_amount_2023=mysqli_fetch_array($balance_amount_res_2023);

/*$total_pre_year = date("Y") - 1;
$total_current_year = date("Y");

$total_amount_res=mysqli_query($con,"SELECT sum(Grand_Total) FROM `paid_fees` where Paid_date between '$total_pre_year-04-01' and '$total_current_year-03-31'");
$total_amount=mysqli_fetch_array($total_amount_res);*/

$total_amount_res_1=mysqli_query($con,"SELECT IFNULL(SUM(Total_Amount), 0) FROM `stud_basic2` inner join stud_basic on stud_basic.Stud_Id = stud_basic2.Stud_Id where year is null");
$total_amount_1=mysqli_fetch_array($total_amount_res_1);

$total_amount_res_1_2023=mysqli_query($con,"SELECT IFNULL(SUM(Total_Amount), 0) FROM `stud_basic2` inner join stud_basic on stud_basic.Stud_Id = stud_basic2.Stud_Id where year=2023");
$total_amount_1_2023=mysqli_fetch_array($total_amount_res_1_2023);



$online_app_res=mysqli_query($con,"SELECT COUNT(`Fees_id`) FROM `paid_fees` WHERE `Mode` = 'Online' and `flag` = '0'");
$online_app=mysqli_fetch_array($online_app_res);

?>




<!DOCTYPE html>
<html lang="en">
<head>
	
	<!-- start: Meta -->
	<meta charset="utf-8">
<title>Fees Management</title>	<meta name="description" content="Bootstrap Metro Dashboard">
	<meta name="author" content="Dennis Ji">
	<meta name="keyword" content="Metro, Metro UI, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
	<!-- end: Meta -->
	
	<!-- start: Mobile Specific -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- end: Mobile Specific -->
	
	<!-- start: CSS -->
	<link id="bootstrap-style" href="css/bootstrap.min.css" rel="stylesheet">
	<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
	<link id="base-style" href="css/style.css" rel="stylesheet">
	<link id="base-style-responsive" href="css/style-responsive.css" rel="stylesheet">
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,latin-ext' rel='stylesheet' type='text/css'>

	</style>





	


	<!-- end: CSS -->
	

	<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	  	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<link id="ie-style" href="css/ie.css" rel="stylesheet">
	<![endif]-->
	
	<!--[if IE 9]>
		<link id="ie9style" href="css/ie9.css" rel="stylesheet">
	<![endif]-->
		
	<!-- start: Favicon -->
	<link rel="shortcut icon" href="img/favicon.ico">
	<!-- end: Favicon -->
    <style type="text/css">
<!--
.style1 {
	color: #0000FF;
	font-weight: bold;
}
.style2 {font-size: 24px}
.style3 {
	color: #330099;
	font-weight: bold;
}
-->
.text-center {
    text-align: center!important;
}
    </style>
     
    
     
    
    
</head>

<body>
		<!-- start: Header -->
<?php
include "menu_f.php";
?>
	<!-- start: Header -->
	
		<div class="container-fluid-full">
		<div class="row-fluid">
				
			<!-- start: Main Menu -->
			<div id="sidebar-left" class="span2">
				<div class="nav-collapse sidebar-nav">
					<ul class="nav nav-tabs nav-stacked main-menu">
						<li><a href="dashboard.php"><i class="icon-bar-chart"></i><span class="hidden-tablet"> Dashboard</span></a></li>	
						
						



<?php

//replca menu.php with codes

	include "menu.php"; 							
						

?>
 	</ul>
				</div>
			</div>
			<!-- end: Main Menu -->
			
			<noscript>
				<div class="alert alert-block span10">
					<h4 class="alert-heading">Warning!</h4>
					<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
				</div>
			</noscript>
			
			<!-- start: Content -->
			<div id="content" class="span10">
			
			
			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="dashboard.php">Home</a>
					<i class="icon-angle-right"></i> 
				</li>
				<li>
				    <a href="#"><i class="icon-school"></i> <?php  echo $schoolName; ?></a>
				</li> 
				<li style="float: right;">
				    <?php   
                        $url = "https://smsc.kingdigital.in/index.php/creditsapi/credits/?secret=".$secret;   
                        $ch = curl_init();   
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);   
                        curl_setopt($ch, CURLOPT_URL, $url);   
                        $res = curl_exec($ch);
                        $result = json_decode($res, true);
                    ?>  
                    <p>
                        <?php /*
                        <div class="badge badge-primary"><b>Promotional : </b><?php echo (int)$result['promotional']; ?></div> */ ?>
                        <div class="badge badge-info"><b>SMS Balance : </b><?php echo (int)$result['api_transactional']; ?></div>
                        <?php /*
                        <div class="badge badge-success"><b>Promo Sender Id : </b><?php echo (int)$result['promo_sender_id']; ?></div> */ ?>
                    </p>
				</li>
			</ul>
			
				 <!--<form method="post"> 
        <input type="submit" name="button1"
                value="Last Year"/> 
          
        <input type="submit" name="button2"
                value="This Year"/> 
             </form> -->
             
             <?php
      
        if(isset($_POST['button1'])) { 
             $_SESSION['last_year']="2019";
             header("Refresh:0");
             include './config/config.php';
        } 
        if(isset($_POST['button2'])) { 
             unset($_SESSION['last_year']);
              header("Refresh:0");
              include './config/config.php';
        } 
    ?>
				<br>
			
				<div class="row-fluid">	
				<div class="box blue span12">
				    
				    
				    
				    
					<div class="box-header">
						<h2><i class="halflings-icon white white hand-top"></i><span class="break"></span>Quick Count</h2>
						<h2 style="float:right;"><span class="break"></span>Today Collection - <?php echo "Rs ".$TodayCollection[0]; ?></h2>
					</div>
					<div class="box-content">
						
						<a class="quick-button span2">
							<i class="icon-group"></i>
							<p>Students</p>
							<!--<p>&nbsp;</p>-->
							<span class="notification blue"><?php echo "$total_students[0]";  ?></span>
						</a>
						
						<a class="quick-button span2" href="reportsexcel.php">
							<i class="icon-certificate"></i>
							<p>Total Amount</p>
						<!--	<p>2023 (<?php echo "$total_amount_1_2023[0]";  ?>)</p>-->
							<span class="notification yellow"><?php echo "$total_amount_1[0]";  ?></span>

						</a>
						<a class="quick-button span2" href="recpt_report_excle.php">
							<i class="icon-asterisk"></i>
							<p>Paid Amount</p>
						<!--	<p>2023 (<?php echo $paid_amount_2023[0];  ?>)</p>-->
							<span class="notification green"><?php echo "$paid_amount[0]";  ?></span>
							<?php /*<span class="notification yellow" style="top: 25px;"><?php echo "$paid_amount1[0]";  ?></span>*/ ?>
						</a>
						<a class="quick-button span2" href="balancelistprint.php">
							<i class="icon-adjust"></i>
							<p>Balance Amount</p>
							<!--<p>2023 (<?php echo "$balance_amount_2023[0]";  ?>)</p>-->
							<span class="notification red"><?php echo "$balance_amount[0]";  ?></span>
						</a>
						<?php
						/*
 if(isset($_SESSION['user']) || isset($_SESSION['Mng_User']))
 {
	?>
						<a class="quick-button span2" href="online_approve.php">
							<i class="icon-warning-sign"></i>
							<p>Online Approve</p>
								<span class="notification red"><?php echo "$online_app[0]";  ?></span>
						</a>
<?php
} */
?>
                        <a class="quick-button span2" href="Student_entry.php">
							<i class="icon-user"></i>
							<p>Add Student</p>
				<!--	<p>&nbsp;</p>-->
						</a>
<?php
if(isset($_SESSION['user']))
{
?>
						<a class="quick-button span2" href="Pay_fees.php">
							<i class="icon-home"></i>
							<p>Pay Fees</p>
				<!--	<p>&nbsp;</p>-->
						</a>
						<?php
						}
						?>
						<div class="clearfix"></div>
					</div>	
				</div><!--/span-->
				
			</div>




					  	<div class="row-fluid">
				
				<div class="box span12 SchoolDetails">
					<div class="box-header">
						<h2><i class="halflings-icon white th"></i><span class="break"></span>School Intake</h2>
						<div class="box-icon"><!--a href="testexcel.php" ><font color="White">Print</font></a-->
							
						</div>
					</div>
					
					
					<div class="box-content">  

                    <div class="table-responsive" style="overflow-x:auto;">
					  <table class="table table-striped table-bordered custom-datatable">
						   <thead>
							  <tr>
							      <th>Sr. No.</th>
								  <th>Div/Class </th>
								  <?php
								  		 if(!$class_res=mysqli_query($con,"SELECT * FROM `class`"))
								{
									echo("Error description: " . mysqli_error($con));
								}
										
									while ($class=mysqli_fetch_array($class_res))
									{
									?>	
								  <th><?php echo "$class[Name]";?></th>
								 	<?php
								 	}
								 	?>
								 	<th>Total</th>
							  </tr>
						  </thead>  
						  <tbody>

						  	<?php
						  if(!$heads_res=mysqli_query($con,"SELECT * FROM `division`"))
								{
									echo("Error description: " . mysqli_error($con));
								}
								$ii=1;	
									while ($heads=mysqli_fetch_array($heads_res))
									{
									?>
								<tr>
								    <td><?php echo $ii++; ?></td>
								<td class="center"><?php echo "$heads[Name]";?> </td>
								<?php
								    $class_res=mysqli_query($con,"SELECT * FROM `class`");
								    $total_sub=0;
									while ($class=mysqli_fetch_array($class_res))
									{
									   //echo  "select count(`Stud_Id`) where `Class` = '$class[Cls_Id]' and `Division`='$heads[Div_Id]'";
									 $cnt_res=mysqli_query($con,"select COUNT(`Stud_Id`) FROM `stud_basic` where `Class` = '$class[Name]' and `Division`='$heads[Name]'")or die(mysqli_error($con));
									 $cnt=mysqli_fetch_array($cnt_res);
									 $total_sub=$total_sub+$cnt[0];
									?>
									<td> <?php echo "$cnt[0]";  ?> </td>
									<?php
									}
								?>
								<td><?php echo $total_sub; ?></td>
							</tr>
							<?php  
								} 
								?>
                            <tr>
                                <td><span style="display:none;"><?php echo $ii; ?></span></td>
                                <td>Total</td>
                                <?php
                                    $class_res=mysqli_query($con,"SELECT * FROM `class`");
                                    $final_ttt=0;
									while ($class=mysqli_fetch_array($class_res))
									{
									    $cnt_res=mysqli_query($con,"select COUNT(`Stud_Id`) FROM `stud_basic` where `Class` = '$class[Name]' and division!=''")or die(mysqli_error($con));
									 $cnt=mysqli_fetch_array($cnt_res);
									 $final_ttt=$final_ttt+$cnt[0];
                                ?>
                                <td> <?php echo "$cnt[0]";  ?> </td>
                                <?php
									}
									?>
									<td><?php echo $final_ttt; ?></td>
                            </tr>
						  </tbody>
						
					  </table>
					  </div>
					    <div>
					    <div align="right" class="style1">
					      
					    </div>
					  </div> 
					</div></div></div> 

					<div class="box-content CollectionDetails">
						<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header" data-original-title>
						<h2><i class="halflings-icon white th"></i><span class="break"></span>Collection Summary(Bankwise) </h2>
						<div class="box-icon"><!--a href="testexcel.php"><font color="White">Print</font></a-->
							
						</div>
					</div>
					
					<?php
					$CollectionDate=Date('Y-m-d');
					    if(isset($_POST['CollectionDate']))
					    {
					        $CollectionDate=Date('Y-m-d',strtotime($_POST['CollectionDate']));
					    }
					?>
					<form action="dashboard.php" method="POST" name="myfrm">
					<div style="width:150px;float:left;margin-left:20px;margin-top:15px">
					    <label>Collection Date</label>
					    <input type="date" name="CollectionDate" value="<?php echo $CollectionDate; ?>" style="width:100%;" />
					</div>
					<div style="width:100px;float:left;margin-left:20px;margin-top:15px">
					    <label style="width:100%;">&nbsp;</label>
					    <button type="submit" class="btn btn-primary btn-sm" style="padding: 4px 12px;">Submit</button>
					</div>
					</form>
					<div class="table-responsive" style="overflow-x:auto;width:100%;">
						<table id="example" class="table table-striped table-bordered custom-datatable">
						  <thead>
							  <tr>
								  <th rowspan="2" class="text-center">Sr. No</th>
								  <th rowspan="2" class="text-center">Bank Name/AC</th>
								  <th colspan="4" class="text-center">Collection - <?php echo Date('d/m/Y',strtotime($CollectionDate)); ?></th>
							  </tr>
							  <tr>
								  <th class="text-center">Cash</th>
								  <th class="text-center">Cheque</th>
								  <th class="text-center">DD</th>
								  <th class="text-center">Challan</th>
								  <th class="text-center">Online</th>
								  <th class="text-center">Total</th>
							  </tr>
						  </thead>   
						  <tbody>

						  	<?php 
							
$bank_sql=mysqli_query($con,"select COALESCE(Sum(pd.Grand_Total),0) AS Total,COALESCE(SUM(CASE WHEN pd.Mode='Online' then pd.Grand_Total else 0 END),0) As OnlinePay,COALESCE(SUM(CASE WHEN pd.Mode='Cash' then pd.Grand_Total else 0 END),0) As CashPay,COALESCE(SUM(CASE WHEN pd.Mode='DD' then pd.Grand_Total else 0 END),0) As DDPay,COALESCE(SUM(CASE WHEN pd.Mode='Cheque' then pd.Grand_Total else 0 END),0) As ChequePay,COALESCE(SUM(CASE WHEN pd.Mode='Challan' then pd.Grand_Total else 0 END),0) As ChallanPay,pd.Paid_date,bk.Id,bk.Account_Number,bk.Bank_Name from bankaccounts as bk inner join head as hd on hd.Bank_Code=bk.Id inner join paid_fees as pd on pd.Head_Id=hd.Head_Id where pd.Paid_date='$CollectionDate' group by bk.Id,bk.Bank_Name,bk.Account_Number,pd.Paid_date");
							  
						  
$i=0;
									 
	while($bank_row=mysqli_fetch_array($bank_sql))
		{
					$i++;
					?>
							<tr>
								
								<td class="center"> <?php echo $i; ?></td>
								<td class="center"><?php echo $bank_row['Bank_Name']."/".$bank_row['Account_Number'];?> </td>
								<td class="center"><?php echo number_format($bank_row['CashPay'],0); ?></td>
								<td class="center"><?php echo number_format($bank_row['ChequePay'],0); ?></td>
								<td class="center"><?php echo number_format($bank_row['DDPay'],0); ?></td>
								<td class="center"><?php echo number_format($bank_row['ChallanPay'],0); ?></td>
								<td class="center"><?php echo number_format($bank_row['OnlinePay'],0); ?></td>
								<td class="center"><?php echo number_format($bank_row['Total'],0); ?></td>
							</tr>
							<?php   }  ?>

						  </tbody>
					  </table>
					  </div>
					  </div></div></div>





					<div class="box-content">
						<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header" data-original-title>
						<h2><i class="halflings-icon white th"></i><span class="break"></span>By Fees Code Summary (Reciept Details) </h2>
						<div class="box-icon">
							<a href="fees-summary.php"><font color="White">Details</font></a>
						</div>
					</div>
					<div class="table-responsive" style="overflow-x:auto;">
						<table id="example" class="table table-striped table-bordered custom-datatable">
						  <thead>
							  <tr>
								  <th>Sr. No</th>
								  <th>Fees Code</th>
								  <th>Today Collection</th>
								  <th>Total Amount</th>
								  <th>Paid Amount</th>
								  <th>Balance Amount</th>
							  </tr>
						  </thead>   
						  <tbody>

						  	<?php
						  if(!$heads_res=mysqli_query($con,"SELECT * FROM `head`"))
								{
									echo("Error description: " . mysqli_error($con));
								}
										$i=0;
									while ($heads=mysqli_fetch_array($heads_res))
									{
										$i++;
										
						  	?>
							<tr>
								
								<td class="center"><?php echo "$i";?> </td>
								<td class="center"><?php echo "$heads[Name]";?> </td>
								<?php

	 	$head_tamount_res=mysqli_query($con,"SELECT sum(`Total_Amount`) FROM `stud_basic2` WHERE `Head_Id` = '$heads[Head_Id]'");
	 	$head_pamount_res=mysqli_query($con,"SELECT sum(`Paid`) FROM `stud_basic2` WHERE `Head_Id` = 
	 		'$heads[Head_Id]'");
	 	$head_bamount_res=mysqli_query($con,"SELECT sum(`Balance`) FROM `stud_basic2` WHERE `Head_Id` = 
	 		'$heads[Head_Id]'");
	 			$head_tamount=mysqli_fetch_array($head_tamount_res);
	 			$head_pamount=mysqli_fetch_array($head_pamount_res);
	 			$head_bamount=mysqli_fetch_array($head_bamount_res);
	 			
	 			$today_date=Date('Y-m-d');
	 			$head_todayamount_res=mysqli_query($con,"SELECT COALESCE(Sum(Grand_Total),0) AS TodayCollection FROM `paid_fees` where Head_Id='$heads[Head_Id]' AND Paid_date='$today_date'");
	 			$head_todayamount_row=mysqli_fetch_array($head_todayamount_res);
								?>
								
								<td class="center"> <?php echo number_format($head_todayamount_row['TodayCollection'],is_decimal_school($decimalFeesSchool) ? 2 : 0); ?></td>
								<td class="center"><?php echo number_format($head_tamount[0],is_decimal_school($decimalFeesSchool) ? 2 : 0); ?> </td>
								<td class="center"><?php echo number_format($head_pamount[0],is_decimal_school($decimalFeesSchool) ? 2 : 0); ?> </td>
								<td class="center"> <?php echo number_format($head_bamount[0],is_decimal_school($decimalFeesSchool) ? 2 : 0); ?></td>
								
							</tr>
							<?php  } ?>

						  </tbody>
					  </table>   
					  </div>
					  <div>
					    <div align="right" class="style1">
					      <div align="center"><a href="recpt_report_excle.php" class="style1"> Receipt Report </a>&nbsp;-&nbsp;  <a href="balancelist.php" class="style1">Balance Report</a> </div>
					     
					    </div>
					  </div>
					  
					   
					      
					   
					  </div></div></div>



					  	<div class="row-fluid">
				
				<div class="box span12">
					<div class="box-header">
						<h2><i class="halflings-icon white th"></i><span class="break"></span>fees Collection Summary </h2>
						<div class="box-icon"><!--a href="testexcel.php" ><font color="White">Print</font></a-->
							
						</div>
					</div>
					
					
					<div class="box-content">  

<div class="table-responsive" style="overflow-x:auto;">
					  <table class="table table-striped table-bordered custom-datatable">
						   <thead>
							  <tr>
								  <th>Fees Code</th>
								  <?php
								  		 if(!$class_res=mysqli_query($con,"SELECT * FROM `class` ORDER BY `Cls_Id` ASC "))
								{
									echo("Error description: " . mysqli_error($con));
								}
										
									while ($class=mysqli_fetch_array($class_res))
									{
									?>	
								  <th><?php echo "$class[Name]";?></th>
								 	<?php
								 	}
								 	?>
							  </tr>
						  </thead>  
						  <tbody>

						  	<?php
						  if(!$heads_res=mysqli_query($con,"SELECT * FROM `head`"))
								{
									echo("Error description: " . mysqli_error($con));
								}
									
									while ($heads=mysqli_fetch_array($heads_res))
									{
									?>
								<tr>
								<td class="center"><?php echo "$heads[Name]";?> </td>
								<?php
								$class_res=mysqli_query($con,"SELECT * FROM `class` ORDER BY Cls_Id ASC");
									while ($class=mysqli_fetch_array($class_res))
									{
										

									 	$count_res=mysqli_query($con,
										"SELECT SUM(stud_basic2.Paid) 
										FROM stud_basic INNER JOIN stud_basic2 
										ON stud_basic.Stud_Id = stud_basic2.Stud_Id 
										WHERE stud_basic.Class='$class[Name]' and 
										stud_basic2.Head_Id='$heads[Head_Id]'");
										$cnt=mysqli_fetch_array($count_res);
										if($cnt['0'] == "")
										{
											$cnt['0'] = 0;

										}
									?>
									<td> <?php echo "$cnt[0]";  ?> </td>
									<?php
									}
								?>
							</tr>
							<?php  
								} 
								?>

						  </tbody>
						
					  </table> 
					  </div>
					    <div>
					    <div align="right" class="style1">
					      <div align="center"><b><a href="reportsexcel.php" class="style1">Explore </a></b> </div>
					    </div>
					  </div> 
					</div></div></div> 


							  	<div class="row-fluid">
				
				<div class="box span12">
					<div class="box-header">
						<h2><i class="halflings-icon white th"></i><span class="break"></span>Fees Code Assigned Summary </h2>
						<div class="box-icon"><!--a href="testexcel.php"><font color="White">Print</font></a-->
							
						</div>
					</div>
					<div class="box-content">  

<div class="table-responsive" style="overflow-x:auto;">
					  <table class="table table-striped table-bordered custom-datatable">
						   <thead>
							  <tr>
								  <th>Fees Code</th>
								  <?php
								  		 if(!$class_res=mysqli_query($con,"SELECT * FROM `class` ORDER BY Cls_Id ASC"))
								{
									echo("Error description: " . mysqli_error($con));
								}
										
									while ($class=mysqli_fetch_array($class_res))
									{
									?>	
								  <th><?php echo "$class[Name]";?></th>
								 	<?php
								 	}
								 	?>
							  </tr>
						  </thead>  
						  <tbody>

						  	<?php
						  if(!$heads_res=mysqli_query($con,"SELECT * FROM `head`"))
								{
									echo("Error description: " . mysqli_error($con));
								}
									
									while ($heads=mysqli_fetch_array($heads_res))
									{ $cccc=0;
									?>
								<tr>
								<td class="center"><?php echo "$heads[Name]";?> </td>
								<?php
								$class_res=mysqli_query($con,"SELECT * FROM `class`ORDER BY Cls_Id ASC");
									while ($class=mysqli_fetch_array($class_res))
									{
										$cccc=0;
        //                                 $a= "SELECT count(DISTINCT stud_basic.Stud_Id) 
								// 		FROM stud_basic INNER JOIN stud_basic2 
								// 		ON stud_basic.Stud_Id = stud_basic2.Stud_Id 
								// 		WHERE stud_basic.Class='$class[Name]' and 
								// 		stud_basic2.Head_Id='$heads[Head_Id]'";
								// 		echo "<br>";
									 	$count_res=mysqli_query($con,
										"SELECT count(DISTINCT stud_basic.Stud_Id) 
										FROM stud_basic INNER JOIN stud_basic2 
										ON stud_basic.Stud_Id = stud_basic2.Stud_Id 
										WHERE stud_basic.Class='$class[Name]' and 
										stud_basic2.Head_Id='$heads[Head_Id]'");
										$cnt=mysqli_fetch_array($count_res);
										$cccc=$cnt['0'];
									?>
									<td> <?php echo "$cccc";  ?> </td>
								<?php
									}
								?>
							</tr>
							<?php  
								} 
								?>

						  </tbody>
					  </table>  
					  </div>
					</div></div></div> 
				</div>
				

				</div>

				</div><!--/span-->

			
			</div>





					
			



		</div><!--/.fluid-container-->
	
			<!-- end: Content -->
		</div><!--/#content.span10-->
		</div><!--/fluid-row-->
		

	
	<div class="clearfix"></div>
	
		<footer>

		<p>
			
			
		</p>

	</footer>
	
	<!-- start: JavaScript-->

		<script src="js/jquery-1.9.1.min.js"></script>
		<script src="js/jquery-migrate-1.0.0.min.js"></script>
		<script src="js/jquery-ui-1.10.0.custom.min.js"></script>
		<script src="js/jquery.ui.touch-punch.js"></script>
		<script src="js/modernizr.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/jquery.cookie.js"></script>
		<script src='js/fullcalendar.min.js'></script>
		<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
        <script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>
        <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.5.1/css/buttons.dataTables.min.css" />
		<script src="js/excanvas.js"></script>
	<script src="js/jquery.flot.js"></script>
	<script src="js/jquery.flot.pie.js"></script>
	<script src="js/jquery.flot.stack.js"></script>
	<script src="js/jquery.flot.resize.min.js"></script>
	<script src="js/jquery.chosen.min.js"></script>
		<script src="js/jquery.uniform.min.js"></script>
		<script src="js/jquery.cleditor.min.js"></script>
		<script src="js/jquery.noty.js"></script>
		<script src="js/jquery.elfinder.min.js"></script>
		<script src="js/jquery.raty.min.js"></script>
		<script src="js/jquery.iphone.toggle.js"></script>
		<script src="js/jquery.uploadify-3.1.min.js"></script>
		<script src="js/jquery.gritter.min.js"></script>
		<script src="js/jquery.imagesloaded.js"></script>
		<script src="js/jquery.masonry.min.js"></script>
		<script src="js/jquery.knob.modified.js"></script>
		<script src="js/jquery.sparkline.min.js"></script>
		<script src="js/counter.js"></script>
		<script src="js/retina.js"></script>
		<script src="js/custom.js"></script>
	    <script src="js9/fastclick.js"></script>
	    
	

		
	<!-- end: JavaScript-->
	
	<?php if(isset($_GET['id'])) { ?>
	<script>
        $('html, body').animate({
            scrollTop: $(".SchoolDetails").offset().top - 20
        }, 0);
    </script>
    <?php } ?>
    <?php if(isset($_POST['CollectionDate'])) { ?>
	<script>
        $('html, body').animate({
            scrollTop: $(".CollectionDetails").offset().top - 20
        }, 0);
    </script>
    <?php } ?>
    <script>
        $(document).ready(function() {
    $('.custom-datatable').DataTable( {
        dom: 'Bfrtip',
        bFilter: false, 
        bInfo: false,
        paging:false,
        buttons: [
            //'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            //'pdfHtml5'
        ]
    } );
} );
    </script>
</body>
</html>

MMCT - 2023