<?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/func.inc.php");
include_once("../inc/func_date.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/func_time.inc.php");
include_once("../inc/func_txt.inc.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/lst.inc.php");
Archivelog(@$_SESSION["code_log"]);

$orig =  strip_tags(trim($_GET['or'])); // Récupération origine de l'appel
$cc = strip_tags(trim($_GET['cc'])); // Récupération code Client
$search = strip_tags(trim($_GET['search'])); // Récupération clef de recherche

$pbm_cocl=FALSE;

if ($cc <> "")
{
	// Récupération des informations clients
	$row = lit_enr_cli($cc,TRUE);
	if (is_array($row))
		extract ($row);
	else
		$pbm_cocl=TRUE;
}
else	
	$pbm_cocl=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; ?> : Historique des Contrats</title>

<!-- Feuille de style pour les affichages courants -->
<link href="../css/smi.css" rel="stylesheet" type="text/css">

<!-- 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();">

<p align="center"><span class="titrepage">HISTORIQUE DES CONTRATS</span></p>
<?PHP
if ($pbm_cocl==FALSE)
{
?>
<p align="center"><span class="titre_gras">
<?php 
	if ($cli_ste <> "")
		echo $cli_ste;
	else
		echo $cli_civilite." ".$cli_prenom." ".$cli_nom;
	echo " (Compte : ".$cc.")";
?>
</span></p>

<!-- Formulaire de demande du numéro de contrat -->
<form name="dde_cocl" id="dde_cocl" method="GET" action="coclhd_lst.php">
<input name="cc" type="hidden" id="cc" value="<?PHP echo $cc ?>">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>
	<select name="search" size="1" id="search" onChange="dde_cocl.submit()">
	<?PHP 
	// Création de la liste des contrats
	echo "<option value=\"\"";
	if ($co == "")
		echo " selected";
	echo ">-- Choisissez un contrat --</option>";
	
	$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
	mysql_select_db(DBNAME);
	$rs = mysql_query("SELECT * FROM ".TBCOCL." WHERE `cocl_codecli` = '".$cc."' ORDER BY cocl_code");
	
	while ($resultat = mysql_fetch_array($rs)) 
	{
		extract($resultat);
		
		$rech2 = "SELECT * FROM " .TBCO. " WHERE co_code = '".$cocl_codeco."'";
		$rs2 = mysql_query($rech2) or die(mysql_error());
		if ($row2 = mysql_fetch_array($rs2))
			extract($row2);
		$txt_cocl = $cocl_code." - ".$co_nom." (";
		if ($cocl_typh == 1)
			$txt_cocl.="Quota horaire";
		else
			$txt_cocl.="Classique";
		if ($cocl_delai <> 0)
			$txt_cocl.= ", ".$cocl_delai."h";
		else
			$txt_cocl.= ", Pas de délai";
		if ($cocl_datef<>"0000-00-00")
			$txt_cocl.=", echéance ".formatedate($cocl_datef);
		else
			$txt_cocl.=", sans echéance ";
		$txt_cocl.=")";

		if (formatedate($cocl_datefin) <> "")
			$txt_cocl.=" - CLOT";
		else
			$txt_cocl.=" - OUVERT";
		if (formatedate($cocl_datesig) == "")
			$txt_cocl.=" - A SIGNER";
		else
			$txt_cocl.=" - SIGNE";

		echo '<option value="'.$cocl_code.'"';
		if ($cocl_code == $search)
			echo ' selected';
		echo '>'.$txt_cocl.'</option>';
	}
	mysql_free_result($rs);
	mysql_close($conn);
	?>
	</select>
	</td>
</tr>
</table>
</form>
<!-- Fin de formulaire de demande du numéro de contrat -->
<?PHP
if (isset($_GET['search']) && !empty($_GET['search']))  
{
	$row = lit_enr_cocl($_GET['search']);
	if (is_array($row))
	{
		extract ($row);
		$nbh = sec_heure($cocl_nbs,3,TRUE);
		$deduit=tps_trav_clot($_GET['search'],TRUE);
		$a_deduire=tps_trav_non_clot($_GET['search'],TRUE);
		$soldes = soldes_contrat($_GET['search'],TRUE);
		$solde_reel=soldes_reel_contrat($_GET['search'],TRUE);
		$apports=apports_vers_contrat($_GET['search'],TRUE);
		$reports=reports_depuis_contrat($_GET['search'],TRUE);

		echo "<br />";
		echo "<div class=\"annot_gras_it\">";
		echo "D&eacute;tail des interventions";
		echo "<span class=\"annot_petit_it\">";
		echo " (laisser souris sur les ic&ocirc;nes pour les d&eacute;tails)";
		echo "</span>";
		echo "</div>";
		
		$i = 0;
		// *** Affichage de la table
		echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     
	
		// Création entête
		titlst($coclh_titre_col);
	
		$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
		mysql_select_db(DBNAME);
	
		// Détail des interventions
		$rech = cree_strrechlstcoclh();
		$rech .= crestr_triord($coclh_titre_col,"int_code",FALSE,$limit);
		
		$rs = mysql_query($rech) or die(mysql_error());
		
		if (mysql_num_rows($rs) <> 0)
		{
			$offert=FALSE;
			$indice=FALSE;
			
			while ($row = mysql_fetch_assoc($rs)) 
			{         
			 // Affichage résumé Contrat Client
		
				// Création de l'entête de ligne (TR)
				creetrlst($i);
		
				// Récupération du total travaillé
				$tpstotalsec = 0;
				$tpsoffsec = 0;
				$tpsretsec = 0;
			
				$rech2 = "SELECT * FROM `" .TBINTH. "` WHERE `inth_codeint`= '".$row["int_code"]."'";
				$rs2 = mysql_query($rech2) or die(mysql_error());
				if (mysql_num_rows($rs2) <> 0)
				{
					while ($row2 = mysql_fetch_assoc($rs2)) 
					{
						$tpspassesec = diff_time_sec($row2["inth_heurea"],$row2["inth_heured"]);
						// Calcul du temps réellement passé
						$tpstotalsec = $tpstotalsec + $tpspassesec;
						// C'est du temps offert ?
						// Oui : on ajoute juste au temps total offert
						// Non : on ajoute au temps total retenu
						if ($row2["inth_offert"] == 1)
						{
							// Calcul du temps offert
							$tpsoffsec = $tpsoffsec + $tpspassesec;
							$offert=TRUE;
						}
						else
						{
							// Calcul du temps retenu
							$ind_coeff=1;
							if ($row2["inth_codeind"]=="-1")
								$tpsretsec=$tpsretsec+$tpspassesec;
							else
							{
								$indice=TRUE;
								$row3=lit_enr_ind($row2["inth_codeind"],FALSE);
								if (is_array($row3))
								{
									extract($row3);
									$tpsretsec=$tpsretsec+($tpspassesec*$ind_coeff);
								}
							}
						}
					}
				}
				
				// Si un utilisateur a quitté avant de sauver (bien qu'ayant modifié le détail horaire),
				// on remet en état car seul le détail horaire et technicien enregistré est valable
				if ($row["int_durees"] <> $tpsretsec)
				{
					$rech2 = "UPDATE `" .TBINT. "` SET `int_datemod`='".$datea."', `int_codemod`='".$codeuser."',`int_durees`='".$tpsretsec."'";
					$rech2 .=" WHERE `int_code` = '".$ci."'";
					$rs2 = mysql_query($rech2) or die(mysql_error());
					$row["int_durees"] = $tpsretsec;
				}
	
				echo "<td align=\"center\">";
				echo $row["int_code"];
				if ($tpstotalsec<>$tpsretsec)
					echo " <a href=\"#\" class=\"popa\"><img src=\"../img/clock.png\" alt=\"D&eacute;tail\" border=\"0\" align=\"absmiddle\"><span>Temps r&eacute;el : ".heure_to_hhmm(sec_heure($tpstotalsec,3,TRUE))."</span></a>";
				else
					echo ' <img src="../img/none.gif" style="width:16px;">';
				if ($tpsoffsec<>0)
					echo " <a href=\"#\" class=\"popa\"><img src=\"../img/gift.png\" alt=\"D&eacute;tail\" border=\"0\" align=\"absmiddle\"><span>Temps offert : ".heure_to_hhmm(sec_heure($tpsoffsec,3,TRUE))."</span></a>";
				else
					echo ' <img src="../img/none.gif" style="width:16px;">';
				if (formatedate($row["int_datefin"]) <> "")
					echo ' <img src="../img/none.gif" style="width:16px;">';
				else
					echo " <a href=\"#\" class=\"popa\"><img src=\"../img/out.png\" alt=\"D&eacute;tail\" border=\"0\" align=\"absmiddle\"><span>Intervention &agrave; d&eacute;duire</span></a>";
	
				echo "</td>\n";
				echo "<td align=\"center\">";
				echo formatedate($row["int_datedde"]);
				echo "</td>\n";
				echo "<td align=\"center\">";
				if (formatedate($row["int_daterdv"]) <> "")
				echo formatedate($row["int_daterdv"]);
				else
				echo "-";
				echo "</td>\n";
				echo "<td align=\"center\">";
				if (formatedate($row["int_datefin"]) <> "")
					echo formatedate($row["int_datefin"]);
				else
					echo "-";
				echo "</td>\n";
				echo "<td align=\"center\">".$row["int_codeage"]."</td>\n";
				echo "<td align=\"center\">";
				if ($tpsretsec <> 0)
					echo heure_to_hhmm(sec_heure($tpsretsec,3,TRUE));
				else
					echo "-";
				echo "</td>\n";
	
				// Affichage Icône Statut
				
				echo "<td 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)
				{
					if ($rowico = mysql_fetch_array($rsico))
					{
						extract ($rowico);
						if ($statut_img <> "")
						{
							echo "<img src=\"".$statut_img."\" title=\"".$statut_desc."\" border=\"0\" align=\"absmiddle\">";
						}
						else
						{
							 echo "<span class=\"annot_std_it\">";
							 echo $statut;
							 echo "</span>";
						}
					}
				}
				
				mysql_free_result($rsico);
				
				$url = "int_maj.php?td=edit&ci=".$row["int_code"]."&cc=".$row["coclh_codecli"]."&ca=".$row["int_codeage"];
				$desc = "Voir fiche d'intervention";
				?>
				 <a href="javascript:void(0)" onClick="javascript:; window.opener.location='<?PHP echo $url ?>'; self.close('fscomp');")>
				 <img src="../img/hcon.png" title="<?PHP echo $desc ?>" width="<?PHP echo $hl_vign ?>" height="<?PHP echo $hl_vign ?>" border="0" align="absmiddle">
				 </a>
				 <?PHP
				 echo "</td>\n";
		
				 echo "</tr>\n";
			 // Fin affichage résumé Contrat Client
				
				$i++;    
			}
		}
		else
		{
			creetrlst($i);
			echo "<td colspan=\"7\" align=\"center\">Aucun historique interventions sur ce contrat</td>\n";
			echo "</tr>\n";
		}

		// Totaux
		creetrlst($i);
		echo "<td colspan=\"7\" align=\"center\">&nbsp;</td>\n";
		echo "</tr>\n";
		
		$i++;
		creetrlst($i);
		echo "<td colspan =\"5\" align=\"right\" class=\"annot_std_gras\">Temps d&eacute;j&agrave; utilis&eacute; : </td>\n";
		echo "<td align=\"center\" class=\"annot_std_gras\">";
		if ($deduit <> 0)
			echo heure_to_hhmm(sec_heure($deduit,3,TRUE));
		else
			echo "-";
		echo "</td>\n";
		echo "<td align=\"center\">&nbsp;</td>\n";
		echo "</tr>\n";
		
		$i++;
		creetrlst($i);
		echo "<td colspan =\"5\" align=\"right\" class=\"annot_std_gras\">Temps &agrave; d&eacute;duire : </td>\n";
		echo "<td align=\"center\" class=\"annot_std_gras\">";
		if ($a_deduire <> 0)
			echo heure_to_hhmm(sec_heure($a_deduire,3,TRUE));
		else
			echo "-";
		echo "</td>\n";
		echo "<td align=\"center\">&nbsp;</td>\n";
		echo "</tr>\n";
		
		$i++;
		creetrlst($i);
		echo "<td colspan =\"5\" align=\"right\" class=\"annot_std_gras\">Sous-total temps d&eacute;ductible : </td>\n";
		echo "<td style=\"border-top:thin; border-top-style:solid;\" align=\"center\" class=\"annot_std_gras\">";
		if (($deduit+$a_deduire) <> 0)
			echo heure_to_hhmm(sec_heure($deduit+$a_deduire,3,TRUE));
		else
			echo "-";
		echo "</td>\n";
		echo "<td align=\"center\">&nbsp;</td>\n";
		echo "</tr>\n";
		
		$i++;
		creetrlst($i);
		echo "<td colspan=\"7\" align=\"center\">&nbsp;</td>\n";
		echo "</tr>\n";
		
		if ($cocl_typh == 1)
		{
			$i++;
			creetrlst($i);
			echo "<td colspan=\"5\" align=\"right\" class=\"annot_std_gras\">Quota initial d'heures : </td>\n";
			echo "<td align=\"center\" class=\"annot_std_gras\">";
			echo substr($nbh,0,5);
			echo "</td>\n";
			echo "<td align=\"center\">&nbsp;</td>\n";
			echo "</tr>\n";
			
			if ($apports<>0)
			{
				$i++;
				creetrlst($i);
				echo "<td colspan=\"5\" align=\"right\" class=\"annot_std_gras\">Total apports (<a href=\"#detapp\">cf d&eacute;tails apports</a>) : </td>\n";
				echo "<td align=\"center\" class=\"annot_std_gras\">";
				echo heure_to_hhmm(sec_heure($apports,3,TRUE));
				echo "</td>\n";
				echo "<td align=\"center\">&nbsp;</td>\n";
				echo "</tr>\n";
			}
			
			if ($reports>0)
			{
				$i++;
				creetrlst($i);
				echo "<td colspan=\"5\" align=\"right\" class=\"annot_std_gras\">Total reports (<a href=\"#detrep\">cf d&eacute;tails reports</a>) : </td>\n";
				echo "<td align=\"center\" class=\"annot_std_gras\">";
				echo "-".heure_to_hhmm(sec_heure($reports,3,TRUE));
				echo "</td>\n";
				echo "<td align=\"center\">&nbsp;</td>\n";
				echo "</tr>\n";
			}
			
			$i++;
			creetrlst($i);
			echo "<td colspan=\"5\" align=\"right\" class=\"annot_std_gras\">Temps disponible : </td>\n";
			echo "<td style=\"border-top:thin; border-top-style:solid;\" align=\"center\" class=\"annot_std_gras\">";
			$tpsdispo=$cocl_nbs+$apports-$reports;
			echo heure_to_hhmm(sec_heure($tpsdispo,3,TRUE));
			echo "</td>\n";
			echo "<td align=\"center\">&nbsp;</td>\n";
			echo "</tr>\n";

			$i++;
			creetrlst($i);
			echo "<td colspan=\"7\" align=\"center\">&nbsp;</td>\n";
			echo "</tr>\n";
			
			$i++;
			creetrlst($i);
			echo "<td colspan=\"5\" align=\"right\" class=\"annot_std_gras\">Solde hors interventions en cours : </td>\n";
			echo "<td align=\"center\" class=\"annot_std_gras\">";
			echo heure_to_hhmm(sec_heure($soldes,3,TRUE));
			echo "</td>\n";
			echo "<td align=\"center\">&nbsp;</td>\n";
			echo "</tr>\n";

			$i++;
			creetrlst($i);
			echo "<td colspan=\"5\" align=\"right\" class=\"annot_std_gras\">Solde r&eacute;&eacute;l th&eacute;orique (inclus &quot;&agrave; d&eacute;duire&quot;) : </td>\n";
			echo "<td align=\"center\" class=\"annot_std_gras\">";
			echo heure_to_hhmm(sec_heure($solde_reel, 3,TRUE));
			echo "</td>\n";
			echo "<td align=\"center\">&nbsp;</td>\n";
			echo "</tr>\n";
			
			// Si contrat clot, on dit vers quel contrat cela a été reporté
			if (formatedate($cocl_datefin)<>"")
			{
				$rech = "SELECT coclr_cocldest FROM ".TBCOCLR." WHERE coclr_coclori = '".$_GET['search']."' AND coclr_nbsrep = ".$solde_reel."";
				$rs = mysql_query($rech) or die(mysql_error());
				
				if (mysql_num_rows($rs) <> 0)
				{
					if ($row = mysql_fetch_assoc($rs)) 
					{         
						extract($row);
						$i++;
						creetrlst($i);
						echo "<td colspan=\"5\" align=\"right\" class=\"annot_gras_it\">Solde report&eacute; vers contrat </td>\n";
						echo "<td align=\"center\" class=\"annot_gras_it\">";
						echo $coclr_cocldest;
						echo "</td>\n";
						echo "<td align=\"center\">&nbsp;</td>\n";
						echo "</tr>\n";
					}
				}
			}
		}
		echo "</table>\n";
		// *** Fin affichage de la table

		// Création de la liste des apports affectés à ce contrat (s'il y en a)
		$rech = "SELECT * FROM ".TBCOCLR." WHERE coclr_cocldest = '".$_GET['search']."' ORDER BY coclr_codeint";
		$rs = mysql_query($rech) or die(mysql_error());
		
		if (mysql_num_rows($rs) <> 0)
		{
			echo "<br>";
			echo "<div class=\"annot_gras_it\">";
			echo "<a name=\"detapp\" id=\"detapp\"></a>";
			echo "D&eacute;tails des apports affect&eacute;s &agrave; ce contrat";
			echo "</div>";
	
			$totalreport=0;
			
			// *** Affichage de la table
			echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     

			// Création de l'entête de la table "détails reports"
			echo "<th>";
			echo "Libell&eacute;";
			echo "</th>\n";
			echo "<th>";
			echo "Dur&eacute;e";
			echo "</th>\n";
		
			$j = 0;
			
			while ($row = mysql_fetch_assoc($rs)) 
			{         
				extract($row);
				
				// Création de l'entête de ligne (TR)
				creetrlst($j);
				
				echo "<td>\n";
				if ($coclr_nbsrep>0)
					$txt="Report non ";
				else
					$txt="D&eacute;duction sur-";
				$txt.="consomm&eacute; du contrat ".$coclr_coclori;
				if ($coclr_codeint<>'')
					$txt.=" (Intervention ".$coclr_codeint.")";
				else
					$txt.=" (Cl&ocirc;ture manuelle)";
				echo $txt;
				echo "</td>\n";
		
				echo "<td align=\"center\">\n";
				echo heure_to_hhmm(sec_heure($coclr_nbsrep,3,TRUE));
				$totalreport=$totalreport+$coclr_nbsrep;
				echo "</td>\n";

				echo "</tr>\n";
			
				$j++;
			}
		
			// Total
			creetrlst($j);

			echo "<td align=\"right\" class=\"annot_std_gras\">Total g&eacute;n&eacute;ral :</td>\n";
	
			echo "<td align=\"center\" class=\"annot_std_gras\">\n";
			echo heure_to_hhmm(sec_heure($totalreport,3,TRUE));
			echo "</td>\n";

			echo "</tr>\n";

			echo "</table>\n";
			// Fin affichage table détails reports
		}

		// Création de la liste des reports affectés depuis ce contrat (s'il y en a)
		$rech = "SELECT * FROM ".TBCOCLR." WHERE coclr_coclori = '".$_GET['search']."' AND coclr_nbsrep > 0 ORDER BY coclr_codeint";
		$rs = mysql_query($rech) or die(mysql_error());
		
		if (mysql_num_rows($rs) <> 0)
		{
			echo "<br>";
			echo "<div class=\"annot_gras_it\">";
			echo "<a name=\"detrep\" id=\"detrep\"></a>";
			echo "D&eacute;tails des reports effectu&eacute;s depuis ce contrat";
			echo "</div>";
	
			$totalreport=0;
			
			// *** Affichage de la table
			echo "<table class=\"Mtable\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";     

			// Création de l'entête de la table "détails reports"
			echo "<th>";
			echo "D&eacute;tail des reports";
			echo "</th>\n";
			echo "<th>";
			echo "Dur&eacute;e";
			echo "</th>\n";
		
			$j = 0;
			
			while ($row = mysql_fetch_assoc($rs)) 
			{         
				extract($row);
				
				// Création de l'entête de ligne (TR)
				creetrlst($j);
				
				echo "<td>\n";
				if ($coclr_nbsrep>0)
					$txt="Report non ";
				else
					$txt="D&eacute;duction sur-";
				$txt.="consomm&eacute; vers contrat ".$coclr_cocldest;
				if ($coclr_codeint<>'')
					$txt.=" (Intervention ".$coclr_codeint.")";
				else
					$txt.=" (Cl&ocirc;ture manuelle)";
				echo $txt;
				echo "</td>\n";
		
				echo "<td align=\"center\">\n";
				echo heure_to_hhmm(sec_heure($coclr_nbsrep,3,TRUE));
				$totalreport=$totalreport+$coclr_nbsrep;
				echo "</td>\n";

				echo "</tr>\n";
			
				$j++;
			}
		
			// Total
			creetrlst($j);

			echo "<td align=\"right\" class=\"annot_std_gras\">Total g&eacute;n&eacute;ral :</td>\n";
	
			echo "<td align=\"center\" class=\"annot_std_gras\">\n";
			echo heure_to_hhmm(sec_heure($totalreport,3,TRUE));
			echo "</td>\n";

			echo "</tr>\n";

			echo "</table>\n";
			// Fin affichage table détails reports

		}
	}
	mysql_free_result($rs);
	mysql_close($conn);
}
else
	echo "<br><span class=\"annot_std_gras\">Merci de choisir un contrat.</span><br>";

?>
	<br />
	<div align="center">
	<input name="ferm" type="button" class="bton_std" id="ferm" value="<?PHP echo html_entity_decode($but_fermf); ?>" onClick="javascript:; window.self.close('');">
	</div>
<?PHP
}
else
{
?>
	<script type="text/javascript">
	<!--
	self.close('fscomp');
	//-->
	</script>
<?PHP
}
?>
</body>
</html>
