| Current File : /home/d/i/g/digitaw/Ycof/admin/updauto.php |
<?php
require 'configuration.php';
if($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset($_POST['submit'])){
$photo="";
$id=$_POST['id'];
$photo=$_FILES['image']['name'];
$upload = "../cartegrise/".$photo;
move_uploaded_file($_FILES['image']['tmp_name'], $upload);
$req="UPDATE assuranceauto SET photo='$photo' WHERE id=$id";
$result=$connection->query($req);
if($result) {
$msg = "Modification reussie !";
$_SESSION['msg'] = "<div class='alert alert-success alert-dismissible fade show ' role='alert'>
<svg xmlns='http://www.w3.org/2000/svg' style='margin-right:10px' width='20' height='20' fill='currentColor' class='bi bi-check2-all' viewBox='0 0 16 16'>
<path d='M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z'/>
<path d='m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z'/>
</svg>
<strong style='font-size:17px;'>$msg</strong>
<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>
</div>";
header('location: ./auto.php');
}
}
}