var savedRecord = false;"; error_($results); }else{ echo ""; } }else if($_GET['action'] == 'delete'){ if(!delete_record($_POST['uid'])){ echo ""; error_("Unable to delete record"); }else{ echo ""; } }else{ $title = i18n("Manage Students"); send_header($title, array("School Home" => "schoolaccess.php")); draw_javascript(); draw_list(); send_footer(); } }else{ header('Location: schoolaccess.php'); } // create a new record with the given first name last name and e-mail address // return true on success, error message on failure function process_newRecord($firstName, $lastName, $email){ $firstName = trim($firstName); $lastName = trim($lastName); $email = trim($email); // make sure we are actually given a first and last name if(strlen($firstName) == 0 || strlen($lastName) == 0) return i18n("First and last names are required fields"); if($email != null){ $user = user_load_by_email($email); }else{ $user = false; } if($user != false){ // we're modifying an existing user }else{ // we're creating a new user if(strlen($email) == 0){ // let's create an e-mail address }else if(!isEmailAddress($email)){ // not a valid e-mail address return i18n("Invalid e-mail address"); }else{ // we'll use the e-mail address provided } } $uid = rand() % 100000; // <-- just testing - should be an actual user id echo "
=i18n("First Name");?> | =i18n("Last Name");?> | =i18n("Email Address");?> | ||
---|---|---|---|---|
=i18n("New:")?> |