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

Version 0.9.6
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 require ("../inc/func_txt.inc.php") ?>
<?php include ("../inc/fic.inc.php") ?>
<?PHP
	Archivelog(@$HTTP_SESSION_VARS["code_log"]);
?>
<?php
	$conn2 = 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 !
	{
		 while ($rowcons = mysql_fetch_array($rscons)) 
		{
			extract ($rowcons);
		}
	
		mysql_free_result($rscons);
		mysql_close($conn2);  
	}
?>

<!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 - ESPACE PRIVE : Pr&eacute;avis &amp; num&eacute;rotations</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 -->
<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>

<!-- Scripts Javascript pour contrôle de formulaire -->
<script	type="text/javascript" src="../jscript/vform/vform.js"></script>

<script language="javascript">
var tab1_champ=new Array(
	"nom:relmin ; format:unsigned ; req:Y ; txt:Minimum pour les préavis ; lmx:3 ; stok:frmok ; stbad:frmbad",
	"nom:relmax ; format:unsigned ; req:Y ; txt:Maximum pour les préavis ; lmx:3 ; stok:frmok ; stbad:frmbad",
	"nom:rtec ; format:alphanum ; req:Y ; txt:Radical codage techniciens ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:ntec ; format:unsigned ; req:Y ; txt:Numérotation codage techniciens ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rcli ; format:alphanum ; req:Y ; txt:Radical codage clients ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:ncli ; format:unsigned ; req:Y ; txt:Numérotation codage clients ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rint ; format:alphanum ; req:Y ; txt:Radical codage interventions ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:nint ; format:unsigned ; req:Y ; txt:Numérotation codage interventions ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rope ; format:alphanum ; req:Y ; txt:Radical codage opérateurs ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:nope ; format:unsigned ; req:Y ; txt:Numérotation codage opérateurs ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rcon ; format:alphanum ; req:Y ; txt:Radical codage contrats ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:ncon ; format:unsigned ; req:Y ; txt:Numérotation codage contrats ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rdde ; format:alphanum ; req:Y ; txt:Radical codage demandes ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:ndde ; format:unsigned ; req:Y ; txt:Numérotation codage demandes ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rrel ; format:alphanum ; req:Y ; txt:Radical codage dossiers de relevés ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:nrel ; format:unsigned ; req:Y ; txt:Numérotation codage dossiers de relevés ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rrlic ; format:alphanum ; req:Y ; txt:Radical codage relevés de licences ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:nrlic ; format:unsigned ; req:Y ; txt:Numérotation codage relevés de licences ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:rrpdt ; format:alphanum ; req:Y ; txt:Radical codage relevés de matériels ; lmx:10 ; stok:frmok ; stbad:frmbad",
	"nom:nrpdt ; format:unsigned ; req:Y ; txt:Numérotation codage relevés de matériels ; lmx:10 ; stok:frmok ; stbad:frmbad");
</script>

</head>
<body>

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

<p align="center"><span class="titrepage">PREAVIS &amp; NUMEROTATIONS</span></p>
<p align="center" class="annot_gras_it">&nbsp;</p>
<form name="num_maj" method="post" action="num_enr.php" onSubmit="javascript:; return (VForm(this,tab1_champ,''));">
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><div align="center"><span class="annot_gras_it">Veuillez saisir le minimum et le maximum (en jours) pour les pr&eacute;avis de relance sur les contrats </span></div></td>
    </tr>
    <tr>
      <td class="annot_petit_it"><div align="center">Minimum = nombre de jours &agrave; partir desquels on peut commencer &agrave; relancer.<br>
      Maximum = nombre de jours &agrave; partir desquels on ne peut plus relancer. </div></td>
    </tr>
    <tr>
      <td  class="rubfrm" id="f_relmin">Minimum (en jours) pour les pr&eacute;avis </td>
    </tr>
    <tr>
      <td><div align="center">
        <input name="relmin" type="text" id="relmin" value="<?PHP echo $cons_relmin ?>" size="10" maxlength="10">
      </div></td>
    </tr>
    <tr>
      <td class="rubfrm" id="f_relmax">Maximum (en jours) pour les pr&eacute;avis </td>
    </tr>
    <tr>
      <td><div align="center">
        <input name="relmax" type="text" id="relmax" value="<?PHP echo $cons_relmax ?>" size="10" maxlength="10">
      </div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <table width="100%"  border="0">
    <tr>
      <td colspan="2" align="center">
	  
	  <span class="annot_gras_it">Veuillez saisir le radical et le num&eacute;ro pour chaque type de num&eacute;rotation</span>
	  <br>
	  <span class="annot_petit_it">(Il n'est pas possible de modifier un num&eacute;ro sur un type s'il y a d&eacute;j&agrave; eu des saisies effectu&eacute;es sur ce type) </span></td>
    </tr>
    <tr>
      <td width="50%">&nbsp;</td>
      <td width="50%">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_ntec">Type de num&eacute;rotation pour les techniciens</td>
    </tr>
    <tr>
      <td align="right">
        <input name="rtec" type="text" id="rtec" value="<?PHP echo $cons_rtec ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_tec("") == 0)
		{
	  ?>
			<input name="ntec" type="text" id="ntec" value="<?PHP echo $cons_ntec ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="ntec" type="text" id="ntec" value="<?PHP echo $cons_ntec ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_ncli">Type de num&eacute;rotation pour les clients</td>
    </tr>
    <tr>
      <td align="right">
        <input name="rcli" type="text" id="rcli" value="<?PHP echo $cons_rcli ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_cli("") == 0)
		{
	  ?>
			<input name="ncli" type="text" id="ncli" value="<?PHP echo $cons_ncli ?>" size="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="ncli" type="text" id="ncli" value="<?PHP echo $cons_ncli ?>" size="10" readonly="1">
	  <?PHP
		}
	  ?>
	</td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_nint">Type de num&eacute;rotation pour les interventions</td>
    </tr>
    <tr>
      <td align="right">
        <input name="rint" type="text" id="rint" value="<?PHP echo $cons_rint ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_int("") == 0)
		{
	  ?>
			<input name="nint" type="text" id="nint" value="<?PHP echo $cons_nint ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="nint" type="text" id="nint" value="<?PHP echo $cons_nint ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_nope">Type de num&eacute;rotation pour les op&eacute;rateurs t&eacute;l&eacute;phoniques </td>
    </tr>
    <tr>
      <td align="right">
        <input name="rope" type="text" id="rope" value="<?PHP echo $cons_rope ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_ope() == 0)
		{
	  ?>
			<input name="nope" type="text" id="nope" value="<?PHP echo $cons_nope ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="nope" type="text" id="nope" value="<?PHP echo $cons_nope ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
		</td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_ncon">Type de num&eacute;rotation pour les contrats</td>
    </tr>
    <tr>
      <td align="right">
        <input name="rcon" type="text" id="rcon" value="<?PHP echo $cons_rcon ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_cocl("") == 0)
		{
	  ?>
			<input name="ncon" type="text" id="ncon" value="<?PHP echo $cons_ncon ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="ncon" type="text" id="ncon" value="<?PHP echo $cons_ncon ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_ncon">Type de num&eacute;rotation pour les certificats de destruction </td>
    </tr>
    <tr>
      <td align="right">
        <input name="rcer" type="text" id="rcer" value="<?PHP echo $cons_rcer ?>" size="10" maxlength="10">
      </td>
      <td><input name="ncer" type="text" id="ncer" value="<?PHP echo $cons_ncer ?>" size="10" maxlength="10"></td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_ndde">Type de num&eacute;rotation pour les demandes </td>
    </tr>
    <tr>
      <td align="right">
        <input name="rdde" type="text" id="rdde" value="<?PHP echo $cons_rdde ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_dde() == 0)
		{
	  ?>
			<input name="ndde" type="text" id="ndde" value="<?PHP echo $cons_ndde ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="ndde" type="text" id="ndde" value="<?PHP echo $cons_ndde ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_nrel">Type de num&eacute;rotation pour les dossiers de relev&eacute;s</td>
    </tr>
    <tr>
      <td align="right">
        <input name="rrel" type="text" id="rrel" value="<?PHP echo $cons_rrel ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_rela("") == 0)
		{
	  ?>
			<input name="nrel" type="text" id="nrel" value="<?PHP echo $cons_nrel ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="nrel" type="text" id="nrel" value="<?PHP echo $cons_nrel ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_nrlic">Type de num&eacute;rotation pour les relev&eacute;s de licences </td>
    </tr>
    <tr>
      <td align="right">
        <input name="rrlic" type="text" id="rrlic" value="<?PHP echo $cons_rrlic ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_rlica("") == 0)
		{
	  ?>
			<input name="nrlic" type="text" id="nrlic" value="<?PHP echo $cons_nrlic ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="nrlic" type="text" id="nrlic" value="<?PHP echo $cons_nrlic ?>" size="10" maxlength="10">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="rubfrm" id="f_nrpdt">Type de num&eacute;rotation pour les relev&eacute;s de mat&eacute;riels </td>
    </tr>
    <tr>
      <td align="right">
        <input name="rrpdt" type="text" id="rrpdt" value="<?PHP echo $cons_rrpdt ?>" size="10" maxlength="10">
      </td>
      <td>
	  <?PHP
	  	if (nb_rpdta("") == 0)
		{
	  ?>
			<input name="nrpdt" type="text" id="nrpdt" value="<?PHP echo $cons_nrpdt ?>" size="10" maxlength="10">
	  <?PHP
	  	}
		else
		{
	  ?>
			<input name="nrpdt" type="text" id="nrpdt" value="<?PHP echo $cons_nrpdt ?>" size="10" maxlength="10" readonly="1">
	  <?PHP
		}
	  ?>
	  </td>
    </tr>
  </table>
  <p align="center">
    <input name="RAZ" type="reset" id="RAZ" value="R&eacute;initialiser">
    <input name="submit" type="submit" id="submit" value="Enregistrer">
  </p>
</form>
<?php 
	include_once ("pied.php")
?>
