<?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
****************************************************************************************/

include ("../inc/config.inc.php");
?>
<?php require ("../inc/func.inc.php") ?>
<?php require ("../inc/func_log.inc.php") ?>
<?php include ("../inc/func_txt.inc.php") ?>
<?php require ("../inc/fic.inc.php") ?>
<?PHP
	Archivelog(@$HTTP_SESSION_VARS["code_log"]);
?>
<?php
	$orig = strip_tags(trim($_GET['ori'])); // Récupération origine ('Public / Privé')
	$dep = strip_tags(trim($_GET['dep'])); // Récupération code département
	
	$ddeok = TRUE;
	$ddeur="";

	// Si origine de la demande est "privée", on récupère le code du département du connecté et les données du demandeur
	if ($orig == "pr")
	{
		switch (@$HTTP_SESSION_VARS["niv_log"])
		{
			//Centre de gestion
			case 5 : $row = lit_enr_cdg();
					 extract($row);
					 
					 $ste = $cge_nom;
					 $adr1 = $cge_adr1;
					 $adr2 = $cge_adr2;
					 $dep = $cge_dep;
					 $ville = $cge_ville;
					 $pays = $cge_pays;
					 $telf = ereg_replace(" ","",$cge_telf);
					 $fax = ereg_replace(" ","",$cge_fax);
					 $email = $cge_emaild;
					 
					 $ddeur="cge";
					
					break;

			//Agence
			case 4 : $row = lit_enr_age(@$HTTP_SESSION_VARS["code_log"]);
					 extract($row);
					 
					 $ste = $age_nom;
					 $adr1 = $age_adr1;
					 $adr2 = $age_adr2;
					 $dep = $age_dep;
					 $ville = $age_ville;
					 $pays = $age_pays;
					 $telf = ereg_replace(" ","",$age_telf);
					 $fax = ereg_replace(" ","",$age_fax);
					 $email = $age_emaild;
					 
					 $ddeur="age";
					
					break;

			//Technicien
			case 3 : $row = lit_enr_tec(@$HTTP_SESSION_VARS["code_log"]);
					 extract($row);
					 
					 $civilite = $tec_civilite;
					 $prenom = $tec_prenom;
					 $nom = $tec_nom;
					 $adr1 = $tec_adr1;
					 $adr2 = $tec_adr2;
					 $dep = $tec_dep;
					 $ville = $tec_ville;
					 $pays = $tec_pays;
					 $telf = ereg_replace(" ","",$tec_telf);
					 $telp = ereg_replace(" ","",$tec_telp);
					 $fax = ereg_replace(" ","",$tec_fax);
					 $email = $tec_email;
					
					 $ddeur="tec";
					
					break;

			//Opérateur
			case 2 : $row = lit_enr_ope(@$HTTP_SESSION_VARS["code_log"]);
					 extract($row);
					 
					 $civilite = $ope_civilite;
					 $prenom = $ope_prenom;
					 $nom = $ope_nom;
					 $adr1 = $ope_adr1;
					 $adr2 = $ope_adr2;
					 $dep = $ope_dep;
					 $ville = $ope_ville;
					 $pays = $ope_pays;
					 $telf = ereg_replace(" ","",$ope_telf);
					 $telp = ereg_replace(" ","",$ope_telfp);
					 $email = $ope_email;
					
					 $ddeur="ope";
					
					break;

			//Client
			case 1 : $row = lit_enr_cli(@$HTTP_SESSION_VARS["code_log"]);
					 extract($row);
					 
					 $ste = $cli_ste;
					 $civilite = $cli_civilite;
					 $prenom = $cli_prenom;
					 $nom = $cli_nom;
					 $adr1 = $cli_adr1;
					 $adr2 = $cli_adr2;
					 $dep = $cli_dep;
					 $ville = $cli_ville;
					 $pays = $cli_pays;
					 $telf = ereg_replace(" ","",$cli_telf);
					 $fax = ereg_replace(" ","",$cli_fax);
					 $telp = ereg_replace(" ","",$cli_telfp);
					 $email = $cli_email;
					
					 $ddeur="cli";
					
					break;
					
			default : $dep="";
					  $ddeok = FALSE;
					break;
		}
	}

	$titre = "MESSAGES & DEMANDES";
?>

<!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 : Demande</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 vérifications -->
<script language="JavaScript" src="../inc/verif.js"></script>

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

</head>

<body>

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

<p align="center"> <span class="titrepage"><?PHP echo $titre ?></span></p>

<!-- Affiché uniquement si demande cohérente -->
<?PHP 
if ($ddeok == TRUE)
{
?>
	<script language="javascript">
	var tab1_champ=new Array(
		"nom:dep ; format:liste ; req:Y ; txt:Département ; vmn:1 ; stok:frmok ; stbad:frmbad");
	<?
	if (@$HTTP_SESSION_VARS["niv_log"] <> "") // Espace privé
	{
	?>
	var tab2_champ=new Array(
		"nom:objet ; format:liste ; req:Y ; txt:Objet de la demande ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:dest ; format:liste ; req:Y ; txt:Destinataire ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:ste ; format:txt ; req:N ; txt:Société ; stok:frmok ; stbad:frmbad",
		"nom:civilite ; format:liste ; req:Y ; txt:Civilité ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:prenom ; format:txt ; req:Y ; txt:Prénom ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:nom ; format:txt ; req:Y ; txt:Prénom ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:adr1 ; format:txt ; req:Y ; txt:Adresse(1) ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:adr2 ; format:txt ; req:N ; txt:Adresse(2) ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:ville ; format:liste ; req:Y ; txt:Ville ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:pays ; format:liste ; req:Y ; txt:Ville ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:telf ; format:tel_fr ; req:Y ; txt:Téléphone fixe ; stok:frmok ; stbad:frmbad",
		"nom:fax ; format:tel_fr ; req:N ; txt:Télécopieur ; stok:frmok ; stbad:frmbad",
		"nom:telp ; format:telp_fr ; req:N ; txt:Téléphone portable ; stok:frmok ; stbad:frmbad",
		"nom:email ; format:mail ; req:Y ; txt:Email ; stok:frmok ; stbad:frmbad",
		"nom:txtdde ; format:txt ; req:Y ; txt:Votre demande ; stok:frmok ; stbad:frmbad");
	<?PHP
	}
	else
	{
	?>
	var tab2_champ=new Array(
		"nom:objet ; format:liste ; req:Y ; txt:Objet de la demande ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:dest ; format:liste ; req:Y ; txt:Destinataire ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:cat ; format:liste ; req:Y ; txt:Vous êtes ; stok:frmok ; stbad:frmbad",
		"nom:ste ; format:txt ; req:N ; txt:Société ; stok:frmok ; stbad:frmbad",
		"nom:civilite ; format:liste ; req:Y ; txt:Civilité ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:prenom ; format:txt ; req:Y ; txt:Prénom ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:nom ; format:txt ; req:Y ; txt:Prénom ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:adr1 ; format:txt ; req:Y ; txt:Adresse(1) ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:adr2 ; format:txt ; req:N ; txt:Adresse(2) ; lmx:50 ; stok:frmok ; stbad:frmbad",
		"nom:ville ; format:liste ; req:Y ; txt:Ville ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:pays ; format:liste ; req:Y ; txt:Ville ; vmn:1 ; stok:frmok ; stbad:frmbad",
		"nom:telf ; format:tel_fr ; req:Y ; txt:Téléphone fixe ; stok:frmok ; stbad:frmbad",
		"nom:fax ; format:tel_fr ; req:N ; txt:Télécopieur ; stok:frmok ; stbad:frmbad",
		"nom:telp ; format:telp_fr ; req:N ; txt:Téléphone portable ; stok:frmok ; stbad:frmbad",
		"nom:email ; format:mail ; req:Y ; txt:Email ; stok:frmok ; stbad:frmbad",
		"nom:txtdde ; format:txt ; req:Y ; txt:Votre demande ; stok:frmok ; stbad:frmbad");
	<?PHP
	}
	?>
	</script>

	
	<!-- Formulaire de demande du numéro de département (uniquement si n'existe pas) -->
	<?PHP if (($dep == "") AND ($orig == "pu")) { ?>
	<form name="dde_dep" id="dde_dep" method="GET" action="dde_maj.php" onSubmit="javascript:; return (VForm(this,tab1_champ,''));">
    <input name="ori" type="hidden" id="ori" value="<?PHP echo $orig ?>">
		<p align="center">Merci de saisir votre num&eacute;ro de d&eacute;partement. </p>
		<table width="100%"  border="0">
	<tr>
		<td width="20%" class="rubfrm" id="f_ouvert"><div align="right">D&eacute;partement</div></td>
		<td>
		<select name="dep" size="1" id="dep">
		<?PHP
		
		echo "<option>-- Choisissez un département --</option>";

		// Création de la liste des départements
		
		$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
		mysql_select_db(DBNAME);
		$rs = mysql_query("SELECT * FROM ".TBDEP." ORDER BY dep_nom");
		
		while ($resultat = mysql_fetch_array($rs)) 
		{
			extract($resultat);
			$chaine_dep = $dep_nom." (".$dep_num.")";
			echo "<option value=\"".$dep_num."\">".$chaine_dep."</option>";
		}

		mysql_free_result($rs);
		mysql_close($conn);
		?>
		</select>
          <img src="../img/oblig.gif" width="10" height="11">
		</td>
	</tr>
	</table>
	<p align="center">
		<input type="submit" name="Submit" value="Valider">
	</p>
	</form>
	
	<?PHP } ?>
	<!-- Fin de formulaire de demande du numéro de département (uniquement si n'existe pas) -->

	<!-- Affiché uniquement s'il y a un code département et si la source de la demande est identifiée -->
	<?PHP
	if (($dep <> "") AND (($orig == "pr") OR ($orig == "pu")))
	{
	?>
		<p>&nbsp;</p>
		<form name="dde_maj" method="post" action="dde_enr.php" onSubmit="javascript:; return (VForm(this,tab2_champ,''));">
		<input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
	    <input name="ori" type="hidden" id="ori" value="<?PHP echo $orig ?>">
		
		<!-- Objet -->
		<table width="800"  border="0">
		<tr>
			<td width="160" class="rubfrm" id="f_obj"><div align="right">Objet</div></td>
			<td>
			<select name="objet" id="objet">
			<option>-- Choisissez pourquoi vous expédiez ce message --</option>
			<?PHP
				
				// Création de la liste des type de demandes
				
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				if (@$HTTP_SESSION_VARS["niv_log"] <> "") // Espace privé
				{
					switch ($ddeur)
					{
						// Si Demandeur = Centre de gestion
						case "cge" :
							$rech = "SELECT * FROM ".TBDDET." WHERE `ddet_cge` = '1' ORDER BY ddet_desc";
							break;

						// Si Demandeur = Agence
						case "age" :
							$rech = "SELECT * FROM ".TBDDET." WHERE `ddet_age` = '1' ORDER BY ddet_desc";
							break;

						// Si Demandeur = Client
						case "cli" :
							$rech = "SELECT * FROM ".TBDDET." WHERE `ddet_cli` = '1' ORDER BY ddet_desc";
							break;

						// Si Demandeur = Opérateur
						case "ope" :
							$rech = "SELECT * FROM ".TBDDET." WHERE `ddet_ope` = '1' ORDER BY ddet_desc";
							break;

						// Si Demandeur = Technicien
						case "tec" :
							$rech = "SELECT * FROM ".TBDDET." WHERE `ddet_tec` = '1' ORDER BY ddet_desc";
							break;
					}
				}
				else
				{
					$rech = "SELECT * FROM ".TBDDET." WHERE `ddet_pub` = '1' ORDER BY ddet_desc";
				}
				$rs = mysql_query($rech);
				
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
		
					echo '<option value="'.$ddet_code.'">'.$ddet_desc.'</option>';
				}
				mysql_free_result($rs);
				mysql_close($conn);
			?>
			</select>
			<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		</table>
		
		<!-- Destinataire -->
		<table width="800"  border="0">
		<tr>
			<td width="160" class="rubfrm" id="f_dest"><div align="right">Destinataire</div></td>
			<td>
			<select name="dest" id="dest">
			<option>-- Choisissez à qui vous expédiez ce message --</option>
			<?PHP
				
				// Création de la liste des destinataires demandes
				
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				if (@$HTTP_SESSION_VARS["niv_log"] <> "") // Espace privé
				{
					switch ($ddeur)
					{
						// Si Demandeur = Centre de gestion
						case "cge" :
							$rech = "SELECT * FROM ".TBDDED." WHERE `dded_cge` = '1' ORDER BY dded_desc";
							break;

						// Si Demandeur = Agence
						case "age" :
							$rech = "SELECT * FROM ".TBDDED." WHERE `dded_age` = '1' ORDER BY dded_desc";
							break;

						// Si Demandeur = Client
						case "cli" :
							$rech = "SELECT * FROM ".TBDDED." WHERE `dded_cli` = '1' ORDER BY dded_desc";
							break;

						// Si Demandeur = Opérateur
						case "ope" :
							$rech = "SELECT * FROM ".TBDDED." WHERE `dded_ope` = '1' ORDER BY dded_desc";
							break;

						// Si Demandeur = Technicien
						case "tec" :
							$rech = "SELECT * FROM ".TBDDED." WHERE `dded_tec` = '1' ORDER BY dded_desc";
							break;
					}
				}
				else
				{
					$rech = "SELECT * FROM ".TBDDED." WHERE `dded_pub` = '1' ORDER BY dded_desc";
				}
				$rs = mysql_query($rech);
				
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
		
					echo '<option value="'.$dded_code.'">'.$dded_desc.'</option>';
				}
				mysql_free_result($rs);
				mysql_close($conn);
			?>
			</select>
			<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		</table>
		<br>

		<!-- Détails expéditeur-->
		<table width="800"  border="0">
		<tr>
			<td class="rubfrm">
				<div align="center">Vos coordonn&eacute;es </div>
			</td>
		</tr>
		</table>

		<!-- Catégorie -->
		<?
		if (@$HTTP_SESSION_VARS["niv_log"] <> "") // Espace privé
		{
		?>
			<input name="cat" type="hidden" id="cat" value="<?PHP echo str_majuscules($ddeur); ?>">
		<?PHP
		}
		else
		{
		?>
		<table width="800"  border="0">
		<tr>
			<td width="160" class="rubfrm" id="f_cat"><div align="right">Vous &ecirc;tes</div></td>
			<td>
				<select name="cat" id="cat">
				<option>-- Choisissez une cat&eacute;gorie --</option>
				<?PHP
					
					// Création de la liste des catégories de demandeurs (espace privé uniquement)
					
					$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
					mysql_select_db(DBNAME);
					$rech = "SELECT * FROM ".TBDDEC." WHERE `ddec_pub` = '0' ORDER BY ddec_desc";
					$rs = mysql_query($rech);
					
					while ($resultat = mysql_fetch_array($rs)) 
					{
						extract($resultat);
			
						echo '<option value="'.$ddec_code.'">'.$ddec_desc.'</option>';
					}
					mysql_free_result($rs);
					mysql_close($conn);
				?>
				</select>
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		</table>
		<?PHP
		}
		?>

	    <!-- Coordonnées -->
		<table width="800"  border="0">
		<tr>
			<td width="160" class="rubfrm" id="f_ste"><div align="right">Soci&eacute;t&eacute;</div></td>
			<td>
				<input name="ste" type="text" id="ste" value="<?PHP echo $ste ?>" size="50" maxlength="50">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_civilite"><div align="right">Civilit&eacute;</div></td>
			<td>
			<select name="civilite" size="1" id="civilite">
			<?PHP
			
			echo "<option>-- Choisissez une civilité --</option>";

			// Création de la liste des civilités
			
			$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
			mysql_select_db(DBNAME);
			$rs = mysql_query("SELECT * FROM ".TBCIV." ORDER BY civ_desc");
			
			while ($resultat = mysql_fetch_array($rs)) 
			{
				extract($resultat);
				if ($civilite == $civ_code)
				{
					echo '<option value="'.$civ_code.'" selected>'.$civ_desc.'</option>';
				}
				else
				{
					echo '<option value="'.$civ_code.'">'.$civ_desc.'</option>';
				}
	
				$i++;
			}
			mysql_free_result($rs);
			mysql_close($conn);
			?>
			</select>
			<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_prenom"><div align="right">Pr&eacute;nom</div></td>
			<td>
				<input name="prenom" type="text" id="prenom" value="<?PHP echo $prenom ?>" size="50" maxlength="50">
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_nom"><div align="right">Nom</div></td>
			<td>
				<input name="nom" type="text" id="nom" value="<?PHP echo $nom ?>" size="50" maxlength="50" onChange="javascript:this.value=this.value.toUpperCase();">
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_adr1"><div align="right">Adresse (1) </div></td>
			<td>
				<input name="adr1" type="text" id="adr1" value="<?PHP echo $adr1 ?>" size="50" maxlength="50" onChange="javascript:this.value=this.value.toUpperCase();">
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_adr2"><div align="right">Adresse (2) </div></td>
			<td>
				<input name="adr2" type="text" id="adr2" value="<?PHP echo $adr2 ?>" size="50" maxlength="50" onChange="javascript:this.value=this.value.toUpperCase();">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_dep"><div align="right">D&eacute;partement</div></td>
			<td>
				<input name="dep" type="text" id="dep" value="<?PHP echo $dep ?>" size="3" maxlength="3" readonly="1">
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_ville"><div align="right">Ville</div></td>
			<td>
				<select name="ville" size="1" id="ville">
				<?PHP
				
				echo "<option>-- Choisissez une ville --</option>";

				// Création de la liste des villes
				
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$filtre = $dep;
				if (($filtre == "2A") OR ($filtre == "2B"))
					$filtre = "20";
				$rs = mysql_query("SELECT * FROM ".TBVILLES." WHERE `villes_cp` LIKE '".$filtre."%' ORDER BY villes_nom");
				
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					if ($ville == $villes_insee)
					{
						echo '<option value="'.$villes_insee.'" selected>'.str_majuscules($villes_nom).' ('.$villes_cp.')</option>';
					}
					else
					{
						echo '<option value="'.$villes_insee.'">'.str_majuscules($villes_nom).' ('.$villes_cp.')</option>';
					}
		
					$i++;
				}
				mysql_free_result($rs);
				mysql_close($conn);
				?>
				</select>
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td width="160" class="rubfrm" id="f_pays"><div align="right">Pays</div></td>
			<td>
				<select name="pays" size="1" id="pays">
			<?PHP
				
				echo "<option>-- Choisissez un pays --</option>";

				// Création de la liste des pays
				
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBPAYS." ORDER BY pays_nom");
				
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					if ($pays == $pays_nom)
					{
						echo '<option value="'.$pays_nom.'" selected>'.$pays_nom.'</option>';
					}
					else
					{
						echo '<option value="'.$pays_nom.'">'.$pays_nom.'</option>';
					}
		
					$i++;
				}
				mysql_free_result($rs);
				mysql_close($conn);
				?>
				</select>
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td class="rubfrm" id="f_telf"><div align="right">T&eacute;l&eacute;phone Fixe </div></td>
			<td>
				<input name="telf" type="text" id="telf" value="<?PHP echo $telf ?>" size="20" maxlength="20">
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		<tr>
			<td class="rubfrm" id="f_fax"><div align="right">T&eacute;l&eacute;copieur</div></td>
			<td>
				<input name="fax" type="text" id="fax" value="<?PHP echo $fax ?>" size="20" maxlength="20">
			</td>
		</tr>
		<tr>
			<td class="rubfrm" id="f_telp"><div align="right">Portable</div></td>
			<td>
				<input name="telp" type="text" id="telp" value="<?PHP echo $telp ?>" size="20" maxlength="20">
			</td>
		</tr>
		<tr>
			<td class="rubfrm" id="f_email"><div align="right">Email</div></td>
			<td>
				<input name="email" type="text" id="email" value="<?PHP echo $email ?>" size="50" maxlength="50" onChange="javascript:this.value=this.value.toLowerCase();">
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		</table>
		<br>

		<!-- Texte de la demande -->
		<table width="800"  border="0">
		<tr>
			<td class="rubfrm" id="f_txtdde">
				<div align="center">Votre message </div>
			</td>
		</tr>
		</table>
		<table width="800"  border="0">
		<tr>
			<td>
				<textarea name="txtdde" cols="125" rows="5" id="txtdde"><?PHP echo $txtdde ?></textarea>
				<img src="../img/oblig.gif" width="10" height="11">
			</td>
		</tr>
		</table>
		
		<p align="center">
		<input name="RAZ" type="reset" id="RAZ" value="R&eacute;initialiser">
		<input name="enr" type="submit" id="enr" value="Envoyer">
		</p>
		</form>
		
	<?PHP 
	} 
	?>
	<!-- Fin affiché uniquement s'il y a un code département et si la source de la demande est identifiée -->

<!-- Fin Affiché uniquement si demande cohérente -->
<?PHP
}
else
{
?>
	<script type="text/javascript">
	setTimeout("self.location.href=('index.php');",2000)
	</script>
	<p align="center" class="annot_std_it">Il y a un prob&egrave;me dans la demande...</p>
    <?PHP
}
?>
