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

Copyright (C) 2006  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
****************************************************************************************/

session_start(); 
?>
<?php if ((@$HTTP_SESSION_VARS["etat_log"] <> "connecte") or ((@$HTTP_SESSION_VARS["niv_log"] <> 9) AND (@$HTTP_SESSION_VARS["niv_log"] <> 5))) header("Location: ../index.php") ?>
<?php include ("../inc/config.inc.php") ?>
<?php include ("../inc/func.inc.php") ?>
<?php include ("../inc/func_log.inc.php") ?>
<?PHP
	Archivelog(@$HTTP_SESSION_VARS["code_log"]);
?>
<?php
	 	// 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"])));

		$retourmnu = 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."', `cons_ntec`='".$ntec."', `cons_rcli`='".$rcli."', `cons_ncli`='".$ncli."', `cons_rint`='".$rint."', `cons_nint`='".$nint."', `cons_rope`='".$rope."', `cons_nope`='".$nope."', `cons_rcon`='".$rcon."', `cons_ncon`='".$ncon."', `cons_rcer`='".$rcer."', `cons_ncer`='".$ncer."', `cons_rdde`='".$rdde."', `cons_ndde`='".$ndde."',`cons_rrel`='".$rrel."', `cons_nrel`='".$nrel."',`cons_rrlic`='".$rrlic."', `cons_nrlic`='".$nrlic."',`cons_rrpdt`='".$rrpdt."', `cons_nrpdt`='".$nrpdt."'  WHERE `cons_id` = '".$rowcons["cons_id"]."'";
				$rs = mysql_query($rech) or die(mysql_error());
				$msg = "Fiche modifiée avec succès !";
				$retourmnu = TRUE;
			}
		}
		else
		{
			$msg = "Problème sur la mise à jour !";
		}
		mysql_free_result($rscons);
		mysql_close($conn);
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SMI - ESPACE PRIVE : Pr&eacute;avis &amp; num&eacute;rotations</title>

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

<!-- Feuille de style & Script pour le menu -->
<link href="../inc/menu.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../coolmenus/coolmenus4.js"></script>

<!-- Scripts Javascript pour affichages -->
<script language="JavaScript" src="../inc/aff.js"></script>

</head>
<body>

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


<p align="center"><span class="titrepage">MISE A JOUR NUMEROTATIONS</span></p>
<p align="center">&nbsp;</p>
<p align="center" class="annot_gras_it"><?PHP echo $msg ?></p>

<?PHP if ($retourmnu == FALSE) { ?>
	<table width="100%"  border="0">
	  <tr>
		<td width="3%">&nbsp;</td>
		<td width="44%"><div align="right"><a href="num_maj.php"><img src="../img/liste.gif" width="33" height="34" border="0" align="absmiddle"></a> <a href="num_maj.php" class="annot_gras_it">Retour &agrave; la saisie </a></div></td>
		<td width="7%">&nbsp;</td>
		<td width="43%"><a href="index.php"><em><img src="../img/index.gif" width="48" height="48" border="0" align="absmiddle"> </em><span class="annot_gras_it">Revenir &agrave; l'accueil</span> </a></td>
		<td width="3%">&nbsp;</td>
	  </tr>
	</table>
<?PHP } else { ?>
	<script type="text/javascript">
	window.setTimeout("location=('index.php');",2000)
	</script>
	<p align="center" class="annot_std_it">Retour à l'index dans 2 secondes...</p>
<?PHP } ?>

<?php 
	include_once ("pied.php")
?>

