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

// Vérification des tentatives de hack
$pos=strpos($_SERVER['PHP_SELF'],"inc.php");
if ($pos===FALSE)
	$ok_inc=TRUE;
else
	$ok_inc=FALSE;
if ($ok_inc==FALSE) header("Location: ../index.php");

include_once("fic_hum.inc.php");
include_once("fic_mque.inc.php");
include_once("func.inc.php");
include_once("func_geo.inc.php");
include_once("func_geol.inc.php");
include_once("func_txt.inc.php");
include_once("geoip.inc.php");
Archivelog(@$_SESSION["code_log"]);

$td = strip_tags(trim($_GET['td']));
$coderech = strip_tags(trim($_GET['code']));

$pbm_rlpm=FALSE;

if (@$_SESSION["niv_log"]<3)
	$pbm_rlpm=TRUE;

$msg1_err_type=$ajx_nodeppays;
$msg2_err_type="Aucune ville dans ce département, région, ou état";
$mquen_nota="";
$codeuser=@$_SESSION["code_log"];
if (@$_SESSION["niv_log"]==3)
	$codeuser=@$_SESSION["code_age"];

if ($coderech <> "")
{
	// Vérification qu'il existe bien des contacts et nombre de ceux-ci
	$nbcontacts = nb_cmque_in_mque($coderech);

	// Vérification qu'il existe bien des contacts et nombre de ceux-ci
	$nbliens = nb_wmque_in_mque($coderech);

	$row = lit_enr_mque($coderech,TRUE);
	if (is_array($row))
	{
		extract ($row);
		$row=lit_enr_MqueNPriv($coderech,$codeuser);
		if (is_array($row))
			extract ($row);
	}
	else
		$pbm_rlpm=TRUE;
}
else
{
	if ($td == "add")
	{
		$mque_code = "";
		$mque_ste = "";
		$mque_codepays=pays_connect_code($_SERVER['REMOTE_ADDR']);
	}
	else
		$pbm_rlpm=TRUE;
}
switch ($td)
{
	case "add" :
		$titre = "AJOUT FABRIQUANT/EDITEUR/DISTRIBUTEUR";
		break;
	case "edit" :
		$titre = "MODIFICATION FABRIQUANT/EDITEUR/DISTRIBUTEUR";
		break;
	case "del" :
		$titre = "SUPPRESSION FABRIQUANT/EDITEUR/DISTRIBUTEUR";
		break;
	default :
		$pbm_rlpm=TRUE;
		break;
}
?>
<!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 echo $title_esp_prive; ?> : Relev&eacute;s - Fiche Fabriquant/Editeur</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>

<!-- 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:type; format:liste ; req:Y ; txt:Type ; vmn:1 ; stok:frmok ; stbad:frmbad",
	"nom:code ; format:alphanum ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_code); ?> ; lmx:20 ; stok:frmok ; stbad:frmbad",
	"nom:ste; format:txt ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_nom); ?> ; lmx:50 ; stok:frmok ; stbad:frmbad",
	"nom:rcs ; format:siret ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_siret); ?> ; lmx:50; stok:frmok ; stbad:frmbad",
	"nom:ape ; format:naf ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_ape); ?> ; lmx:10; stok:frmok ; stbad:frmbad",
	"nom:tvai ; format:tva ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_tvai); ?> ; lmx:50; stok:frmok ; stbad:frmbad",
	"nom:adr1 ; format:txt ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_adr1); ?> ; lmx:50; stok:frmok ; stbad:frmbad",
	"nom:adr2 ; format:txt ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_adr2); ?> ; lmx:50; stok:frmok ; stbad:frmbad",
	"nom:ville ; format:liste ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_ville); ?> ; vmn:1; stok:frmok ; stbad:frmbad",
	"nom:dep ; format:liste ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_dep); ?>; vmn:1 ; stok:frmok ; stbad:frmbad",
	"nom:pays ; format:liste ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_pays); ?> ; vmn:1; stok:frmok ; stbad:frmbad",
	"nom:telf ; format:tel ; req:Y ; txt:<?PHP echo html_entity_decode($txt_chp_telf); ?>; stok:frmok ; stbad:frmbad",
<?PHP if (@$_SESSION["niv_log"] >= 5)
{ 
?>
	"nom:notaa ; format:txt ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_notes); ?> administration; stok:frmok ; stbad:frmbad",
<?PHP
}
if (@$_SESSION["niv_log"] >= 3)
{ 
?>
	"nom:notat ; format:txt ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_notes); ?> techniques; stok:frmok ; stbad:frmbad",
<?PHP
}
?>
	"nom:fax ; format:tel ; req:N ; txt:<?PHP echo html_entity_decode($txt_chp_fax); ?>; stok:frmok ; stbad:frmbad");
//-->
</script>

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

<!-- Scripts Javascript divers -->
<script language="JavaScript" src="../jscript/divers.js"></script>

<!-- Scripts Ajax -->
<script type="text/javascript" src="../ajax/util.js"></script>
<script type="text/javascript" src="../ajax/SelectUpdater.js"></script>

<?PHP if ($pbm_rlpm==FALSE) { ?>
<script type="text/javascript">
<!--        
function updateVille()
{
	villeUpdater = new SelectUpdater("ville", "<?PHP echo $rep_appli.'/ajax/'; ?>recupville.php?dep=", "attn2", "msg2", "<?PHP echo $msg2_err_type; ?>");
	anciendep = "";
	document.getElementById("dep").onchange = function() {
		var listedep = document.getElementById("dep");
		var dep = listedep.options[listedep.selectedIndex].value;
		var listepays = document.getElementById("pays");
		var codepays = listepays.options[listepays.selectedIndex].value;
		if (dep.length > 0)
		{
			if (dep != anciendep)
			{
				// Faire l'appel Ajax
				var prmget=dep+"_"+codepays;
				villeUpdater.run(prmget);
				anciendep = dep;
			}
		}
		else
		{
			// Remettre la liste a vide et annuler l'appel eventuel
			villeUpdater.reset();
			anciendep = "";
		}
	}
}

function updateDep()
{
	depUpdater = new SelectUpdater("dep", "<?PHP echo $rep_appli.'/ajax/'; ?>recupdep.php?pays=", "attn1", "msg1", "<?PHP echo $msg1_err_type; ?>");
	anciencodepays = "";
	anciendep = "";
	document.getElementById("pays").onchange = function() {
		var listepays = document.getElementById("pays");
		var codepays = listepays.options[listepays.selectedIndex].value;
		if (codepays.length > 0)
		{
			if (codepays != anciencodepays)
			{
				// Faire l'appel Ajax
				depUpdater.run(codepays);
				var txthtml = "<option><?PHP echo $sel_lst_makechx; ?></option>\n";
				document.getElementById("ville").innerHTML=txthtml;
				document.getElementById("attn2").innerHTML = "";
				document.getElementById("msg2").innerHTML = "";
				anciencodepays = codepays;
			}
		}
		else
		{
			// Remettre la liste a vide et annuler l'appel eventuel
			depUpdater.reset();
			var txthtml = "<option><?PHP echo $sel_lst_makechx; ?></option>\n";
			document.getElementById("ville").innerHTML=txthtml;
			document.getElementById("attn2").innerHTML = "";
			document.getElementById("msg2").innerHTML = "";
			anciencodepays = "";
		}
	}
}
//-->
</script>
<?PHP } ?>

</head>

<?PHP if ($td == "del"){ ?>
<body onload="warndel();metReadonly();">
<?PHP } else { ?>
<body onLoad="metFocus();updateDep();updateVille();">
<?PHP }
include_once("../inc/entete.inc.php"); 

if ($pbm_rlpm==FALSE)
{
	if (nb_civ() <> 0)
	{
?>

<p align="center"> <span class="titrepage"><?PHP echo $titre ?></span></p>
<table width="100%"  border="0">
<tr>
    <td width="33%"><strong><em><a href="mque_lst.php"><?PHP echo $txt_lnk_ret_liste; ?></a></em></strong></td>
    <td width="33%">&nbsp;
	
	 </td>
    <td width="33%" align="right"><strong><em></em> </strong></td>
  </tr>
</table>
<table width="100%"  border="0">
<tr>
	<td width="31%">
    <?PHP if ($td == "edit")
	{
		$url_crlpma = "cmque_maj.php?td=add&cm=".$mque_code."&tx=mque";
	?>
		<a href="javascript:;" onclick="fensaisie('<?PHP echo $url_crlpma; ?>',950,650,'status=no,scrollbars=yes,menubar=no,statusbar=no,location=no,locationbar=no');")><img src="../img/ctacts.png" border="0" align="absmiddle"></a>
		<a href="javascript:;" onclick="fensaisie('<?PHP echo $url_crlpma; ?>',950,650,'status=no,scrollbars=yes,menubar=no,statusbar=no,location=no,locationbar=no');")> Ajouter un contact </a>
	<?PHP
		$url_crlpma = "cmque_maj.php?td=lst&cm=".$mque_code."&tx=mque";
		if (nb_cmque_in_mque($mque_code) == 0)
			echo '<span id="ctact" style="display:none">';
		else
			echo '<span id="ctact" style="display:inline">';
    ?>
		/
		<a href="javascript:;" onclick="fensaisie('<?PHP echo $url_crlpma; ?>',950,560,'status=no,scrollbars=yes,menubar=no,statusbar=no,location=no,locationbar=no');")> Edition contacts</a>
	<?PHP
		echo '</span>';
	}
	?>
	</td>
	<td width="39%" valign="top">
	<div id="oblig" align="center" class="annot_petit_it">(<img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>"> : <?PHP echo $txt_div_saisoblg; ?>)
	</div>
	</td>
	<td width="30%" align="right">
    <?PHP if ($td == "edit")
	{
		$url_wrlpma = "wmque_maj.php?td=add&cm=".$mque_code;
	?>
		<a href="javascript:;" onclick="fensaisie('<?PHP echo $url_wrlpma; ?>',950,560,'status=no,scrollbars=yes,menubar=no,statusbar=no,location=no,locationbar=no');")><img src="../img/web_link.png" border="0" align="absmiddle"></a>
		<a href="javascript:;" onclick="fensaisie('<?PHP echo $url_wrlpma; ?>',950,560,'status=no,scrollbars=yes,menubar=no,statusbar=no,location=no,locationbar=no');")> Ajouter un lien </a>
	<?PHP
		$url_wrlpma = "wmque_maj.php?td=lst&cm=".$mque_code;
		if (nb_wmque_in_mque($mque_code) == 0)
			echo '<span id="wmque" style="display:none">';
		else
			echo '<span id="wmque" style="display:inline">';
    ?>
		/
		<a href="javascript:;" onclick="fensaisie('<?PHP echo $url_wrlpma; ?>',950,560,'status=no,scrollbars=yes,menubar=no,statusbar=no,location=no,locationbar=no');")> Edition liens</a>
	<?PHP
		echo '</span>';
	}
	?>
	</td>
</tr>
</table>
<table width="100%"  border="0">
<tr>
	<td width="31%">&nbsp;
	
	</td>
	<td width="39%" valign="top">&nbsp;
	
	</td>
	<td width="30%" align="right">
    <?PHP 
	if ($td == "edit")
		echo "<a href=\"retp_maj.php?td=add&cm=".$mque_code."\"><img src=\"../img/retp.png\" border=\"0\" align=\"absmiddle\" title=\"Saisir produit &agrave; retourner\"> Saisir produit &agrave; retourner</a>";
	else
		echo "&nbsp;";
	?>
	</td>
</tr>
</table>
<br>
<form name="mque_maj" method="post" action="mque_enr.php" onSubmit="javascript:; return (VForm(this,tab1_champ,document.mque_maj.pays.value,'<?PHP echo $_SESSION["lng"]; ?>'));">
<input name="titre" type="hidden" id="titre" value="<?PHP echo $titre ?>">
<input name="td" type="hidden" id="td" value="<?PHP echo $td ?>">
  <table width="100%"  border="0">
    <tr>
		<td class="rubfrm" id="f_type" width="160" align="right">Type</td>
	  <td>
			<select id="type" name="type">
			<option value="">--- Choisissez le type de ce contructeur/&eacute;diteur ---</option>
		<?PHP
		foreach ($mques_types as $index => $type)
		{
			echo "<option value=\"".$index."\"";
			if ($index==$mque_type)
				echo" selected";
			echo ">".$type."</option>";
		}
		?>
		</select>
	    <img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
		<br />
		<span class="annot_petit_it">Le type du fabriquant/&eacute;diteur permet de d&eacute;terminer s'il est sp&eacute;cifiquement d&eacute;di&eacute; aux licences, aux mat&eacute;riels, ou aux deux.
		<br />Le distributeur est uniquement utilis&eacute; pour les retours ou pour information.
		<br />Le type recyclage est uniquement utilis&eacute; pour les organismses collecteurs de recyclage.
		</span>
	</td>
    </tr>
    <tr>
      <td class="rubfrm" id="f_code" align="right"><?PHP echo $txt_chp_code; ?></td>
	  <td>
      <?PHP if ($td == "add") { ?>
      <input name="code" type="text" id="code" value="<?PHP echo $mque_code ?>" size="20" maxlength="20">
          <img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
      <?PHP } else { ?>
      <input name="code" type="text" id="code" value="<?PHP echo $mque_code ?>" size="20" maxlength="20" readonly="1">
      <?PHP } ?>
	  </td>
    </tr>
    <tr>
      <td class="rubfrm" id="f_desc" align="right"><?PHP echo $txt_chp_nom; ?></td>
      <td><input name="ste" type="text" id="ste" value="<?PHP echo htmlspecialchars($mque_ste) ?>" size="50">
          <img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>"></td>
    </tr>
		<tr>
			<td class="rubfrm" id="f_rcs" align="right"><?PHP echo $txt_chp_siret; ?></td>
			<td>
			<input name="rcs" type="text" id="rcs" value="<?PHP echo htmlspecialchars($mque_rcs) ?>" size="50" onChange="javascript:this.value=this.value.toUpperCase();">
			</td>
		</tr>
		<tr>
			<td class="rubfrm" id="f_ape" align="right"><?PHP echo $txt_chp_ape; ?></td>
			<td>
			<input name="ape" type="text" id="ape" value="<?PHP echo htmlspecialchars($mque_ape) ?>" size="10" onChange="javascript:this.value=this.value.toUpperCase();">
			</td>
		</tr>
		<tr>
			<td class="rubfrm" id="f_tvai" align="right"><?PHP echo $txt_chp_tvai; ?></td>
			<td>
			<input name="tvai" type="text" id="tvai" value="<?PHP echo htmlspecialchars($mque_tvai) ?>" size="50" onChange="javascript:this.value=this.value.toUpperCase();">
			</td>
		</tr>
	<tr>
		<td class="rubfrm" id="f_adr1" align="right"><?PHP echo $txt_chp_adr1; ?></td>
		<td>
			<input name="adr1" type="text" id="adr1" value="<?PHP echo htmlspecialchars($mque_adr1) ?>" size="50" onChange="javascript:this.value=this.value.toUpperCase();">
			<img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
		</td>
	</tr>
	<tr>
		<td class="rubfrm" id="f_adr2" align="right"><?PHP echo $txt_chp_adr2; ?></td>
		<td>
			<input name="adr2" type="text" id="adr2" value="<?PHP echo htmlspecialchars($mque_adr2) ?>" size="50" onChange="javascript:this.value=this.value.toUpperCase();">
		</td>
	</tr>
	<tr>
		<td class="rubfrm" id="f_pays" align="right"><?PHP echo $txt_chp_pays; ?></td>
		<td>
		<?PHP
			$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
			mysql_select_db(DBNAME);
			$rs = mysql_query("SELECT * FROM ".TBPAYS." ORDER BY pays_nom");
		?>			
			<select name="pays" id="pays">
		<?PHP
			
			echo "<option value=\"\">".$sel_lst_pays."</option>";
	
			// Création de la liste des pays
			
			while ($resultat = mysql_fetch_array($rs)) 
			{
				extract($resultat);
				if ($mque_codepays == $pays_code)
					echo '<option value="'.$pays_code.'" selected>'.$pays_nom.'</option>';
				else
					echo '<option value="'.$pays_code.'">'.$pays_nom.'</option>';
			}
		?>
			</select>
			<img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
		<?PHP
			mysql_free_result($rs);
			mysql_close($conn);
		?>		
		</td>
	</tr>
	<tr>
		<td class="rubfrm" id="f_dep" align="right"><?PHP echo $txt_chp_dep; ?></td>
		<td>
		<?PHP
		// Création de la liste des départements
		$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
		mysql_select_db(DBNAME);
		$rech="SELECT * FROM ".TBDEP." WHERE `dep_codepays`='".$mque_codepays."' ORDER BY dep_code";
		$rs = mysql_query($rech) or die(mysql_error());
		?>
		<select name="dep" size="1" id="dep">
		<?PHP
		echo "<option>".$sel_lst_makechx."</option>";
		if (mysql_num_rows($rs)>0)
		{
			while ($resultat = mysql_fetch_array($rs)) 
			{
				extract($resultat);
				if ($mque_dep == $dep_code)
					echo "<option value=\"".$dep_code."\" selected>".$dep_code." (".$dep_nom.")</option>";
				else
					echo "<option value=\"".$dep_code."\">".$dep_code." (".$dep_nom.")</option>";
			}
		}
		else
			echo "<option value=\"-1\" selected>".$sel_lst_unknown."</option>";
		?>
		</select>
		 <img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
		 <span id="attn1"></span><span id="msg1" style="background-color:#FF0000; color:#FFFF00; font-weight:bold"><?PHP if ((mysql_num_rows($rs)==0) AND ($td<>"del")) echo htmlspecialchars($msg1_err_type)?></span>
		<?PHP
		mysql_free_result($rs);
		mysql_close($conn);
		?>
		</td>
	</tr>
	<tr>
		<td class="rubfrm" id="f_ville" align="right"><?PHP echo $txt_chp_ville; ?></td>
		<td>
		<?PHP
		// Création de la liste des villes
		$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
		mysql_select_db(DBNAME);

		$rech="";
		if ($mque_dep<>"")
		{
			if ($mque_dep<>"-1")
			{
				$filtre=$mque_dep;
				if (($filtre == "2A") OR ($filtre == "2B"))
					$filtre = "20";
				$rech = "SELECT * FROM ".TBVILLES." WHERE `villes_dep` = '".str_majuscules($filtre)."' AND `villes_codepays`='".str_majuscules($mque_codepays)."' ORDER BY villes_nom";
			}
			else
			{
				$rech = "SELECT * FROM ".TBVILLES." WHERE `villes_codepays`='".str_majuscules($mque_codepays)."' ORDER BY villes_nom";
			}
		}
		if ($rech<>"")
			$rs = mysql_query($rech) or die(mysql_error());
		?>
		<select name="ville" size="1" id="ville">
		<?PHP
		echo "<option>".$sel_lst_ville."</option>";

		if ($rech<>"")
		{
			if (mysql_num_rows($rs)>0)
			{
				while ($resultat = mysql_fetch_array($rs)) 
				{
					extract($resultat);
					if ($mque_ville == $villes_id)
					{
						echo '<option value="'.$villes_id.'" selected>'.str_majuscules($villes_nom).' ('.$villes_cp.')</option>';
					}
					else
					{
						echo '<option value="'.$villes_id.'">'.str_majuscules($villes_nom).' ('.$villes_cp.')</option>';
					}
				}
			}
		}
		?>
		</select>
	     <img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
		 <span id="attn2"></span><span id="msg2" style="background-color:#FF0000; color:#FFFF00; font-weight:bold"><?PHP if ($rech<>"") {if ((mysql_num_rows($rs)==0) AND ($td<>"del")) echo htmlspecialchars($msg2_err_type);}?></span>
		<?PHP
		mysql_close($conn);
		?>
		</td>
	</tr>
	<tr>
		<td class="rubfrm" id="f_telf" align="right"><?PHP echo $txt_chp_telf; ?> </td>
		<td>
			<input name="telf" type="text" id="telf" value="<?PHP echo $mque_telf ?>" size="20" maxlength="20">
			<img src="../img/oblig.png" align="absmiddle" alt="<?PHP echo $alt_chp_oblig; ?>">
		</td>
	</tr>
	<tr>
		<td class="rubfrm" id="f_fax" align="right"><?PHP echo $txt_chp_fax; ?></td>
		<td>
			<input name="fax" type="text" id="fax" value="<?PHP echo $mque_fax ?>" size="20" maxlength="20">
		</td>
	</tr>
	<?PHP if (@$_SESSION["niv_log"] >= 5)
	{ 
	?>
	<tr>
		<td class="rubfrm" id="f_notaa" align="right">Notes Administration</td>
		<td>
			<textarea name="notaa" rows="5" id="notaa"><?PHP echo htmlspecialchars($mque_notaa) ?></textarea>
		</td>
	</tr>
	<?PHP
	}
	?>
	<tr>
		<td height="37" class="rubfrm" id="f_notat" align="right">Notes publiques Agences<br><span class="annot_petit_it">(Saisies par l'administrateur ou<br>le centre de gestion)</span></td>
		<td>
			<textarea name="notat" rows="5" id="notat" <?PHP if ((@$_SESSION["niv_log"] == 3) OR (@$_SESSION["niv_log"] == 4))	{ echo "readonly=\"readonly\""; } ?>><?PHP echo htmlspecialchars($mque_notat) ?></textarea>
		</td>
	</tr>
	<tr>
		<td height="37" class="rubfrm" id="f_notap">
		<div align="right">Notes Personnelles<br><span class="annot_petit_it">(Pour les techniciens ce sont<br>celles de leur agence)</span></div>
		</td>
		<td>
			<textarea name="notap" rows="5" id="notap"><?PHP echo htmlspecialchars($mquen_nota) ?></textarea>
		</td>
	</tr>
  </table>
  <p align="center">
    <?PHP if (($td == "add") OR ($td == "edit")) { ?>
    <input name="RAZ" type="reset" class="bton_std" id="RAZ" value="<?PHP echo $but_reinit; ?>">
    <input name="submit" type="submit" class="bton_std" id="submit" value="<?PHP echo $but_enr; ?>">
    <?PHP } ?>
    <?PHP if ($td == "del") { ?>
    <input name="del" type="submit" class="bton_std" id="del" value="<?PHP echo $but_del; ?>">
    <?PHP } ?>
  </p>
</form>
<?PHP
	}
	else
	{
		if (@$_SESSION["niv_log"] >= 5)
		{
			if (nb_fonc() == 0)
			{
?>
	<script type="text/javascript">
	<!--
	setTimeout("self.location.href=('fonc_lst.php');",2000)
	//-->
	</script>
	<p align="center" class="annot_std_it">Merci de cr&eacute;er au moins une fonction...</p>
<?PHP
			}
		}
		else
		{
?>
	<script type="text/javascript">
	<!--
	setTimeout("self.location.href=('index.php');",2000)
	//-->
	</script>
	<p align="center" class="annot_std_it"><?PHP echo $alert_sminoconf; ?><br /><?PHP echo $txt_div_ctactadmincge; ?></p>
<?PHP
		}
	}
}
else
	aff_ret_pbm_auto("mque_lst.php",2000);
include_once("pied.php");
?>
