<?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['pay_date']; ?>

</Br></Br></Br></Br>
<table width="100%" border="1" cellspacing="2" cellpadding="2" class="table table-bordered table-striped">
  <tr>
    <td rowspan="3" ><span >S.No.</span></td>
    <td rowspan="3" ><span >Filling Date</span></td>
    <td rowspan="3" ><span >Locked Date</span></td>
    <td rowspan="3" ><span >Course Type</span></td>
    <td rowspan="3" ><span >Course</span></td>
    <td rowspan="3" ><span >Year</span></td>
    <td rowspan="3" ><span >Form No</span></td>
    <td rowspan="3" ><span >Roll No</span></td>
    <td rowspan="3" ><span >Student Name</span></td>
    <td rowspan="3" ><span >Fathers Name</span></td>
    <td rowspan="3" ><span >Mothers Name</span></td>
    <td rowspan="3" ><span >D.O.B.</span></td>
    <td rowspan="3" ><span >Category</span></td>
    <td rowspan="3" ><span >Religion</span></td>
    <td rowspan="3" ><span >Mobile</span></td>
    <td rowspan="3" ><span >Subject</span></td>
    <td rowspan="3" ><span >Total Course Fee</span></td>
    <td colspan="7" ><div align="center">Discount Details</div></td>
    <td rowspan="3" ><span >Course Adj. Fees</span></td>
    <td colspan="19" ><div align="center"><strong>Pay Fees Details</strong></div></td>
    <td rowspan="2" ><span >Dues</span></td>
  </tr>
  <tr>
    <td rowspan="2" bgcolor="#FFFFFF" ><strong>Admission Fee</strong></td>
    <td rowspan="2" bgcolor="#FFFFFF" ><strong>Practical Fee</strong></td>
    <td rowspan="2" bgcolor="#FFFFFF" ><strong>Practical File Fee</strong></td>
    <td rowspan="2" bgcolor="#FFFFFF" ><strong>UIN Fee</strong></td>
    <td rowspan="2" bgcolor="#FFFFFF" ><strong>Other Fee</strong></td>
    <td rowspan="2" bgcolor="#FFFFFF" ><strong>Other Fee - 2</strong></td>
    <td rowspan="2" ><span >Discount</span></td>
    <td colspan="3" bgcolor="#FFFFFF" ><strong>Admission Fee</strong></td>
    <td colspan="3" bgcolor="#FFFFFF" ><strong>Practical Fee</strong></td>
    <td colspan="3" bgcolor="#FFFFFF" ><strong>Practical File Fee</strong></td>
    <td colspan="3" bgcolor="#FFFFFF" ><strong>UIN Fee</strong></td>
    <td colspan="3" bgcolor="#FFFFFF" ><strong>Other Fee</strong></td>
    <td colspan="3" bgcolor="#FFFFFF" ><strong>Other Fee - 2</strong></td>
    <td ><span >Pay Fees</span></td>
  </tr>
  <tr>
    <td bgcolor="#FF0000" >T</td>
    <td bgcolor="#009900" >P</td>
    <td bgcolor="#FFFFFF" >D</td>
    <td bgcolor="#FF0000" >T</td>
    <td bgcolor="#009900" >P</td>
    <td bgcolor="#FFFFFF" >D</td>
    <td bgcolor="#FF0000" >T</td>
    <td bgcolor="#009900" >P</td>
    <td bgcolor="#FFFFFF" >D</td>
    <td bgcolor="#FF0000" >T</td>
    <td bgcolor="#009900" >P</td>
    <td bgcolor="#FFFFFF" >D</td>
    <td bgcolor="#FF0000" >T</td>
    <td bgcolor="#009900" >P</td>
    <td bgcolor="#FFFFFF" >D</td>
    <td bgcolor="#FF0000" >T</td>
    <td bgcolor="#009900" >P</td>
    <td bgcolor="#FFFFFF" >D</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
  </tr>

  

    

     <?php

    

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

$query = "SELECT * FROM class2 WHERE college='$college' and `CourseType`='$CourseType' and `Course`='$Course' and `Course_Details`='$Course_Details' and datee LIKE '%$datee%' and status='Locked' 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(($CourseType!="")&&($login_type!='admin')){

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

 {

 $fnoo=$a_row['fno'];

 ?>

  <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 $course_name=$a_row['Course']; ?></td>
    <td><?php echo $Course_Details=$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 
$fno=$a_row['fno'];$Course=$a_row['Course'];$Course_Details=$a_row['Course_Details'];
											

											$queryx = "SELECT * FROM fees where class='$Course' and section='$Course_Details' and code='$college'";

$numresultsyx=mysql_query($queryx);

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

$a_rowx = mysql_fetch_row( $resultyx );

$fees_1=$a_rowx[3];

  $fees_2=$a_rowx[4];
  $fees_8=$a_rowx[8];
  $fees_9=$a_rowx[9];
  $fees_10=$a_rowx[10];
  $fees_11=$a_rowx[11];
  $fees_12=$a_rowx[12];
  
  //////////////////////////////////////////////

  

 

 $check_exist_qryfe="select * from class2 where fno='$fno'";

$run_qryfe=mysql_query($check_exist_qryfe);

$total_foundfe=mysql_num_rows($run_qryfe);

$roww_fe = mysql_fetch_array($run_qryfe, MYSQL_BOTH);

	 $str = $roww_fe['class_app']; 

	 $college_codex = $roww_fe['college'];

	 $CourseTypex = $roww_fe['CourseType'];
$tofees=$roww_fe['total_fees'];
	 

	 if($str!=""){

	 $class_app=explode(",",$str);

	

foreach ($class_app as $value) {



//////////////////////////////////////////////



//echo $value;

 $queryyr = "SELECT * FROM subject where college_code='$college' and college_type='$CourseTypex' and subject='$value' and subject_type='P'";

$numresultsyr=mysql_query($queryyr);

$numrows=mysql_num_rows($numresultsyr);

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

$a_rowwr = mysql_fetch_row( $resultyr );

$pra_chk=$a_rowwr[5]; 

if(($numrows!="")&&($pra_chk=="P")&&($a=="")){

$a=0;

//echo '*';

}

if(($numrows!="")&&($pra_chk="P")){



$a;


$a++;

}

//echo $pra_chk;



  

//echo $a;



}
}

  ////////////////////////////////////////////

  

  $fees_2=$fees_2*$a;
$fees_9=$fees_9;
  $gtotalp=$fees_2+$fees_9;

    
//$tofees=$fees_8+$fees_10+$fees_11+$fees_12+$gtotalp;
 // echo $tofees;
$a=0;

  

  ?>  
      <?php $tofees=$tofees; ?>
    <?php echo $tofees; 
			   
			   ?>          
     <?php
			$roll=$a_row['fno'];				
$queryy = "SELECT * FROM pay_fees where roll_no='$roll'";
$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>
      
      <div align="right">

          
        <?php echo $dis2; ?>    </div></td>
    <td><div align="right"><?php echo $s1; ?></div></td>
    <td bgcolor="#FF0000"><?php echo $fees_8=$tofees; $fees_88+=$fees_8; ?></td>
    <td bgcolor="#009900"><?php echo $payy1; ?></td>
    <td bgcolor="#FFFFFF">
	<?php   $due_adm=$fees_8-($payy1+$duee1);echo $due_adm; $due_adm1+=$due_adm;?>	</td>
    <td bgcolor="#FF0000"><?php echo $fees_2; $fees_22+=$fees_2; ?></td>
    <td bgcolor="#009900"><?php echo $payy2;?></td>
    <td bgcolor="#FFFFFF">
	<?php  $due_prafee=$fees_2-($payy2+$duee2); echo $due_prafee; $due_prafee1+=$due_prafee;?></td>
    <td bgcolor="#FF0000"><?php echo $fees_9; $fees_91+=$fees_9; ?></td>
    <td bgcolor="#009900"><?php echo $payy3;?></td>
    <td bgcolor="#FFFFFF">
	<?php  $due_prafile=$fees_9-($payy3+$duee3); echo $due_prafile; $due_prafile1+=$due_prafile;?>	</td>
    <td bgcolor="#FF0000"><?php echo $fees_10; $fees_101+=$fees_10; ?></td>
    <td bgcolor="#009900"><?php echo $payy4;?></td>
    <td bgcolor="#FFFFFF">
	
	
	<?php  $due_uin=$fees_10-($payy4+$duee4); echo $due_uin; $due_uin1+=$due_uin;?>
	<br/></td>
    <td bgcolor="#FF0000"><?php echo $fees_11; $fees_111+=$fees_11; ?></td>
    <td bgcolor="#009900"><?php echo $payy5;?></td>
    <td bgcolor="#FFFFFF"><?php  $due_ot1=$fees_11-($payy5+$duee5); echo $due_ot1; $due_ot11+=$due_ot1;?>      <Br/></td>
    <td bgcolor="#FF0000"><?php echo $fees_12; $fees_121+=$fees_12; ?></td>
    <td bgcolor="#009900"><?php echo $payy6;?></td>
    <td bgcolor="#FFFFFF"><?php  $due_ot2=$fees_12-($payy6+$duee6); echo $due_ot2; $due_ot21+=$due_ot2; ?>      <Br/></td>
    <td><strong>
      <div align="right"><?php echo $pay2; ?></div></td>
    <td> <div align="right"><?php echo $dues3; ?></div></td>
  </tr>

  <?php 
  $dis221+=$dis2;
  $pay221+=$pay2;  
   $payy11+=$payy1;
  $payy22+=$payy2;
  $payy33+=$payy3;
   $payy44+=$payy4;
   $payy55+=$payy5;
   $payy66+=$payy6;
   $duee11+=$duee1;
   $duee22+=$duee2;
   $duee33+=$duee3;
   $duee44+=$duee4;
   $duee55+=$duee5;
   $duee66+=$duee6;
  $pay2=0;
  $dis2=0;
  $a=0;
  $pra_chk=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;
  
$tofeesd+=$tofees;
$s1f+=$s1;
$dues33+=$dues3;
 $counter++; 
} ?>  <tr>
    <td colspan="16">&nbsp;</td>
    <td bgcolor="#FFFF33"><div align="center" class="style4">
      <div align="right"><?php echo $tofeesd; ?></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="#FFFF33"><div align="center" class="style4">
      <div align="right"><?php echo $dis221; ?></div>
    </div></td>
    <td bgcolor="#FFFF33"><div align="center" class="style4">
      <div align="right"><?php echo $s1f; ?></div>
    </div></td>
    <td bgcolor="#FF0000"><?php echo $fees_88; ?></td>
    <td bgcolor="#009900"><?php echo $payy11; ?></td>
    <td bgcolor="#FFFF00"><?php   echo $due_adm1;?></td>
    <td bgcolor="#FF0000"><?php echo $fees_22; ?></td>
    <td bgcolor="#009900"><?php echo $payy22;?></td>
    <td bgcolor="#FFFF00"><?php  echo $due_prafee1;?></td>
    <td bgcolor="#FF0000"><?php echo $fees_91;  ?></td>
    <td bgcolor="#009900"><?php echo $payy33;?></td>
    <td bgcolor="#FFFF00"><?php  echo $due_prafile1;?></td>
    <td bgcolor="#FF0000"><?php echo $fees_101; ?></td>
    <td bgcolor="#009900"><?php echo $payy44;?></td>
    <td bgcolor="#FFFF00"><?php  echo $due_uin1;?></td>
    <td bgcolor="#FF0000"><?php echo $fees_111; ?></td>
    <td bgcolor="#009900"><?php echo $payy55;?></td>
    <td bgcolor="#FFFF00"><?php  echo $due_ot11;?></td>
    <td bgcolor="#FF0000"><?php echo $fees_121; ?></td>
    <td bgcolor="#009900"><?php echo $payy66;?></td>
    <td bgcolor="#FFFF00"><?php  echo $due_ot21; ?></td>
    <td bgcolor="#FFFF33"><div align="center" class="style4">
      <div align="right"><?php echo $pay221; ?></div>
    </div></td>
    <td bgcolor="#FFFF33"><div align="center" class="style4">
      <div align="right"><?php echo $dues33; ?></div>
    </div></td>
  </tr>
</table>

</div></div>




<?php  }

//include "footer.php"; ?>