コード例 #1
0
 public function updateStudent()
 {
     // So now we need to get POST data.
     // The student might need its grade changed!
     $identity = array('id' => $_POST['identityID'], 'fName' => $_POST['firstName'], 'mName' => $_POST['middleName'], 'lName' => $_POST['lastName'], 'gender' => $_POST['gender']);
     // Returns if failed
     if (!Identity::updateIdentity($identity)) {
         $_SESSION['Error'] = "Unable to update Student Identity!";
     }
     $student = array('id' => $_POST['studentID'], 'gradeId' => $_POST['grade'], 'identityId' => $_POST['identityID'], 'schoolId' => $_POST['school']);
     if (!Student::updateStudent($student)) {
         $_SESSION['Error'] = "Unable to update Student!";
     }
     // TODO: If student moves schools, the student looses their classes!
     header("Location: " . $_POST['path']);
 }
コード例 #2
0
 public function updateContact()
 {
     $identity = array('id' => $_POST['identityId'], 'fName' => $_POST['firstName'], 'mName' => $_POST['middleName'], 'lName' => $_POST['lastName'], 'gender' => $_POST['gender'], 'email' => $_POST['email']);
     // Returns if failed
     if (!Identity::updateIdentity($identity)) {
         print "error";
         $_SESSION['Error'] = "Unable to update Contact Identity!";
     }
     header("Location: " . $_POST['path']);
 }