當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。