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

include_once("../inc/fic_cli.inc.php");
include_once("../inc/fic_cocl.inc.php");
include_once("../inc/fic_int.inc.php");
include_once("../inc/fic_tac.inc.php");
include_once("../inc/func.inc.php");
include_once("../inc/func_date.inc.php");
include_once("../inc/func_time.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/func_txt.inc.php");
include_once("../inc/lst.inc.php");
Archivelog(@$_SESSION["code_log"]);
$fi="";
if (isset($_GET['fi']) && (trim($_GET['fi'])<>""))
	$fi=intval(strip_tags(trim($_GET['fi'])));
?>
<!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; ?> : Liste Contrats Clients</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>

</head>

<body onLoad="metFocus();">

<?php
include_once("../inc/entete.inc.php");
switch(@$_SESSION["niv_log"])
{
	case 1 :
		$tab_cli=give_tab_rcli($_SESSION["code_log"],TRUE);
		echo '<p align="center"><span class="titrepage">VOS CONTRATS</span></p>';
		break;
	default :
		echo '<p align="center"><span class="titrepage">CONTRATS</span></p>';
		if ((@$_SESSION["niv_log"] == 4) OR (@$_SESSION["niv_log"] == 3))
			echo '<p align="center" class="annot_std_it">(G&eacute;r&eacute;s par votre agence)</p>';
		break;
}

if ((@$_SESSION["niv_log"] == 9) OR (@$_SESSION["niv_log"] == 5) OR (@$_SESSION["niv_log"] == 4))
	$url_add = "cli_lst.php?td=con";
if (@$_SESSION["niv_log"] == 9)
	$url_rss = $rep_appli."/rss/rss.php?log=".$admin_code."&pw=".md5($admin_mdp)."&trss=cocl";

if ((@$_SESSION["niv_log"] == 9) OR (@$_SESSION["niv_log"] == 5) OR (@$_SESSION["niv_log"] == 4) OR (@$_SESSION["niv_log"] == 3) OR (@$_SESSION["niv_log"] == 1))
{
	$fic_imp = "cocl_lsti.php";
	$tab_fi[]="Tous les contrats";
	$tab_fi[]="Contrats actifs";
	$tab_fi[]="Contrats envoyés et non reçus";
	$tab_fi[]="Contrats non renouvelés";
}

$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
mysql_select_db(DBNAME);

switch(@$_SESSION["niv_log"])
{
	case 1 :
		if (count($tab_cli)==1)
		{
			$rech = cree_strrechlstcoclc();
			if(!stristr($rech,"WHERE "))
				$rech .= " WHERE cocl_codecli='".@$_SESSION["code_log"]."'";
			else
				$rech .= " AND cocl_codecli='".@$_SESSION["code_log"]."'";
		}
		else
		{
			$rech = cree_strrechlstcocl();
			
			// On rajoute les comptes complémentaires (cas des regroupements de clients)
			if(!stristr($rech,"WHERE "))
			 $rech .= " WHERE ";
			else
			 $rech .= " AND ";
			if (count($tab_cli)>1)
				$rech .= "(";
			foreach($tab_cli as $key=>$value)
			{
				$rech .= " ".TBCOCL.".cocl_codecli='".$value."' OR";
			}
			// Suppression du dernier 'OR'
			$rech = substr($rech,0,strlen($rech)-3);
		
			if (count($tab_cli)>1)
				$rech .=")";
		}
		break;
	default :
		$rech = cree_strrechlstcocl();
		if ((@$_SESSION["niv_log"] == 4) OR (@$_SESSION["niv_log"] == 3))
		{
			if(!stristr($rech,"WHERE "))
				$rech .= " WHERE ".TBCOCL.".cocl_codeage='".@$_SESSION["code_age"]."'";
			else
				$rech .= " AND ".TBCOCL.".cocl_codeage='".@$_SESSION["code_age"]."'";
		}
		break;
}

switch ($fi)
{
	case "1" :
		if(!stristr($rech,"WHERE "))
			$rech .= " WHERE cocl_datesig<>'0000-00-00' AND cocl_dated<='".$datea."' AND (cocl_datef>='".$datea."' OR cocl_datef='0000-00-00') AND cocl_datefin='0000-00-00'";
		else
			$rech .= " AND cocl_datesig<>'0000-00-00' AND cocl_dated<='".$datea."' AND (cocl_datef>='".$datea."' OR cocl_datef='0000-00-00') AND cocl_datefin='0000-00-00'";
		break;
	case "2" :
		if(!stristr($rech,"WHERE "))
			$rech .= " WHERE cocl_dateenv<>'0000-00-00' AND cocl_daterec='0000-00-00'";
		else
			$rech .= " AND cocl_dateenv<>'0000-00-00' AND cocl_daterec='0000-00-00'";
		break;
	case "3" :
		if(!stristr($rech,"WHERE "))
			$rech .= " WHERE cocl_renouv=0";
		else
			$rech .= " AND cocl_renouv=0";
		break;
	default :
		break;
}

switch(@$_SESSION["niv_log"])
{
	case 1 :
		if (count($tab_cli)==1)
			$rech .= crestr_triord($coclc_titre_col,"cocl_code",FALSE,$limit);
		else
			$rech .= crestr_triord($cocl_titre_col,"cocl_code",FALSE,$limit);
		break;
	default :
		$rech .= crestr_triord($cocl_titre_col,"cocl_code",FALSE,$limit);
		break;
}
$rs = mysql_query($rech) or die(mysql_error());
$numrows = mysql_num_rows($rs); // Nombre de résultats à la requête

if($numrows == 0)
{
	retpp();
}
 else
{
	include_once("formr.inc.php"); 

	switch(@$_SESSION["niv_log"])
	{
		case 1 :
			if (count($tab_cli)==1)
			{
				$rech = cree_strrechlstcoclc();
				if(!stristr($rech,"WHERE "))
					$rech .= " WHERE cocl_codecli='".@$_SESSION["code_log"]."'";
				else
					$rech .= " AND cocl_codecli='".@$_SESSION["code_log"]."'";
			}
			else
			{
				$rech = cree_strrechlstcocl();
				
				// On rajoute les comptes complémentaires (cas des regroupements de clients)
				if(!stristr($rech,"WHERE "))
				 $rech .= " WHERE ";
				else
				 $rech .= " AND ";
				if (count($tab_cli)>1)
					$rech .= "(";
				foreach($tab_cli as $key=>$value)
				{
					$rech .= " ".TBCOCL.".cocl_codecli='".$value."' OR";
				}
				// Suppression du dernier 'OR'
				$rech = substr($rech,0,strlen($rech)-3);
			
				if (count($tab_cli)>1)
					$rech .=")";
			}
			break;
		default :
			$rech = cree_strrechlstcocl();
			if ((@$_SESSION["niv_log"] == 4) OR (@$_SESSION["niv_log"] == 3))
			{
				if(!stristr($rech,"WHERE "))
					$rech .= " WHERE ".TBCOCL.".cocl_codeage='".@$_SESSION["code_age"]."'";
				else
					$rech .= " AND ".TBCOCL.".cocl_codeage='".@$_SESSION["code_age"]."'";
			}
			break;
	}

	switch ($fi)
	{
		case "1" :
			if(!stristr($rech,"WHERE "))
				$rech .= " WHERE cocl_datesig<>'0000-00-00' AND cocl_dated<='".$datea."' AND (cocl_datef>='".$datea."' OR cocl_datef='0000-00-00') AND cocl_datefin='0000-00-00'";
			else
				$rech .= " AND cocl_datesig<>'0000-00-00' AND cocl_dated<='".$datea."' AND (cocl_datef>='".$datea."' OR cocl_datef='0000-00-00') AND cocl_datefin='0000-00-00'";
			break;
		case "2" :
			if(!stristr($rech,"WHERE "))
				$rech .= " WHERE cocl_dateenv<>'0000-00-00' AND cocl_daterec='0000-00-00'";
			else
				$rech .= " AND cocl_dateenv<>'0000-00-00' AND cocl_daterec='0000-00-00'";
			break;
		case "3" :
			if(!stristr($rech,"WHERE "))
				$rech .= " WHERE cocl_renouv=0";
			else
				$rech .= " AND cocl_renouv=0";
			break;
		default :
			break;
	}
	
	switch(@$_SESSION["niv_log"])
	{
		case 1 :
			if (count($tab_cli)==1)
				$rech .= crestr_triord($coclc_titre_col,"cocl_code",TRUE,$limit);
			else
				$rech .= crestr_triord($cocl_titre_col,"cocl_code",TRUE,$limit);
			break;
		default :
			$rech .= crestr_triord($cocl_titre_col,"cocl_code",TRUE,$limit);
			break;
	}

	$rs = mysql_query($rech) or die(mysql_error());

	// *** Pagination de pied
	pagine_lst($numrows,$limit);

		
	// *** Affichage de la table
	 echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     

	// Création entête
	switch(@$_SESSION["niv_log"])
	{
		case 1 :
			if (count($tab_cli)==1)
				titlst($coclc_titre_col);
			else
				titlst($cocl_titre_col);
			break;
		default :
			titlst($cocl_titre_col);
			break;
	}
	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);

		 $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"];

		 // CREATION d'icône si signé
		  if (formatedate($row["cocl_datesig"]) <> "")
		  {
			$lst_sig = TRUE;
			echo " <a href=\"#\" class=\"popa\"><img src=\"../img/ok.png\" alt=\"Sign&eacute; le ".formatedate($row["cocl_datesig"])."\" border=\"0\" align=\"absmiddle\"><span>Sign&eacute; le ".formatedate($row["cocl_datesig"])."</span></a>";
		  }

		 // CREATION d'icône si terminé
		  if ((formatedate($row["cocl_datefin"]) <> "") OR ($echeance_ok == FALSE))
		  {
			$lst_fini = TRUE;
			if (formatedate($row["cocl_datefin"]) <> "")
				echo " <a href=\"#\" class=\"popw\"><img src=\"../img/warn.png\" alt=\"Termin&eacute; le ".formatedate($row["cocl_datefin"])."\" border=\"0\" align=\"absmiddle\"><span>Termin&eacute; le ".formatedate($row["cocl_datefin"])."</span></a>";
			else
				echo " <a href=\"#\" class=\"popw\"><img src=\"../img/warn.png\" alt=\"Termin&eacute; le ".formatedate($row["cocl_datef"])."\" border=\"0\" align=\"absmiddle\"><span>Termin&eacute; le ".formatedate($row["cocl_datef"])."</span></a>";
		  }

		// Icône si tâches non terminées
		if (@$_SESSION["niv_log"] <>1)
		{
			$nb_tac_actives=nb_tac_actives(2,$row["cocl_code"],FALSE);
			if ($nb_tac_actives>0)
			{
				$url_taclst="tac_lst.php?ord=DES&tri=Code&fi=4&search=".$row["cocl_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; ce contrat)";
				echo " <a href=\"".$url_taclst."\"><img src=\"../img/tacwarn.png\" title=\"".$txt_tac."\" border=\"0\" align=\"absmiddle\"></a>";
			}
		 }
		 // Détail contrat
		 echo "<br>";
		 echo "<span class=\"annot_petit_it\">";
		 $txt = formatetxt($row["co_nom"]);
		 echo "->Type : ".htmlspecialchars($txt,ENT_NOQUOTES);
		 echo "</span>";
		 
		 // Géré par
		if ((@$_SESSION["niv_log"] <>3) AND (@$_SESSION["niv_log"] <>4))
		{
			 echo "<br>";
			 echo "<span class=\"annot_petit_it\">";
			 $txt = formatetxt($row["cocl_codeage"]);
			 echo "->Agence : ".htmlspecialchars($txt,ENT_NOQUOTES);
			 echo "</span>";
		}
		 echo "</td>\n";
		 
		// Type de contrat
		 echo "<td align=\"center\">".$typ_horaire[$row["cocl_typh"]]."</td>\n";

		switch(@$_SESSION["niv_log"])
		{
			case 1 :
				if (count($tab_cli)>1)
				{
					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";
				}
				break;
			default :
				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";
				break;
		}

		// 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));
			$solde=soldes_contrat($row["cocl_code"],FALSE);
			$soldeas=tps_trav_non_clot($row["cocl_code"],FALSE);
			echo "<br>Solde actuel : ";
			echo heure_to_hhmm(sec_heure($solde,3,TRUE));
			echo "<br>A sortir : ";
			echo heure_to_hhmm(sec_heure($soldeas,3,TRUE));
			$solde_reel=$solde-$soldeas;
			echo "<br>Solde r&eacute;el : ";
			echo heure_to_hhmm(sec_heure($solde_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 "&nbsp;";
		 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 (@$_SESSION["niv_log"] >= 4) // Edition et cloture uniquement si >=agence
		 {
			if ((formatedate($row["cocl_datefin"]) == "") AND ($echeance_ok == TRUE) AND (formatedate($row["cocl_datesig"]) == ""))
			{
				$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 (@$_SESSION["niv_log"] <= 3) // Voir si <=Technicien
		 {
			$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 (@$_SESSION["niv_log"] >= 3) // Création intervention uniquement si >=technicien et pas fini
		 {
			 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>";
			 }
		 }
		
		 if (@$_SESSION["niv_log"] >= 4) // Suppression uniquement si >=agence et si pas signé
		 {
			 if (formatedate($row["cocl_datesig"]) == "")
			 {
				$lst_del = TRUE;
	
				echo " ";
				echo "<a href=\"cocl_maj.php?td=del&co=".$row["cocl_code"]."&cc=".$row["cocl_codecli"]."&ca=".$row["cocl_codeage"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\" title=\"".$alt_del."\"></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."\" border=\"0\" align=\"absmiddle\"></a>";

		if (@$_SESSION["niv_log"] <> 1)
		{
			 $renouv=TRUE;
			 
			 // Si le contrat n'a pas encore été renouvelé, on peut renouveler
			 if ($row["cocl_renouv"] == 1)
				$renouv=FALSE;
			
			 if ($renouv==TRUE)
			 {
				$lst_ren = TRUE;
				echo "<a href=\"coclren_maj.php?co=".$row["cocl_code"]."\"><img src=\"../img/renouv.png\" border=\"0\" align=\"absmiddle\" title=\"Renouveler\"></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>";

		$lst_mail = TRUE;
		$urlmail = "cocl_pdf.php?code=".$row["cocl_code"]."&timp=1&tact=cop";
		echo " ";
		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 "</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);
	mysql_close($conn);  
		
	echo "<table width=\"100%\" border=\"0\">";
	echo "<tr>";
	echo "<td width=\"50%\">";
	if (($numrows > 0) AND (@$_SESSION["niv_log"] >= 4))
	{
		echo "<a href=\"coclrel_maj.php\">Relancer les contrats non reçus</a>";
		echo " / ";
		echo "<a href=\"coclrec_maj.php\">Accuser réception des contrats reçus</a>";
	}
	else
		echo "&nbsp;";
	echo "</td>";
	echo "<td align=\"right\">";
	echo "&nbsp;";
	echo "</td>";
	echo "</tr>";
	echo "</table>\n";

	// *** Pagination de pied
	pagine_lst($numrows,$limit);

	$taille_piedla="";
	include_once("piedla.inc.php");
}
include_once("pied.php");
?>