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

session_start(); 
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/func_log.inc.php");
if (CheckURLLog(FALSE)==FALSE) header("Location: ../index.php");
if (CheckNivLog("5-9")==FALSE) header("Location: ../index.php");
include_once("../inc/fic_age.inc.php");
include_once("../inc/fic_cli.inc.php");
include_once("../inc/fic_cocl.inc.php");
include_once("../inc/fic_do.inc.php");
include_once("../inc/fic_dos.inc.php");
include_once("../inc/fic_fici.inc.php");
include_once("../inc/fic_int.inc.php");
include_once("../inc/fic_loc.inc.php");
include_once("../inc/fic_ope.inc.php");
include_once("../inc/fic_ot.inc.php");
include_once("../inc/fic_pdt.inc.php");
include_once("../inc/fic_rel.inc.php");
include_once("../inc/fic_st.inc.php");
include_once("../inc/fic_tac.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_geo.inc.php");
include_once("../inc/func_txt.inc.php");
include_once("../inc/func_date.inc.php");
include_once("../inc/func_time.inc.php");
include_once("../inc/lst.inc.php");
Archivelog(@$_SESSION["code_log"]);
$pbm_conf=FALSE;
if (CheckNivLog("5")==TRUE)
{
	if (!exist_logo("cge")) $pbm_conf=TRUE;
	if (!exist_logo_allage()) $pbm_conf=TRUE;
	if (!existe_cdg()) $pbm_conf=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; ?> : <?PHP echo $title_index_bo; ?></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 divers -->
<script language="JavaScript" src="../jscript/divers.js"></script>

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

</head>

<body onLoad="set_mnu_sgeidx('m1');">
<?php 
if ($pbm_conf==FALSE)
{
include_once("../inc/entete.inc.php");

if (CheckNivLog("5")==TRUE)
{
?>
<p align="center"><span class="titrepage"><?PHP echo $titlein_tbord; ?></span><br></p>
<br>
<div id="menu_sgeidx" class="menu_ongletfull">
<a class="ongleti" id="m1" href="javascript:;" onclick="set_mnu_sgeidx(this.id);" onFocus="this.blur();"><?PHP echo $mnuo_tacnt; ?></a>
<a class="ongleti" id="m2" href="javascript:;" onclick="set_mnu_sgeidx(this.id);" onFocus="this.blur();"><?PHP echo $mnuo_intc; ?></a>
<a class="ongleti" id="m3" href="javascript:;" onclick="set_mnu_sgeidx(this.id);" onFocus="this.blur();"><?PHP echo $mnuo_intag; ?></a>
<a class="ongleti" id="m4" href="javascript:;" onclick="set_mnu_sgeidx(this.id);" onFocus="this.blur();"><?PHP echo $mnuo_relpbm; ?></a>
<a class="ongleti" id="m5" href="javascript:;" onclick="set_mnu_sgeidx(this.id);" onFocus="this.blur();"><?PHP echo $mnuo_coechp; ?></a>
<a class="ongleti" id="m6" href="javascript:;" onclick="set_mnu_sgeidx(this.id);" onFocus="this.blur();"><?PHP echo $mnuo_dosc; ?></a>
</div>
<br>

<div id="detailm1" style="display:none">
<?PHP
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);
	
	$rech = cree_strrechlsttac($niv_urgence);
	if(!stristr($rech,"WHERE "))
		$rech .= " WHERE ".TBTAC.".tac_codedest<>'".$admin_code."'";
	else
		$rech .= " AND ".TBTAC.".tac_codedest<>'".$admin_code."'";
	if(!stristr($rech,"WHERE "))
		$rech .= " WHERE tac_datefin='0000-00-00'";
	else
		$rech .= " AND tac_datefin='0000-00-00'";
	$rech .= "ORDER BY ".TBTAC.".tac_code DESC";

	$rs = mysql_query($rech) or die(mysql_error());
	$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête

	if($numrows > 0)
	{
		// *** Affichage de la table
		 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
	
		// Création entête
		titlst($tac_titre_col,FALSE);
		echo "<th>".ucfirst($txt_ent_lst_clic)."</th>\n";
			
		$i = 0;
		
		while ($row = mysql_fetch_assoc($rs)) 
		{         
		 // Affichage résumé tâche
	
			// Création de l'entête de ligne (TR)
			creetrlst($i);
	
			echo "<td>";
			echo $row["tac_code"];
			$rech2="SELECT * FROM ".TBTACC." WHERE `tacc_code`='".$row["tac_codetacc"]."'";
			$rs2 = mysql_query($rech2) or die(mysql_error());
			if ($row2 = mysql_fetch_array($rs2))
			{
				$txttacc = $alt_typtac." : ".$row2["tacc_desc"]." (".$row2["tacc_code"].")";
				echo " <img src=\"".$row2["tacc_img"]."\" title=\"".$txttacc."\" height=\"16\" witdh=\"16\" border=\"0\" align=\"absmiddle\">";
			}
									
			// Détail de la tâche
			if (trim($row["tac_afaire"])<>"")
				echo " <a href=\"#\" class=\"pop\"><img src=\"../img/help.png\" alt=\"R&eacute;sum&eacute;\" border=\"0\" align=\"absmiddle\"><span>-- ".trim($row["tac_titre"])." --<br>".formatetxtbr(trim($row["tac_afaire"]))."</span></a>";
		
			// Auteur
			echo "<div align=\"right\" class=\"annot_petit_it\">";
			echo "Auteur : ";
			if (trim($row["tac_codecrea"])<>@$_SESSION["code_log"])
				echo $row["tac_codecrea"];
			else
				echo "vous-m&ecirc;me";
			echo "</div>";
			
			// Si rattachée
			if (trim($row["tac_coderat"])<>"")
			{
				echo "<div align=\"right\" class=\"annot_petit_it\">";
				echo "Rattach&eacute;e &agrave; ";
				switch ($row["tac_typrat"])
				{
					case 1 :
						echo "int. ";
						break;
					case 2 :
						echo "cont. maint. ";
						break;
					case 3 :
						echo "cont. loc. ";
						break;
					case 4 :
						echo "dossier ";
						break;
					case 5 :
						echo "relev&eacute; ";
						break;
					case 6 :
						echo "bon trav. ";
						break;
				}
				echo $row["tac_coderat"];
				echo "</div>";
			}
			echo "</td>\n";
			 echo "<td align=\"center\">";;
			echo formatedate($row["tac_datecrea"]);
			echo "</td>\n";
			 echo "<td align=\"center\">";;
			echo formatedate($row["tac_datefinp"]);
			// Icône si date de fin dépassée
			if (formatedate($row["tac_datefin"])=="")
			{
				if (echeance_depassee_date($datea,$row["tac_datefinp"]) == TRUE)
					echo " <img src=\"../img/warn.png\" title =\"".$alt_dtedep."\" border=\"0\">";
			}
			echo "</td>\n";
	
			// Affichage détail urgence
			 echo "<td align=\"center\">";;
			echo $niv_urgence[$row["tac_urg"]];
			echo "</td>\n";
			// Fin affichage détail urgence
	
			// Affichage destinataire
			 echo "<td align=\"center\">";;
			if ($row["tac_codedest"]=="CGE")
				echo "Centre de gestion";
			else
				echo $row["tac_codedest"];
			echo "</td>\n";
			// Fin affichage destinataire
			
			 // Affichage Icône Avancement
			 echo "<td align=\"center\">";;
			 echo "<img src=\"../img/2pour".$row["tac_avance"].".png\" title=\"".$row["tac_avance"]."%\" border=\"0\" align=\"absmiddle\">";
			 echo "</td>\n";
	
			// CREATION lien dynamique sur icône (édition, suppression, etc...)
			 echo "<td align=\"center\">";;
	
			$lst_maj = TRUE;
			echo "<a href=\"tac_maj.php?td=edit&ct=".$row["tac_code"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_edit."\"></a>";
			echo " ";
	
			if  ($row["tac_codecrea"] == @$_SESSION["code_log"])
			{
				$lst_del = TRUE;
				echo "<a href=\"tac_maj.php?td=del&ct=".$row["tac_code"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_del."\"></a>";
				echo " ";
			}
			 echo "</td>\n";
	
			 echo "</tr>\n";
		 // Fin affichage résumé Tâche
			
			$i++;    
		}  
		echo "</table>\n";
		// *** Fin affichage de la table
		
		mysql_free_result($rs);
	}
	else
	{
		echo "<div class=\"annot_gras_it\">";
		echo "<br />".$alert_notacnt;
		echo "</div>";
	}	

	
	mysql_close($conn);  
	
	$taille_piedla="";
	include("../inc/piedla.inc.php"); ?>
</div>

<div id="detailm2" style="display:none">
<?PHP
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);

	$rech = cree_strrechlstint($niv_urgence);
	if(!stristr($rech,"WHERE "))
		$rech .= " WHERE ".TBINT.".int_codestatut <> 'CLOT'";
	else
		$rech .= " AND ".TBINT.".int_codestatut <> 'CLOT'";
	$rech .= " AND ".TBINT.".int_codetec <> '-1'";
	$rech .= "ORDER BY ".TBINT.".int_code DESC";
	// *** Fin de Chaîne de Recherche
		 
	$rs = mysql_query($rech) or die(mysql_error());
	$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête
	
	if($numrows > 0)
	{
		echo "<div class=\"annot_std_it\">";
		echo $txt_div_detico;
		echo "</div>";
	
		// *** Affichage de la table
		 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
	
		// Création entête
		titlst($int_titre_col,FALSE);
		echo "<th>".ucfirst($txt_ent_lst_clic)."</th>\n";
		
		$i = 0;
		
		while ($row = mysql_fetch_assoc($rs)) 
		{         
		 // Affichage résumé intervention
	
			// Création de l'entête de ligne (TR)
			creetrlst($i);
	
			echo "<td>";
			echo $row["int_code"];
			$detfic=">>Mat&eacute;riel :<br />".$row["int_mat"]."<br /><br />>>Travail &agrave; effectuer :<br />".$row["int_pbm"];
			if ($detfic<>"")
				echo " <a href=\"#\" class=\"pop\"><img src=\"../img/help.png\" alt=\"D&eacute;tail\" border=\"0\" align=\"absmiddle\"><span>".formatetxtbr($detfic)."</span></a>";
			if ((formatedate($row["int_dateprev"])<>"") AND (formatedate($row["int_datefin"])==""))
			{
				echo " <img src=\"../img/phone.png\" border=\"0\" align=\"absmiddle\"";
				if (@$_SESSION["niv_log"] <> 1)
					echo " title=\"Client pr&eacute;venu\"";
				else
					echo " title=\"Vous avez &eacute;t&eacute; pr&eacute;venu(e)\"";
				echo">";
			}

			$rech2 = "SELECT * FROM `" .TBOT. "` WHERE `ot_codeint` = '".$row["int_code"]."'";
			$rs2 = mysql_query($rech2)or die(mysql_error());
			$nbexist_ot = mysql_num_rows($rs2);
			if ($nbexist_ot>0)
			{
				if ($nbexist_ot>1)
					$txt_ot = $nbexist_ot." bons de travail rattach&eacute;s";
				else
					$txt_ot = $nbexist_ot." bon de travail rattach&eacute;";
				$rech3 = "SELECT * FROM `" .TBOT. "` WHERE `ot_codeint` = '".$row["int_code"]."' AND `ot_datefin` = '0000-00-00'";
				$rs3 = mysql_query($rech3)or die(mysql_error());
				$nbexist_oto = mysql_num_rows($rs3);
				if ($nbexist_oto>0)
				{
					if ($nbexist_oto>1)
						$txt_ot.= ", dont ".$nbexist_oto." non termin&eacute;s";
					else
						$txt_ot.= ", dont ".$nbexist_oto." non termin&eacute;";
					echo " <img src=\"../img/otolink.png\" title=\"".$txt_ot."\" border=\"0\" align=\"absmiddle\">";
				}
				else
					echo " <img src=\"../img/otlink.png\" title=\"".$txt_ot."\" border=\"0\" align=\"absmiddle\">";
				mysql_free_result($rs3);
			}
			mysql_free_result($rs2);

			echo "<div align=\"center\" class=\"annot_petit_it\">";
			echo "G&eacute;r&eacute;e par ".$row["int_codeage"];
			echo "</div>";

			if ($row["int_codeman"]<>"")
			{
				 echo "<div align=\"center\" class=\"annot_petit_it\">";
				 echo "(Code saisie manuelle : ".$row["int_codeman"].")";
				 echo "</div>";
			}
			$nb_tac_actives=nb_tac_actives(1,$row["int_code"],FALSE);
			if ($nb_tac_actives>0)
			{
				$url_taclst="tac_lst.php?ord=DES&tri=Code&fi=3&search=".$row["int_code"];
				$txt_tac=$nb_tac_actives." t&acirc;che";
				if ($nb_tac_actives>1)
					$txt_tac.="s";
				$txt_tac.=" non termin&eacute;e";
				if ($nb_tac_actives>1)
					$txt_tac.="s";
				$txt_tac.=" (cliquez pour la liste des t&acirc;ches rattach&eacute;es &agrave; cette intervention)";
				echo " <a href=\"".$url_taclst."\"><img src=\"../img/tacwarn.png\" title=\"".$txt_tac."\" border=\"0\" align=\"absmiddle\"></a>";
			}

			if ($row["int_codedo"]<>"")
			{
				 echo "<div align=\"center\" class=\"annot_petit_it\">";
				 echo "Ordre de ".$row["int_codedo"];
				 echo "</div>";
			}


			if ($row["int_codeext"]<>"")
			{
				 echo "<div align=\"center\" class=\"annot_petit_it\">";
				 echo "(Dossier : ".$row["int_codeext"].")";
				 echo "</div>";
			}
			echo "</td>\n";
			echo "<td>";
			echo "<div align=\"center\">";
			echo formatedate($row["int_datedde"]);
			echo "</div>";
			echo "</td>\n";
			echo "<td align=\"center\">";
			echo formatedate($row["int_daterdv"]);
			if (formatedate($row["int_daterdv"])<>"")
			{
				echo "<div align=\"center\" class=\"annot_petit_it\">";
				echo substr($row["int_hrdv"],0,5);
				echo "</div>";
			}
			echo "</td>\n";
	
			 // Affichage Icône Lieu
			 echo "<td>";
			 echo "<div align=\"center\">";
			 
			 $lieu = $row["int_codelieu"];
			 $rechlieu = "SELECT * FROM ".TBLIEU." WHERE lieu_code = '$lieu'";
			 
			 $rslieu = mysql_query($rechlieu) or die(mysql_error());
			 
				if (mysql_num_rows($rslieu) <> 0)
				{
					if ($rowlieu = mysql_fetch_array($rslieu)) 
					{
						extract ($rowlieu);
						if ($rowlieu["lieu_img"] <> "")
						{
							$lieuint = $rowlieu["lieu_desc"]." (".$lieu.")";
							echo "<img src=\"".$rowlieu["lieu_img"]."\" title=\"".$lieuint."\" border=\"0\" align=\"absmiddle\">";
						}
						else
						{
							 echo "<span class=\"annot_std_it\">";
							 echo $lieu;
							 echo "</span>";
						}
					}
				}
			 
				mysql_free_result($rslieu);
	
			 echo "</div>";
			 echo "</td>\n";
	
			// Affichage détail urgence
			echo "<td>";
			echo "<div align=\"center\">";
			echo $niv_urgence[$row["int_urg"]];
			echo "</div>";
			echo "</td>\n";
			// Fin affichage détail urgence

			echo "<td>";
			echo $row["int_codecli"];
			$rech2="SELECT cli_dep FROM ".TBCLI." WHERE `cli_code`='".$row["int_codecli"]."'";
			$rs2 = mysql_query($rech2) or die(mysql_error());
			if ($row2 = mysql_fetch_array($rs2))
			{
				echo " <a href=\"cli_maj.php?td=edit&cc=".$row["int_codecli"]."&dep=".$row2["cli_dep"]."\"><img src=\"../img/edit.png\" width=\"14\" height=\"14\" border=\"0\" align=\"absmiddle\" title=\"".$alt_editcli."\"></a>";
			}
			
			// Affichage détail client
			$detailcli = "";
			if ($row["cli_ste"] <> "")
				$detailcli .= $row["cli_ste"].", ";
			$detailcli .= $row["cli_civilite"]." ".$row["cli_nom"];
			echo "<div class=\"annot_petit_itgras\" style=\"margin-left:5px;\">";
			echo $detailcli;
			echo "</div>";
			
			// Affichage site client
			$sitecli = "";
			switch (trim($row["int_idsite"]))
			{
				case "0" :
					break;
				default :
					$rech2 = "SELECT * FROM `" .TBSCLI. "` WHERE `scli_id` = '".trim($row["int_idsite"])."'";
					$rs2 = mysql_query($rech2) or die(mysql_error());
					if ($row2 = mysql_fetch_array($rs2))
					{
						extract($row2);
						$sitecli.= $scli_ste."<br />";
						$sitecli.= $scli_adr1."<br />";
						if ($scli_adr2 <> "")
							$sitecli.= $scli_adr2."<br />";
						$sitecli.= Retournecp_openId($scli_ville,FALSE)." ".Retourneville_openId($scli_ville,FALSE)."<br />";
					}
					mysql_free_result($rs2);
			}
			if ($sitecli<>"")
			{
				$txtgere="";
				echo "<div class=\"annot_petit_itsoul\" style=\"margin-left:5px;padding-top:2px;\">";
				echo "Site (G&eacute;r&eacute; par ";
				if (trim($row["int_codeages"])<>"")
					echo $row["int_codeages"];
				else
					echo $row["int_codeage"];
				echo ")";
				echo "</div>";
				echo "<div class=\"annot_petit_it\" style=\"margin-left:7px;\">";
				echo $sitecli;
				echo "</div>";
			}
			
			// Fin affichage détail client
			
			echo "</td>\n";
			
			// Technicien / Agence traitants
			echo "<td align=\"center\">";
			if (($row["int_codetec"] <> "") AND ($row["int_codetec"] <> "-1"))
			{
				echo $row["int_codetec"];
				$rech2 = "SELECT tec_codeage FROM `" .TBTEC. "` WHERE `tec_code` = '".trim($row["int_codetec"])."'";
				$rs2 = mysql_query($rech2) or die(mysql_error());
				if ($row2 = mysql_fetch_array($rs2))
				{
					extract($row2);
					echo "<div class=\"annot_petit_it\">";
					echo "(Agence ".$tec_codeage.")";
					echo "</div>";
				}
				mysql_free_result($rs2);
			}
			else
				echo "-";
			echo "</td>\n";
			 
			 // Affichage Icône Statut
			 echo "<td>";
			 echo "<div align=\"center\">";
			 
			 $statut = $row["int_codestatut"];
			 $rechico = "SELECT * FROM ".TBSTA." WHERE statut_code = '$statut'";
			 
			 $rsico = mysql_query($rechico) or die(mysql_error());
			 
				if (mysql_num_rows($rsico) <> 0)
				{
					 while ($rowico = mysql_fetch_array($rsico)) 
					{
						extract ($rowico);
						if ($rowico["statut_img"] <> "")
						{
							$statint = $rowico["statut_desc"]." (".$statut.")";
							echo "<img src=\"".$rowico["statut_img"]."\" title=\"".$statint."\" border=\"0\" align=\"absmiddle\">";
						}
						else
						{
							 echo "<span class=\"annot_std_it\">";
							 echo $statut;
							 echo "</span>";
						}
					}
				}
			 
				mysql_free_result($rsico);
	
			 echo "</div>";
			 echo "</td>\n";
	
			// CREATION lien dynamique sur icône (édition, suppression, etc...)
			 echo "<td>";
			 echo "<div align=\"center\">";
	
			$lst_maj = TRUE;
			echo "<a href=\"int_maj.php?td=edit&ci=".$row["int_code"]."&cc=".$row["int_codecli"]."&ca=".$row["int_codeage"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_edit."\"></a>";
			echo " ";
	
			$lst_imp = TRUE;
			$urlimp = "int_pdf.php?ci=".$row["int_code"]."&timp=0";
			echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/print.png\" title=\"Imprimer l'intervention\" border=\"0\" align=\"absmiddle\"></a>";
			echo " ";
	
			$lst_mail = TRUE;
			$urlmail = "int_pdf.php?ci=".$row["int_code"]."&timp=1&tact=cop";
			echo "<a href=\"javascript:;\" onclick=\"fensaisie('".$urlmail."',1,1,'status=no,scrollbars=no,menubar=no,statusbar=no,location=no,locationbar=no');\")><img src=\"../img/mail.png\"";
			if (@$_SESSION["niv_log"] <> 1)
				echo" title=\"Renvoyer une copie par email au client\"";
			else
				echo" title=\"Obtenir une copie par email\"";
			echo " border=\"0\" align=\"absmiddle\"></a>";
			echo " ";
	
			$impc=TRUE;
			if ($_SESSION["code_age"]<>$row["int_codeage"])
			{
				if ((@$_SESSION["niv_log"] == 4) OR (@$_SESSION["niv_log"] == 3))
					$impc=FALSE;
			}

			if ($impc==TRUE)
			{
				$lst_impc = TRUE;
				$urlimp = "int_pdf.php?ci=".$row["int_code"]."&cgv=ok";
				echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/printc.png\" title=\"Imprimer (avec CGV)\" border=\"0\" align=\"absmiddle\"></a>";
				echo " ";
			}

			$lst_del = TRUE;
			echo "<a href=\"int_maj.php?td=del&ci=".$row["int_code"]."&cc=".$row["int_codecli"]."&ct=".$row["int_codetec"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_del."\"></a>";
			echo " ";

			 echo "</div>";
			 echo "</td>\n";
	
			 echo "</tr>\n";
		 // Fin affichage résumé intervention
			
			$i++;    
		}  
		echo "</table>\n";
		// *** Fin affichage de la table
		
		mysql_free_result($rs);
	}
	else
	{
		echo "<div class=\"annot_gras_it\">";
		echo "<br />".$alert_nointc;
		echo "</div>";
	}	

	mysql_close($conn);  
	
	$taille_piedla="";
	include("../inc/piedla.inc.php"); ?>
</div>


<div id="detailm3" style="display:none">
<?PHP
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);

	$rech = cree_strrechlstint($niv_urgence);
	if(!stristr($rech,"WHERE "))
		$rech .= " WHERE ".TBINT.".int_codetec = '-1'";
	else
		$rech .= " AND ".TBINT.".int_codetec = '-1'";
		
	$rech .= " ORDER BY ".TBINT.".int_code DESC";
	// *** Fin de Chaîne de Recherche
		 
	$rs = mysql_query($rech) or die(mysql_error());
	$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête
	
	if($numrows > 0)
	{
		echo "<span class=\"annot_petit_it\">";
		echo $txt_div_detico."<br />";
		echo "</span>";
	
		// *** Affichage de la table
		 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
	
		// Création entête
		titlst($int_titre_col,FALSE);
		echo "<th>".ucfirst($txt_ent_lst_clic)."</th>\n";
		
		$i = 0;
		
		while ($row = mysql_fetch_assoc($rs)) 
		{         
		 // Affichage résumé intervention
	
			// Création de l'entête de ligne (TR)
			creetrlst($i);
	
			 echo "<td>".$row["int_code"];
			$detfic=">>Mat&eacute;riel :<br />".$row["int_mat"]."<br /><br />>>Travail &agrave; effectuer :<br />".$row["int_pbm"];
			if ($detfic<>"")
				echo " <a href=\"#\" class=\"pop\"><img src=\"../img/help.png\" alt=\"D&eacute;tail\" border=\"0\" align=\"absmiddle\"><span>".formatetxtbr($detfic)."</span></a>";
			echo "</td>\n";
			echo "<td align=\"center\">".formatedate($row["int_datedde"])."</td>\n";
			echo "<td align=\"center\">";
			echo formatedate($row["int_daterdv"]);
			if (formatedate($row["int_daterdv"])<>"")
			{
				echo "<div align=\"center\" class=\"annot_petit_it\">";
				echo substr($row["int_hrdv"],0,5);
				echo "</div>";
			}
			echo "</td>\n";
	
			 // Affichage Icône Lieu
			 echo "<td>";
			 echo "<div align=\"center\">";
			 
			 $lieu = $row["int_codelieu"];
			 $rechlieu = "SELECT * FROM ".TBLIEU." WHERE lieu_code = '$lieu'";
			 
			 $rslieu = mysql_query($rechlieu) or die(mysql_error());
			 
				if (mysql_num_rows($rslieu) <> 0)
				{
					 while ($rowlieu = mysql_fetch_array($rslieu)) 
					{
						extract ($rowlieu);
						if ($rowlieu["lieu_img"] <> "")
						{
							$lieuint = $rowlieu["lieu_desc"]." (".$lieu.")";
							echo "<img src=\"".$rowlieu["lieu_img"]."\" title=\"".$lieuint."\" border=\"0\" align=\"absmiddle\">";
						}
						else
						{
							 echo "<span class=\"annot_std_it\">";
							 echo $lieu;
							 echo "</span>";
						}
					}
				}
			 
				mysql_free_result($rslieu);
	
			 echo "</div>";
			 echo "</td>\n";

			 // Affichage détail urgence
			 echo "<td>";
			 echo "<div align=\"center\">";
			 echo $niv_urgence[$row["int_urg"]];
			 echo "</div>";
			 echo "</td>\n";
		
			 // Fin affichage détail urgence
	
	
			 echo "<td>".$row["int_codecli"];
	
			 // Affichage détail client
	
				 $detailcli = "->";
				 if ($row["cli_ste"] <> "")
					$detailcli .= htmlspecialchars($row["cli_ste"]).", ";
				 $detailcli .= htmlspecialchars($row["cli_civilite"])." ".htmlspecialchars($row["cli_nom"]);
				 echo "<br>";
				 echo "<span class=\"annot_std_it\">";
				 echo $detailcli;
				 echo "</span>";
		
			 // Fin affichage détail client
	
			 echo "</td>\n";
			 if (($row["int_codetec"] <> "") AND ($row["int_codetec"] <> "-1"))
				echo "<td>".$row["int_codetec"]."</td>\n";
			 else
				echo "<td>&nbsp;</td>\n";
			 
			 // Affichage Icône Statut
			 
			 echo "<td>";
			 echo "<div align=\"center\">";
			 
			 $statut = $row["int_codestatut"];
			 $rechico = "SELECT * FROM ".TBSTA." WHERE statut_code = '$statut'";
			 
			 $rsico = mysql_query($rechico) or die(mysql_error());
			 
				if (mysql_num_rows($rsico) <> 0)
				{
					 while ($rowico = mysql_fetch_array($rsico)) 
					{
						extract ($rowico);
						if ($rowico["statut_img"] <> "")
						{
							$statint = $rowico["statut_desc"]." (".$statut.")";
							echo "<img src=\"".$rowico["statut_img"]."\" title=\"".$statint."\" border=\"0\" align=\"absmiddle\">";
						}
						else
						{
							 echo "<span class=\"annot_std_it\">";
							 echo $statut;
							 echo "</span>";
						}
					}
				}
			 
				mysql_free_result($rsico);
	
			 echo "</div>";
			 echo "</td>\n";
	
			// CREATION lien dynamique sur icône (édition, suppression, etc...)
			 echo "<td>";
			 echo "<div align=\"center\">";
	
			$lst_maj = TRUE;
	
			echo "<a href=\"int_maj.php?td=edit&ci=".$row["int_code"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\"></a>";
			echo " ";
	
			$lst_imp = TRUE;
			
			 $urlimp = "int_pdf.php?ci=".$row["int_code"];
			 echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/print.png\" title=\"".$alt_impfic."\" border=\"0\" align=\"absmiddle\"></a>";
			 echo " ";
			 if (int_closed($row["int_code"],FALSE) == FALSE)
			 {
				$lst_del = TRUE;
	
				echo "<a href=\"int_maj.php?td=del&ci=".$row["int_code"]."&cc=".$row["int_codecli"]."&ca=".$row["int_codeage"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\"></a>";
			 }
	
			 echo "</div>";
			 echo "</td>\n";
	
			 echo "</tr>\n";
		 // Fin affichage résumé intervention
			
			$i++;    
		}  
		echo "</table>\n";
		// *** Fin affichage de la table
		
		mysql_free_result($rs);
	}
	else
	{
		echo "<div class=\"annot_gras_it\">";
		echo "<br />".$alert_nointc;
		echo "</div>";
	}	

	mysql_close($conn);  
	
	$taille_piedla="";
	include("../inc/piedla.inc.php"); ?>
</div>

<div id="detailm4" style="display:none">
<span class="annot_std_it"><?PHP echo $txt_div_rpbmna; ?></span>
<?PHP
	$lst_maj = FALSE;
	$lst_imp = FALSE;
	$lst_del = FALSE;
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);

	$rech = cree_strrechlstrrel();
	$rech .= crestr_triord($rel_titre_col,"rel_code",FALSE,$limit);
	// *** Fin de Chaîne de Recherche
	$rs = mysql_query($rech) or die(mysql_error());
	$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête
	

	if($numrows > 0)
	{
		$first=TRUE;
		$i = 0;
		
		while ($row = mysql_fetch_assoc($rs)) 
		{         
		 // Affichage résumé relevé
	
			// Vérification si problème(s) non affecté(s)
			// Si oui, on affiche (sinon, non)
			$rexist2 = "SELECT * FROM ".TBRPBM."  WHERE rpbm_codecli = '".$row["cli_code"]."' AND rpbm_codeint IS NULL";
			$rs2 = mysql_query($rexist2) or die(mysql_error());
			if (mysql_num_rows($rs2) > 0)
			{
				if ($first==TRUE)
				{
					// *** Affichage de la table
					 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
				
					// Création entête
					titlst($rel_titre_col,FALSE);
					echo "<th>".ucfirst($txt_ent_lst_clic)."</th>\n";
					
					$first=FALSE;
				}
				
				// Création de l'entête de ligne (TR)
				creetrlst($i);
		
				 echo "<td>";
				 echo $row["rel_code"];
				 echo "</td>\n";
				 echo "<td>".formatedate($row["rel_datecrea"])."</td>\n";
				 echo "<td>".formatedate($row["rel_datemod"])."</td>\n";
				 echo "<td>".$row["rel_codecli"];
		
				 // Affichage détail client
		
					 $detailcli = "->";
					 if ($row["cli_ste"] <> "")
						$detailcli .= htmlspecialchars($row["cli_ste"]).", ";
					 $detailcli .= $row["cli_civilite"]." ".htmlspecialchars($row["cli_nom"]);
					 echo "<br>";
					 echo "<span class=\"annot_std_it\">";
					 echo $detailcli;
					 echo "</span>";
			
				 // Fin affichage détail client
		
				 echo "</td>\n";
				 if ($row["rel_codeage"] <> "")
					echo "<td>".$row["rel_codeage"]."</td>\n";
				 else
					echo "<td>&nbsp;</td>\n";
				 
				// CREATION lien dynamique sur icône (édition, suppression, etc...)
				 echo "<td>";
				 echo "<div align=\"center\">";
		
				$lst_maj = TRUE;
		
				echo "<a href=\"rel_maj.php?td=edit&cr=".$row["rel_code"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\"></a>";
				echo " ";
		
				$lst_imp = TRUE;
				
				 $urlimp = "rel_pdf.php?cr=".$row["rel_code"]."&pbm=0";
				 echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/print.png\" title=\"".$alt_impdosr."\" border=\"0\" align=\"absmiddle\"></a>";
				 echo " ";
		
				$lst_impp = TRUE;
				
				 $urlimp = "rel_pdf.php?cr=".$row["rel_code"]."&pbm=1";
				 echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/printc.png\" title=\"".$alt_impdosrp."\" border=\"0\" align=\"absmiddle\"></a>";
				 echo " ";
		
				$lst_del = TRUE;
		
				echo "<a href=\"rel_maj.php?td=del&cr=".$row["rel_code"]."&cc=".$row["rel_codecli"]."&ca=".$row["rel_codeage"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\"></a>";
		
				 echo "</div>";
				 echo "</td>\n";
		
				 echo "</tr>\n";
				 // Fin affichage résumé intervention
				
				$i++;
			}
		} 
		
		if ($first==FALSE)
			echo "</table>\n";		// *** Fin affichage de la table
		else
		{
			echo "<div class=\"annot_gras_it\">";
			echo "<br />";
			echo $alert_norpbmna;
			echo "</div>";
		}
	
		mysql_free_result($rs);
	}
	else
	{
		echo "<div class=\"annot_gras_it\">";
		echo "<br />".$alert_norelage;
		echo "</div>";
	}

	mysql_close($conn);  
	
	$taille_piedla="";
	include("../inc/piedla.inc.php"); ?>
</div>

<div id="detailm5" style="display:none">
<span class="annot_std_it"><?PHP echo $txt_div_coclar; ?></span>
<?PHP
	$lst_maj = FALSE;
	$lst_voir = FALSE;
	$lst_int = FALSE;
	$lst_imp = FALSE;
	$lst_impp = FALSE;
	$lst_del = FALSE;
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);

	$rech = cree_strrechlstcocl();
	if(!stristr($rech,"WHERE "))
		$rech .= " WHERE ";
	else
		$rech .= " AND ";
	$rech.= TBCOCL.".cocl_datefin ='0000-00-00' AND ".TBCOCL.".cocl_datesig <>'0000-00-00' AND ".TBCOCL.".cocl_renouv =0";
	$rech.= "  AND ".TBCOCL.".cocl_dated<='".$datea."'";
	$rech.= " AND (".TBCOCL.".cocl_typh=1";
	$rech.= " OR (".TBCOCL.".cocl_datef <='".nouv_date_plus_jours($datea,30)."' AND ".TBCOCL.".cocl_datef<>'0000-00-00'))";
	$rech.= " ORDER BY ".TBCOCL.".cocl_code DESC";
	// *** Fin de Chaîne de Recherche
	
	$rs = mysql_query($rech) or die(mysql_error());
	$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête
	
	if($numrows > 0)
	{
		echo "<span class=\"annot_petit_it\">";
		echo $txt_div_detico."<br />";
		echo "</span>";

		echo "<a href=\"coclren_lst.php?ord=DES&tri=Code\">".$txt_lnk_rencocl."</a>";
	
		// *** Affichage de la table
		 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
	
		// Création entête
		titlst($cocl_titre_col,FALSE);
		echo "<th>".ucfirst($txt_ent_lst_clic)."</th>\n";
		
		$i = 0;
		while ($row = mysql_fetch_assoc($rs)) 
		{         
			 // Affichage résumé Contrat Client
		
			// Création de l'entête de ligne (TR)
			creetrlst($i);
		
			$aff_ok=TRUE;
			
			$soldes_reel=soldes_contrat($row["cocl_code"],FALSE);
			if($row["cocl_typh"]==1)
			{
				if ($soldes_reel>3600)
					$aff_ok=FALSE;
			}
			
			if ($aff_ok==TRUE)
			{
				 $echeance_ok = TRUE;
				 if (formatedate($row["cocl_datef"]) <> "")
				 {
					if (echeance_depassee_date($datea,$row["cocl_datef"]) == TRUE)
						$echeance_ok = FALSE;
				 }
		
				 echo "<td>".$row["cocl_code"];
		
				 // Détail contrat
				 echo "<br>";
				 echo "<span class=\"annot_petit_it\">";
				 $txt = formatetxt($row["co_nom"]);
				 echo "->Type : ".htmlspecialchars($txt,ENT_NOQUOTES);
				 echo "</span>";
				 
				 echo "</td>\n";
				 
				// Type de contrat
				 echo "<td align=\"center\">".$typ_horaire[$row["cocl_typh"]]."</td>\n";
		
				echo "<td>";
				echo $row["cocl_codecli"];
				echo " <a href=\"cli_maj.php?td=edit&cc=".$row["cocl_codecli"]."&dep=".$row["cli_dep"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_editcli."\"></a>";
		
				// Affichage détail client
				
				$detailcli = "->";
				if ($row["cli_ste"] <> "")
				$detailcli .= $row["cli_ste"].", ";
				$detailcli .= $row["cli_civilite"]." ".$row["cli_nom"];
				echo "<br>";
				echo "<span class=\"annot_petit_it\">";
				echo htmlspecialchars($detailcli,ENT_NOQUOTES);
				echo "</span>";
				
				// Fin affichage détail client
				
				echo "</td>\n";
		
				// Création
				 echo "<td>";
				 echo "<div align=\"center\">";
				 echo formatedate($row["cocl_datecrea"]);
				 echo "</div>";
				 echo "</td>\n";
				// Début
				 echo "<td>";
				 echo "<div align=\"center\">";
				 echo formatedate($row["cocl_dated"]);
				 echo "</div>";
				 echo "</td>\n";
				// Fin
				 echo "<td>";
				 echo "<div align=\"center\">";
				 if (formatedate($row["cocl_datef"]) == "")
					echo "&nbsp;";
				 else
					echo formatedate($row["cocl_datef"]);
				 echo "</div>";
				 echo "</td>\n";
				// Temps
				 echo "<td>";
				 echo "<div align=\"center\">";
				 echo "<span class=\"annot_petit_it\">";
				 if ($row["cocl_typh"] == 1)
				 {
					 echo "Solde initial : ".heure_to_hhmm(sec_heure($row["cocl_nbs"],3,TRUE));
					 if (formatedate($row["cocl_datesig"]) <> "")
					 {
						$soldes=soldes_contrat($row["cocl_code"],FALSE);
						$soldeass=$soldes_reel-$soldes;
						echo "<br />Solde actuel : ".heure_to_hhm(sec_heure($soldes,3,TRUE));
						echo "<br />A sortir : ".heure_to_hhmm(sec_heure($soldeass,3,TRUE));
						echo "<br />Solde r&eacute;el : ";
						echo heure_to_hhmm(sec_heure($soldes_reel,3,TRUE));
					 }
				 }
				 else
					echo "-";			
				 echo "</span>";
				 echo "</div>";
				 echo "</td>\n";
				// Relancé le
				 echo "<td>";
				 echo "<div align=\"center\">";
				 if (formatedate($row["cocl_daterel"]) == "")
					echo "-";
				 else
					echo formatedate($row["cocl_daterel"]);
				 echo "</div>";
				 echo "</td>\n";
		
				// Renouvellement
				 echo "<td>";
		
				 // Affichage détail renouvelé
				 echo "<div align=\"center\">";
				 echo $non_oui[$row["cocl_renouv"]];
	
				if ($row["cocl_renouv"] == 1)
				{
					 // Affichage détail renouvellement
		
					 $detailren = "(".$row["cocl_rnum"].")";
					 echo "<br>";
					 echo "<span class=\"annot_petit_it\">";
					 echo $detailren;
					 echo "</span>";
			
					 // Fin affichage détail renouvellement
				}
	
				 echo "</div>";
				 // Fin affichage détail renouvelé
		
				 echo "</td>\n";
		
				// CREATION lien dynamique sur icône (édition, suppression, etc...)
				 echo "<td>";
				 echo "<div align=\"center\">";
		
		
				if ((formatedate($row["cocl_datefin"]) == "") AND ($echeance_ok == TRUE))
				{
					$lst_maj = TRUE;
					echo "<a href=\"cocl_maj.php?td=edit&co=".$row["cocl_code"]."&cc=".$row["cocl_codecli"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_edit."\"></a>";
				}
				else
				{
					$lst_voir = TRUE;
					echo "<a href=\"cocl_maj.php?td=view&co=".$row["cocl_code"]."&cc=".$row["cocl_codecli"]."\"><img src=\"../img/eye.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_voir."\"></a>";
				}
				if ((formatedate($row["cocl_datesig"]) <> "") AND (formatedate($row["cocl_datefin"]) == "") AND (tps_trav_non_clot($row["cocl_code"],FALSE)==0))
				{
					echo " ";
					$lst_clore = TRUE;
					echo " <a href=\"coclclos_maj.php?co=".$row["cocl_code"]."\"><img src=\"../img/clore.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_clore."\"></a>";
				}
		
				 if ((formatedate($row["cocl_datefin"]) == "") AND (formatedate($row["cocl_datesig"]) <> "") AND ($echeance_ok == TRUE))
				 {
					$lst_int = TRUE;
					echo " ";
					$url_int = "int_maj.php?td=add&ci=&cc=".$row["cocl_codecli"]."&ca=".$row["cocl_codeage"]."&co=".$row["cocl_code"];
					echo "<a href=\"".$url_int."\"><img src=\"../img/int.png\" title=\" ".$alt_saisintcocl.$row["cocl_code"]."\"  border=\"0\" align=\"absmiddle\"></a>";
				 }
				
				 $lst_histo = TRUE;
				 $urlhisto = "cocls_pdf.php?co=".$row["cocl_code"];
				 echo " <a href=\"javascript:;\" onclick=\"lanceimp('".$urlhisto."');\")><img src=\"../img/histo.png\" title=\"".$alt_syncocl."t\" border=\"0\" align=\"absmiddle\"></a>";
		
				 $lst_imp = TRUE;
				 $urlimp = "cocl_pdf.php?code=".$row["cocl_code"];
				 echo " ";
				 echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/print.png\" title=\"".$alt_impcocl."\" border=\"0\" align=\"absmiddle\"></a>";
			
				 echo "</div>";
				 echo "</td>\n";
		
				 echo "</tr>\n";
				// Fin affichage résumé Contrat Client
					
				$i++;    
			}
		}  
		echo "</table>\n";
		// *** Fin affichage de la table
		
		mysql_free_result($rs);
	}
	else
	{
		echo "<div class=\"annot_gras_it\">";
		echo "<br />".$alert_nococle;
		echo "</div>";
	}	

	mysql_close($conn);  
	
	$taille_piedla="";
	include("../inc/piedla.inc.php"); 
?>
</div>

<div id="detailm6" style="display:none">
<?PHP
	$lst_maj = FALSE;
	$lst_imp = FALSE;
	$lst_del = FALSE;
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);
	
	$rech = cree_strrechlstdos($niv_urgence);
	if(!stristr($rech,"WHERE "))
		$rech .= " WHERE ";
	else
		$rech .= " AND ";
	$rech.= TBDOS.".dos_datefin ='0000-00-00'";
	$rech.= " ORDER BY ".TBDOS.".dos_datefinp ASC";
	// *** Fin de Chaîne de Recherche
	
	$rs = mysql_query($rech) or die(mysql_error());
	$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête
	
	if($numrows > 0)
	{
		echo "<span class=\"annot_petit_it\">";
		echo $txt_div_detico."<br />";
		echo "</span>";

		// *** Affichage de la table
		 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
	
		// Création entête
		titlst($dos_titre_col,FALSE);
		echo "<th>".ucfirst($txt_ent_lst_clic)."</th>\n";
			
		$i = 0;
		while ($row = mysql_fetch_assoc($rs)) 
		{         
			// Création de l'entête de ligne (TR)
			creetrlst($i);
	
			echo "<td>";
			echo $row["dos_code"];
			$rech2="SELECT * FROM ".TBDOSC." WHERE `dosc_code`='".$row["dos_codedosc"]."'";
			$rs2 = mysql_query($rech2) or die(mysql_error());
			if ($row2 = mysql_fetch_array($rs2))
			{
				$txtdosc = $alt_typdos." : ".$row2["dosc_desc"]." (".$row2["dosc_code"].")";
				echo " <img src=\"".$row2["dosc_img"]."\" title=\"".$txtdosc."\" height=\"16\" witdh=\"16\" border=\"0\" align=\"absmiddle\">";
			}
			
			echo "</td>\n";
			echo "<td>";
			echo "<div align=\"center\">";
			echo formatedate($row["dos_datedde"]);
			echo "</div>";
			echo "</td>\n";
			echo "<td>";
			echo "<div align=\"center\">";
			echo formatedate($row["dos_datefinp"]);
			echo "</div>";
			echo "</td>\n";
	
			echo "<td>";
			
			// Affichage détail urgence
			
			echo "<div align=\"center\">";
			echo $niv_urgence[$row["dos_urg"]];
			echo "</div>";
			
			// Fin affichage détail urgence
			
			echo "</td>\n";
	
			echo "<td>";
			echo $row["dos_codecli"];
			$rech2="SELECT cli_dep FROM ".TBCLI." WHERE `cli_code`='".$row["dos_codecli"]."'";
			$rs2 = mysql_query($rech2) or die(mysql_error());
			if ($row2 = mysql_fetch_array($rs2))
			{
				echo " <a href=\"cli_maj.php?td=edit&cc=".$row["dos_codecli"]."&dep=".$row2["cli_dep"]."\"><img src=\"../img/edit.png\" width=\"14\" height=\"14\" border=\"0\" align=\"absmiddle\" title=\"".$alt_editcli."\"></a>";
			}
			
			// Affichage détail client
			$detailcli = "";
			if ($row["cli_ste"] <> "")
				$detailcli .= $row["cli_ste"].", ";
			$detailcli .= $row["cli_civilite"]." ".$row["cli_nom"];
			echo "<div class=\"annot_petit_it\" style=\"margin-left:5px;\">";
			echo $detailcli;
			echo "</div>";
			
			// Fin affichage détail client
			
			echo "</td>\n";
			
			// Technicien / Agence traitants
			echo "<td>";
			if (($row["dos_codesuiv"] <> "") AND ($row["dos_codesuiv"] <> "-1"))
			{
				echo $row["dos_codesuiv"];
				echo "<br /> ".$txt_div_age." : ".$row["dos_codeage"];
			}
			else
				echo "&nbsp;";
			echo "</td>\n";
			 
			 // Affichage Icône Probabilité
			 echo "<td>";
			 echo "<div align=\"center\">";
			 echo "<img src=\"../img/1pour".$row["dos_proba"].".png\" title=\"".$row["dos_proba"]."%\" border=\"0\" align=\"absmiddle\">";
			 echo "</div>";
			 echo "</td>\n";
	
			 // Affichage Icône Avancement
			 echo "<td>";
			 echo "<div align=\"center\">";
			 echo "<img src=\"../img/2pour".$row["dos_avance"].".png\" title=\"".$row["dos_avance"]."%\" border=\"0\" align=\"absmiddle\">";
			 echo "</div>";
			 echo "</td>\n";
	
			 // Affichage Icône Statut
			 echo "<td>";
			 echo "<div align=\"center\">";
			 
			 $rechico = "SELECT * FROM ".TBDOSS." WHERE doss_code = '".$row["dos_codedoss"]."'";
			 
			 $rsico = mysql_query($rechico) or die(mysql_error());
			 
				if (mysql_num_rows($rsico) <> 0)
				{
					 while ($rowico = mysql_fetch_array($rsico)) 
					{
						extract ($rowico);
						if ($rowico["doss_img"] <> "")
						{
							$statint = $rowico["doss_desc"]." (".$row["dos_codedoss"].")";
							echo "<img src=\"".$rowico["doss_img"]."\" title=\"".$statint."\" border=\"0\" align=\"absmiddle\">";
						}
						else
						{
							 echo "<span class=\"annot_std_it\">";
							 echo $row["dos_codedoss"];
							 echo "</span>";
						}
					}
				}
			 
				mysql_free_result($rsico);
	
			 echo "</div>";
			 echo "</td>\n";
	
			// CREATION lien dynamique sur icône (édition, suppression, etc...)
			 echo "<td>";
			 echo "<div align=\"center\">";
	
			$voir=FALSE;
			
			$lst_maj = TRUE;
			echo "<a href=\"dos_maj.php?td=edit&cd=".$row["dos_code"]."&cc=".$row["dos_codecli"]."&ca=".$row["dos_codeage"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_edit."\"></a>";
			echo " ";
	
			$lst_imp = TRUE;
			$urlimp = "dos_pdf.php?cd=".$row["dos_code"];
			echo "<a href=\"javascript:;\" onclick=\"lanceimp('".$urlimp."');\")><img src=\"../img/print.png\" title=\"".$alt_impdoss."\" border=\"0\" align=\"absmiddle\"></a>";
			echo " ";
	
			$lst_del = TRUE;
			echo "<a href=\"dos_maj.php?td=del&cd=".$row["dos_code"]."&cc=".$row["dos_codecli"]."&ca=".$row["dos_codeage"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_del."\"></a>";
			echo " ";

			echo "</div>";
			echo "</td>\n";
	
			 echo "</tr>\n";
			 // Fin affichage résumé Dossier

			$i++;    
		}  
		echo "</table>\n";
		// *** Fin affichage de la table
		
		mysql_free_result($rs);
	}
	else
	{
		echo "<div class=\"annot_gras_it\">";
		echo "<br />".$alert_nodose;
		echo "</div>";
	}	

	mysql_close($conn);  
	
	$taille_piedla="";
	include("../inc/piedla.inc.php"); 
?>
</div>
<?PHP
}
else
{
?>
<p align="center"><span class="titrepage"><?PHP echo $titlein_bo; ?></span></p>
<?PHP
if ((existe_cdg()==FALSE) OR (exist_logo("cge")==FALSE))
{
?>
<br>
<div align="center"><span class="alerte1"><?PHP echo $alert_cgenp; ?></span></div>
<br>
<div align="center" class="annot_gras_it"><a href="cge_maj.php"><?PHP echo $txt_lnk_conf; ?></a></div>
<?PHP
}
?>
<?PHP
if (exist_logo_allage()==FALSE)
{
?>
<br>
<div align="center"><span class="alerte1"><?PHP echo $alert_agenologo ; ?></span></div>
<br>
<div align="center" class="annot_gras_it"><a href="logo_maj.php?td=age"><?PHP echo $txt_lnk_conf; ?></a></div>
<?PHP
}
?>
<p align="center" class="annot_std_gras"><?PHP echo $txt_div_etatfic; ?></p>

<table class="Mtable" border="0" width="500" cellpadding="0" cellspacing="0" align="center">
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre d'op&eacute;rateurs t&eacute;l&eacute;phoniques</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_ope(); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre d'agences</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_age(); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de techniciens agences</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_tec(""); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de donneurs d'ordres</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_do(); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de techniciens donneurs d'ordres</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_tec_do(""); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de sous-traitants</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_st(); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de techniciens sous-traitants</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_tec_st(""); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de clients</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_cli(""); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre d'interventions</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_int(""); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de bons de travail</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_ot(""); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de contrats</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_cocl(""); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de relev&eacute;s de parcs</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_rela(""); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre d'articles</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_pdt(); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de locations</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_coloc(); ?></span></td>
</tr>
<tr class="TRalter1">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de dossiers de suivi</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_dos(); ?></span></td>
</tr>
<tr class="TRalter2">
	<td width="75%" align="right"><span class="annot_std_gras">Nombre de t&acirc;ches</span></td>
	<td align="center"><span class="annot_std_gras"><?PHP echo nb_tac(0,'',TRUE); ?></span></td>
</tr>
</table>
<?PHP
}
if (@$_SESSION["niv_log"] ==5) 
{
?>
<script type="text/javascript">
<!--
warnnbagespr(<?PHP echo pbm_agespr(TRUE); ?>);
warnnbtecspr(<?PHP echo pbm_tecspr('',TRUE); ?>);
warnnbcagespr(<?PHP echo pbm_cagespr('',TRUE); ?>);
//-->
</script>
<?PHP
}
include_once("pied.php");
}
else
{
?>
<p align="center"><span class="titrepageerr"><?PHP echo $alert_pbmconf; ?></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div align="center" class="annot_gras_it"><?PHP echo $alert_sminoconf; ?><br><br>
<?PHP echo $txt_div_ctactadmin; ?></div>
<script type="text/javascript">
<!--
window.setTimeout("location=('../index.php');",2000)
//-->
</script>
<?PHP
}
?>
