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_______________
 
prepare("select distinct subject_id from marks where (acad_session = :yr and stclass = :kls) and term =:tm " ); $skl->bindparam(':yr' , $yrs) ; $skl->bindparam(':kls' , $cls) ; $skl->bindparam(':tm' , $trm) ; $skl->execute() ; while($rowsubj = $skl->FETCH(PDO::FETCH_ASSOC)) { $subjarray[] = $rowsubj['subject_id'] ; } $arrlength = count($subjarray); $subg = array() ; for($x = 0; $x < $arrlength; $x++) { $subj = $subjarray[$x] ; //get the subject corressponding to subjarray elements $subjarray[$x] $subjskl = $DBcon->prepare("select subjectname from subjects where subject_id = :id ") ; $subjskl->bindparam(':id' , $subj) ; $subjskl->execute() ; $rowpsubj = $subjskl->FETCH(PDO::FETCH_ASSOC) ; $realsubject = $rowpsubj['subjectname'] ; $subg[] = $realsubject ; } $subglenght = count($subg) ; echo "" ; echo "" ; echo"" ; echo"" ; for($x = 0; $x < $subglenght; $x++) { $real = substr($subg[$x],0,5) ; echo "" ; } echo"" ; echo"" ; echo"" ; echo"" ; echo "" ; //get the student regno in the specified class and term from the mark table $st = $DBcon->prepare("select distinct stregno from marks where (term = :tm and stclass = :kls) and acad_session =:yr") ; $st->bindparam(':tm',$trm) ; $st->bindparam(':kls',$cls) ; $st->bindparam(':yr',$yrs) ; $st->execute() ; if($st->rowcount() > 0) { while($rowreg = $st->FETCH(PDO::FETCH_ASSOC)) { $regnoarray[] = $rowreg['stregno'] ; } } // using the regno extracted get the student name, and subjects scores $subglenght = count($subg) ; $arrayrealname = array() ; $reglenght = count($regnoarray) ; for($x = 0; $x < $reglenght; $x++) { $totalscore = array() ; $val = $regnoarray[$x] ; $stname = $DBcon->prepare("select * from students where regno = :reg") ; $stname->bindparam(':reg',$val) ; $stname->execute() ; if($stname->rowcount() > 0) { $rws = $stname->FETCH(PDO::FETCH_ASSOC) ; $name = $rws['studentname'] ; $arrayrealname[] = $rws['studentname'] ; } else $name = '-' ; echo "" ; echo "" ; echo "" ; 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"" ; } //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"" ; echo "" ; //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 "" ; //end position // echo "" ; if($av >= 40.00) $stu = 'Pass'; else $stu = 'Fail'; echo "" ; echo ""; } $rlenght = count($arrayrealname) ; for($x = 0; $x < $rlenght; $x++) { } //echo"" ; // echo"" ; echo "
". 'NAME' ."". 'REGNO' ."" . $real . "". 'TOTAL' ."". 'AVG' ."". 'POS' ."". 'STATUS' ."
".$name."".$val."".$tt."". $tts ."".round($av,2)."".$spm."".'NY'."".$stu."
".'non'."
" ; ?>
   
   
   
Generated By____________________________ Sign_________________________________