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


PHP UserDao::update方法代碼示例

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


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

示例1: UserDao

 function supprimer_admin($params)
 {
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $deleteProjects = $_POST['check'];
         $userDao = new UserDao(new User());
         $list = $userDao->read($deleteProjects);
         $list->setIs_admin(0);
         $userDao = new UserDao($list);
         $userDao->update($deleteProjects);
         $this->redirect('admin/administrateur');
     }
     $userDao = new UserDao(new User());
     $list = $userDao->read($params);
     $this->set(array("user" => $list));
     $this->render('supprimer_admin');
 }
開發者ID:BinarySoltions,項目名稱:projet_rpm,代碼行數:16,代碼來源:Administrateur.php

示例2: User

<?php

$user_id = $_POST['user']['id'];
$user_obj = null;
$updatedUser_obj = null;
$user_obj = new User();
$updatedUser_obj = new User();
if (array_key_exists('find', $_POST)) {
    $data = array('id' => $_POST['user']['id']);
    UserMapper::map($user_obj, $data);
    $dao = new UserDao();
    $foundUser = $dao->findById($user_id);
}
if (array_key_exists('update', $_POST)) {
    $data = array('id' => $_POST['user']['id'], 'first_name' => $_POST['user']['first_name'], 'user_password' => $_POST['user']['user_password']);
    UserMapper::map($updatedUser_obj, $data);
    $dao = new UserDao();
    $dao->update($updatedUser_obj);
    Flash::addFlash('user record(s) updated successfully :)');
}
開發者ID:beshad,項目名稱:dropoff_practice_26NOV_0011,代碼行數:20,代碼來源:find-update-script.php

示例3: initialiser

 function initialiser()
 {
     $erreur = false;
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         if ($_POST['mail'] == '') {
             $erreur_array['mail'] = 1;
             $erreur = true;
         } else {
             $mail = trim($_POST['mail']);
             $erreur_array['mail'] = 0;
         }
         if ($_POST['password'] == '') {
             $erreur_array['password'] = 1;
             $erreur = true;
         } else {
             $password = trim($_POST['password']);
             $erreur_array['password'] = 0;
         }
         if (!$erreur) {
             $userDao = new UserDao(new User());
             //$where = array('email'=>"$email");
             $nb = $userDao->getRow(array('email' => $param));
             if (count($nb)) {
                 $password_hash = md5($password);
                 $nb->setPassword($password_hash);
                 $userDao = new UserDao($nb);
                 $id = $nb->getId();
                 $userDao->update($id);
                 $this->set(array('init' => '1'));
                 $this->render('initialiser');
             }
             $this->set(array('init' => '-1'));
             $this->render('initialiser');
         }
     }
     $this->set(array('init' => '0'));
     $this->render('initialiser');
 }
開發者ID:fallouseven,項目名稱:projet_rpm,代碼行數:38,代碼來源:Authentification.php

示例4: array

<?php

$errors = array();
$userObj = new User();
$address_obj = new Address();
if (array_key_exists('submit', $_POST)) {
    $userData = array('id' => (int) $_SESSION['user_id'], 'first_name' => $_POST['user']['first_name'], 'last_name' => $_POST['user']['last_name']);
    $addressData = array('street_no' => $_POST['address']['street_no'], 'street' => $_POST['address']['street'], 'suburb' => $_POST['address']['suburb'], 'city' => $_POST['address']['city'], 'post_code' => $_POST['address']['post_code']);
    UserMapper::map($userObj, $userData);
    AddressMapper::map($address_obj, $addressData);
    //$errors = Validator::validate($userObj);
    //if (empty($errors)) {
    $userDao = new UserDao();
    $addressDao = new AddressDao();
    $_SESSION['address_id'] = $addressDao->create($address_obj)->getId();
    $userDao->update($userObj);
    //Utils::redirect(dashboard);
    //}
}
開發者ID:beshad,項目名稱:dropoff_30_nov_,代碼行數:19,代碼來源:dashboard-script.php

示例5: array

 function modifier_profil($params)
 {
     $erreur_array = array('name' => -1, 'description' => -1, 'contenu' => -1, 'from' => -1, 'to' => -1);
     $erreur = false;
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $params = $_POST['iduser'];
         $array_user = $this->postModifier_user($erreur, $erreur_array);
         if (!$erreur) {
             $userDao = new UserDao(new User($array_user['user']));
             $userDao->update($params);
             $array_user['adresse']['id_user'] = $params;
             $adresseDao = new AdresseDao(new Adresse($array_user['adresse']));
             $adresseDao->update($params);
             $this->redirect('authentification/profil/' . $params);
             /* $mail = new Mail();
                $result = $mail->sendMailActivation('support@rp2m.com', $array_user['user']['email'], $array_user['user']['prenom'],$array_user['user']['is_verified']);
                if($result['send']){
                    $this->set(array('success'=>'1'));
                    $this->render('inscription');
                }*/
         }
     }
     $adresseDao = new AdresseDao(new Adresse());
     $adresse = $adresseDao->getRow(array('id_user' => $params));
     $this->set(array('adresse' => $adresse, 'profession' => $this->getUser()->getProfession(), 'secteur' => $this->getUser()->getDomaine()));
     $this->render('modifier_profil');
 }
開發者ID:BinarySoltions,項目名稱:projet_rpm,代碼行數:27,代碼來源:Authentification.php

示例6: editUser

 static function editUser($user, $data)
 {
     if (isset($data[User::PASSWORD]) && $data[User::PASSWORD] != "") {
         $data[User::PASSWORD] = Filter::encodePassword($data[User::PASSWORD]);
     }
     $data = Filter::filterArray($data);
     $user->edit($data);
     $userdao = new UserDao();
     return $userdao->update($user, $editor);
 }
開發者ID:Esisto,項目名稱:IoEsisto,代碼行數:10,代碼來源:UserManager.php


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