X7ROOT File Manager
Current Path:
/home/u126090504/domains/oca.org.in/public_html/admin
home
/
u126090504
/
domains
/
oca.org.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.73 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: admissions.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 = ""; // ✅ Delete Admission if (isset($_GET['delete'])) { if (!isset($_GET['csrf']) || !hash_equals($_SESSION['csrf'], $_GET['csrf'])) { die("❌ CSRF validation failed."); } $id = intval($_GET['delete']); $stmt = $conn->prepare("DELETE FROM admissions WHERE id=?"); $stmt->bind_param("i", $id); if ($stmt->execute()) { $success = "⚠️ Admission record deleted."; } else { $error = "❌ Failed to delete record."; } } // ✅ Export CSV if (isset($_GET['export']) && $_GET['export'] === "csv") { header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=admissions_export.csv'); $output = fopen("php://output", "w"); fputcsv($output, ["ID","Name","Father's Name","Phone","Email","DOB","Address","School/College","Course","Message","Date"]); $res = $conn->query("SELECT * FROM admissions ORDER BY id DESC"); while ($row = $res->fetch_assoc()) { fputcsv($output, $row); } fclose($output); exit; } // ✅ Export PDF if (isset($_GET['export']) && $_GET['export'] === "pdf") { require_once("../tcpdf/tcpdf.php"); // ⚠️ Make sure tcpdf installed $pdf = new TCPDF(); $pdf->AddPage(); $pdf->SetFont("dejavusans", "", 10); $html = "<h3>Admission Applications</h3><table border='1' cellpadding='4'> <tr> <th><b>ID</b></th> <th><b>Name</b></th> <th><b>Father's Name</b></th> <th><b>Phone</b></th> <th><b>Email</b></th> <th><b>DOB</b></th> <th><b>School/College</b></th> <th><b>Course</b></th> <th><b>Date</b></th> </tr>"; $res = $conn->query("SELECT * FROM admissions ORDER BY id DESC"); while ($row = $res->fetch_assoc()) { $html .= "<tr> <td>{$row['id']}</td> <td>".htmlspecialchars($row['name'])."</td> <td>".htmlspecialchars($row['father_name'])."</td> <td>{$row['phone']}</td> <td>{$row['email']}</td> <td>{$row['dob']}</td> <td>".htmlspecialchars($row['school'])."</td> <td>{$row['course']}</td> <td>{$row['created_at']}</td> </tr>"; } $html .= "</table>"; $pdf->writeHTML($html); $pdf->Output("admissions_export.pdf", "D"); exit; } ?> <div class="container mt-4"> <h3>📋 Admission Applications</h3> <?php if ($success): ?><div class="alert alert-success"><?php echo $success; ?></div><?php endif; ?> <?php if ($error): ?><div class="alert alert-danger"><?php echo $error; ?></div><?php endif; ?> <div class="mb-3"> <a href="dashboard.php" class="btn btn-primary btn-sm"><i class="fa fa-home"></i> Back to Dashboard</a> <a href="?export=csv" class="btn btn-success btn-sm"><i class="fa fa-file-excel"></i> Export to Excel</a> </div> <div class="table-responsive mt-3"> <table class="table table-bordered table-hover text-center"> <thead class="thead-dark"> <tr> <th>ID</th> <th>Name</th> <th>Father's Name</th> <th>Phone</th> <th>Email</th> <th>DOB</th> <th>Address</th> <th>School/College</th> <th>Course</th> <th>Message</th> <th>Date</th> <th>Action</th> </tr> </thead> <tbody> <?php $res = $conn->query("SELECT * FROM admissions ORDER BY id DESC"); if ($res->num_rows > 0) { while ($row = $res->fetch_assoc()) { echo "<tr> <td>{$row['id']}</td> <td>".htmlspecialchars($row['name'])."</td> <td>".htmlspecialchars($row['father_name'])."</td> <td>".htmlspecialchars($row['phone'])."</td> <td>".htmlspecialchars($row['email'])."</td> <td>{$row['dob']}</td> <td>".htmlspecialchars($row['address'])."</td> <td>".htmlspecialchars($row['school'])."</td> <td>{$row['course']}</td> <td>".htmlspecialchars($row['message'])."</td> <td>{$row['created_at']}</td> <td> <a href='?delete={$row['id']}&csrf={$_SESSION['csrf']}' class='btn btn-danger btn-sm' onclick='return confirm(\"Delete this admission?\")'> Delete </a> </td> </tr>"; } } else { echo "<tr><td colspan='12'>No Admissions Found</td></tr>"; } ?> </tbody> </table> </div> </div> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder