<?php include "header_with_out_nav.php"; 

if($login_type!=''){

$code=$_GET['code'];

$college_type=$_GET['college_type'];

$sv=$_GET['sv'];

$sem_yer=$_GET['sem_yer'];

$pay_date=$_GET['pay_date'];

?>

</Br></Br></Br></Br>

<table width="100%" border="1" cellspacing="2" cellpadding="2" class="table table-bordered table-striped">

  <tr>

    <td bgcolor="#000000"><span class="style3 style1">S.No.</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Form No</span></td>

    <td bgcolor="#000000">R.No.</td>

    <td bgcolor="#000000"><span class="style3 style1">Pay Date</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Course Type</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Course</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Year</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Student Name</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Fathers Name</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Mothers Name</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Pay Fees</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Discount Amount</span></td>

    <td bgcolor="#000000"><span class="style3 style1">Checked By</span></td>

  </tr>

  

    

     <?php

       if(($sv!="")&&($login_type=='admin')){

	 

$query = "SELECT * FROM pay_fees WHERE code='$code' and `college_type`='$college_type' and `sv`='$sv' and `sem_yer`='$sem_yer' and pay_date LIKE '%$pay_date%'  and dis_amount!='0' and session='$session' and code='$code'  order by id";

$numresults=mysql_query($query);

 $numrows=mysql_num_rows($numresults);

$result = mysql_query($query) or die("Couldn't execute query");

}elseif(($sv!="")&&($login_type!='admin')){

	 

$query = "SELECT * FROM pay_fees WHERE code='$code' and `college_type`='$college_type' and `sv`='$sv' and `sem_yer`='$sem_yer' and pay_date LIKE '%$pay_date%'  and dis_amount!='0' and checked_by='$login_session' and session='$session' and code='$code' order by id";

$numresults=mysql_query($query);

 $numrows=mysql_num_rows($numresults);

$result = mysql_query($query) or die("Couldn't execute query");

}elseif($login_type=='admin'){

$query = "SELECT * FROM pay_fees WHERE  pay_date LIKE '%$pay_date%'  and dis_amount!='0' and session='$session' and code='$code' order by checked_by";

$numresults=mysql_query($query);

 $numrows=mysql_num_rows($numresults);

$result = mysql_query($query) or die("Couldn't execute query");

}elseif($login_type!='admin'){



$query = "SELECT * FROM pay_fees WHERE pay_date LIKE '%$pay_date%'  and dis_amount!='0' and checked_by='$login_session' and session='$session' and code='$code'  order by id";

$numresults=mysql_query($query);

 $numrows=mysql_num_rows($numresults);

$result = mysql_query($query) or die("Couldn't execute query");

}

?>

<?php 

$counter = 1;?>

 <?php

while ( $a_row = mysql_fetch_array( $result ) )

 {

 $sv=$a_row[9];

 $code=$a_row[7];

 ?>

  <tr>

    <td><?php echo $counter; ?></td>

    <td><?php echo $a_row['roll_no']; ?></td>

    <td><?php echo $code.'-'.$a_row['id']; ?></td>

    <td><?php echo $a_row['pay_date']; ?></td>

    <td><?php echo $a_row['college_type']; ?></td>

    <td> <?php 

											$queryy = "SELECT * FROM course_name where college_id='$code' && id='$sv' and session='$session' and code='$code'";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

 ?>

	                 

	                 <?php

while ( $a_roww = mysql_fetch_row( $resulty ) )

 {?>

	                 <?php 

				  

				 $course_namei=$a_row['sv'];

				//echo $course_namei;

				

				 $Course_id=$a_roww[0];

				 if($Course_id==$course_namei){

				  ?> 

	                 <?php echo $a_roww[1];?>

	                 <?php } ?> 

                     <?php } ?></td>

    <td><?php echo $a_row['sem_yer']; ?></td>

    <td><?php

	$roll_no=$a_row['roll_no'];

	$queryy = "SELECT * FROM class2 where college_roll='$roll_no' and session='$session' and code='$code'";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

$a_rowop = mysql_fetch_array($resulty );

	

	 echo $a_rowop['StudentName']; ?></td>

    <td><?php echo $a_rowop['FatherName']; ?></td>

    <td><?php echo $a_rowop['MotherName']; ?></td>

    

    <td><div align="right"><?php echo $a_row['pay_amount']; ?></div></td>

    <td><div align="right"><?php echo $a_row['dis_amount']; ?></div></td>

    <td><?php echo $a_row['checked_by']; ?></td>

  </tr>

  

  <?php $counter++; 

  $pay_amount2+=$a_row['pay_amount'];

  $dis_amount2+=$a_row['dis_amount'];

  } ?>

  

  <tr>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td><div align="right"><strong><?php echo $pay_amount2; ?></strong></div></td>

    <td><div align="right"><strong><?php echo $dis_amount2; ?></strong></div></td>

    <td>&nbsp;</td>

  </tr>

</table>









<?php  }

include "footer.php"; ?>