g(2); //Nom de la requete $sql = ""; $whereId = "id"; $linkId = "id"; $select = array("name"=>"name" ,"regtree"=>"regtree", "regkey"=>"regkey", "regvalue"=>"regvalue"); $selectPrelim = array( "id"=>"id" ); $from = "regconfig"; $fromPrelim = ""; $group = ""; $order = ""; $countId = "id"; $req=new Req($lbl,$whereId,$linkId,$sql,$select,$selectPrelim,$from,$fromPrelim,$group,$order,$countId); printEnTete($requete->label); ShowResults($req,true); echo "

"; echo "      "; echo "      "; echo ""; echo "

 "; break; endswitch; function formulaire($id,$name,$regtree,$regkey,$regvalue) { global $l; $readonly = ""; $modif = ""; $label = $ajreq; $demande = "enreAjout"; if($_GET["typeDemande"]== "modif") // c'est une modification { $label = $name; $modif = 1; $readonly = "readonly"; // pour qu'on ne puisse pas modifier le ID $demande = "enreModif"; } $tr = " "; //echo "
OCS INVENTORY

"; printEnTete($l->g(108)); echo "

".$l->g(252)." :
".$l->g(253)." :
".$l->g(254)." :
".$l->g(255)." :


        
"; } function modifier() { global $l; $tr = ""; if ($_GET["id"]) // on a récupéré le ID de la ligne que l'on veut modifier { $requete = "select ID,NAME,REGTREE,REGKEY,REGVALUE from regconfig where ID='".$_GET["id"]."';"; $result = mysql_query($requete, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"])); $item = mysql_fetch_object($result); formulaire($item->ID,$item->NAME,$item->REGTREE,$item->REGKEY,$item->REGVALUE); } else // on demande quelle ligne on veut modifier { //echo "
OCS INVENTORY

"; echo "
".$l->g(256)." :


"; $requete = "SELECT ID,NAME,REGVALUE FROM regconfig"; $result = mysql_query($requete, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"])); echo ""; while($colname = mysql_fetch_field($result)) echo""; echo ""; while($item = mysql_fetch_object($result)) { echo ""; } echo"
$colname->name
$item->ID    $item->NAME
"; echo "

".$l->g(113).""; }// fin else }// fin function function enregistrer() { if($_GET["typeDemande"]== "enreModif") // enregistrer une modififcation { $req = "UPDATE regconfig SET ". "NAME='".$_POST["NAME"]."',". "REGTREE='".$_POST["REGTREE"]."',". "REGKEY='".$_POST["REGKEY"]."',". "REGVALUE='".$_POST["REGVALUE"]."' ". "where ID='".$_POST["ID"]."'"; $result = mysql_query($req, $_SESSION["writeServer"]) or die(mysql_error($_SESSION["writeServer"])); } else // enregistrer un ajout { $req = "INSERT INTO regconfig VALUES(\"\",\"".$_POST["NAME"]."\",\"".$_POST["REGTREE"]."\",\"".$_POST["REGKEY"]."\",\"".$_POST["REGVALUE"]."\")"; $result = mysql_query($req, $_SESSION["writeServer"]); }//fin else ?>
OCS INVENTORY

"; echo "
sélectionner la requête registre que vous voulez supprimer :


"; $requete = "SELECT ID,NAME,REGVALUE FROM regconfig"; $result = mysql_query($requete, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"])); echo ""; while($colname = mysql_fetch_field($result)) echo""; echo ""; while($item = mysql_fetch_object($result)) { echo ""; } echo"
$colname->name
$item->ID    $item->NAME
"; echo "

".$l->g(113).""; }// fin else }// fin supprimer ?>