コード例 #1
0
    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>';
        // price cell
        $user = new user($_SESSION['userid']);
        if ($generic && $user->level[USER_BIT_CASHIER] && $arr['printed'] && !$deleted) {
            $link = 'orders.php?command=price_modify&amp;data[id]=' . $arr['id'];
            $output .= '<td onclick="redir(\'' . $link . '\');"><a href="' . $link . '">' . $arr['price'] . '</a></td>';
        } elseif ($deleted) {
            $output .= '<td><s>' . $arr['price'] . '</s></td>';
        } else {
            $output .= '<td >' . $arr['price'] . '</td>';
        }
        // edit button
        if ($toclose) {
            // the table has been closed, can't modify rows
            $output .= '<td>&nbsp;</td>';
        } elseif (!$deleted && $arr['printed'] != NULL && $arr['dishid'] != MOD_ID) {
            // printed orderd, special edit (only deleting or substiting)
            $link = 'orders.php?command=edit&amp;data[id]=' . $orderid;
        } elseif (!$deleted && $arr['dishid'] == MOD_ID) {
            // modification, can't edit directly, only via associated order
            $output .= '<td>&nbsp;</td>';
        } elseif ($deleted) {
            // deleted order, no editing, of course
            $output .= '<td>&nbsp;</td>';
        } else {
            // other cases, normal editing
            $link = 'orders.php?command=edit&data[id]=' . $orderid;
            $output .= '<td onclick="loadModal(\'' . $link . '\');"><img src="' . IMAGE_SOURCE . '" width="32" border="0"></a></td>';
        }
        // quantity arrows
        if ($toclose) {
            // table is closed, no more editing
            $output .= '<td>&nbsp;</td>';
        } else {
            // normal section to rapidly add or subtract single quantities
            $output .= '<td>';
            if (!$arr['printed'] && $arr['dishid'] != MOD_ID || $arr['dishid'] == SERVICE_ID) {
                $newquantity = $arr['quantity'] + 1;
                $link = "command=update&data[quantity]=" . $newquantity . "&data[id]=" . $orderid;
                if ($arr['suspend']) {
                    $link .= "&data[suspend]=1";
                }
                if ($arr['extra_care']) {
                    $link .= "&data[extra_care]=1";
                }
                $output .= '<a href="#" onClick="modifyDishQuantity(\'' . $link . '\')"><img src="' . IMAGE_PLUS . '" alt="' . ucfirst(phr('PLUS')) . ' (' . ucfirst(phr('ADD')) . ')" border=0></a></td><td>';
                if ($arr['quantity'] > 1) {
                    $newquantity = $arr['quantity'] - 1;
                    $link = "command=update&data[quantity]=" . $newquantity . "&data[id]=" . $orderid;
                    if ($arr['suspend']) {
                        $link .= "&data[suspend]=1";
                    }
                    if ($arr['extra_care']) {
                        $link .= "&data[extra_care]=1";
                    }
                    $output .= '<a href="#" onClick="modifyDishQuantity(\'' . $link . '\')"><img src="' . IMAGE_MINUS . '" alt="' . ucfirst(phr('MINUS')) . ' (' . ucfirst(phr('REMOVE')) . ')" border=0></a>';
                } elseif ($arr['quantity'] == 1 && CONF_ALLOW_EASY_DELETE) {
                    $newquantity = 0;
                    $link = "command=ask_delete&data[id]=" . $orderid;
                    if ($arr['suspend']) {
                        $link .= "&data[suspend]=1";
                    }
                    if ($arr['extra_care']) {
                        $link .= "data[extra_care]=1";
                    }
                    $output .= '<a href="#" onClick="modifyDishQuantity(\'' . $link . '\')"><img src="' . IMAGE_TRASH . '" width="32" alt="' . ucfirst(phr('MINUS')) . ' (' . ucfirst(phr('REMOVE')) . ')" border=0></a>';
                } else {
                    $output .= '&nbsp;' . "\n";
                }
            } else {
                $output .= '&nbsp;</td><td>&nbsp;';
            }
            $output .= '</td>';
        }
        $output .= '</tr>' . "\n\n";
        return $output;
    }
コード例 #2
0
ファイル: user.php プロジェクト: DINKIN/rokket
                    $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
0
ファイル: server.php プロジェクト: kyroskoh/rokket
        }
        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">