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

include_once("../inc/config.inc.php");
include_once("../inc/func.inc.php");
include_once("../inc/func_log.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/func_txt.inc.php");
include_once("../inc/fic_txt.inc.php");
include_once("../inc/lst.inc.php");
Archivelog(@$_SESSION["code_log"]);

// Récupération du code contrat type
$co =  strip_tags(trim($_GET['co'])); 
?>
<!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 - ESPACE PRIVE : Contrats Possibles</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("entete.inc.php"); 
?>


<p align="center"><span class="titrepage">NOS OFFRES DE CONTRATS</span></p>
<p>&nbsp;</p>

<!-- Formulaire de demande du type de contrat -->
<form name="dde_co" id="dde_co" method="GET" action="co_disp.php">
<table width="800"  border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>
		<select name="co" size="1" id="co" onChange="dde_co.submit()">
		
		<?PHP 
		// Création de la liste des contrats
		if ($co <> "")
			echo "<option value=\"\">-- Choisissez un contrat type --</option>";
		else
			echo "<option value=\"\" selected>-- Choisissez un contrat type --</option>";
		
		$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
		mysql_select_db(DBNAME);
		$rs = mysql_query("SELECT * FROM ".TBCO." WHERE `co_actif` = '1' ORDER BY co_nom");
		while ($resultat = mysql_fetch_array($rs)) 
		{
			extract($resultat);
			
			if ($co_code == $co)
				echo '<option value="'.$co_code.'" selected>'.$co_nom.'</option>';
			else
				echo '<option value="'.$co_code.'">'.$co_nom.'</option>';
		}
		mysql_free_result($rs);
		mysql_close($conn);
		?>
		</select>
	</td>
</tr>
</table>
</form>
<!-- Fin de formulaire de demande du type de contrat -->
<div id="detco">
<?PHP
if ((isset($_GET['co'])) && (!empty($_GET['co'])))
{
?>
<div id="detco_titreombre">
<?PHP
$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
mysql_select_db(DBNAME);
$rs = mysql_query("SELECT * FROM ".TBCO." WHERE `co_code` = '".$co."'");
if ($row = mysql_fetch_array($rs))
{
	extract($row);
	echo formatetxt($co_desc);
}
else
	echo "&nbsp;";
mysql_free_result($rs);
mysql_close($conn);
?>
</div>
<?PHP
}
?>
<span class="annot_std_it">
<?PHP
$row = lit_enr_txt("CON_PUBCPR");
if (is_array($row))
{
	echo formatetxt($row["txt_texte"]);
}
else
	echo "&nbsp;";
?>
</span>
</div>
<?php 
include_once("pied.php");
?>
