<?php
/****************************************************************************************
SMI (Services Maintenance Interventions) est une gestion libre de maintenance et de SAV

Version 0.9.9

Copyright (C) 2006-2009  Sylvain FATOME
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; 
either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program
(in the directory docs); 
if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
Boston, MA  02110-1301, USA.

Contact : galawa@free.fr

Web : http://smitst.homelinux.com
****************************************************************************************/

session_start(); 
if (!isset($_SESSION["lng"])) $_SESSION["lng"]="fr";
include_once("../lng/".$_SESSION["lng"].".inc.php"); // Paramètres de language
include_once("../inc/config.inc.php");
include_once("../inc/func_log.inc.php");
if (CheckURLLog(TRUE)==FALSE) header("Location: ../index.php");
if (CheckNivLog("5-9")==FALSE) header("Location: ../index.php");
include_once("../inc/func.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/func_txt.inc.php");
Archivelog(@$_SESSION["code_log"]);

// Variables Formulaire
$relmin = str_majuscules(strip_tags(trim(@$_POST["relmin"])));
$relmax = str_majuscules(strip_tags(trim(@$_POST["relmax"])));
$rtec = str_majuscules(strip_tags(trim(@$_POST["rtec"])));
$ntec = str_majuscules(strip_tags(trim(@$_POST["ntec"])));
$rcli = str_majuscules(strip_tags(trim(@$_POST["rcli"])));
$ncli = str_majuscules(strip_tags(trim(@$_POST["ncli"])));
$rint = str_majuscules(strip_tags(trim(@$_POST["rint"])));
$nint = str_majuscules(strip_tags(trim(@$_POST["nint"])));
$rope = str_majuscules(strip_tags(trim(@$_POST["rope"])));
$nope = str_majuscules(strip_tags(trim(@$_POST["nope"])));
$rcon = str_majuscules(strip_tags(trim(@$_POST["rcon"])));
$ncon = str_majuscules(strip_tags(trim(@$_POST["ncon"])));
$rcer = str_majuscules(strip_tags(trim(@$_POST["rcer"])));
$ncer = str_majuscules(strip_tags(trim(@$_POST["ncer"])));
$rdde = str_majuscules(strip_tags(trim(@$_POST["rdde"])));
$ndde = str_majuscules(strip_tags(trim(@$_POST["ndde"])));
$rrel = str_majuscules(strip_tags(trim(@$_POST["rrel"])));
$nrel = str_majuscules(strip_tags(trim(@$_POST["nrel"])));
$rrlic = str_majuscules(strip_tags(trim(@$_POST["rrlic"])));
$nrlic = str_majuscules(strip_tags(trim(@$_POST["nrlic"])));
$rrpdt = str_majuscules(strip_tags(trim(@$_POST["rrpdt"])));
$nrpdt = str_majuscules(strip_tags(trim(@$_POST["nrpdt"])));
$rretp = str_majuscules(strip_tags(trim(@$_POST["rretp"])));
$nretp = str_majuscules(strip_tags(trim(@$_POST["nretp"])));
$rrete = str_majuscules(strip_tags(trim(@$_POST["rrete"])));
$nrete = str_majuscules(strip_tags(trim(@$_POST["nrete"])));
$rloc = str_majuscules(strip_tags(trim(@$_POST["rloc"])));
$nloc = str_majuscules(strip_tags(trim(@$_POST["nloc"])));
$rdos = str_majuscules(strip_tags(trim(@$_POST["rdos"])));
$ndos = str_majuscules(strip_tags(trim(@$_POST["ndos"])));
$rtac = str_majuscules(strip_tags(trim(@$_POST["rtac"])));
$ntac = str_majuscules(strip_tags(trim(@$_POST["ntac"])));

$retourliste = FALSE;

// MAJ de la fiche Numérotation

$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
mysql_select_db(DBNAME);
$rcons = "SELECT * FROM " .TBCONS;
$rscons = mysql_query($rcons) or die(mysql_error());
if (mysql_num_rows($rscons) == 1) // Uniquement UN SEUL enregistrement !
{
	if ($rowcons = mysql_fetch_array($rscons)) 
	{
		$rech = "UPDATE `" .TBCONS. "` SET `cons_relmin`='".$relmin."', `cons_relmax`='".$relmax."', `cons_rtec`='".$rtec."',";
		$rech.=" `cons_ntec`='".$ntec."', `cons_rcli`='".$rcli."', `cons_ncli`='".$ncli."', `cons_rint`='".$rint."',";
		$rech.=" `cons_nint`='".$nint."', `cons_rope`='".$rope."', `cons_nope`='".$nope."', `cons_rcon`='".$rcon."',";
		$rech.=" `cons_ncon`='".$ncon."', `cons_rcer`='".$rcer."', `cons_ncer`='".$ncer."', `cons_rdde`='".$rdde."',";
		$rech.=" `cons_ndde`='".$ndde."',`cons_rrel`='".$rrel."', `cons_nrel`='".$nrel."',`cons_rrlic`='".$rrlic."',";
		$rech.=" `cons_nrlic`='".$nrlic."',`cons_rrpdt`='".$rrpdt."', `cons_nrpdt`='".$nrpdt."',";
		$rech.=" `cons_rretp`='".$rretp."', `cons_nretp`='".$nretp."',";
		$rech.=" `cons_rrete`='".$rrete."', `cons_nrete`='".$nrete."',";
		$rech.=" `cons_rloc`='".$rloc."', `cons_nloc`='".$nloc."',";
		$rech.=" `cons_rdos`='".$rdos."', `cons_ndos`='".$ndos."',";
		$rech.=" `cons_rtac`='".$rtac."', `cons_ntac`='".$ntac."'";
		$rech.="  WHERE `cons_id` = '".$rowcons["cons_id"]."'";
		$rs = mysql_query($rech) or die(mysql_error());
		$msg = $txt_fiche_mod;
		$retourliste = TRUE;
	}
}
else
{
	$msg = $txt_fiche_pbmmaj;
}
mysql_free_result($rscons);
mysql_close($conn);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SMI - <?PHP $title_esp_prive; ?> : <?PHP echo $title_cons_maj; ?></title>

<!-- Feuille de style pour les affichages courants -->
<link href="../css/smi.css" rel="stylesheet" type="text/css">

<!-- Feuille de style & Script pour le menu -->

<script language="JavaScript" src="../jscript/coolmenus/coolmenus4.js"></script>

<!-- Scripts Javascript pour fenêtres -->
<script language="JavaScript" src="../jscript/fen.js"></script>

</head>
<body>

<?php 
include_once("../inc/entete.inc.php"); 
?>


<p align="center"><span class="titrepage"><?PHP echo $titlein_numenr_maj_edit; ?></span></p>
<p align="center">&nbsp;</p>
<p align="center">
<?PHP if ($retourliste==FALSE)
	echo '<span class="alerte1">';
else
	echo '<span class="annot_std_gras">';
echo $msg;
?>
</span>
</p>
<?PHP 
if ($retourliste == FALSE)
	aff_ret_idx_man($td,"num_maj.php",$txt_lnk_ret_saisie,FALSE);
else
	aff_ret_idx_auto("index.php",2000);
include_once("pied.php");
?>

