Ejemplo n.º 1
0
*/
$lang_tables[] = 'pharmacy.php';
define('NO_2LEVEL_CHK', 1);
require $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/care_api_classes/class_tz_pharmacy.php';
$debug = FALSE;
$product_obj = new Product();
if ($debug) {
    function print_debug_info($name, $value)
    {
        if (isset($value)) {
            echo $name . " is set to value: " . $value . "<br>";
        }
    }
    print_debug_info("Search pattern", $keyword);
    print_debug_info("Category", $category);
}
// prepare the category-select box:
$classfication_options = '';
$all_cassifications_array = $product_obj->get_all_categories();
while ($classification_array = $all_cassifications_array->FetchRow()) {
    if ($category == $classification_array[0]) {
        $classfication_options = $classfication_options . "<option selected>" . $classification_array[0] . "</option>\n";
    } else {
        $classfication_options = $classfication_options . "<option>" . $classification_array[0] . "</option>\n";
    }
}
if (!empty($keyword) || !empty($category)) {
    // We have work...
    if (empty($keyword)) {
        $keyword = "*";
Ejemplo n.º 2
0
        }
    }
    print_debug_info("mode", $mode);
    print_debug_info("Peadric check box", $is_peadric);
    print_debug_info("Adult check box", $is_adult);
    print_debug_info("Other check box", $is_other);
    print_debug_info("Consumable check box", $is_consumable);
    print_debug_info("Part Code", $part_code);
    print_debug_info("Items full description", $items_full_description);
    print_debug_info("Item classification", $item_classification);
    print_debug_info("Item Sub Category", $item_subclass);
    print_debug_info("Selian Item number", $selian_item_number);
    print_debug_info("Pack size", $pack_size);
    print_debug_info("Selians Item Description", $selians_item_description);
    print_debug_info("Price", $selians_item_price);
    print_debug_info("mode", $mode);
}
// Endable db-debugging if variable debug is true
$debug ? $db->debug = TRUE : ($db->debug = FALSE);
$product_obj = new Product();
$product_obj->usePriceDescriptionTable();
/*
 * Seciton to read out the Configuration of price accounts
 */
$allItems = $product_obj->getAllDataObject();
$index = 0;
while ($row = $allItems->FetchRow()) {
    $short[$index] = $row['ShowDescription'];
    $long[$index] = $row['FullDescription'];
    $is_insurance[$index] = $row['is_insurance_price'];
    $timestamp = $row['last_change'];
Ejemplo n.º 3
0
*magohe Iddy M iddy85@gmail.com
* See the file "copy_notice.txt" for the licence notice
*/
$lang_tables[] = 'pharmacy.php';
define('NO_2LEVEL_CHK', 1);
require $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/care_api_classes/class_tz_pharmacy.php';
$debug = false;
if ($debug) {
    function print_debug_info($name, $value)
    {
        if (isset($value)) {
            echo $name . " is set to value: " . $value . "<br>";
        }
    }
    print_debug_info("Search pattern", $keyword);
}
if (!empty($keyword)) {
    // We have work...
    $product_obj = new Product();
    if ($keyword == "*") {
        $search_results = $product_obj->get_all_items();
    } else {
        if ($category == "category") {
            //echo $keyword=$category1;
            $search_results = $product_obj->get_all_items_in_category($Keyword);
        } else {
            $search_results = $product_obj->get_array_search_results($keyword, $category);
        }
    }
    $number_of_search_results = $search_results->RecordCount();
function call_api_server($method, $endpoint, $data)
{
    global $key, $secret;
    $time = time();
    $nonce = rand();
    if ($method == Method::POST) {
        assert('$data != NULL /* @@@@ POST requires $data @@@@ */');
    } elseif ($method == Method::GET || $method == Method::DELETE) {
        assert('$data == NULL /* @@@ GET and DELETE take no $data @@@ */');
    }
    $path = $endpoint;
    // if present, concatenate encoded json to $endpoint for Signature:
    if ($data != NULL) {
        $json = json_encode($data);
        $path .= $json;
    }
    $authorization = "key=" . $key . ",timestamp=" . $time . ",nonce=" . $nonce;
    $signature = hash_hmac('sha256', $authorization . $path . $body, $secret);
    $headers = build_headers($authorization, $signature);
    print_debug_info($method, $endpoint, $headers);
    invoke_curl($method, $endpoint, $headers, $json);
}