echo "Appointment: ", date('l, F d, Y g:i A', $oldDatephp), "<br>"; // Display meeting location echo "Meeting Location: ", $appt->getMeeting(), "</label><br>"; // Hidden input for old appointment ID echo "<input type='hidden' name='oldAppID' value='{$oldApptID}'>"; } $currentAdvisorID = $_POST["advisor"]; $currentDatephp = strtotime($_POST["appTime"]); // Get appointment information for current appointment, even if it's taken $appointments = Appointment::searchAppointments($COMMON, $currentAdvisorID, $student->getMajor(), $_POST["appTime"], null, false, 1, ''); $currentAppt = $appointments[0]; $currentApptID = $currentAppt->getID(); if ($currentAdvisorID != 0) { // Individual advisor, so get info from database $currentAdvisor = new Advisor($COMMON, $currentAdvisorID); $currentAdvisorName = $currentAdvisor->convertFullName(); $currentAdvisorOffice = $currentAdvisor->getOffice(); } else { // Group advising appointment $currentAdvisorName = "Group"; } echo "<h2>Current Appointment</h2>"; echo "<label for='newinfo'>"; echo "Advisor: ", $currentAdvisorName, "<br>"; // Display office for individual advisor if (isset($currentAdvisorOffice)) { echo "Office: ", $currentAdvisorOffice, "<br>"; } echo "Appointment: ", date('l, F d, Y g:i A', $currentDatephp), "<br>"; echo "Meeting Location: ", $currentAppt->getMeeting(), "</label>"; // Hidden input for appointment id
<div class="top"> <h1>Select Appointment Time</h1> <div class="field"> <form action = "10StudConfirmSch.php" method = "post" name = "SelectTime"> <?php // Hidden form field for advisor ID echo "<input type='hidden' name='advisor' value='{$localAdvisor}'>"; // http://php.net/manual/en/function.time.php fpr SQL statements below // Comparing timestamps, could not remember. $curtime = time(); // Search for open appointments with given advisor, student's major, and that are in the future $appointments = Appointment::searchAppointments($COMMON, $localAdvisor, $student->getMajor()); // Display title if ($localAdvisor != 0) { echo "<h2>Individual Advising</h2><br>"; echo "<label for='prompt'>Select appointment with ", $advisor->convertFullName(), ":</label><br>"; } else { echo "<h2>Group Advising</h2><br>"; echo "<label for='prompt'>Select appointment:</label><br>"; } // Display all appointment options on screen foreach ($appointments as $appt) { $datephp = strtotime($appt->getTime()); echo "<label for='", $appt->getID(), "'>"; echo "<input id='", $appt->getID(), "' type='radio' name='appTime' required value='", $appt->getTime(), "'>", date('l, F d, Y g:i A', $datephp), "</label><br>\n"; } ?> </div> <?php // Do not allow continuing if there are no appointments for this advisor if (count($appointments) > 0) {
<div class="field"> <?php // Search for appointment with this student $appointments = Appointment::searchAppointments($COMMON, null, null, null, null, null, null, '', $studID); // if for some reason there really isn't a match, (something got messed up, tell them there really isn't one there) $num_rows = count($appointments); if ($num_rows > 0) { $appt = $appointments[0]; // get legit data $advisorID = $appt->getAdvisorID(); $datephp = strtotime($appt->getTime()); if ($advisorID != 0) { // Individual advisor - Get advisor info from database $advisor = new Advisor($COMMON, $advisorID); $advisorOffice = $advisor->getOffice(); $advisorName = $advisor->convertFullName(); } else { // Group advisor $advisorName = "Group"; } echo "<label for='info'>"; echo "Advisor: ", $advisorName, "<br>"; // If individual advisor, display office location if (isset($advisorOffice)) { echo "Office: ", $advisorOffice, "<br>"; } echo "Appointment: ", date('l, F d, Y g:i A', $datephp), "<br>"; // Display appointment location echo "Meeting Location: ", $appt->getMeeting(), "</label>"; } else { echo "No appointment was detected. It may have been cancelled. Please make another appointment.";
include '../Advisor.php'; $COMMON = new Common($debug); $indID = $_POST["IndApp"]; // Get appointment info from the database $appt = new Appointment($COMMON, $indID); $adv = $appt->getAdvisorID(); $advisor = new Advisor($COMMON, $adv); if ($appt->getEnrolledID()) { $student = new Student($COMMON, trim($appt->getEnrolledID())); $std = $student->getFirstName() . " " . $student->getLastName(); $eml = $student->getEmail(); } $sql = "DELETE FROM `Proj2Appointments` WHERE `id`='{$indID}'"; $rs = $COMMON->executeQuery($sql, "Advising Appointments"); echo "Time: " . date('l, F d, Y g:i A', strtotime($appt->getTime())) . "<br>"; echo "Advisor: " . $advisor->convertFullName() . "<br>"; echo "Majors included: "; if ($appt->getMajor()) { echo $appt->convertMajor() . "<br>"; } else { echo "Available to all majors<br>"; } echo "Enrolled: "; if ($appt->getEnrolledID()) { echo "{$std}</b>"; $sql = "UPDATE `Proj2Students` SET `Status`='C' WHERE `StudentID` = '" . trim($appt->getEnrolledID()) . "'"; $rs = $COMMON->executeQuery($sql, "Advising Appointments"); $message = "The following appointment has been deleted by the adminstration of your advisor: " . "\r\n" . "Time: " . $appt->getTime() . "\r\n" . "Advisor: " . $advisor->convertFullName() . "\r\n" . "Student: {$std}" . "\r\n" . "To schedule for a new appointment, please log back into the UMBC COEIT Engineering and Computer Science Advising webpage." . "\r\n" . "http://coeadvising.umbc.edu -> COEIT Advising Scheduling \r\n Reminder, this is only accessible on campus."; mail($eml, "Your Advising Appointment Has Been Deleted", $message); } else { echo "Empty";
echo "Time: "; foreach ($times as $t) { echo ++$i, ") ", date('g:i A', strtotime($t)), " "; } } echo "<br>"; if ($advisor == '') { echo "Advisor: All appointments"; } elseif ($advisor == 'I') { echo "Advisor: All individual appointments"; } elseif ($advisor == '0') { echo "Advisor: All group appointments"; } else { // Get advisor info from database $advisor = new Advisor($COMMON, $advisor); echo "Advisor: ", $advisor->convertFullName(); } echo "<br>"; if ($studID == '' && $studLN == '') { echo "Student: All"; } else { $studLN = strtoupper($studLN); $studID = strtoupper($studID); $sql = "select `LastName`, `StudentID` from Proj2Students where `StudentID` = '{$studID}' or `LastName` = '{$studLN}'"; $rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]); $row = mysql_fetch_row($rs); $studLN = $row[0]; $studID = $row[1]; echo "Student: ", $studID, " ", $studLN; } echo "<br>";