|
 |
asp_web_howto thread: Help! With a seat booking system!
Message #1 by "Seb Belcher" <seb@s...> on Sun, 21 Oct 2001 17:34:21 +0100
|
|
Hi,
For my A-Level ICT project I am making a online booking system for my school's Theatre. To allow people to choose the seats they
want I have an HTML page with a seat map of the theatre and a form check box in each 'seat'. It's a total of 306 checkboxes, each
is named as the seat it represents, i.e a1,a2,... c4,c5 etc.
What ideally I need an ASP page to do is get which seats have been 'checked' by the user, and put the name of the seat into an
array. The users can book, hence check, any number of check-boxes, even the whole theatre in one go if they wanted.
If anyone has a simple way of doing this, or can think of a better way, please let me know!!
My second problem is that when the page is loaded, I need to make it so that it can change the state of a seat by changing it's
colour. There are at the moment 3 states for the table cells which represent seats to be in:
1: Unbooked, so needs to have checkbox in it with a clear background.
2: Booked, needs to have no checkbox and be displayed in red.
3: Unavailabe, needs no checkbox and diplayed in grey.
To decide what state a seat was in the ASP would need to look in the database. A seat which is unbooked will NOT be in the seats
table with the relevant showID. A booked seat WILL appear with the relevant showID, and a seat which is unavailable will appear in
the table as booked by user 'houseseat'.
If anyone has any ideas on how to do this, it would be greatly apprieciated.
Finally if anyone reading this has had experience with making a booking system for a theatre, cinema etc. and would be willing to
give me some help and advice, then please e-mail me.
Thanks,
Seb
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 22 Oct 2001 13:08:16 +1000
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Seb Belcher" <seb@s...>
Subject: [asp_web_howto] Help! With a seat booking system!
: What ideally I need an ASP page to do is get which seats have been
'checked' by the user,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose each Checkbox has the same name="" attribute value.
Request.Form("chkBoxName")
will contain the values checked by the user.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: and put the name of the seat into an array.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Split() on the "," the delimits the checked values, and you'll have your
array.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: My second problem is that when the page is loaded, I need to make it so
that it can change the state of a seat by changing it's colour. There are
at the moment 3 states for the table cells which represent seats to be in:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a recordset of data from the database. For each seat, compare the
value stored in the recordset (if any). If there is no matching value, then
write out a clear background + checkbox. If there is a match in your
recordset, then write out the appropriate background and checkbox if
required.
This is all rudimentary ASP - and can be achieved with some rudimentary
logical contructs (If...Then...Else...End if, Do While...Loop etc) which you
can find in any decent programming text.
Cheers
Ken
|
|
 |