<?php include "header_with_out_nav.php"; 

if($login_type!=''){

$college=$_GET['college'];

$CourseType=$_GET['CourseType'];

$Course=$_GET['Course'];

$Course_Details=$_GET['Course_Details'];

$datee=$_GET['datee']; ?>



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

                    

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

  <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 >&nbsp;</td>

    <td >&nbsp;</td>

    <td >&nbsp;</td>

    <td >&nbsp;</td>

    <td >&nbsp;</td>

    <td >&nbsp;</td>

    <td >&nbsp;</td>

    <td colspan="7" >Discount Details</td>

    <td >&nbsp;</td>

    <td colspan="7" ><div align="center"><strong>Pay Fees Details</strong></div></td>

    <td >&nbsp;</td>

  </tr>

  <tr>

    <td ><span >S.No.</span></td>

    <td ><span >Filling Date</span></td>

    <td ><span >Locked Date</span></td>

    <td ><span >Course Type</span></td>

    <td ><span >Course</span></td>

    <td ><span >Year</span></td>

    <td ><span >Form No</span></td>

    <td ><span >Roll No</span></td>

    <td ><span >Student Name</span></td>

    <td ><span >Fathers Name</span></td>

    <td ><span >Mothers Name</span></td>

    <td ><span >D.O.B.</span></td>

    <td ><span >Category</span></td>

    <td ><span >Religion</span></td>

    <td ><span >Mobile</span></td>

    <td ><span >Subject</span></td>

    <td ><span >Total Course Fee</span></td>

    <td bgcolor="#FFFFFF" ><strong>Admission Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Practical Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Practical File Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>UIN Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Other Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Other Fee - 2</strong></td>

    <td bgcolor="#CCCCCC" ><span >Discount</span></td>

    <td ><span >Course Adj. Fees</span></td>

    <td bgcolor="#FFFFFF" ><strong>Admission Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Practical Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Practical File Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>UIN Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Other Fee</strong></td>

    <td bgcolor="#FFFFFF" ><strong>Other Fee - 2</strong></td>

    <td bgcolor="#CCCCCC" ><strong>Pay Fees</strong></td>

    <td ><span >Dues</span></td>

  </tr>

  

    

     <?php

    

	if(($CourseType!="")&&($datee=='')){

$query = "SELECT * FROM class2 WHERE college='$college' and `CourseType`='$CourseType' and `Course`='$Course' and `Course_Details`='$Course_Details' 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 query1");

echo "fdgdfgfdg";

}elseif($CourseType!=""){

$query = "SELECT * FROM class2 WHERE college='$college' and `CourseType`='$CourseType' and `Course`='$Course' and `Course_Details`='$Course_Details' and datee LIKE '%$datee%' 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 query1");

}else{

$query = "SELECT * FROM class2 WHERE college='$college' and datee LIKE '%$datee%' 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 query2");}

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

//$query = "SELECT * FROM class2 WHERE college='$college' and datee LIKE '%$datee%' order by id";

//$numresults=mysql_query($query);

// $numrows=mysql_num_rows($numresults);

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

//}elseif($login_session!='admin'){

//$query = "SELECT * FROM class2 WHERE college='$college' and datee LIKE '%$datee%' and checked_by='$login_session' order by id";

//$numresults=mysql_query($query);

// $numrows=mysql_num_rows($numresults);

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

//}



?>

<?php 

$counter = 1;?>

 <?php

while ( $a_row = mysql_fetch_array( $result ) )

 {

 ?>

  <tr>

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

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

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

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

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

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

    <td>

	<script language="javascript" type="text/javascript">

<!--

function popitup(url) {

	newwindow=window.open(url,'name2','height=600,width=1200');

	if (window.focus) {newwindow.focus()}

	return false;

}



// -->

</script><a href="total_form_fill.php" onclick="return popitup('veri_form_2.php?fno=<?php echo $a_row['fno'];?>&&btnSave2=Save&&all_game_valueb=<?php echo $a_row['class_app'];?>&&CourseType=<?php echo $a_row['CourseType'];?>&&Course=<?php echo $a_row['Course'];?>&&Course_Details=<?php echo $a_row['Course_Details'];?>&&session=<?php echo $a_row['session'];?>&&Student_Type=<?php echo $a_row['Student_Type'];?>&college=<?php echo $a_row['college'];?>')">

   <?php echo $a_row['fno']; ?>

    </a>    </td>

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

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

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

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

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

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

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

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

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

    <td><div align="right">

      <?php $tofees=$a_row['total_fees']; ?>

    <?php echo $tofees; 

			   

			   ?>            <?php

			$roll=$a_row['fno'];				

$queryy = "SELECT * FROM pay_fees where roll_no='$roll' and session='$session' and code='$code'";

$numresultsy=mysql_query($queryy);

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

?>

          

        <?php

while ( $a_rowd = mysql_fetch_row( $resulty ) )

 {?>

          

        <?php

 $dis1=$a_rowd[5];

    $pay1=$a_rowd[4];

  $pay1=$a_rowd[4];

  $payy1+=$a_rowd[13];

  $payy2+=$a_rowd[14];

  $payy3+=$a_rowd[15];

   $payy4+=$a_rowd[16];

   $payy5+=$a_rowd[17];

   $payy6+=$a_rowd[18];

   $duee1+=$a_rowd[19];

   $duee2+=$a_rowd[20];

   $duee3+=$a_rowd[21];

   $duee4+=$a_rowd[22];

   $duee5+=$a_rowd[23];

   $duee6+=$a_rowd[24];

   

  $pay2+=$pay1;

  $dis2+=$dis1;  

  } 

			    $s1=$tofees-$dis2;

			   $dues3=$s1-$pay2;

			  

  ?></div></td>

    <td bgcolor="#FFFFFF"><?php echo $duee1;?></td>

    <td bgcolor="#FFFFFF"><?php echo $duee2;?></td>

    <td bgcolor="#FFFFFF"><?php echo $duee3;?></td>

    <td bgcolor="#FFFFFF"><?php echo $duee4;?></td>

    <td bgcolor="#FFFFFF"><?php echo $duee5;?></td>

    <td bgcolor="#FFFFFF"><?php echo $duee6;?></td>

    <td bgcolor="#CCCCCC">

      

      <div align="right">



          

        <?php echo $dis2; ?>    </div></td>

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

    <td bgcolor="#FFFFFF"><?php echo $payy1;?></td>

    <td bgcolor="#FFFFFF"><?php echo $payy2;?></td>

    <td bgcolor="#FFFFFF"><?php echo $payy3;?></td>

    <td bgcolor="#FFFFFF"><?php echo $payy4;?></td>

    <td bgcolor="#FFFFFF"><?php echo $payy5;?></td>

    <td bgcolor="#FFFFFF"><?php echo $payy6;?></td>

    <td bgcolor="#CCCCCC"><strong>

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

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

  </tr>



  <?php 

  $dis221+=$dis2;

  $pay221+=$pay2;  

  $pay2=0;

  $dis2=0;

   $duee1=0;

    $duee2=0;

    $duee3=0;

    $duee4=0;

    $duee5=0;

    $duee6=0;

    $payy1=0;

    $payy2=0;

    $payy3=0;

    $payy4=0;

    $payy5=0;

    $payy6=0;

  $payy11+=$payy1;

  $payy22+=$payy2;

  $payy33+=$payy3;

   $payy44+=$payy4;

   $payy55+=$payy5;

   $payy66+=$payy6;

   $duee11+=$duee1;

   $duee22+=$duee2;

   $duee33+=$duee3;

   $duee44+=$duee4;

   $duee55+=$duee5;

   $duee66+=$duee6;

$tofeesd+=$tofees;

$s1f+=$s1;

$dues33+=$dues3;

$counter++;  

} ?>  <tr>

    <td colspan="16" bgcolor="#FFFF00"><div align="center"><span class="style4"></span></div></td>

    <td bgcolor="#FFFF00"><div align="center" class="style4">

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

    </div></td>

    <td bgcolor="#FFFF00"><?php echo $duee11;?></td>

    <td bgcolor="#FFFF00"><?php echo $duee22;?></td>

    <td bgcolor="#FFFF00"><?php echo $duee33;?></td>

    <td bgcolor="#FFFF00"><?php echo $duee44;?></td>

    <td bgcolor="#FFFF00"><?php echo $duee55;?></td>

    <td bgcolor="#FFFF00"><?php echo $duee66;?></td>

    <td bgcolor="#CCCCCC"><div align="center" class="style4">

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

    </div></td>

    <td bgcolor="#FFFF00"><div align="center" class="style4">

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

    </div></td>

    <td bgcolor="#FFFF00"><?php echo $payy11;?></td>

    <td bgcolor="#FFFF00"><?php echo $payy22; ?></td>

    <td bgcolor="#FFFF00"><?php echo $payy33;?></td>

    <td bgcolor="#FFFF00"><?php echo $payy44;?></td>

    <td bgcolor="#FFFF00"><?php echo $payy55;?></td>

    <td bgcolor="#FFFF00"><?php echo $payy66;?></td>

    <td bgcolor="#CCCCCC"><div align="center" class="style4">

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

    </div></td>

    <td bgcolor="#FFFF00"><div align="center" class="style4">

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

    </div></td>

  </tr>

</table>









<?php  }

include "footer.php"; ?>