

<?php $cy=date("y");

 if(isset($_POST["submit500"])){ if($_POST["schoolyear"]!='01'){ $schoolyear = $_POST["schoolyear"];

 $ya = "where schoolyear='$schoolyear'";

 $ya2= " and schoolyear='$schoolyear'";

 } else { $schoolyear ="";

 $ya ="";

 $ya2="";

 } } else{ $schoolyear =$cy;

 $ya ="where schoolyear='$cy'";

 $ya2 =" and schoolyear='$cy'";

 } $incomet1 = $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 t1_totalincome from received where term='1' $ya2");

 $row_inc_t1 = $incomet1->fetchObject();

 $expectedt1 = $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 t1_totalexpected from t1 $ya");

 $row_exp_t1 = $expectedt1->fetchObject();

 $incomet2 = $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 term='2' $ya2");

 $row_inc_t2 = $incomet2->fetchObject();

 $expectedt2 = $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_totalexpected from t2 $ya");

 $row_exp_t2 = $expectedt2->fetchObject();

 $incomet3 = $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 t3_totalincome from received where term='3' $ya2");

 $row_inc_t3 = $incomet3->fetchObject();

 $expectedt3 = $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 t3_totalexpected from t3 $ya");

 $row_exp_t3 = $expectedt3->fetchObject();

 

?>