Could not fetch the supervisorīs offered projects: " . mysql_error() . "

"); // fetching all offering projects in order to display // the status of the projects $sv_proj_offer_query2 = mysql_query("SELECT PROJ_ID,TITLE,STATUS FROM susx_course_projects WHERE person_code = ". $sv_query_row['PERSON_CODE'] . " AND status NOT LIKE 'ARCHIVED' AND status NOT LIKE 'SPROPOSE'") or die("

Could not fetch the supervisorīs offered projects: " . mysql_error() . "

"); // fetching all supervising students $sv_student_query = mysql_query("SELECT p.PROJ_ID, h.FORENAME, h.SURNAME, h.USERNAME FROM susx_course_projects p INNER JOIN student s ON s.registration_number = p.registration_number INNER JOIN hes_people h ON h.person_code = s.person_code WHERE p.person_code = ". $sv_query_row['PERSON_CODE'] ." AND p.status = 'CLOSED' ORDER BY h.SURNAME") or die("

Could not fetch the supervisorīs students: " . mysql_error() . "

"); $number_supervised_students = mysql_num_rows($sv_student_query); // fetching all proposing students $proposing_student_query = mysql_query("SELECT p.PROJ_ID, h.FORENAME, h.SURNAME, h.USERNAME FROM susx_course_projects p INNER JOIN student s ON s.registration_number = p.registration_number INNER JOIN hes_people h ON h.person_code = s.person_code WHERE p.person_code = ". $sv_query_row['PERSON_CODE'] ." AND p.status NOT LIKE 'ARCHIVED' AND p.status NOT LIKE 'CLOSED' ORDER BY h.SURNAME") or die("

Could not fetch the supervisorīs students: " . mysql_error() . "

"); $number_proposing_students = mysql_num_rows($proposing_student_query); // displaying the supervisor data in a table echo '
'; echo ""; // displaying the students who have requested the // supervisor (SPROPOSE or PROPOSE) echo'"; } else { if ($number_proposing_students == 1) { echo "One student request:"; } else { echo "$number_proposing_students student requests:"; } } echo "'; // closing the table echo'
' . $sv_fullname . ' (Load: ' . $sv_query_row['PROJ_LOAD']. ')
Supervisor\'s projects: '; //displaying all offering projects while ($offered_project = mysql_fetch_array($sv_proj_offer_query)) { echo "
  • " . $offered_project['TITLE'] . " (id:". $offered_project['PROJ_ID'] .")
  • "; } echo '
    '; // displaying whether the projects are on offer, taken or requested while ($offered_project2 = mysql_fetch_array($sv_proj_offer_query2)) { // offered project is already taken by a student if ($offered_project2['STATUS'] == 'CLOSED') { echo "*CLOSED*
    "; } else { if ($offered_project2['STATUS'] == 'PROPOSED' || $offered_project2['STATUS'] == 'SPROPOSE') { echo "*PROPOSED*
    "; } else { echo "*ON OFFER*
    "; } } } echo'
    '; // displaying the text announcing the current supervision arrangements if ($number_supervised_students == 0) { echo "No supervision arrangements"; } else { if ($number_supervised_students == 1) { echo "Supervising one student:"; } else { echo "Supervising $number_supervised_students students:"; } } echo ''; // displaying all students supervised while ($supervised_student = mysql_fetch_array($sv_student_query)) { $student_fullname = $supervised_student['FORENAME'] . ' ' . $supervised_student['SURNAME']; echo "[" . $student_fullname . "] "; if ($sv_query_row['PERSON_CODE']==$_SESSION['person_code']) { $super_mail_array[] = $supervised_student['USERNAME']; } } echo '"; if (!empty($super_mail_array)) { echo ""; $super_mail_array = 0; } echo "
    '; // no students on request if ($number_proposing_students == 0) { echo "No student requests"; // displaying all proposing students while($proposing_student = mysql_fetch_array($proposing_student_query)) { $pstudent_fullname = $proposing_student['FORENAME'] . ' ' . $proposing_student['SURNAME']; echo "[" . $pstudent_fullname . "] "; if ($sv_query_row['PERSON_CODE']==$_SESSION['person_code']) { $propose_mail_array[] = $proposing_student['USERNAME']; } } echo ""; if (!empty($propose_mail_array)) { echo ""; $propose_mail_array = 0; } echo '

    '; } } // the query did not run properly else { echo "

    The supervisors could not be displayed due to a database error:

    "; } // close the database connection disconnect(); // set the footer include ('templates/mle-ftr.inc'); ?>