con questo codice ricavo le notti che un cliente permane in hotel.
Codice PHP:
$datearr = "$a_a/$m_a/$g_a";
$datepar = "$a_p/$m_p/$g_p";
$datearr = strtotime($datearr);
$datepar = strtotime($datepar);
echo "<h2>Tot. notti</h2>";
if($datearr)
{
$difference = ceil(($datepar-$datearr)/86400);
echo "
".$difference."</p>";
}
else
{
echo "<h3>ERROR during checkdate</h3>";
}
ora: come faccio a vedere se nella tabella DISPONIBILITA ci sono le camere per i giorni richiesti?
la TAB è così strutt.
11-06-2007
12-06-2007
13-06-2007
14-06-2007
ecc....