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