X7ROOT File Manager
Current Path:
/home/u126090504/domains/svmbaripada.org.in/public_html/admin
home
/
u126090504
/
domains
/
svmbaripada.org.in
/
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.79 KB)
📄
dashboard.php
(27.78 KB)
📄
downloads.php
(4.91 KB)
📄
edit_faculty.php
(6.85 KB)
📄
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
(6.39 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_delete.php
(543 B)
📄
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.35 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: subject_master.php
<?php include 'secure_session.php'; include 'includes/auth.php'; require_once '../config.php'; include 'includes/header.php'; function h($v){ return htmlspecialchars($v ?? '', ENT_QUOTES, 'UTF-8'); } $msg = ''; $alertClass = 'alert-info'; /* -------- Add Subject (name + class_id) -------- */ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $name = trim($_POST['subject_name'] ?? ''); $class_id = (int)($_POST['class_id'] ?? 0); if ($name === '' || $class_id <= 0) { $msg = "⚠️ Please enter subject name and select class."; $alertClass = 'alert-warning'; } else { $stmt = $conn->prepare("INSERT INTO subjects(name, class_id) VALUES(?, ?)"); if ($stmt) { $stmt->bind_param("si", $name, $class_id); if ($stmt->execute()) { $msg = "✅ Subject added successfully."; $alertClass = 'alert-success'; } else { if ($conn->errno == 1062) { $msg = "⚠️ This subject already exists for the selected class."; $alertClass = 'alert-warning'; } else { $msg = "❌ Error adding subject: ".$conn->error; $alertClass = 'alert-danger'; } } $stmt->close(); } else { $msg = "❌ Prepare failed: ".$conn->error; $alertClass = 'alert-danger'; } } } /* -------- Delete Subject (prepared) -------- */ if (isset($_GET['del'])) { $id = (int)$_GET['del']; if ($id > 0) { $stmt = $conn->prepare("DELETE FROM subjects WHERE id=?"); if ($stmt) { $stmt->bind_param("i", $id); if ($stmt->execute()) { $msg = "🗑️ Subject deleted."; $alertClass = 'alert-success'; } else { $msg = "❌ Delete failed: ".$conn->error; $alertClass = 'alert-danger'; } $stmt->close(); } else { $msg = "❌ Prepare failed: ".$conn->error; $alertClass = 'alert-danger'; } } } /* -------- Data for UI -------- */ $classes = $conn->query("SELECT id, name FROM classes ORDER BY name ASC"); $res = $conn->query(" SELECT s.id, s.name AS subject_name, c.name AS class_name FROM subjects s LEFT JOIN classes c ON c.id = s.class_id ORDER BY c.name ASC, s.name ASC "); ?> <style> :root{ --brand:#e30613; --dark:#0a0a0a; --light:#f6f7f9; } body{ background: var(--light); font-family: 'Poppins', sans-serif; } .page-wrap{ max-width:1100px; margin:40px auto; background:#fff; border-radius:1rem; padding:2rem; box-shadow:0 8px 30px rgba(0,0,0,.05); } .page-head{ display:flex; justify-content:space-between; align-items:center; border-bottom:3px solid var(--brand); padding-bottom:.75rem; } .page-head h3{ color:var(--dark); font-weight:600; margin:0; } .shortcut-bar{ display:flex; flex-wrap:wrap; gap:.75rem; margin-top:1rem; } .shortcut-bar a{ display:inline-flex; align-items:center; gap:.5rem; background:#fff; border:1px solid rgba(227,6,19,.25); color:var(--brand); border-radius:.75rem; padding:.6rem 1.1rem; font-weight:500; text-decoration:none; transition:all .25s; } .shortcut-bar a:hover{ background:var(--brand); color:#fff; box-shadow:0 5px 20px rgba(227,6,19,.25); } .form-section{ margin-top:2rem; background:var(--light); padding:1.5rem; border-radius:.75rem; border:1px solid #e5e7eb; } .form-control:focus{ border-color:var(--brand); box-shadow:0 0 0 .2rem rgba(227,6,19,.15); } .btn-brand{ background:var(--brand); border:none; color:#fff; font-weight:600; border-radius:.5rem; transition:all .25s; } .btn-brand:hover{ background:#b9040f; box-shadow:0 4px 14px rgba(227,6,19,.35); } table{ margin-top:1.5rem; border-radius:.75rem; overflow:hidden; } thead{ background:var(--brand); color:#fff; } tbody tr:hover{ background:rgba(227,6,19,.05); } .alert{ border-radius:.75rem; font-weight:500; } </style> <div class="page-wrap"> <div class="page-head"> <h3>📗 Subject Master</h3> <div class="shortcut-bar"> <a href="class_master.php"><i class="bi bi-journal-plus"></i> Class Master</a> <a href="section_master.php"><i class="bi bi-book"></i> Section Master</a> </div> </div> <?php if($msg): ?> <div class="alert <?= $alertClass ?> mt-3"><?= h($msg) ?></div> <?php endif; ?> <!-- Form --> <form method="post" class="form-section row g-3"> <div class="col-md-5"> <label class="form-label">Class</label> <select name="class_id" class="form-control" required> <option value="">-- Select Class --</option> <?php if($classes && $classes->num_rows): while($c=$classes->fetch_assoc()): ?> <option value="<?= (int)$c['id'] ?>"><?= h($c['name']) ?></option> <?php endwhile; endif; ?> </select> </div> <div class="col-md-5"> <label class="form-label">Subject Name</label> <input type="text" name="subject_name" class="form-control" placeholder="e.g. Mathematics" required> </div> <div class="col-md-2 d-flex align-items-end"> <button class="btn btn-brand w-100">Add</button> </div> </form> <!-- Table --> <table class="table table-bordered align-middle text-center"> <thead> <tr> <th style="width:60px;">#</th> <th>Class</th> <th>Subject</th> <th style="width:150px;">Action</th> </tr> </thead> <tbody> <?php $i=1; if($res && $res->num_rows): while($row = $res->fetch_assoc()): ?> <tr> <td><?= $i++ ?></td> <td><?= h($row['class_name'] ?: '—') ?></td> <td><?= h($row['subject_name']) ?></td> <td> <a href="?del=<?= (int)$row['id'] ?>" class="btn btn-sm btn-danger" onclick="return confirm('Delete this subject?')"> <i class="bi bi-trash"></i> Delete </a> </td> </tr> <?php endwhile; else: ?> <tr><td colspan="4">No subjects yet.</td></tr> <?php endif; ?> </tbody> </table> </div> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder