File manager - Edit - /home/pack/admin/dashboard.php
Back
<?php require_once "../config.php"; require_once "../auth.php"; require_login(); ?> <?php include "header.php"; ?> <div id="debugLogBox" style=" position: fixed; bottom: 0; left: 0; width: 100%; max-height: 35%; background: #000; color: #0f0; padding: 10px; font-family: monospace; font-size: 13px; overflow-y: auto; z-index: 999999; display: none; "> </div> <button onclick="toggleDebugLog()" style=" position: fixed; bottom: 38%; right: 10px; z-index: 999999; background: #222; color: #fff; border: 1px solid #0f0; padding: 6px 10px; font-size: 12px; border-radius: 6px; "> Debug Log </button> <button onclick="clearDebugLog()" style=" position: fixed; bottom: 38%; right: 90px; z-index: 999999; background: #444; color: #fff; border: 1px solid #f33; padding: 6px 10px; font-size: 12px; border-radius: 6px; "> Clear Log </button> <script> let debugLogVisible = false; function addDebugLog(msg) { const box = document.getElementById("debugLogBox"); const time = new Date().toLocaleTimeString(); box.innerHTML += `[${time}] ${msg}<br>`; box.scrollTop = box.scrollHeight; } function toggleDebugLog() { debugLogVisible = !debugLogVisible; document.getElementById("debugLogBox").style.display = debugLogVisible ? "block" : "none"; } function clearDebugLog() { document.getElementById("debugLogBox").innerHTML = ""; addDebugLog("ð§đ Cleared Log"); } // Capture console.log â redirect to debug log (function(){ const oldLog = console.log; console.log = function(...args) { oldLog.apply(console, args); addDebugLog(args.join(" ")); }; const oldWarn = console.warn; console.warn = function(...args) { oldWarn.apply(console, args); addDebugLog("â " + args.join(" ")); }; const oldError = console.error; console.error = function(...args) { oldError.apply(console, args); addDebugLog("â " + args.join(" ")); }; })(); </script> <script> document.addEventListener("DOMContentLoaded", function () { // â āļŠāļĢāđāļēāļ Display Zone let statusBox = document.getElementById("beacon_status_box"); if (!statusBox) { statusBox = document.createElement("div"); statusBox.id = "beacon_status_box"; statusBox.style = ` position: fixed; bottom: 10px; right: 10px; padding: 12px 16px; border-radius: 10px; background: rgba(0,0,0,0.7); color: #fff; font-size: 15px; z-index: 99999; `; statusBox.innerHTML = "âģ āļāļģāļĨāļąāļāđāļāļ·āđāļāļĄāļāđāļâĶ"; document.body.appendChild(statusBox); } // â Flutter â Web Event Handler window.addEventListener("flutter_beacon", function(e) { const data = e.detail; console.log("ðĨ Web Received Event:", data); let text = "ðĄ Unknown Event"; switch (data.type) { case "scan_status": if (data.status === "scanning") { text = "ðĩ āļāļģāļĨāļąāļāļŠāđāļāļ BeaconâĶ"; } else if (data.status === "idle") { text = "⊠āļŦāļĒāļļāļāļŠāđāļāļāđāļĨāđāļ§"; } break; case "beacon_found": text = `ðĒ āļāļ Beacon āđāļāļĨāđāļāļļāļ: ${data.location}`; break; default: text = "âđïļ Event Received"; } statusBox.innerHTML = text; }); }); </script> <h3><i class="bi bi-speedometer2"></i> āđāļāļāļāļ§āļāļāļļāļĄ (Dashboard)</h3> <hr> <div style="font-size:18px; margin:10px 0;"> <b>āļŠāļāļēāļāļ°āļĢāļ°āļāļ:</b> <span id="scan-status" style="color:gray">⊠āļŦāļĒāļļāļāļŠāđāļāļ</span> </div> <button onclick="testFlutterEvent()">āļāļāļŠāļāļāļĢāļąāļ Event</button> <script> function testFlutterEvent() { window.dispatchEvent(new CustomEvent('flutter_beacon', { detail: { type: "scan_status", status: "scanning" } })); } </script> <style> .menu-card { transition: 0.2s; border-radius: 12px; cursor: pointer; padding: 25px; background: #fff; border: 1px solid #e0e0e0; text-align: center; } .menu-card:hover { transform: translateY(-5px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); } .menu-icon { font-size: 45px; color: #0d6efd; } </style> <div class="row g-4"> <!-- ====================================== ADMIN + STAFF MENU ======================================= --> <?php if ($ROLE == 'admin' || $ROLE == 'staff'): ?> <div class="col-md-3"> <a href="users.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-people menu-icon"></i> <h5 class="mt-3">āļāļąāļāļāļēāļĢāļāļđāđāđāļāđ</h5> </div> </a> </div> <div class="col-md-3"> <a href="beacons.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-broadcast-pin menu-icon"></i> <h5 class="mt-3">āļāļąāļāļāļēāļĢ Beacon</h5> </div> </a> </div> <div class="col-md-3"> <a href="items.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-list-check menu-icon"></i> <h5 class="mt-3">āļĢāļēāļĒāļāļēāļĢāļŠāļīāđāļāļāļāļāļāļĢāļ°āļāļģāļ§āļąāļ</h5> </div> </a> </div> <div class="col-md-3"> <a href="logs.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-clock-history menu-icon"></i> <h5 class="mt-3">āļāļĢāļ°āļ§āļąāļāļīāđāļāđāļāđāļāļ·āļāļ</h5> </div> </a> </div> <?php else: ?> <!-- ====================================== USER MENU ======================================= --> <div class="col-md-4"> <a href="beacons.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-broadcast menu-icon"></i> <h5 class="mt-3">Beacon āļāļāļāļāļąāļ</h5> </div> </a> </div> <div class="col-md-4"> <a href="items.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-list-task menu-icon"></i> <h5 class="mt-3">āļĢāļēāļĒāļāļēāļĢāļŠāļīāđāļāļāļāļāļāļāļāļāļąāļ</h5> </div> </a> </div> <div class="col-md-4"> <a href="logs.php" class="text-decoration-none text-dark"> <div class="menu-card"> <i class="bi bi-clock-history menu-icon"></i> <h5 class="mt-3">āļāļĢāļ°āļ§āļąāļāļīāđāļāđāļāđāļāļ·āļāļāļāļāļāļāļąāļ</h5> </div> </a> </div> <?php endif; ?> </div> <?php include "../footer.php"; ?> <script> window.addEventListener("flutter_beacon", function(e) { console.log("ðĄ Event from Flutter â", JSON.stringify(e.detail)); const data = e.detail || {}; if (data.type === "scan_status") { console.log("ð Beacon scan status:", data.status); } if (data.type === "beacon_found") { console.log( `ðŊ Beacon Found: ${data.uuid} (${data.major}/${data.minor}) at ${data.location}` ); } }); </script>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.88 |
proxy
|
phpinfo
|
Settings