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


PHP Model_Users类代码示例

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


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

示例1: docUserLogAction

 public function docUserLogAction()
 {
     //$this->_helper->layout->setLayout('main');
     $users = new Model_Users();
     $doc_user_log = $users->getDocUserLog();
     $this->view->result = $doc_user_log;
 }
开发者ID:uppaljs,项目名称:pakistan-vlmis-v2,代码行数:7,代码来源:DocsController.php

示例2: sendMails

 public function sendMails($data)
 {
     $config = (include_once 'config/main.php');
     $result = array('status' => 'success', 'message' => 'Сообщения успешно разосланы!');
     // Получаем всех пользователей
     $model = new Model_Users();
     $users = $model->getUsersMailing(intval($data['id_group']));
     if (!$users) {
         $result['status'] = 'error';
         $result['message'] = 'Пользователи не найдены!';
         return $result;
     }
     //Формируем адресатов
     $addresses = [];
     for ($i = 0; $i < count($users); $i++) {
         if ($users[$i]->name) {
             $addresses[$i]['name'] = $users[$i]->name;
         } else {
             $addresses[$i]['name'] = 'пользователь сайта LoftShop';
         }
         $addresses[$i]['email'] = $users[$i]->email;
     }
     $username = 'пользователь сайта LoftShop';
     $letter = ['preview' => $data['subject'], 'title' => $data['title'], 'username' => $username, 'body' => $data['body']];
     $bodyHtml = $this->view->render('admin/mailing/letter_template.twig', array('letter' => $letter));
     $bodyText = 'Здравствуйте, ' . $username . '! ' . $data['body'] . ' С уважением, администрация сайта LoftShop!';
     $sendStatus = $this->sendMailMany($config['email']['adminname'], $config['email']['adminemail'], $config['email']['adminpassword'], $addresses, $data['subject'], $bodyHtml, $bodyText);
     if (!$sendStatus) {
         $result['status'] = 'error';
         $result['message'] = 'Не удалось отправить сообщения=(';
         return $result;
     }
     return $result;
 }
开发者ID:Antoshka007,项目名称:php_dz5,代码行数:34,代码来源:controller_mailing.php

示例3: deleteAction

 public function deleteAction()
 {
     $role = new Model_Users();
     $role_id = $_GET['role_id'];
     $role->deleteRole($role_id);
     $this->redirect('giaovu/role/list');
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:7,代码来源:RoleController.php

示例4: index

 function index()
 {
     $model = new Model_Users();
     $userInfo = $model->getUser(2);
     $this->template->vars('userInfo', $userInfo);
     $this->template->view('index');
 }
开发者ID:andxbes,项目名称:ArchetypePHPMVC,代码行数:7,代码来源:Index.php

示例5: calificacionautomatica

 public function calificacionautomatica($idempresa, $users, $estado)
 {
     if ($estado == "4") {
         $proyecto = 1;
         if ($users == "564") {
             $userid = 564;
             $deptocalifica = 2;
         } else {
             $ouser = new Model_Users();
             $deptocalifica = $ouser->iddeptouser($users->id);
             $userid = $users->id;
         }
         $notafinal1 = $this->califica($idempresa, $proyecto, $deptocalifica);
         $calificaciones = ORM::factory('calificaciones');
         $calificaciones->id_empresa = $idempresa;
         $calificaciones->id_user = $userid;
         $calificaciones->calificacion = $notafinal1;
         $calificaciones->comentario = "Nota para proyectos en Vivienda Nueva (GENERADO POR EL SISTEMA)";
         $calificaciones->fecha_registro = date('Y-m-d H:i:s');
         $calificaciones->id_clasificacion = "1";
         $calificaciones->save();
         $proyecto = 2;
         $notafinal2 = $this->califica($idempresa, $proyecto, $deptocalifica);
         $calificaciones = ORM::factory('calificaciones');
         $calificaciones->id_empresa = $idempresa;
         $calificaciones->id_user = $userid;
         $calificaciones->calificacion = $notafinal2;
         $calificaciones->comentario = "Nota para proyectos PMAR (GENERADO POR EL SISTEMA)";
         $calificaciones->fecha_registro = date('Y-m-d H:i:s');
         $calificaciones->id_clasificacion = "1";
         $calificaciones->save();
     }
 }
开发者ID:sysdevbol,项目名称:entidad,代码行数:33,代码来源:rankingempresas.php

示例6: _getArticleObjectFromData

 protected static function _getArticleObjectFromData(\stdClass $article_data)
 {
     $author = new Model_Users($article_data->author_username);
     $author->prop('id', $article_data->author_id);
     $category = new Model_Categories($article_data->category_name);
     $category->prop('id', $article_data->category_id);
     return new Model_Articles(['id' => $article_data->id, 'title' => $article_data->title, 'introduction' => $article_data->introduction, 'content' => $article_data->content, 'date_publication' => $article_data->date_publication, 'date_last_update' => $article_data->date_last_update, 'is_published' => $article_data->is_published, 'author' => $author, 'category' => $category]);
 }
开发者ID:adrien-gueret,项目名称:le-chomp-enchaine,代码行数:8,代码来源:Articles.php

示例7: recoverAction

 public function recoverAction()
 {
     $user_id = $_GET['user_id'];
     $user = new Model_Users();
     //$user->deleteUserRole($user_id);
     $user->recoverUser($user_id);
     $this->redirect('giaovu/user/list');
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:8,代码来源:UserController.php

示例8: action_index

 public function action_index()
 {
     $oUser = new Model_Users();
     $users = $oUser->listaGeneral();
     if (sizeof($users) > 0) {
         $this->template->content = View::factory('admin/users')->bind('users', $users);
     }
 }
开发者ID:sysdevbol,项目名称:entidad,代码行数:8,代码来源:user.php

示例9: isValid

 public function isValid($value, $context = null)
 {
     $usersModel = new Model_Users();
     if ($usersModel->userIsValid($context['email'], $value)) {
         return true;
     }
     $this->_error(self::NOT_MATCH);
     return false;
 }
开发者ID:georgetutuianu,项目名称:licenta,代码行数:9,代码来源:Credentials.php

示例10: isValid

 public function isValid($value)
 {
     $usersModel = new Model_Users();
     if ($usersModel->emailExists($value)) {
         $this->_error(self::MAIL_TAKEN);
         return false;
     }
     return true;
 }
开发者ID:georgetutuianu,项目名称:licenta,代码行数:9,代码来源:EmailNotTaken.php

示例11: isValid

 public function isValid($value)
 {
     $modelUsers = new Model_Users();
     $user = $modelUsers->fetchWithEmail($value);
     if (!$user) {
         $this->_error(self::INVALID_USER_EMAIL);
         return false;
     }
     return true;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:10,代码来源:User.php

示例12: login

 /**
  * Autenticação de Usuário
  *
  * Apresentando como primeiro parâmetro o e-mail do usuário e como segundo o
  * seu hash cadastrado no sistema, será apresentado um token de autenticação
  * resultante se as credenciais apresentadas estiverem válidas.
  *
  * @param  string $email E-mail Utilizado pelo Usuário
  * @param  string $hash  Hash Cadastrado para o E-mail
  * @return string Token de Autenticação
  */
 public function login()
 {
     // Captura de Parâmetros
     $email = (string) func_get_arg(0);
     $hash = (string) func_get_arg(1);
     // Camada de Modelo
     $model = new Model_Users();
     // Processamento
     $result = $model->login($email, $hash);
     // Apresentação
     return $result;
 }
开发者ID:laiello,项目名称:wanderson,代码行数:23,代码来源:Compiler.php

示例13: indexAction

 public function indexAction()
 {
     $form = new Form_Cadmin_UserSearch();
     $form_add = new Form_Cadmin_User();
     $params = array();
     $users = new Model_Users();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $loginid = $form->getValue('login_id');
             $role_id = $form->getValue('role');
             if (!empty($loginid)) {
                 $params['loginId'] = $loginid;
             }
             if (!empty($role_id)) {
                 $params['role'] = $role_id;
             }
         }
     } else {
         $loginid = $this->_getParam('login_id');
         $role_id = $this->_getParam('role');
         if (!empty($loginid)) {
             $params['loginId'] = $loginid;
             $form->login_id->setValue($loginid);
         }
         if (!empty($role_id)) {
             $params['role'] = $role_id;
             $form->role->setValue($role_id);
         }
     }
     $sort = $this->_getParam("sort", "asc");
     $order = $this->_getParam("order", "login_id");
     $users->form_values = $params;
     $result = $users->getUsers($order, $sort);
     //Paginate the contest results
     $paginator = Zend_Paginator::factory($result);
     $page = $this->_getParam("page", 1);
     $counter = $this->_getParam("counter", 10);
     $paginator->setCurrentPageNumber((int) $page);
     $paginator->setItemCountPerPage((int) $counter);
     $this->view->form = $form;
     $this->view->form_add = $form_add;
     $this->view->paginator = $paginator;
     $this->view->sort = $sort;
     $this->view->order = $order;
     $this->view->counter = $counter;
     $this->view->pagination_params = $params;
     $base_url = Zend_Registry::get('baseurl');
     $this->view->inlineScript()->appendFile($base_url . '/js/all_level_combos.js');
     $this->view->inlineScript()->appendFile($base_url . '/common/bootstrap/extend/jasny-bootstrap/js/jasny-bootstrap.min.js');
     $this->view->inlineScript()->appendFile($base_url . '/common/bootstrap/extend/jasny-bootstrap/js/bootstrap-fileupload.js');
     $this->view->headLink()->appendStylesheet($base_url . '/common/bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap.min.css');
     $this->view->headLink()->appendStylesheet($base_url . '/common/bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap-responsive.min.css');
 }
开发者ID:uppaljs,项目名称:pakistan-vlmis-v2,代码行数:53,代码来源:ManageUsersController.php

示例14: addeditAction

 /**
  * Function addeditAction for add and edit the user's information.
  */
 public function addeditAction()
 {
     $asUser = Zend_Json_Decoder::decode($this->getRequest()->getParam('ssUserDetail'), Zend_Json::TYPE_ARRAY);
     if ($asUser['id_user'] == 0) {
         $oUser = new Model_Users();
         $oUser->saveUser($asUser);
     } else {
         $oUser = Model_UsersTable::updateUser($asUser);
     }
     $asResponse = array('status' => 'success', 'massage' => 'Record added or edited successfully');
     echo Zend_Json_Encoder::encode($asResponse);
     exit;
 }
开发者ID:nainit-virtueinfo,项目名称:zend-rest,代码行数:16,代码来源:RestserverController.php

示例15: accountAction

 public function accountAction()
 {
     $lecturer_id = $this->sessionGlobal->lecturer_id;
     $user = new Model_Users();
     $findUser = $user->findOneUser($lecturer_id);
     $this->view->findUser = $findUser;
     if ($this->_request->isPost()) {
         $data = $this->_getParam('searchParam');
         $user->updateUser($data);
         echo "Thành công";
         header("Refresh:0");
     }
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:13,代码来源:InfoController.php


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