<?php
    include_once '../account/session.php';
    include_once '../../scripts/bdd.php';
    if(isset($_GET['id_offer'])) {
    	if(!empty($_GET['id_offer'])) {
    		$bdd->query("DELETE FROM offer WHERE id = '".$_GET['id_offer']."'");
    		$bdd->query("DELETE FROM image WHERE id_offer = '".$_GET['id_offer']."'");
    		echo "<script>alert('deleted');</script>";
    		header("location: show.php");
    	} else {
    		echo "<script>alert('error');</script>";
    		header("location: show.php");
    	}
    } else {
    	echo "<script>alert('error');</script>";
    	header("location: show.php");
    }