| Server IP : 172.64.80.1 / Your IP : 108.162.241.67 Web Server : Apache System : Linux mail.federalpolyede.edu.ng 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 User : federalpolyede.edu.ng_idh35skikv ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/federalpolyede.edu.ng/httpdocs/admin_student/ |
Upload File : |
<?php
//die("The Page will ba back very soon");
//echo "am here";
ob_start();
session_start();
$asession=$_SESSION['asession'];
$matNo=$_SESSION['matNo'];
$asemester=$_SESSION['asemester'];;
$dept= $_SESSION['course'];
require_once('../../connect.php');
$db=db_connect();
$hod="select signs,fullName from dept where dOption='$dept'";
$hodexe=$db->query($hod);
if($hodexe->rowCount()==1){
$hodfetch=$hodexe->fetch(PDO::FETCH_BOTH);
$hods=$hodfetch['signs'];
$hodSign='<img src="hodSign/'. $hods.'" alt="" width="85" height="45" />';
$hodName=$hodfetch['fullName'];
}
die("am hereee");
$levelID= $_SESSION['levelID'];
//die($levelID);
//===============================Checking for maximum Unit===============================
require_once('check_maxUnit.php');
//die("am hereee");
/*
$sqlCourse=$db->query("select sum(courseunit) as sumUnit from coursereg where matNo='$matNo' and semester='$asemester' and asession='$asession'");
$sumUnit_fetch=$sqlCourse->fetch(PDO::FETCH_BOTH);
$sumUnit=$sumUnit_fetch['sumUnit'];
//die($sumUnit);
$prefix=substr($matNo,0,2);
$sql=$db->query("select ndMaxUnit,hndMaxUnit from dept where nd='$prefix' or hnd='$prefix'");
$sql_fetch=$sql->fetch(PDO::FETCH_BOTH);
if ($sql_fetch['ndMaxUnit']>1) {
$maxUnit = $sql_fetch['ndMaxUnit'];
}else{
$maxUnit = $sql_fetch['hndMaxUnit'];
}
$session_split=explode('/',$asession);
$session_gena=$session_split[0]-1;
$session_genb=$session_split[1]-1;
$session_gen=$session_gena.'/'.$session_genb;
$sq=$db->query("select * from rawcgpa where matNo='$matNo' and remark like 'Prob%' and asession='$session_gen'")->rowCount();
if ($sq>0){
switch ($levelID) {
case 1:
$maxUnit=18;
break;
case 2:
$maxUnit=18;
break;
case 3:
$maxUnit=18;
break;
case 4:
$maxUnit=18;
break;
case 5:
$maxUnit=15;
break;
case 6:
$maxUnit=15;
break;
case 7:
$maxUnit=15;
break;
case 8:
$maxUnit=18;
break;
case 9:
$maxUnit=18;
break;
case 10:
$maxUnit=1;
break;
}
//echo $maxUnit;
// die();
}
*/
//die($maxCheck);
if ($maxUnit<$sumUnit){
// die("check");
// $maxUnit=ihkhh;
// $kkk=$maxUnit;
// $k="kdhwkhed";
//echo $maxUnit;
// echo $sumUnit;
$excessUnit=$sumUnit-$maxUnit;
// echo '<script> alert ('.$maxUnit.') </script>';
echo "<div align='center' style='color: red'><h2>You Have Registered More Than Approved Units (".$maxUnit."), Kindly Remove ".$excessUnit." Units Course(s)</h2></div>";
echo '<div align="center"><a href="../courseReg2.php">Click Here to Remove</a></div>';
die();
}
//$j="select * from rawcgpa where matNo='$matNo' and remark like 'Prob%' and asession='$session_gen'";
//===============================Checking for maximum Unit===============================
$mainBody='
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ePortal | Courses Registered</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>';
$mainBody.='
<table width="100%" align="center" cellpadding="3" cellspacing="5">
<tr>
<td >
<table align="center" cellpadding="1" cellspacing="1">
<tr>
<td valign="top">
<table width="100%" cellspacing="1" cellpadding="1">
<tr>
<td align="center" valign="top"><p><img src="../../images/siwesHead.png" width="731" height="95" alt="Federal Polytechnic Ede" /></p></td>
</tr>
<tr>
<td align="center" bgcolor="#999999"><h2>COURSE FORM</h2></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="7">
<table cellspacing="5" cellpadding="3" align="center" width="100%">
<tr>
<td colspan="1"><b>Matric Number</b></td>
<td > </td>
<td colspan="2">'.$matNo.'</td>
<td> </td>
<td rowspan="4" colspan="2" align="center"><img src="../../passport/Reg'. $matNo.'.jpg" alt="" width="115" height="125" /></td>
</tr>
<tr>
<td colspan="1" ><b>Name</b></td>
<td> </td>
<td colspan="2"><b>'.strtoupper($_SESSION['names']).'</b></td>
</tr>
<tr>
<td id="lab" colspan="1"><b>Session</b></td>
<td > </td>
<td colspan="1">'. $asession.'</td>
</tr><tr>
<td id="lab"><b>Semester</b></td>
<td > </td>
<td>'. $asemester.'</td>
</tr>
<tr>
<td id="lab"><b>Department</b></td>
<td> </td>
<td >'. $_SESSION['course'].'</td>
<td > </td>
<td id="lab"><b>Level</b></td>
<td> </td>
<td>';
$sqlLevel=$db->query("select * from leveltb where id='$levelID'");
$sqlLevel_fetch=$sqlLevel->fetch(PDO::FETCH_BOTH);
$numLevel=$sqlLevel->rowCount();
if ($numLevel>0){
$mainBody.= $sqlLevel_fetch['levelName'];
}else{
$mainBody.= "No Level Attached";
}
$mainBody.='</td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td colspan="6"></td>
</tr>
<tr>
<td ><strong>SN</strong></td>
<td ><strong>Course Code</strong></td>
<td colspan="3" ><strong>Course Title</strong></td>
<td ><strong>Course Unit</strong></td>
</tr>
';
//<td style="display: none"><strong>Adviser/<br>HOD Sign</strong></td>
$sqlCourse=$db->query("select * from coursereg where matNo='$matNo' and semester='$asemester' and asession='$asession'");
// $sqlCourse=$db->query("select * from coursereg where matNo='$matNo' and semester='First Semester' and asession='$asession'");
$numCourse=$sqlCourse->rowCount();
if ($numCourse>0){
$i=1;
$aTotal=0;
while ($row=$sqlCourse->fetch(PDO::FETCH_BOTH)){
$mainBody.='
<tr>
<td>'. $i.'</td>
<td>'. $row['courseCode'].'</td>
<td colspan="3">'. $row['courseTitle'].'</td>';
$a= $row['courseUnit'];
$aTotal+=$a;
$mainBody.='
<td>'. $a.'</td>
<td> </td>
</tr>';
++$i;
}
$mainBody.='
<tr>
<td colspan="4" align="right"><B>TOTAL UNIT REGISTERED</B></td>
<td colspan="1"><B>'. $aTotal.'</B></td>
<td> </td>
</tr>';
}else{
$mainBody.='
<tr>
<td colspan="6">
No Course Registered Yet!
</td>
</tr>
';
}
$mainBody.=' <tr><td colspan="6">
<table cellspacing="5" cellpadding="3" >
<tr>
<td> Students\'
Signature: <img src="../../signature/Reg'. $matNo.'.jpg" width="140px" height="80px" />
<td>Date: '. date('d M, o').'</td>
</tr>
</table>
</td>
</tr>
</table><table>
<tr>
<td bgcolor="#FFFFFF" id="headingg2" colspan="5">
<tr>
<td bgcolor="#666666" id="headingg" colspan="5" width="90%">FOR OFFICIAL USE ONLY
<tr>
<td colspan="5"><table width="100%" cellspacing="5" cellpadding="3">
<tr>
<td colspan="2"><strong>Head of Department Signature : '.$hodSign.' </strong></td>
</tr>
<tr>
<td colspan="5"><strong>Head of Department Name :</strong> '.$hodName.'</td>
<td> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>';
if ($matNo=='MK202S20102641'){
echo $mainBody;
die();
}
echo $mainBody;
die();
$filename='courseForm-'.$matNo.'.pdf';
include("../../mpdf/mpdf.php");
//$mpdf=new mPDF('c');
$mpdf=new mPDF('','', 0, '', 10, 10, 10, 10, 9, 9, 'P');
$mpdf->SetWatermarkImage('../../images/logoBack.png');
$mpdf->showWatermarkImage = true;
$dat=date('l, M d, o, h:i:s a');
$customizedFooter='<img src="../../images/siwesfooter.png"><br><div align="right">'. $dat.'</div>';
$mpdf->WriteHTML($mainBody);
$mpdf->setFooter($customizedFooter) ;
$mpdf->Output($filename,'D');
exit;
ob_end_flush();
//?>