|
Server : LiteSpeed System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : outerorb ( 1091) PHP Version : 8.1.34 Disable Function : mail Directory : /home2/outerorb/assetradar.outerorbittech.com/ | |
|
Path: /home2/outerorb/assetradar.outerorbittech.com/DOCUMENTATION.html
Size: 15.47 KB
Permissions: 0666
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AssetRadar — Documentation</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap" rel="stylesheet">
<style>
:root{--bg:#f8fafc;--card:#ffffff;--muted:#6b7280;--brand:#4f46e5;--accent:#06b6d4}
html,body{height:100%;font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);}
.doc-shell{min-height:100vh;display:flex}
.doc-sidebar{width:260px;background:linear-gradient(180deg,rgba(79,70,229,0.06),rgba(6,182,212,0.03));padding:28px;border-right:1px solid rgba(15,23,42,0.04);position:sticky;top:0;align-self:flex-start;height:100vh;overflow:auto}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.brand img{height:40px}
.brand h1{font-size:1.2rem;margin:0;color:var(--brand);letter-spacing:0.6px}
.nav-list{margin-top:10px}
.nav-list a{display:block;color:#0f172a;padding:8px 10px;border-radius:8px;margin-bottom:6px;text-decoration:none}
.nav-list a.active,.nav-list a:hover{background:var(--brand);color:#fff}
.doc-content{flex:1;padding:32px;max-width:1100px;margin:0 auto}
.doc-hero{background:linear-gradient(90deg,var(--brand),var(--accent));color:#fff;padding:28px;border-radius:12px;margin-bottom:20px}
.doc-card{background:var(--card);padding:20px;border-radius:10px;box-shadow:0 8px 30px rgba(15,23,42,0.04);margin-bottom:18px}
.doc-card h2{color:var(--brand);}
.muted{color:var(--muted)}
.doc-footer{text-align:center;color:var(--muted);margin-top:28px}
pre{background:#0f172a;color:#fff;padding:12px;border-radius:8px;overflow:auto}
@media (max-width: 900px){.doc-sidebar{display:none}.doc-shell{flex-direction:column}.doc-content{padding:18px}}
</style>
</head>
<body>
<div class="doc-shell">
<aside class="doc-sidebar d-none d-lg-block">
<div class="brand">
<img src="assets/assetradar_logo.svg" alt="AssetRadar">
</div>
<p class="muted small">Comprehensive guide for Admins, Team Leaders and Users</p>
<nav class="nav-list mt-3">
<a href="#overview" class="active">Overview</a>
<a href="#quickstart">Quick Start</a>
<a href="#configuration">Configuration</a>
<a href="#database">Database Schema</a>
<a href="#api">API Endpoints</a>
<a href="#workflows">Workflows</a>
<a href="#features">Key Features</a>
<a href="#usage">How to Use</a>
<a href="#troubleshooting">Troubleshooting</a>
<a href="#faq">FAQ</a>
<a href="#changelog">Changelog</a>
<a href="#support">Support & Contact</a>
</nav>
<div class="mt-4 small muted">© 2025 AssetRadar</div>
</aside>
<main class="doc-content">
<div class="doc-hero">
<h2 class="mb-1">IT Asset Tracker</h2>
<p class="lead mb-0">Manage inventory, assign assets, track issues, and monitor notifications — all in one modern, responsive platform.</p>
</div>
<section id="overview" class="doc-card">
<h2>System Overview</h2>
<p class="muted">The IT Asset Tracker is a web-based platform for managing IT inventory, tracking asset assignments, reporting issues, and monitoring notifications. It supports three user roles: Admin, Team Leader, and User.</p>
<ul class="mt-3">
<li>Mobile-friendly, modern UI with Bootstrap 5</li>
<li>Role-based dashboards and navigation</li>
<li>Live charts, widgets, and quick actions</li>
<li>Search, filter, pagination, and CSV export for tables</li>
<li>Inline editing and instant notifications</li>
</ul>
</section>
<section id="quickstart" class="doc-card">
<h2>Quick Start</h2>
<h5 class="mt-3">Requirements</h5>
<ul>
<li>PHP 8.0+ with mysqli and mbstring extensions</li>
<li>MySQL/MariaDB 5.7+</li>
<li>Apache or nginx webserver (XAMPP bundled Apache works well)</li>
</ul>
<h5 class="mt-3">Installation</h5>
<ol>
<li>Place the project files in your webroot (example: <code>C:\xampp\htdocs\AssetRadar</code>).</li>
<li>Create a database and import <code>database.sql</code> using phpMyAdmin or the mysql CLI.</li>
<li>Adjust DB credentials in <code>config.php</code> (DB_HOST, DB_USER, DB_PASS, DB_NAME).</li>
<li>Point your browser to the site and login using seeded accounts (see below).</li>
</ol>
<h5 class="mt-3">Seeded Accounts</h5>
<p class="muted">The sample database contains default users for quick testing: admin, team leader, and user (see README for exact credentials or check <code>database.sql</code>).</p>
</section>
<section id="configuration" class="doc-card">
<h2>Configuration</h2>
<h5 class="mt-3">Key File: <code>config.php</code></h5>
<p class="muted">Main configuration is in <code>config.php</code>. Important constants:</p>
<ul>
<li><code>DB_HOST, DB_USER, DB_PASS, DB_NAME</code> — database connection</li>
<li><code>BASE_URL</code> — base path for links and assets (update when deploying to a subfolder)</li>
</ul>
<h5 class="mt-3">Security Notes</h5>
<ul>
<li>Ensure <code>display_errors</code> is disabled in production.</li>
<li>Use strong DB credentials and limit DB user privileges where possible.</li>
<li>Consider enabling HTTPS and HSTS for production deployments.</li>
</ul>
</section>
<section id="database" class="doc-card">
<h2>Database Schema (Highlights)</h2>
<p class="muted">The project uses a small relational schema. Key tables include:</p>
<ul>
<li><strong>users</strong> — user accounts, roles and team associations.</li>
<li><strong>roles</strong> — role definitions (admin/tl/user).</li>
<li><strong>items</strong> — inventory items (asset_tag, item_name, category_id, warranty_to, assigned_to).</li>
<li><strong>tickets</strong> — issue reports linked to items and users.</li>
<li><strong>notifications</strong> — in-app notifications for users.</li>
</ul>
<h5 class="mt-3">Adding a Column / Migration</h5>
<p class="muted">Use SQL migrations in the <code>migrations/</code> folder or run manual ALTER statements. Example to add a warranty column:</p>
<pre>ALTER TABLE items ADD COLUMN warranty_expiry DATE DEFAULT NULL;</pre>
</section>
<section id="api" class="doc-card">
<h2>API Endpoints (Overview)</h2>
<p class="muted">The app exposes a small internal API used by the UI under <code>/api/</code> and <code>/admin/master_data_api.php</code>. Important endpoints:</p>
<ul>
<li><code>/api/items.php</code> — item listing and quick operations</li>
<li><code>/api/tickets.php</code> — ticket actions and status updates</li>
<li><code>/api/notifications.php</code> — fetch and mark notifications</li>
<li><code>admin/master_data_api.php</code> — CRUD for master data (roles, teams, categories, users, items, vendors)</li>
</ul>
<p class="muted">Most endpoints accept and return JSON and rely on session-based authentication (the user must be logged in).</p>
</section>
<section id="workflows" class="doc-card">
<h2>Workflows</h2>
<h5 class="mt-3">Inventory Lifecycle</h5>
<ol>
<li>Admin creates/adds an item or imports via CSV.</li>
<li>Item can be assigned to a user (assign_item.php) or left unassigned.</li>
<li>Item status can be updated inline (Working, Damaged, etc.).</li>
<li>Warranties are monitored by the Alerts & Warranties page.</li>
</ol>
<h5 class="mt-3">Ticket Lifecycle</h5>
<ol>
<li>User or TL creates a ticket for an item.</li>
<li>Assigned staff can update status and add comments.</li>
<li>When resolved, ticket can be closed — notifications are sent as needed.</li>
</ol>
</section>
<section id="roles" class="doc-card">
<h2>Roles & Permissions</h2>
<p class="muted">Different roles have different capabilities. Below is a summary.</p>
<div class="table-responsive">
<table class="table align-middle">
<thead>
<tr><th>Role</th><th>Capabilities</th></tr>
</thead>
<tbody>
<tr><td><strong>Admin</strong></td><td>Full inventory management, assign items, manage tickets, view all reports, bulk upload, audit, alerts, and master data.</td></tr>
<tr><td><strong>Team Leader</strong></td><td>View/manage team items and tickets, report issues, audit, dashboard widgets, and notifications.</td></tr>
<tr><td><strong>User</strong></td><td>View assigned items, report issues, track ticket status, receive notifications.</td></tr>
</tbody>
</table>
</div>
</section>
<section id="features" class="doc-card">
<h2>Key Features</h2>
<h5 class="mt-3">Inventory Management</h5>
<ul>
<li>View, search, filter, and export inventory</li>
<li>Assign items to users/teams (admin)</li>
<li>Inline editing for item condition and ownership</li>
</ul>
<h5 class="mt-3">Ticketing System</h5>
<ul>
<li>Report issues for assets</li>
<li>Track ticket status and history</li>
<li>Quick actions: close, update status, assign</li>
<li>Role-based ticket view and update</li>
</ul>
<h5 class="mt-3">Notifications</h5>
<ul>
<li>Live notification dropdown with auto-refresh</li>
<li>Mark as read, instant updates, and links to tickets</li>
</ul>
<h5 class="mt-3">Dashboard & Widgets</h5>
<ul>
<li>Role-specific dashboard cards and charts</li>
<li>Recent tickets, items needing attention, quick links</li>
</ul>
</section>
<section id="usage" class="doc-card">
<h2>How to Use</h2>
<h5 class="mt-3">Login & Navigation</h5>
<ul>
<li>Login with your credentials to access your dashboard</li>
<li>Use the top navigation bar for quick access to features</li>
</ul>
<h5 class="mt-3">Managing Inventory</h5>
<ul>
<li>Admins can add, edit, assign, and bulk upload items</li>
<li>Team Leaders can view team items and audit</li>
<li>Users see only their assigned items</li>
</ul>
<h5 class="mt-3">Reporting & Tracking Issues</h5>
<ul>
<li>Report issues from your dashboard or item view</li>
<li>Track ticket status and add comments</li>
<li>Admins and TLs can update status and close tickets</li>
</ul>
<h5 class="mt-3">Notifications</h5>
<ul>
<li>Check the bell icon for new notifications</li>
<li>Click to view details or mark as read</li>
</ul>
</section>
<section id="technical" class="doc-card">
<h2>Technical Details</h2>
<ul>
<li>Built with PHP, MySQL, Bootstrap 5, Chart.js</li>
<li>Role-based access control and secure authentication</li>
<li>AJAX for live updates and quick actions</li>
<li>Responsive design for desktop and mobile</li>
</ul>
<h5 class="mt-3">Files of Interest</h5>
<ul>
<li><code>config.php</code> — application bootstrap and DB connection</li>
<li><code>inc/auth.php</code> — login helpers and role checks</li>
<li><code>admin/master_data_api.php</code> — CRUD API for master data</li>
<li><code>api/</code> — lightweight internal API endpoints</li>
</ul>
</section>
<section id="troubleshooting" class="doc-card">
<h2>Troubleshooting</h2>
<h5 class="mt-3">Common Errors</h5>
<ul>
<li><strong>Unknown column</strong> in SQL: This usually means the code expects a column name different from the DB. Check <code>database.sql</code> and ensure migrations ran (e.g., <code>warranty_to</code> vs <code>warranty_expiry</code>).</li>
<li><strong>Session warnings</strong>: Ensure <code>session_start()</code> is called only once (see <code>config.php</code> for guarded startup).</li>
<li><strong>Permission denied / 403</strong>: Verify file permissions and that session auth is working for routes that require login.</li>
</ul>
<h5 class="mt-3">Debugging Tips</h5>
<ul>
<li>Enable <code>display_errors</code> locally and check Apache/PHP error logs.</li>
<li>Use the browser DevTools Network tab to inspect AJAX requests and responses.</li>
</ul>
</section>
<section id="faq" class="doc-card">
<h2>FAQ</h2>
<h5 class="mt-3">How do I change the base URL?</h5>
<p class="muted">Edit <code>BASE_URL</code> in <code>config.php</code> to match the deployment path (e.g., <code>/assetradar</code> or <code>/</code>).</p>
<h5 class="mt-3">How do I add more roles?</h5>
<p class="muted">Insert new records in the <code>roles</code> table and adjust any role-based checks in <code>inc/auth.php</code> if necessary.</p>
</section>
<section id="changelog" class="doc-card">
<h2>Changelog</h2>
<ul>
<li><strong>2025-09-13</strong> — Project scaffold and initial sample data (database.sql)</li>
<li><strong>2025-10-18</strong> — Documentation styling and sidebar improvements</li>
</ul>
</section>
<section id="support" class="doc-card">
<h2>Support & Contact</h2>
<p class="muted">For help, feature requests, or bug reports, contact your system administrator or IT support team.</p>
</section>
<div class="doc-footer">© 2025 AssetRadar — All rights reserved.</div>
</main>
</div>
<script>
// Smooth in-page navigation and active link handling
document.querySelectorAll('.nav-list a').forEach(a => {
a.addEventListener('click', function(e){
e.preventDefault();
document.querySelectorAll('.nav-list a').forEach(x=>x.classList.remove('active'));
this.classList.add('active');
const id = this.getAttribute('href').substring(1);
const el = document.getElementById(id);
if(el){ window.scrollTo({top: el.getBoundingClientRect().top + window.scrollY - 20, behavior:'smooth'}); }
});
});
// Highlight active section on scroll
const sections = document.querySelectorAll('main section');
window.addEventListener('scroll', () => {
let current = '';
sections.forEach(s => {
const top = s.getBoundingClientRect().top - 60;
if(top <= 0) current = s.id;
});
if(current){
document.querySelectorAll('.nav-list a').forEach(a => a.classList.toggle('active', a.getAttribute('href') === '#'+current));
}
});
</script>
</body>
</html>