Ok here is my situation, I have a project due in 2 days in which I have come to a huge mountain and havent been able to get any further with in about 2 weeks.
I have a query from my database selecting 2 values:
seat_number (which has values 1 to 100)
seat_status (either EMPTY or BOOKED)
Here is my code:
<?php
$result = mysql_query($query_rstAvailSeats);
$x = 1;
echo '<table align="center"><tr>';
while($disp = mysql_fetch_array($result)){
if ($disp['seat_status'] == 'EMPTY')
{
echo '<td><img src="../Images/chair.jpg" onClick=addSeat()>';
echo $disp['seat_number'];
}
else
{
echo '<td><img src="../Images/chairBooked.jpg" onClick=alert("Booked")>';
echo $disp['seat_number'];
}
if($x%5==0){
echo '</tr>'."\n".
'<tr>'."\n";
}
if($x%25==0){
echo '</tr>'."\n".
'<tr></tr>'."\n".
'<tr>'."\n";
}
$x = $x+1;
}
echo '</tr>'."\n".
'</table>';
?>
This displays a 5x20 table, each cell having a picture of an empty chair is seat_status is EMPTY or a chair with a cross if seat_status is BOOKED.
I need it, so when a user clicks on a chair, lets say chair 25, the value is passed SOMEWHERE (i'm not sure where, i was thinking a javascript array) so when the user clicks on a submit button, the chair values he has selected can be passed back to the database, and their seat_status changed from EMPTY to BOOKED.
I would also like the picture to change from an empty chair to a booked one.
I know this may seem alot but I am in real trouble if I dont get this done, and I have been trying for weeks now. Ive been to every possible internet site on the net I should think.
Many Many thanks