Exemple #1
0
</div>  <!-- noteTxt -->
</td></tr><tr><td colspan=2 class="tblHeader">
<h3>Tax</h3></td></tr>
<tr><td colspan=2>
<p><i>Provided tax rates are used to create database views. As such,
descriptions should be DB-legal syntax (e.g., no spaces). A rate of
0% with ID 0 is automatically included. Enter exact values - e.g.,
0.05 to represent 5%.</i></p></td></tr>
<tr><td colspan=2>
<?php 
$rates = array();
if ($gotDBs == 2) {
    $sql = new \COREPOS\pos\lib\SQLManager(CoreLocal::get('localhost'), CoreLocal::get('DBMS'), CoreLocal::get('tDatabase'), CoreLocal::get('localUser'), CoreLocal::get('localPass'));
    if (CoreLocal::get('laneno') == 0 && CoreLocal::get('laneno') !== '') {
        // server-side rate table is in op database
        $sql = new \COREPOS\pos\lib\SQLManager(CoreLocal::get('localhost'), CoreLocal::get('DBMS'), CoreLocal::get('pDatabase'), CoreLocal::get('localUser'), CoreLocal::get('localPass'));
    }
    if ($sql->table_exists('taxrates')) {
        $ratesR = $sql->query("SELECT id,rate,description FROM taxrates ORDER BY id");
        while ($row = $sql->fetch_row($ratesR)) {
            $rates[] = array($row[0], $row[1], $row[2]);
        }
    }
}
echo "<table><tr><th>ID</th><th>Rate</th><th>Description</th></tr>";
foreach ($rates as $rate) {
    printf("<tr><td>%d</td><td><input type=text name=TAX_RATE[] value=\"%f\" /></td>\n        <td><input type=text name=TAX_DESC[] value=\"%s\" /></td></tr>", $rate[0], $rate[1], $rate[2]);
}
printf("<tr><td>(Add)</td><td><input type=text name=TAX_RATE[] value=\"\" /></td>\n    <td><input type=text name=TAX_DESC[] value=\"\" /></td></tr></table>");
?>
</td></tr><tr><td colspan=2 class="submitBtn">
Exemple #2
0
body {
    line-height: 1.5em;
}
</style>
</head>
<body>
<?php 
include 'tabs.php';
?>
<div id="wrapper">
<h2>IT CORE Lane Installation: Sample Data</h2>

<form action=extra_data.php method=post>
<div class="alert success"><b>
<?php 
$db = new \COREPOS\pos\lib\SQLManager(CoreLocal::get('localhost'), CoreLocal::get('DBMS'), CoreLocal::get('pDatabase'), CoreLocal::get('localUser'), CoreLocal::get('localPass'));
if (isset($_REQUEST['employees'])) {
    echo "Loading employees";
    $db->query("TRUNCATE TABLE employees");
    InstallUtilities::loadSampleData($db, 'employees');
} elseif (isset($_REQUEST['custdata'])) {
    echo "Loading custdata";
    $db->query("TRUNCATE TABLE custdata");
    InstallUtilities::loadSampleData($db, 'custdata');
} elseif (isset($_REQUEST['products'])) {
    echo "Loading products";
    $db->query("TRUNCATE TABLE products");
    InstallUtilities::loadSampleData($db, 'products');
} elseif (isset($_REQUEST['tenders'])) {
    echo "Loading tenders";
    $db->query("TRUNCATE TABLE tenders");