<?php include "../model/db.php"; include_once "../libs/function.php"; if (isset($_POST)) { $page = isset($_POST["page"]) ? $_POST["page"] : ""; $action = isset($_POST["action"]) ? $_POST["action"] : ""; $limit = 3; if ($action == "next") { $page = $page + 1; } else { if ($action == "prev") { $page = $page - 1; } } $batdau = ($page - 1) * $limit; $sanpham = mysqli_query($db, "SELECT id, name, hinh1,time, giaca, danhmuc,khuvuc, phone FROM sanpham ORDER by time DESC LIMIT " . $batdau . "," . $limit); while ($row = mysqli_fetch_array($sanpham)) { $result = "\n\t\n\t\t<div class='col-sm-4 col-lg-4 col-md-4'>\n\t\t<div class='thumbnail'>\n\t\t\t<img src='" . $row['hinh1'] . "' alt='" . $row['name'] . "' \n\t\t\t\t\ttại Bách khoa shop' style='width:100%; height:200px'>\n\t\t\t <h4 class='giaca'>" . $row["giaca"] . " VNĐ</h4>\n\t\t\t<div class='caption'>\n\t\t\t \n\t\t\t\t<h4><strong><a href='#'>" . $row["name"] . "</a></strong>\n\t\t\t\t</h4>\n\t\t\t\t<p style='font-family: 'Lobster', cursive;' >\n\t\t\t\t\t<span class='glyphicon glyphicon-list-alt'></span> \n\t\t\t\t\t\t<a href='#' data-toggle='tooltip' title='Danh mục'>" . $row["danhmuc"] . " </a>\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t<span class='glyphicon glyphicon-map-marker'></span> <em>Khu vực: </em>\n\t\t\t\t\t\t<strong data-toggle='tooltip' title='Khu vực giao hàng'>" . $row["khuvuc"] . "</strong>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class='ratings'>\n\t\t\t\t<p class='pull-right'>" . times_ago($row["time"]) . "</p>\n\t\t\t\t<p>\n\t\t\t\t <a class='btn btn-danger' href='?ctr=chi-tiet-tin&id=" . $row["id"] . " '>Xem chi tiết</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t\t\t"; echo $result; } }
echo $row["ten_nd"]; ?> </td> </tr> <tr> <th scope="row"><span class="glyphicon glyphicon-map-marker"></span> Địa điểm giao dịch:</th> <td><?php echo $row["khuvuc"]; ?> </td> </tr> <tr> <th scope="row"><span class="glyphicon glyphicon-time"></span> Thời gian đăng: </th> <td style="color:#c3c3c3"><?php echo times_ago($row["time"]); ?> </td> </tr> </table> <div style="height:150px; text-align:center; " class="contact"> <img src="image/icon/contacticon.png" class="img-rounded" height="90%" /> <button class="btn btn-primary" id="myContact"> Liên lạc với <?php echo $row["ten_nd"]; ?> </button> </div>