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: achv_list.php
<?php // /admin/achv_list.php — Manage Achievements (MySQLi) include 'secure_session.php'; include 'includes/auth.php'; require_once '../config.php'; include 'includes/header.php'; ini_set('display_errors', 1); error_reporting(E_ALL); if (empty($_SESSION['csrf_token'])) $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); $csrf = $_SESSION['csrf_token']; $errors = []; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!isset($_POST['csrf']) || !hash_equals($_SESSION['csrf_token'], $_POST['csrf'])) { $errors[] = 'Invalid request token.'; } else { $action = $_POST['action'] ?? ''; // Toggle Active Status if ($action === 'toggle' && isset($_POST['id']) && ctype_digit($_POST['id'])) { $id = (int)$_POST['id']; $res = $conn->query("SELECT is_active FROM achievements WHERE id={$id}"); if ($row = $res->fetch_assoc()) { $new = $row['is_active'] ? 0 : 1; $stmt = $conn->prepare("UPDATE achievements SET is_active=? WHERE id=?"); $stmt->bind_param("ii", $new, $id); if ($stmt->execute()) $success = 'Status updated.'; else $errors[] = $stmt->error; $stmt->close(); } } // Delete Record if ($action === 'delete' && isset($_POST['id']) && ctype_digit($_POST['id'])) { $id = (int)$_POST['id']; $stmt = $conn->prepare("SELECT image_path FROM achievements WHERE id=?"); $stmt->bind_param("i", $id); $stmt->execute(); $res = $stmt->get_result(); if ($row = $res->fetch_assoc()) { if ($row['image_path']) { $abs = dirname(__DIR__) . '/' . $row['image_path']; if (is_file($abs)) @unlink($abs); } } $stmt->close(); $stmt = $conn->prepare("DELETE FROM achievements WHERE id=?"); $stmt->bind_param("i", $id); if ($stmt->execute()) $success = 'Deleted.'; else $errors[] = $stmt->error; $stmt->close(); } // Save Order if ($action === 'save_order' && isset($_POST['orders']) && is_array($_POST['orders'])) { $stmt = $conn->prepare("UPDATE achievements SET display_order=? WHERE id=?"); foreach ($_POST['orders'] as $id => $ord) { if (ctype_digit((string)$id) && is_numeric($ord)) { $oid = (int)$id; $o = (int)$ord; $stmt->bind_param("ii", $o, $oid); $stmt->execute(); } } $stmt->close(); $success = 'Order saved.'; } } $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); $csrf = $_SESSION['csrf_token']; } $rows = []; $res = $conn->query("SELECT * FROM achievements ORDER BY display_order ASC, created_at DESC"); while ($r = $res->fetch_assoc()) $rows[] = $r; ?> <style> body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; background: #f6f7fb; margin: 0; padding: 0; } .main-wrapper { margin-left: 260px; /* adjust to sidebar width */ margin-top: 90px; /* adjust to header height */ padding: 24px; } .card { max-width: 1100px; margin: 0 auto; background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.08); padding: 24px; } h1 { margin: 0 0 16px; } table { width: 100%; border-collapse: collapse; } th, td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; } .badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; } .on { background: #e8fff1; color: #177a3f; } .off { background: #ffe8e8; color: #8a1f1f; } .thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; } .nav { margin: 0 auto 16px; max-width: 1100px; display: flex; gap: 10px; } .nav a { padding: 8px 12px; text-decoration: none; border-radius: 12px; background: #fff; border: 1px solid #eee; color: #222; } .btn { padding: 8px 12px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 700; } .btn-primary { background: #ea0000; color: #fff; } .btn-link { background: transparent; color: #0b5ed7; text-decoration: underline; cursor: pointer; border: 0; } input[type="number"] { width: 90px; padding: 8px; border: 1px solid #e3e3e8; border-radius: 10px; } .actions form { display: inline; } .alert { max-width: 1100px; margin: 0 auto 12px; padding: 12px 14px; border-radius: 12px; } .alert-ok { background: #e8fff1; color: #177a3f; border: 1px solid #c8f2d8; } .alert-err { background: #ffe8e8; color: #8a1f1f; border: 1px solid #ffd2d2; } </style> <div class="main-wrapper"> <div class="nav"> <a href="achv_upload.php">Add</a> <a href="achv_list.php">Manage</a> </div> <?php if($success): ?> <div class="alert alert-ok"><?= htmlspecialchars($success) ?></div> <?php endif; ?> <?php if($errors): ?> <div class="alert alert-err"><?= implode('<br>', array_map('htmlspecialchars', $errors)) ?></div> <?php endif; ?> <div class="card"> <h1>Manage Achievements</h1> <form method="post"> <input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>"> <input type="hidden" name="action" value="save_order"> <table> <thead> <tr> <th>#</th> <th>Thumb</th> <th>Title</th> <th>Category</th> <th>Date</th> <th>Active</th> <th>Order</th> <th>Actions</th> </tr> </thead> <tbody> <?php if(!$rows): ?> <tr><td colspan="8" style="text-align:center;color:#888">No records</td></tr> <?php else: foreach($rows as $i=>$r): ?> <tr> <td><?= $i+1 ?></td> <td> <?php if($r['image_path']): ?> <img class="thumb" src="../<?= htmlspecialchars($r['image_path']) ?>"> <?php endif; ?> </td> <td> <strong><?= htmlspecialchars($r['title']) ?></strong><br> <small style="color:#666"><?= htmlspecialchars($r['sub_title'] ?? '') ?></small> </td> <td><?= ucfirst($r['category']) ?></td> <td><?= $r['event_date'] ?: '—' ?></td> <td><span class="badge <?= $r['is_active'] ? 'on' : 'off' ?>"><?= $r['is_active'] ? 'ON' : 'OFF' ?></span></td> <td><input type="number" name="orders[<?= $r['id'] ?>]" value="<?= $r['display_order'] ?>"></td> <td class="actions"> <!-- Toggle --> <form method="post" style="display:inline"> <input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>"> <input type="hidden" name="action" value="toggle"> <input type="hidden" name="id" value="<?= $r['id'] ?>"> <button class="btn btn-link" type="submit"><?= $r['is_active'] ? 'Deactivate' : 'Activate' ?></button> </form> <!-- Image --> <?php if($r['image_path']): ?> <a class="btn-link" target="_blank" href="../<?= htmlspecialchars($r['image_path']) ?>">Image</a> <?php endif; ?> <!-- External Link --> <?php if($r['external_link']): ?> <a class="btn-link" target="_blank" href="<?= htmlspecialchars($r['external_link']) ?>">Link</a> <?php endif; ?> <!-- Delete --> <form method="post" style="display:inline" onsubmit="return confirm('Delete this item?');"> <input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>"> <input type="hidden" name="action" value="delete"> <input type="hidden" name="id" value="<?= $r['id'] ?>"> <button class="btn btn-link" type="submit">Delete</button> </form> </td> </tr> <?php endforeach; endif; ?> </tbody> </table> <div style="margin-top:12px"> <button class="btn btn-primary" type="submit">Save Order</button> </div> </form> </div> </div> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder