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


PHP Application_Model_User类代码示例

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


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

示例1: init

 public function init()
 {
     //get user lsit
     $userM = new Application_Model_User();
     $usersArr = $userM->getUsersList(null, '--- Select Author ---');
     $this->addElement('select', 'userId', array('label' => 'Author:', 'style' => 'width: 313px;', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select author.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $usersArr));
     $categories = new Application_Model_Category();
     $categoriesArr = $categories->getCategory("--- Select Category ---", "advice");
     $this->addElement('select', 'categoryId', array('label' => 'Category:', 'style' => 'width: 313px;', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select advice category.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $categoriesArr));
     $this->addElement('text', 'title', array('label' => 'Title :', 'class' => 'title-input-box', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the advice title')))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'identifire', array('label' => 'URL Re-write :', 'class' => 'title-input-box', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the advice URL Re-write')))), 'decorators' => $this->elementDecorators));
     // Add an body element
     $this->addElement('textarea', 'content', array('label' => 'Content:', 'required' => false, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the page content')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     // Add an body element
     $this->addElement('textarea', 'synopsis', array('label' => 'Synopsis:', 'required' => false, 'class' => 'title-input-box', 'cols' => '50', 'rows' => '3', 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the synopsis')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('textarea', 'metaTitle', array('label' => 'Meta Title :', 'cols' => '50', 'rows' => '3', 'class' => 'title-input-box', 'required' => false, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the page identifire')))), 'decorators' => $this->elementDecorators));
     $this->addElement('textarea', 'metaKeyword', array('label' => 'Meta Keyword :', 'cols' => '50', 'rows' => '3', 'class' => 'title-input-box', 'required' => false, 'decorators' => $this->elementDecorators));
     $this->addElement('textarea', 'metaDescription', array('label' => 'Meta Description :', 'class' => 'title-input-box', 'cols' => '50', 'rows' => '3', 'required' => false, 'decorators' => $this->elementDecorators));
     $Name = new Zend_Form_Element_File('name');
     $Name->setLabel('Upload an image:')->setRequired(false)->addValidator('Extension', false, 'jpg,png,gif')->clearDecorators()->addDecorators($this->fileDecorators);
     $this->addElements(array($Name));
     $this->addElement('submit', 'savePublish', array('required' => false, 'ignore' => true, 'title' => 'Save and Publish', 'label' => 'Save and Publish', 'decorators' => $this->buttonDecorators));
     $this->addElement('submit', 'saveUnpublish', array('required' => false, 'ignore' => true, 'title' => 'Save and Unpublish', 'label' => 'Save and Unpublish', 'decorators' => $this->buttonDecorators));
     $this->addElement('submit', 'previewPage', array('required' => false, 'ignore' => true, 'title' => 'Preview Page', 'label' => 'Preview Page', 'decorators' => $this->buttonDecorators));
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:25,代码来源:Advice.php

示例2: addUserPrivilegeAction

 public function addUserPrivilegeAction()
 {
     $request = $this->getRequest();
     $form = new Application_Form_UserPrivilege();
     if ($request->isPost()) {
         $options = $request->getPost();
         if ($form->isValid($options)) {
             //$options['status']='active';
             $model = new Application_Model_User($options);
             $id = $model->save();
             if ($id) {
                 /*---------  Upload image START -------------------------*/
                 $model->uploadProfilePicture($id, $options);
                 /*---------  Upload image END -------------------------*/
                 $this->_flashMessenger->addMessage(array('success' => 'User added successfully!'));
                 $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/admin/user/add-new-user'));
             } else {
                 $this->_flashMessenger->addMessage(array('error' => 'Failed to add user!'));
                 $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/admin/user/add-new-user'));
             }
             $form->reset();
         } else {
             $form->reset();
             $form->populate($options);
         }
     }
     $this->view->form = $form;
 }
开发者ID:riteshsahu1981,项目名称:Weadvance,代码行数:28,代码来源:UserPrivilegeController.php

示例3: find

 public function find($id, Application_Model_User $user)
 {
     $result = $this->getDbTable()->find($id);
     if (0 === count($result)) {
         return;
     }
     $user->setOptions($result->current()->toArray());
 }
开发者ID:jingjangjung,项目名称:WinsAndWants,代码行数:8,代码来源:UserMapper.php

示例4: find

 public function find($articleId, Application_Model_User $article)
 {
     $result = $this->getDbTable()->find($articleId);
     if (0 == count($result)) {
         return;
     }
     $row = $result->current();
     $article->setArticleId($row->articleId)->setArticleTitle($row->articleTitle)->setArticleValue($row->articleValue)->setArticleLastEdit($row->articleLastEdit)->setUserId($row->userId);
 }
开发者ID:rguetlin,项目名称:blog,代码行数:9,代码来源:ArticleMapper.php

示例5: recoverUsername

 public function recoverUsername(Application_Model_User $user)
 {
     $options['email'] = $user->getEmail();
     $options['username'] = $user->getUsername();
     $options['firstName'] = $user->getFirstName();
     $options['lastName'] = $user->getLastName();
     $Mail = new Base_Mail();
     $Mail->sendForgotUsernameMail($options);
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:9,代码来源:Auth.php

示例6: addAction

 public function addAction()
 {
     if ($this->_request->isPost()) {
         $user_data = $this->_request->getParams();
         $user = new Application_Model_User();
         $user->addUser($user_data);
         //$this->view->user_data=$user_data;
         //$this->render();
     }
 }
开发者ID:abeinoo,项目名称:Zend,代码行数:10,代码来源:UserController.php

示例7: fetchAll

 public function fetchAll()
 {
     $resultSet = $this->getDbTable()->fetchAll();
     $users = array();
     foreach ($resultSet as $row) {
         $user = new Application_Model_User();
         $user->setUserId($row->userId)->setUserName($row->userName)->setUserPassword($row->userPassword)->setUserReg($row->userRegDate)->setUserLastLogin($row->userLastLogin);
         $users[] = $user;
     }
     return $users;
 }
开发者ID:rguetlin,项目名称:blog,代码行数:11,代码来源:UserMapper.php

示例8: init

 public function init()
 {
     $this->setName('frmBookUser');
     $model = new Application_Model_User();
     $users = $model->getAllUsers("active");
     $this->addElement('select', 'userId', array('label' => 'Employee:', 'style' => 'width:193px', 'class' => 'text-input small-input', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select user.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $users));
     $this->addElement('text', 'issueDate', array('label' => 'Issue Date:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter issue date')))), 'class' => 'text-input medium-input', 'readonly' => 'true', 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('text', 'estimatedReturnDate', array('label' => 'Estimated Return Date:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter estimated return date')))), 'class' => 'text-input medium-input', 'readonly' => 'true', 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('text', 'returnDate', array('label' => 'Return Date:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter return date')))), 'class' => 'text-input medium-input', 'readonly' => 'true', 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('submit', 'submit', array('required' => false, 'class' => 'button', 'ignore' => true, 'label' => 'Submit', 'value' => 'submit', 'decorators' => $this->buttonDecorators));
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:11,代码来源:BookUser.php

示例9: fetchAll

 public function fetchAll()
 {
     $resultSet = $this->getDbTable()->fetchAll();
     $entries = array();
     foreach ($resultSet as $row) {
         $entry = new Application_Model_User();
         $entry->setId($row->id)->setPassword($row->password)->setUserName($row->username);
         $entries[] = $entry;
     }
     return $entries;
 }
开发者ID:BGCX262,项目名称:zwh-web-svn-to-git,代码行数:11,代码来源:AccountMapper.php

示例10: init

 public function init()
 {
     $this->setName('frmDepartment');
     $this->addElement('text', 'title', array('label' => 'Department Title:', 'autocomplete' => "off", 'class' => 'text-input medium-input', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter designation title'))), array('Db_NoRecordExists', true, array('table' => 'department', 'field' => 'title', 'messages' => 'department title already exists'))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('select', 'type', array('label' => 'Type:', 'style' => 'width:193px', 'class' => 'text-input small-input', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select department type.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => array("normal" => "Normal", "operations" => "Operations")));
     $arrUser = array();
     $user = new Application_Model_User();
     $arrUser = $user->getAllUsers("active");
     //$arrUser=array_merge(array(''=>'Select'),$arrUser);
     $this->addElement('select', 'departmentHeadId', array('label' => 'Department Head:', 'style' => 'width:193px', 'class' => 'text-input medium-input', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select department head.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arrUser));
     $this->addElement('submit', 'submit', array('required' => false, 'class' => 'button', 'ignore' => true, 'label' => 'Submit', 'value' => 'submit', 'decorators' => $this->buttonDecorators));
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:12,代码来源:Department.php

示例11: userAction

 public function userAction()
 {
     $user_model = new Application_Model_User();
     $users = $user_model->fetchAll();
     $this->view->users = $users;
     $review_model = new Application_Model_Review();
     $reviews = $review_model->fetchAll();
     $this->view->reviews = $reviews;
     $song_model = new Application_Model_Song();
     $songs = $song_model->fetchAll();
     $this->view->songs = $songs;
 }
开发者ID:sinaBaharlouei,项目名称:Itunes,代码行数:12,代码来源:ViewController.php

示例12: errorAction

 public function errorAction()
 {
     //$this->_helper->layout->setLayout('home-layout');
     $errors = $this->_getParam('error_handler');
     $flag = true;
     switch ($errors->type) {
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
             //var_dump($this->_getParam('controller'));
             $userM = new Application_Model_User();
             $user = $userM->fetchRow("username='{$this->_getParam('controller')}'");
             if ($user !== false) {
                 $flag = false;
                 //Forward to the controller
                 $this->_forward('index', 'profile', 'default', array('id' => $user->getId()));
             }
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
             $this->getResponse()->setHttpResponseCode(404);
             $this->view->message = 'Page not found';
             break;
         default:
             // application error
             $this->getResponse()->setHttpResponseCode(500);
             $this->view->message = 'Application error';
             break;
     }
     // Log exception, if logger available
     if ($log = $this->getLog()) {
         $log->crit($this->view->message, $errors->exception);
     }
     // conditionally display exceptions
     //var_dump($this->getInvokeArg('displayExceptions'));
     if ($this->getInvokeArg('displayExceptions') == true) {
         $this->view->exception = $errors->exception;
     }
     $this->view->request = $errors->request;
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
     $this->view->error_flag = $config->error_flag;
     //Mail
     $options['message'] = $this->view->message;
     if ($this->getInvokeArg('displayExceptions') == true) {
         $options['exception'] = $this->view->exception->getMessage();
         $options['traceString'] = $this->view->exception->getTraceAsString();
     }
     $options['params'] = $this->view->request->getParams();
     $options['requesturi'] = $this->view->request->getRequestUri();
     $options['siteurl'] = Zend_Registry::get('siteurl');
     $mail = new Base_Mail();
     if ($flag == true) {
         $mail->sendErrorMail($options);
     }
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:52,代码来源:ErrorController.php

示例13: init

 public function init()
 {
     $model = new Application_Model_User();
     $arr = $model->getAllUsers();
     $arr = array_merge(array('' => 'Select'), $arr);
     $this->addElement('select', 'userId', array('label' => 'Employee:', 'class' => 'text-input small-input', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select employee')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arr));
     $model = new Application_Model_AppriciationType();
     $arr = $model->getAppriciationType();
     //$arr=array_merge(array(''=>'Select'),$arr);
     $this->addElement('select', 'appriciationTypeId', array('label' => 'Appriciation Type:', 'class' => 'text-input small-input', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select type')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arr));
     $this->addElement('text', 'appriciationDate', array('label' => 'Date:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter date')))), 'class' => 'text-input small-input', 'readonly' => 'true', 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('textarea', 'remarks', array('label' => 'Remarks:', 'class' => 'text-input textarea address', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter remarks.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('submit', 'submit', array('required' => false, 'class' => 'button', 'ignore' => true, 'label' => 'Submit', 'value' => 'submit', 'decorators' => $this->buttonDecorators));
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:14,代码来源:Appriciation.php

示例14: createAction

 public function createAction()
 {
     //if($this->getRequest()->isPost()){
     //Récupération des données
     $user = new Application_Model_User();
     $user->setIdUser('1')->setEmailUser('billy@orange.fr')->setNomUser('wallace')->setPrenomUser('grommit')->setAdresse1User('1 rue Albert')->setAdresse2User('')->setZipUser('69380')->setPasswordUser('0000')->setNbMaxEmpruntUser('3')->setDelaisEmpruntUser('24')->setServiceUser('')->setDateInscription('27/01/2014')->setBureauUser('')->setParutionIdParution('')->setActifUser('')->setValidMailUser('')->setActivationUser('');
     //Instance du Mapper
     $userMapper = new Application_Model_UserMapper();
     //Save des données
     $userMapper->save($user);
     //Réponse à la vue
     $this->view->success = 'Enregistrement effectué';
     //}
 }
开发者ID:anouvene,项目名称:Zeus,代码行数:14,代码来源:UserController.php

示例15: regAction

 public function regAction()
 {
     $request = $this->getRequest();
     $form = new Application_Form_UserRegistration();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($request->getPost())) {
             $user = new Application_Model_User($form->getValues());
             $user->setUserReg(date('Y-m-d H:i:s', time()))->setUserLastLogin(date('Y-m-d H:i:s', time()));
             $userMapper = new Application_Model_UserMapper();
             $userMapper->save($user);
             return $this->_helper->redirector('index,', 'index');
         }
     }
     $this->view->form = $form;
 }
开发者ID:rguetlin,项目名称:blog,代码行数:15,代码来源:UserController.php


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