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'] ; } /* $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___________SUBJECT : __ 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) ; */ $gts = $DBcon->prepare("select * from subjects where subjectname = '$tsubj' ") ; $gts->execute() ; $srow = $gts->fetch(pdo::FETCH_ASSOC) ; $sbno = $srow['subject_id'] ; echo "" ; echo "" ; echo"" ; echo"" ; //for($x = 0; $x < $subglenght; $x++) // { $real = substr($tsubj,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',$sbno) ; $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'] ; $total = $test + $ex + $md ; $totalscore[] = $total ; } else $total = '-'; echo"" ; //} //work average //POSITION //begin subject position $subj = $sbno ; $subjp = array() ; $pst = $DBcon->prepare("select subject_id, test, midterm, exam from marks where (term = '$trm' and acad_session = '$yrs') and (stclass = '$cls' and subject_id = $subj)") ; $pst->execute() ; while($rw = $pst->fetch(pdo::FETCH_ASSOC)) { $tc = $rw['test'] ; $md = $rw['midterm'] ; $te = $rw['exam'] ; $tt = $tc + $md + $te ; $subjp[] = $tt ; } arsort($subjp) ; $psm = 0 ; foreach($subjp as $totm) { $psm++ ; $appm = position($psm) ; if($total == $totm) { $spm = $psm.$appm ; //echo $ps.$app ; break ; } } $tts = array_sum($totalscore) ; $numrow = count($totalscore) ; if($tts > 0) $av = $tts / $numrow ; // else //$av = '-' ; echo"" ; // echo "" ; // 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 . "". 'POSITION' ."". 'AVG' ."". 'POS' ."". 'STATUS' ."
".$name."".$val."".$total."". $spm ."".round($av,2)."".'NY'."".$stu."
".'non'."
" ; ?>
   
   
   
Generated By____________________________ Sign_________________________________