<?php
session_start();
include 'dbc.php';

$userid=$_SESSION["userid"];
$cname=$_POST["class_name"];
$month_name=$_POST["month_name"];

$sql="select * from issueslip where cname='$cname' and monthname='$month_name' and user_id='$userid' ORDER BY rollno";
$issueslip=mysql_query($sql) or die("Error : " . mysql_error());
while($ppp=mysql_fetch_array($issueslip))


{

    echo "<h4 align=center>$userid </h4>";
echo "<center> 987-988-989 Ravi Block Allama Iqbal Town Lahore </center>";
echo "<table border=1 width=90% align=center bgcolor=white>";
echo "<tr>";

echo "</tr>";
echo "<tr>";
  echo "<th bgcolor=white align=left> Credit A/C #: </th>";
  echo "<td>   </td>" ;  
  echo "<th bgcolor=white align=left> Credit A/C #: </th>";
  echo "<td>   </td>" ; 
  echo "</tr>";
  
echo "</table>";


echo "<table border=1 width=90% align=center bgcolor=white>";

echo "<tr>";
echo "<th bgcolor=white align=left> Slip No </th>";
  echo "<td>"  .$ppp["id"] . "</td>" ;
  echo "<th bgcolor=white align=left> Issue Date </th>";
  echo "<td>"  .$ppp["date"] . "</td>" ;  
  echo "<th bgcolor=white align=left> Due Date </th>";
  echo "<td>"  .$ppp["due_date"] . "</td>" ;
  echo "</tr>";
  echo "<tr>";
echo "<th bgcolor=white align=left> Roll No </th>";
echo "<td>"  .$ppp["code"] . "</td>" ;
 echo "<td>"  .$ppp["rollno"] . "</td>" ;
 
 echo "<th bgcolor=white align=left> Student Name </th>";
  echo "<td>"  .$ppp["stdname"] . "</td>" ;
  echo "<th bgcolor=white align=left> Class Name </th>";
 echo "<td>"  .$ppp["cname"] . "</td>" ;

 echo "</tr>";
echo "</table>";
echo "<table border=1 width=90% align=center bgcolor=white>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2 width=30%> Fee Period </th>";
  echo "<td width=10%>"  .$ppp["months"] . "</td>" ;
 
  echo "<th bgcolor=white align=center> Note </th>";

echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=2 width=20%> Tuition Fee </th>";
 echo "<td>"  .$ppp["mfee"] . "</td>" ;
 echo "<td bgcolor=white align=left rowspan=4> 
A Fine of Rs. 10 per day will be charged after the Due Date.

Student will not be allowed to attend the class after 15 days of the due date.
Any Error in the calculation of fine by the bank will adjusted in the next fee bill.
 </td>";
echo "</tr>";

echo "<tr>";
echo "<th bgcolor=white align=left colspan=2> Annual Fund </th>";
 echo "<td>"  .$ppp["afee"] . "</td>" ;
 echo "</tr>";

 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2> Balance </th>";
 echo "<td>"  .$ppp["bal"] . "</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2> G. Total </th>";
 echo "<td>"  .$ppp["nettotal"] . "</td>" ;
 echo "</tr>";
  echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2> Total Payable after due Date </th>";
 echo "<td bgcolor=white align=center>  </td>";

echo "<th bgcolor=white align=center> School Copy </th>";
 echo "</tr>";
echo "</table>";


//echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 echo "<h4 align=center>$userid </h4>";
echo "<center>987-988-989 Ravi Block Allama Iqbal Town Lahore</center>";
echo "<table border=1 width=90% align=center bgcolor=white>";
echo "<tr>";
echo "</tr>";
echo "<tr>";
  echo "<th bgcolor=white align=left> Credit A/C #: </th>";
  echo "<td>   </td>" ;  
  echo "<th bgcolor=white align=left> Credit A/C #: </th>";
  echo "<td>   </td>" ; 
  echo "</tr>";
  
echo "</table>";


echo "<table border=1 width=90% align=center bgcolor=white>";

echo "<tr>";
echo "<th bgcolor=white align=left> Slip No </th>";
  echo "<td>"  .$ppp["id"] . "</td>" ;
  echo "<th bgcolor=white align=left> Issue Date </th>";
  echo "<td>"  .$ppp["date"] . "</td>" ;  
  echo "<th bgcolor=white align=left> Due Date </th>";
  echo "<td>"  .$ppp["due_date"] . "</td>" ;
  echo "</tr>";
  echo "<tr>";
echo "<th bgcolor=white align=left> Roll No </th>";
echo "<td>"  .$ppp["code"] . "</td>" ;
 echo "<td>"  .$ppp["rollno"] . "</td>" ;
 
 echo "<th bgcolor=white align=left> Student Name </th>";
  echo "<td>"  .$ppp["stdname"] . "</td>" ;
  echo "<th bgcolor=white align=left> Class Name </th>";
 echo "<td>"  .$ppp["cname"] . "</td>" ;
 
 echo "</tr>";
echo "</table>";
echo "<table border=1 width=90% align=center bgcolor=white>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2 width=30%> Fee Period </th>";
  echo "<td width=10%>"  .$ppp["months"] . "</td>" ;
 
  echo "<th bgcolor=white align=center> Note </th>";

echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=2 width=20%> Tuition Fee </th>";
 echo "<td>"  .$ppp["mfee"] . "</td>" ;
 echo "<td bgcolor=white align=left rowspan=4> 
A Fine of Rs. 10 per day will be charged after the Due Date.

Student will not be allowed to attend the class after 15 days of the due date.
Any Error in the calculation of fine by the bank will adjusted in the next fee bill.
 </td>";
echo "</tr>";

echo "<tr>";
echo "<th bgcolor=white align=left colspan=2> Annual Fund </th>";
 echo "<td>"  .$ppp["afee"] . "</td>" ;
 echo "</tr>";

 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2> Balance </th>";
 echo "<td>"  .$ppp["bal"] . "</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2> G. Total </th>";
 echo "<td>"  .$ppp["nettotal"] . "</td>" ;
 echo "</tr>";
  echo "<tr>";
 echo "<th bgcolor=white align=left colspan=2> Total Payable after due Date </th>";
 echo "<td bgcolor=white align=center>  </td>";

echo "<th bgcolor=white align=center> Parents Copy </th>";
 echo "</tr>";
echo "</table>";


//echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";



}
?>