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


PHP UserModel::getStates方法代碼示例

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


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

示例1: searchResult

 public static function searchResult()
 {
     require_once 'Search.model.php';
     require_once 'Upload.model.php';
     require_once 'User.model.php';
     $data = array();
     if (isset($_POST['searchProduct'])) {
         $searchProduct = $_POST['searchField'];
         $category = $_POST['category'];
         $state = $_POST['state'];
         $sort = $_POST['sort'];
         $query = SearchModel::searchQuery($searchProduct, $category, $state, $sort);
         try {
             $searchresult = SearchModel::getSearchResult($searchProduct, $category, $state, $sort);
             $data['template'] = 'searchResult.html';
             $data['products'] = $searchresult;
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         } catch (Exception $e) {
             $data['error'] = $e->getMessage();
             $data['template'] = 'error.html';
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         }
     } else {
         $searchCheck = Self::searchCheck();
         $data['redirect'] = 'error.html';
     }
     return $data;
 }
開發者ID:miahellqvist,項目名稱:webbloppis,代碼行數:30,代碼來源:Search.controller.php

示例2: sellerReviews

 public static function sellerReviews($url_parts)
 {
     require_once 'Review.model.php';
     require_once 'User.model.php';
     require_once 'Upload.model.php';
     require_once 'Product.model.php';
     $data = array();
     if (count($url_parts) > 0) {
         $user_id = $url_parts[0];
         try {
             $result = ReviewModel::getSellerReviews($user_id);
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
             $data['reviews'] = $result;
             $data['user_id'] = $user_id;
             $data['template'] = 'userReviews.html';
         } catch (Exception $e) {
             $data['error'] = $e->getMessage();
             $data['template'] = 'error.html';
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         }
         return $data;
     }
 }
開發者ID:miahellqvist,項目名稱:webbloppis,代碼行數:25,代碼來源:Review.controller.php

示例3: emailSent

 public static function emailSent()
 {
     require_once 'Contact.model.php';
     require_once 'User.model.php';
     require_once 'Upload.model.php';
     $data = array();
     if (isset($_POST['send'])) {
         $senderName = htmlentities($_POST['name']);
         $senderEmail = htmlentities($_POST['email']);
         $senderMsg = htmlentities($_POST['message']);
         $subject = $_POST['subject'];
         $sellerEmail = $_POST['sellerEmail'];
         try {
             $result = ContactModel::sendEmailtoSeller($senderName, $senderEmail, $senderMsg, $subject, $sellerEmail);
             $data['template'] = 'emailSuccess.html';
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         } catch (Exception $e) {
             $data['error'] = $e->getMessage();
             $data['template'] = 'error.html';
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         }
     } else {
         $data['redirect'] = '?/User/home';
     }
     return $data;
 }
開發者ID:miahellqvist,項目名稱:webbloppis,代碼行數:28,代碼來源:Contact.controller.php

示例4: upload

 public static function upload()
 {
     require_once 'Upload.model.php';
     require_once 'User.model.php';
     $data['states'] = UserModel::getStates();
     $data['categories'] = UploadModel::getCategories();
     $data['subcategories'] = UploadModel::getSubCategories();
     $data['user'] = UserModel::getPersonalData();
     $data['template'] = 'upload.html';
     return $data;
 }
開發者ID:miahellqvist,項目名稱:webbloppis,代碼行數:11,代碼來源:Upload.controller.php

示例5: personal

 public static function personal()
 {
     require_once 'User.model.php';
     require_once 'Upload.model.php';
     $data['states'] = UserModel::getStates();
     $data['user'] = UserModel::getPersonalData();
     $data['template'] = 'personal.html';
     return $data;
 }
開發者ID:miahellqvist,項目名稱:webbloppis,代碼行數:9,代碼來源:User.controller.php

示例6: personalProduct

 public static function personalProduct($url_parts)
 {
     require_once 'User.model.php';
     require_once 'Upload.model.php';
     require_once 'Product.model.php';
     $data = array();
     if (count($url_parts) > 0) {
         $id = $url_parts[0];
         if (isset($_SESSION['user'])) {
             $user_id = $_SESSION['user']['user_id'];
             $result = ProductModel::getPersonalProduct($id, $user_id);
             if ($result) {
                 $data['states'] = UserModel::getStates();
                 $data['categories'] = UploadModel::getCategories();
                 $data['subcategories'] = UploadModel::getSubcategories();
                 $data['user'] = UserModel::getPersonalData();
                 $data['product'] = $result;
                 $data['template'] = 'personalProduct.html';
             }
         } else {
             $data['redirect'] = '?/User/home';
         }
     }
     return $data;
 }
開發者ID:miahellqvist,項目名稱:webbloppis,代碼行數:25,代碼來源:Product.controller.php


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