} $found = "<tr><td>" . date('l, F d, Y g:i A', strtotime($row[1])) . "</td>" . "<td>" . $advName . "</td>" . "<td>" . $row[3] . "</td></tr>" . array_push($results, $found); } } } } else { foreach ($times as $t) { $sql = "select * from Proj2Appointments where `Time` like '%{$date}%' and `Time` > '" . date('Y-m-d H:i:s') . "' and `Time` like '%{$t}%' and `AdvisorID` like '%{$advisor}%' and `EnrolledNum` = 0 and `Major` like '%" . getMajor() . "%' order by `Time` ASC Limit 30"; $rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]); $row = mysql_fetch_row($rs); if ($row) { while ($row = mysql_fetch_row($rs)) { if ($row[2] == 0) { $advName = "Group"; } else { $advName = getAdvisorName($row); } $found = "<tr><td>" . date('l, F d, Y g:i A', strtotime($row[1])) . "</td>" . "<td>" . $advName . "</td>" . "<td>" . $row[3] . "</td></tr>" . array_push($results, $found); } } } } } if (empty($results)) { echo "No results found.<br><br>"; } else { echo "<table border='1'><th colspan='3'>Appointments Available</th>\n"; echo "<tr><td width='60px'>Time:</td><td>Advisor</td><td>Major</td></tr>\n"; foreach ($results as $r) { echo $r . "\n"; }
$debug = false; include '../CommonMethods.php'; include '../Appointment.php'; include '../Advisor.php'; include '../Student.php'; $COMMON = new Common($debug); // Get all individual appointments $appointments = Appointment::searchAppointments($COMMON, 'I', null, null, null, true, -1, ''); // Check if there are appointments if (count($appointments) > 0) { echo "<form action=\"AdminConfirmEditInd.php\" method=\"post\" name=\"Confirm\">"; echo "<table border='1px'>\n<tr>"; echo "<tr><td width='320px'>Time</td><td>Majors</td><td>Enrolled</td></tr>\n"; // Display all items foreach ($appointments as $appt) { $advisorname = getAdvisorName($appt->getAdvisorID()); if ($appt->getEnrolledID()) { $student = new Student($COMMON, trim($appt->getEnrolledID())); } echo "<tr><td><label for='" . $appt->getID() . "'><input type=\"radio\" id='" . $appt->getID() . "' name=\"IndApp\" \n required value=\"" . $appt->getID() . "\">"; echo date('l, F d, Y g:i A', strtotime($appt->getTime())) . "</label></td>"; if ($appt->getMajor()) { echo "<td>" . $appt->convertMajor() . "</td>"; } else { echo "Available to all majors"; } if ($appt->getEnrolledId()) { echo "<td>" . $student->getFirstName() . " " . $student->getLastName() . "</td>"; } else { echo "<td>Empty</td>"; }
} elseif ($advisor == 'I') { echo "Advisor: All individual appointments"; } elseif ($advisor == '0') { echo "Advisor: All group appointments"; } else { // Display individual advisor's name echo "Advisor: ", getAdvisorName($advisor); } ?> <br><br><label> <?php // Get search resulsts for student $appts = Appointment::searchAppointments($COMMON, $advisor, $major, $date, $times); // Add results to array foreach ($appts as $appointment) { $found = "<tr><td>" . date('l, F d, Y g:i A', strtotime($appointment->getTime())) . "</td>" . "<td>" . getAdvisorName($appointment->getAdvisorID()) . "</td>" . "<td>" . $appointment->convertMajor() . "</td></tr>"; array_push($results, $found); } // Display results on screen if (empty($results)) { echo "No results found.<br><br>"; } else { echo "<table border='1'><th colspan='3'>Appointments Available</th>\n"; echo "<tr><td width='60px'>Time:</td><td>Advisor</td><td>Major</td></tr>\n"; foreach ($results as $r) { echo $r . "\n"; } echo "</table>"; } ?> </label>
if ($filter == '') { echo "Filter: All appointments"; } elseif ($filter == 0) { echo "Filter: Open appointments"; } elseif ($filter == 1) { echo "Filter: Closed appointments"; } ?> <br><br><label> <?php // Search for appointments $appts = Appointment::searchAppointments($COMMON, $advisor, null, $date, $times, false, null, $filter, $studID); // Format results for display foreach ($appts as $appointment) { // Get advisor's name $advName = getAdvisorName($appointment->getAdvisorID()); $found = "Time: " . date('l, F d, Y g:i A', strtotime($appointment->getTime())) . "<br>Advisor: " . $advName . "<br>Major: " . $appointment->convertMajor() . "<br>Enrolled Students: " . $appointment->getEnrolledID() . "<br>Number of enrolled student(s): " . $appointment->getEnrolledNum() . "<br>Maximum number of students allowed: " . $appointment->getMax() . "<br><br>"; array_push($results, $found); } /*if(empty($times)){ if($advisor == 'I'){ if($filter == 1){ $sql = "select * from Proj2Appointments where `Time` like '%$date%' and `AdvisorID` != 0 and `EnrolledID` like '%$studID%' and `EnrolledNum` >= 1 order by `Time` ASC"; } else{ $sql = "select * from Proj2Appointments where `Time` like '%$date%' and `AdvisorID` != 0 and `EnrolledID` like '%$studID%' and