Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/03/2010, 04:19
serbc27
 
Fecha de Ingreso: febrero-2007
Mensajes: 165
Antigüedad: 17 años, 2 meses
Puntos: 0
Error al validar

Me han pasado un calendario php, pero estoy haciendo pruebas, y a la hora de validar me dan errores a la hora de validarlo donde me da error es donde lo pongo en negrita

echo '
<div style="width:190px">
<table summary="Esta tabla contiene el calendario" cellpadding="0" cellspacing="0" id="calendario" align="center">
<thead><tr><th colspan="7"> <a href="?ladata='.$anteriorMes.'" title="mes anterior"><img src="images/anterior.gif" alt="Anterior"/>
</a> '.utf8_encode($nomMes).' '.$anio.' <a href="?ladata='.$proximMes.'" title="proximo mes"><img src="images/siguiente.gif" alt="Siguente"/>
</a></th></tr></thead>

' ;
echo '<tr>
<th>L</th><th>M</th><th>M</th><th>J</th><th>V</th><th>S</th><th>D</th>
</tr>';
echo '<tr>';
for ($i = 1; $i <= ($dias + $sum); $i++) {
// Dias de otro mes, no mostraremos nada
if (!$start) if ($i <= 7 && $i == $diaset) {
$start = true; $sum = $i - 1;

} else {
echo '<td class="inactivo"></td>';
}
if ($start) {

if (($i - 1) % 7 == 0) echo '</tr>';
if ($i == ($hoy + $sum) && ($mes == date('m')) && ($anio == date('Y')) ) {
$complet = $anio.'-'.$mes.'-'.($i - $sum ); // Fecha completa formato 2007-12-31
// Hoy
echo '
<td class="hoy">';
$consulta = "SELECT * FROM agenda WHERE fecha='$complet'";
$resp = mysql_query($consulta);
if ($dades=mysql_fetch_array($resp)) {
echo '<p><a title="' . $dades['evento'] . '"href="veragenda.php?fecha=' . $dades['fecha'] . '"class="aCal">' . ($i - $sum ). '</a></p>';
}else{
echo $hoy;
}
echo '</td>';
} elseif (in_array($i-$sum, $array_dias)) {
// Dia que hay algun evento
echo '<td class="evento">';
$complet = $anio.'-'.$mes.'-'.($i - $sum );
$consulta = "SELECT * FROM agenda WHERE fecha='$complet'";
$resp = mysql_query($consulta);
if ($dades=mysql_fetch_array($resp)) {
echo '<p><a title="' . $dades['evento'] . '"href="veragenda.php?fecha=' . $dades['fecha'] . '"class="aCal">' . ($i - $sum ). '</a></p>';
}
echo '</td>';
} else {
// Dia que no hay nada
echo '
<td>
' . ($i - $sum ) .'
</td>';
}
}
}
echo '
</tr></table></div><br />
';