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

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

		$sql1 = "SELECT * FROM feenote WHERE user_id  = '$userid'";
$result1=$conn->query($sql1);
$row1 = $result1->fetch_assoc();
				$accno=$row1['accno'] ;
				
				$bname=$row1['bname'] ;
				$notice=$row1['notice'] ;
			
				 
$sql="select * from issueslip where month_name='$month_name' and class_name='$cname' and user_id='$userid' ORDER BY adm_no";
$result=$conn->query($sql);
 while($ppp = $result->fetch_assoc())


{
  
	echo "<table border=1 width=33% align=left bgcolor=white>";
	?>
<tr>
<td align="center" colspan="4"><img src="logo1.jpg" /></td>

</tr>
<?php
	echo "<tr>";
	echo "<td colspan=4>";
	
	echo "<h1 align=center colspan=4>$userid </h1>";
	
	 echo "<h4 align=center colspan=4>$bname </h4>";
	 echo "<h4 align=center colspan=4>$accno </h4>";
	 echo "</td>";
echo "</tr>";
 echo "<tr>";
  echo "<th bgcolor=white align=left > Issue Date </th>";
  echo "<td> " .$ppp["date"] . "</td>" ;
  echo "<th bgcolor=white align=center > Slip No </th>";
  echo "<td> "  .$ppp["id"] . "</td>" ;
  echo "</tr>";

echo "<tr>";
echo "<th bgcolor=white align=left> Admission No </th>";
  echo "<th colspan=3> "  .$ppp["adm_no"] . "</th>" ;
 echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=left>Student Name </th>";
  echo "<th colspan=3> "  .$ppp["std_name"] . "</th>" ;
  
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left>Father Name </th>";
  echo "<th colspan=3> "  .$ppp["fname"] . "</th>" ;
  
 echo "</tr>";
echo "<tr>";
  echo "<th bgcolor=white align=left> Student ID </th>";

 echo "<th colspan=3> "  .$ppp["portal_id"] . "</th>" ;
  echo "</tr>";
  echo "<tr>";
   echo "<tr>";
  echo "<th bgcolor=white align=left> Class  </th>";
 echo "<td colspan=3 align=center> "  .$ppp["class_name"] . "</td>" ;
  echo "</tr>";
  echo "<th bgcolor=white align=left> Section </th>";

 echo "<th colspan=3> "  .$ppp["cls_sec"] . "</th>" ;
  echo "</tr>";
  
 

 echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Fee Period </th>";
  echo "<td width=10% colspan=3> "  .$ppp["month_period"] . "</td>" ;
echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Due Date </th>";
  echo "<td width=10% colspan=3> "  .$ppp["due_date"] . "</td>" ;
echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=center colspan=3 > Particulars </th>";
echo "<th bgcolor=white align=center > Rs. </th>";


echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3 > Tuition Fee </th>";
 echo "<td width=40%> " ."Rs." .$ppp["mfee"] .".00". "</td>" ;
 
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc1"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee1"] .".00". "</td>" ;
 echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc2"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee2"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc3"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee3"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc4"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee4"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc5"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee5"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc6"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee6"] .".00". "</td>" ;
 echo "</tr>";
 
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Pre. Balance </th>";
echo "<td width=40%> " ."Rs" .$ppp["bal"] . ".00"."</td>" ;
echo "</tr>";

  echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Current Fine </th>";
 echo "<td width=40%>  " ."Rs." .$ppp["fine"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=3> Net Paybale </th>";
  echo "<td width=40%>  " ."Rs." .$ppp["totalfee"] . ".00"."</td>" ;
 echo "</tr>";
 

 
 
  
 
  echo "<tr>";
  echo "<td bgcolor=white align=left colspan=4><b>$notice</b>
 </td>";
 echo "</tr>";
 
  echo "<tr>";
echo "<th bgcolor=white align=center colspan=4> School Copy </th>";
 echo "</tr>";

echo "</table>";
echo "<table border=1 width=33% align=left bgcolor=white>";
	?>
<tr>
<td align="center" colspan="4"><img src="logo1.jpg" /></td>

</tr>
<?php
	echo "<tr>";
	echo "<td colspan=4>";
	
	echo "<h1 align=center colspan=4>$userid </h1>";
	
	 echo "<h4 align=center colspan=4>$bname </h4>";
	 echo "<h4 align=center colspan=4>$accno </h4>";
	 echo "</td>";
echo "</tr>";
 echo "<tr>";
  echo "<th bgcolor=white align=left > Issue Date </th>";
  echo "<td> " .$ppp["date"] . "</td>" ;
  echo "<th bgcolor=white align=center > Slip No </th>";
  echo "<td> "  .$ppp["id"] . "</td>" ;
  echo "</tr>";

echo "<tr>";
echo "<th bgcolor=white align=left> Admission No </th>";
  echo "<th colspan=3> "  .$ppp["adm_no"] . "</th>" ;
 echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=left>Student Name </th>";
  echo "<th colspan=3> "  .$ppp["std_name"] . "</th>" ;
  
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left>Father Name </th>";
  echo "<th colspan=3> "  .$ppp["fname"] . "</th>" ;
  
 echo "</tr>";
echo "<tr>";
  echo "<th bgcolor=white align=left> Student ID </th>";

 echo "<th colspan=3> "  .$ppp["portal_id"] . "</th>" ;
  echo "</tr>";
  echo "<tr>";
   echo "<tr>";
  echo "<th bgcolor=white align=left> Class  </th>";
 echo "<td colspan=3 align=center> "  .$ppp["class_name"] . "</td>" ;
  echo "</tr>";
  echo "<th bgcolor=white align=left> Section </th>";

 echo "<th colspan=3> "  .$ppp["cls_sec"] . "</th>" ;
  echo "</tr>";
  
 

 echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Fee Period </th>";
  echo "<td width=10% colspan=3> "  .$ppp["month_period"] . "</td>" ;
echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Due Date </th>";
  echo "<td width=10% colspan=3> "  .$ppp["due_date"] . "</td>" ;
echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=center colspan=3 > Particulars </th>";
echo "<th bgcolor=white align=center > Rs. </th>";


echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3 > Tuition Fee </th>";
 echo "<td width=40%> " ."Rs." .$ppp["mfee"] .".00". "</td>" ;
 
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc1"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee1"] .".00". "</td>" ;
 echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc2"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee2"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc3"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee3"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc4"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee4"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc5"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee5"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc6"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee6"] .".00". "</td>" ;
 echo "</tr>";
 
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Pre. Balance </th>";
echo "<td width=40%> " ."Rs" .$ppp["bal"] . ".00"."</td>" ;
echo "</tr>";

  echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Current Fine </th>";
 echo "<td width=40%>  " ."Rs." .$ppp["fine"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=3> Net Paybale </th>";
  echo "<td width=40%>  " ."Rs." .$ppp["totalfee"] . ".00"."</td>" ;
 echo "</tr>";
 

 
 
  
 
  echo "<tr>";
  echo "<td bgcolor=white align=left colspan=4><b>$notice</b>
 </td>";
 echo "</tr>";
 
  echo "<tr>";
echo "<th bgcolor=white align=center colspan=4> Bank Copy </th>";
 echo "</tr>";

echo "</table>";
echo "<table border=1 width=33% align=left bgcolor=white>";
	?>
<tr>
<td align="center" colspan="4"><img src="logo1.jpg" /></td>

</tr>
<?php
	echo "<tr>";
	echo "<td colspan=4>";
	
	echo "<h1 align=center colspan=4>$userid </h1>";
	
	 echo "<h4 align=center colspan=4>$bname </h4>";
	 echo "<h4 align=center colspan=4>$accno </h4>";
	 echo "</td>";
echo "</tr>";
 echo "<tr>";
  echo "<th bgcolor=white align=left > Issue Date </th>";
  echo "<td> " .$ppp["date"] . "</td>" ;
  echo "<th bgcolor=white align=center > Slip No </th>";
  echo "<td> "  .$ppp["id"] . "</td>" ;
  echo "</tr>";

echo "<tr>";
echo "<th bgcolor=white align=left> Admission No </th>";
  echo "<th colspan=3> "  .$ppp["adm_no"] . "</th>" ;
 echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=left>Student Name </th>";
  echo "<th colspan=3> "  .$ppp["std_name"] . "</th>" ;
  
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left>Father Name </th>";
  echo "<th colspan=3> "  .$ppp["fname"] . "</th>" ;
  
 echo "</tr>";
echo "<tr>";
  echo "<th bgcolor=white align=left> Student ID </th>";

 echo "<th colspan=3> "  .$ppp["portal_id"] . "</th>" ;
  echo "</tr>";
  echo "<tr>";
   echo "<tr>";
  echo "<th bgcolor=white align=left> Class  </th>";
 echo "<td colspan=3 align=center> "  .$ppp["class_name"] . "</td>" ;
  echo "</tr>";
  echo "<th bgcolor=white align=left> Section </th>";

 echo "<th colspan=3> "  .$ppp["cls_sec"] . "</th>" ;
  echo "</tr>";
  
 

 echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Fee Period </th>";
  echo "<td width=10% colspan=3> "  .$ppp["month_period"] . "</td>" ;
echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Due Date </th>";
  echo "<td width=10% colspan=3> "  .$ppp["due_date"] . "</td>" ;
echo "</tr>";
echo "<tr>";
 echo "<th bgcolor=white align=center colspan=3 > Particulars </th>";
echo "<th bgcolor=white align=center > Rs. </th>";


echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3 > Tuition Fee </th>";
 echo "<td width=40%> " ."Rs." .$ppp["mfee"] .".00". "</td>" ;
 
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc1"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee1"] .".00". "</td>" ;
 echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc2"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee2"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc3"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee3"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc4"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee4"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc5"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee5"] .".00". "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>" . $ppp["feedisc6"] ."</th>";
 echo "<td width=40%> " ."Rs." .$ppp["fee6"] .".00". "</td>" ;
 echo "</tr>";
 
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Pre. Balance </th>";
echo "<td width=40%> " ."Rs" .$ppp["bal"] . ".00"."</td>" ;
echo "</tr>";

  echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Current Fine </th>";
 echo "<td width=40%>  " ."Rs." .$ppp["fine"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=3> Net Paybale </th>";
  echo "<td width=40%>  " ."Rs." .$ppp["totalfee"] . ".00"."</td>" ;
 echo "</tr>";
 

 
 
  
 
  echo "<tr>";
  echo "<td bgcolor=white align=left colspan=4><b>$notice</b>
 </td>";
 echo "</tr>";
 
  echo "<tr>";
echo "<th bgcolor=white align=center colspan=4> Parents Copy </th>";
 echo "</tr>";

echo "</table>";
echo "_______________________________________________________________________________________________________________________";

}
?>