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


PHP Ajax::storeSearchResult方法代码示例

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


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

示例1: json_encode

        $result = "";
        $filters = $_POST['filters'];
        require_once APPLICATION_PATH . MODEL_DIR . '/Party.php';
        $party = new Party();
        $result = $party->search($search_term, $filters, $search_type);
    }
}
/**
 * Once a search result has been selected, this gets the rest of the selected user's info
 */
if (isset($_POST['form']) && $_POST['form'] == "get_party_info") {
    if (isset($_POST['party_id'])) {
        require_once APPLICATION_PATH . MODEL_DIR . '/Party.php';
        require_once APPLICATION_PATH . MODEL_DIR . '/Ajax.php';
        $party_id = $_POST['party_id'];
        $result = "";
        $party = new Party();
        $result = $party->preparePartyRecord($party_id);
        $ajax = new Ajax();
        $search_name = $result->party->name;
        $search_id = $result->party->id;
        $result->search_history = $ajax->storeSearchResult('party_search_history', $search_id, $search_name);
    }
}
if (isset($_POST['form']) && $_POST['form'] == "get_search_history") {
    require_once APPLICATION_PATH . MODEL_DIR . '/Ajax.php';
    $ajax = new Ajax();
    $result = $ajax->getSearchHistory($_POST['search_type']);
}
header('Content-Type: application/json');
echo json_encode(array("result" => $result));
开发者ID:kameshwariv,项目名称:testexample,代码行数:31,代码来源:searchParties.php

示例2: Order

if (isset($_POST['form']) && $_POST['form'] == "get_order_info") {
    require_once APPLICATION_PATH . MODEL_DIR . '/Order.php';
    require_once APPLICATION_PATH . MODEL_DIR . '/Ajax.php';
    $order = new Order();
    if (!empty($_POST['shipment_id'])) {
        $param = $_POST['shipment_id'];
        $method = 'shipment_id';
    } elseif (!empty($_POST['order_id'])) {
        $param = $_POST['order_id'];
        $method = 'order_id';
    }
    $result = $order->getOrderRecord($param, $method);
    $ajax = new Ajax();
    $search_name = $result->customer->first_name . ' ' . $result->customer->last_name;
    $search_id = $result->order->id;
    $result->search_history = $ajax->storeSearchResult('order_search_history', $search_id, $search_name);
}
/**
 * Once a search result has been selected, this gets the rest of the selected user's info
 */
if (isset($_POST['form']) && $_POST['form'] == "get_order_id") {
    if (isset($_POST['order_item_id'])) {
        require_once APPLICATION_PATH . MODEL_DIR . '/Order_item.php';
        $order_item_id = $_POST['order_item_id'];
        $result = "";
        $order_item = new Order_item();
        $result = $order_item->getOrderIdById($order_item_id);
    }
}
if (isset($_POST['form']) && $_POST['form'] == "get_search_history") {
    require_once APPLICATION_PATH . MODEL_DIR . '/Ajax.php';
开发者ID:kameshwariv,项目名称:testexample,代码行数:31,代码来源:searchOrders.php


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