« Back to History
index.php
|
20260723_000646.php
Initial Domain Snapshot
Copy Code
<?php // index.php - ERP Builder mock (integrates with ERP partials if available) // // Place this file at: public_html/builder/index.php // It will try to include erp/partials/header.php and footer.php if they exist. // If not, it renders a lightweight fallback header/footer. $baseRel = __DIR__ . '/..'; // adjust only if your layout differs $erpHeader = $baseRel . '/erp/partials/header.php'; $erpFooter = $baseRel . '/erp/partials/footer.php'; $useErpPartials = file_exists($erpHeader) && file_exists($erpFooter); // helper to output minimal head when ERP partials are not present function print_fallback_head() { ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1" /> <title>ERP Builder — Mock</title> <!-- If you maintain a central main.css, prefer adding the CSS there. As fallback we load builder.css in this same folder. --> <link rel="stylesheet" href="builder.css"> </head> <body> <header style="padding:16px;background:#0b1220;color:#e6eef8;"> <div style="max-width:1100px;margin:0 auto;display:flex;justify-content:space-between;align-items:center"> <div><strong>Mister Builder</strong> <small style="color:#9fb3c8">Visual ERP generator</small></div> <div style="font-size:13px;color:#9fb3c8">Logged in as: Raj</div> </div> </header> <main style="max-width:1100px;margin:20px auto"> <?php } function print_fallback_footer() { ?> </main> <footer style="padding:18px;background:#071124;color:#9fb3c8;text-align:center"> © <?=date('Y')?> Mister Builder </footer> <script src="builder.js"></script> </body> </html> <?php } // If ERP partials exist, include them. Otherwise print fallback. if ($useErpPartials) { require $erpHeader; } else { print_fallback_head(); } ?> <!-- Begin page content --> <div class="page page-dashboard" style="padding:12px;"> <div class="topbar" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px"> <div style="display:flex;gap:12px;align-items:center"> <nav> <a href="index.php" class="nav-link">Dashboard</a> | <a href="index.php?screen=projects" class="nav-link">Projects</a> | <a href="index.php?screen=builder" class="nav-link">Page Builder</a> | <a href="index.php?screen=models" class="nav-link">Models</a> </nav> </div> <div style="color:#9fb3c8">ERP Builder Mock</div> </div> <?php // simple router for this single-file mock $screen = $_GET['screen'] ?? 'dashboard'; if ($screen === 'dashboard'): ?> <h1>Dashboard</h1> <section class="cards-grid"> <div class="card"> <h2>Projects</h2> <p>3 Active</p> </div> <div class="card"> <h2>Pages</h2> <p>27 Published</p> </div> <div class="card"> <h2>Recent Activity</h2> <ul> <li>Edited: Attendance Form</li> <li>Published: Production Report</li> </ul> </div> </section> <?php elseif ($screen === 'projects'): ?> <h1>Projects</h1> <p><button class="btn">+ New Project</button></p> <table class="table"> <thead> <tr><th>Name</th><th>Pages</th><th>Last Updated</th><th>Actions</th></tr> </thead> <tbody> <tr> <td>ERP Alpha</td><td>12</td><td>2025-09-17</td> <td><a href="index.php?screen=builder&project=alpha">Open</a></td> </tr> <tr> <td>ERP Beta</td><td>8</td><td>2025-09-15</td> <td><a href="index.php?screen=builder&project=beta">Open</a></td> </tr> </tbody> </table> <?php elseif ($screen === 'builder'): ?> <h1>Page Builder — Attendance Form</h1> <div class="builder-layout"> <aside class="builder-components"> <h3>Components</h3> <ul> <li><button class="comp" data-comp="text">Text Field</button></li> <li><button class="comp" data-comp="date">Date Field</button></li> <li><button class="comp" data-comp="select">Select</button></li> <li><button class="comp" data-comp="table">Data Table</button></li> </ul> </aside> <section class="builder-canvas"> <p><em>Drag components here (mock)</em></p> <div id="canvasArea"> <div class="canvas-dropzone"><label>Employee</label><input type="text" disabled></div> <div class="canvas-dropzone"><label>Date</label><input type="date" disabled></div> </div> </section> <aside class="builder-properties"> <h3>Properties</h3> <form id="propForm"> <label>Label</label> <input name="label" type="text" value="Employee"> <label style="display:block;margin-top:8px">Required</label> <input name="required" type="checkbox" checked> <div style="margin-top:10px"><button type="button" id="saveProps">Save</button></div> </form> </aside> </div> <?php elseif ($screen === 'models'): ?> <h1>Data Models</h1> <div class="models-list"> <div class="entity"><strong>Employees</strong><div class="muted">fields: id, name, code, department_id</div></div> <div class="entity"><strong>Attendance</strong><div class="muted">fields: id, employee_id, date, status</div></div> <p><button class="btn">+ Create Model</button></p> </div> <?php else: ?> <h1>Unknown screen</h1> <?php endif; ?> </div> <!-- End page content --> <?php if ($useErpPartials) { require $erpFooter; } else { print_fallback_footer(); } ?>