<?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"] <> 4)) header("Location: ../index.php") ?>
<?php include ("../inc/config.inc.php") ?>
<?php require ("../inc/func.inc.php") ?>
<?php require ("../inc/func_date.inc.php") ?>
<?php require ("../inc/func_log.inc.php") ?>
<?php require ("../inc/fic.inc.php") ?>
<?PHP
	Archivelog(@$HTTP_SESSION_VARS["code_log"]);
?>
<?php
	$coderech = strip_tags(trim($_GET['code']));
	
	if ($coderech <> "")
	{
		// Récupération des informations techniciens

		$row = lit_enr_tec($coderech);
		extract ($row);

		$tec_datecreaf = formatedate($tec_datecrea);
		$tec_congdf = formatedate($tec_congd);
		$tec_congff = formatedate($tec_congf);
		$tec_dateoutf = formatedate($tec_dateout);
	}
?>

<!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 : Impression Fiche Client</title>

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

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

</head>

<body>
<?PHP
	entimpfic("FICHE TECHNICIEN");
?>
  <table class="Ftable" width="800"  border="0">
    <tr>
      <td width="20%" class="rubNormal" id="f_codetec"><div align="right">Code Technicien</div></td>
      <td><?PHP echo $tec_code ?></td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_salarie"><div align="right">Salari&eacute;</div></td>
      <td>
	  <?PHP 
		if ($tec_out == FALSE)
			echo "Oui";
		else
			echo "Non";
		?>
        <span class="annot_std_it">
        <?PHP
		if ($tec_out == false)
			echo "  (Embauche le : ".$tec_datecreaf.")";
		else
			echo "  (Embauche le : ".$tec_datecreaf.", départ le : ".$tec_dateoutf.")";
		?>
        </span> 
	  </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_dconges"><div align="right">Cong&eacute;s </div></td>
      <td colspan="3"><span class="annot_petit_gras">du</span> <?PHP echo $tec_congdf; ?> <span class="annot_petit_gras"> au </span> <?PHP echo $tec_congff; ?> <span class="annot_std_it"> (Prochains cong&eacute;s ou cong&eacute;s en cours)</span> </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_agence"><div align="right">Agence</div></td>
      <td width="83%" colspan="3">
          <?PHP
				
				// Affichage de l'agence
	
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBAGE." WHERE age_code = '".$tec_codeage."'");
				if (mysql_num_rows($rs) <> 0)
				{
					while ($resultat = mysql_fetch_array($rs)) 
					{
						extract($resultat);
						echo $age_nom;
					}
				}
				mysql_free_result($rs);
				mysql_close($conn);
			?>
	  </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_civil"><div align="right">Civilit&eacute;</div></td>
      <td width="83%" colspan="3">
          <?PHP
				
				// Affichage de la civilité
	
				$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
				mysql_select_db(DBNAME);
				$rs = mysql_query("SELECT * FROM ".TBCIV." WHERE civ_code = '".$tec_civilite."'");
				if (mysql_num_rows($rs) <> 0)
				{
					while ($resultat = mysql_fetch_array($rs)) 
					{
						extract($resultat);
						echo $civ_desc;
					}
				}
				mysql_free_result($rs);
				mysql_close($conn);
			?>
	  </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_prenom"><div align="right">Pr&eacute;nom</div></td>
      <td colspan="3"><?PHP echo $tec_prenom ?>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_nom"><div align="right">Nom</div></td>
      <td colspan="3"><?PHP echo $tec_nom ?>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_adr1"><div align="right">Adresse(1)</div></td>
      <td colspan="3"><?PHP echo $tec_adr1 ?>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_adr2"><div align="right">Adresse(2)</div></td>
      <td colspan="3"><?PHP echo $tec_adr2 ?>
    </tr>
    <tr>
      <td class="rubNormal" id="f_cp"><div align="right">Code Postal </div></td>
      <td colspan="3">
          <?PHP
		  		echo Retournecp($tec_ville);
			?>
      </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_ville"><div align="right">Ville</div></td>
      <td colspan="3">
          <?PHP
		  		echo Retourneville($tec_ville);
			?>
      </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_pays"><div align="right">Pays</div></td>
      <td colspan="3">
          <?PHP
				// Affichage du pays

				echo $tec_pays;
			?>
      </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_telf"><div align="right">T&eacute;l&eacute;phone Fixe</div></td>
      <td colspan="3"><?PHP echo $tec_telf ?>
	  </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_fax"><div align="right">T&eacute;l&eacute;copieur</div></td>
      <td colspan="3"><?PHP echo $tec_fax ?></td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_telp"><div align="right">Portable</div></td>
      <td colspan="3"><?PHP echo $tec_telp ?>
      </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_email"><div align="right">Email</div></td>
      <td colspan="3"><?PHP echo $tec_email ?>
	  </td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_mess"><div align="right">Messagerie</div></td>
      <td colspan="3"><?PHP echo $tec_mess ?></td>
    </tr>
    <tr>
      <td width="20%" class="rubNormal" id="f_nota"><div align="right">Notes</div></td>
      <td colspan="3">
		<?PHP
			echo "<span class=\"txtnotes\">";
	  		echo formatetxt($tec_nota);
			echo "</span>";
		?>
		</td>
    </tr>
</table>

    <script type="text/javascript">
	warnimpfic();
	</script>

</body>
</html>