예제 #1
0
$BUCKYS_GLOBALS['content'] = 'trade/traded';
$BUCKYS_GLOBALS['headerType'] = 'trade';
$paramCurrentPage = get_secure_integer($_REQUEST['page']);
$paramType = get_secure_string($_REQUEST['type']);
$view = array();
$baseURL = '/trade/traded.php';
if ($paramType == 'history') {
    $baseURL .= '?type=' . $paramType;
} else {
    $paramType = 'completed';
}
//Get offer_received info
$tradeIns = new BuckysTrade();
$countryIns = new BuckysCountry();
$view['trades'] = $tradeIns->getTradesByUserID($userID, $paramType);
$view['trades'] = buckys_trade_pagination($view['trades'], $baseURL, $paramCurrentPage, TRADE_ROWS_PER_PAGE);
$view['myID'] = $userID;
switch ($paramType) {
    case 'history':
        $view['pagetitle'] = 'Trade History';
        break;
    case 'completed':
    default:
        $view['pagetitle'] = 'Completed Trades';
        //Mark the activity (offer received) as read
        $tradeNotificationIns = new BuckysTradeNotification();
        $tradeNotificationIns->markAsRead($userID, BuckysTradeNotification::ACTION_TYPE_OFFER_ACCEPTED);
        break;
}
$BUCKYS_GLOBALS['title'] = $view['pagetitle'] . ' - BuckysRoomTrade';
require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
예제 #2
0
<?php

require dirname(dirname(__FILE__)) . '/includes/bootstrap.php';
if (!($userID = buckys_is_logged_in())) {
    buckys_redirect('/index.php', MSG_NOT_LOGGED_IN_USER, MSG_TYPE_ERROR);
}
buckys_enqueue_stylesheet('trade.css');
buckys_enqueue_javascript('trade.js');
$BUCKYS_GLOBALS['content'] = 'trade/offer_received';
$BUCKYS_GLOBALS['headerType'] = 'trade';
$paramCurrentPage = get_secure_integer($_REQUEST['page']);
$paramTargetID = get_secure_integer($_REQUEST['targetID']);
$view = array();
//Get offer_received info
$tradeOfferIns = new BuckysTradeOffer();
$view['offers'] = $tradeOfferIns->getOfferReceived($userID, $paramTargetID);
$view['offers'] = buckys_trade_pagination($view['offers'], '/trade/offer_received.php', $paramCurrentPage, TRADE_ROWS_PER_PAGE);
$BUCKYS_GLOBALS['title'] = 'Offer Received - BuckysRoomTrade';
//Mark the activity (offer received) as read
$tradeNotificationIns = new BuckysTradeNotification();
$tradeNotificationIns->markAsRead($userID, BuckysTradeNotification::ACTION_TYPE_OFFER_RECEIVED);
$tradeOfferIns->markAsRead($userID, BuckysTradeOffer::STATUS_OFFER_ACTIVE);
require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
예제 #3
0
$paramCategory = get_secure_string($_REQUEST['cat'], true);
$paramLocation = get_secure_string($_REQUEST['loc'], true);
$paramSort = get_secure_string($_REQUEST['sort']);
$paramUserID = get_secure_integer($_REQUEST['user']);
$view = array();
//Get available items
$tradeItemIns = new BuckysTradeItem();
$countryIns = new BuckysCountry();
$tradeCatIns = new BuckysTradeCategory();
$itemResultList = $tradeItemIns->search($paramQueryStr, $paramCategory, $paramLocation, $paramUserID);
$itemResultList = $tradeItemIns->sortItems($itemResultList, $paramSort);
$view['categoryList'] = $tradeItemIns->countItemInCategory($itemResultList);
//Create Base URL for pagination of search page
$paginationUrlBase = buckys_trade_search_url($paramQueryStr, $paramCategory, $paramLocation, $paramSort, $paramUserID);
//Display
$view['items'] = buckys_trade_pagination($itemResultList, $paginationUrlBase, $paramCurrentPage, TRADE_ROWS_PER_PAGE);
$view['param']['q'] = $paramQueryStr;
$view['param']['cat'] = $paramCategory;
$view['param']['loc'] = $paramLocation;
$view['param']['sort'] = $paramSort;
$view['param']['user'] = $paramUserID;
$BUCKYS_GLOBALS['tradeSearchParam'] = $view['param'];
$view['countryList'] = $countryIns->getCountryList();
if ($paramQueryStr != '') {
    $BUCKYS_GLOBALS['title'] = $paramQueryStr . ' - BuckysRoomTrade Search';
} else {
    if ($paramCategory != '') {
        $BUCKYS_GLOBALS['title'] = $paramCategory . ' - BuckysRoomTrade Search';
    } else {
        if ($paramUserID != '' && is_numeric($paramUserID)) {
            $userIns = new BuckysUser();