當前位置: 首頁>>代碼示例>>PHP>>正文


PHP table::get方法代碼示例

本文整理匯總了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>&nbsp;</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&amp;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&amp;data[id]=' . $orderid;
                $output .= '
				<td onclick="loadModal(\'' . $link . '\');">' . $dishname . '</td>';
            } elseif (!$deleted && $arr['printed'] == NULL && $arr['dishid'] == MOD_ID) {
                $link = 'orders.php?command=listmods&amp;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>';
//.........這裏部分代碼省略.........
開發者ID:jaimeivan,項目名稱:smart-restaurant,代碼行數:101,代碼來源:orders_waiter_class.php

示例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>
開發者ID:DINKIN,項目名稱:rokket,代碼行數:31,代碼來源:user.php

示例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">
開發者ID:kyroskoh,項目名稱:rokket,代碼行數:31,代碼來源:server.php


注:本文中的table::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。