function customer_edit_page($data)
{
    global $tpl;
    $tpl->set_waiter_template_file('standard');
    $tmp = navbar_form('form1', 'orders.php');
    $tpl->assign('navbar', $tmp);
    $tmp = '';
    $tmp .= customer_edit_form($data);
    $tpl->assign('content', $tmp);
    return 0;
}
function orders_edit($start_data, $fee_destroyer = false)
{
    global $tpl;
    $tpl->set_waiter_template_file('edit');
    $ordid = (int) $start_data['id'];
    $ord = new order($ordid);
    if (!$ord->exists()) {
        return ERR_ORDER_NOT_FOUND;
    }
    if ($fee_destroyer) {
        $tmp = navbar_form('form1', 'orders.php?command=delete&data[silent]=1&data[id]=' . $start_data['id']);
    } else {
        $tmp = navbar_trash('form1', 'orders.php?command=list', $start_data);
    }
    $tpl->assign('navbar', $tmp);
    orders_edit_printed_info($ord);
    if ($ord->data['dishid'] != SERVICE_ID) {
        orders_edit_substitute($ord);
    }
    if ($ord->data['dishid'] != SERVICE_ID && $ord->data['printed']) {
        $tmp = navbar_trash('', 'orders.php?command=list', $start_data);
        $tpl->assign('navbar', $tmp);
        return 0;
    }
    orders_edit_form($ord);
    orders_edit_quantity($ord);
    orders_edit_dish_name($ord);
    if ($ord->data['dishid'] == SERVICE_ID) {
        return 0;
    }
    orders_edit_priority($ord);
    orders_edit_extra_care($ord);
    orders_edit_suspend($ord);
    return 0;
}
function mods_list($start_data, $letter = '')
{
    global $tpl;
    $_SESSION['order_added'] = 0;
    $tpl->set_waiter_template_file('modslist');
    $tmp = navbar_form('form1', 'orders.php?command=list');
    $tpl->assign('navbar', $tmp);
    $tmp = (int) $start_data['id'];
    if (!($ord = new order($tmp))) {
        return 1;
    }
    $tmp = mods_form_start($ord);
    $tpl->assign('form_start', $tmp);
    $tmp = "</FORM>\n";
    $tpl->assign('form_end', $tmp);
    $tmp = mods_quantity($ord);
    $tpl->assign('mod_quantity', $tmp);
    $tmp = mods_letter_list($ord);
    $tpl->assign('mod_letters', $tmp);
    $tmp = mods_key_binds($ord);
    $tpl->append('scripts', $tmp);
    $ord->ingredients_arrays();
    if (!empty($ord->ingredients['contained'])) {
        $tmp = mods_list_delete($ord);
        $tpl->assign('delete_list', $tmp);
    }
    if (!empty($ord->ingredients['available'])) {
        $tmp = mods_list_add($ord, $letter);
        $tpl->assign('add_list', $tmp);
    }
}
function bill_reset_confirm()
{
    global $tpl;
    $tpl->set_waiter_template_file('question');
    $tmp = navbar_form('form1', 'orders.php?command=printing_choose');
    $tpl->assign('navbar', $tmp);
    $tmp = ucfirst(phr('RESET_SEPARATED_EXPLAIN')) . '
		<br>
		<br><br>

	<FORM ACTION="orders.php" METHOD=POST name="form1">
	<INPUT TYPE="HIDDEN" NAME="command" VALUE="bill_reset">
	<INPUT TYPE="checkbox" name="reset" value="1">
	' . ucfirst(phr('RESET_SEPARATED')) . '<br><br>
	</FORM>
	';
    $tpl->assign('question', $tmp);
    return 0;
}
/**
* Table reopening confirmation page
*
* Template: question.tpl
* Assigns: question, navbar.
*
* @return integer error code
*/
function table_reopen_confirm()
{
    global $tpl;
    $tpl->set_waiter_template_file('question');
    $tmp = '
	<FORM ACTION="orders.php" METHOD=POST name="form1">
	<INPUT TYPE="HIDDEN" NAME="command" VALUE="reopen">
	' . ucfirst(phr('REOPEN_TABLE_ASK')) . '
	</FORM>
	';
    $tpl->assign('question', $tmp);
    $tmp = navbar_form('form1', 'orders.php?command=none');
    $tpl->assign('navbar', $tmp);
    return 0;
}