Exemplo n.º 1
0
<?php 
include 'functions.php';
$extension = '/shop/buy-ipad/ipad-air-2';
$products = [["name" => "ipad_air_2_16", "price_key" => 0], ["name" => "ipad_air_2_64", "price_key" => 1], ["name" => "ipad_air_2_128", "price_key" => 2], ["name" => "ipad_air_2_16_cell", "price_key" => 9], ["name" => "ipad_air_2_64_cell", "price_key" => 10], ["name" => "ipad_air_2_128_cell", "price_key" => 11]];
foreach ($countries as $country) {
    foreach ($products as $product) {
        get_prices($extension, $country[country], $country[abbr], $country[decimals], $product[name], $product[price_key]);
    }
}
Exemplo n.º 2
0
        } elseif ($input_error != 1) {
            add_item_price($_POST['stock_id'], $_POST['sales_type_id'], $_POST['curr_abrev'], input_num('price'), input_num('factor'));
            display_note(tr("The new price has been added."));
        }
        clear_data();
    }
}
//------------------------------------------------------------------------------------------------------
if (isset($_GET['delete'])) {
    //the link to delete a selected record was clicked
    delete_item_price($_GET['PriceID']);
    echo tr("The selected price has been deleted.");
}
//---------------------------------------------------------------------------------------------------
$mb_flag = get_mb_flag($_POST['stock_id']);
$prices_list = get_prices($_POST['stock_id']);
start_table("{$table_style} width=30%");
$th = array(tr("Currency"), tr("Sales Type"), tr("Price"), tr("Factor"), "", "");
table_header($th);
$k = 0;
//row colour counter
while ($myrow = db_fetch($prices_list)) {
    alt_table_row_color($k);
    label_cell($myrow["curr_abrev"]);
    label_cell($myrow["sales_type"]);
    amount_cell($myrow["price"]);
    amount_cell($myrow["factor"]);
    edit_link_cell("PriceID=" . $myrow["id"] . "&Edit=1");
    delete_link_cell("PriceID=" . $myrow["id"] . "&delete=yes");
    end_row();
}
Exemplo n.º 3
0
             $_SESSION['stop4'] = $stop['prices']['1']['high_estimate'];
         }
     }
 }
 if (!empty($_POST['end4']) && !empty($_POST['end5'])) {
     $stop = get_prices($_POST['end4'], $_POST['end5']);
     if (isset($_POST['car']) && $_POST['car'] == 'uberx') {
         $_SESSION['stop5'] = $stop['prices']['0']['high_estimate'];
     } else {
         if (isset($_POST['car']) && $_POST['car'] == 'uberxl') {
             $_SESSION['stop5'] = $stop['prices']['1']['high_estimate'];
         }
     }
 }
 if (!empty($_POST['end5']) && !empty($_POST['end6'])) {
     $stop = get_prices($_POST['end5'], $_POST['end6']);
     if (isset($_POST['car']) && $_POST['car'] == 'uberx') {
         $_SESSION['stop6'] = $stop['prices']['0']['high_estimate'];
     } else {
         if (isset($_POST['car']) && $_POST['car'] == 'uberxl') {
             $_SESSION['stop6'] = $stop['prices']['1']['high_estimate'];
         }
     }
 }
 $_SESSION['total'] = 0;
 if (isset($_SESSION['stop1'])) {
     $_SESSION['total'] += $_SESSION['stop1'];
 }
 if (isset($_SESSION['stop2'])) {
     $_SESSION['total'] += $_SESSION['stop2'];
 }
<?php

if (!isset($_GET['cmd'])) {
    exit;
}
switch ($_GET['cmd']) {
    case 0:
        get_barcodes();
        break;
    case 1:
        get_product_names();
        break;
    case 2:
        get_prices();
        break;
    case 3:
        add_transaction();
        break;
    default:
        break;
}
function get_barcodes()
{
    include_once 'product.php';
    $obj = new product();
    if (!$obj->connect()) {
        $json = 'connection error';
        echo $json;
        exit;
    }
    if ($obj->get_products()) {