<?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");

if (!isset($_SESSION["lng"])) $_SESSION["lng"]="fr";
include_once("../lng/".$_SESSION["lng"].".inc.php"); // Paramètres de language
include_once("../inc/config.inc.php");
include_once("../inc/fic_age.inc.php");
include_once("../inc/fic_do.inc.php");
include_once("../inc/fic_st.inc.php");
include_once("../inc/fic_hum.inc.php");
include_once("../inc/fic_tec.inc.php");
include_once("../inc/func.inc.php");
include_once("../inc/func_date.inc.php");
include_once("../inc/func_log.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/func_txt.inc.php");
Archivelog(@$_SESSION["code_log"]);

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

$pbm_tec=FALSE;

if ($coderech <> "")
{
	// Récupération des informations techniciens

	$row = lit_enr_tec($coderech,TRUE);
	if (is_array($row))
	{
		extract ($row);
	
		if ((@$_SESSION["niv_log"] == 4) OR (@$_SESSION["niv_log"] == 3))
		{
			if ($tec_codeage<>$_SESSION["code_age"])
				$pbm_tec=TRUE;
		}

		if ($pbm_tec==FALSE)
		{
			$tec_datecreaf = formatedate($tec_datecrea);
			$tec_congdf = formatedate($tec_congd);
			$tec_congff = formatedate($tec_congf);
			$tec_dateoutf = formatedate($tec_dateout);
		}
	}
	else
		$pbm_tec=TRUE;
}
else
	$pbm_tec=TRUE;
?>
<!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; ?> : Impression Fiche Client</title>

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

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

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


</head>

<body onLoad="warnimpfic();">

<?PHP
if ($pbm_tec==FALSE)
{
	entimpfic("FICHE TECHNICIEN");
?>
  <table class="Ftable" width="100%"  border="0">
    <tr>
      <td width="160" class="rubNormal" id="f_codetec" align="right">Code Technicien</td>
      <td><?PHP echo $tec_code ?></td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_salarie" align="right">Salari&eacute;</td>
      <td>
	  <?PHP  echo $non_oui[$tec_out]; ?>
        <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="160" class="rubNormal" id="f_emploi" align="right"><?PHP echo $txt_chp_emploi; ?>
		</td>
		<td>
		<?PHP echo $tec_emploi; ?>
		</td>
	</tr>
	<tr>
		<td width="160" class="rubNormal" id="f_qualif" align="right"><?PHP echo $txt_chp_qualif; ?>
		</td>
		<td>
		<?PHP echo $tec_qualif; ?>
		</td>
	</tr>
	<tr>
		<td width="160" class="rubNormal" id="f_niveau" align="right"><?PHP echo $txt_chp_nivechcoe; ?>
		</td>
		<td>
		<?PHP echo $tec_niveau. " / ".$tec_echelon." / ".$tec_coeff; ?>
		</td>
	</tr>
    <tr>
      <td width="160" class="rubNormal" id="f_dconges" align="right"><?PHP echo $txt_chp_conges; ?></td>
      <td colspan="3">
	  <?PHP if ($tec_congdf<>"") { ?>
	  <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"> <?PHP echo $txt_div_congnext; ?></span>
	  <?PHP } else { ?>
	  &nbsp;
	  <?PHP } ?>
	  </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_agence" align="right">Employeur</td>
      <td width="83%" colspan="3">
	  <?PHP
		// Affichage de l'agence
		if ((@$_SESSION["niv_log"] == 4) OR ($tec_codeage<>""))
		{
			$row = lit_enr_age($tec_codeage,TRUE);
			if (is_array($row))
				extract ($row);
			$empl=$tec_codeage." (Agence)";
		}
		if ((@$_SESSION["niv_log"] == 6) OR ($tec_codedo<>""))
		{
			$row = lit_enr_do($tec_codedo);
			if (is_array($row))
				extract ($row);
			$empl=$tec_codedo." (Donneur d'ordres)";
		}
		if ((@$_SESSION["niv_log"] == 10) OR ($tec_codest<>""))
		{
			$row = lit_enr_st($tec_codest);
			if (is_array($row))
				extract ($row);
			$empl=$tec_codest." (Sous-traitant)";
		}
		echo $empl;
		?>
	  </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_civil" align="right"><?PHP echo $txt_chp_civil; ?></td>
      <td width="83%" colspan="3">
	  <?PHP
		$row = lit_enr_civ($tec_civilite);
		if (is_array($row))
			extract($row);
		echo $civ_desc;
		?>
	  </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_prenom" align="right"><?PHP echo $txt_chp_pnom; ?></td>
      <td colspan="3"><?PHP echo $tec_prenom ?>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_nom" align="right"><?PHP echo $txt_chp_nom; ?></td>
      <td colspan="3"><?PHP echo $tec_nom ?>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_adr1" align="right"><?PHP echo $txt_chp_adr1; ?></td>
      <td colspan="3"><?PHP echo $tec_adr1 ?>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_adr2" align="right"><?PHP echo $txt_chp_adr2; ?></td>
      <td colspan="3"><?PHP echo $tec_adr2 ?>
    </tr>
    <tr>
      <td class="rubNormal" id="f_cp" align="right">Code Postal </td>
      <td colspan="3">
          <?PHP
		  		echo Retournecp_openId($tec_ville,TRUE);
			?>
      </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_ville" align="right"><?PHP echo $txt_chp_ville; ?></td>
      <td colspan="3">
          <?PHP
		  		echo Retourneville_openId($tec_ville,TRUE);
			?>
      </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_pays" align="right">D&eacute;partement</td>
      <td colspan="3">
          <?PHP
				// Affichage du département
				$dep=Retournedep_open($tec_dep,$tec_codepays,TRUE);
				if ($tec_dep<>$dep)
					echo $tec_dep." (".$dep.")";
				else
					echo $dep;
			?>
      </td>
	</tr>
    <tr>
      <td width="160" class="rubNormal" id="f_pays" align="right"><?PHP echo $txt_chp_pays; ?></td>
      <td colspan="3">
          <?PHP
				// Affichage du pays
				echo Retournepays_open($tec_codepays,TRUE);
			?>
      </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_telf" align="right"><?PHP echo $txt_chp_telf; ?></td>
      <td colspan="3"><?PHP echo $tec_telf ?>
	  </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_fax" align="right"><?PHP echo $txt_chp_fax; ?></td>
      <td colspan="3"><?PHP echo $tec_fax ?></td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_telp" align="right"><?PHP echo $txt_chp_telp; ?></td>
      <td colspan="3"><?PHP echo $tec_telp ?>
      </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_email" align="right"><?PHP echo $txt_chp_email; ?></td>
      <td colspan="3"><?PHP echo $tec_email ?>
	  </td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_mess" align="right">Messagerie</td>
      <td colspan="3"><?PHP echo $tec_mess ?></td>
    </tr>
    <tr>
      <td width="160" class="rubNormal" id="f_nota" align="right"><?PHP echo $txt_chp_notes; ?></td>
      <td colspan="3">
		<?PHP
			echo "<span class=\"txtnotes\">";
	  		echo formatetxt($tec_nota);
			echo "</span>";
		?>
		</td>
    </tr>
</table>
<?PHP
}
else
{
?>
	<script type="text/javascript">
	<!--
	window.close();
	//-->
	</script>
<?PHP
}
?>
</body>
</html>
