Пример #1
0
</option>
                        <?php 
}
?>
                    </select>
                </div>
            </div>
            <div class="form-group" id="hidden-cat">
                <label class="col-md-3 control-label" for="example-select">Danh mục</label>
                <div class="col-md-6">
                    <select id="example-select" name="cat_id" class="form-control" size="1">
                        <option value="0">Please select</option>
                          <?php 
//$temp_cat = $cat_obj->getAllCat();
$cat_obj = new category();
$temp_cat = $cat_obj->getAllCat('position');
echo buildCatDeQuy($temp_cat, 0);
?>
                    </select>
                </div>
            </div>
            <div class="form-group" id="hidden-cat-product">
                <label class="col-md-3 control-label" for="example-select">Danh mục sản phẩm</label>
                <div class="col-md-6">
                    <select id="example-select" name="cat_pro_id" class="form-control" size="1">
                        <option value="0">Please select</option>
                          <?php 
//$temp_cat = $cat_obj->getAllCat();
$cat_obj = new category_product();
$temp_cat = $cat_obj->getAllCat('position');
echo buildCatDeQuy($temp_cat, 0);
Пример #2
0
if (isset($_GET['id'])) {
    echo $temp['content'];
}
?>
</textarea>
                </div>
            </div>  
               
               <div class="form-group">
                <label class="col-md-3 control-label" for="example-select">Danh mục</label>
                <div class="col-md-6">
                    <select id="example-select" name="cat_id" class="form-control" size="1">
                        <option value="0">Please select</option>
                        <?php 
$cat_obj = new category();
$temp_cat = $cat_obj->getAllCat();
foreach ($temp_cat as $val) {
    ?>
                        <option value="<?php 
    echo $val['cat_id'];
    ?>
" <?php 
    if (isset($_GET['id'])) {
        if ($val['cat_id'] == $temp['cat_id']) {
            echo "selected";
        }
    }
    ?>
><?php 
    echo $val['cat_name'];
    ?>
Пример #3
0
<?php

require_once '../models/class-cat.php';
$cat_obj = new category();
$sort = '';
if (isset($_GET['sort'])) {
    $sort = $_GET['sort'];
}
switch ($sort) {
    case 'cat':
        $a = $cat_obj->getAllCat('cat_name');
        break;
    case 'position':
        $a = $cat_obj->getAllCat('position');
        break;
    default:
        $a = $cat_obj->getAllCat();
}
?>
    <table class="table table-bordered table-striped table-condensed flip-content">
        <thead class="flip-content">
            <tr>
                <th><a href="index.php?view=list-cat&sort=cat">Category Name</a></th>
                <th width="10%" class="numeric"><a href="index.php?view=list-cat&sort=position">Thứ tự</a></th>
                <th width="5%" class="numeric">Sửa</th>
                <th width="5%" class="numeric">Xóa</th>
            </tr>
        </thead>
        <tbody>
        <?php 
echo listCatTable($a);
Пример #4
0
                <div class="col-md-6">
                    <input type="text" id="example-email" name="position" class="form-control" placeholder="Thứ tự" value="<?php 
if (isset($_GET['id'])) {
    echo $temp['position'];
}
?>
"></div>
            </div>
             <div class="form-group">
                <label class="col-md-3 control-label" for="example-select">Lựa chọn danh mục cha</label>
                <div class="col-md-6">
                    <select id="example-select" name="parent_id" class="form-control" size="1">
                        <option value="0">Không có danh mục cha</option>
                        <?php 
//$temp_cat = $cat_obj->getAllCat();
$temp_cat = isset($_GET['id']) ? $cat_obj->getAllCatExceptId($_GET['id'], 'position') : $cat_obj->getAllCat('position');
$id = isset($_GET['id']) ? $temp['parent_id'] : 0;
echo buildCatDeQuy($temp_cat, $id);
?>
                    </select>
                </div>
            </div>
             <div class="form-group">
                <label class="col-md-3 control-label">Hiển thị ra trang chủ </label>
                <div class="col-md-9">
                    <div class="checkbox mar-left5">
                        <label for="example-checkbox1">
                            <input type="checkbox" id="example-checkbox1" <?php 
if (isset($_GET['id'])) {
    echo $temp['home'] == 1 ? "checked" : "";
}