Ciao a tutti,

ho creato una tabella che popolo dinamicamente tramite script PHP:

Codice PHP:
 <table width="100%">
<thead>
<tr>
<th style='text-align:center'></th>
<?php
      $mese 
mktime000$m1$y ); 
      
$numeroDigiorni intval(date("t",$mese)); 
      for(
$i=1$i<=$numeroDigiorni$i++)
      {
       print(
"<th width='2%'>".$i."</th>");
      }
?>
</thead>
<?php
$count1 
0;
$res1 mysql_query"SELECT * FROM flotta ORDER BY targa;");
while ( 
$riga1 mysql_fetch_array$res1 ) ) {
        
$dateform explode'-'$riga1["data"] );
        
$datafin $dateform[2].'.'.$dateform[1].'.'.$dateform[0];
              
?> 


<tbody>
<?php
$mese 
mktime000$m1$y ); 
$numeroDigiorni intval(date("t",$mese));  
print(
"<tr>");
print(
"<td style='text-align:center'>[url='./nuovo_noleggio.php?targa=".$riga1["targa"]."&modello=".$riga1["modello"]."&versione=".$riga1["versione"]."']".$riga1["targa"]." ".$riga1["modello"]." ".$riga1["versione"]."[/url]</td>");

      for(
$i=1$i<=$numeroDigiorni$i++)
      {
      
       print(
"<td></td>");
      }
      print(
"</tr>");
}
?>
</tbody>
</table>
Praticamente la prima colonna mi contiene i dati di alcune vetture che devo noleggiare, il resto è il calendario. Ora, vorrei sapere come colorare le celle della tabella in base ad una seconda tabella che ho chiamato noleggio. Questo è il dump delle due tabelle:

codice:
/* TABELLA FLOTTA */
CREATE TABLE IF NOT EXISTS `flotta` (
  `id` bigint(50) NOT NULL auto_increment,
  `targa` varchar(7) default NULL,
  `telaio` varchar(255) default NULL,
  `modello` varchar(150) default NULL,
  `versione` varchar(255) default NULL,
  `colore` varchar(100) default NULL,
  `lungo_periodo` tinyint(1) default NULL,
  `km` varchar(10) default NULL,
  `carburante` varchar(20) default NULL,
  `kw` varchar(10) default NULL,
  `cv` varchar(10) default NULL,
  `cilindrata` varchar(10) default NULL,
  `data_immatricolazione` varchar(10) default NULL,
  `categoria` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `telaio` (`telaio`),
  UNIQUE KEY `targa` (`targa`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
codice:
CREATE TABLE IF NOT EXISTS `noleggio` (
  `id` bigint(50) NOT NULL auto_increment,
  `contratto` varchar(20) default NULL,
  `data_inizio` date default NULL,
  `data_fine` date default NULL,
  `ragione_sociale` varchar(255) default NULL,
  `mezzo` varchar(255) default NULL,
  `noleggiato` tinyint(1) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
mi sapete aiutare?