3
* Created on 7 mai 2009
5
* To change the template for this generated file go to
6
* Window - Preferences - PHPeclipse - PHP - Code Templates
8
require ('fichierConf.class.php');
9
$form_name='admin_type';
12
require_once("header.php");
13
if (!($_SESSION["lvluser"] == SADMIN or $_SESSION['TRUE_LVL'] == SADMIN))
16
echo "<form name='".$form_name."' id='".$form_name."' action='' method='post'>";
18
if (isset($_POST['SUP_PROF']) and $_POST['SUP_PROF'] != ''){
19
$del_type=mysql_real_escape_string($_POST['SUP_PROF']);
20
$sql="delete from devicetype where id='".$del_type."'";
21
mysql_query($sql, $_SESSION["writeServer"]) or die(mysql_error($_SESSION["writeServer"]));
22
$tab_options['CACHE']='RESET';
26
if (isset($_POST['Valid_modif_x'])){
27
$new_type=mysql_real_escape_string($_POST['TYPE_NAME']);
28
if (trim($new_type) == ''){
31
$sql="select ID from devicetype where NAME = '".$new_type."'";
32
$res = mysql_query($sql, $_SESSION["readServer"] );
33
$row=mysql_fetch_object($res);
38
echo "<font color=red><b>".$ERROR."</b></font>";
39
$_POST['ADD_TYPE']="VALID";
42
$sql="insert into devicetype (NAME) VALUES ('".$new_type."')";
43
mysql_query($sql, $_SESSION["writeServer"]) or die(mysql_error($_SESSION["writeServer"]));
44
$tab_options['CACHE']='RESET';
52
if (isset($_POST['ADD_TYPE'])){
53
$tab_typ_champ[0]['DEFAULT_VALUE']=$_POST['TYPE_NAME'];
54
$tab_typ_champ[0]['INPUT_NAME']="TYPE_NAME";
55
$tab_typ_champ[0]['CONFIG']['SIZE']=60;
56
$tab_typ_champ[0]['CONFIG']['MAXLENGTH']=255;
57
$tab_typ_champ[0]['INPUT_TYPE']=0;
58
$tab_name[0]=$l->g(938).": ";
59
$tab_hidden['pcparpage']=$_POST["pcparpage"];
60
tab_modif_values($tab_name,$tab_typ_champ,$tab_hidden,$title,$comment="");
66
//if( $_SESSION["lvluser"]!=LADMIN && $_SESSION["lvluser"]!=SADMIN )
68
$sql="select ID,NAME from devicetype";
69
$list_fields= array('ID' => 'ID',
72
//$list_fields['SUP']='ID';
73
$default_fields=$list_fields;
74
$list_col_cant_del=$list_fields;
75
if (!(isset($_POST["pcparpage"])))
76
$_POST["pcparpage"]=5;
77
$result_exist=tab_req($table_name,$list_fields,$default_fields,$list_col_cant_del,$sql,$form_name,80,$tab_options);
79
echo "<input type = submit value='".$l->g(307)."' name='ADD_TYPE'>";
83
require_once($_SESSION['FOOTER_HTML']);