本文整理汇总了PHP中table::get方法的典型用法代码示例。如果您正苦于以下问题:PHP table::get方法的具体用法?PHP table::get怎么用?PHP table::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table
的用法示例。
在下文中一共展示了table::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: table
function table_row_pos($arr)
{
$output = '';
$tbl = new table($arr['sourceid']);
$toclose = $tbl->get('toclose');
$dish = new dish($arr['dishid']);
$dishname = $dish->name($_SESSION['language']);
if (!$arr['deleted'] && $arr['printed'] != NULL && CONF_TIME_SINCE_PRINTED) {
$ordid = (int) $arr['id'];
$ord = new order($ordid);
$dishname .= ' (' . orders_print_elapsed_time($ord, true) . ')';
unset($ord);
}
$generic = $dish->get('generic');
$deleted = $arr['deleted'];
$orderid = $arr['id'];
if ($arr['dishid'] == MOD_ID) {
// first we clean the ingredient id from + and -
$modingred = $arr['ingredid'];
// then we find the ingredient name
$ingr = new ingredient($modingred);
$moddeddishname = $ingr->name($_SESSION['language']);
// say if it's added or subtracted
if ($arr['operation'] == 1) {
$dishname = "" . ucfirst(phr('PLUS'));
} elseif ($arr['operation'] == -1) {
$dishname = "" . ucfirst(phr('MINUS'));
} elseif ($arr['operation'] == 0) {
$dishname = "";
}
// and finally consider any optional info (lot/few)
if ($arr['ingred_qty'] == 1) {
$dishname .= '<img src="' . IMAGE_PLUS . '" height="16" width="16" border="0">';
} elseif ($arr['ingred_qty'] == -1) {
$dishname .= '<img src="' . IMAGE_MINUS . '" height="16" width="16" border="0">';
}
$dishname .= " " . $moddeddishname;
// gets the original ingred price (from ingreds table)
// if the original price is 0 and the actual price is 0
// then it means that the ingred has passed through the autocalc system
// and we let the waiter know this, so he could check the prices.
$modingredprice = $ingr->get('price');
//$modingredprice=get_db_data(__FILE__,__LINE__,$_SESSION['common_db'],"ingreds","price",$modingred);
if ($modingredprice == 0 && $arr['price'] != 0) {
$dishname .= "(auto)";
}
}
if ($arr['dishid'] == SERVICE_ID) {
$dishname = ucfirst(phr('SERVICE_FEE'));
}
$classpriority = order_priority_class($arr['priority']);
$oextra = order_extra_msg($arr['extra_care']);
$class = order_printed_class($arr['printed'], $arr['suspend']);
if (CONF_COLOUR_PRINTED && $arr['printed'] && !$arr['deleted']) {
$classtime = order_print_time_class($arr['id']);
if (!$classtime) {
$classtime = $class;
}
} else {
$classtime = $class;
}
$classextra = order_extra_class($arr['extra_care'], $class);
// row begins
$output .= '<tr>';
// quantity cell
if ($deleted && $arr['dishid'] != MOD_ID) {
$output .= '<td><s>' . $arr['quantity'] . '</s></td>';
} elseif (!$deleted && $arr['dishid'] != MOD_ID) {
$output .= '<td><strong>' . $arr['quantity'] . '</strong></td>';
} else {
$output .= '<td> </td>';
}
// mods cell
if ($deleted && $arr['dishid'] != MOD_ID) {
$output .= '';
} elseif (!$deleted && $arr['printed'] == NULL && $arr['dishid'] != MOD_ID && $arr['dishid'] != SERVICE_ID) {
$link = 'orders.php?command=listmods&data[id]=' . $arr['associated_id'];
}
// Name of the dish
if ($deleted) {
$output .= '<td><s>' . $dishname . '</s></td>';
} else {
if (!$deleted && $arr['printed'] == NULL && $arr['dishid'] != MOD_ID && $arr['dishid'] != SERVICE_ID) {
$link = 'orders.php?command=listmods&data[id]=' . $orderid;
$output .= '
<td onclick="loadModal(\'' . $link . '\');">' . $dishname . '</td>';
} elseif (!$deleted && $arr['printed'] == NULL && $arr['dishid'] == MOD_ID) {
$link = 'orders.php?command=listmods&data[id]=' . $arr['associated_id'];
$output .= '<td onclick="loadModal(\'' . $link . '\');">' . $dishname . '</td>';
} else {
$output .= '<td>' . $dishname . '</td>';
}
}
if ($deleted) {
$output .= '<td ><s>' . $oextra . '</s></td>';
} else {
$output .= '<td>' . $oextra . '</td>';
}
// priority cell
$output .= '<td >' . $arr['priority'] . '</td>';
//.........这里部分代码省略.........
示例2: table
$sql->setWhere("id=" . $var);
$sql->delete();
}
echo message::success(lang::get('user_deleted'));
}
} else {
echo message::danger(lang::get('choose_user'));
}
}
$table = new table();
$table->addCollsLayout('25, 30%, *, 140, 100');
$table->addRow()->addCell("\n\t\t\t<input type='checkbox' id='all'>\n\t\t\t<label for='all'></label>\n\t\t", ['class' => 'checkbox'])->addCell(lang::get('name'))->addCell(lang::get('email'))->addCell(lang::get('username'))->addCell("");
$table->addSection('tbody');
$table->setSql('SELECT * FROM ' . sql::table('user'));
while ($table->isNext()) {
$id = $table->get('id');
$edit = '<a class="btn" href="?page=user&action=edit&id=' . $id . '">' . layout::svg('edit') . '</a>';
$table->addRow()->addCell("\n\t\t\t\t<input type='checkbox' name='ids[]' value='" . $id . "' id='id" . $id . "'>\n\t\t\t\t<label for='id" . $id . "'></label>\n\t\t\t", ['class' => 'checkbox'])->addCell($table->get('firstname') . " " . $table->get('name'))->addCell($table->get('email'))->addCell($table->get('username'))->addCell($edit);
$table->next();
}
?>
<div class="panel">
<form action="" method="post">
<div class="top">
<h3><?php
echo $table->numSql() . ' ' . lang::get('user');
?>
</h3>
<ul>
<li>
示例3: server
}
if ($action == 'stop' && $id) {
$server = new server($id);
$server->stop();
$return = message::success(lang::get('server_stopped'));
}
ajax::addReturn($return);
}
$table = new table();
$table->addCollsLayout('25, 32%, *, 70, 170');
$table->addRow()->addCell("\n\t\t\t<input type='checkbox' id='all'>\n\t\t\t<label for='all'></label>\n\t\t", ['class' => 'checkbox'])->addCell(lang::get('name'))->addCell(lang::get('game'))->addCell(lang::get('port'))->addCell(lang::get('status'));
$table->addSection('tbody');
$table->setSql('SELECT * FROM ' . sql::table('server'));
if ($table->numSql()) {
while ($table->isNext()) {
$id = $table->get('id');
$server = new server($id);
$status = $server->status($table->get('status'));
$table->addRow()->addCell("\n\t\t\t\t\t<input type='checkbox' name='ids[]' value='" . $id . "' id='id" . $id . "'>\n\t\t\t\t\t<label for='id" . $id . "'></label>\n\t\t\t\t", ['class' => 'checkbox'])->addCell($table->get('name'))->addCell($table->get('gameID'))->addCell($table->get('port'))->addCell($status, ['class' => 'toggleState']);
$table->next();
}
} else {
$table->addRow()->addCell(lang::get('no_entries'), ['colspan' => 5, 'class' => 'first']);
}
?>
<div class="row">
<div class="col-md-12">
<div class="panel">