X7ROOT File Manager
Current Path:
/home/u408670528/domains/vittoriabeltrame.com/public_html/admin
home
/
u408670528
/
domains
/
vittoriabeltrame.com
/
public_html
/
admin
/
📁
..
📄
.DS_Store
(6 KB)
📁
ajax
📄
artists.php
(6.87 KB)
📄
artists_delete.php
(309 B)
📄
artists_edit.php
(6.06 KB)
📄
artists_edit2.php
(519 B)
📄
artists_new.php
(5.8 KB)
📄
artists_new2.php
(663 B)
📄
blog.php
(6.94 KB)
📄
blog_delete.php
(648 B)
📄
blog_edit.php
(10.43 KB)
📄
blog_edit2.php
(2.28 KB)
📄
blog_new.php
(9.71 KB)
📄
blog_new2.php
(1.44 KB)
📄
changepsw.php
(535 B)
📁
css
📄
exhibitions.php
(7.41 KB)
📄
exhibitions_delete.php
(879 B)
📄
exhibitions_edit.php
(7.74 KB)
📄
exhibitions_edit2.php
(3.98 KB)
📄
exhibitions_new.php
(7.4 KB)
📄
exhibitions_new2.php
(2.52 KB)
📁
img
📁
includes
📄
index.php
(9.63 KB)
📁
js
📄
logout.php
(78 B)
📄
press.php
(7.01 KB)
📄
press_delete.php
(507 B)
📄
press_edit.php
(5.34 KB)
📄
press_edit2.php
(834 B)
📄
press_new.php
(5.13 KB)
📄
press_new2.php
(606 B)
📁
vendor
📄
works.php
(7.2 KB)
📄
works_delete.php
(500 B)
📄
works_edit.php
(6.86 KB)
📄
works_edit2.php
(939 B)
📄
works_new.php
(6.3 KB)
📄
works_new2.php
(657 B)
Editing: exhibitions_edit2.php
<?php session_start(); if(isset($_SESSION["validado"])!=true){ header("Location:../index.php?ventrada=fail"); exit(); } include("../includes/conexiones.php"); $id=$_POST["cid"]; $exName=$_POST["fullname"]; $exAuth=$_POST["author"]; $start=date("Y-m-d",strtotime($_POST['start'])); $end=date("Y-m-d",strtotime($_POST['end'])); $venue=$_POST["venue"]; $descr=$_POST["cdescription"]; $pic=$_FILES["cpic"]["name"]; // Prepare and execute the update statement for exhibitions $stmt = $con->prepare("UPDATE exhibitions SET ex_name=?, author=?, start_date=?, end_date=?, venue=?, text=? WHERE id=?"); $stmt->bind_param("ssssssi", $exName, $exAuth, $start, $end, $venue, $descr, $id); $stmt->execute(); $stmt->close(); // Check if a new picture is uploaded and handle it if ($pic != "") { $stmt = $con->prepare("SELECT photo FROM exhibitions WHERE id=?"); $stmt->bind_param("i", $id); $stmt->execute(); $stmt->bind_result($oldPic); $stmt->fetch(); $stmt->close(); $stmt = $con->prepare("UPDATE exhibitions SET photo=? WHERE id=?"); $stmt->bind_param("si", $pic, $id); if ($stmt->execute()) { copy($_FILES["cpic"]["tmp_name"], "../assets/img/exhibitions/" . $pic); unlink("../assets/img/exhibitions/" . $oldPic); } $stmt->close(); } // Handle slider images if any are uploaded if ($_FILES['slider']['name'][0] != "") { $stmt = $con->prepare("SELECT id, picture FROM slider WHERE id_exh=?"); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); while ($row = $result->fetch_assoc()) { $oldSliderPic = $row['picture']; $oldId = $row['id']; $stmt2 = $con->prepare("DELETE FROM slider WHERE id=?"); $stmt2->bind_param("i", $oldId); if ($stmt2->execute()) { unlink("../assets/img/exhibitions/slider/" . $oldSliderPic); } $stmt2->close(); } $stmt->close(); $countFiles = count($_FILES['slider']['name']); for ($i = 0; $i < $countFiles; $i++) { $fileName = $_FILES['slider']['name'][$i]; $stmt = $con->prepare("INSERT INTO slider (id_exh, picture) VALUES (?, ?)"); $stmt->bind_param("is", $id, $fileName); if ($stmt->execute()) { move_uploaded_file($_FILES['slider']['tmp_name'][$i], '../assets/img/exhibitions/slider/' . $fileName); } $stmt->close(); } } header("Location: exhibitions.php?vexhibition=modified"); exit(); ?> <!-- $sql="UPDATE exhibitions SET ex_name='$exName', author='$exAuth', start_date='$start', end_date= '$end', venue='$venue', text='$descr' WHERE (id=$id)"; mysqli_query($con, $sql); if ($pic!=""){ $sql="SELECT photo FROM exhibitions WHERE (id=$id)"; $resultado=mysqli_query($con,$sql); $fila=mysqli_fetch_array($resultado); $oldPic=$fila["photo"]; $sql="UPDATE exhibitions SET photo='$pic' WHERE (id=$id)"; if(mysqli_query($con,$sql)){ copy($_FILES["cpic"]["tmp_name"],"../assets/img/exhibitions/".$pic); unlink("../assets/img/exhibitions/".$oldPic); }; }; if(($_FILES['slider']['name'][0])!="") { $sql="SELECT * FROM slider WHERE id_exh=$id"; $res=mysqli_query($con,$sql); while($row=mysqli_fetch_array($res)) { $oldSliderPic=$row['picture']; $oldId=$row['id']; $sql2="DELETE FROM slider WHERE (id = $oldId)"; if(mysqli_query($con,$sql2)){unlink("../assets/img/exhibitions/slider/".$oldSliderPic);} } $countFiles=count($_FILES['slider']['name']); for($i=0; $i<$countFiles;$i++) { $fileName=$_FILES['slider']['name'][$i]; $sql="INSERT INTO slider (id_exh, picture) VALUES ($id, '$fileName')"; if(mysqli_query($con,$sql)) { move_uploaded_file($_FILES['slider']['tmp_name'][$i], '../assets/img/exhibitions/slider/'.$fileName); }; }; }; header("location:exhibitions.php?vexhibition=modified"); -->
Upload File
Create Folder