<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{
include 'dbc.php';
date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
$userid=$_SESSION["userid"];

$sql = "SELECT * FROM admission where  user_id='$userid'";
$result=$conn->query($sql);
while($row = $result->fetch_assoc())
 
  {
  $tfee=$tfee + $row['mfee'];
 
$trecord=$trecord + 1;
  }
  
  $sql2 = "SELECT * FROM admission where month='$my' and  user_id='$userid'";
$result2=$conn->query($sql2);
while($row2 = $result2->fetch_assoc())
 
  {
  $tfee2=$tfee2 + $row2['mfee'];
 
$trecord2=$trecord2 + 1;
  }
  
  $sqlactive = "SELECT * FROM admission where status='Active' and  user_id='$userid'";
$resultactive=$conn->query($sqlactive);
while($rowactive = $resultactive->fetch_assoc())
 
  {
  $tfeeactive=$tfeeactive + $rowactive['mfee'];
 
$trecordactive=$trecordactive + 1;
  }
  
   $sqlinactive = "SELECT * FROM admission where status='InActive' and  user_id='$userid'";
$resultinactive=$conn->query($sqlinactive);
while($rowinactive = $resultinactive->fetch_assoc())
 
  {
  $tfeeinactive=$tfeeinactive + $rowinactive['mfee'];
 
$trecordinactive=$trecordinactive + 1;
  }
  
  $sqla = "SELECT * FROM attendence where date='$today' and  status='A' and  user_id='$userid'";
$resulta=$conn->query($sqla);
while($rowa = $resulta->fetch_assoc())
 
  {
  
$trecorda=$trecorda + 1;
  }
  $sqlp = "SELECT * FROM attendence where date='$today' and  status='P' and  user_id='$userid'";
$resultp=$conn->query($sqlp);
while($rowp = $resultp->fetch_assoc())
 
  {
  
$trecordp=$trecordp + 1;
  }
  
   $sqll = "SELECT * FROM attendence where date='$today' and  status='L' and  user_id='$userid'";
$resultl=$conn->query($sqll);
while($rowl = $resultl->fetch_assoc())
 
  {
  
$trecordl=$trecordl + 1;
  }
  
   $sqllinq = "SELECT * FROM admission where status='Active'  and  user_id='$userid'";
$resultlinq=$conn->query($sqllinq);
while($rowlinq = $resultlinq->fetch_assoc())
 
  {
  
$trecordlinq=$trecordlinq + 1;
  }
  $sqla1 = "SELECT * FROM attendence_tech where date='$today' and  status='A' and  user_id='$userid'";
$resulta1=$conn->query($sqla1);
while($rowa1 = $resulta1->fetch_assoc())
 
  {
  
$trecorda1=$trecorda1 + 1;
  }
  $sqlp1 = "SELECT * FROM attendence_tech where date='$today' and  status='P' and  user_id='$userid'";
$resultp1=$conn->query($sqlp1);
while($rowp1 = $resultp1->fetch_assoc())
 
  {
  
$trecordp1=$trecordp1 + 1;
  }
  
   $sqll1 = "SELECT * FROM attendence_tech where date='$today' and  status='L' and  user_id='$userid'";
$resultl1=$conn->query($sqll1);
while($rowl1 = $resultl1->fetch_assoc())
 
  {
  
$trecordl1=$trecordl1 + 1;
  }
  
   $sqllinq1 = "SELECT * FROM teacher where status='Active'  and  user_id='$userid'";
$resultlinq1=$conn->query($sqllinq1);
while($rowlinq1 = $resultlinq1->fetch_assoc())
 
  {
  
$trecordlinq1=$trecordlinq1 + 1;
  }
  $sql2rec = "SELECT * FROM rec_fee where month_period='$my'";
$result2rec=$conn->query($sql2rec);
while($row2rec = $result2rec->fetch_assoc())
 
  {
  $tfeerec=$tfeerec + $row2rec['feerec'];
$totalrec=$totalrec + 1;
  }
  $sql2rec1 = "SELECT * FROM rec_fee where date='$today'";
$result2rec1=$conn->query($sql2rec1);
while($row2rec1 = $result2rec1->fetch_assoc())
 
  {
  $tfeerec1=$tfeerec1 + $row2rec1['feerec'];
$totalrec1=$totalrec1 + 1;
  }
   $sql2exp = "SELECT * FROM expense_voucher where month_name='$my'";
$result2exp=$conn->query($sql2exp);
while($row2exp = $result2exp->fetch_assoc())
 
  {
  $totalexp=$totalexp + $row2exp['amount'];

  }
  $sql2rec11 = "SELECT * FROM expense_voucher where date='$today'";
$result2rec11=$conn->query($sql2rec11);
while($row2rec11 = $result2rec11->fetch_assoc())
 
  {
  $totalexpday=$totalexpday + $row2rec11['amount'];

  }
   $sqlwidraw = "SELECT * FROM widraw where month='$my' and  user_id='$userid'";
$resultwidraw=$conn->query($sqlwidraw);
while($rowwidraw = $resultwidraw->fetch_assoc())
 
  {
  $twidraw=$twidraw + $rowwidraw['bal'];
$trecordwidraw=$trecordwidraw + 1;
  }
  
   $sqlw = "SELECT * FROM widraw where  user_id='$userid'";
$resultw=$conn->query($sqlw);
while($roww = $resultw->fetch_assoc())
 
  {
  $tw=$tw + $roww['bal'];
$trecordw=$trecordw + 1;
  }
  
   $netqty =0;
$qtysale=0;
$qtypur=0;
 $netqty1 =0;
$qtysale1=0;
$qtypur1=0;
 $netqty2 =0;
$qtysale2=0;
$qtypur2=0;
 $netqty3 =0;
$qtysale3=0;
$qtypur3=0;
 $netqty4 =0;
$qtysale4=0;
$qtypur4=0;
 $netqty5 =0;
$qtysale5=0;
$qtypur5=0;
 $netqty6 =0;
$qtysale6=0;
$qtypur6=0;

  $sql2 = "select * from issueslip where month_name='$my' and user_id='$userid'";
$result2=$conn->query($sql2);
while($ppp1 = $result2->fetch_assoc())
{
$class_name=  $ppp1["class_name"];
$std_name=  $ppp1["std_name"];
$fname=  $ppp1["fname"];
$cell_1=  $ppp1["cell_1"];
  $qtysale= $qtysale + $ppp1["feebal"];
   
 } 
  
$sql3 = "select * from rec_fee where month_period='$my' and user_id='$userid'";
$result3=$conn->query($sql3);
while($ppp3 = $result3->fetch_assoc())
{
  $qtypur= $qtypur + $ppp3["feerec"];
 
 } 
 
$netqty = ($qtysale ) - ($qtypur );


?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

    <?php include("includes/menu.php") ?><!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

             <?php include("includes/headermenu.php") ?>

        </header><!-- /header -->
        <!-- Header-->

        <div class="breadcrumbs">
            <div class="col-sm-6">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><? echo "" . $_SESSION["userid"]; ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li class="active"><? echo "" . $_SESSION["username"]; ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="content mt-3">

           


            
            <!--/.col-->

            
            <!--/.col-->

            
            <!--/.col-->

            
           
		   
		    <!--/.col-->

            
             <div class="col-sm-6 col-lg-12">
                <div class="card text-white bg-flat-color-5">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="center"><h3>Student & Fee Information</h3></div>
                        
                    </div>
                </div>
            </div>

            <div class="col-sm-6 col-lg-3">
                <div class="card text-white bg-flat-color-1">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						
                        <h4 class="mb-0">
						<p class="text-light">Tution Fee: <span class="count"><?php echo $tfee; ?></span></p>
						 <p class="text-light">Total Students: <span class="count"><?php echo $trecord; ?></span></p>
                            <p class="text-light">  Admission: <?php echo $my; ?>: <span class="count"><?php echo $trecord2; ?></span></p>
							<p><a href="class_g.php" target="_blank"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="+1"> Class Fee Breakup</font></a></p>
                        </h4>
                    </div>
                </div>
            </div>

<div class="col-xl-9 col-lg-6">
                <div class="card" >
                    <div class="card-body" style="background:#FFFFCC">
                        <div class="stat-widget-one">
                            
                            <div class="stat-content dib">
                                <div class="stat-text"><?php
								include 'dbc.php';
								$sqlg = "SELECT class_name, SUM(mfee) as mfee 
        FROM admission 
        GROUP BY class_name";
$resultg = $conn->query($sqlg);

$classes = [];
$totals = [];
$grand_total = 0;

while ($rowg = $resultg->fetch_assoc()) {
    $classes[] = $rowg['class_name'];
    $totals[] = $rowg['mfee'];
    $grand_total += $rowg['mfee'];
}
?>
								<!DOCTYPE html>
<html>
<head>
    <title>Student Fee Report</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>


<table border="1" cellpadding="8">
    <?php foreach($classes as $i => $cls): ?>
    
    <?php endforeach; ?>
   
</table>

<!-- Graph -->

<canvas id="feeChart" width="640" height="158"></canvas>

<script>
var ctx = document.getElementById('feeChart').getContext('2d');
var feeChart = new Chart(ctx, {
    type: 'bar', // Change to 'pie' if you want pie chart
    data: {
        labels: <?php echo json_encode($classes); ?>,
        datasets: [{
            label: 'Total Tution Fee Break up',
            data: <?php echo json_encode($totals); ?>,
            backgroundColor: 'rgba(54, 162, 235, 0.6)',
            borderColor: 'rgba(54, 162, 235, 1)',
            borderWidth: 1
        }]
    },
    options: {
        responsive: true,
        scales: {
            y: { beginAtZero: true }
        }
    }
});
</script>

</body>
</html>

</div>
                               
							</div>
                            </div>
                        </div>
                    </div>
                </div>
				 <div class="col-sm-6 col-lg-12">
                <div class="card text-white bg-flat-color-5">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="center"><h3>Fee Collection Information</h3></div>
                        
                    </div>
                </div>
            </div>
            <div class="col-sm-6 col-lg-3">
                <div class="card text-white bg-flat-color-3">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
                        <h4 class="mb-0">
						
						<p class="text-light"> Fee Receipt: <?php echo $my; ?>: <span class="count"><?php echo $tfeerec; ?></span></p>
						 <p class="text-light">Today Receipt: <span class="count"><?php echo $tfeerec1; ?></span></p>
                            <p class="text-light"> Total Students:<?php echo $my; ?>: <span class="count"> <?php echo $totalrec; ?></span></p>
							<p><a href="Daily_Collection_Summary_Report.php" target="_blank"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="+1">  Fee Paid Breakup</font></a></p>
                        </h4>
                    </div>
                </div>
            </div>

<div class="col-xl-9 col-lg-6">
                <div class="card" >
                    <div class="card-body" style="background:#FFFF66">
                        <div class="stat-widget-one">
                            
                            <div class="stat-content dib">
                                <div class="stat-text"><?php
								include 'dbc.php';
								$sqlg1 = "SELECT date, SUM(feerec) as feerec 
        FROM rec_fee where month_period='$my'
        GROUP BY date";
$resultg1 = $conn->query($sqlg1);

$classes1 = [];
$totals1 = [];
$grand_total1 = 0;

while ($rowg1 = $resultg1->fetch_assoc()) {
    $classes1[] = $rowg1['date'];
    $totals1[] = $rowg1['feerec'];
    $grand_total1 += $rowg1['feerec'];
}
?>
								<!DOCTYPE html>
<html>
<head>
    <title>Student Fee Report</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>


<table border="1" cellpadding="8">
    <?php foreach($classes1 as $a => $cls1): ?>
    
    <?php endforeach; ?>
   
</table>

<!-- Graph -->

<canvas id="feeChart1" width="640" height="180"></canvas>

<script>
var ctx1 = document.getElementById('feeChart1').getContext('2d');
var feeChart1 = new Chart(ctx1, {
    type: 'bar', // Change to 'pie' if you want pie chart
    data: {
        labels: <?php echo json_encode($classes1); ?>,
        datasets: [{
            label: 'Total Fee Collection:<?php echo $tfeerec; ?>',
            data: <?php echo json_encode($totals1); ?>,
            backgroundColor: 'rgba(54, 162, 235, 0.6)',
            borderColor: 'rgba(54, 162, 235, 1)',
            borderWidth: 1
        }]
    },
    options: {
        responsive: true,
        scales: {
            y: { beginAtZero: true }
        }
    }
});
</script>

</body>
</html>

</div>
                               
							</div>
                            </div>
                        </div>
                    </div>
                </div>
				
						
                        
                  
            <div class="col-sm-6 col-lg-6">
                <div class="card text-white bg-flat-color-4">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="left"><h3>Current Month Revenue  Information</h3></div>
                        <h4 class="mb-0">
						
						<p class="text-light"> Revenue Genrate: <?php echo $my; ?>: <span class="count"><?php echo $qtysale; ?></span></p>
						 <p class="text-light"> Receipt Fee:<?php echo $my; ?>:  <span class="count"><?php echo $qtypur; ?></span></p>
                            <p class="text-light"> Pending Fee:<?php echo $my; ?>: <span class="count"> <?php echo $netqty; ?></span></p>
							<p><a href="Monthly_Finance_Report_Details3.php" target="_blank"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="+1">  Monthly Revnue Breakup</font></a></p>
                        </h4>
                    </div>
                </div>
            </div>
 
                        
						
                        
                   
<div class="col-sm-6 col-lg-6">
                <div class="card text-white bg-flat-color-2">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="center"><h3>Student Attendance Information</h3></div>
                        <h4 class="mb-0">
						<p class="text-light"> Total Students: <span class="count"> <?php echo $trecord; ?></span></p>
						<p class="text-light"> Total Present Students:  <span class="count"><?php echo $trecordp; ?></span></p>
						 <p class="text-light"> Total Absent Students:  <span class="count"><?php echo $trecorda; ?></span></p>
                            <p class="text-light"> Total Leave Students: <span class="count"> <?php echo $trecorda; ?></span></p>
							
							
                        </h4>
                    </div>
                </div>
            </div>
			 
						
                        
                    
			<div class="col-sm-6 col-lg-6">
                <div class="card text-white bg-flat-color-1">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="left"><h3>Student Widraw Information</h3></div>
                        <h4 class="mb-0">
						<p class="text-light"> Total Widraw Students: <span class="count"> <?php echo $trecordw; ?></span></p>
						<p class="text-light">  Widraw Students: <?php echo $my; ?>: <span class="count"><?php echo $trecordwidraw; ?></span></p>
						   
							
  
                        </h4>
                    </div>
                </div>
            </div>
			
						
                        
                  
            <div class="col-sm-6 col-lg-6">
                <div class="card text-white bg-flat-color-4">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="center"><h3>Expenses Information</h3></div>
                        <h4 class="mb-0">
						
						<p class="text-light">  Expenses for the month of: <?php echo $my; ?>: <span class="count"><?php echo $totalexp; ?></span></p>
						   <p class="text-light">  Expenses Today: <?php echo $today; ?>: <span class="count"><?php echo $totalexpday; ?></span></p>
						   
							
  
                        </h4>
                    </div>
                </div>
            </div>
			 
						
             
            <div class="col-sm-6 col-lg-6">
                <div class="card text-white bg-flat-color-3">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
						<div class="stat-text" align="left"><h3>Staff Attendance Information</h3></div>
                        <h4 class="mb-0">
						<p class="text-light"> Total  Staff: <span class="count"> <?php echo $trecordlinq1; ?></span></p>
						<p class="text-light">  Absent Staff:  <span class="count"><?php echo $trecorda1; ?></span></p>
						   <p class="text-light">  Present Staff:  <span class="count"><?php echo $trecordp1; ?></span></p>
						   <p class="text-light">  Leave Staff:  <span class="count"><?php echo $trecordl1; ?></span></p>
						   
						   
							
  
                        </h4>
                    </div>
                </div>
            </div>
			
            <div class="col-sm-6 col-lg-12">
                <div class="card text-white bg-flat-color-1">
                    <div class="card-body pb-0">
                        <div class="dropdown float-right">    
                        </div>
                        <h4 class="mb-0">
						<?php

include 'dbc.php';

date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$dd1= date("d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
$userid=$_SESSION["userid"];
$sqlin = "SELECT * FROM admission order by dob";
$resultin=$conn->query($sqlin);
?><div class="stat-text"><h2>Student Birthday List Today</h2></div>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
echo "<th > Studnet Name </th>";
echo "<th > Father Name </th>";
echo "<th > Class Name </th>";
echo "<th > Sec </th>";
echo "<th > Cell 1 </th>";
echo "<th > DOB</th>";



echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($rowin = $resultin->fetch_assoc())
 
  {
  $id = $rowin['id'];	
   $dob= $rowin['dob'];
    $cell_1= $rowin['cell_1'];
	$std_name= $rowin['std_name'];
 $month1 = date("m",strtotime($dob));
  $dd2 = date("d",strtotime($dob));
		$year1 = date("Y",strtotime($dob));
		 $month_name1 = date("F", mktime(0, 0, 0, $month1, 10));
		 if ($month_name1 == $month_name and $dd1 == $dd2)
		 {
   echo "<tr>";

  echo "<td>" .$rowin['std_name'] .  "</td>";
 echo "<td>" .$rowin['fname'] . "</td>";
 echo "<td>" .$rowin['class_name'] .  "</td>";
 echo "<td>" .$rowin['cls_sec'] .  "</td>";
 echo "<td>" .$rowin['cell_1'] .  "</td>";
 
 echo "<td>" .$rowin['dob'] .  "</td>";

		  
	
  echo "</tr>";

}


  }
   
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
			
							
  
                        </h4>
                    </div>
                </div>
            </div>


            

            
			
			
			
			
			
			
			<div class="stat-text"><h2>Inquiry Report</h2></div>
			<div class="card-body">
							<?php
							

include 'dbc.php';


$userid=$_SESSION["userid"];
$sqlin = "SELECT * FROM inq where month='$my' order by id";
$resultin=$conn->query($sqlin);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									   echo "<th > S.# </th>";
echo "<th > Inq# </th>";
echo "<th > Inq Date</th>";
echo "<th > Studnet Name </th>";
echo "<th > Father Name </th>";
echo "<th > Class Name </th>";
echo "<th > Cell 1 </th>";
echo "<th > DOB</th>";
echo "<th > Address</th>";
echo "<th > Job</th>";
echo "<th > Remarks</th>";
echo "<th > Admission</th>";



echo "</tr>";
$sno=1;
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($rowin = $resultin->fetch_assoc())
 
  {
  $id = $rowin['id'];
  	
   echo "<tr>";
  echo "<td>" .$sno . "</td>";
   echo "<td>" .$rowin['id'] . "</td>";
   echo "<td>" .$rowin['date'] .  "</td>";
  echo "<td>" .$rowin['std_name'] .  "</td>";
 echo "<td>" .$rowin['fname'] . "</td>";
 echo "<td>" .$rowin['class_name'].":" .$rowin['cls_sec'] .  "</td>";
 echo "<td>" .$rowin['cell_1'] .  "</td>";
 
 echo "<td>" .$rowin['dob'] .  "</td>";
 echo "<td>" .$rowin['address'] .  "</td>";
 echo "<td>" .$rowin['job'] .  "</td>";
 echo "<td>" .$rowin['remarks'] .  "</td>";
 echo "<td>" .$rowin['astatus'] .  "</td>";
 echo"<th> <a href ='Add_Student_Registration1.php?id=$id'>"?><button type="button" class="btn btn-primary">  Convert to Admission </button><?php "</a>";
	echo"<th> <a href ='Del_Inquiry.php?id=$id'>"?><button type="button" class="btn btn-primary">  Del Inquiry </button><?php "</a>";
	echo"<th> <a href ='Edit_Inquiry.php?id=$id'>"?><button type="button" class="btn btn-primary">  Edit Inquiry </button><?php "</a>";
	echo"<th> <a href ='Print_Inquiry.php?id=$id'>"?><button type="button" class="btn btn-primary">  Print Inquiry </button><?php "</a>";
  echo "</tr>";
		  
	
  echo "</tr>";
  $sno=$sno + 1;
$trecord10=$trecord10 + 1;

  }
   echo "<tr>";
	echo "<td colspan=6 align=right><b>" ."Total Records::". $trecord10 ."</b></td>";
	
	  
		
	  echo "</tr>";
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
			
			
			<div class="stat-text"><h2>Student to Teacher Complain</h2></div>
			<div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$sql = "SELECT * FROM studentcomplain where status='Open' and user_id='$userid'";
$result=$conn->query($sql);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									   echo "<th > Date</th>";
echo "<th > Student Rollno</th>";
echo "<th > Student Name</th>";
echo "<th > Father Name</th>";
echo "<th > Class Name</th>";
echo "<th > Complain to</th>";
echo "<th > Complain</th>";
echo "<th > Reply</th>";
echo "<th > Status</th>";



echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
 
  {
  $id = $row['id'];	
   echo "<tr>";
   echo "<td>" .$row['date'] . "</td>";
echo "<td>" .$row['bname'] . "</td>";
echo "<td>" .$row['std_name'] . "</td>";
echo "<td>" .$row['fname'] . "</td>";
echo "<td>" .$row['class_name'] . "</td>";
echo "<td>" .$row['accno'] . "</td>";
echo "<td>" .$row['notice'] . "</td>";
echo "<td>" .$row['remarks'] . "</td>";
echo "<td>" .$row['status'] . "</td>";

		  
	
  echo "</tr>";


  }
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
							
							<div class="stat-text"><h2>Teacher to Student Complain</h2></div>
			<div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$sqlt = "SELECT * FROM teachercomplain where status='Open' and user_id='$userid'";
$resultt=$conn->query($sqlt);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									   echo "<th > Date</th>";
echo "<th > Student Name</th>";
echo "<th > Complain to</th>";
echo "<th > Complain</th>";
echo "<th > Reply</th>";
echo "<th > Status</th>";



echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($rowt = $resultt->fetch_assoc())
 
  {
  $id = $rowt['id'];	
   echo "<tr>";
   echo "<td>" .$rowt['date'] . "</td>";
echo "<td>" .$rowt['bname'] . "</td>";
echo "<td>" .$rowt['accno'] . "</td>";
echo "<td>" .$rowt['notice'] . "</td>";
echo "<td>" .$rowt['remarks'] . "</td>";
echo "<td>" .$rowt['status'] . "</td>";

		  
	
  echo "</tr>";


  }
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
			
<div class="stat-text"><h2>Student Fee Packages</h2></div>
            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$sql = "SELECT * FROM addclass where user_id='$userid'";
$result=$conn->query($sql);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
echo "<th > Class Name </th>";
echo "<th > Tution Fee </th>";
echo "<th > Discription Fee1 </th>";
echo "<th > Discription Fee2 </th>";
echo "<th > Discription Fee3 </th>";
echo "<th > Discription Fee4 </th>";
echo "<th > Discription Fee5 </th>";
echo "<th > Discription Fee6 </th>";


echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
 
  {
  $id = $row['id'];	
   echo "<tr>";
echo "<td>" .$row['cname'] . "</td>";
echo "<td>" .$row['mfee'] . "</td>";
 echo "<td>" .$row['feedisc1'] . ":". $row['fee1'] . "</td>";
  echo "<td>" .$row['feedisc2'] . ":". $row['fee2'] . "</td>";
 echo "<td>" .$row['feedisc3'] . ":". $row['fee3'] . "</td>";
 echo "<td>" .$row['feedisc4'] . ":". $row['fee4'] . "</td>";
 echo "<td>" .$row['feedisc5'] . ":". $row['fee5'] . "</td>";
 echo "<td>" .$row['feedisc6'] . ":". $row['fee6'] . "</td>";

		 
		  
	
  echo "</tr>";


  }
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>


        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
?>