<?php
/****************************************************************************************
SMI (Services Maintenance Interventions) est une gestion libre de maintenance et de SAV

Version 0.9.7

Copyright (C) 2006-2007  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=\"header1\">\n";
echo "<div id=\"logo\">\n";
aff_img($urllog,"index.php",195,36,"RETOUR A L'INDEX","Retour à l'index",TRUE);
//echo "<a href=\"index.php\"><img src=\"".$urllog."\"  title=\"RETOUR A L'INDEX\" alt=\"Retour à l'index\" width=\"196\" height=\"36\" border=\"0\" align=\"absmiddle\"></a><br>";
// Récupération des informations centre de gestion
$row=lit_enr_cdg();
if (is_array($row))
{
	extract($row);
	echo $cge_adr1."<br>";
	$pasadr2 = FALSE;
	if ($cge_adr2 <>"")
		echo $cge_adr2."<br>";
	else
		$pasadr2 = TRUE;
	echo Retournecp_openId($cge_ville,TRUE)." ".Retourneville_openId($cge_ville,TRUE)."<br>";
	echo "<br>";
	if ($pasadr2 == TRUE)
		echo "<br>";
	$chemin_imagesco = $chemin_images."/telc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_telf;
	echo "<span class=\"annot_petit_it\">";
	echo " ".$cge_txttelf."<br>";
	echo "</span>";
	$chemin_imagesco = $chemin_images."/faxc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_fax;
	echo "<span class=\"annot_petit_it\">";
	echo " ".$cge_txtfax."<br>";
	echo "</span>";
	echo "<span class=\"annot_petit\">";
	$chemin_imagesco = $chemin_images."/webc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_web;
	echo "<img src=\"".$urlcache."\" align=\"absmiddle\">";
	$chemin_imagesco = $chemin_images."/atc.png"; 
	echo "<img src=\"".$chemin_imagesco."\" align=\"absmiddle\">";
	echo " ".$cge_email."<br>";
	echo "</span>";
	echo "<span class=\"annot_petit_it\">";
	echo $cge_rcs."<br>";
	echo "</span>";
}
else
{
	echo "<br>";
	echo "<br>";
	echo "<br>";
	echo "<br>";
	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>";
echo "<div id=\"head_hd\">";
echo "<div align=\"right\">";
echo "<span class=\"annot_petit_it\" align=\"right\">".date ("d-m-Y")."</span><br>";
echo "</div>";
echo "<br>";
echo "<br>";
echo "<br>";
// Cartouche de connexion
echo "<div id=\"cnx\">";
echo "<table border=\"0\" width=\"250\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr class=\"annot_petit\">\n";
echo "<td align=\"right\" >\n";
echo "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 class=\"annot_petit\">\n";
echo "<td align=\"right\">\n";
echo "Session : ";
echo "</td>\n";
echo "<td class=\"annot_petit_it\" style=\"padding-left:2px;\">\n";
switch (@$_SESSION["niv_log"])
{
	case 1 : 
		echo "Client";
		break;
	case 2 : 
		echo "Op&eacute;rateur";
		break;
	case 3 : 
		echo "Technicien agence";
		break;
	case 4 : 
		echo "Agence";
		break;
	case 5 : 
		echo "Centre de Gestion";
		break;
	case 6 : 
		echo "Donneur d'ordres";
		break;
	case 7 : 
		echo "Technicien donneur d'ordres";
		break;
	case 9 : 
		echo "Administrateur";
		break;
	case 10 : 
		echo "Sous-traitant";
		break;
	case 11 : 
		echo "Technicien sous-traitant";
		break;
}
echo "</td>\n";
echo "</tr>\n";

echo "<tr class=\"annot_petit\">\n";
echo "<td align=\"right\" >\n";
switch (@$_SESSION["niv_log"])
{
	case 3 :
		echo "Agence : ";
		break;
	case 7 :
		echo "Donneur d'ordres : ";
		break;
	case 11 :
		echo "Sous-traitant : ";
		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>";

echo "<br>";
echo "<br>";
echo "<div align=\"right\">";
$chemin_imagesco = $chemin_images."/quit.gif"; 
echo "<a href=\"quit.php\"><img src=\"".$chemin_imagesco."\" title=\"QUITTER\" alt=\"Quitter\" border=\"0\" align=\"absmiddle\"></a>";
echo "</div>";
echo "</div>";
echo "</div>";
?>
<div id="menu_haut">
<!-- You need all this START-->
<ilayer id="layerMenu"><div id="divMenu">  
</div></ilayer>  
<!-- END -->
</div>

<!-- Définition du menu -->
<?PHP
switch (@$_SESSION["niv_log"])
{
	// Menu Technicien sous-traitant
	case 11 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/tecst_mnu.js\"></script>";
		break;
	// Menu Sous-traitant
	case 10 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/st_mnu.js\"></script>";
		break;
	// Menu Administrateur
	case 9 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/adm_mnu.js\"></script>";
		break;
	// Menu Technicien Donneur d'ordres
	case 7 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/tecdo_mnu.js\"></script>";
		break;
	// Menu Donneur d'ordres
	case 6 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/do_mnu.js\"></script>";
		break;
	// Menu Centre de Gestion
	case 5 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/cge_mnu.js\"></script>";
		break;
	// Menu Agences
	case 4 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/age_mnu.js\"></script>";
		break;
	// Menu Techniciens
	case 3 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/tec_mnu.js\"></script>";
		break;
	// Menu Opérateur Téléphonique
	case 2 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/ope_mnu.js\"></script>";
		break;
	// Menu Client
	case 1 :
		echo "<script language=\"JavaScript\" src=\"../jscript/menus/cli_mnu.js\"></script>";
		break;
}
?>
<br>
<br>
<br>
<br>

