| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/domains/technicrayong.ac.th/private_html/rytc/tobe/admin/ |
Upload File : |
<?php
require_once __DIR__ . '/auth.php';
$totalConsult = (int)$pdo->query('SELECT COUNT(*) FROM consultations')->fetchColumn();
$waitConsult = (int)$pdo->query("SELECT COUNT(*) FROM consultations WHERE status='รอดำเนินการ'")->fetchColumn();
$totalActivity = (int)$pdo->query('SELECT COUNT(*) FROM activities')->fetchColumn();
$latest = $pdo->query('SELECT * FROM consultations ORDER BY created_at DESC LIMIT 5')->fetchAll();
include __DIR__ . '/header.php';
?>
<div class="page-header"><div class="container"><h1 class="fw-bold">แดชบอร์ดผู้ดูแลระบบ</h1><p class="mb-0">ยินดีต้อนรับ <?= e($_SESSION['admin_name'] ?? 'ผู้ดูแลระบบ') ?></p></div></div>
<div class="container mb-5">
<div class="row g-4 mb-4">
<div class="col-md-4"><div class="service-card"><div class="icon-circle"><i class="bi bi-inbox-fill"></i></div><h3 class="fw-bold"><?= $totalConsult ?></h3><p>รายการขอคำปรึกษาทั้งหมด</p></div></div>
<div class="col-md-4"><div class="service-card"><div class="icon-circle"><i class="bi bi-clock-history"></i></div><h3 class="fw-bold"><?= $waitConsult ?></h3><p>รายการรอดำเนินการ</p></div></div>
<div class="col-md-4"><div class="service-card"><div class="icon-circle"><i class="bi bi-images"></i></div><h3 class="fw-bold"><?= $totalActivity ?></h3><p>ข่าว/กิจกรรมทั้งหมด</p></div></div>
</div>
<div class="content-card p-4">
<div class="d-flex justify-content-between align-items-center mb-3"><h4 class="fw-bold mb-0">คำปรึกษาล่าสุด</h4><a href="consult_list.php" class="btn btn-gradient btn-sm">ดูทั้งหมด</a></div>
<div class="table-responsive"><table class="table align-middle"><thead><tr><th>วันที่</th><th>ชื่อ</th><th>หัวข้อ</th><th>สถานะ</th></tr></thead><tbody>
<?php foreach($latest as $row): ?><tr><td><?= e($row['created_at']) ?></td><td><?= e($row['fullname']) ?></td><td><?= e($row['topic']) ?></td><td><?= e($row['status']) ?></td></tr><?php endforeach; ?>
<?php if(!$latest): ?><tr><td colspan="4" class="text-center text-muted">ยังไม่มีข้อมูล</td></tr><?php endif; ?>
</tbody></table></div>
</div>
</div>
<?php include __DIR__ . '/footer.php'; ?>