Example #1
0
    $temp = $menu_obj->getMenuById($_GET['id']);
    //print_r($temp);
}
?>
<style type="text/css">.bold-option{font-weight:bold} </style>
 <form class="form-horizontal form-bordered">
 <?php 
echo isset($_GET['id']) ? '<fieldset disabled>' : '';
?>
 <div class="form-group">
                <label class="col-md-3 control-label" for="example-select">NHÓM MENU***</label>
                <div class="col-md-6">
                    <select id="group_menu" name="menu_group" class="form-control" size="1">
                        <option value="0">Chọn nhóm menu</option>
                        <?php 
$menu_group_obj = new menu_group();
$temp_menu_group = $menu_group_obj->getAllMenuGroup(1);
foreach ($temp_menu_group as $val) {
    ?>
                        <option value="<?php 
    echo $val['menu_gr_id'];
    ?>
" 
                        <?php 
    if (isset($_GET['id'])) {
        if ($val['menu_gr_id'] == $temp['menu_gr_id']) {
            echo "selected";
        }
    }
    if (isset($_GET['group_id'])) {
        if ($val['menu_gr_id'] == $_GET['group_id']) {
Example #2
0
<?php

require_once '../models/class-menu.php';
$menu_group_obj = new menu_group();
$sort = '';
if (isset($_GET['sort'])) {
    $sort = $_GET['sort'];
}
switch ($sort) {
    case 'name':
        $a = $menu_group_obj->getAllMenuGroup('', 'menu_group_name');
        break;
    case 'status':
        $a = $menu_group_obj->getAllMenuGroup('', 'status');
        break;
    default:
        $a = $menu_group_obj->getAllMenuGroup();
}
?>
    <table class="table table-bordered table-striped table-condensed flip-content">
        <thead class="flip-content">
            <tr>
                <th width="5%">STT</th>
                <th><a href="index.php?view=list-menu-group&sort=name">Category Name</a></th>
                <th class="numeric"><a href="index.php?view=list-menu-group&sort=status">Trạng thái</a></th>
                <th class="numeric">Sửa</th>
                <th class="numeric">Xóa</th>
            </tr>
        </thead>
        <tbody>
        <?php 
Example #3
0
<?php

require_once '../models/class-menu.php';
if (isset($_GET['id'])) {
    $menu_group_obj = new menu_group();
    $temp = $menu_group_obj->getMenuGroupById($_GET['id']);
}
?>
<div class="panel panel-danger">
    <div class="panel-heading">
        <h3 class="panel-title">
            <i class="livicon" data-name="bell" data-loop="true" data-color="#fff" data-hovercolor="#fff" data-size="18"></i>
            <?php 
if (isset($_GET['act'])) {
    echo $_GET['act'] == 'update' ? 'Sửa' : 'Thêm';
} else {
    echo "Thêm";
}
?>
 danh mục
        </h3>
        <span class="pull-right">
            <i class="fa fa-fw fa-chevron-up clickable"></i>
            <i class="fa fa-fw fa-times removepanel clickable"></i>
        </span>
    </div>
    <div class="panel-body border">
        <form action="control/proccess-menu-group.php" method="post" class="form-horizontal form-bordered">
            <div class="form-group">
                <label class="col-md-3 control-label" for="example-text-input">Tên nhóm menu</label>
                <div class="col-md-6">
                $id = $_POST['id'];
                if ($menu_group_obj->updateMenuGroup($menu_group_name, $status, $id)) {
                    header("Location: ../index.php?view=list-menu-group&stt=success");
                } else {
                    header("Location: ../index.php?view=list-menu-group&stt=fail");
                }
            }
            break;
        case "xoa":
            $id = $_POST['id'];
            $menu_group_obj = new menu_group();
            if ($menu_group_obj->delMenuGroup($id)) {
                header("Location: ../index.php?view=list-menu-group&stt=success");
            } else {
                header("Location: ../index.php?view=list-menu-group&stt=fail");
            }
            break;
        default:
            if (isset($_POST['menu_group_name']) && isset($_POST['status'])) {
                $menu_group_obj = new menu_group();
                $menu_group_name = $_POST['menu_group_name'];
                $status = $_POST['status'];
                if ($menu_group_obj->insertMenuGroup($menu_group_name, $status)) {
                    header("Location: ../index.php?view=form-menu-group&stt=success");
                } else {
                    header("Location: ../index.php?view=form-menu-group&stt=fail");
                }
            }
            break;
    }
}