<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" : ""; }
echo $temp['description']; } ?> </textarea> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-md-12 reset-margin-padding">Chọn danh mục sản phẩm:</label> <div class="col-md-12 grey-back"> <table class="align-col"> <?php //$temp_cat = $cat_obj->getAllCat(); $cat_obj = new category_product(); $temp_cat = $cat_obj->getAllCat('position'); echo buildCatDeQuy($temp_cat, 0); ?> </table> </div> </div> </div> </div> </div> </div> </div> </div> <div id="tab2" class="tab-pane fade"> <div class="row"> <div class="col-md-12 pd-top"> <div class="form-body">
<?php require_once '../models/class-cat-product.php'; $cat_obj = new category_product(); $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-product&sort=cat">Category Name</a></th> <th width="10%" class="numeric"><a href="index.php?view=list-cat-product&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);