<?php
//inicio de sesion
session_start();
//control de la sesion para guardar el id de la carrera
if (!isset($_SESSION["controlcr"])) {
$_SESSION["IDCarreracr"] = $_GET["idrcr"];
$_SESSION["IDTramocr"] = $_GET["idtrcr"];
$_SESSION["controlcr"] = TRUE;
}
if (($_SESSION["controlcr"])==TRUE):
// incluimos la conexión
include("conexion.php");
// creamos la consulta
mysql_query("SET NAMES 'utf8'");
$query = "SELECT * FROM T08Clase INNER JOIN (T07Grupo INNER JOIN (T06Copas RIGHT JOIN (T05Clubes INNER JOIN (T01Carreras INNER JOIN T02Participantes ON T01Carreras.IDCarreraT01 = T02Participantes.IDCarreraT02) ON T05Clubes.IDClubT05 = T02Participantes.IDClubT02) ON T06Copas.IDCCopaT06 = T02Participantes.IDCopaT02) ON T07Grupo.IDGrupoT07 = T02Participantes.IDGrupoT02) ON T08Clase.IDClaseT08 = T02Participantes.IDClaseT02 WHERE (((T02Participantes.IDCarreraT02)=". $_SESSION['IDCarreracr'] .") AND ((T02Participantes.AutorizadoT02)=1)) ORDER BY T02Participantes.DorsalT02";
// enviamos la consulta a MySQL
$queEmp = mysql_query($query, $conexion);
$resEmp = mysql_fetch_array($queEmp);
require('../header.php');
?>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jeditable.js"></script>
<script type="text/javascript" src="js.js"></script>
<fieldset id="content">
<!--<legend>Editando registros de una tabla con Jeditable plugin jQuery.</legend>-->
<legend><?php echo $resEmp['NombreCarreraT01'];?></legend>
<table width="960" id="mytable" cellspacing="0">
<thead>
<tr class="head">
<th scope="col" width="20">Nº</th>
<th scope="col" width="220">PILOTO</th>
<th scope="col" width="220">COPILOTO</th>
<th scope="col" width="220">VEHICULO</th>
<th scope="col" width="20">CL.</th>
<th scope="col" width="20">GR.</th>
<th scope="col" width="120">SALIDA</th>
<th scope="col" width="120">META</th>
</tr>
</thead>
<tbody>
<?php
//volver al primer registro
mysql_data_seek ( $queEmp, 0);
while($resEmp = mysql_fetch_array($queEmp)) {
$id = $resEmp['IDParticipanteT02'];
?>
<tr>
<td align="center"><?php echo $resEmp['DorsalT02'];?></td>
<td><?php echo $resEmp['PilotoT02'];?></th>
<td><?php echo $resEmp['CopilotoT02'];?></th>
<td><?php echo $resEmp['VehiculoT02'];?></th>
<td align="center"><?php echo $resEmp['NombreT08'];?></th>
<td align="center"><?php echo $resEmp['NombreT07'];?></th>
<td><div class="text" id="Salida-<?php echo $id ?>"><?php echo $resEmp['Salida']?></div></td>
<td><div class="text" id="Meta-<?php echo $id ?>"><?php echo $resEmp['Meta']?></div></td>
</tr>
<?php } ?>
</tbody>
</table>
</fieldset>
<?php
endif;
?>