function printing_choose_pos($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_pos(); return 0; } $tpl->set_waiter_template_file('printing'); $tmp = printing_commands_pos(); $tpl->append('commands', $tmp); $tmp = navbar_empty_pos(); $tpl->assign('navbar', $tmp); }
function customer_recognize($term = '') { global $tpl; $term = trim($term); if (empty($term)) { return 0; } $query = "SELECT * FROM `customers`"; $query .= " WHERE `surname` LIKE '%{$term}%'"; $query .= " OR `phone` LIKE '%{$term}%'"; $query .= " OR `address` LIKE '%{$term}%'"; $query .= " OR `email` LIKE '%{$term}%'"; $query .= " OR `vat_account` LIKE '%{$term}%'"; $query .= " ORDER BY `surname` ASC"; $res = common_query($query, __FILE__, __LINE__); if (!$res) { return 0; } if (mysql_num_rows($res) == 1) { $arr = mysql_fetch_array($res); $data['takeaway_surname'] = $arr['surname']; $data['customer'] = $arr['id']; $err = takeaway_set_customer_data($_SESSION['sourceid'], $data); status_report('TAKEAWAY_DATA', $err); orders_list(); return 1; } return 0; }
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: orders_list(); break; } // this line is already in waiter_start, but it's here repeated because of possible modifications from waiter start till now $tmp = table_people_number_line($_SESSION['sourceid']); $tpl->assign("people_number", $tmp); // html closing stuff and disconnect line $tmp = disconnect_line(); $tpl->assign('logout', $tmp); // prints page generation time $tmp = generating_time($inizio); $tpl->assign('generating_time', $tmp); if ($err = $tpl->parse()) { return $err; } $tpl->clean();
function orders_delete($event, $step) { global $txp_user, $vars, $txpcfg, $prefs; extract($prefs); extract(doSlash($_REQUEST)); if (isset($id)) { $rs = safe_delete('orders', "id = {$id}"); } if ($rs) { orders_list('', '', "Order Deleted"); } else { orders_list("There was an error trying to update the order: " . mysql_error()); } }
function table_ask_association_pos() { global $tpl; if (table_is_takeaway($_SESSION['sourceid'])) { $err = table_associate(); status_report('ASSOCIATION', $err); orders_list(); return 0; } $tpl->set_waiter_template_file('question'); $tmp = ' <table> <tr> <td width=35> <a href="tables.php"><img src="' . IMAGE_MENU . '" alt="' . ucfirst(phr('BACK_TO_TABLES')) . '" border=0></a> </td> <td width=35> </td> <td width=35> </td> <td width=35> </td> <td width=35>'; if (get_conf(__FILE__, __LINE__, "service_fee_use")) { $tmp .= ' <a href="orders.php?command=service_fee"><img src="' . IMAGE_NO . '" alt="' . ucfirst(phr('NO')) . '" border=0></a>'; } else { $tmp .= ' <a href="orders.php"><img src="' . IMAGE_NO . '" alt="' . ucfirst(phr('NO')) . '" border=0></a>'; } $tmp .= ' </td> <td width=35> <a href="orders.php?command=associate"><img src="' . IMAGE_OK . '" alt="' . ucfirst(phr('YES')) . '" border=0></a> </td> </tr> </table> '; $tpl->assign('navbar', $tmp); $tmp = ucfirst(phr('ASSOCIATE_ASK')) . '<br/>' . "\n"; $tpl->assign('question', $tmp); return 0; }