<?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
		$categorie = $_GET["cat"];
		
		if ($categorie == "siege")
			$titre = "MOT DE PASSE DU SIEGE";
		if ($categorie == "age")
			$titre = "MOTS DE PASSE AGENCES";
		if ($categorie == "tec")
			$titre = "MOTS DE PASSE TECHNICIENS";
		if ($categorie == "cli")
			$titre = "MOTS DE PASSE CLIENTS";
		if ($categorie == "ope")
			$titre = "MOTS DE PASSE OPERATEURS";
?>

<!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 : Mot de Passe</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>

<!-- Scripts Javascript pour validation des formulaires -->
<script language="JavaScript" src="../inc/validator.js"></script>

</head>
<body>

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

<p align="center"><span class="titrepage"><?PHP echo $titre; ?></span></p>
<p align="center"><span class="annot_gras_it">Que souhaitez-vous faire ?</span></p>
<?PHP if ($categorie == "siege")
{
?>
<form name="mdp_maj" method="post" action="mdp_enr.php?cat=siege">
  <input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
  <p align="center">
    <input name="RAZ" type="button" id="RAZ" value="Rien" onclick="javascript:; history.back();":>
    <input name="init" type="submit" id="init" value="R&eacute;initialiser">
  </p>
</form>
<?PHP
}
?>

<?PHP if ($categorie == "age")
{
?>
<form name="mdp_maj" method="post" action="mdp_enr.php?cat=age">
  <div align="center">
    <input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
    Choisissez l'agence : 
    <select name="code" id="code">
            <?PHP
				// Création de la liste des agences ouvertes
	
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBAGE." WHERE `age_ouvert` = '1' ORDER BY age_nom");
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					$txt_age = $age_nom." (".$age_code.")";
					echo '<option value="'.$age_code.'">'.$txt_age.'</option>';
				}
				mysql_free_result($rs);
				mysql_close($conn);
				?>
    </select>
  </div>
  <p align="center">
    <input name="RAZ" type="button" id="RAZ" value="Rien" onclick="javascript:; history.back();":>
    <input name="init" type="submit" id="init" value="R&eacute;initialiser">
    <input name="init" type="submit" id="init" value="D&eacute;sactiver">
    <input name="init" type="submit" id="init" value="R&eacute;activer">
    <br>
    <span class="annot_petit_it">(La d&eacute;sactivation  emp&ecirc;che la connexion, mais ne supprime pas la fiche) </span></p>
</form>
<?PHP
}
?>

<?PHP if ($categorie == "tec")
{
?>
<form name="mdp_maj" method="post" action="mdp_enr.php?cat=tec">
  <div align="center">
    <input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
    Choisissez le technicien : 
    <select name="code" id="code">
            <?PHP
				// Création de la liste des techniciens présents
	
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBTEC." WHERE `tec_out` = '0' ORDER BY tec_nom");
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					$txt_tec = $tec_nom." ".$tec_prenom." (".$tec_code."), agence ".$tec_codeage;
					echo '<option value="'.$tec_code.'">'.$txt_tec.'</option>';
				}
				mysql_free_result($rs);
				mysql_close($conn);
				?>
    </select>
  </div>
  <p align="center">
    <input name="RAZ" type="button" id="RAZ" value="Rien" onclick="javascript:; history.back();":>
    <input name="init" type="submit" id="init" value="R&eacute;initialiser">
    <input name="init" type="submit" id="init" value="D&eacute;sactiver">
    <input name="init" type="submit" id="init" value="R&eacute;activer">
    <br>
    <span class="annot_petit_it">(La d&eacute;sactivation  emp&ecirc;che la connexion, mais ne supprime pas la fiche) </span></p>
</form>
<?PHP
}
?>

<?PHP if ($categorie == "cli")
{
?>
<form name="mdp_maj" method="post" action="mdp_enr.php?cat=cli">
  <div align="center">
    <input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
    Choisissez le client : 
    <select name="code" id="code">
            <?PHP
				// Création de la liste des clients
	
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBCLI." ORDER BY cli_ste,cli_nom");
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					if ($cli_ste <> "")
						$txt_cli = $cli_ste." (".Retournecp($cli_ville).", ".Retourneville($cli_ville).")";
					else
						$txt_cli = $cli_nom." ".$cli_prenom." (".Retournecp($cli_ville).", ".Retourneville($cli_ville).")";
					echo '<option value="'.$cli_code.'">'.$txt_cli.'</option>';
				}
				mysql_free_result($rs);
				mysql_close($conn);
				?>
    </select>
  </div>
  <p align="center">
    <input name="RAZ" type="button" id="RAZ" value="Rien" onclick="javascript:; history.back();":>
    <input name="init" type="submit" id="init" value="R&eacute;initialiser">
    <input name="init" type="submit" id="init" value="D&eacute;sactiver">
    <input name="init" type="submit" id="init" value="R&eacute;activer">
    <br>
    <span class="annot_petit_it">(La d&eacute;sactivation  emp&ecirc;che la connexion, mais ne supprime pas la fiche) </span></p>
</form>
<?PHP
}
?>

<?PHP if ($categorie == "ope")
{
?>
<form name="mdp_maj" method="post" action="mdp_enr.php?cat=ope">
  <div align="center">
    <input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
    Choisissez l'op&eacute;rateur : 
    <select name="code" id="code">
            <?PHP
				// Création de la liste des opérateurs présents
	
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBOPE." WHERE `ope_out` = '0' ORDER BY ope_nom");
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					$txt_ope = $ope_nom." ".$ope_prenom." (".$ope_code.")";
					echo '<option value="'.$ope_code.'">'.$txt_ope.'</option>';
				}
				mysql_free_result($rs);
				mysql_close($conn);
				?>
    </select>
  </div>
  <p align="center">
    <input name="RAZ" type="button" id="RAZ" value="Rien" onclick="javascript:; history.back();">
    <input name="init" type="submit" id="init" value="R&eacute;initialiser">
    <input name="init" type="submit" id="init" value="D&eacute;sactiver">
    <input name="init" type="submit" id="init" value="R&eacute;activer">
    <br>
    <span class="annot_petit_it">(La d&eacute;sactivation  emp&ecirc;che la connexion, mais ne supprime pas la fiche) </span></p>
</form>
<?PHP
}
?>

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