<?php 



if(isset($_POST["submit670"])){

$schoolyear = $_POST["schoolyear"];

$terma = $_POST["term"];



$term = "t".$terma;

$ya="and schoolyear='$schoolyear'";

$ter="and term='$terma'";



}else{

	$schoolyear = date("y");

$ya = "and schoolyear='$schoolyear'";

$ter="and term='1'";



$cm=date("m");

if($cm>='1' and $cm<='4'){$term="t1";}

elseif($cm>='5' and $cm<='8'){$term="t2";}

elseif($cm>='9' and $cm<='12'){$term="t3";}

}







$result8t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='8' $ya");

$row8t1 = $result8t1->fetch(); 



$result8t1c = $dbh->query("select * from $term where schoolclass='8' $ya");

$count8t1c = $result8t1c->rowCount();



$result9t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='9' $ya");

$row9t1 = $result9t1->fetch(); 



$result9t1c = $dbh->query("select * from $term where schoolclass='9' $ya");

$count9t1c = $result9t1c->rowCount();



$result10t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='10' $ya");

$row10t1 = $result10t1->fetch(); 



$result10t1c = $dbh->query("select * from $term where schoolclass='10' $ya");

$count10t1c = $result10t1c->rowCount();



$result1t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='1' $ya");

$row1t1 = $result1t1->fetch(); 



$result1t1c = $dbh->query("select * from $term where schoolclass='1' $ya");

$count1t1c = $result1t1c->rowCount();



$result2t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='2' $ya");

$row2t1 = $result2t1->fetch(); 



$result2t1c = $dbh->query("select * from $term where schoolclass='2' $ya");

$count2t1c = $result2t1c->rowCount();



$result3t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='3' $ya");

$row3t1 = $result3t1->fetch(); 



$result3t1c = $dbh->query("select * from $term where schoolclass='3' $ya");

$count3t1c = $result3t1c->rowCount();



$result4t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='4' $ya");

$row4t1 = $result4t1->fetch(); 



$result4t1c = $dbh->query("select * from $term where schoolclass='4' $ya");

$count4t1c = $result4t1c->rowCount();





$result5t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='5' $ya");

$row5t1 = $result5t1->fetch(); 



$result5t1c = $dbh->query("select * from $term where schoolclass='5' $ya");

$count5t1c = $result5t1c->rowCount();



$result6t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='6' $ya");

$row6t1 = $result6t1->fetch(); 



$result6t1c = $dbh->query("select * from $term where schoolclass='6' $ya");

$count6t1c = $result6t1c->rowCount();



$result7t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='7' $ya");

$row7t1 = $result7t1->fetch(); 



$result7t1c = $dbh->query("select * from $term where schoolclass='7' $ya");

$count7t1c = $result7t1c->rowCount();



$result21t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='21' $ya");

$row21t1 = $result21t1->fetch(); 



$result21t1c = $dbh->query("select * from $term where schoolclass='21' $ya");

$count21t1c = $result21t1c->rowCount();



$result22t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='22' $ya");

$row22t1 = $result22t1->fetch(); 



$result22t1c = $dbh->query("select * from $term where schoolclass='22' $ya");

$count22t1c = $result22t1c->rowCount();



$result23t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='23' $ya");

$row23t1 = $result23t1->fetch(); 



$result23t1c = $dbh->query("select * from $term where schoolclass='23' $ya");

$count23t1c = $result23t1c->rowCount();



$result24t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='24' $ya");

$row24t1 = $result24t1->fetch();



$result24t1c = $dbh->query("select * from $term where schoolclass='24' $ya");

$count24t1c = $result24t1c->rowCount();



$result25t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='25' $ya");

$row25t1 = $result25t1->fetch();



$result25t1c = $dbh->query("select * from $term where schoolclass='25' $ya");

$count25t1c = $result25t1c->rowCount();



$result26t1 = $dbh->query

("select sum(ownfee)+sum(uniform)+sum(contribution)+sum(registration)+sum(holiday)+sum(admission)+sum(transport)+sum(mockfa)+sum(other1)+sum(other2)+sum(other3)

 AS t2_totalincome from $term where schoolclass='26' $ya");

$row26t1 = $result26t1->fetch(); 



$result26t1c = $dbh->query("select * from $term where schoolclass='26' $ya");

$count26t1c = $result26t1c->rowCount();









$result8inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='8' $ter $ya");

$row8inc = $result8inc->fetch();



$result9inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='9' $ter $ya");

$row9inc = $result9inc->fetch();



$result10inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='10' $ter $ya");

$row10inc = $result10inc->fetch();



$result1inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='1' $ter $ya");

$row1inc = $result1inc->fetch();



$result2inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='2' $ter $ya");

$row2inc = $result2inc->fetch();



$result3inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='3' $ter $ya");

$row3inc = $result3inc->fetch();



$result4inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='4' $ter $ya");

$row4inc = $result4inc->fetch();



$result5inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='5' $ter $ya");

$row5inc = $result5inc->fetch();



$result6inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='6' $ter $ya");

$row6inc = $result6inc->fetch();



$result7inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='7' $ter $ya");

$row7inc = $result7inc->fetch();



$result21inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='21' $ter $ya");

$row21inc = $result21inc->fetch();



$result22inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='22' $ter $ya");

$row22inc = $result22inc->fetch();



$result23inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='23' $ter $ya");

$row23inc = $result23inc->fetch();



$result24inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='24' $ter $ya");

$row24inc = $result24inc->fetch();



$result25inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='25' $ter $ya");

$row25inc = $result25inc->fetch();



$result26inc = $dbh->query

("select sum(p_fees)+sum(p_uniform)+sum(p_contribution)+sum(p_registration)+sum(p_holiday)+sum(p_admission)+sum(p_transport)+sum(p_mockfa)+sum(p_other1)+sum(p_other2)+sum(p_other3

	) AS t2_totalincome from received where schoolclass='26' $ter $ya");

$row26inc = $result26inc->fetch();



?>