<?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_age.inc.php");
include_once("../inc/fic_st.inc.php");
include_once("../inc/fic_tec.inc.php");
include_once("../inc/fic_hum.inc.php");
include_once("../inc/lst.inc.php");
Archivelog(@$_SESSION["code_log"]);
$td="";
if (isset($_GET['td']))
	$td = strip_tags(trim(@$_GET['td']));
else
	$td = strip_tags(trim(@$_POST['td']));
$codetec="";
if (isset($_GET['ct']))
	$codetec = strip_tags(trim(@$_GET['ct']));
else
	$codetec = strip_tags(trim(@$_POST['ct']));
$tl="";
if (isset($_GET['tl']))
	$tl = intval(strip_tags(trim(@$_GET['tl'])));
else
	$tl = intval(strip_tags(trim(@$_POST['tl'])));

if (($tl<>1) AND ($tl<>3))
	$pbm_tec=TRUE;
	
if (@$_SESSION["niv_log"] == 4)
	$tl=1;

if (@$_SESSION["niv_log"] == 10)
	$tl=3;

$id = "";
if (isset($_GET['id']))
	$id = strip_tags(trim(@$_GET['id']));
else
	$id = strip_tags(trim(@$_POST['id']));

$pbm_tec=FALSE;
$pbm_enr_tecpr = FALSE;
$msg="";
$lastid=0;
$lastdate="";
$totalpr=0;
$datecrea="";
if ($codetec <> "")
{
	$row = lit_enr_tec($codetec,TRUE);
	if (is_array($row))
	{
		extract ($row);
		// Vérification tentative de hack d'une agence
		if (@$_SESSION["niv_log"] == 4)
		{
			if ($tec_codeage<>$_SESSION["code_age"])
				$pbm_tec=TRUE;
		}

		// Vérification tentative de hack d'un sous-traitant
		if (@$_SESSION["niv_log"] == 10)
		{
			if ($tec_codest<>$_SESSION["code_st"])
				$pbm_tec=TRUE;
		}

		if ($pbm_tec==FALSE)
		{
			switch ($tl)
			{
				case 1 :
					$row = lit_enr_age($tec_codeage,TRUE);
					break;
				case 3 :
					$row = lit_enr_st($tec_codest,TRUE);
					break;
			}
			if (is_array($row))
			{
		
				extract ($row);
				switch ($tl)
				{
					case 1 :
						$datecrea = $age_datecrea;
						break;
					case 3 :
						$datecrea = $st_datecrea;
						break;
				}
				
				$totalpr=nb_tecpr($codetec,TRUE);
				if ($totalpr==0)
					$td="add";
				if (((strip_tags(trim(@$_POST["enr"])) == html_entity_decode($but_add)) OR (strip_tags(trim(@$_POST["enr"])) == html_entity_decode($but_modif))))
				{
					$datesais = strip_tags(trim(@$_POST["date"]));
					if ($datesais <> "")
						$datesaisa = datefrang($datesais);
					else
						$datesaisa ="";
					$hj = strip_tags(trim(@$_POST["hj"])).":00";
					$hjs = heure_sec($hj);
					$hh = strip_tags(trim(@$_POST["hh"])).":00";
					$hhs = heure_sec($hh);
					$hm = strip_tags(trim(@$_POST["hm"])).":00";
					$hms = heure_sec($hm);
					$salm = strip_tags(trim(@$_POST["salm"]));
					$couth = strip_tags(trim(@$_POST["couth"]));

					if (($datesaisa <> "") AND (floatval($couth)>0))
					{
						$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
						mysql_select_db(DBNAME);
						if (strip_tags(trim(@$_POST["enr"])) == html_entity_decode($but_add))
						{
							$rech = "INSERT INTO " .TBTECPR;
							$rech .= " (tecpr_codetec,tecpr_date,tecpr_hjs,tecpr_hhs,tecpr_hms,tecpr_salm,";
							for ($key=1; $key<8; $key++)
							{
								$variable="j".$key."m1";
								$rech .= " tecpr_".$variable.",";
								$variable="j".$key."m2";
								$rech .= " tecpr_".$variable.",";
								$variable="j".$key."a1";
								$rech .= " tecpr_".$variable.",";
								$variable="j".$key."a2";
								$rech .= " tecpr_".$variable.",";
							}
							$rech .= "tecpr_couth) VALUES";
							$rech .= " ('$codetec','$datesaisa','$hjs','$hhs','$hms','$salm',";
							for ($key=1; $key<8; $key++)
							{
								$variable="j".$key."m1";
								$rech .= " '".$_POST[$variable].":00',";
								$variable="j".$key."m2";
								$rech .= " '".$_POST[$variable].":00',";
								$variable="j".$key."a1";
								$rech .= " '".$_POST[$variable].":00',";
								$variable="j".$key."a2";
								$rech .= " '".$_POST[$variable].":00',";
							}
							$rech .= "'$couth')";
						}
						if (strip_tags(trim(@$_POST["enr"])) == html_entity_decode($but_modif))
						{
							if ($id <> "")
							{
								$rech = "UPDATE `" .TBTECPR;
								$rech .= "` SET `tecpr_date`='".$datesaisa."',`tecpr_couth`='".$couth."',";
								$rech .= " `tecpr_hjs`='".$hjs."',`tecpr_hhs`='".$hhs."',";
								$rech .= " `tecpr_hms`='".$hms."',";
								for ($key=1; $key<8; $key++)
								{
									$variable="j".$key."m1";
									$rech .= " `tecpr_".$variable."`='".$_POST[$variable].":00',";
									$variable="j".$key."m2";
									$rech .= " `tecpr_".$variable."`='".$_POST[$variable].":00',";
									$variable="j".$key."a1";
									$rech .= " `tecpr_".$variable."`='".$_POST[$variable].":00',";
									$variable="j".$key."a2";
									$rech .= " `tecpr_".$variable."`='".$_POST[$variable].":00',";
								}
								$rech .= "`tecpr_salm`='".$salm."'";
								$rech .="  WHERE `tecpr_id` = '".$id."'";
							}
						}
						$rs = mysql_query($rech) or die(mysql_error());
						mysql_close($conn);
						unset($_POST);
						$td ="add";
					}
					else
					{
						$pbm_enr_tecpr = TRUE;
						$msg = "Probl&egrave;me de saisie.";
					}
				}
				else
				{
					if (strip_tags(trim(@$_POST["enr"])) == html_entity_decode($but_del))
					{
						if ($id <> "")
						{
							$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
							mysql_select_db(DBNAME);
							$rech = "DELETE FROM `" .TBTECPR. "` WHERE `tecpr_id` = '$id'";
							$rs = mysql_query($rech) or die(mysql_error());
							mysql_close($conn);
						}
						unset($_POST);
						$td ="add";
					}
				}
			}
			else
				$pbm_tec=TRUE;
		}
	}
	else
		$pbm_tec=TRUE;
}
else
	$pbm_tec=TRUE;		

if ($pbm_tec == FALSE)
{
	$lastid=last_id_tecpr($codetec);
	$lastdate=last_date_tecpr($lastid);
	
	switch ($td)
	{
		case "add" :
			$titre = "Ajouter prix de revient";
			if ($lastid>0)
			{
				$row = lit_enr_tecpr($lastid);
				if (is_array($row))
					extract($row);
				$datesais=formatedate(nouv_date_plus_jours($lastdate,1));
				// Récupération horaires
				$tecpr_hj = heure_to_hhmm(sec_heure($tecpr_hjs));
				$tab_heure=explode(":",sec_heure($tecpr_hhs));
				$tecpr_hh=$tab_heure[0].":".$tab_heure[1];
				$tab_heure=explode(":",sec_heure($tecpr_hms));
				$tecpr_hm=$tab_heure[0].":".$tab_heure[1];
			}
			else
			{
				$datesais=formatedate($datecrea);
				$tecpr_hj = "07:00";
			}
			break;
		case "edit" :
		case "view" :
		case "del" :
			if ($id <> "")
			{
				$row = lit_enr_tecpr($id);
				if (is_array($row))
					extract($row);
				$datesais = datefr($tecpr_date);	
				// Récupération horaires
				$tecpr_hj = heure_to_hhmm(sec_heure($tecpr_hjs));
				$tab_heure=explode(":",sec_heure($tecpr_hhs));
				$tecpr_hh=$tab_heure[0].":".$tab_heure[1];
				$tab_heure=explode(":",sec_heure($tecpr_hms));
				$tecpr_hm=$tab_heure[0].":".$tab_heure[1];
			}
			if ($td=="edit")
				$titre = "Editer prix de revient";
			if ($td=="view")
				$titre = "Voir prix de revient";
			if ($td=="del")
				$titre = "Supprimer prix de revient";
			break;
	}
}
?>
<!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; ?> : Prix de revient technicien</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 pour contrôle de formulaire -->
<script	type="text/javascript" src="../jscript/vform/vform.js"></script>

<script language="javascript">
<!--
var tab1_champ=new Array(
	"nom:date ; format:date ; masque:<?PHP echo $datemsql; ?> ; req:Y ; txt:Date ; vmn:<?PHP if ($lastid>0) {if ($td=="add") echo formatedate(nouv_date_plus_jours($lastdate,1)); else echo formatedate($lastdate); } else echo formatedate($datecrea); ?> ; stok:frmok ; stbad:frmbad",
	"nom:hj; format:dureehhmm ; req:N ; txt:Horaire journalier ; stok:frmok ; stbad:frmbad",
	"nom:hh; format:dureehhmm ; req:N ; txt:Horaire hebdomadaire ; stok:frmok ; stbad:frmbad",
	"nom:hm; format:dureehhmm ; req:N ; txt:Horaire mensuel ; stok:frmok ; stbad:frmbad",
	"nom:salm; format:reel_ns ; req:N ; txt:Salaire mensuel ; stok:frmok ; stbad:frmbad",
<?PHP
	foreach ($lng_tjour as $key=>$value)
	{
		$variable="j".$key."m1";
		echo '"nom:'.$variable.'; format:heurehhmm ; req:N ; txt:Horaire début matin '.$value.' ; stok:frmok ; stbad:frmbad",';
		$variable="j".$key."m2";
		echo '"nom:'.$variable.'; format:heurehhmm ; req:N ; txt:Horaire fin matin '.$value.' ; stok:frmok ; stbad:frmbad",';
		$variable="j".$key."a1";
		echo '"nom:'.$variable.'; format:heurehhmm ; req:N ; txt:Horaire début après-midi '.$value.' ; stok:frmok ; stbad:frmbad",';
		$variable="j".$key."a2";
		echo '"nom:'.$variable.'; format:heurehhmm ; req:N ; txt:Horaire fin après-midi '.$value.' ; stok:frmok ; stbad:frmbad",';
	}
?>
	"nom:couth; format:reel_ns ; req:Y ; txt:coût horaire ; vmn:0.01 ; stok:frmok ; stbad:frmbad");
//-->
</script>

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

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

<!-- Scripts Javascript pour vérifications des champs -->
<script language="JavaScript" src="../jscript/verif_field.js"></script>
<!-- Définition Javascript pour calendrier popup -->

  <!-- Feuille de Style -->
  <link rel="stylesheet" type="text/css" media="all" href="../jscript/jscal/skins/aqua/theme.css" title="Aqua" />

  <!-- Script Javascript Principal -->
  <script type="text/javascript" src="../jscript/jscal/calendar.js"></script>

  <!-- Choix du langage -->
  <script type="text/javascript" src="../jscript/jscal/lang/calendar-<?PHP echo $_SESSION["lng"]; ?>.js"></script>

  <!-- the following script defines the Calendar.setup helper function, which makes
       adding a calendar a matter of 1 or 2 lines of code. -->
  <script type="text/javascript" src="../jscript/jscal/calendar-setup.js"></script>

<!-- Fin de la définition Javascript pour calendrier popup -->

</head>
<?PHP 
if ($td <> "edit")
{
	if ($pbm_tec == FALSE)
	{
?>
		<body onLoad="javascript:; window.focus();">
<?PHP
	}
	else
	{
?>
		<body>
<?PHP
	}
}
else
{
?>
	<body onLoad="javascript:; window.focus();metFocus();">
<?PHP
}
if (($pbm_tec == FALSE) AND ($pbm_enr_tecpr == FALSE))
{
?>
<p align="center"> <span class="titrepage">PRIX DE REVIENT</span></p>
<p align="center"><span class="titre_gras">Pour le technicien : <?php echo $tec_nom." ".$tec_prenom; ?> </span></p>
<div align="right">
<input name="quit" type="button" class="bton_std" id="quit" value="<?PHP echo $but_quit; ?>" style="text-decoration: none; font-size: 11px; color:White ;font-weight:bold;background-color: #666666;" onClick="javascript:; self.close('fscomp');">
</div>
<br />
<?PHP
$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
mysql_select_db(DBNAME);
$rech = "SELECT * FROM `" .TBTECPR. "` WHERE `tecpr_codetec`= '".$codetec."' ORDER BY tecpr_id";
$rs = mysql_query($rech) or die(mysql_error());

if (mysql_num_rows($rs) <> 0)
{
	echo "<table class=\"MtableD\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\n";
	 
	// Création de l'entête de la table "détail prix de revient"
	echo "<th>";
	echo "Date";
	echo "</th>\n";
	echo "<th>";
	echo "Co&ucirc;t horaire";
	echo "</th>\n";
	echo "<th>";
	echo $txt_ent_lst_clic;
	echo "</th>\n";
	
	$j = 0;
	
	while ($row = mysql_fetch_assoc($rs)) 
	{         
		// Création de l'entête de ligne (TR)
		creetrlstdet($j);
		
		echo "<td align=\"center\">\n";
		echo formatedate($row["tecpr_date"]);
		echo "<td align=\"right\">\n";
		echo format_num($row["tecpr_couth"],2).$lang['symbole_monnaie'];
		echo "</td>\n";
		echo "<td align=\"center\">\n";
		if (($td <> "view") AND ($lastid==$row["tecpr_id"]))
		{
			$lst_maj = TRUE;
			echo "<a href=\"tecpr_maj.php?td=edit&ct=".$codetec."&id=".$row["tecpr_id"]."\"><img src=\"../img/edit.png\" border=\"0\" align=\"absmiddle\"></a>";
			echo " ";

			$lst_del = TRUE;
			echo "<a href=\"tecpr_maj.php?td=del&ct=".$codetec."&id=".$row["tecpr_id"]."\"><img src=\"../img/del.png\" border=\"0\" align=\"absmiddle\"></a>";
		}
		else
			echo "-";
		echo "</td>\n";

		echo "</tr>\n";
	
		$j++;
	}
	
	echo "</table>\n";
	// Fin affichage table détail horaire
}
else
{
?>
	<p class="annot_petit_it">Aucun prix de revient enregistr&eacute;</p>
<?PHP
}
mysql_free_result($rs);
mysql_close($conn);

$taille_piedla="";
include_once("piedla.inc.php"); 

if ($td <> "view")
{
?>
	<br>
	<form name="tecpr_maj" class="form_pointilles" method="post" action="tecpr_maj.php" onSubmit="javascript:; return (VForm(this,tab1_champ,'','<?PHP echo $_SESSION["lng"]; ?>'));">
	<p align="center" class="annot_std_gras"><?PHP echo $titre; ?></p>
	<p align="center" class="annot_petit_it">Tous les champs sont obligatoires</p>
	<input name="td" type="hidden" id="td" value="<?PHP echo $td; ?>">
	<input name="ct" type="hidden" id="ct" value="<?PHP echo $codetec; ?>">
	<input name="id" type="hidden" id="id" value="<?PHP echo $id; ?>">
	<table width="580"  border="0" align="center">
	<tr>
		<td width="30%" class="rubfrm" id="f_date" align="right">Date</td>
		<td align="left">
			<input name="date" type="text" id="date" value="<?PHP echo $datesais; ?>" size="10" maxlength="10" readonly="1">
			<img src="../img/calendar.png" align="absmiddle" id="f_img_date" title="<?PHP echo $alt_chxdate; ?>">
			<a href="javascript:;" onclick="document.tecpr_maj.date.value=''"><img src="../img/raz.png" border="0" align="absmiddle"></a>
			<?PHP 
			if ($td=="add") 
			{
				if ($lastid>0)
				{ 
			?>
			<br /><span class="annot_petit_it">(Strictement sup&eacute;rieur &agrave; derni&egrave;re date de modification)</span>
			<?PHP 
				}
				else
				{
			?>
			<br /><span class="annot_petit_it">
			<?PHP
			echo '(Sup&eacute;rieur ou &eacute;gal &agrave; la date de cr&eacute;ation';
			switch ($tl)
			{
				case 1 :
					echo " de l'agence";
					break;
				case 3 :
					echo " du sous-traitant";
					break;
			}
			echo formatedate($age_datecrea).')';
			?>
			</span>
			<?PHP
				}
			}
			
			if ($td=="edit") { ?>
			<br /><span class="annot_petit_it">(Ne peut &ecirc;tre inf&eacute;rieure &agrave; la date pr&eacute;c&eacute;demment saisie)</span>
			<?PHP } ?>
		</td>
	</tr>
	<tr>
			<td width="160" class="rubfrm" id="f_hj" align="right">Heures journali&egrave;res</td>
			<td>
			<input name="hj" type="text" id="hj" style="text-align:right" value="<?PHP echo $tecpr_hj ?>" size="5" maxlength="8">
			</td>
	</tr>
	<tr>
			<td width="160" class="rubfrm" id="f_hh" align="right">Heures hebdomadaires</td>
			<td>
			<input name="hh" type="text" id="hh" style="text-align:right" value="<?PHP echo $tecpr_hh ?>" size="5" maxlength="8">
			</td>
	</tr>
	<tr>
			<td width="160" class="rubfrm" id="f_hm" align="right">Heures mensuelles</td>
			<td>
			<input name="hm" type="text" id="hm" style="text-align:right" value="<?PHP echo $tecpr_hm ?>" size="6" maxlength="9">
			</td>
	</tr>
	<tr>
		<td width="30%" class="rubfrm" id="f_salm" align="right">Salaire mensuel</td>
		<td align="left">
		<input name="salm" type="text" id="salm" style="text-align:right" value="<?PHP echo format_num($tecpr_salm,2) ?>" onChange="formatedeci(this.id,2);" size="10">
		<?PHP echo $lang['symbole_monnaie']; ?>
		<br /><span class="annot_petit_it">(La d&eacute;cimale doit &ecirc;tre '.' et pas la virgule)</span>
		</td>
	</tr>
	<tr>
		<td width="30%" class="rubfrm" id="f_horaires" align="right">Horaires</td>
		<td align="left">
		<table width="100%"  border="0" align="center">
		<tr>
			<td>&nbsp;</td>
			<td align="center" class="annot_std_it">Matin</td>
			<td align="center" class="annot_std_it">Apr&egrave;s-midi</td>
		</tr>
		<?PHP
		foreach ($lng_tjour as $key=>$value)
		{
			echo '<tr>';
			echo '<td>'.$value.'</td>';
			echo '<td align="center">';
			$variable="\$tecpr_j".$key."m1";
			eval ("\$valeur = substr($variable,0,5);");
			echo 'de ';
			echo '<input name="j'.$key.'m1" type="text" id="j'.$key.'m1" style="text-align:right" value="'.$valeur.'" size="5">';
			echo ' &agrave; ';
			$variable="\$tecpr_j".$key."m2";
			eval ("\$valeur = substr($variable,0,5);");
			echo '<input name="j'.$key.'m2" type="text" id="j'.$key.'m2" style="text-align:right" value="'.$valeur.'" size="5">';
			echo '</td>';
			echo '<td align="center">';
			$variable="\$tecpr_j".$key."a1";
			eval ("\$valeur = substr($variable,0,5);");
			echo 'de ';
			echo '<input name="j'.$key.'a1" type="text" id="j'.$key.'a1" style="text-align:right" value="'.$valeur.'" size="5">';
			echo ' &agrave; ';
			$variable="\$tecpr_j".$key."a2";
			eval ("\$valeur = substr($variable,0,5);");
			echo '<input name="j'.$key.'a2" type="text" id="j'.$key.'a2" style="text-align:right" value="'.$valeur.'" size="5">';
			echo '</td>';
			echo '</tr>';
		}
		?>
		</table>
		</td>
	</tr>
	<tr>
		<td width="30%" class="rubfrm" id="f_tec" align="right">Co&ucirc;t horaire</td>
		<td align="left">
		<input name="couth" type="text" id="couth" style="text-align:right" value="<?PHP echo format_num($tecpr_couth,2) ?>" onChange="formatedeci(this.id,2);" size="10">
		<?PHP echo $lang['symbole_monnaie']; ?>
		<br /><span class="annot_petit_it">(La d&eacute;cimale doit &ecirc;tre '.' et pas la virgule)</span>
		</td>
	</tr>
	</table>
		<p align="center">
		<input name="annul" type="button" class="bton_std" id="annul" value="<?PHP echo $but_cancel; ?>" onclick="javascript:; self.location.href='tecpr_maj.php?td=add&ct=<?PHP echo $codetec; ?>';">
		<?PHP
			if ($td == "add")
			{
		?>
				<input name="enr" type="submit" class="bton_std" id="enr" value="<?PHP echo $but_add; ?>">
		<?PHP
			}
			if ($td == "edit")
			{
		?>
				<input name="enr" type="submit" class="bton_std" id="enr" value="<?PHP echo $but_modif; ?>">
		<?PHP
			}
			if ($td == "del")
			{
		?>
			<input name="enr" type="submit" class="bton_std" id="enr" value="<?PHP echo $but_del; ?>">
		<?PHP
			}
		?>
		</p>
	</form>
	
	<script type="text/javascript">
	<!--
		Calendar.setup({
			inputField     :    "date",     	// id of the input field
			ifFormat       :    "<?PHP echo $datefmtc; ?>",     // format of the input field
			button         :    "f_img_date",  	// trigger for the calendar (button ID)
			align          :    "Ll",           // alignment (defaults to "Bl")
			electric	   :	false,
			singleClick    :    true
		});
	//-->
	</script>
<?PHP
}
}
else
{
	if ($pbm_tec == TRUE)
	{
?>
		<script type="text/javascript">
		<!--
		self.close('fscomp');
		//-->
		</script>
<?PHP
	}
	if ($pbm_enr_tecpr == TRUE)
	{
?>
		<p align="center" class="annot_std_it"><?PHP echo $msg; ?></p>
		<script type="text/javascript">
		<!--
		window.setTimeout("location=('tecpr_maj.php?ct=<?PHP echo $codetec; ?>&td=<?PHP echo $td; ?>&id=<?PHP echo $id; ?>');",3000)
		//-->
		</script>
<?PHP
	}
}
?>

</body>
</html>
