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: manage_videos.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 = ""; // Add Video if ($_SERVER['REQUEST_METHOD'] == 'POST') { $title = trim($_POST['title']); $video_url = trim($_POST['video_url']); if (!empty($title) && !empty($video_url)) { $stmt = $conn->prepare("INSERT INTO videos (title, video_url) VALUES (?, ?)"); $stmt->bind_param("ss", $title, $video_url); $stmt->execute(); echo "<div class='alert alert-success'>✅ Video Added Successfully!</div>"; } else { echo "<div class='alert alert-danger'>⚠ Please enter both title and video URL.</div>"; } } // Delete Video if (isset($_GET['delete'])) { $id = intval($_GET['delete']); $conn->query("DELETE FROM videos WHERE id=$id"); echo "<div class='alert alert-warning'>🗑 Video Deleted!</div>"; } ?> <div class="container mt-4"> <h2 class="mb-4"><i class="fas fa-video"></i> Manage Video Gallery</h2> <!-- Add Video Form --> <form method="POST" class="mb-4"> <div class="form-group"> <label>Video Title</label> <input type="text" name="title" class="form-control" placeholder="Enter video title" required> </div> <div class="form-group"> <label>Video URL (YouTube or Google Drive)</label> <input type="text" name="video_url" class="form-control" placeholder="https://..." required> </div> <button type="submit" class="btn btn-primary">Add Video</button> <a href="dashboard.php" class="btn btn-secondary">⬅ Back to Dashboard</a> </form> <!-- All Videos List --> <h4 class="mt-5">📺 All Videos</h4> <table class="table table-bordered table-striped"> <thead class="thead-dark"> <tr> <th>ID</th> <th>Title</th> <th>Preview</th> <th>Action</th> </tr> </thead> <tbody> <?php $res = $conn->query("SELECT * FROM videos ORDER BY id DESC"); if ($res->num_rows > 0) { while ($row = $res->fetch_assoc()) { $video_url = $row['video_url']; // Convert YouTube link to embed if (strpos($video_url, "youtube.com") !== false || strpos($video_url, "youtu.be") !== false) { if (strpos($video_url, "watch?v=") !== false) { $video_url = str_replace("watch?v=", "embed/", $video_url); } elseif (strpos($video_url, "youtu.be") !== false) { $video_url = str_replace("youtu.be/", "www.youtube.com/embed/", $video_url); } } // Convert Google Drive link to embed if (strpos($video_url, "drive.google.com") !== false) { $video_url = str_replace("view?usp=sharing", "preview", $video_url); } echo "<tr> <td>{$row['id']}</td> <td>{$row['title']}</td> <td> <iframe width='200' height='120' src='{$video_url}' frameborder='0' allowfullscreen></iframe> </td> <td> <a href='manage_videos.php?delete={$row['id']}' class='btn btn-danger btn-sm' onclick=\"return confirm('Are you sure?')\">Delete</a> </td> </tr>"; } } else { echo "<tr><td colspan='4' class='text-center'>No videos added yet.</td></tr>"; } ?> </tbody> </table> </div> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder