示例#1
0
        $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));
示例#2
0
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';