本文整理汇总了PHP中User_Model::set_name方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::set_name方法的具体用法?PHP User_Model::set_name怎么用?PHP User_Model::set_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_Model
的用法示例。
在下文中一共展示了User_Model::set_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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,objective FROM user INNER JOIN organization 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_name($row['name']);
$user_model->set_doe($row['doe']);
$user_model->set_img($row['img']);
$user_model->set_address($row['address']);
$user_model->set_objective($row['objective']);
array_push($user_list, $user_model);
}
$this->db->close();
return $user_list;
}
示例2: _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;
}
示例3: get_all_users
public function get_all_users()
{
$res = $this->connection->query("SELECT * FROM userdb", PDO::FETCH_LAZY);
$users = array();
global $logged_user;
$i = 0;
foreach ($res as $row) {
if ($row['uid'] == $logged_user->uid) {
continue;
}
$cur_user = new User_Model();
$cur_user->set_login($row['login']);
$cur_user->set_password($row['pass']);
$cur_user->set_email($row['email']);
$cur_user->set_role($row['role']);
$cur_user->set_status($row['status']);
$cur_user->set_name($row['name']);
$cur_user->set_surname($row['surname']);
$cur_user->set_uid($row['uid']);
$users[$i] = $cur_user;
$i++;
}
return $users;
}