« Back to History
company_list.php
|
20261118_125741.php
Initial Domain Snapshot
Copy Code
<?php /* File: public_html/developer/company_list.php Direct access enabled (no auth check) */ require_once __DIR__ . '/developer_bootstrap.php'; /* =============================== DB INCLUDE (ERP LOCATION) =============================== */ require_once __DIR__ . '/../erp/core/db.php'; $pdo = developer_get_pdo(); /* =============================== SAFE HELPER =============================== */ /* =============================== FETCH ALL COMPANIES =============================== */ try { $st = $pdo->query(" SELECT id, name, is_active FROM companies ORDER BY id DESC "); $rows = $st->fetchAll(PDO::FETCH_ASSOC); } catch (Exception $ex) { echo "<div class='card'><h2>Database error</h2><pre>" . h($ex->getMessage()) . "</pre></div>"; exit; } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Company List</title> <style> body{font-family:"Segoe UI",Tahoma,sans-serif;background:#f4f7fb;margin:0;padding:24px;color:#172033;} .page{max-width:1100px;margin:0 auto;} .topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:20px;} .topbar h2{margin:0;} .topbar p{margin:6px 0 0;color:#637287;} .btn{background:#0b5fff;color:#fff;padding:10px 14px;border:none;border-radius:8px;cursor:pointer;text-decoration:none;display:inline-block;} .btn-secondary{background:#e8f0ff;color:#17305c;} .card{background:#fff;padding:18px;border-radius:14px;box-shadow:0 12px 30px rgba(24,39,75,.08);border:1px solid #d9e2f0;} .table{width:100%;border-collapse:collapse;} .table th,.table td{padding:12px;border-top:1px solid #e9eef5;text-align:left;} .table th{color:#637287;font-size:13px;text-transform:uppercase;letter-spacing:.03em;} .badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;} .badge--success{background:#dcfce7;color:#166534;} .badge--danger{background:#ffe1e1;color:#991b1b;} </style> </head> <body> <div class="page"> <div class="topbar"> <div> <h2>Companies</h2> <p>Yeh page direct access mode me hai. ERP header include nahi ho raha, isliye login prompt bhi nahi aayega.</p> </div> <div> <a class="btn btn-secondary" href="dashboard.php">Back to Dashboard</a> </div> </div> <div class="card"> <h2>Companies (Direct Access Mode)</h2> <table class="table"> <thead> <tr> <th style="width:80px;">ID</th> <th>Name</th> <th style="width:120px;">Status</th> <th style="width:90px;">Action</th> </tr> </thead> <tbody> <?php if (empty($rows)): ?> <tr> <td colspan="4" style="text-align:center;padding:12px;"> No companies found </td> </tr> <?php else: ?> <?php foreach ($rows as $r): ?> <?php $active = (int)$r['is_active'] === 1; ?> <tr> <td><?= (int)$r['id'] ?></td> <td><?= h($r['name']) ?></td> <td> <span class="badge <?= $active ? 'badge--success' : 'badge--danger' ?>"> <?= $active ? 'Active' : 'Inactive' ?> </span> </td> <td> <a class="btn" href="company_edit.php?id=<?= (int)$r['id'] ?>">Edit</a> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </div> </body> </html>