本文整理汇总了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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}