Heray-Was-Here
Server : LiteSpeed
System : Linux uk-fast-web1372.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User : u390967363 ( 390967363)
PHP Version : 8.2.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Directory :  /home/u390967363/domains/aibenproperties.com/public_html/app/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u390967363/domains/aibenproperties.com/public_html/app/includes/demo_panel.php
<?php
if (!function_exists('isDemoMode')) {
    function isDemoMode(): bool {
        $env = strtolower((string)(getenv('APP_ENV') ?: ($_ENV['APP_ENV'] ?? '')));
        $host = strtolower((string)($_SERVER['HTTP_HOST'] ?? ''));
        $isLocal = ($env === 'local') || ($env === 'development') || (strpos($host, 'localhost') !== false) || (strpos($host, '127.0.0.1') !== false);
        $allowQueryDemo = $isLocal;
        $settingDemo = (function_exists('getSetting') && getSetting('demo_mode', 'off') === 'on');
        $allowSettingDemo = $settingDemo && ($env === '' || $env === 'local' || $env === 'development' || $env === 'staging' || $env === 'demo');
        return ($allowQueryDemo && isset($_GET['demo']) && $_GET['demo'] === '1') || $allowSettingDemo;
    }
}
if (!isDemoMode()) {
    return;
}
$kpis = [
    ['label' => 'Revenue', 'value' => '₦12,450,000'],
    ['label' => 'Active Clients', 'value' => '128'],
    ['label' => 'Open Tickets', 'value' => '23'],
    ['label' => 'Occupancy', 'value' => '92%'],
    ['label' => 'Allocations', 'value' => '56'],
    ['label' => 'Commissions', 'value' => '₦1,245,000']
];
$payments = [
    ['date' => '2026-01-24', 'client' => 'Adekunle A.', 'property' => 'Block A-12', 'amount' => '₦250,000', 'status' => 'Received'],
    ['date' => '2026-01-22', 'client' => 'Chioma N.', 'property' => 'Skyview-09', 'amount' => '₦180,000', 'status' => 'Pending'],
    ['date' => '2026-01-20', 'client' => 'Ibrahim O.', 'property' => 'Garden-04', 'amount' => '₦300,000', 'status' => 'Received'],
    ['date' => '2026-01-18', 'client' => 'Amaka C.', 'property' => 'Block B-02', 'amount' => '₦220,000', 'status' => 'Failed']
];
$allocations = [
    ['id' => 'AL-1024', 'client' => 'Segun K.', 'property' => 'Block A-12', 'status' => 'Pending'],
    ['id' => 'AL-1025', 'client' => 'Ngozi L.', 'property' => 'Skyview-11', 'status' => 'Approved'],
    ['id' => 'AL-1026', 'client' => 'Mary J.', 'property' => 'Garden-01', 'status' => 'In Review']
];
$clients = [
    ['name' => 'Adekunle A.', 'email' => 'adekunle@example.com', 'phone' => '+2348012345678'],
    ['name' => 'Chioma N.', 'email' => 'chioma@example.com', 'phone' => '+2348098765432'],
    ['name' => 'Ibrahim O.', 'email' => 'ibrahim@example.com', 'phone' => '+2347081234567']
];
$maintenance = [
    ['ticket' => 'MR-204', 'title' => 'Leaky faucet', 'priority' => 'High', 'status' => 'Open'],
    ['ticket' => 'MR-205', 'title' => 'AC servicing', 'priority' => 'Medium', 'status' => 'In Progress'],
    ['ticket' => 'MR-206', 'title' => 'Elevator check', 'priority' => 'Low', 'status' => 'Closed']
];
$tasks = [
    ['task' => 'Verify client KYC', 'assignee' => 'Agent: Ada', 'due' => '2026-02-03', 'priority' => 'High'],
    ['task' => 'Update property images', 'assignee' => 'Ops: Kunle', 'due' => '2026-02-05', 'priority' => 'Medium'],
    ['task' => 'Prepare commission report', 'assignee' => 'Finance: Tayo', 'due' => '2026-02-07', 'priority' => 'Low']
];
$commissions = [
    ['agent' => 'Agent Ayo', 'amount' => '₦450,000', 'status' => 'Pending'],
    ['agent' => 'Agent Zainab', 'amount' => '₦320,000', 'status' => 'Approved'],
    ['agent' => 'Agent Musa', 'amount' => '₦475,000', 'status' => 'Paid']
];
$reports = [
    ['metric' => 'Monthly Revenue', 'value' => '₦12.45M'],
    ['metric' => 'Avg. Time To Allocate', 'value' => '3.4 days'],
    ['metric' => 'Maintenance SLA', 'value' => '87%']
];
$notifications = [
    ['title' => 'Payment received', 'detail' => '₦250,000 from Adekunle'],
    ['title' => 'New ticket', 'detail' => 'Leaky faucet reported'],
    ['title' => 'Commission approved', 'detail' => 'Agent Zainab ₦320,000']
];
$documents = [
    ['name' => 'Allocation Letter', 'owner' => 'Chioma', 'status' => 'Signed'],
    ['name' => 'Payment Receipt', 'owner' => 'Ibrahim', 'status' => 'Verified'],
    ['name' => 'KYC Form', 'owner' => 'Mary', 'status' => 'Pending']
];
?>
<div id="demoPanel" style="position:fixed;right:16px;bottom:16px;z-index:1050;">
    <button id="demoToggle" style="background:#001F3F;color:#fff;border:none;border-radius:999px;padding:10px 16px;box-shadow:0 8px 24px rgba(0,0,0,0.2);font-weight:600;">Demo</button>
    <div id="demoDrawer" style="display:none;width:380px;max-height:70vh;overflow:auto;margin-top:8px;background:#fff;border:1px solid rgba(0,0,0,0.08);border-radius:12px;box-shadow:0 16px 32px rgba(0,0,0,0.18);">
        <div style="padding:12px 16px;background:#001F3F;color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;font-weight:600;">Aiben Demo Preview</div>
        <div style="padding:12px 16px;">
            <div style="display:grid;grid-template-columns:repeat(3,1fr);gap:8px;">
                <?php foreach ($kpis as $k): ?>
                    <div style="background:#f5f7fb;border:1px solid #e7eaef;border-radius:10px;padding:10px;">
                        <div style="font-size:12px;color:#4b5563;"><?php echo $k['label']; ?></div>
                        <div style="font-size:16px;font-weight:700;color:#001F3F;"><?php echo $k['value']; ?></div>
                    </div>
                <?php endforeach; ?>
            </div>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Recent Payments</div>
            <table style="width:100%;border-collapse:collapse;">
                <thead>
                    <tr>
                        <th style="text-align:left;padding:8px;border-bottom:1px solid #e7eaef;">Date</th>
                        <th style="text-align:left;padding:8px;border-bottom:1px solid #e7eaef;">Client</th>
                        <th style="text-align:left;padding:8px;border-bottom:1px solid #e7eaef;">Property</th>
                        <th style="text-align:right;padding:8px;border-bottom:1px solid #e7eaef;">Amount</th>
                        <th style="text-align:left;padding:8px;border-bottom:1px solid #e7eaef;">Status</th>
                    </tr>
                </thead>
                <tbody>
                <?php foreach ($payments as $p): ?>
                    <tr>
                        <td style="padding:8px;border-bottom:1px solid #f0f2f7;"><?php echo $p['date']; ?></td>
                        <td style="padding:8px;border-bottom:1px solid #f0f2f7;"><?php echo $p['client']; ?></td>
                        <td style="padding:8px;border-bottom:1px solid #f0f2f7;"><?php echo $p['property']; ?></td>
                        <td style="padding:8px;border-bottom:1px solid #f0f2f7;text-align:right;"><?php echo $p['amount']; ?></td>
                        <td style="padding:8px;border-bottom:1px solid #f0f2f7;"><?php echo $p['status']; ?></td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Allocations</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($allocations as $a): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;">
                        <span><?php echo $a['id']; ?> · <?php echo $a['client']; ?> · <?php echo $a['property']; ?></span>
                        <span style="color:#2ECC40;font-weight:600;"><?php echo $a['status']; ?></span>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Clients</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($clients as $c): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;">
                        <div style="font-weight:600;"><?php echo $c['name']; ?></div>
                        <div style="font-size:12px;color:#4b5563;"><?php echo $c['email']; ?> · <?php echo $c['phone']; ?></div>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Maintenance</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($maintenance as $m): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;">
                        <span><?php echo $m['ticket']; ?> · <?php echo $m['title']; ?> · <?php echo $m['priority']; ?></span>
                        <span style="color:#001F3F;font-weight:600;"><?php echo $m['status']; ?></span>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Tasks</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($tasks as $t): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;">
                        <div style="font-weight:600;"><?php echo $t['task']; ?></div>
                        <div style="font-size:12px;color:#4b5563;"><?php echo $t['assignee']; ?> · Due <?php echo $t['due']; ?> · <?php echo $t['priority']; ?></div>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Commissions</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($commissions as $c): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;">
                        <span><?php echo $c['agent']; ?></span>
                        <span><?php echo $c['amount']; ?> · <?php echo $c['status']; ?></span>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Reports</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($reports as $r): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;">
                        <span><?php echo $r['metric']; ?></span>
                        <span style="font-weight:700;color:#001F3F;"><?php echo $r['value']; ?></span>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Notifications</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($notifications as $n): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;">
                        <div style="font-weight:600;"><?php echo $n['title']; ?></div>
                        <div style="font-size:12px;color:#4b5563;"><?php echo $n['detail']; ?></div>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div style="margin-top:12px;border-top:1px solid #e7eaef;padding-top:12px;font-weight:600;color:#001F3F;">Documents</div>
            <ul style="list-style:none;padding:0;margin:0;">
                <?php foreach ($documents as $d): ?>
                    <li style="padding:8px;border:1px solid #e7eaef;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;">
                        <span><?php echo $d['name']; ?> · <?php echo $d['owner']; ?></span>
                        <span><?php echo $d['status']; ?></span>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
    var t = document.getElementById('demoToggle');
    var d = document.getElementById('demoDrawer');
    if (!t || !d) return;
    t.addEventListener('click', function () {
        var s = d.style.display;
        d.style.display = s === 'none' || s === '' ? 'block' : 'none';
    });
});
</script>

Hry