echo "<label for='info'>"; echo "Advisor: ", $oldAdvisorName, "<br>"; // Display advisor office for individual advisor if (isset($oldAdvisorOffice)) { echo "Office: ", $oldAdvisorOffice, "<br>"; } 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
</head> <body> <div id="login"> <div id="form"> <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"; } ?>
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 { // 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>";
<?php session_start(); $debug = false; include '../CommonMethods.php'; include '../Student.php'; include '../Appointment.php'; $COMMON = new Common($debug); if ($_POST["cancel"] == 'Cancel') { // Get student info from database $studid = $_SESSION["studID"]; $student = new Student($COMMON, $studid); // Find student's appointment $appointments = Appointment::searchAppointments($COMMON, null, null, null, null, null, null, '', $studid); //remove stud from EnrolledID $appt = $appointments[0]; $apptID = $appt->getID(); $newIDs = str_replace($studid, "", $appt->getEnrolledID()); $sql = "update `Proj2Appointments` set `EnrolledNum` = EnrolledNum-1, `EnrolledID` = '{$newIDs}' where `id`='{$apptID}'"; $rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]); //update stud status to noApp $sql = "update `Proj2Students` set `Status` = 'N' where `StudentID` = '{$studid}'"; $rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]); $stat = 'ca'; } else { $stat = 'k'; } header("Location: 12StudExit.php?stat={$stat}");
<link rel='stylesheet' type='text/css' href='../css/standard.css'/> </head> <body> <div id="login"> <div id="form"> <div class="top"> <h1>Edit Group Appointment</h1> <h2>Select an appointment to change</h2> <div class="field"> <?php $debug = false; include '../CommonMethods.php'; include '../Appointment.php'; $COMMON = new Common($debug); // Get all group appointments from database $appointments = Appointment::searchAppointments($COMMON, 0, null, null, null, true, -1, ''); //first item in row if (count($appointments) > 0) { echo "<form action=\"AdminProcessEditGroup.php\" method=\"post\" name=\"Confirm\">"; echo "<table border='1px'>\n<tr>"; echo "<tr><td width='320px'>Time</td><td>Majors</td><td>Seats Enrolled</td><td>Total Seats</td></tr>\n"; // Display each appointment foreach ($appointments as $appt) { echo "<tr><td><label for='" . $appt->getID() . "'><input type=\"radio\" id='" . $appt->getID() . "' name=\"GroupApp\" \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 "<td>Available to all majors</td>"; } echo "<td>" . $appt->getEnrolledNum() . "</td><td>" . $appt->getMax();
$studID = $row[1]; echo "Student: ", $studID, " ", $studLN; } echo "<br>"; 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"; }