Beispiel #1
0
         $Email_Exist = $Email_Exist ? "We already have this email in pending request" : "";
     }
     // Checking if Student ID Registered:
     $StudentID = strtoupper($StudentID);
     $StudentID_Exist = isStudentIDExist($StudentID, 'userids', $r_error);
     // Checking if Student ID Exist in the Request Queue:
     if (!$StudentID_Exist) {
         $StudentID_Exist = isStudentIDExist($StudentID, 'userids_temp', $r_error);
         $StudentID_Exist = $StudentID_Exist ? "We already have this ID in pending request" : "";
     }
     // Checking if File Size Exceded Limit:
     $ImageSize_err = validate_image_size($_FILES["Image"]["size"], $r_error);
     // Checking if the File is Invalid:
     $ImageType_err = validate_image_type($_FILES["Image"]["type"], $r_error);
     // Checking if the Student is from Dept. of CSE:
     $NonDept_err = validateStudentID($StudentID, $r_error);
 }
 if (!$r_missing && !$r_error) {
     // Creating the Values:
     $db = new Database();
     $sql = "SELECT MAX(UID) FROM userids_temp";
     $result = $db->query($sql);
     $row = $db->fetch($result);
     $num = intval($row['MAX(UID)']);
     // Inserting Values into Temporary UserIDs Table:
     $extension = end(explode(".", $_FILES["Image"]["name"]));
     $newFileName = "members/" . ++$num . "_temp." . $extension;
     move_uploaded_file($_FILES["Image"]["tmp_name"], $newFileName);
     $DateOfBirth = $_POST['YOB'] . "/" . $_POST['MOB'] . "/" . $_POST['DOB'];
     $data = array();
     $data['StudentID'] = $StudentID;
Beispiel #2
0
 foreach ($_POST as $key => $value) {
     $value = pure_it($value);
     empty($value) ? $p_missing = "Please fill out all the fields!" : (${$key} = $value);
 }
 if (!$p_missing) {
     // Email Validation:
     $p_Invalid_Mail1 = validate_email($eMail1, $p_error);
     $p_Invalid_Mail2 = validate_email($eMail2, $p_error);
     $p_Invalid_Mail3 = validate_email($eMail3, $p_error);
     // Checking if Team Name Exist:
     $p_TeamName_err = "This Team Name is already registered!";
     $p_TeamName = isExist('TeamName', 'programmingcontest', $TeamName, $p_error);
     // Checking if the Student is from Dept. of CSE:
     $p_NonDept_err1 = validateStudentID($ID1, $p_error);
     $p_NonDept_err2 = validateStudentID($ID2, $p_error);
     $p_NonDept_err3 = validateStudentID($ID3, $p_error);
     // Checking if Student ID Exist:
     $p_StudentID_err = "This Student ID is already registered!";
     $SExist1 = isExist('ID1', 'programmingcontest', $ID1, $p_error);
     $SExist2 = isExist('ID2', 'programmingcontest', $ID1, $p_error);
     $SExist3 = isExist('ID3', 'programmingcontest', $ID1, $p_error);
     $p_StudentID_Exist1 = $SExist1 || $SExist2 || $SExist3;
     $SExist1 = isExist('ID1', 'programmingcontest', $ID2, $p_error);
     $SExist2 = isExist('ID2', 'programmingcontest', $ID2, $p_error);
     $SExist3 = isExist('ID3', 'programmingcontest', $ID2, $p_error);
     $p_StudentID_Exist2 = $SExist1 || $SExist2 || $SExist3;
     $SExist1 = isExist('ID1', 'programmingcontest', $ID3, $p_error);
     $SExist2 = isExist('ID2', 'programmingcontest', $ID3, $p_error);
     $SExist3 = isExist('ID3', 'programmingcontest', $ID3, $p_error);
     $p_StudentID_Exist3 = $SExist1 || $SExist2 || $SExist3;
     // Checking if Email Exist: