Personal Profile
Personal Profile
View and Print Result
prepare("select * from students where regno =:reg") ; $sql->bindparam(":reg",$regno) ; $sql->execute() ; if($sql->rowcount() > 0) { $row = $sql->FETCH(PDO::FETCH_ASSOC) ; $fnames = $row['surname'] ; $mnames = $row['middlename'] ; $lnames = $row['lastname'] ; $names = $fnames.' '.$mnames.' '.$lnames ; $gender = $row['gender'] ; $imgs = $row['avatar'] ; } if(isset($_POST['first'])) { $msg = array() ; $pin = $_SESSION['pin'] ; $regno = $_SESSION['rgno'] ; $_SESSION["schsesion"] = trim($_POST['yr']); $_SESSION["term"] = 'FIRST TERM' ; $classid = $_SESSION["classid"] ; $lvs = $_SESSION["lvs"] ; //mysql_select_db("$database", $conn); $schyear = $_SESSION["schsesion"] ; $classid = $_SESSION["classid"] ; $term = $_SESSION["term"] ; //$level = substr($classid, 0, 7); //$level1 = substr($classid, 0, 2); //check pin validity $sql1 = $DBcon->prepare("select * from pinassociate where PINCODE =:p") ; $sql1->bindparam(':p', $pin) ; $sql1->execute() ; $rc = $sql1->rowcount() ; if($rc > 0) { $row1 = $sql1->FETCH(PDO::FETCH_ASSOC) ; $pin = $row1['PINCODE'] ; $owner = $row1['REGNO'] ; $numbused = $row1['NOUSED'] ; $tm = $row1['TERM'] ; $yr = $row1['acadsession'] ; //check reg no if($numbused >= 5) $msg[] = 'You have used this Pin above its Limit please buy another Card' ; if($term != $tm) $msg[] = 'You have used this Pin to Check another Term Result, Please Get another Card' ; if($yr != $schyear) $msg[] = 'You have used this Pin to Check another Session Result, Please Get another Card' ; }// end if access, i.e, if pin exist if(empty($msg)) { $sqlc = $DBcon->prepare(" select * from marks where (stregno =:rg and acad_session =:yr) and (term =:tm and stclass = :cs)") ; $sqlc->bindparam(':rg', $regno) ; $sqlc->bindparam(':yr', $schyear) ; $sqlc->bindparam(':tm', $term) ; $sqlc->bindparam(':cs', $classid) ; $sqlc->execute() ; $rcx = $sqlc->rowcount() ; //$resultc = mysql_query($sqlc) or die('Error: ' . mysql_error()); if($rcx > 0) { $rowc = $sqlc->FETCH(PDO::FETCH_ASSOC) ; $resultnoc = $rowc['stregno'] ; $_SESSION["getresultc"] = $resultnoc ; } else $msg[] = 'Sorry, Your Result is not Ready or Make Sure you entered correct Information' ; } if(empty($msg)) { if($lv == 'JS')header("location: resultsheet/basicsheet.php"); if($lv == 'SS') header("location: resultsheet/basicsheet.php"); //else header("location: resultsheet/basicsheet.php"); } } if(isset($_POST['second'])) { $msg = array() ; $pin = $_SESSION['pin'] ; $regno = $_SESSION['rgno'] ; $_SESSION["schsesion"] = trim($_POST['yr']); $_SESSION["term"] = 'SECOND TERM' ; $classid = $_SESSION["classid"] ; $lvs = $_SESSION["lvs"] ; //mysql_select_db("$database", $conn); $schyear = $_SESSION["schsesion"] ; $classid = $_SESSION["classid"] ; $term = $_SESSION["term"] ; //$level = substr($classid, 0, 7); //$level1 = substr($classid, 0, 2); //check pin validity $sql1 = $DBcon->prepare("select * from pinassociate where PINCODE =:p") ; $sql1->bindparam(':p', $pin) ; $sql1->execute() ; $rc = $sql1->rowcount() ; if($rc > 0) { $row1 = $sql1->FETCH(PDO::FETCH_ASSOC) ; $pin = $row1['PINCODE'] ; $owner = $row1['REGNO'] ; $numbused = $row1['NOUSED'] ; $tm = $row1['TERM'] ; $yr = $row1['acadsession'] ; //check reg no if($numbused >= 5) $msg[] = 'You have used this Pin above its Limit please buy another Card' ; if($term != $tm) $msg[] = 'You have used this Pin to Check another Term Result, Please Get another Card' ; if($yr != $schyear) $msg[] = 'You have used this Pin to Check another Session Result, Please Get another Card' ; }// end if access, i.e, if pin exist if(empty($msg)) { $sqlc = $DBcon->prepare(" select * from marks where (stregno =:rg and acad_session =:yr) and (term =:tm and stclass = :cs)") ; $sqlc->bindparam(':rg', $regno) ; $sqlc->bindparam(':yr', $schyear) ; $sqlc->bindparam(':tm', $term) ; $sqlc->bindparam(':cs', $classid) ; $sqlc->execute() ; $rcx = $sqlc->rowcount() ; //$resultc = mysql_query($sqlc) or die('Error: ' . mysql_error()); if($rcx > 0) { $rowc = $sqlc->FETCH(PDO::FETCH_ASSOC) ; $resultnoc = $rowc['stregno'] ; $_SESSION["getresultc"] = $resultnoc ; } else $msg[] = 'Sorry, Your Result is not Ready or Make Sure you entered correct Information' ; } if(empty($msg)) { if($lv == 'JS')header("location: resultsheet/basicsheet.php"); if($lv == 'SS') header("location: resultsheet/basicsheet.php"); //else header("location: resultsheet/basicsheet.php"); } } if(isset($_POST['third'])) { $msg = array() ; $pin = $_SESSION['pin'] ; $regno = $_SESSION['rgno'] ; $_SESSION["schsesion"] = trim($_POST['yr']); $_SESSION["term"] = 'THIRD TERM' ; $classid = $_SESSION["classid"] ; //mysql_select_db("$database", $conn); $schyear = $_SESSION["schsesion"] ; $classid = $_SESSION["classid"] ; $term = $_SESSION["term"] ; $lvs = $_SESSION["lvs"] ; //$level = substr($classid, 0, 7); //$level1 = substr($classid, 0, 2); //check pin validity $sql1 = $DBcon->prepare("select * from pinassociate where PINCODE =:p") ; $sql1->bindparam(':p', $pin) ; $sql1->execute() ; $rc = $sql1->rowcount() ; if($rc > 0) { $row1 = $sql1->FETCH(PDO::FETCH_ASSOC) ; $pin = $row1['PINCODE'] ; $owner = $row1['REGNO'] ; $numbused = $row1['NOUSED'] ; $tm = $row1['TERM'] ; $yr = $row1['acadsession'] ; //check reg no if($numbused >= 5) $msg[] = 'You have used this Pin above its Limit please buy another Card' ; //if($term != $tm) $msg[] = 'You have used this Pin to Check another Term Result, Please Get another Card' ; if($yr != $schyear) $msg[] = 'You have used this Pin to Check another Session Result, Please Get another Card' ; }// end if access, i.e, if pin exist if(empty($msg)) { $sqlc = $DBcon->prepare(" select * from marks where (stregno =:rg and acad_session =:yr) and (term =:tm and stclass = :cs)") ; $sqlc->bindparam(':rg', $regno) ; $sqlc->bindparam(':yr', $schyear) ; $sqlc->bindparam(':tm', $term) ; $sqlc->bindparam(':cs', $classid) ; $sqlc->execute() ; $rcx = $sqlc->rowcount() ; //$resultc = mysql_query($sqlc) or die('Error: ' . mysql_error()); if($rcx > 0) { $rowc = $sqlc->FETCH(PDO::FETCH_ASSOC) ; $resultnoc = $rowc['stregno'] ; $_SESSION["getresultc"] = $resultnoc ; } else $msg[] = 'Sorry, Your Result is not Ready or Make Sure you entered correct Information' ; } if(empty($msg)) { if($lv == 'JS')header("location: resultsheet/basicsheet.php"); if($lv == 'SS') header("location: resultsheet/basicsheet.php"); //else header("location: resultsheet/basicsheet.php"); } } // check annual if(isset($_POST['annual'])) { $msg = array() ; $pin = $_SESSION['pin'] ; $regno = $_SESSION['rgno'] ; $_SESSION["schsesion"] = trim($_POST['yr']); $_SESSION["term"] = 'ANNUAL TERM' ; $classid = $_SESSION["classid"] ; //mysql_select_db("$database", $conn); $schyear = $_SESSION["schsesion"] ; //$classid = $_SESSION["classid"] ; //$term = $_SESSION["term"] ; $lvs = $_SESSION["lvs"] ; $sqlc = $DBcon->prepare(" select * from marks where (stregno =:rg and acad_session =:yr) and (stclass = :cs and term = 'THIRD TERM' )") ; $sqlc->bindparam(':rg', $regno) ; $sqlc->bindparam(':yr', $schyear) ; //$sqlc->bindparam(':tm', $term) ; $sqlc->bindparam(':cs', $classid) ; $sqlc->execute() ; $rcx = $sqlc->rowcount() ; //$resultc = mysql_query($sqlc) or die('Error: ' . mysql_error()); if($rcx > 0) { $rowc = $sqlc->FETCH(PDO::FETCH_ASSOC) ; $resultnoc = $rowc['stregno'] ; $_SESSION["getresultcm"] = $resultnoc ; } else $msg[] = 'Sorry Your 3rd Term Result is not ready, you can view Cumulative Now, check back next week' ; //check pin $sql1 = $DBcon->prepare("select * from pinassociate where PINCODE =:p") ; $sql1->bindparam(':p', $pin) ; $sql1->execute() ; $rc = $sql1->rowcount() ; if($rc > 0) { $row1 = $sql1->FETCH(PDO::FETCH_ASSOC) ; $pin = $row1['PINCODE'] ; $owner = $row1['REGNO'] ; $numbused = $row1['NOUSED'] ; // $tm = $row1['TERM'] ; $yr = $row1['acadsession'] ; //check reg no if($numbused >= 5) $msg[] = 'You have used this Pin above its Limit please buy another Card' ; //if($term != $tm) $msg[] = 'You have used this Pin to Check another Term Result, Please Get another Card' ; if($yr != $schyear) $msg[] = 'You have used this Pin to Check another Session Result, Please Get another Card' ; }// end if access, i.e, if pin exist if(empty($msg)) { //if($lvs == 'PRIMARY') header("location: resultsheet/pcheader.php"); //else header("location: resultsheet/pjsheet.php"); } } ?>