Пример #1
0
}
if (isset($_GET['val']) || isset($_GET['coin'])) {
    //only come here from a get call for the xml
    header('Content-Type:text/xml; charset="utf8"');
    if (!isset($_SESSION)) {
        session_start();
    }
    require_once "config.php";
    require_once "database.php";
    //require_once 'fb.php';
    if (isset($_GET['val'])) {
        $val = $_GET['val'];
    } else {
        $val = '0';
    }
    if (isset($_GET['coin'])) {
        $coin = $_GET['coin'];
    } else {
        $coin = '0';
    }
    $newval = getRounding($val, $coin);
    //FB::log($newval, "Rounding.php newval=");
    echo '<?xml version="1.0" encoding="utf8" ?>';
    ?>

    <value><?php 
    echo $newval;
    ?>
</value>
<?php 
}
Пример #2
0
    <body onload="focus()">
        <?php 
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    die('For the sale window you need to have a valid sale transaction number. it should take the form of sale.php?id=3456');
} else {
    $sql = "select * from sales where id=" . $_GET['id'];
    $result = $db->query($sql);
    if ($result) {
        $sales_info = $db->fetchAssoc($result);
    } else {
        die("sale.php died with sql= {$sql}");
    }
    if (!$quote) {
        $pmtp = unserialize(base64_decode($sales_info['paid_with']));
        // this was changed to avoid issue character encoding http://davidwalsh.name/php-serialize-unserialize-issues
        $change = getRounding(abs($pmtp['remainder']));
        $changeout = number_format($change, 2);
        unset($pmtp['remainder']);
        unset($pmtp['id']);
        unset($pmtp['total']);
        unset($pmtp['cost']);
        unset($pmtp['smallcoin']);
        $payment = "Payment received=";
        foreach ($pmtp as $key => $val) {
            if ($key === "voucherref" || $key === "accountref") {
                $payment .= strtoupper($key) . " : " . $val . ". ";
            } else {
                $payment .= strtoupper($key) . " : \$" . money_format('%i', $val) . ". ";
            }
        }
        $payment .= "Change given : \$" . $changeout;
Пример #3
0
    ?>
images/account.png) no-repeat top right;height:32px;">Account</td><td class="pmtd"><input name="account" id="account" class="price" type="text" onkeypress="return isCurrencyKey(event);" value="<?php 
    echo isset($_POST['account']) ? $_POST['account'] : '';
    ?>
"/></td><td><input type="button" id="accountall" onclick="allt('account');" value="All" title="Pay all on Account. Hotkey alt-x"/></td><td class="pmtd"><input name="accountref" type="text"  value="<?php 
    echo isset($_POST['accountref']) ? $_POST['accountref'] : '';
    ?>
"/></td></tr>
                        <tr class="pmtr"><td class="pmtd"style="background:url(<?php 
    echo $themepath;
    ?>
images/cash.png) no-repeat top right;height:32px;">Cash</td><td class="pmtd"><input name="cash" id="cash" class="price" type="text" onkeypress="return isCurrencyKey(event);"value="<?php 
    echo isset($_POST['cash']) ? $_POST['cash'] : '';
    ?>
" /></td><td><input type="button" id="cashall" onclick="allt('cash');" value="All" title="Pay all on Cash. Hotkey alt-c"/></td><td><label>&Lt; Rounded value:$</label><label id="cashlabel"><?php 
    print getRounding($cost, 0);
    ?>
</label></td></tr>
                        <tr class="pmtr"><td class="pmtd" style="background:url(<?php 
    echo $themepath;
    ?>
images/cheque.png) no-repeat top right;height:32px;">Cheque</td><td class="pmtd"><input name="cheque" id="cheque" class="price" type="text" onkeypress="return isCurrencyKey(event);"value="<?php 
    echo isset($_POST['cheque']) ? $_POST['cheque'] : '';
    ?>
" /></td><td><input type="button" id="chequeall" onclick="allt('cheque');" value="All" title="Pay all on Cheque. Hotkey alt-q"/></td></tr>
                        <tr class="pmtr"><td class="pmtd" style="background:url(<?php 
    echo $themepath;
    ?>
images/laybuy.png) no-repeat top right;height:32px;">Laybuy</td><td class="pmtd"><input name="laybuy" id="laybuy" class="price" type="text" onkeypress="return isCurrencyKey(event);"value="<?php 
    echo isset($_POST['laybuy']) ? $_POST['laybuy'] : '';
    ?>