public function validate(Student $student) { $this->validateFirstName($student->getFirstName()); $this->validateLastName($student->getLastName()); $this->validateGroupNumber($student->getGroupNumber()); $this->validateEmail($student->getEmail()); $this->validateMark($student->getMark()); $this->validateBirthYear($student->getBirthYear()); $this->validateSexOpt($student->getSex()); $this->validateLocalityOpt($student->getLocality(true)); }
function displayIndividual($id, $date) { global $debug; global $COMMON; $sql = "SELECT `Time`, `Major`, `EnrolledID` FROM `Proj2Appointments` \n WHERE `Time` LIKE '{$date}%' AND `AdvisorID`='{$id}' AND `MAX`=1 ORDER BY `Time`"; $rs = $COMMON->executeQuery($sql, "Advising Appointments"); $matches = mysql_num_rows($rs); // see how many rows were collected by the query if ($debug) { echo "matches was {$matches}"; } if ($matches == 0) { return; } echo "<h3>Individual Appointments:</h3>"; echo "<table border='1'><th colspan='4'>Individual Appointments</th>\n"; echo "<tr><td width='60px'>Time:</td><td>Majors Included:</td><td>Student's name</td><td>Student ID</td></tr>\n"; while ($row = mysql_fetch_array($rs, MYSQL_NUM)) { echo "<tr>"; echo "<td>" . date('g:i A', strtotime($row[0])) . "</td>"; echo "<td>" . $row[1] . "</td>"; if (strlen($row[2]) > 0) { $stud = $row[2]; $student = new Student($COMMON, strtoupper($stud)); $firstName = $student->getFirstName(); $lastName = $student->getLastName(); echo "<td>" . $firstName . " " . $lastName . "</td>"; } else { echo "<td></td>"; } echo "<td>" . $row[2] . "</td>"; echo "</tr>"; } echo "</table><br><br>"; }
<div class="field"> <?php $debug = false; include '../CommonMethods.php'; include '../Appointment.php'; include '../Student.php'; 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>";
$student = new Student($COMMON, $_SESSION["studID"]); ?> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Student Advising Home</title> <link rel='stylesheet' type='text/css' href='../css/standard.css'/> </head> <body> <div id="login"> <div id="form"> <div class="top"> <h2>Hello <?php echo $student->getFirstName(); ?> </h2> <div class="selections"> <form action="StudProcessHome.php" method="post" name="Home"> <?php $adminCancel = false; $noApp = false; if ($student->getStatus() == 'C') { $adminCancel = true; } if ($student->getStatus() == 'N') { $noApp = true; } if ($adminCancel == true || $noApp == true) { if ($adminCancel == true) {
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>"; } echo "</tr>\n"; } echo "</table>"; echo "<div class=\"nextButton\">"; echo "<input type=\"submit\" name=\"next\" class=\"button large go\" value=\"Delete Appointment\">"; echo "</div>"; echo "</form>"; echo "<form method=\"link\" action=\"AdminUI.php\">"; echo "<input type=\"submit\" name=\"next\" class=\"button large\" value=\"Cancel\">"; echo "</form>"; } else { echo "<br><b>There are currently no individual appointments scheduled.</b>";