Beispiel #1
0
if (isset($_GET['id'])) {
    echo $temp['menu_name'];
}
?>
">     
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-md-3 control-label" for="example-select">Kiểu menu</label>
                <div class="col-md-6">
                    <select id="type-menu-select" name="menu_type" class="form-control" size="1">
                        <option value="0">Chọn kiểu menu</option>
                        <?php 
$menu_type_obj = new menu_type();
$temp_menu_type = $menu_type_obj->getAllMenuType();
foreach ($temp_menu_type as $val) {
    ?>
                        <option data-url="<?php 
    echo $val['view'];
    ?>
" value="<?php 
    echo $val['mn_type_id'];
    ?>
" 
                        <?php 
    if (isset($_GET['id'])) {
        if ($val['mn_type_id'] == $temp['mn_type_id']) {
            echo "selected";
        }
    }
Beispiel #2
0
<?php

require_once '../models/class-menu.php';
$menu_type_obj = new menu_type();
$sort = '';
if (isset($_GET['sort'])) {
    $sort = $_GET['sort'];
}
switch ($sort) {
    case 'type_name':
        $a = $menu_type_obj->getAllMenuType('type_name');
        break;
    default:
        $a = $menu_type_obj->getAllMenuType();
}
?>
    <table class="table table-bordered table-striped table-condensed flip-content">
        <thead class="flip-content">
            <tr>
                <th>ID</th>
                <th><a href="index.php?view=list-menu-type&sort=type_name">Type Name</a></th>
                <th class="numeric">Kiểu view</th>
                <th class="numeric">Sửa</th>
                <th class="numeric">Xóa</th>
            </tr>
        </thead>
        <tbody>
        <?php 
$i = 0;
foreach ($a as $val) {
    $i++;