X7ROOT File Manager
Current Path:
/home/u126090504/domains/sketkaranjia.com/public_html/admin
home
/
u126090504
/
domains
/
sketkaranjia.com
/
public_html
/
admin
/
π
..
π
achievers.php
(21.44 KB)
π
achv_cat_manage.php
(7.99 KB)
π
achv_edit.php
(9.58 KB)
π
achv_list.php
(8.08 KB)
π
achv_upload.php
(13.39 KB)
π
admin-academic-calendar.php
(20.41 KB)
π
admin-public-disclosure.php
(18.36 KB)
π
admissions.php
(28.76 KB)
π
admissions_error.log
(56 KB)
π
assets
π
banners.php
(9.78 KB)
π
branding_settings.php
(5.93 KB)
π
change_password.php
(3.01 KB)
π
class_master.php
(4.32 KB)
π
contacts.php
(3.83 KB)
π
dashboard.php
(27.76 KB)
π
downloads.php
(4.91 KB)
π
edit_faculty.php
(6.85 KB)
π
events.php
(920 B)
π
export_franchise.php
(930 B)
π
faculty.php
(8.36 KB)
π
fees_list.php
(8.48 KB)
π
fees_upload.php
(6.19 KB)
π
forgot_password.php
(5.76 KB)
π
franchise.php
(7.28 KB)
π
gallery.php
(3.08 KB)
π
grievance-update.php
(1003 B)
π
grievance-view.php
(8.51 KB)
π
grievances.php
(9.55 KB)
π
homework_add.php
(5.98 KB)
π
homework_edit.php
(9.39 KB)
π
homework_list.php
(2.24 KB)
π
img
π
includes
π
index.php
(82 B)
π
login.php
(13.47 KB)
π
logout.php
(102 B)
π
manage_albums.php
(10.82 KB)
π
manage_media.php
(11.77 KB)
π
manage_photos.php
(6.35 KB)
π
manage_videos.php
(18.38 KB)
π
managing-committee.php
(13.64 KB)
π
master_menu.php
(5.75 KB)
π
master_menu_debug.php
(3.73 KB)
π
new_password.php
(3.9 KB)
π
non_academic_achievers.php
(21.2 KB)
π
notice.php
(15.52 KB)
π
notice_error.log
(38.45 KB)
π
notices.php
(8.24 KB)
π
payments.php
(14.96 KB)
π
phpmailer
π
popup.php
(14.07 KB)
π
reset_password.php
(2.27 KB)
π
section_master.php
(6.59 KB)
π
sections_by_class.php
(346 B)
π
secure_session.php
(1000 B)
π
settings.php
(8.34 KB)
π
student_photo_update.php
(1.8 KB)
π
subject_master.php
(6.16 KB)
π
submit-grievance.php
(4.97 KB)
π
testimonials.php
(15.15 KB)
π
update_status.php
(1.66 KB)
π
upi_settings.php
(1.52 KB)
Editing: managing-committee.php
<?php // governing-body-manage.php β Red theme + search/filter + no left sidebar gap // ----- enable only while debugging ----- // ini_set('display_errors', 1); // error_reporting(E_ALL); include __DIR__ . '/secure_session.php'; include __DIR__ . '/includes/auth.php'; require_once __DIR__ . '/../config.php'; include __DIR__ . '/includes/header.php'; if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); } // CSRF token if (empty($_SESSION['csrf'])) { $_SESSION['csrf'] = bin2hex(random_bytes(32)); } $csrf = $_SESSION['csrf']; function e($v){ return htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8'); } function trim_text($t,$n=120){ if (function_exists('mb_strlen')) { return mb_strlen($t,'UTF-8')>$n ? mb_substr($t,0,$n,'UTF-8').'β¦' : $t; } return strlen($t)>$n ? substr($t,0,$n).'β¦' : $t; } $errors = []; $notice = null; if (!isset($conn) || !($conn instanceof mysqli)) { echo "<pre style='background:#fee;border-left:4px solid #f00;padding:10px'>Config error: \$conn (mysqli) not available. Check ../config.php</pre>"; exit; } /* ---------- Create / Update ---------- */ if ($_SERVER['REQUEST_METHOD']==='POST') { if (!hash_equals($_SESSION['csrf'] ?? '', $_POST['csrf'] ?? '')) { $errors[] = 'Invalid CSRF.'; } else { $id = isset($_POST['id']) ? (int)$_POST['id'] : 0; $name = trim($_POST['name'] ?? ''); $designation = trim($_POST['designation'] ?? ''); $role = trim($_POST['role_responsibility'] ?? ''); $sort = (int)($_POST['sort_order'] ?? 0); $status = ($_POST['status'] ?? 'active') === 'inactive' ? 'inactive' : 'active'; if ($name==='') $errors[] = 'Name is required.'; if ($designation==='') $errors[] = 'Designation is required.'; if ($role==='') $errors[] = 'Role/Responsibility is required.'; if (!$errors) { if ($id > 0) { $stmt = $conn->prepare( "UPDATE governing_body_members SET name=?, designation=?, role_responsibility=?, sort_order=?, status=? WHERE id=?" ); $stmt->bind_param("sssisi", $name, $designation, $role, $sort, $status, $id); $stmt->execute(); $stmt->close(); $notice = 'Updated successfully.'; } else { $stmt = $conn->prepare( "INSERT INTO governing_body_members (name, designation, role_responsibility, sort_order, status) VALUES (?,?,?,?,?)" ); $stmt->bind_param("sssis", $name, $designation, $role, $sort, $status); $stmt->execute(); $stmt->close(); $notice = 'Added successfully.'; } } } } /* ---------- Delete ---------- */ if (($_GET['action'] ?? '') === 'delete' && isset($_GET['id'])) { if (!hash_equals($_SESSION['csrf'] ?? '', $_GET['csrf'] ?? '')) { $errors[] = 'Invalid CSRF.'; } else { $id = (int)$_GET['id']; $stmt = $conn->prepare("DELETE FROM governing_body_members WHERE id=?"); $stmt->bind_param("i", $id); $stmt->execute(); $stmt->close(); $notice = 'Deleted successfully.'; } } /* ---------- Filters (Search + Status) ---------- */ $q = trim($_GET['q'] ?? ''); $filter_status = $_GET['status'] ?? 'all'; // all | active | inactive $where = "WHERE 1 "; $params = []; $types = ""; if ($q !== "") { $where .= "AND (name LIKE CONCAT('%',?,'%') OR designation LIKE CONCAT('%',?,'%') OR role_responsibility LIKE CONCAT('%',?,'%')) "; $params[] = $q; $params[] = $q; $params[] = $q; $types .= "sss"; } if ($filter_status === 'active' || $filter_status === 'inactive') { $where .= "AND status = ? "; $params[] = $filter_status; $types .= "s"; } /* ---------- Load list ---------- */ $list = []; $sql = "SELECT * FROM governing_body_members $where ORDER BY sort_order ASC, name ASC"; if ($params) { $stmt = $conn->prepare($sql); $stmt->bind_param($types, ...$params); $stmt->execute(); $res = $stmt->get_result(); while($row = $res->fetch_assoc()) { $list[] = $row; } $stmt->close(); } else { $res = $conn->query($sql); if ($res) { while($row = $res->fetch_assoc()) { $list[] = $row; } $res->close(); } } /* ---------- Load item for edit ---------- */ $edit = null; if (($_GET['action'] ?? '') === 'edit' && isset($_GET['id'])) { $id = (int)$_GET['id']; $stmt = $conn->prepare("SELECT * FROM governing_body_members WHERE id=?"); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); $edit = $result->fetch_assoc(); $stmt->close(); } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Manage Managing Committee</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> :root{ --bg:#ffffff; --text:#1f2937; --muted:#6b7280; --accent:#ef4444; /* red */ --accent-2:#dc2626; /* darker red */ --soft:#f3f4f6; --border:#e5e7eb; --radius:12px; } /* No extra left margin (so sidebar gap won't double) */ html,body{height:100%;} body{ margin:0 !important; background:var(--bg); color:var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif; font-size:15px; line-height:1.5; } .page{ padding:24px; } /* Header like screenshot */ .heading{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; } .heading h2{ margin:0; font-size:22px; font-weight:800; display:flex; align-items:center; gap:10px; } .heading .underline{ height:3px; width:120px; background:var(--accent); border-radius:999px; margin-top:8px; } .chip{ font-size:12px; color:#374151; background:#fff; border:1px solid var(--border); padding:6px 10px; border-radius:999px; } .btn{ display:inline-block; border:0; border-radius:999px; padding:10px 14px; background:var(--accent); color:#fff; cursor:pointer; font-weight:700; } .btn:hover{ background:var(--accent-2); } .btn.gray{ background:#6b7280; } .btn.gray:hover{ background:#4b5563; } .btn.ghost{ background:#fff; color:var(--accent); border:1px solid var(--accent); } .section-card{ background:#fff; border:1px solid var(--border); border-radius:16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); margin-top:18px; } .section-head{ padding:12px 16px; border-bottom:1px solid var(--border); font-weight:700; background: #fafafa; border-top-left-radius:16px; border-top-right-radius:16px; } .section-body{ padding:16px; } /* Form */ label{display:block; font-size:13px; color:#374151; margin-bottom:6px;} input, textarea, select{ width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:#fff; color:var(--text); outline:none; } textarea{min-height:110px; resize:vertical;} .row{display:flex; gap:12px;} .row>.col{flex:1;} .mt-12{margin-top:12px;} /* Filters/search bar like screenshot */ .filters{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; } .filters .grow{ flex:1; min-width:260px; } .filters input[type="text"]{ border-radius:999px; } /* Table */ table{ width:100%; border-collapse:collapse; } th,td{ padding:12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; } th{ background:#fafafa; font-weight:800; font-size:13px; } tr:hover td{ background:#fbfbfb; } .row-actions a{ display:inline-block; margin-right:10px; text-decoration:none; color:var(--accent); font-weight:700; } .badge{ display:inline-block; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; background:#fee2e2; color:#991b1b; border:1px solid #fecaca; } .badge.ok{ background:#fee2e2; color:#991b1b; } .badge.active{ background:#fee2e2; color:#991b1b; } /* red pill like screenshot */ .badge.inactive{ background:#f3f4f6; color:#374151; border:1px solid var(--border); } .notice{ background:#fef3c7; border:1px solid #fde68a; color:#92400e; padding:10px 12px; border-radius:10px; margin:10px 0; } .notice.ok{ background:#e0f2fe; border-color:#bae6fd; color:#075985; } .notice.err{ background:#fee2e2; border-color:#fecaca; color:#7f1d1d; } </style> </head> <body> <div class="page" id="pageRoot"> <div class="heading"> <div> <h2>π Manage Managing Committee</h2> <div class="underline"></div> </div> <div class="chip">Records are auto-sorted by βSort Orderβ</div> </div> <?php if($notice): ?><div class="notice ok"><?= e($notice) ?></div><?php endif; ?> <?php if($errors): ?><div class="notice err"><?= e(implode(' ', $errors)) ?></div><?php endif; ?> <!-- Create / Edit form --> <div class="section-card"> <div class="section-head"><?= $edit ? 'Edit Member' : 'Add Member' ?></div> <div class="section-body"> <form method="post" autocomplete="off"> <input type="hidden" name="csrf" value="<?= e($csrf) ?>"> <input type="hidden" name="id" value="<?= $edit ? (int)$edit['id'] : 0 ?>"> <div class="row"> <div class="col"> <label>Name</label> <input name="name" required value="<?= e($edit['name'] ?? '') ?>"> </div> <div class="col"> <label>Designation</label> <input name="designation" required value="<?= e($edit['designation'] ?? '') ?>"> </div> </div> <div class="row mt-12"> <div class="col"> <label>Sort Order</label> <input type="number" name="sort_order" value="<?= e($edit['sort_order'] ?? 0) ?>"> </div> <div class="col"> <label>Status</label> <select name="status"> <option value="active" <?= (($edit['status'] ?? 'active')==='active')?'selected':'' ?>>Active</option> <option value="inactive" <?= (($edit['status'] ?? '')==='inactive')?'selected':'' ?>>Inactive</option> </select> </div> </div> <div class="mt-12"> <label>Role / Responsibility</label> <textarea name="role_responsibility" required><?= e($edit['role_responsibility'] ?? '') ?></textarea> </div> <div class="mt-12"> <button class="btn" type="submit"><?= $edit ? 'Update Member' : 'Add Member' ?></button> <?php if($edit): ?> <a class="btn gray" href="governing-body-manage.php">Cancel</a> <?php endif; ?> </div> </form> </div> </div> <!-- Filters / Search like screenshot --> <div class="section-card"> <div class="section-head">Filters</div> <div class="section-body"> <form method="get" class="filters"> <input type="hidden" name="action" value=""> <div class="grow"> <label style="margin-bottom:6px; display:block; font-size:13px; color:#374151;">Search</label> <input type="text" name="q" placeholder="Name, designation, roleβ¦" value="<?= e($q) ?>"> </div> <div> <label style="margin-bottom:6px; display:block; font-size:13px; color:#374151;">Status</label> <select name="status" style="padding:10px 12px; border-radius:999px; border:1px solid var(--border);"> <option value="all" <?= $filter_status==='all'?'selected':'' ?>>All</option> <option value="active" <?= $filter_status==='active'?'selected':'' ?>>Active</option> <option value="inactive" <?= $filter_status==='inactive'?'selected':'' ?>>Inactive</option> </select> </div> <div style="align-self:flex-end"> <button class="btn" type="submit">Apply</button> </div> </form> </div> </div> <!-- Members table --> <div class="section-card"> <div class="section-head">All Members</div> <div class="section-body" style="padding:0;"> <table> <thead> <tr> <th style="width:7%">#</th> <th style="width:24%">Name</th> <th style="width:20%">Designation</th> <th>Status</th> <th>Role / Responsibility</th> <th style="width:16%">Action</th> </tr> </thead> <tbody> <?php if(empty($list)): ?> <tr><td colspan="6" style="color:#777;padding:20px;">No records found.</td></tr> <?php else: foreach($list as $r): ?> <tr> <td><?= (int)$r['sort_order'] ?></td> <td><?= e($r['name']) ?></td> <td><em><?= e($r['designation']) ?></em></td> <td> <?php if(($r['status'] ?? 'active')==='active'): ?> <span class="badge active">Active</span> <?php else: ?> <span class="badge inactive">Inactive</span> <?php endif; ?> </td> <td><?= e(trim_text($r['role_responsibility'],140)) ?></td> <td class="row-actions"> <a href="?action=edit&id=<?= (int)$r['id'] ?>">Edit</a> <a href="?action=delete&id=<?= (int)$r['id'] ?>&csrf=<?= e($csrf) ?>" onclick="return confirm('Delete this member?')">Delete</a> </td> </tr> <?php endforeach; endif; ?> </tbody> </table> </div> </div> </div> <!-- Ensure page never adds any left gap even if layout has a sidebar --> <script> (function(){ var root = document.getElementById('pageRoot'); if(root){ root.style.marginLeft = '0'; root.classList.add('no-left-offset'); } })(); </script> <?php include __DIR__ . '/includes/footer.php'; ?>
Upload File
Create Folder