X7ROOT File Manager
Current Path:
/home/u126090504/domains/chanakyahss.org.in/public_html/admin
home
/
u126090504
/
domains
/
chanakyahss.org.in
/
public_html
/
admin
/
📁
..
📄
achievers.php
(5.15 KB)
📄
admissions.php
(5.67 KB)
📄
banners.php
(5.86 KB)
📄
change_password.php
(3.54 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(6.61 KB)
📄
downloads.php
(4.91 KB)
📄
export_franchise.php
(930 B)
📄
faculty.php
(7.22 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
(4.27 KB)
📄
manage_media.php
(3.02 KB)
📄
manage_photos.php
(6.87 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)
📄
public-disclosure.php
(7.33 KB)
📄
reset_password.php
(2.27 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(5.21 KB)
📄
submit-grievance.php
(4.97 KB)
📄
syllabus.php
(4.68 KB)
📄
testimonials.php
(10.25 KB)
📄
timetable.php
(3.68 KB)
📄
update_status.php
(1.29 KB)
📄
upi_settings.php
(1.52 KB)
Editing: timetable.php
<?php include 'secure_session.php'; include 'includes/auth.php'; require_once '../config.php'; include 'includes/header.php'; $success = ""; $error = ""; $allowed = ['pdf','jpg','jpeg','png']; $maxSize = 10 * 1024 * 1024; // 10MB /* ADD TIME TABLE */ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['add_timetable'])) { $title = trim($_POST['title']); if ($title == "") { $error = "Title is required."; } elseif (!empty($_FILES['file']['name'])) { $targetDir = "../uploads/timetable/"; if (!is_dir($targetDir)) mkdir($targetDir, 0755, true); $ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION)); if (!in_array($ext, $allowed)) { $error = "Only PDF, JPG, PNG allowed."; } elseif ($_FILES['file']['size'] > $maxSize) { $error = "Max size 10MB."; } else { $newName = time() . "_" . rand(10000,99999) . "." . $ext; $path = $targetDir . $newName; if (move_uploaded_file($_FILES['file']['tmp_name'], $path)) { $conn->query("DELETE FROM timetable"); // only one record allowed $stmt = $conn->prepare("INSERT INTO timetable (title, file_name) VALUES (?, ?)"); $stmt->bind_param("ss", $title, $newName); $stmt->execute(); $success = "Time Table uploaded successfully."; } } } } /* DELETE TIME TABLE */ if (isset($_GET['delete'])) { $res = $conn->query("SELECT file_name FROM timetable LIMIT 1"); if ($res->num_rows) { $old = $res->fetch_assoc()['file_name']; $filePath = "../uploads/timetable/" . $old; if (file_exists($filePath)) unlink($filePath); } $conn->query("DELETE FROM timetable"); $success = "Time Table Deleted"; } ?> <div class="container mt-4"> <h3>Manage Time Table</h3> <?php if ($success) echo "<div class='alert alert-success'>{$success}</div>"; ?> <?php if ($error) echo "<div class='alert alert-danger'>{$error}</div>"; ?> <div class="card mb-4"> <div class="card-header">Upload New Time Table</div> <div class="card-body"> <form method="POST" enctype="multipart/form-data"> <div class="form-group"> <label>Title</label> <input type="text" name="title" class="form-control" required> </div> <div class="form-group"> <label>File (PDF / JPG / PNG)</label> <input type="file" name="file" class="form-control" required> </div> <button type="submit" name="add_timetable" class="btn btn-primary">Upload</button> </form> </div> </div> <h4>Current Time Table</h4> <?php $res = $conn->query("SELECT * FROM timetable LIMIT 1"); if ($res->num_rows > 0) { $row = $res->fetch_assoc(); $ext = pathinfo($row['file_name'], PATHINFO_EXTENSION); $fileUrl = "../uploads/timetable/" . $row['file_name']; ?> <p><strong>Title:</strong> <?= $row['title']; ?></p> <a href="?delete=1" class="btn btn-danger btn-sm" onclick="return confirm('Delete this timetable?')">Delete</a> <br><br> <?php if ($ext == "pdf") { ?> <iframe src="<?= $fileUrl ?>" style="width:100%;height:500px;"></iframe> <?php } else { ?> <img src="<?= $fileUrl ?>" style="width:100%;height:500px;object-fit:contain;"> <?php } ?> <?php } else { ?> <p>No time table uploaded.</p> <?php } ?> </div> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder