ik ben bezig met een reserverings systeem aan het maken voor een restaurant. dit hoort bij een school opdracht dus moet wel.
nu loop ik tegen een probleem aan.
bepaalde gegevens haal ik uit de sessie zoals userid enz. verder word er gegevens gevraagd bij het reserveren . nadat de gebruiker op de knop klikt "tafel kiezen" komen er op een platte grond divjes over een platte grond op de plek waar geen reservering staat op die tijd, datum en plek.
nu zit ik met het probleem dat ik er niet uitkom dat ik een divje selecteerbaar maak zoals een radio button of een checkbox.
het mooiste is een radio button effect maar ik krijg helemaal niks voor mekaar daarmee.
hier is me code.
<input type="submit" value="tafel selecteren">
</p>
</form>
<div id="reservetablepicture">
<?php
if (isset($_GET['day'])) {
$resdate = $_GET['year'] . $_GET['month'] . $_GET['day'];
$restime = $_GET['time'];
$respers = $_GET['persons'];
include "inc/dbconnect.php";
$qtable1 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '1'");
$tf1_rows = mysql_num_rows($qtable1);
if ($tf1_rows < 1 ) {
echo "<div id='table1' class=' '>1</div>";
}
$qtable2 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '2'");
$tf2_rows = mysql_num_rows($qtable2);
if ($tf2_rows < 1 ) {
echo "<div id='table2' class=' '>2</div>";
}
$qtable3 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '3'");
$tf3_rows = mysql_num_rows($qtable3);
if ($tf3_rows < 1 ) {
echo "<div id='table3' class=' '>3</div>";
}
$qtable4 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '4'");
$tf4_rows = mysql_num_rows($qtable4);
if ($tf4_rows < 1 ) {
echo "<div id='table4' class=' '>4</div>";
}
$qtable5 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '5'");
$tf5_rows = mysql_num_rows($qtable5);
if ($tf5_rows < 1 ) {
echo "<div id='table5' class=' '>5</div>";
}
$qtable6 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '6'");
$tf6_rows = mysql_num_rows($qtable6);
if ($tf6_rows < 1 ) {
echo "<div id='table6' class=' '>6</div>";
}
$qtable7 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '7'");
$tf7_rows = mysql_num_rows($qtable7);
if ($tf7_rows < 1 ) {
echo "<div id='table7' class=' '>7</div>";
}
$qtable8 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '8'");
$tf8_rows = mysql_num_rows($qtable8);
if ($tf8_rows < 1 ) {
echo "<div id='table8' class=' '>8</div>";
}
$qtable9 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '9'");
$tf9_rows = mysql_num_rows($qtable9);
if ($tf9_rows < 1 ) {
echo "<div id='table9' class=' '>9</div>";
}
$qtable10 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '10'");
$tf10_rows = mysql_num_rows($qtable10);
if ($tf10_rows < 1 ) {
echo "<div id='table10' class=' '>10</div>";
}
$qtable11 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '11'");
$tf11_rows = mysql_num_rows($qtable11);
if ($tf11_rows < 1 ) {
echo "<div id='table11' class=' '>11</div>";
}
$qtable12 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '12'");
$tf12_rows = mysql_num_rows($qtable12);
if ($tf12_rows < 1 ) {
echo "<div id='table12' class=' '>12</div>";
}
$qtable13 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '13'");
$tf13_rows = mysql_num_rows($qtable13);
if ($tf13_rows < 1 ) {
echo "<div id='table13' class=' '>13</div>";
}
$qtable14 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '14'");
$tf14_rows = mysql_num_rows($qtable14);
if ($tf14_rows < 1 ) {
echo "<div id='table14' class=' '>14</div>";
}
$qtable15 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '15'");
$tf15_rows = mysql_num_rows($qtable15);
if ($tf15_rows < 1 ) {
echo "<div id='table15' class=' '>15</div>";
}
$qtable16 = mysql_query("SELECT * FROM reserverules WHERE resdate = '$resdate' AND restime = '$restime' AND tableid = '16'");
$tf16_rows = mysql_num_rows($qtable16);
if ($tf16_rows < 1 ) {
echo "<div id='table16' class=' '>16</div>";
}
}
?>
</div>
hier is de css van de divjes waar het om gaat
#table1 {
top: 7px;
left: 8px;
background-color:green;
width: 58px;
height: 40px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table1:hover {
background-color: blue;
}
#table2 {
top: 7px;
left:83px;
background-color:green;
width: 58px;
height: 40px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table3 {
top: 7px;
left:158px;
background-color:green;
width: 58px;
height: 40px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table4 {
top: 7px;
left:232px;
background-color:green;
width: 58px;
height: 40px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table5 {
top: 7px;
left:307px;
background-color:green;
width: 58px;
height: 40px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table6 {
top: 58px;
left:5px;
background-color:green;
width: 44px;
height: 50px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table7 {
top: 116px;
left:5px;
background-color:green;
width: 58px;
height: 50px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table8 {
top: 80px;
left:119px;
background-color:green;
width: 59px;
height: 59px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table9 {
top: 80px;
left:215px;
background-color:green;
width: 59px;
height: 59px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table10 {
top: 59px;
right:146px;
background-color:green;
width: 29px;
height: 53px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table11 {
top: 59px;
right:116px;
background-color:green;
width: 29px;
height: 53px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table12 {
top: 59px;
right:86px;
background-color:green;
width: 29px;
height: 53px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table13 {
top: 156px;
left:162px;
background-color:green;
width: 66px;
height: 66px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table14 {
top: 157px;
left:317px;
background-color:green;
width: 66px;
height: 66px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table15 {
top: 18px;
right:4px;
background-color:green;
width: 44px;
height: 50px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
#table16 {
top: 88px;
right:4px;
background-color:green;
width: 58px;
height: 50px;
position:absolute; opacity:0.6;
filter:alpha(opacity=60);
}
ik weet dat de php/mysql niet optimaal is maar dat kan ik later wel verbeteren.
weet iemand hoe ik dus zo'n div aan klikbaar kan maken voor een form?
mvg,
ben