本文整理汇总了PHP中BFCHelper::GetResourcesOnSellByIds方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::GetResourcesOnSellByIds方法的具体用法?PHP BFCHelper::GetResourcesOnSellByIds怎么用?PHP BFCHelper::GetResourcesOnSellByIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::GetResourcesOnSellByIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: accommodationdetails_merchantdetails_sales
function accommodationdetails_merchantdetails_sales($merchant_name)
{
$parts = explode('-', $merchant_name);
$merchant_id = $parts[0];
$model = new BookingForConnectorModelMerchantDetails();
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$num_per_page = 20;
$total = $model->getTotalOnSellUnits($merchant_id);
$pages = ceil($total / $num_per_page);
$start = ($page - 1) * $num_per_page;
$merchant = $model->getItem($merchant_id);
$onsellunits = $model->getItems('onsellunits', $start, $merchant_id);
$resource_ids = array();
if (isset($onsellunits) && !empty($onsellunits)) {
foreach ($onsellunits as $resource) {
$resource_ids[] = $resource->ResourceId;
}
}
$resource_ids = implode(',', $resource_ids);
$url = $_SERVER['REQUEST_URI'];
$pagination_args = array('base' => $url . '%_%', 'format' => '&page=%#%', 'total' => $pages, 'current' => $page, 'show_all' => false, 'end_size' => 5, 'mid_size' => 2, 'prev_next' => true, 'prev_text' => __('«'), 'next_text' => __('»'), 'type' => 'plain', 'add_args' => false, 'add_fragment' => '');
$output = '';
$paginate_links = paginate_links($pagination_args);
if ($paginate_links) {
$output = $output . "<nav class='custom-pagination'>";
// $output = $output. "<span class='page-numbers page-num'>Page " . $page . " of " . $numpages . "</span> ";
$output = $output . "<span class='page-numbers page-num'>" . __('Page', 'bfi') . " </span> ";
$output = $output . $paginate_links;
$output = $output . "</nav>";
}
$output = $output . '<div id="idsforajax" rel="' . $resource_ids . '"></div>';
$output = $output . '<div id="ajaxurl" rel="' . get_site_url() . '/merchant-details/sales/' . $merchant_name . '"></div>';
if (!isset($_REQUEST['task'])) {
include 'templates/onsellunits.php';
echo $output;
} else {
if (isset($_REQUEST['task']) && $_REQUEST['task'] == 'GetResourcesOnSellByIds') {
$language = $_REQUEST['language'];
$listsId = $_REQUEST['resourcesId'];
$return = BFCHelper::GetResourcesOnSellByIds($listsId, $language);
@header('Content-Type: application/json; charset=' . get_option('blog_charset'));
echo $return;
die;
}
}
}
示例2: GetResourcesOnSellByIds
function GetResourcesOnSellByIds()
{
$listsId = JRequest::getVar('resourcesId');
$language = JRequest::getVar('language');
$return = BFCHelper::GetResourcesOnSellByIds($listsId, $language);
echo $return;
$app = JFactory::getApplication();
$app->close();
}