'', 'name' => '', 'email' => '', 'phone' => '', 'address' => '', 'notes' => '' ]; $editing = false; if (!empty($VARS['id'])) { if ($database->has('customers', ['customerid' => $VARS['id']])) { $editing = true; $custdata = $database->get( 'customers', [ 'customerid (id)', 'name', 'email', 'phone', 'address', 'notes' ], [ 'customerid' => $VARS['id'] ]); } else { // customer id is invalid, redirect to a version of the page that won't // cause an error when pressing Save header('Location: app.php?page=editcustomer'); die(); } } $pricing = []; if ($editing) { $pricing = $database->select('customer_pricing', ['itemid', 'price'], ['customerid' => $custdata['id']]); for ($i = 0; $i < count($pricing); $i++) { $pricing[$i]['item'] = $binstack->get('items', ['itemid', 'name', 'code1', 'code2', 'cost', 'price'], ['itemid' => $pricing[$i]['itemid']]); } } ?>

build("editing customer", ['name' => "" . htmlspecialchars($custdata['name']) . ""]); ?> get("adding customer"); ?>


get("customer pricing"); ?>
get("add price"); ?>
get('actions'); ?> get("item"); ?> get("cost"); ?> get("normal price"); ?> get("customer price"); ?>
get("delete"); ?>