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

$userid=$_SESSION["userid"];
$challan_no=$_POST["challan_no"];
$blnk=0;
$result = mysql_query("SELECT * FROM users WHERE userid  = '$userid'");
$test = mysql_fetch_array($result);
if (!$result) 
		{
		die("Error: Data not found..");
		}
				$accno=$test['accno'] ;
				$bankname=$test['address'] ;
				$bname=$test['bankname'] ;
				$cell=$test['cell'] ;
$sql="select * from issueslip where id='$challan_no' and user_id='$userid'";
$issueslip=mysql_query($sql) or die("Error : " . mysql_error());
while($ppp=mysql_fetch_array($issueslip))


{


  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>$bankname </h4>";
	 echo "<h4 align=center colspan=4>$cell </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  width=30% >Bank / Branch </th>";
echo "<td bgcolor=white align=left colspan=3 width=70%>$bname </td>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left width=30% >Acc# </th>";
echo "<td bgcolor=white align=left colspan=3 width=70%>$accno </td>";
echo "</tr>";
  




echo "<tr>";
 echo "<th bgcolor=white align=left>Student Name </th>";
  echo "<th colspan=3>"  .$ppp["stdname"] . "</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["rollno"] . "</th>" ;
  echo "</tr>";
   echo "<tr>";
  echo "<th bgcolor=white align=left> Class  </th>";
 echo "<td colspan=3 align=center>"  .$ppp["cname"] . "</td>" ;
  echo "</tr>";
 

 echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Fee Period </th>";
  echo "<td width=10% colspan=3>"  .$ppp["months"] . "</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 "<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 "<tr>";
echo "<th bgcolor=white align=left colspan=3> Arrears </th>";
echo "<td width=40%>" ."Rs" .$ppp["bal"] . ".00"."</td>" ;
 
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Annual Charges </th>";
 echo "<td width=40%>" ."Rs." .$ppp["afee"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Transport Fee </th>";
 echo "<td width=40%>" ."Rs." .$ppp["gfee"] . ".00"."</td>" ;
 echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>"  .$ppp["feedisc"] . "</th>";
 echo "<td width=40%>" ."Rs." .$ppp["feeamount"] . ".00"."</td>" ;
 echo "</tr>";
 
  echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Discount if any</th>";
 echo "<td width=40%>" . " Rs.0.00 " . "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Misc </th>";
 echo "<td width=40%>" . " Rs.0.00 " . "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Late Payment Fine </th>";
 echo "<td width=40%>" ."Rs." .$ppp["fine"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=3> With Due Date </th>";
  echo "<td width=40%>" ."Rs." .$ppp["nettotal"] . ".00"."</td>" ;
 echo "</tr>";
 

 
 
  
 
 
  echo "<tr>";
echo "<td bgcolor=white align=left colspan=4><b> Dear Parents,<br>A Fine of Rs. 20 per day will be charged after the Due Date. Student will not be allowed to attend the classes, if the fee is not deposited within 2 weeks of the due date. Due date is applicable only for the current Fee bill. In case of Balance pay it immediately.</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>$bankname </h4>";
	 echo "<h4 align=center colspan=4>$cell </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  width=30% >Bank / Branch </th>";
echo "<td bgcolor=white align=left colspan=3 width=70%>$bname </td>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left width=30% >Acc# </th>";
echo "<td bgcolor=white align=left colspan=3 width=70%>$accno </td>";
echo "</tr>";


echo "<tr>";
 echo "<th bgcolor=white align=left> Student Name </th>";
  echo "<th colspan=3>"  .$ppp["stdname"] . "</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["rollno"] . "</th>" ;
  echo "</tr>";
   echo "<tr>";
  echo "<th bgcolor=white align=left> Class  </th>";
 echo "<td colspan=3 align=center>"  .$ppp["cname"] . "</td>" ;
  echo "</tr>";
 

 echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Fee Period </th>";
  echo "<td width=10% colspan=3>"  .$ppp["months"] . "</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 "<th bgcolor=white align=center colspan=3 > Particulars </th>";
echo "<th bgcolor=white align=center > Rs. </th>";


echo "</tr>";

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 "<tr>";
echo "<th bgcolor=white align=left colspan=3> Arrears </th>";
 echo "<td width=40%>" ."Rs" .$ppp["bal"] . ".00"."</td>" ;
 
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Annual Charges </th>";
 echo "<td width=40%>" ."Rs." .$ppp["afee"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>  Transport Fee </th>";
 echo "<td width=40%>" ."Rs." .$ppp["gfee"] . ".00"."</td>" ;
 echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>"  .$ppp["feedisc"] . "</th>";
 echo "<td width=40%>" ."Rs." .$ppp["feeamount"] . ".00"."</td>" ;
 echo "</tr>";
 
  echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Discount if any</th>";
 echo "<td width=40%>" . " Rs.0.00 " . "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Misc </th>";
 echo "<td width=40%>" . " Rs.0.00 " . "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Late Payment Fine </th>";
 echo "<td width=40%>" ."Rs." .$ppp["fine"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=3> With Due Date </th>";
  echo "<td width=40%>" ."Rs." .$ppp["nettotal"] . ".00"."</td>" ;
 echo "</tr>";
 

 
 
  
 
 
  echo "<tr>";
echo "<td bgcolor=white align=left colspan=4><b>Dear Parents,<br>A Fine of Rs. 20 per day will be charged after the Due Date. Student will not be allowed to attend the classes, if the fee is not deposited within 2 weeks of the due date. Due date is applicable only for the current Fee bill. In case of Balance pay it immediately.</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>$bankname </h4>";
	 echo "<h4 align=center colspan=4>$cell </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  width=30% >Bank / Branch </th>";
echo "<td bgcolor=white align=left colspan=3 width=70%>$bname </td>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left width=30% >Acc# </th>";
echo "<td bgcolor=white align=left colspan=3 width=70%>$accno </td>";
echo "</tr>";
  




echo "<tr>";
 echo "<th bgcolor=white align=left> Student Name </th>";
  echo "<th colspan=3>"  .$ppp["stdname"] . "</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["rollno"] . "</th>" ;
  echo "</tr>";
   echo "<tr>";
  echo "<th bgcolor=white align=left> Class  </th>";
 echo "<td colspan=3 align=center>"  .$ppp["cname"] . "</td>" ;
  echo "</tr>";
 

 echo "<tr>";
 echo "<th bgcolor=white align=left width=30%> Fee Period </th>";
  echo "<td width=10% colspan=3>"  .$ppp["months"] . "</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 "<th bgcolor=white align=center colspan=3 > Particulars </th>";
echo "<th bgcolor=white align=center > Rs. </th>";


echo "</tr>";

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 "<tr>";
echo "<th bgcolor=white align=left colspan=3> Arrears </th>";
 echo "<td width=40%>" ."Rs" .$ppp["bal"] . ".00"."</td>" ;
 
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Annual Charges </th>";
 echo "<td width=40%>" ."Rs." .$ppp["afee"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>  Transport Fee </th>";
 echo "<td width=40%>" ."Rs." .$ppp["gfee"] . ".00"."</td>" ;
 echo "</tr>";
echo "<tr>";
echo "<th bgcolor=white align=left colspan=3>"  .$ppp["feedisc"] . "</th>";
 echo "<td width=40%>" ."Rs." .$ppp["feeamount"] . ".00"."</td>" ;
 echo "</tr>";
  
  echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Discount if any</th>";
 echo "<td width=40%>" . " Rs.0.00 " . "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Misc </th>";
 echo "<td width=40%>" . " Rs.0.00 " . "</td>" ;
 echo "</tr>";
 echo "<tr>";
echo "<th bgcolor=white align=left colspan=3> Late Payment Fine </th>";
 echo "<td width=40%>" ."Rs." .$ppp["fine"] . ".00"."</td>" ;
 echo "</tr>";
 echo "<tr>";
 echo "<th bgcolor=white align=left colspan=3> With Due Date </th>";
  echo "<td width=40%>" ."Rs." .$ppp["nettotal"] . ".00"."</td>" ;
 echo "</tr>";
 

 
 
  
 
 
  echo "<tr>";
echo "<td bgcolor=white align=left colspan=4><b>Dear Parents,<br>A Fine of Rs. 20 per day will be charged after the Due Date. Student will not be allowed to attend the classes, if the fee is not deposited within 2 weeks of the due date. Due date is applicable only for the current Fee bill. In case of Balance pay it immediately.</b>

 </td>";
 echo "</tr>";
  echo "<tr>";
 

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

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

}
?>