コード例 #1
0
echo "<h5>District : {$res["District"]}</h5>";
echo "<h5>State : {$res["State"]}</h5>";
echo "<h4>Phone : {$res["Phone"]} </h4>";
echo "<h4>Email : {$res["Email"]} </h4>";
echo "<h4>Pending Amount : {$amt} </h4>";
//BILL RECORDS
$sql = "Select Date,Bill_ID,Amount from bill_record where Cust_ID={$_GET['query']}";
$res = $mysqli->query($sql);
if ($res->num_rows > 0) {
    echo "<h3>Bill Records for {$cname} : </h3>";
    table_bill();
    while ($row = $res->fetch_assoc()) {
        bill_details($row);
    }
    end_table();
} else {
    echo "No Bill Records for {$cname} Yet";
}
//Payment Records
$sql = "Select Date,Payment_ID,Amount from payment_record where Cust_ID={$_GET['query']}";
$res = $mysqli->query($sql);
if ($res->num_rows > 0) {
    echo "<h3>Payment Records for {$cname} : </h3>";
    table_pay();
    while ($row = $res->fetch_assoc()) {
        pay_details($row);
    }
    end_table();
} else {
    echo "No Payment Records for {$cname} Yet";
}
コード例 #2
0
ファイル: orders.php プロジェクト: jaimeivan/smart-restaurant
     table_ask_close();
     break;
 case 'close':
     $err = table_close($_SESSION['sourceid']);
     status_report('CLOSE', $err);
     if (!$err) {
         table_closed_interface();
     } else {
         orders_list();
     }
     break;
 case 'closed':
     table_closed_interface();
     break;
 case 'pay':
     $err = table_pay($start_data['paid']);
     status_report('PAYMENT', $err);
     $err = table_clear();
     status_report('CLEARING', $err);
     table_cleared_interface();
     break;
 case 'clear':
     if (!$err) {
         table_cleared_interface();
     } else {
         table_closed_interface();
     }
     break;
 case 'none':
     break;
 default:
コード例 #3
0
function table_closed_interface_pos()
{
    global $tpl;
    date_default_timezone_set(get_conf(__FILE__, __LINE__, "default_timezone"));
    if (bill_orders_to_print($_SESSION['sourceid'])) {
        $_SESSION['select_all'] = 1;
        $err = bill_select_pos();
        if ($err) {
            error_display($err);
        }
        return 0;
    }
    $tpl->set_waiter_template_file('closed_table_pos');
    $paid = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'sources', "paid", $_SESSION['sourceid']);
    $total = table_total($_SESSION['sourceid']);
    $discount = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'sources', 'discount', $_SESSION['sourceid']);
    if ($total == 0 && $paid == 0) {
        $err = table_pay(1);
        status_report('PAYMENT', $err);
        $paid = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'sources', "paid", $_SESSION['sourceid']);
    }
    $tmp = navbar_tables_only_pos();
    $user = new user($_SESSION['userid']);
    if ($user->level[USER_BIT_CASHIER]) {
        $tmp = navbar_empty_pos();
    }
    $tpl->assign('navbar', $tmp);
    $tmp = '
		' . ucfirst(phr('TABLE_TOTAL_DISCOUNTED')) . ': <b>' . country_conf_currency(true) . ' ' . $total . '</b>
	';
    if ($discount != 0) {
        $discount = sprintf("%01.2f", abs($discount));
        $tmp .= '
		 (' . ucfirst(phr('DISCOUNT')) . ': ' . country_conf_currency(true) . ' ' . $discount . ')';
    }
    $tmp .= '<br />' . "\n";
    $tpl->assign('total', $tmp);
    if ($paid) {
        $tmp = '
		<FORM ACTION="orders.php" METHOD=POST>
		<INPUT TYPE="HIDDEN" NAME="command" VALUE="clear">
		' . ucfirst(phr('PAID_ALREADY')) . '<br/>
		' . ucfirst(phr('EMPTY_TABLE_EXPLAIN')) . '
		<INPUT TYPE="submit" value="' . ucfirst(phr('EMPTY_TABLE_BUTTON')) . '">
		</FORM>
		';
        $tmp .= '<br />' . "\n";
        $tpl->assign('clear', $tmp);
    }
    // user is not allowed to pay, so don't display the button
    if (!access_allowed(USER_BIT_MONEY)) {
        return 0;
    }
    $tmp = '
		<FORM ACTION="orders.php" METHOD=POST>
		<INPUT TYPE="HIDDEN" NAME="command" VALUE="pay">
		' . ucfirst(phr('PAID_ASK')) . '<br/>
		';
    if ($paid) {
        $tmp .= '
		<INPUT TYPE="hidden" name="data[paid]" value="0">
		<INPUT TYPE="submit" value="' . ucfirst(phr('NOT_PAID_BUTTON')) . '">
		<br/><br/>';
    } else {
        $tmp .= '
		<INPUT TYPE="hidden" name="data[paid]" value="1">
		<INPUT TYPE="submit" value="' . ucfirst(phr('PAID_BUTTON')) . '">
		<br/><br/>';
    }
    $tmp .= '
		</FORM>';
    $tmp .= '<br />' . "\n";
    $tpl->assign('pay', $tmp);
    return 0;
}