当前位置: 首页>>代码示例>>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;未经允许,请勿转载。