当前位置: 首页>>代码示例>>PHP>>正文


PHP BFCHelper::GetResourcesByIds方法代码示例

本文整理汇总了PHP中BFCHelper::GetResourcesByIds方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::GetResourcesByIds方法的具体用法?PHP BFCHelper::GetResourcesByIds怎么用?PHP BFCHelper::GetResourcesByIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BFCHelper的用法示例。


在下文中一共展示了BFCHelper::GetResourcesByIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: search_availability

function search_availability()
{
    bfi_get_locale();
    if (!isset($_REQUEST['task'])) {
        unset($_SESSION['search.filterparams']);
        setSessionFromSubmittedData();
        $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
        $num_per_page = 20;
        $start = ($page - 1) * $num_per_page;
        $searchmodel = new BookingForConnectorModelSearch();
        $items = $searchmodel->getItems(false, false, $start);
        $items = is_array($items) ? $items : array();
        $total = 0;
        if (!empty($_SESSION['search.results']) && !empty($_SESSION['search.results']['totalresultcount'])) {
            $total = $_SESSION['search.results']['totalresultcount'];
        }
        $pages = ceil($total / $num_per_page);
        $output = '';
        $output = $output . '<div id="bfcmerchantlist"><div id="searchitems" rel="' . htmlspecialchars(json_encode($items)) . '"></div> 
		<div class="resourcetabmenu">
		<a class="resources" rel="resources"><i class="fa fa-list-ul"></i> ' . __('List', 'bfi') . '</a><a id="maptab" class="mappa" rel="mappa"> ' . __('Map', 'bfi') . '</a>
		</div>
		<div class="resourcetabcontainer">
		<div id="resources" class="tabcontent">
		<div class="com_bookingforconnector-merchantlist">';
        echo $output;
        $merchant_ids = '';
        if ($_SESSION['search.params']['merchantResults']) {
            $resource_ids = array();
            if (is_array($items)) {
                $merchant_ids = array();
                foreach ($items as $merchant) {
                    $merchant_ids[] = $merchant->MerchantId;
                }
                $merchant_ids = implode(',', $merchant_ids);
            }
            echo '<div id="idsforajax" rel="' . $merchant_ids . '"></div>';
            include 'templates/search-listing.php';
        } else {
            $resource_ids = array();
            foreach ($items as $resource) {
                $resource_ids[] = $resource->ResourceId;
            }
            $resource_ids = implode(',', $resource_ids);
            echo '<div id="idsforajax" rel="' . $resource_ids . '"></div>';
            include 'templates/search-listing-resources.php';
        }
        $output = '';
        $output = $output . '</div>
		</div>
		<div id="mappa" class="tabcontent">		
		<div id="map_canvassearch" class="searchmap" style="width:100%; min-height:400px"></div>
		</div>';
        $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' => __('&laquo;'), 'next_text' => __('&raquo;'), 'type' => 'plain', 'add_args' => false, 'add_fragment' => '');
        $paginate_links = paginate_links($pagination_args);
        if ($paginate_links) {
            echo "<nav class='custom-pagination'>";
            //		echo "<span class='page-numbers page-num'>Page " . $page . " of " . $numpages . "</span> ";
            echo "<span class='page-numbers page-num'>" . __('Page', 'bfi') . " </span> ";
            print $paginate_links;
            echo "</nav>";
        }
        $output = $output . "</div></div>";
        echo $output;
    } else {
        $task = $_REQUEST['task'];
        if ($task == 'GetMerchantsByIds') {
            $lists = $_REQUEST['merchantsId'];
            $merchants = BFCHelper::getMerchantsByIds($lists, $GLOBALS['bfi_lang']);
            die($merchants);
        } else {
            if ($task == 'getMerchantGroups') {
                $merchantgroups = BFCHelper::getMerchantGroups();
                wp_send_json($merchantgroups);
            } else {
                if ($task == 'GetPhoneByMerchantId') {
                    $merchantId = $_REQUEST['merchantid'];
                    $language = $GLOBALS['bfi_lang'];
                    $phno = BFCHelper::GetPhoneByMerchantId($merchantId, $language);
                    wp_send_json($phno);
                } else {
                    if ($task == 'GetResourcesByIds') {
                        $lists = $_REQUEST['resourcesId'];
                        $language = $GLOBALS['bfi_lang'];
                        $resources = BFCHelper::GetResourcesByIds($lists, $language);
                        @header('Content-Type: application/json; charset=' . get_option('blog_charset'));
                        echo $resources;
                        die;
                    } else {
                        if ($task == 'getmarketinfo') {
                            $base_url = get_site_url();
                            $merchant_id = $_REQUEST['merchantId'];
                            $model = new BookingForConnectorModelMerchantDetails();
                            $merchant = $model->getItem($merchant_id);
                            $output = '<div class="com_bookingforconnector_map_merchantdetails" style="display:block;height:150px;overflow:auto; width: 300px;">
							<div class="com_bookingforconnector_merchantdetails com_bookingforconnector_merchantdetails-t257">
								<h3 style="margin:0;" class="com_bookingforconnector_merchantdetails-name"><a class="com_bookingforconnector_merchantdetails-nameAnchor" href="' . $base_url . '/merchant-details/merchantdetails/' . $merchant->MerchantId . '-' . seoUrl($merchant->Name) . '">' . $merchant->Name . '</a> 
									<br/><span class="com_bookingforconnector_merchantdetails-rating com_bookingforconnector_merchantdetails-rating' . $merchant->Rating . '">
										<span class="com_bookingforconnector_merchantdetails-ratingText">Rating ' . $merchant->Rating . '</span>
//.........这里部分代码省略.........
开发者ID:Bookingfor,项目名称:wordpress-plugin,代码行数:101,代码来源:bfi.php

示例2: GetResourcesByIds

 function GetResourcesByIds()
 {
     $listsId = JRequest::getVar('resourcesId');
     $language = JRequest::getVar('language');
     $return = BFCHelper::GetResourcesByIds($listsId, $language);
     echo $return;
     $app = JFactory::getApplication();
     $app->close();
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:9,代码来源:controller.php


注:本文中的BFCHelper::GetResourcesByIds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。