prepare("select * from average where grades = :a ") ; $alpha->bindparam(':a', $af) ; $alpha->execute() ; if($alpha->rowcount() > 0) { $rowds = $alpha->FETCH(PDO::FETCH_ASSOC) ; $as = $rowds['start'] ; $ae = $rowds['end'] ; } //get credits grade $cd = 'Credit' ; $crd = $DBcon->prepare( "select * from average where grades = :c ") ; $crd->bindparam(':c', $cd) ; $crd->execute() ; if($crd->rowcount() > 0) { $rowcr = $crd->FETCH(PDO::FETCH_ASSOC) ; $cs = $rowcr['start'] ; $ce = $rowcr['end'] ; } //get pass grade $p = 'Pass' ; $pass = $DBcon->prepare("select * from average where grades = :p ") ; $pass->bindparam(':p' , $p) ; $pass->execute() ; if($pass->rowcount() > 0) { $rowps = $pass->FETCH(PDO::FETCH_ASSOC) ; $ps = $rowps['start'] ; $pe = $rowps['end'] ; } //get failure grades $f = 'Fail' ; $fail =$DBcon->prepare("select * from average where grades =:f ") ; $fail->bindparam(':f' , $f) ; $fail->execute() ; if($fail->rowcount() > 0) { $rowfl = $fail->FETCH(PDO::FETCH_ASSOC) ; $fs = $rowfl['start'] ; $fe = $rowfl['end'] ; } //get promotional average $pa = 'Promotion Average' ; $pro = $DBcon->prepare("select * from average where grades = :pr "); $pro->bindparam(':pr' , $pa) ; $pro->execute() ; if($pro->rowcount() > 0) { $rowpro = $pro->FETCH(PDO::FETCH_ASSOC) ; $prs = $rowpro['start'] ; $pre = $rowpro['end'] ; } //min //get minimum no of subject $level = getm($cls) ; $sqlm = $DBcon->prepare("select * from subjno where (classlevel =:kls and term =:tm) and yr = :y") ; $sqlm->bindparam(':kls',$level) ; $sqlm->bindparam(':tm',$trm) ; $sqlm->bindparam(':y',$yrs) ; $sqlm->execute() ; $rowm = $sqlm->FETCH(PDO::FETCH_ASSOC) ; $min = $rowm['nos'] ; /* $sqls = $DBcon->prepare("select * from school") ; $sqls->execute() ; if($sqls->rowcount() == 0) header("location: school.php") ; else { $rw = $sqls->FETCH(PDO::FETCH_ASSOC) ; $name = $rw['name'] ; $add = $rw['address'] ; $ph = $rw['phones'] ; $emailsite = $rw['emailsite'] ; } */ ?>
|
GREAT MADONNA MODEL ACADEMY
ABA, ABIA STATE
WWW.GREATMADONNAMODELACADEMY.ORG
|
||
|---|---|---|
Termly Master Result Sheet |
||
| CLASS________________ | TERM__________________ | YEAR_______________ |
| ". 'NAME' ." | " ; echo"". 'REGNO' ." | " ; for($x = 0; $x < $subglenght; $x++) { $real = substr($subg[$x],0,5) ; echo "" . $real . " | " ; } echo"". 'TOTAL' ." | " ; echo"". 'AVG' ." | " ; echo"". 'POS' ." | " ; echo"". 'STATUS' ." | " ; echo "|
| ".$name." | " ; echo "".$val." | " ; foreach ($subjarray as $id) { $sc = $DBcon->prepare("select * from marks where(stregno =:reg and subject_id =:ids) and (term =:tm and acad_session =:yr)") ; $sc->bindparam(':reg',$val) ; $sc->bindparam(':ids',$id) ; $sc->bindparam(':tm',$trm) ; $sc->bindparam(':yr',$yrs) ; $sc->execute() ; if($sc->rowcount() > 0) { $rwd = $sc->FETCH(PDO::FETCH_ASSOC) ; $test =$rwd['test'] ; $md =$rwd['midterm'] ; $ex =$rwd['exam'] ; $tt = $test + $ex + $md ; $totalscore[] = $tt ; } else $tt = '-'; echo"".$tt." | " ; } //work average $tts = array_sum($totalscore) ; $numrow = count($totalscore) ; if($tts > 0) { if($numrow < $min) $av = $tts / $min ; else $av = $tts / $numrow; } else $av = '-' ; echo"". $tts ." | " ; echo "".round($av,2)." | " ; //work for position //POSITION //begin subject position //mysql_select_db("$database", $conn); // $so =$DBcon->prepare("select * from marks where (stclass = :kls and acad_session = :yr) and (stregno = :reg and term =:tm) ") ; $so->bindparam(':kls' , $cls) ; $so->bindparam(':yr' , $yrs) ; $so->bindparam(':reg' , $val) ; $so->bindparam(':tm' , $trm) ; $so->execute() ; //$res = mysql_query($so) or die('Error: ' . mysql_error()) ; while ($ro = $so->FETCH(PDO::FETCH_ASSOC)) { $fst = $ro['test'] ; $sc = $ro['midterm'] ; $exa = $ro['exam'] ; $tom = $fst + $exa + $sc ; $maya[] = $tom ; } $cal = array_sum($maya) ; //start $streamno = array(); $arresult = array() ; $myarray = array() ; //$finarray = array() ; $sqla = $DBcon->prepare("select distinct stregno from marks where (stclass =:kls and acad_session =:yr) and term = :tm" ) ; $sqla->bindparam(':kls',$cls) ; $sqla->bindparam(':yr',$yrs) ; $sqla->bindparam(':tm',$trm) ; $sqla->execute() ; //$exec = mysql_query($sqla) or die('Error: ' . mysql_error()); //$row = mysql_fetch_array($exec) ; while ($streamrow = $sqla->FETCH(PDO::FETCH_ASSOC)) { $streamno[] = $streamrow['stregno']; } foreach ($streamno as $va) { $sqlgo =$DBcon->prepare("select * from marks where ((stregno = :v and stclass = :kls) and (term =:tm and acad_session = :yr)) ") ; $sqlgo->bindparam(':v',$va) ; $sqlgo->bindparam(':kls',$cls) ; $sqlgo->bindparam(':tm',$trm) ; $sqlgo->bindparam(':yr',$yrs) ; $sqlgo->execute() ; //$go = mysql_query($sqlgo) or die('Error: ' . mysql_error()); //$gorow = mysql_fetch_array($go) ; $rownumber = $sqlgo->rowcount() ; while ($gorow = $sqlgo->FETCH(PDO::FETCH_ASSOC)) { $first = $gorow['test'] ; $sec = $gorow['midterm'] ; $ex = $gorow['exam'] ; $tota = $first + $ex + $sec ; $myarray[] = $tota ; //$myarray[] = $ar ; } $tosum = array_sum($myarray) ; if($rownumber < $min) $ar = $tosum/$min ; else $ar = $tosum/$rownumber; $arresult[] = $ar ; $myarray = array() ; } arsort($arresult) ; $ps = 0 ; foreach($arresult as $tot) { $ps++ ; $app = position($ps) ; if($av == $tot) { // echo $ps.$app ; $spm = $ps.$app ; break ; } } echo "".$spm." | " ; //end position // echo "".'NY'." | " ; if($av >= 40.00) $stu = 'Pass'; else $stu = 'Fail'; echo "".$stu." | " ; echo "".'non'." | " ; // echo"" ; echo "
| Generated By____________________________ | Sign_________________________________ |