</head> <body> <div class="white-trans-container"> <?php session_start(); include_once 'header.php'; if (isset($_POST['ok1'])) { $bt = $td = ""; include_once 'bthuoc.php'; include_once 'database.php'; $bthuoc = new bthuoc(); if ($_POST['baiViet'] && $_POST['noiDung']) { $bt = $_POST['baiViet']; $td = $_POST['noiDung']; $sql = "select * from baiViet where tenbaiViet like '%" . $bt . "%' && noiDung like '%" . $td . "%'"; $bthuoc->query($sql); } else { if ($_POST['baiViet'] && $_POST['noiDung'] == null) { $bt = $_POST['baiViet']; $td = $_POST['noiDung']; $sql = "select * from baiViet where tenbaiViet like '%" . $bt . "%'"; $bthuoc->query($sql); } else { if ($_POST['baiViet'] == null && $_POST['noiDung']) { $bt = $_POST['baiViet']; $td = $_POST['noiDung']; $sql = "select * from baiViet where noiDung like '%" . $td . "%'"; $bthuoc->query($sql); } } }
</div> </div></a></center></td> <?php } ?> </tr> </table> </div> <li><a href="baiviet.php">CÁC BÀI VIẾT KHÁC</a></li><div class="nav-content" id="baiviet-newest"> <table class="no-border"> <tr class="tr-header no-border"> <td class="left-header-td no-border"><b>CÁC BÀI VIẾT MỚI NHẤT</b></td> <?php $bthuoc3 = new bthuoc(); $sql5 = "SELECT * FROM baiviet ORDER BY maBaiViet DESC LIMIT 4"; $bthuoc3->query($sql5); $data6 = array(); while ($row6 = $bthuoc3->fetch()) { $data6[] = $row6; } foreach ($data6 as $rows6) { ?> <td class="no-border"><center><?php echo "<a href='chitietbaiviet.php?maBaiViet=" . $rows6['maBaiViet'] . "'>"; ?> <div class="news-detail"> <div class="news-detail-content"><?php echo "<img src='" . $rows6['anhMinhHoa'] . "' alt='Vui lòng kết nối Internet để xem ảnh'>"; ?> </div> <div class="news-detail-title"><?php