Initial commit

This commit is contained in:
Porawit Dongwang
2026-09-16 23:20:08 +07:00
commit 0041668dbb
32577 changed files with 3687927 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
// includes/header.php
?>
<header class="topbar">
<div class="topbar-left">
<h2 style="font-size:1.1rem; color:var(--text-main); font-weight:600;">
<span id="date_time" style="font-weight:400; color:var(--text-muted);"></span>
</h2>
</div>
<div class="topbar-right" style="display:flex; align-items:center; gap:1.5rem;">
<div class="user-info" style="text-align:right;">
<div style="font-weight:600;"><?php echo htmlspecialchars($name ?? $account ?? 'User'); ?></div>
<div style="font-size:0.8rem; color:var(--text-muted);"><?php echo htmlspecialchars($position ?? 'เจ้าหน้าที่'); ?></div>
</div>
<a href="logout.php" class="btn" style="background:#fef2f2; color:var(--danger); border:1px solid #fecaca; padding: 0.5rem 1rem;">
ออกจากระบบ
</a>
</div>
</header>
<script>
function date_time(id) {
let date = new Date();
let year = date.getFullYear() + 543;
let month = date.getMonth();
let months = ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'];
let d = date.getDate();
let h = date.getHours();
if(h<10) h = "0"+h;
let m = date.getMinutes();
if(m<10) m = "0"+m;
let s = date.getSeconds();
if(s<10) s = "0"+s;
let result = d + ' ' + months[month] + ' ' + year + ' เวลา ' + h + ':' + m + ':' + s + ' น.';
document.getElementById(id).innerHTML = result;
setTimeout('date_time("'+id+'");', '1000');
return true;
}
window.onload = function() {
date_time('date_time');
};
</script>
@@ -0,0 +1,52 @@
<?php
// includes/sidebar.php
$chk_itcenter = preg_match('/itcenter/', $account);
?>
<aside class="sidebar">
<div class="sidebar-header">
<h1>HOSxP Web</h1>
</div>
<div class="sidebar-menu">
<ul>
<li class="nav-header">เมนูหลัก</li>
<li class="<?php echo ($page_link == 'main.php') ? 'active' : ''; ?>">
<a href="main.php">
<svg style="width:20px;height:20px;margin-right:10px;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg>
หน้าหลัก
</a>
</li>
<li class="nav-header mt-4">ค้นหาข้อมูลผู้มารับบริการ</li>
<li class="<?php echo ($page_link == 'search_hn.php') ? 'active' : ''; ?>">
<a href="search_hn.php">ค้นจาก HN</a>
</li>
<li class="<?php echo ($page_link == 'search_cid.php') ? 'active' : ''; ?>">
<a href="search_cid.php">ค้นจากเลขบัตรประชาชน</a>
</li>
<li class="<?php echo ($page_link == 'search_passport.php') ? 'active' : ''; ?>">
<a href="search_passport.php">ค้นจาก Passport</a>
</li>
<?php if ($chk_itcenter) { ?>
<li class="<?php echo ($page_link == 'search_name.php') ? 'active' : ''; ?>">
<a href="search_name.php">ค้นจากชื่อ - สกุล</a>
</li>
<?php } ?>
<?php if ($chk_itcenter) { ?>
<li class="nav-header mt-4">ผู้ดูแลระบบ</li>
<li class="<?php echo ($page_link == '2fa_authen.php') ? 'active' : ''; ?>">
<a href="2fa_authen.php">ทำ 2FA Authentication</a>
</li>
<li class="<?php echo ($page_link == 'hosxp_cost.php') ? 'active' : ''; ?>">
<a href="hosxp_cost.php">แก้ไขข้อมูลค่าใช้จ่าย HOSxP</a>
</li>
<?php } ?>
</ul>
</div>
<div class="sidebar-footer">
<p>OS: <span style="color:var(--primary);"><?php echo htmlspecialchars($user_os ?? ''); ?></span></p>
<p>IP: <span style="color:var(--secondary);"><?php echo htmlspecialchars($ip ?? ''); ?></span></p>
</div>
</aside>