當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Guardian::setNationality方法代碼示例

本文整理匯總了PHP中Guardian::setNationality方法的典型用法代碼示例。如果您正苦於以下問題:PHP Guardian::setNationality方法的具體用法?PHP Guardian::setNationality怎麽用?PHP Guardian::setNationality使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Guardian的用法示例。


在下文中一共展示了Guardian::setNationality方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postAdd

 public function postAdd()
 {
     $divisions = DBGNDDivisionController::getAllDivision();
     $divisionIdA = array();
     foreach ($divisions as $division) {
         $divisionIdA[] = $division->getGrama_niladari_div_no();
     }
     $first_name = Input::get("firstNameText");
     $last_name = Input::get("lastNameText");
     $email = Input::get("emailText");
     $permanent_address = Input::get("addressText");
     $password = Input::get("password");
     $conform_password = Input::get("confirm_password");
     $nic = Input::get("nicText");
     $telephone_number = Input::get("telephoneText");
     $relation_to_child = Input::get("relationshiptochild");
     $religion = Input::get("religionText");
     $nationality = Input::get("nationalityText");
     $div_val = Input::get("gramaNiladariDivisionNumberText");
     $grama_niladry_division_number = $divisionIdA[$div_val];
     /*$rules=array('$conform_password' => 'same:$password', );
       $validator=Validator::make(Input::all(),$rules);
       if($validator->fails())
               return Redirect::to('/');*/
     if (strcmp($conform_password, $password) != 0) {
         return Redirect::to('guardian')->withInput()->with('error', "Passwords dont match");
     } elseif (validationhandler::checkNIC($nic) == false) {
         return Redirect::to('guardian')->withInput()->with('error', "NIC is invalid");
     } elseif (!preg_match("/^[a-zA-Z'-]+\$/", $first_name)) {
         return Redirect::to('guardian')->withInput()->with('error', "First Name is invalid");
     } elseif (!preg_match("/^[a-zA-Z'-]+\$/", $last_name)) {
         return Redirect::to('guardian')->withInput()->with('error', "Last Name is invalid");
     } elseif (!preg_match("/^[a-zA-Z'-]+\$/", $religion)) {
         return Redirect::to('guardian')->withInput()->with('error', "Religion is invalid");
     } elseif (!preg_match("/^[a-zA-Z'-]+\$/", $nationality)) {
         return Redirect::to('guardian')->withInput()->with('error', "Nationality is invalid");
     } elseif (!preg_match("/^[0]{1}[0-9]{9}\$/", $telephone_number)) {
         return Redirect::to('guardian')->withInput()->with('error', "Telephone Number is invalid");
     } else {
         $guardian = new Guardian();
         $guardian->setNic($nic);
         $guardian->setFirstName($first_name);
         $guardian->setLastName($last_name);
         $guardian->setEmail($email);
         $guardian->setPermanent_address($permanent_address);
         // $guardian->setPassword(Hash::make($password));
         $guardian->setPassword($password);
         $guardian->setContact_number($telephone_number);
         $guardian->setRelationship($relation_to_child);
         $guardian->setReligion($religion);
         $guardian->setNationality($nationality);
         $guardian->setGrama_nil_div_no($grama_niladry_division_number);
         $result = DBGuardianController::addGuardian($guardian);
         if ($result) {
             return View::make('G1SAS/AddGuardianSuccessfull');
         } else {
             return "not added successfully";
         }
     }
 }
開發者ID:dushaniw,項目名稱:Grade1_admission_system,代碼行數:60,代碼來源:GuardianController.php

示例2: getGuardianByNic

 public static function getGuardianByNic($guardianNic)
 {
     $db = Connection::getInstance();
     $mysqli = $db->getConnection();
     $query = "select * from guardian where NIC='{$guardianNic}'";
     $result = $mysqli->query($query);
     $guardian = new Guardian();
     if ($result->num_rows > 0) {
         if ($row = $result->fetch_assoc()) {
             $guardian->setNic($row["NIC"]);
             $guardian->setEmail($row["email"]);
             $guardian->setFirstName($row["g_firstName"]);
             $guardian->setLastName($row["g_lastName"]);
             $guardian->setRelationship($row["relationship"]);
             $guardian->setNationality($row["g_nationality"]);
             $guardian->setReligion($row["g_religion"]);
             $guardian->setPermanent_address($row["permanent_address"]);
             $guardian->setEmail($row["email"]);
             $guardian->setContact_number($row["contactNumber"]);
             $guardian->setGrama_nil_div_no($row["grama_niladari_div_no"]);
             $guardian->setPassword($row["password"]);
         }
     } else {
         return NULL;
     }
     return $guardian;
 }
開發者ID:dushaniw,項目名稱:Grade1_admission_system,代碼行數:27,代碼來源:DBGuardianController.php


注:本文中的Guardian::setNationality方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。