Example #1
0
 public function postRegister()
 {
     $validationRules = array('email' => 'required|email|unique:users', 'password' => 'required|min:8|confirmed', 'type' => 'required');
     $formValidator = Validator::make(Input::all(), $validationRules);
     if ($formValidator->passes()) {
         // creatting new user
         $createUser = new User();
         $createUser->email = Input::get('email');
         $createUser->type = Input::get('type');
         $createUser->password = Hash::make(Input::get('password'));
         $createUser->status = 'OFF';
         $createUser->save();
         // checking to create if user is patient or physician
         if ($createUser->type == 'PHYSICIAN') {
             $createPhysisician = new Physician();
             $createPhysisician->user_id = $createUser->id;
             $createPhysisician->save();
         }
         if ($createUser->type == 'PATIENT') {
             $createPatient = new Patient();
             $createPatient->user_id = $createUser->id;
             $createPatient->save();
         }
         return Redirect::to('user/login')->with('success', ' Account created, please login');
     } else {
         return Redirect::back()->withInput()->withErrors($formValidator);
     }
 }
Example #2
0
         throw new Exception('Email address is required', __LINE__);
     }
     $sql = "insert into physicians (fname,lname,email,pending,avail_date,data_entry,spec_2nd,school,amg,bcbe,bcbe_year, licensed, pstatus, visa_status,pref_region,pref_states,languages,res_id,`year`,`source`,phg_source) values ('{$fname}','{$lname}','{$email}',2,{$avail_date},now(), {$spec_2nd}, {$school}, {$amg}, {$bcbe}, {$bcbe_year}, {$licensed}, {$pstatus}, {$visa_status},{$pref_region},{$pref_states},{$languages},{$phg},2000,20,{$phg_source})";
     $result = $resdb->query($sql);
     if (!$result) {
         throw new Exception(DEBUG ? "{$resdb->error} : {$sql}" : 'Can not insert, may be email address is already registered', __LINE__);
     }
     $docid = $resdb->insert_id;
     $sql = "insert into gestapo (phid,opid,action) values ({$docid},{$UUID},'IMPORT')";
     $result = $nodb->query($sql);
 }
 if ($docid) {
     if (!isset($resdb)) {
         $resdb = db_career();
     }
     $doc = new Physician($resdb, $docid);
     // now process form buttons
     if (isset($_POST['submit']) || isset($_POST['submit2']) || isset($_POST['savest'])) {
         // fname midname lname addr1 addr2 city state zip phone spec ...
         $strippost = str_replace('"', "'", $_POST);
         // make all double quotes to be single
         extract($strippost, EXTR_SKIP);
         if ($iv_date <= date('Y-m-d')) {
             $doc->iv_date = $iv_date;
         }
         $doc->dup = 0;
         $doc->inactive = 0;
         $doc->status = 1;
         if (!empty($fname)) {
             $doc->fname = $fname;
         }
Example #3
0
         list($nextid) = $result->fetch_row();
     } else {
         $sql = "select memberuid from custlistsus where listid = 0 and owneruid = {$peekuid} LIMIT 0, 2";
         $result = $db->query($sql);
         $result->fetch_row();
         // skip current
         list($nextid) = $result->fetch_row();
     }
     $result->free();
 }
 // got $preved and $nextid, which can be NULL/false/unset
 // $db is set now
 if (!isset($db)) {
     $db = db_career();
 }
 $doc = new Physician($db, $docid);
 $hashlink = 'http://physiciancareer.com/log-in/?i=' . $doc->ph_id . '&d=' . $newt . '&mm=' . sha1($doc->ph_id . $doc->fname . $doc->lname . $newt . 'Please let me in, I got this email - this is the secret code!');
 $hashlinkQP = 'http://physiciancareer.com/log-in/?i=3D' . $doc->ph_id . '&d=3D' . $newt . '&mm=3D' . sha1($doc->ph_id . $doc->fname . $doc->lname . $newt . 'Please let me in, I got this email - this is the secret code!');
 // now process form buttons
 if (isset($_POST['submit']) || isset($_POST['submitcv']) || isset($_POST['savest'])) {
     $action = $doc->reg_date ? 'UPDATE' : 'SAVE';
     // fname midname lname addr1 addr2 city state zip phone spec ...
     unset($formpage);
     $strippost = str_replace('"', "'", $_POST);
     // make all double quotes to be single
     extract($strippost, EXTR_SKIP);
     // readonly check block. NB: indent is wrong
     if ($fname) {
         $doc->fname = $fname;
     } else {
         $mesg .= "no first name; ";
Example #4
0
            $showcv = $id;
        }
        // msie would not let save files from such links, we need to show some page first
    } catch (Exception $e) {
        $result = false;
        $mesg = 'Can not send CV: ' . $e->getMessage() . ' (' . $e->getCode() . ')';
    }
}
$cvacc = 0;
if ($UUID && $ACCESS && $docid) {
    try {
        if (!$db) {
            $db = db_career();
        }
        if (!$doc) {
            $doc = new Physician($db, $docid);
        }
        if (!$cv) {
            $cv = $doc->getcv();
        }
        $key = substr(md5($cv->filename . $doc->fname . $doc->lname), 0, 8);
        if (isset($_POST['submit']) || isset($_POST['submit1']) || isset($_POST['submit2'])) {
            // do stuff
            if ($_REQUEST["permit"] === "yes") {
                if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
                    $file_size = $_FILES['userfile']['size'];
                    if (!$file_size || $file_size > 2 * 1024 * 1024.0) {
                        throw new Exception('File is too big. Size limit is 2Mb', __LINE__);
                    }
                    if ($cv) {
                        // replace