Server IP : 103.233.192.212 / Your IP : 3.141.199.214 Web Server : Apache/2 System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : sumpatuan ( 1058) PHP Version : 5.5.38 Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/sumpatuan/public_html/admin/data/ |
Upload File : |
<?php require_once('session_backend_administrator.php'); header('Content-Type: text/html; charset=UTF-8'); if($STT_login=="admin_login_true"){ $sql = "SELECT COUNT(*) FROM `data_agency` "; $qr = mysqli_query($con_db_administrator, $sql) or trigger_error("SQL", E_USER_ERROR); $rs = mysqli_fetch_row($qr); $numrows = $rs[0]; $rowsperpage = 20; $totalpages = ceil($numrows / $rowsperpage); if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) { $currentpage = (int) $_GET['currentpage']; } else { $currentpage = 1; } if ($currentpage > $totalpages) { $currentpage = $totalpages; } if ($currentpage < 1) { $currentpage = 1; } $offset = ($currentpage - 1) * $rowsperpage; $sql_agency = "SELECT * FROM `data_agency` ORDER BY `id_agency` LIMIT $offset, $rowsperpage "; $qr_agency = mysqli_query($con_db_administrator,$sql_agency) or die( mysqli_error($con_db_administrator)); }else{ echo "<SCRIPT type='text/javascript'> alert('กรุณาเข้าสู่ระบบ'); window.location.replace('../index'); </SCRIPT>"; exit; } ?> <!doctype html> <html lang="en"> <head> <?php include_once ("head.html"); ?> </head> <body class="" > <?php include_once ("menu.php"); ?> <div class="container pt-3 pb-4" > <div class="row "> <div class="col text-secondary" > <div class="p-1 ps-2 box-link " ><a href="../backend-administrator" class="link-info">หน้าหลัก</a> / หน่วยงานและอำนาจหน้าที่</div> </div> <div class="w-100 pb-4"></div> <div class="col m-auto" > <div class="bg-line-1"></div> </div> <div class="col-auto text-center"> <span class="h1 fw-700">หน่วยงานและอำนาจหน้าที่</span> </div> <div class="col m-auto" > <div class="bg-line-1 "></div> </div> </div> <div class="row mt-3 mb-4"> <div class="col clearfix pb-2" > <div class="float-start fs-20 fw-700">รายชื่อหน่วยงาน</div> <div class="float-end"><a class="btn btn-sm btn-dark rounded-5 ps-3 pe-3" href="Agency-adddata" role="button"><i class="fas fa-plus-square text-warning me-1" ></i> เพิ่มข้อมูลใหม่</a></div> </div> <div class="w-100"></div> <div class="col"> <div class="w-100 overflow-x-auto"> <table class="table table-bordered table-striped table-hover mb-2 tball-mw"> <thead > <tr class="text-center"> <th style="width:10%">ลำดับ</th> <th style="width:60%">ชื่อหน่วยงาน</th> <th style="width:15%">สถานะ</th> <th style="width:15%">จัดการ</th> </tr> </thead> <tbody class="table-group-divider fs-16"> <?php while($rs_agency = mysqli_fetch_array($qr_agency)){ ?> <tr> <td class="text-center" style="width:10%"><?php echo $rs_agency["id_agency"];?></td> <th ><?php echo $rs_agency["name_agency"];?></th> <td class="text-center"> <?php $stt_agency = $rs_agency["stt_agency"]; switch ( $stt_agency) { case "0": echo '<span class="badge rounded-pill text-bg-success" data-bs-toggle="tooltip" data-bs-title="ข้อมูลแสดงบนหน้าเว็บหลัก">แสดงข้อมูล</span>'; break; case "1": echo '<span class="badge rounded-pill text-bg-danger" data-bs-toggle="tooltip" data-bs-title="ข้อมูลจะไม่แสดงบนหน้าเว็บหลัก">ไม่แสดงข้อมูล</span>'; break; } ?> </td> <td class="text-center fs-18" style="width:15%"> <a href="Agency-edit?id=<?php echo $rs_agency["id_agency"]; ?>&name=<?php echo $rs_agency["name_agency"]; ?>" class="link-dark" data-bs-toggle="tooltip" data-bs-title="ปรับปรุงข้อมูล"><i class="fas fa-edit" ></i></a> <a href="action/del-Agency?id=<?php echo $rs_agency["id_agency"]; ?>&name=<?php echo $rs_agency["name_agency"]; ?>" class="link-dark" data-bs-toggle="tooltip" data-bs-title="ลบข้อมูล" onclick="return confirm('ต้องการลบข้อมูล ใช่หรือไม่?');" ><i class="fas fa-trash-alt" ></i></a> </td> </tr> <?php } ?> <?php if($numrows=="0"){ echo '<tr><td colspan="4"><div class="w-100 text-center mt-5 mb-5 text-secondary opacity-50 fs-20" ><i class="fas fa-eye-slash"></i> ไม่พบข้อมูล</div></td></tr>';} ?> </tbody> </table> </div> <!------------- NUMBER PAGE -------------> <div class="mt-2 fs-12 w-100 text-secondary clearfix"> <div class="float-start lh-sm"> แสดงข้อมูลตั้งแต่ 1 ถึง 20 <br class="showTab">จากข้อมูลทั้งหมด <span class="text-primary"><?php echo $numrows; ?></span> ข้อมูล </div> <div class="float-end"> <div aria-label="Page navigation example"> <ul class="pagination pagination-sm justify-content-end"> <?php $range = 5; if ($currentpage > 1) { echo " <li class='page-item'> <a class='page-link text-black-50' href='{$_SERVER['PHP_SELF']}?currentpage=1' aria-label='Previous'> <i class='fas fa-angle-double-left'></i> </a> </li>"; $prevpage = $currentpage - 1; echo "<li class='page-item'> <a class='page-link text-black-50' href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage' aria-label='Previous'> <i class='fas fa-angle-left'></i> </a> </li>"; } for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { if (($x > 0) && ($x <= $totalpages)) { if ($x == $currentpage) { echo "<li class='page-item active' aria-current='page'> <a class='page-link text-bg-secondary' href='#'>$x <span class='sr-only'>(current)</span></a> </li> "; } else { echo " <li class='page-item'><a class='page-link text-black-50' href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a></li>"; } } } if ($currentpage != $totalpages) { $nextpage = $currentpage + 1; echo "<li class='page-item'> <a class='page-link text-black-50' href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage' aria-label='Next'> <i class='fas fa-angle-right'></i> </a> </li>"; echo "<li class='page-item'> <a class='page-link text-black-50' href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages' aria-label='Next'> <i class='fas fa-angle-double-right'></i> </a> </li>"; } ?> </ul> </div> </div> </div> <!---------------------------------------> </div> </div> <?php include_once ("../footer.php"); ?> <script> const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) </script> </div> </body> </html>