public function delete() { $this->query("UPDATE " . Pays::TABLE . " SET zone='-1' WHERE zone=" . $this->id); parent::delete(); redirige("zone.php"); }
exit; } require_once "../fonctions/divers.php"; require_once "liste/zone.php"; if ($_POST['action'] == "ajouter" && $_POST['nomzone'] != "") { $zone = new Zone(); $zone->nom = $_POST['nomzone']; $id = $zone->add(); } else { if ($_GET['action'] == "supprimer" && $_GET['id'] != "") { $zone = new Zone(); $pays = new Pays(); $query = "update {$pays->table} set zone=\"-1\" where zone=\"" . $_GET['id'] . "\""; $resul = mysql_query($query, $pays->link); $zone->charger($_GET['id']); $zone->delete(); } } if ($_REQUEST['id'] != "") { $id = $_REQUEST['id']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php require_once "title.php"; require_once "js/zone.php"; ?> </head>
<?php Zone::delete($_GET['id']); header("Location: " . e_SELF);