The output I am receiving is not highlighting all of the contents just part.
in the below code @line 21 if a certain variable is met I want the cell highlighted. The problem is in the output it is highlighting but only on one cell and not covering the other cells that need to be highlighted. For example, the customer books a room for 3 days. The first day is not highlighting just the 2nd and 3rd. If they book a room for only one day then it does not highlight at all.
in the below code @line 21 if a certain variable is met I want the cell highlighted. The problem is in the output it is highlighting but only on one cell and not covering the other cells that need to be highlighted. For example, the customer books a room for 3 days. The first day is not highlighting just the 2nd and 3rd. If they book a room for only one day then it does not highlight at all.
Code:
for ($i = 1; $i <= $days; $i++)
{
$year = date("Y",$tag + 86400 * $i - 86400);
$month = date("n",$tag + 86400 * $i - 86400);
$day = date("d",$tag + 86400 * $i - 86400);
$belegt = belegt($zdaten[$ii][1],date("Y.m.d",$tag+ 86400 * $i - 86400));
if ($belegt=="" )
{
if ($tag+ 86400 * ($i-1) < strtotime(date("Y-m-d 12:00:00"),time()))
{
echo '<td align="center" bgcolor="white"> n/a';
}else{
//available for booking
echo '<td align="center">
<a href="kalender.php?andatum=', $tag + 86400 * $i - 86400, '&zimmer=',$zdaten[$ii][1],'&year=',$year,'&month=',$month,'&day=',$day,'" id="l1">
<font color="#008000">'.$t_myres['free'].'</font></a>';
}
/* ###### CHANGE CELL COLOR IF CONFIRMATION NECESSARY ###### */
}elseif ($knr=$resdaten[1][9]=="")
{
//booked and still needs to be confirmed
echo '<td align="center" bgcolor="yellow">';
$resdaten = sucheresnr($belegt);
$knr=$resdaten[1][1];
$daten = suche('knr', $knr);
$nname=$daten[1][3];
echo '
<a href="details.php?resnr=', $belegt, '&schreiben=readonly" id="l5">',
$nname,
'</a>';
}
else{
//booked and confirmed
echo '<td align="center">';
$resdaten = sucheresnr($belegt);
$knr=$resdaten[1][1];
$daten = suche('knr', $knr);
$nname=$daten[1][3];
echo '
<a href="details.php?resnr=', $belegt, '&schreiben=readonly" id="l5">',
$nname,
'</a>';
}
echo '</td>';
}
echo '<td align="right" style="white-space:nowrap">';
echo "<a href=\"javascript:zimmer_link('";
echo $zimmer;
echo "')\" id='l4'>$zimmer</a></td></tr>";
}
echo '<tr>';
echo '<td width ="', 100/($days+2),'%">';
echo '</td>';
Comment