require_once APPLICATION_PATH . MODEL_DIR . '/Product.php';
    $result = "";
    $products = new Product('replicated');
    $result = $order->getAllMasterProducts();
    header('Content-Type: application/json');
    echo json_encode(array("result" => $result));
} elseif (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']);
} elseif (isset($_POST['form']) && $_POST['form'] == "get_primary_products") {
    // ! Original replacement order page
    require_once APPLICATION_PATH . MODEL_DIR . '/Product.php';
    $result = "";
    $products = new Product('replicated');
    $result = $products->getPrimaryProducts();
} elseif (isset($_POST['form']) && $_POST['form'] == "get_main_products") {
    // !Original Products page call
    require_once APPLICATION_PATH . MODEL_DIR . '/Product.php';
    $result = "";
    $products = new Product('replicated');
    $result = $products->getMainProducts();
} elseif (isset($_POST['form']) && $_POST['form'] == "get_sub_products") {
    require_once APPLICATION_PATH . MODEL_DIR . '/Product.php';
    $result = "";
    $prod_id = $_POST['prod_id'];
    $products = new Product('replicated');
    $result = $products->getProductSubItems($prod_id);
    #$result['products']		=  $products->getProductSubItems($prod_id);
    #$result['item_types']	= $products->getItemAvailTypes();
} elseif (isset($_POST['form']) && $_POST['form'] == "get_sub_details") {