当前位置: 首页>>代码示例>>PHP>>正文


PHP User_Model::set_first_name方法代码示例

本文整理汇总了PHP中User_Model::set_first_name方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::set_first_name方法的具体用法?PHP User_Model::set_first_name怎么用?PHP User_Model::set_first_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User_Model的用法示例。


在下文中一共展示了User_Model::set_first_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_by_id

 public function get_by_id($id)
 {
     $user_model = null;
     //DATABASE CONNECTION
     $this->db->connect();
     //SELECT BY ID
     $sql = "SELECT * FROM user WHERE user_id=?";
     //PREPARE
     $stmt = $this->db->initialize($sql);
     //BIND
     $stmt->bind_param("i", $id);
     //EXECUTE
     $stmt->execute();
     //BIND RESULT
     $stmt->bind_result($user_id, $user_name, $first_name, $last_name, $contact_number, $user_type, $user_status, $user_hash);
     while ($stmt->fetch()) {
         //instantiate object
         $user_model = new User_Model();
         $user_model->set_user_id($user_id);
         $user_model->set_user_name($user_name);
         $user_model->set_first_name($first_name);
         $user_model->set_last_name($last_name);
         $user_model->set_contact_number($contact_number);
         $user_model->set_user_type($user_type);
         $user_model->set_user_status($user_status);
         $user_model->set_user_hash($user_hash);
     }
     $this->db->close();
     return $user_model;
 }
开发者ID:pratishshr,项目名称:Aawaaj,代码行数:30,代码来源:userrepository.class.php

示例2: get_all

 public function get_all()
 {
     //ARRAY OBJECT HARU PASS GARNA
     $user_list = array();
     //DATABASE CONNECTION
     $this->db->connect();
     //SELECT ALL QUERY
     $sql = "SELECT user_id,user_name,first_name,last_name,contact_number,user_type,user_status,gen_id,age FROM user INNER JOIN generaluser ON user_id = u_id";
     //fetchquery
     $result = $this->db->fetchquery($sql);
     //STORE IN OBJECT AND SEND TO VIEW
     while ($row = $result->fetch_assoc()) {
         $user_model = new User_Model();
         $user_model->set_user_id($row['user_id']);
         $user_model->set_user_name($row['user_name']);
         $user_model->set_first_name($row['first_name']);
         $user_model->set_last_name($row['last_name']);
         $user_model->set_contact_number($row['contact_number']);
         $user_model->set_user_type($row['user_type']);
         $user_model->set_user_status($row['user_status']);
         array_push($user_list, $user_model);
     }
     $this->db->close();
     return $user_list;
 }
开发者ID:pratishshr,项目名称:Aawaaj,代码行数:25,代码来源:generaluserrepository.class.php

示例3: get_all

 public function get_all()
 {
     //ARRAY OBJECT HARU PASS GARNA
     $user_list = array();
     //DATABASE CONNECTION
     $this->db->connect();
     //SELECT ALL QUERY
     $sql = "SELECT user_id,user_name,first_name,last_name,contact_number,user_type,user_status,name,doe,img,address,service,objective FROM user INNER JOIN welfare ON user_id = u_id";
     //fetchquery
     $result = $this->db->fetchquery($sql);
     //STORE IN OBJECT AND SEND TO VIEW
     while ($row = $result->fetch_assoc()) {
         $user_model = new User_Model();
         $user_model->set_user_id($row['user_id']);
         $user_model->set_user_name($row['user_name']);
         $user_model->set_first_name($row['first_name']);
         $user_model->set_last_name($row['last_name']);
         $user_model->set_contact_number($row['contact_number']);
         $user_model->set_user_type($row['user_type']);
         $user_model->set_user_status($row['user_status']);
         $user_model->set_welf_name($row['name']);
         $user_model->set_welf_doe($row['doe']);
         $user_model->set_welf_img($row['img']);
         $user_model->set_welf_address($row['address']);
         $user_model->set_welf_objective($row['objective']);
         $user_model->set_welf_service($row['service']);
         array_push($user_list, $user_model);
     }
     $this->db->close();
     return $user_list;
 }
开发者ID:pratishshr,项目名称:Aawaaj,代码行数:31,代码来源:welfarerepository.class.php

示例4: _map_posted_data

 private function _map_posted_data()
 {
     $user_model = new User_Model();
     $user_model->set_user_name($_POST['user_name']);
     $user_model->set_first_name($_POST['first_name']);
     $user_model->set_last_name($_POST['last_name']);
     $user_model->set_contact_number($_POST['contact_number']);
     if (isset($_POST['user_type'])) {
         $user_model->set_user_type($_POST['user_type']);
     }
     $user_model->set_user_status($_POST['user_status']);
     if (isset($_POST['password'])) {
         $user_model->set_password($_POST['password']);
     }
     if ($_POST['user_type'] == 'organization') {
         $user_model->set_name($_POST['name']);
         $user_model->set_doe($_POST['doe']);
         $user_model->set_address($_POST['address']);
         $user_model->set_objective($_POST['objective']);
         //store file
         $filename = $_FILES['img']['name'];
         $path = PUBLIC_PATH . "/pictures/orgPictures/";
         move_uploaded_file($_FILES['img']['tmp_name'], $path . $filename);
         $savepath = PUBLIC_PATH2 . "/pictures/orgPictures/";
         $user_model->set_img($savepath . $filename);
     } elseif ($_POST['user_type'] == 'welfare') {
         $user_model->set_welf_name($_POST['welf_name']);
         $user_model->set_welf_doe($_POST['welf_doe']);
         $user_model->set_welf_service($_POST['welf_service']);
         $user_model->set_welf_address($_POST['welf_address']);
         $user_model->set_welf_objective($_POST['welf_objective']);
         //store file
         $filename = $_FILES['img']['name'];
         $path = PUBLIC_PATH . "/pictures/welfPictures/";
         move_uploaded_file($_FILES['img']['tmp_name'], $path . $filename);
         $savepath = PUBLIC_PATH2 . "/pictures/welfPictures/";
         $user_model->set_welf_img($savepath . $filename);
     }
     return $user_model;
 }
开发者ID:pratishshr,项目名称:Aawaaj,代码行数:40,代码来源:User.php


注:本文中的User_Model::set_first_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。