本文整理匯總了PHP中User_Model::set_address方法的典型用法代碼示例。如果您正苦於以下問題:PHP User_Model::set_address方法的具體用法?PHP User_Model::set_address怎麽用?PHP User_Model::set_address使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類User_Model
的用法示例。
在下文中一共展示了User_Model::set_address方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}