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

$urlcache = $chemin_images."/cache.gif"; 
$urllog = $chemin_logos."/logcge.gif"; 

echo "<div id=\"header\">\n";
//Date du jour
echo "<div class=\"head_hd\">";
echo $nomjour." ".date ($datefmt);
// Cartouche de connexion
echo "<div class=\"cnx\">";
echo "<table border=\"0\" width=\"250\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr>\n";
echo "<td align=\"right\" class=\"annot_petit_gras\">\n";
echo $ent_code." : ";
echo "</td>\n";
echo "<td class=\"annot_petit_it\" style=\"padding-left:2px;\">\n";
echo @$_SESSION["code_log"];
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"right\" class=\"annot_petit_gras\">\n";
echo $ent_session." : ";
echo "</td>\n";
echo "<td class=\"annot_petit_it\" style=\"padding-left:2px;\">\n";
switch (@$_SESSION["niv_log"])
{
	case 1 : 
		echo $ent_client;
		break;
	case 2 : 
		echo $ent_operateur;
		break;
	case 3 : 
		echo $ent_tecage;
		break;
	case 4 : 
		echo $ent_age;
		break;
	case 5 : 
		echo $ent_cge;
		break;
	case 6 : 
		echo $ent_do;
		break;
	case 7 : 
		echo $ent_tecdo;
		break;
	case 9 : 
		echo $ent_admin;
		break;
	case 10 : 
		echo $ent_sstt;
		break;
	case 11 : 
		echo $ent_tecsstt;
		break;
}
echo "</td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td align=\"right\" class=\"annot_petit_gras\">\n";
switch (@$_SESSION["niv_log"])
{
	case 3 :
		echo $ent_age." : ";
		break;
	case 7 :
		echo $ent_do." : ";
		break;
	case 11 :
		echo $ent_sstt." : ";
		break;
	default :
		echo "&nbsp;";
		break;
}
echo "</td>\n";
echo "<td class=\"annot_petit_it\" style=\"padding-left:2px;\">\n";
switch (@$_SESSION["niv_log"])
{
	case 3 :
		echo @$_SESSION["code_age"];
		break;
	case 7 :
		echo @$_SESSION["code_do"];
		break;
	case 11 :
		echo @$_SESSION["code_st"];
		break;
	default :
		echo "&nbsp;";
		break;
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>"; // Fin du cartouche
// Affichage de l'icône pour quitter
echo "<div class=\"exit\">";
$chemin_imagesco = $chemin_images."/quit.png"; 
echo "<a href=\"quit.php\"><span class=\"annot_petit_gras2\">Quitter</span> <img src=\"".$chemin_imagesco."\" title=\"".$ent_lnkquittitle."\" alt=\"".$ent_lnkquittitle."\" border=\"0\" align=\"absmiddle\"></a>";
echo "</div>"; // Fin du "quitter"
echo "</div>"; // Fin du header_hd
// Logo SMI
aff_img($urllog,"index.php",0,0,"logo",$ent_lnkidxtitle,$ent_lnkidxalt,TRUE);
// Affichage coordonnées centre de gestion
$row=lit_enr_cdg();
if (is_array($row))
{
	extract($row);
	echo "<span class=\"annot_petit_gras\">";
	echo $cge_adr1;
	if ($cge_adr2 <>"")
		echo ", ".$cge_adr2;
	echo ", ".Retournecp_openId($cge_ville,TRUE)." ".Retourneville_openId($cge_ville,TRUE)."<br />";
	echo "<br />";
	echo "</span>";
	echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" class=\"annot_petit_gras\">\n";
	echo "<tr>\n";
	echo "<td>\n";
	$chemin_imagesco = $chemin_images."/telc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_telf;
	if (trim($cge_txttelf)<>"")
	{
		echo "<span class=\"annot_petit_it\">";
		echo " (".$cge_txttelf.")";
		echo "</span>";
	}
	echo "</td>\n";
	echo "<td style=\"padding-left:10px;\">\n";
	$chemin_imagesco = $chemin_images."/faxc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_fax;
	if (trim($cge_txtfax)<>"")
	{
		echo "<span class=\"annot_petit_it\">";
		echo " (".$cge_txtfax.")";
		echo "</span>";
	}
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>\n";
	$chemin_imagesco = $chemin_images."/webc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_web;
	echo "</td>\n";
	echo "<td style=\"padding-left:10px;\">\n";
	$chemin_imagesco = $chemin_images."/atc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_email."<br>";
	echo "</td>\n";
	echo "</tr>\n";
	echo "</table>";
}
else
{
	echo "<br />";
	echo "<br />";
	$chemin_imagesco = $chemin_images."/telc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo "<img src=\"".$urlcache."\" align=\"absmiddle\">";
	$chemin_imagesco = $chemin_images."/faxc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo "<br />";
	$chemin_imagesco = $chemin_images."/webc.png"; 
	echo "<img src=\"".$urlcache."\" align=\"absmiddle\">";
	$chemin_imagesco = $chemin_images."/atc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo "<br />";

	$chemin_imagesco = $chemin_images."/telc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo "<br />";
	$chemin_imagesco = $chemin_images."/faxc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo "<br />";
	$chemin_imagesco = $chemin_images."/webc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo "<br />";
	echo "<br />";
}
echo "</div>"; // Fin du logo + coordonnées
?>
<div id="menu_haut">
<ilayer id="layerMenu"><div id="divMenu"></div></ilayer>  
</div>
<!-- Définition du menu -->
<?PHP
echo "<script language=\"JavaScript\" src=\"../jscript/menus/menu.js.php\"></script>";
?>
<br />
