X7ROOT File Manager
Current Path:
/home/u126090504/domains/shreeganeshacademy.in/public_html/admin
home
/
u126090504
/
domains
/
shreeganeshacademy.in
/
public_html
/
admin
/
📁
..
📄
achievers.php
(13.81 KB)
📄
admissions.php
(5.67 KB)
📄
banners.php
(7.18 KB)
📄
change_password.php
(3.54 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(9.86 KB)
📄
downloads.php
(4.91 KB)
📄
export_franchise.php
(930 B)
📄
faculty.php
(13.27 KB)
📄
forgot_password.php
(6.52 KB)
📄
franchise.php
(7.28 KB)
📄
gallery.php
(3.08 KB)
📄
governing-body-manage.php
(9.12 KB)
📄
grievance-update.php
(1003 B)
📄
grievance-view.php
(5.32 KB)
📄
grievances.php
(5.79 KB)
📁
includes
📄
index.php
(82 B)
📄
login.php
(6.59 KB)
📄
logout.php
(102 B)
📄
manage_albums.php
(2.28 KB)
📄
manage_media.php
(3.02 KB)
📄
manage_photos.php
(5.66 KB)
📄
manage_videos.php
(3.62 KB)
📄
new_password.php
(3.9 KB)
📄
notice.php
(16.36 KB)
📄
notices.php
(8.24 KB)
📄
payments.php
(15.23 KB)
📁
phpmailer
📄
popup.php
(10.68 KB)
📄
reset_password.php
(2.27 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(5.21 KB)
📄
submit-grievance.php
(4.97 KB)
📄
testimonials.php
(10.25 KB)
📄
update_status.php
(1.29 KB)
📄
upi_settings.php
(1.52 KB)
Editing: grievances.php
<?php include 'secure_session.php'; // 🔐 Always first (session security) include 'includes/auth.php'; // ✅ Your authentication check require_once '../config.php'; // ✅ DB connection include 'includes/header.php'; // ✅ Layout header $success = $error = ""; // ✅ CSRF Token if (empty($_SESSION['csrf'])) { $_SESSION['csrf'] = bin2hex(random_bytes(32)); } $success = $error = ""; $perPage = 20; $page = max(1, (int)($_GET['page'] ?? 1)); $offset = ($page - 1) * $perPage; $q = trim($_GET['q'] ?? ''); $status = trim($_GET['status'] ?? ''); $category = trim($_GET['category'] ?? ''); $where = []; $params = []; $types = ''; if ($q !== '') { $where[] = "(tracking_id LIKE ? OR name LIKE ? OR email LIKE ? OR contact LIKE ?)"; $needle = "%{$q}%"; $params[] = $needle; $params[] = $needle; $params[] = $needle; $params[] = $needle; $types .= 'ssss'; } if ($status !== '') { $where[] = "status = ?"; $params[] = $status; $types .= 's'; } if ($category !== '') { $where[] = "category = ?"; $params[] = $category; $types .= 's'; } $whereSql = $where ? ('WHERE '.implode(' AND ', $where)) : ''; $countSql = "SELECT COUNT(*) FROM grievances $whereSql"; $stmt = $conn->prepare($countSql); if ($types) { $stmt->bind_param($types, ...$params); } $stmt->execute(); $stmt->bind_result($total); $stmt->fetch(); $stmt->close(); $listSql = "SELECT id, tracking_id, name, email, category, sub_category, status, created_at FROM grievances $whereSql ORDER BY created_at DESC LIMIT $perPage OFFSET $offset"; $stmt = $conn->prepare($listSql); if ($types) { $stmt->bind_param($types, ...$params); } $stmt->execute(); $res = $stmt->get_result(); $rows = $res->fetch_all(MYSQLI_ASSOC); $stmt->close(); $totalPages = max(1, (int)ceil($total / $perPage)); // quick categories (optional – static) $cats = ['Academic','Administrative','Facilities','Disciplinary','Ragging/Harassment','Financial/Fees','Other']; // status options – adjust to match your enum EXACTLY $statuses = ['Pending','Under Review','Action Taken','Resolved']; // or ['Pending','Under_Review','Action_Taken','Resolved'] ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Grievances – Admin</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body{font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;background:#f6f7fb;margin:0;color:#111} .wrap{max-width:1100px;margin:28px auto;padding:0 16px} h1{margin:0 0 12px} .card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 6px 24px rgba(0,0,0,.06);padding:16px} .filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px} input,select{border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px} button{background:#2563eb;color:#fff;border:0;border-radius:10px;padding:9px 14px;cursor:pointer} table{width:100%;border-collapse:collapse} th,td{padding:10px;border-bottom:1px solid #eee;font-size:14px} th{background:#f9fafb;text-align:left} .badge{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px;border:1px solid #e5e7eb;background:#f3f4f6} .pager{display:flex;gap:6px;justify-content:flex-end;margin-top:10px} .pager a,.pager span{padding:6px 10px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;text-decoration:none;color:#111} .pager .active{background:#111;color:#fff;border-color:#111} </style> </head> <body> <div class="wrap"> <h1>Grievances <span class="badge"><?= (int)$total ?> total</span></h1> <div class="card"> <form class="filters" method="get"> <input type="text" name="q" placeholder="Search name/email/contact/tracking" value="<?= htmlspecialchars($q) ?>"> <select name="status"> <option value="">All Status</option> <?php foreach($statuses as $s): ?> <option value="<?= htmlspecialchars($s) ?>" <?= $status===$s?'selected':''; ?>><?= $s ?></option> <?php endforeach; ?> </select> <select name="category"> <option value="">All Category</option> <?php foreach($cats as $c): ?> <option value="<?= htmlspecialchars($c) ?>" <?= $category===$c?'selected':''; ?>><?= $c ?></option> <?php endforeach; ?> </select> <button type="submit">Filter</button> </form> <div style="overflow:auto"> <table> <thead> <tr> <th>#</th> <th>Tracking ID</th> <th>Name</th> <th>Email</th> <th>Category</th> <th>Status</th> <th>Created</th> <th>Action</th> </tr> </thead> <tbody> <?php if(!$rows): ?> <tr><td colspan="8">No records</td></tr> <?php else: foreach($rows as $i=>$r): ?> <tr> <td><?= $offset+$i+1 ?></td> <td><?= htmlspecialchars($r['tracking_id']) ?></td> <td><?= htmlspecialchars($r['name']) ?></td> <td><?= htmlspecialchars($r['email']) ?></td> <td><?= htmlspecialchars($r['category'].' / '.$r['sub_category']) ?></td> <td><span class="badge"><?= htmlspecialchars($r['status']) ?></span></td> <td><?= htmlspecialchars($r['created_at']) ?></td> <td><a href="grievance-view.php?id=<?= (int)$r['id'] ?>">View</a></td> </tr> <?php endforeach; endif; ?> </tbody> </table> </div> <div class="pager"> <?php for($p=1;$p<=$totalPages;$p++): $qs = http_build_query(['q'=>$q,'status'=>$status,'category'=>$category,'page'=>$p]); ?> <?php if ($p==$page): ?> <span class="active"><?= $p ?></span> <?php else: ?> <a href="?<?= $qs ?>"><?= $p ?></a> <?php endif; ?> <?php endfor; ?> </div> </div> </div> </body> </html>
Upload File
Create Folder