本文整理汇总了PHP中table::fetch_data方法的典型用法代码示例。如果您正苦于以下问题:PHP table::fetch_data方法的具体用法?PHP table::fetch_data怎么用?PHP table::fetch_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table
的用法示例。
在下文中一共展示了table::fetch_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_orders
//.........这里部分代码省略.........
if ($err = $tpl_print->parse()) {
$msg = "Error in " . __FUNCTION__ . " - ";
$msg .= 'error: ' . $err . "\n";
error_msg(__FILE__, __LINE__, $msg);
echo nl2br($msg) . "\n";
return ERR_PARSING_TEMPLATE;
}
$tpl_print->restore_curly();
$msg = $tpl_print->getOutput();
$tpl_print->reset_vars();
$output['orders'] = '';
$msg = str_replace("'", "", $msg);
if ($outerr = print_line($destid, $msg)) {
return $outerr;
}
}
if (table_is_takeaway($sourceid)) {
$takeaway_data = takeaway_get_customer_data($sourceid);
$output['takeaway'] = ucfirst(lang_get($dest_language, 'PRINTS_TAKEAWAY')) . " - ";
$output['takeaway'] .= $takeaway_data['takeaway_hour'] . ":" . $takeaway_data['takeaway_minute'] . "\n";
$output['takeaway'] .= $takeaway_data['takeaway_surname'] . "\n";
$tpl_print->assign("takeaway", $output['takeaway']);
}
$output['table'] = ucfirst(lang_get($dest_language, 'PRINTS_TABLE')) . ": " . $tablenum;
$tpl_print->assign("table", $output['table']);
$user = new user($_SESSION['userid']);
$output['waiter'] = ucfirst(lang_get($dest_language, 'PRINTS_WAITER')) . ": " . $user->data['name'];
$tpl_print->assign("waiter", $output['waiter']);
$output['priority'] = ucfirst(lang_get($dest_language, 'PRINTS_PRIORITY')) . ": " . $priority . "\n";
$tpl_print->assign("priority", $output['priority']);
$output['people'] = ucfirst(lang_get($dest_language, 'PRINTS_PEOPLE')) . ": " . table_people_number($sourceid) . "\n";
$tpl_print->assign("people", $output['people']);
$table = new table($sourceid);
$table->fetch_data(true);
if ($cust_id = $table->data['customer']) {
$cust = new customer($cust_id);
$output['customer'] = ucfirst(lang_get($dest_language, 'CUSTOMER')) . ": " . $cust->data['surname'] . ' ' . $cust->data['name'];
$tpl_print->assign("customer_name", $output['customer']);
$output['customer'] = $cust->data['address'];
$tpl_print->assign("customer_address", $output['customer']);
$output['customer'] = $cust->data['zip'];
$tpl_print->assign("customer_zip_code", $output['customer']);
$output['customer'] = $cust->data['city'];
$tpl_print->assign("customer_city", $output['customer']);
$output['customer'] = ucfirst(lang_get($dest_language, 'VAT_ACCOUNT')) . ": " . $cust->data['vat_account'];
$tpl_print->assign("customer_vat_account", $output['customer']);
}
}
$output['orders'] .= printer_print_row($arr, $destid);
$printed_orders[] = $arr['id'];
if ($newassociated_id != $oldassociated_id) {
// if we're in this function, it means that we changed associated_id id
// and also that mods have been printed on the same sheet
if (CONF_PRINT_BARCODES && $arr['dishid'] != MOD_ID) {
$output['orders'] .= print_barcode($newassociated_id);
}
}
if (CONF_PRINT_BARCODES && $arr['dishid'] != MOD_ID) {
$output['orders'] .= print_barcode($newassociated_id);
}
$tpl_print->assign("orders", $output['orders']);
}
$destid = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'dishes', "destid", get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'orders', 'dishid', $newassociated_id));
$dest = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'dests', "dest", $destid);
$destname = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'dests', "name", $destid);
$dest_language = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'dests', "language", $destid);
示例2: orders_list
function orders_list()
{
global $tpl;
// use session to decide wether to show the orders list or not
// TODO: add get_conf here
if (!isset($_SESSION['show_orders_list'])) {
$_SESSION['show_orders_list'] = false;
}
$show_orders = $_SESSION['show_orders_list'];
unset($_SESSION['select_all']);
$_SESSION['go_back_to_cat'] = 0;
$user = new user($_SESSION['userid']);
if (table_is_closed($_SESSION['sourceid']) && !$user->level[USER_BIT_CASHIER]) {
table_closed_interface();
return 0;
}
$_SESSION['order_added'] = 0;
$tpl->set_waiter_template_file('orders');
if (table_is_takeaway($_SESSION['sourceid'])) {
$tpl->set_waiter_template_file('orders_takeaway');
takeaway_form();
}
$table = new table($_SESSION['sourceid']);
$table->fetch_data(true);
if ($cust_id = $table->data['customer']) {
$cust = new customer($cust_id);
$tmp = ucphr('CUSTOMER') . ': ' . $cust->data['surname'];
$tmp .= ' <a href="orders.php?command=customer_search">' . ucphr('EDIT') . '</a>/';
$tmp .= '<a href="orders.php?command=set_customer&data[customer]=0">' . ucphr('REMOVE') . '</a>';
$tmp .= '<br/>';
} else {
$tmp = '<a href="orders.php?command=customer_search">' . ucfirst(phr('INSERT_CUSTOMER_DATA')) . '</a><br/>';
}
$tpl->append('commands', $tmp);
if (!orders_service_fee_exists() && get_conf(__FILE__, __LINE__, 'service_fee_use')) {
$tmp = '<a href="orders.php?command=create&dishid=' . SERVICE_ID . '">' . ucfirst(phr('CREATE_SERVICE_FEE')) . '</a><br/>';
$tpl->append('commands', $tmp);
}
$associated_waiter = table_is_associated();
if (get_conf(__FILE__, __LINE__, "disassociation_allow") && $associated_waiter && ($associated_waiter == $_SESSION['userid'] || $user->level[USER_BIT_CASHIER])) {
$tmp = '<a href="orders.php?command=dissociate">' . ucfirst(phr('DISSOCIATE')) . '</a><br/>';
$tpl->append('commands', $tmp);
}
if ($user->level[USER_BIT_CASHIER]) {
$tmp = '<a href="orders.php?command=ask_move">' . ucfirst(phr('MOVE_TABLE')) . '</a><br/>';
$tpl->append('commands', $tmp);
}
if ($user->level[USER_BIT_CASHIER] && table_is_closed($_SESSION['sourceid'])) {
$tmp = '<a href="orders.php?command=reopen_confirm">' . ucfirst(phr('REOPEN_TABLE')) . '</a><br/>';
$tpl->append('commands', $tmp);
}
if ($_SESSION['show_orders_list'] == false) {
$desc = ucfirst(phr('SHOW_ORDERS'));
} else {
$desc = ucfirst(phr('HIDE_ORDERS'));
}
$tmp = '<a href="orders.php?command=set_show_orders">' . $desc . '</a><br/>';
$tpl->append('commands', $tmp);
$tmp = categories_list();
$tpl->assign('categories', $tmp);
$tmp = letters_list();
$tpl->assign('letters', $tmp);
if (CONF_FAST_ORDER) {
$tmp = order_fast_dishid_form();
$tpl->assign('fast_order_id', $tmp);
} else {
$tmp = keys_orders();
$tpl->append('scripts', $tmp);
}
// use session to decide wether to show the orders list or not
if (!isset($_SESSION['show_toplist'])) {
$_SESSION['show_toplist'] = get_conf(__FILE__, __LINE__, "top_list_show_top");
}
if ($_SESSION['show_toplist']) {
toplist_show();
} elseif (get_conf(__FILE__, __LINE__, "top_list_show_top")) {
$tmp = '<a href="orders.php?command=set_show_toplist">' . ucphr('SHOW_TOPLIST') . '</a><br/>';
$tpl->assign('toplist', $tmp);
}
$tmp = command_bar_table_vertical();
$tpl->assign('vertical_navbar', $tmp);
if ($show_orders) {
$table->list_orders();
}
if (get_conf(__FILE__, __LINE__, "show_summary")) {
$query = "SELECT * FROM `orders`WHERE `sourceid`='" . $_SESSION['sourceid'] . "' AND `id`=`associated_id` ORDER BY `timestamp` DESC LIMIT 1";
$res = common_query($query, __FILE__, __LINE__);
if (!$res) {
return ERR_MYSQL;
}
$arr = mysql_fetch_array($res);
$mods = get_conf(__FILE__, __LINE__, "show_mods_in_summary");
$table->list_orders('last_order', $arr['id'], $mods);
}
return 0;
}
示例3: bill_type_selection
function bill_type_selection($sourceid)
{
/*
sets the bill/invoice type in waiter's session environment
types:
1. bill
2. invoice
3. receipt
*/
for ($i = 1; $i <= 3; $i++) {
$chk[$i] = '';
}
if (isset($_SESSION['type'])) {
$type = $_SESSION['type'];
} else {
$type = 1;
// if type is not set, it automatically sets it to 1;
if (table_is_takeaway($_SESSION['sourceid'])) {
$type = 3;
// if type is not set and table is takeaway type is set to 3;
}
$_SESSION['type'] = $type;
}
// Next is a micro-form to set a discount in percent value
$output = '
<form action="orders.php" NAME="form_type" method=post>
<input type="hidden" name="command" VALUE="bill_print">
<INPUT TYPE="HIDDEN" NAME="keep_separated" VALUE="1">
<div align="center">
' . ucfirst(phr('ACCOUNT')) . ':
<table>
<tr>
<td rowspan="3">' . ucfirst(phr('TYPE')) . ':</td>
<td><input type="radio" name="type" value="1" ' . $chk[1] . '> ' . ucfirst(phr('BILL')) . '</td></tr>
<tr>
<td><input type="radio" name="type" value="2" ' . $chk[2] . '> ' . ucfirst(phr('INVOICE')) . '</td>
</tr>
<tr>
<td><input type="radio" name="type" value="3" ' . $chk[3] . '> ' . ucfirst(phr('RECEIPT')) . '</td>
</tr>
</table>
</div>
</form>
';
$table = new table($_SESSION['sourceid']);
$table->fetch_data(true);
if ($cust_id = $table->data['customer']) {
$cust = new customer($cust_id);
$tmp = ucphr('CUSTOMER') . ': ' . $cust->data['surname'];
$tmp .= ' <a href="orders.php?command=customer_search">' . ucphr('EDIT') . '</a>/';
$tmp .= '<a href="orders.php?command=set_customer&data[customer]=0">' . ucphr('REMOVE') . '</a>';
$tmp .= '<br/>';
} else {
$tmp = '<a href="orders.php?command=customer_search">' . ucfirst(phr('INSERT_CUSTOMER_DATA')) . '</a><br/>';
}
$output .= $tmp;
return $output;
}