Exemplo n.º 1
0
 function setIndianPhoneNumber($phoneNumber)
 {
     if (isPhoneNumber($phoneNumber . '0')) {
         $this->indianPhoneNumber = $phoneNumber;
     } else {
         echo "Please provide valid Phone Number", "<br>";
     }
 }
Exemplo n.º 2
0
 function setIndianPhoneNumber($phoneNumber)
 {
     if (isPhoneNumber($phoneNumber . '0')) {
         $this->IndianphoneNumbe = $phoneNumber;
     } else {
         echo "Please provide a valid phone number";
     }
 }
Exemplo n.º 3
0
 public function actionSignup()
 {
     if (isset($_POST['register'])) {
         if (trim($_POST['compName']) == "") {
             $_SESSION['compName'] = $_POST['compName'];
             $_SESSION['error'] = "Please provide your company or individual name";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (trim($_POST['password']) == "") {
             $_SESSION['error'] = "Password field cannot be blank!";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if ($_POST['location'] == "") {
             $_SESSION['error'] = "Specify your location";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (trim($_POST['email']) == "" || filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) == false) {
             $_SESSION['email'] = $_POST['email'];
             $_SESSION['error'] = "The email you provided was invalid";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (!ctype_alnum($_POST['location'])) {
             $_SESSION['error'] = "Location is NOT sensible!";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (User::checker($_POST['email']) != 0) {
             $_SESSION['error'] = "Sorry, a user already exists with the email you provided. Forgot your password? <a href='#'>Get a new one</a>";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (trim($_POST['tel']) != "") {
             if (!isPhoneNumber($_POST['tel'])) {
                 $_SESSION['tel'] = $_POST['tel'];
                 $_SESSION['error'] = "Invalid phone number";
                 header("location: {$_SERVER['HTTP_REFERER']}");
                 exit;
             }
         }
         $x = new Employer($_POST);
         $x->utype = $this->user_type;
         if (!$x->create()) {
             //Log the next line and simply show an error message
             $_SESSION['error'] = "Oops! Something went wrong!";
         } else {
             UserController::redirectToLogin("Account has been created. Please login to continue");
             exit;
         }
     }
     $type = $this->user_type;
     //passed to the view for toggling
     include __VIEWPATH__ . "employer/signup.php";
 }
Exemplo n.º 4
0
 if (!isValidName($_POST['fname']) || trim($_POST['lname']) == "") {
     $_SESSION['error'] = "New first name is invalid";
     header("location: " . $_SERVER['REQUEST_URI']);
     exit;
 }
 if (!isValidName($_POST['lname']) || trim($_POST['lname']) == "") {
     $_SESSION['error'] = "New last name is invalid";
     header("location: " . $_SERVER['REQUEST_URI']);
     exit;
 }
 if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
     $_SESSION['error'] = "New e-mail is invalid";
     header("location: " . $_SERVER['REQUEST_URI']);
     exit;
 }
 if (!isPhoneNumber($_POST['tel'])) {
     $_SESSION['error'] = "New phone number is invalid";
     header("location: " . $_SERVER['REQUEST_URI']);
     exit;
 }
 if ($_POST['email'] != $me->email && User::checker($_POST['email'] !== 0)) {
     $_SESSION['error'] = "The email you entered is already registered";
     header("location: " . $_SERVER['REQUEST_URI']);
     exit;
 }
 if (strlen($_POST['overview']) > 1000) {
     $_SESSION['error'] = "Overview cannot be more than 1000 words";
     header("location: " . $_SERVER['REQUEST_URI']);
     exit;
 }
 if ($_FILES['photo']['name'] !== "") {
Exemplo n.º 5
0
 public function actionSignup()
 {
     if (isset($_POST['register'])) {
         if (isValidName($_POST['fname']) != "ok") {
             $_SESSION['err_code'] = 5;
             $_SESSION['fname'] = $_POST['fname'];
             $_SESSION['error'] = isValidName($_POST['fname']);
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (isValidName($_POST['lname']) != "ok") {
             $_SESSION['err_code'] = 6;
             $_SESSION['lname'] = $_POST['lname'];
             $_SESSION['error'] = isValidName($_POST['lname']);
             //header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (trim($_POST['email']) == "" || filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) == false) {
             $_SESSION['err_code'] = 7;
             $_SESSION['email'] = $_POST['email'];
             $_SESSION['error'] = "Invalid email provided";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (User::checker($_POST['email']) != 0) {
             $_SESSION['error'] = "Sorry, a user already exists with the email you provided. Forgot your password? <a href='#'>Get a new one</a>";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (trim($_POST['password']) == "") {
             $_SESSION['error'] = "Password field cannot be blank!";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if ($_POST['location'] == "") {
             $_SESSION['error'] = "Specify your location";
             header("location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
         if (isset($_POST['tel'])) {
             if (trim($_POST['tel']) != "" && isPhoneNumber($_POST['tel'] != true)) {
                 $_SESSION['err_code'] = 8;
                 $_SESSION['tel'] = $_POST['tel'];
                 $_SESSION['error'] = isPhoneNumber($_POST['tel']);
                 header("location: {$_SERVER['HTTP_REFERER']}");
                 exit;
             }
         }
         $x = new Student($_POST);
         $x->utype = $this->user_type;
         if ($x->create() !== true) {
             $_SESSION['error'] = "Ooops! Something went wrong! Please try later";
         } else {
             UserController::redirectToLogin("Account has been created. Please signin to continue");
         }
         header("location: {$_SERVER['HTTP_REFERER']}");
         exit;
     }
     $type = $this->user_type;
     //passed to the view for toggling
     include __VIEWPATH__ . "student/signup.php";
 }