function customer_search_page($data = array()) { global $tpl; if (customer_recognize($data['surname'])) { return 0; } $tpl->set_waiter_template_file('standard'); $tmp = navbar_empty('orders.php'); $tpl->assign('navbar', $tmp); $tmp = ''; $tmp .= customer_search_form(); $tmp .= ' <a href="orders.php?command=customer_insert_form">' . ucfirst(phr('INSERT_NEW')) . '</a><br> '; $tmp .= customer_list($data['surname']); $tpl->assign('content', $tmp); return 0; }
/** * My Handy Restaurant * * http://www.myhandyrestaurant.org * * My Handy Restaurant is a restaurant complete management tool. * Visit {@link http://www.myhandyrestaurant.org} for more info. * Copyright (C) 2003-2005 Fabio De Pascale * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Fabio 'Kilyerd' De Pascale <*****@*****.**> * @package MyHandyRestaurant * @copyright Copyright 2003-2005, Fabio De Pascale * @copyright Copyright 2006-2012, Gjergj Sheldija */ function printing_choose($from_bill_print = false) { global $tpl; if (!takeaway_is_set($_SESSION['sourceid'])) { $tmp = '<font color="Red">' . ucfirst(phr('SET_TAKEAWAY_SURNAME_FIRST')) . '</font>'; $tpl->append('messages', $tmp); orders_list(); return 0; } $user = new user($_SESSION['userid']); if (table_is_closed($_SESSION['sourceid']) && (!$user->level[USER_BIT_CASHIER] || $from_bill_print)) { table_closed_interface(); return 0; } $tpl->set_waiter_template_file('printing'); $tmp = printing_commands(); $tpl->append('commands', $tmp); $tmp = navbar_empty(); $tpl->assign('navbar', $tmp); }
$tmp['numtables'] = mysql_num_rows($tmp['tableslist']); if ($tmp['numtables'] == 0) { die(GLOBALMSG_DB_NO_TABLES_ERROR); } unset($tmp); if (!common_allowed_ip($_SERVER['REMOTE_ADDR'])) { $error_msg = common_header('IP address not authorized'); $error_msg .= 'IP <b>' . $_SERVER['REMOTE_ADDR'] . '</b> is not authorized.<br/>' . "\n"; $error_msg .= 'IP <b>' . sprintf("%u", ip2long($_SERVER['REMOTE_ADDR'])) . '</b> is not authorized.' . "\n"; $error_msg .= common_bottom(); die($error_msg); } $GLOBALS['cache_var'] = new cache(); if ($res_loc = check_output_files()) { $error_msg = common_header('Output files not writeable'); $error_msg .= navbar_empty(); switch ($res_loc) { case 1: $err = 'error file not writeable.<br>Solution: set write permission for everybody (or at least for the user running the webserver) on file error.log'; break; case 2: $err = 'error dir not writeable<br>Solution: set write permission for everybody (or at least for the user running the webserver) on the directory containing Smart Restaurant files '; break; case 3: $err = 'debug file not writeable.<br>Solution: set write permission for everybody (or at least for the user running the webserver) on file debug.log'; break; case 4: $err = 'debug dir not writeable'; break; } $error_msg .= GLOBALMSG_CONFIG_OUTPUT_FILES_NOT_WRITEABLE . '<br><br>Error #' . $res_loc . ': ' . $err . '<br>' . "\n";
function dish_list($start_data) { global $tpl; $_SESSION['order_added'] = 0; $tpl->set_waiter_template_file('dishlist'); $tmp = navbar_empty(); if (printing_orders_to_print($_SESSION['sourceid'])) { $tmp = navbar_with_printer(); } else { $tmp = navbar_empty(); } $tpl->assign('navbar', $tmp); if (get_conf(__FILE__, __LINE__, "show_summary") && isset($_SESSION['go_back_to_cat']) && $_SESSION['go_back_to_cat']) { $tbl = new table($_SESSION['sourceid']); if ($last_mod = order_get_last_modified()) { $mods = get_conf(__FILE__, __LINE__, "show_mods_in_summary"); $tbl->list_orders('last_order', $last_mod, $mods); } } if (isset($start_data['category'])) { $tmp = dishlist_form_start($back_to_cat); $tpl->assign('formstart', $tmp); $tmp = dishlist_form_end(); $tpl->assign('formend', $tmp); $tmp = dishlist_back_to_cat(); $tpl->assign('back_to_cat', $tmp); $tmp = priority_radio($start_data); $tpl->assign('priority', $tmp); $tmp = quantity_list($start_data); $tpl->assign('quantity', $tmp); $tmp = dishes_list_cat($start_data); $tpl->assign('dishes_list', $tmp); $tmp = keys_dishlist_cat(); $tpl->append('scripts', $tmp); } elseif (isset($start_data['letter'])) { $tmp = dishlist_form_start(false); $tpl->assign('formstart', $tmp); $tmp = dishlist_form_end(); $tpl->assign('formend', $tmp); $tmp = priority_radio($start_data); $tpl->assign('priority', $tmp); $tmp = quantity_list($start_data); $tpl->assign('quantity', $tmp); $tmp = dishes_list_letter($start_data); $tpl->assign('dishes_list', $tmp); $tmp = keys_dishlist_letters(); $tpl->append('scripts', $tmp); } elseif (isset($start_data['search'])) { $tmp = dishlist_form_start(false); $tpl->assign('formstart', $tmp); $tmp = dishlist_form_end(); $tpl->assign('formend', $tmp); $tmp = priority_radio($start_data); $tpl->assign('priority', $tmp); $tmp = quantity_list($start_data); $tpl->assign('quantity', $tmp); $tmp = dishes_list_search($start_data); $tpl->assign('dishes_list', $tmp); $tmp = keys_dishlist_letters(); $tpl->append('scripts', $tmp); } elseif (isset($start_data['idsystem'])) { $tmp = dishlist_form_start(false); $tpl->assign('formstart', $tmp); $tmp = dishlist_form_end(); $tpl->assign('formend', $tmp); $tmp = priority_radio($start_data); $tpl->assign('priority', $tmp); $tmp = quantity_list($start_data); $tpl->assign('quantity', $tmp); $tmp = input_dish_id($start_data); $tpl->assign('dishes_list', $tmp); } else { $tmp = categories_list($start_data); $tpl->assign('categories', $tmp); $tmp = ucfirst(phr('ERROR_NO_CATEGORY_SELECTED')) . "<br/>\n"; $tpl->append('messages', $tmp); } return 0; }
function access_denied_waiter() { global $tpl; $tpl->set_waiter_template_file('question'); $tmp = ' <div id="negative"> <table width="450" cellpadding="0" cellspacing="12"> <tr> <td width="52"><div align="center"><img src="' . IMAGE_NEGATIVE . '" alt="negative" width="18" height="18" /></div></td> <td width="388">' . ucfirst(phr('ACCESS_DENIED')) . '</td> </tr> </table> </div> '; $tpl->append('messages', $tmp); $tmp = navbar_empty('javascript:history.go(-1);'); $tpl->assign('navbar', $tmp); return 0; }
if (isset($_REQUEST['letter']) && $_REQUEST['letter'] == 'ALL') { $letter = 'ALL'; } elseif (isset($_REQUEST['letter'])) { $letter = $_REQUEST['letter'][0]; } else { $letter = ''; } mods_list($start_data, $letter); } break; case 'list': orders_list(); break; case 'ask_move': $tpl->set_waiter_template_file('tables'); $tmp = navbar_empty('javascript:history.go(-1);'); $tpl->assign('navbar', $tmp); $user = new user($_SESSION['userid']); if ($user->level[USER_BIT_CASHIER]) { $cols = get_conf(__FILE__, __LINE__, 'menu_tables_per_row_cashier'); } else { $cols = get_conf(__FILE__, __LINE__, 'menu_tables_per_row_waiter'); } $table = new table($_SESSION['sourceid']); $table->move_list_tables($cols); break; case 'move': $newtable = $start_data['id']; if (!$newtable) { orders_list(); break;
/** * Interface for closed tables * * Template: closed_table.tpl * Assigns: navbar, pay, clear, total. * * @return integer error code */ function table_closed_interface() { global $tpl; if (bill_orders_to_print($_SESSION['sourceid'])) { $_SESSION['select_all'] = 1; $err = bill_select(); if ($err) { error_display($err); } return 0; } $tpl->set_waiter_template_file('closed_table'); $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(); $user = new user($_SESSION['userid']); if ($user->level[USER_BIT_CASHIER]) { $tmp = navbar_empty(); } $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; }