*/ include("session.php"); require("class_functions.php"); require("class_db.php"); if(file_exists($_SESSION['config']['lang'].'.php')) { include($_SESSION['config']['lang'].'.php'); } else { $_SESSION['error'] = "Language file missing...
"; } $_SESSION['error'] = ""; $db = new dbquery(); $db->connect(); if($_POST['valid']) { if(isset($_POST['type_id']) && !empty($_POST['type_id'])) { $db->query("update res_x set type_id = '".$_POST['type_id']."' where type_id = '".$_POST['id']."' and status <> 'DEL'"); } if($_POST['nb'] > 0 && empty($_POST['type_id'])) { $_SESSION['error'] = _CANT_DEL_TYPE; } else { $db->query("delete from ".$_SESSION['tablename']['doctypes']." where type_id = '".$_POST['id']."'"); if($_SESSION['config']['collectivities'] == "true") { include_once($_SESSION['config']['includedir']."/addon_collectivities.php"); $db = new dbquery(); delete_collectivity($_POST['id'],$db); } ?> query("select RES_ID from res_x where type_id = '".$id."' and STATUS <> 'DEL'"); if($db->nb_result() > 0) { $nb_docs = $db->nb_result(); } else { $nb_docs = 0; } $db->query("select type_id, description from ".$_SESSION['tablename']['doctypes']." where ENABLED = 'Y' and type_id <> '".$id."'"); $types = array(); while($res = $db->fetch_object()) { array_push($types, array('ID' => $res->type_id, 'LABEL' => $res->description)); } ?> <?php echo _DOCTYPE_DELETION;?>

0) { echo "

"._THERE_ARE_NOW.' '.$nb_docs." "._DOC_WITH_THE_DOCTYPE.".

"._TO_DEL_DOCTYPE." :


"; ?>

"._REALLY_DELETE.' '._THIS_DOCTYPE." ?

"; ?>