<?php require 'sebasloc.php'; 

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
	  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
mysql_select_db($database_sebasloc, $sebasloc);
$query_mt2 = "SELECT distinct Club FROM A_Veg_23_Sol ORDER BY Club";
$mt2 = mysql_query($query_mt2, $sebasloc) or die(mysql_error());
$row_mt2 = mysql_fetch_assoc($mt2);
$totalRows_mt2 = mysql_num_rows($mt2);
$club = $_POST["busca"];
if(!$club){
	$club = $row_mt2['Club'];
}
$query_mt1 = "SELECT Dorsal, PG, T, TN, Nom, PC, M, Cat, Club FROM A_Veg_23_Sol WHERE Club='" . $club ."' ORDER BY M ASC";
$mt1 = mysql_query($query_mt1, $sebasloc) or die(mysql_error());
$row_mt1 = mysql_fetch_assoc($mt1);
$totalRows_mt1 = mysql_num_rows($mt1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Classificaci&oacute; per Clubs Cursa Solidària contra el Càncer El Verger 2023</title>
<link href="clasvergi23.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	background-color: #999999;
}
</style>
</head>

<body class="bon_fon">
<div class="tot"><div class="smdt"><a href="https://www.somesport.com" class="sm">Som Esport</a></div>
<div class="cap"><a href="https://www.somesport.com"><img src="Solidaria_Verger_23_banner_ns.png" width="960" alt="Som Esport" longdesc="http://www.somesport.com" /></a><a href="http://www.somesport.com"></a></div>
<div class="cap1">
  <div align="center">
    <div class="abra">
<div class="drt"> <span class="tit18">CLASSIFICACI&Oacute; PER CLUBS IX CURSA SOLIDÀRIA CONTRA EL CÀNCER EL VERGER 2023<a href="http://www.somesport.com/index.html" class="txt12ng"><br />
</a></span><a href="http://www.somesport.com/index.html" class="txt12ng"><br />
</a><span class="txt14ng">Cronometratge<a href="https://www.somesport.com"> www.somesport.com</a></span><br />
<?php echo $totalRows_mt1 ?> corredors arribats a Meta <br />
<br />
<form id="form1" name="form1" method="post" action="clubs_solidaria_verger_23..php">
  <p class="mn">
    <select name="busca" id="busca" class="mn">
      
      <?php  do { ?>
      
      <option value="<?php echo $row_mt2['Club']; ?>" <?php 
	if($club==$row_mt2['Club']){
		echo "selected";
	}
	
	
	?>><?php echo $row_mt2['Club']; ?></option>
      
      <?php } while ($row_mt2 = mysql_fetch_assoc($mt2)); ?>
      
    </select>
    <input name="submit" type="submit" class="bta" id="Consulta" value="Consulta" />
  </p>
</form>
<br />

<br />
        <table width="98%%" border="0" align="center">
                  <!--DWLayoutTable-->
<tr bgcolor="#000000" class="txt12nj">
                    <td width="57"><div align="right">P.Gral</div></td>
          <td width="243"><div align="left">Nombre</div></td>
<td width="45"><div align="right">P.Cat.</div></td>
          <td width="172" ><div align="left">Categoria</div></td>
          <td width="207" ><div align="left">Club</div></td>
          <td width="57"><div align="center">Tiempo</div></td>
<td width="63"> <div align="center">Tiempo<br /> 
                    Real</div></td>
<td width="61"><div align="center">T/ KM</div></td>
</tr>
    <?php do { ?>
      <tr bgcolor="#EBE9EA">
        <td><div align="right" class="mon2"><?php echo $row_mt1['PG']; ?></div></td>
        <td><div align="left" class="mon2"><?php echo $row_mt1['Nom']; ?></div></td>
        <td><div align="right" class="mon2"><?php echo $row_mt1['PC']; ?></div></td>
        <td><div align="left" class="mon2"><?php echo $row_mt1['Cat']; ?></div></td>
        <td><div align="left" class="mon2"><?php echo $row_mt1['Club']; ?></div></td>
        <td><div align="center">
          <div align="center" class="mon2"><?php echo $row_mt1['T']; ?></div>
        </div></td>
        <td bgcolor="#CCCC99"><div align="center" class="mon2"><?php echo $row_mt1['TN']; ?></div></td>
        <td align="center" bgcolor="#9D9D9D"><?php echo $row_mt1['M']; ?></td>
        </tr>
      <?php } while ($row_mt1 = mysql_fetch_assoc($mt1)); ?>
        </table></div>
     
</div>
      <br />
</div>
</div>
</div>
<div id="footer">
	<a href="https://www.somesport.com">Som Esport&nbsp; |&nbsp; Disseny Web Som Esport&nbsp;  |&nbsp;Dorsals | Arcs de Meta | Gesti&oacute; d'inscripcions</a>
  <br />
  <br />
  &copy; Todos los derechos reservados<br />
Queda terminantemente prohibida la reproducción total o parcial de los contenidos ofrecidos a través de esta web, salvo autorización expresa de somesport.com. <br />
Así mismo, queda prohibida toda reproducción a los efectos del artículo 32.1, párrafo segundo, Ley 23/2006 de la Propiedad intelectual.<br />
Se autoriza la utilización con fines personales de los resultados en webs de clubs de atletismo, páginas y blogs personales, <br />
siempre que sea bajo las mismas condiciones aqu&iacute; expresadas.<br />
Queda expresamente prohibida la utilización con fines comerciales y la realización de obra derivada. 
</div>
</body>
</html>
<?php
mysql_free_result($mt1);
mysql_free_result($mt2);
mysql_close($sebasloc);
?>