🤩 File Manager - Mr.X
PHP:
8.2.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:index.php
<?php require_once 'header.php'; // Fetch quick stats try { $stmt = $pdo->query("SELECT COUNT(*) FROM quotations WHERE status = 'Pending'"); $pending_quotes = $stmt->fetchColumn(); $stmt = $pdo->query("SELECT COUNT(*) FROM quotations"); $total_quotes = $stmt->fetchColumn(); $stmt = $pdo->query("SELECT COUNT(*) FROM services WHERE is_active = 1"); $active_services = $stmt->fetchColumn(); $stmt = $pdo->query("SELECT COUNT(*) FROM gallery WHERE is_active = 1"); $gallery_items = $stmt->fetchColumn(); // Fetch recent quotations $stmt = $pdo->query("SELECT * FROM quotations ORDER BY created_at DESC LIMIT 5"); $recent_quotes = $stmt->fetchAll(); } catch (Exception $e) { $pending_quotes = 0; $total_quotes = 0; $active_services = 0; $gallery_items = 0; $recent_quotes = []; } // Projects & Clients stats try { $stmt = $pdo->query("SELECT COUNT(*) FROM projects WHERE is_active = 1"); $total_projects = $stmt->fetchColumn(); } catch(Exception $e) { $total_projects = 0; } try { $stmt = $pdo->query("SELECT COUNT(*) FROM clients WHERE is_blocked = 0"); $active_clients = $stmt->fetchColumn(); } catch(Exception $e) { $active_clients = 0; } try { $stmt = $pdo->query("SELECT COUNT(*) FROM hero_images WHERE is_active = 1"); $active_hero = $stmt->fetchColumn(); } catch(Exception $e) { $active_hero = 0; } ?> <h2 class="mb-4">Dashboard Overview</h2> <div class="row g-4 mb-4"> <div class="col-md-3"> <div class="card bg-primary text-white h-100"> <div class="card-body"> <div class="d-flex justify-content-between align-items-center"> <div> <h6 class="text-white-50">Pending Quotes</h6> <h2 class="mb-0"><?= $pending_quotes ?></h2> </div> <div class="fs-1 opacity-50"><i class="fas fa-clock"></i></div> </div> </div> </div> </div> <div class="col-md-3"> <div class="card bg-success text-white h-100"> <div class="card-body"> <div class="d-flex justify-content-between align-items-center"> <div> <h6 class="text-white-50">Total Quotes</h6> <h2 class="mb-0"><?= $total_quotes ?></h2> </div> <div class="fs-1 opacity-50"><i class="fas fa-file-invoice"></i></div> </div> </div> </div> </div> <div class="col-md-3"> <div class="card bg-warning text-dark h-100"> <div class="card-body"> <div class="d-flex justify-content-between align-items-center"> <div> <h6 class="text-dark-50 opacity-75">Active Services</h6> <h2 class="mb-0"><?= $active_services ?></h2> </div> <div class="fs-1 opacity-50"><i class="fas fa-tools"></i></div> </div> </div> </div> </div> <div class="col-md-3"> <div class="card bg-info text-white h-100"> <div class="card-body"> <div class="d-flex justify-content-between align-items-center"> <div> <h6 class="text-white-50">Gallery Items</h6> <h2 class="mb-0"><?= $gallery_items ?></h2> </div> <div class="fs-1 opacity-50"><i class="fas fa-images"></i></div> </div> </div> </div> </div> </div> <div class="row g-4 mb-5"> <div class="col-md-4"> <div class="card h-100 border-0" style="background:#1a1a2e; color:white;"> <div class="card-body d-flex justify-content-between align-items-center"> <div> <h6 class="text-white-50">Active Projects</h6> <h2 class="mb-0 text-warning"><?= $total_projects ?></h2> <a href="projects.php" class="btn btn-sm btn-outline-warning mt-2 rounded-pill">Manage Projects</a> </div> <div class="fs-1 opacity-25"><i class="fas fa-folder-open"></i></div> </div> </div> </div> <div class="col-md-4"> <div class="card h-100 border-0" style="background:#1a2e1a; color:white;"> <div class="card-body d-flex justify-content-between align-items-center"> <div> <h6 class="text-white-50">Active Clients</h6> <h2 class="mb-0 text-success"><?= $active_clients ?></h2> <a href="clients.php" class="btn btn-sm btn-outline-success mt-2 rounded-pill">Manage Clients</a> </div> <div class="fs-1 opacity-25"><i class="fas fa-users"></i></div> </div> </div> </div> <div class="col-md-4"> <div class="card h-100 border-0" style="background:#2e1a00; color:white;"> <div class="card-body d-flex justify-content-between align-items-center"> <div> <h6 class="text-white-50">Hero Slides Active</h6> <h2 class="mb-0" style="color:#D4AF37"><?= $active_hero ?></h2> <a href="hero_images.php" class="btn btn-sm mt-2 rounded-pill" style="border-color:#D4AF37;color:#D4AF37;">Manage Hero</a> </div> <div class="fs-1 opacity-25"><i class="fas fa-image"></i></div> </div> </div> </div> </div> <div class="card"> <div class="card-header d-flex justify-content-between align-items-center"> <span>Recent Quotation Requests</span> <a href="view_quotations.php" class="btn btn-sm btn-outline-primary">View All</a> </div> <div class="card-body p-0"> <div class="table-responsive"> <table class="table table-hover mb-0"> <thead class="table-light"> <tr> <th>Date</th> <th>Name</th> <th>Service Type</th> <th>Location</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php if(empty($recent_quotes)): ?> <tr><td colspan="6" class="text-center py-4">No recent quotations found.</td></tr> <?php else: ?> <?php foreach($recent_quotes as $q): ?> <tr> <td><?= date('M d, Y', strtotime($q['created_at'])) ?></td> <td><?= htmlspecialchars($q['name']) ?></td> <td><span class="badge bg-secondary"><?= htmlspecialchars($q['quotation_type']) ?></span></td> <td><?= htmlspecialchars($q['location']) ?></td> <td> <?php if($q['status'] == 'Pending'): ?> <span class="badge bg-warning text-dark">Pending</span> <?php elseif($q['status'] == 'Reviewed'): ?> <span class="badge bg-info">Reviewed</span> <?php else: ?> <span class="badge bg-success">Completed</span> <?php endif; ?> </td> <td> <a href="view_quotations.php?id=<?= $q['id'] ?>" class="btn btn-sm btn-primary">View</a> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </div> </div> <?php require_once 'footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder