Student Subject Assessment will enable a student to check his failed subjects on the previous semester and see the result on the next page. The next page will provide him the next semester's set of subjects and will tell him if there were subjects he need to comply first on the first semester. The output will be (Allowed/Not Allowed).
This is the page where the previous semester's subjects appear and where the student check his failed subjects:
Code: Select all
echo "<form name='AssessMe' method='post' action='result.php'>";
$retrieveFirstSem = "SELECT * FROM curr_subjs WHERE subj_sem = '1' AND subj_curr = '".$_SESSION['selectedCurr']."' AND subj_level = '1' AND subj_desc != ''";
$returnFS = mysql_query($retrieveFirstSem) or die(mysql_error());
while($fs = mysql_fetch_array($returnFS)){
echo "<tr>";
echo " <td width=\"2%\" style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> <input type='checkbox' name='checkBox[]' value='$fs[id]'> </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $fs[subj_code] </td>";
echo " <td width='30%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $fs[subj_desc] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $fs[lec_hrs] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $fs[lab_hrs] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $fs[subj_units] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $fs[subj_preq] </td>";
echo "</tr>";
}
echo "<br><br><input type='submit' value='Assess Me' class=\"assessbutt\">";
echo "<input type='hidden' name='isAssessing' value='yes'>";
echo "</form>";
Code: Select all
$retrieveSecondSem = "SELECT * FROM curr_subjs WHERE subj_sem = '2' AND subj_curr = '".$_SESSION['selectedCurr']."' AND subj_level = '1' AND subj_desc != ''";
$returnSS = mysql_query($retrieveSecondSem) or die(mysql_error());
while($Ss = mysql_fetch_array($returnSS)){
echo "<tr>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $Ss[subj_code] </td>";
echo " <td width='30%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $Ss[subj_desc] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $Ss[lec_hrs] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $Ss[lab_hrs] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> $Ss[subj_units] </td>";
echo " <td width='8%' style=\"background:#ffffff; color:#333333; padding-left: 5px;\"> [color=#800000]$assessStatus[/color] </td>";
echo "</tr>";
}Code: Select all
if ($_POST['checkBox']) {
include_once '../../admin_/conn.php';
$chckbx = $_POST['checkBox'];
$assessStatus = "Allowed";
foreach ($chckbx as $c){
//echo $c."<br />";
//find the subjs
$FindSubj = "SELECT * FROM curr_subjs WHERE id = '$c'";
$FindSubjNow = mysql_query($FindSubj) or die(mysql_error());
$FindSubjHandler = mysql_fetch_array($FindSubjNow);
//and get the parallel
$getParallel = "SELECT subj_code FROM curr_subjs WHERE subj_preq = '".$FindSubjHandler['subj_code']."' AND subj_sem = '2' AND subj_level = '1'";
$getParallelNow = mysql_query($getParallel) or die(mysql_error());
$ParallelHandler = mysql_fetch_array($getParallelNow);
if ($ParallelHandler>0) {
// if the checked failed subject is parallel to 2nd semester, return
$assessStatus = "Not Allowed";
}
}
}
why is this so?? anyone please???