Exemple #1
0
<?php

require_once "model/Nhaxe.php";
$model = new Nhaxe();
$link = "index.php?mod=nhaxe&act=list";
if (isset($_GET['hot']) && $_GET['hot'] > -1) {
    $hot = (int) $_GET['hot'];
    $link .= "&hot={$hot}";
} else {
    $hot = -1;
}
if (isset($_GET['keyword'])) {
    $keyword = $model->processData($_GET['keyword']);
    $link .= '&keyword=' . $keyword;
} else {
    $keyword = '';
}
$limit = 100;
$arrTotal = $model->getListNhaxe($keyword, $hot, -1, -1);
$total_page = ceil($arrTotal['total'] / $limit);
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$offset = $limit * ($page - 1);
$arrList = $model->getListNhaxe($keyword, $hot, $offset, $limit);
?>

<div class="row">
    <div class="col-md-12">
    <button class="btn btn-primary btn-sm right" onclick="location.href='index.php?mod=nhaxe&act=form'">Tạo mới</button>        
    <button class="btn btn-primary btn-sm right" id="capnhat_thutu">Cập nhật thứ tự</button> 
         <div class="box-header">
                <h3 class="box-title">Danh sách nhà xe</h3>