File manager - Edit - /home/webapp68.cm.in.th/u68319090013/final/procurement.php
Back
<br><br> <?php include('header.php'); include('connect.php'); ?> <main id="main" class="mt-5"> <div class="container mt-4"> <h1 class="text-center fw-bold mb-3" style="word-wrap: break-word; font-size: 2rem;">การจัดซื้อจัดจ้าง</h1> <!-- เพิ่ม word-wrap และปรับขนาดฟอนต์ --> <p class="text-center text-muted"> </p> <!-- ปุ่มเพิ่มข่าว --> <div class="text-end mb-3"> <a href="?page=appnews" class="btn btn-success">+ เพิ่มข่าว</a> </div> <!-- แสดงข่าวจากฐานข้อมูล --> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead class="table-dark"> <tr> <th>หัวข้อข่าว</th> <th>เนื้อหา</th> <th>วันที่</th> <th>จัดการ</th> <!-- เพิ่มคอลัมน์สำหรับปุ่มแก้ไขและลบ --> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM news ORDER BY time_news DESC"; $result = $con->query($sql); if ($result && $result->num_rows > 0) { while($row = $result->fetch_assoc()){ echo "<tr>"; echo "<td>".htmlspecialchars($row['headline'])."</td>"; echo "<td>".nl2br(htmlspecialchars($row['content']))."</td>"; echo "<td>".$row['time_news']."</td>"; echo "<td> <a href='?page=edit_news&id=".$row['id']."' class='btn btn-warning btn-sm'>แก้ไข</a> <a href='?page=delete_news&id=".$row['id']."' class='btn btn-danger btn-sm' onclick='return confirm(\"คุณแน่ใจไหมที่จะลบข่าวนี้?\")'>ลบ</a> </td>"; // เพิ่มปุ่มแก้ไขและลบ echo "</tr>"; } } else { echo "<tr><td colspan='4' class='text-center text-muted'>ยังไม่มีข่าว</td></tr>"; } ?> </tbody> </table> </div> </div> </main> <?php include('footer.php'); ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.45 |
proxy
|
phpinfo
|
Settings