<?php
require 'database.inc.php';
//session_start();
//session_register("lg_user");
//session_register("lg_password");
//session_register("lg_admin");
//session_register("lg_menu1");
//session_register("lg_menu2");
//session_register("lg_menu3");
//session_register("lg_menu4");
//session_register("lg_menu5");
//session_register("lg_menu6");
if ((!empty($User)) && (!empty($Passwd))) {
	$lg_user = $User;
	$lg_password = $Passwd;
}
if (Test_User($lg_user, $lg_password) == TRUE) {
	$requette = "DELETE FROM atelier" . ID_GARAGE . " WHERE NoAtelier=$NoAtelier";
	if ($resultat = Connection::executeRawQuery($requette)) {
		$requette = "DELETE FROM atelier_suite" . ID_GARAGE . " WHERE NoAtelier=$NoAtelier";
		Connection::executeRawQuery($requette);
		echo "<script language=JavaScript>\n";
		echo "window.opener.location.reload();\n";
		echo "window.close();\n";
		echo "</script>\n";
	} else {
		echo $requette;
		echo "<BR>KO";
	}
}
