public function set($name, $seat, $desc) { $this->Id = Validator::UniqueKey(); $this->desc = $desc; $this->seats = $seat; $this->name = $name; $this->mode = null; }
public function set($seatNo, $planeId, $desc, $type, $rate) { $this->seatNo = $seatNo; $this->planeID = $planeId; $this->type = $type; $this->desc = $desc; $this->rate = $rate; $this->id = Validator::UniqueKey(); }
function __construct($creatorId = null, $title = null, $venue = null, $type = null) { $this->__startDate = "" . (intval(Validator::Now()) + 1 * 24 * 60 * 60); $this->__id = Validator::UniqueKey(14) . "" . TryFetchUserEvent::count(); $this->setCreatorId($creatorId); $this->setTitle($title); $this->setVenue($venue); $this->setType($type); $this->setCreateDate(Validator::Now()); }
public function __construct($flight_id = NULL, $ticket_cat = NULL, $ticket_type = NULL, $adult = 0, $child = 0, $price = 0.0) { parent::__construct(); $this->flight_id = $flight_id; $this->children_no = $child; $this->adult_no = $adult; $this->ticket_cat = $ticket_cat; $this->ticket_type = $ticket_type; $this->ticket_adult_price = $price; $this->id = Validator::UniqueKey(); }
public function set($planeId, $from, $to, $deptdate, $landingDate, $boardingTime, $LandingTime, $ticketPrice, $stops) { $this->from = $from; $this->to = $to; $this->deptureDate = $deptdate; $this->landindDate = $landingDate; $this->boardingTime = $boardingTime; $this->Landingtime = $LandingTime; $this->ticketPrice = $ticketPrice; $this->stops = $stops; $this->Id = Validator::UniqueKey(); $this->planeID = $planeId; }
public function update() { $query = "Update " . UserTable::TableName . " set " . UserTable::VerificationCode . "=:code where " . UserTable::UserName . "=:email"; $stmt = $this->db->prepare($query); $code = Validator::UniqueKey(4); $stmt->bindValue(":email", $this->email); $stmt->bindValue(":code", $code); if ($stmt->execute() && $stmt->rowCount() > 0) { return $code; } else { return null; } }
public final function set($firstname, $lastname, $email, $phone, $password) { $firstname = $firstname == "null" ? null : $firstname; $lastname = $lastname == "null" ? null : $lastname; $email = $email == "null" ? null : $email; $password = $password == "null" ? null : $password; $phone = $phone == "null" ? null : $phone; $this->agentId = Validator::UniqueKey() . "" . Validator::UniqueKey(); $this->firstname = $firstname; $this->lastname = $lastname; $this->email = $email; $this->phonenumber = $phone; $this->password = $password; $this->date_reqistered = Date("d/m/Y", time()); }
public function create() { $this->db->create(new UserTable()); $okay = false; $sql = "Insert Into " . UserTable::TableName . "(" . UserTable::FullName . "," . UserTable::ID . "," . UserTable::UserName . "," . UserTable::Gender . "," . UserTable::LastUpdateDate . "," . UserTable::RegisterDate . "," . UserTable::Status . "," . UserTable::VerificationCode . ")" . " Values" . "(:fullname,:id,:email,:gender,:lastupdate,:registerDate,:status,:vcode)"; //set the fields values $now = Validator::Now(); $stmt = $this->db->prepare($sql); $stmt->bindValue(":fullname", trim($this->user->getFullname())); $stmt->bindValue(":id", Validator::UniqueKey(8)); $stmt->bindValue(":email", addslashes(strtolower(trim($this->user->getEmail())))); $stmt->bindValue(":gender", $this->user->getGender()); $stmt->bindValue(":lastupdate", $now); $stmt->bindValue(":registerDate", $now); $stmt->bindValue(":status", 0); $stmt->bindValue(":vcode", $this->user->getVerificationCode()); $abool = $stmt->execute(); if ($abool && $stmt->rowCount() > 0) { $okay = true; } return $okay; }
private function tryCreate(User $user) { $tryFetchUser = new TryFetchUser(); $response = array(); $response["success"] = 0; if ($tryFetchUser->fetch($user->getEmail()) == null) { $user->setVerificationCode(Validator::UniqueKey(4)); $tryCreate = new TryCreateUser($user); $abool = $tryCreate->create(); if ($abool) { $response["success"] = 1; $user = $tryFetchUser->fetch($user->getEmail()); $response["user"] = $user; $this->sendWelcomeMessage(json_encode($user)); } else { $response["error_message"] = "report this problem please!"; } } else { $email = $user->getEmail(); $response["error_message"] = "The [{$email}] account already exists "; } return $response; }
function Create($email, $firstname, $lastname, $phone, $password, $repassword, $sendButton = null) { $repassword = $repassword == "null" ? null : $repassword; $agent = new Agent(); $agent->set($firstname, $lastname, $email, $phone, $password); $agentModel = new AgentModel($agent); $list = $agentModel->GetUsers(); $this->agentModelView->agent = $agent; $this->agentModelView->agentList = $list; if ($agent->validated()) { if ($password != $repassword) { Session::set("warning", " Password mis-matched, re-enter passwords again!"); return $this->View($this->agentModelView, "Agent", "Create"); } else { $this->agentModelView->agentDbModel = $agentModel; if ($agentModel->Exists()) { Session::set("warning", "The user with the given email address [{$email}] already exists!"); } else { try { //else create the user if ($agentModel->Create()) { $sessionID = Validator::UniqueKey(20); $agentModel->SaveVerificationCode($email, $sessionID); //create a barcode $param = new ArrayIterator(); $param->offsetSet("username", $agent->email); $param->offsetSet("verificationCode", $sessionID); $url = ContextManager::CreateURL("Agent", "Login", $param); $imgPath = ContextManager::CreateQRBarcode($url, $agent->agentId); if ($this->_sendVerificationEmail($agent, $sessionID, $imgPath)) { //navigate to comfirmation page return $this->View($agent, "Agent", "Confirmation"); } else { Session::set("warning", "could not send mail "); $agentModel->DeleteAgent($email); } } } catch (Exception $err) { Session::set("warning", $err->getMessage()); } } } // create a database record here } else { Session::set("warning", $agent->getError()); } return $this->View($this->agentModelView, "Agent", "Create"); }
function __construct() { $this->parkUniqueId = Validator::UniqueKey(10); $this->geolocation = new GeoPosition(0.0, 0.0); $this->date_added = Validator::Now(); }