codice:
$q=mysql_query("select * from vacanza where anno = ".$_SESSION['annoVacanza']." and accettata = 1 order by utente");
echo "<table class='hovertable'>";
echo "<tr><th>utente</th><th>periodo</th><th>anno</th><th>data prenotazione</th><th>giorni vacanza</th><th>Giorni rimasti</th></tr>";
$utente="";
while($riga=mysql_fetch_array($q)){
?>
<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
<?php
if($riga['utente']==$utente){
echo "<tr><td> </td><td>".$riga['periodo']."</td><td>".$riga['anno']."</td><td>".$riga['dataPrenotazione']."</td><td>".$riga['giorniDiVacanza']."</td><td>giorni rimasti</td></tr>"; //ho mantenuto la stessa formattazione della riga della tabella
}else{
$utente=$riga['utente'];
echo "<tr><td>##########</td><td>####################</td><td>######</td><td>################</td><td>############</td><td>################</td></tr>";
echo "<tr><td>".$utente."</td><td>".$riga['periodo']."</td><td>".$riga['anno']."</td><td>".$riga['dataPrenotazione']."</td><td>".$riga['giorniDiVacanza']."</td><td>giorni rimasti</td></tr>";
}
} echo "<tr><td>##########</td><td>####################</td><td>######</td><td>################</td><td>############</td><td>################</td></tr>";
echo "</table>";