Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 00:20
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  MySQL, PostgreSQL, MS SQL, Access (Moderators: Flash-db, Musicman, Ronald Wernecke, Jorge Solis, Andries Seutens)
| | |-+  Dynamic theatre seating display with PHP and mySQL
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Dynamic theatre seating display with PHP and mySQL  (Read 2202 times)
tom
Server what's that
*
Posts: 19



View Profile WWW Email
« on: 03/23/02, 13:56 »

Hey guys,

You've been so useful in the past so I hope you can help me with this one.

I'm building a web-site for a theatre, and one of the main features of it will be the ability to book tickets online. I've done a reasonable amount of coding so far on it, but the main problem I'm having is the seating plan layout of the theatre.

The administration team need to be able to change the status of the rows of seats to 'booked' when they have been bought, so they can't be ordered again. This will change the image of the seat from red to grey. I've built the splices in Fireworks, but now I don't know how to get the script to query the mySQL database where the status of each row of seats will be stored, and then get the page to display the correct image in each row.

The main problem I'm finding is how I should actually go about getting the script to implement the change of image in the page.

Your help with this would really be appreciated and good luck!

Tom

{ http://www.onestopwebdesigns.com }
« Last Edit: 03/23/02, 13:57 by tom » Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #1 on: 03/23/02, 16:37 »

Hi,

not sure whether this will work...
Import the fireworks slices html file as a string, like
$table = "<table><tr><td><img src=\"th_r1_c1.gif\" width=33 height=67></td> ....';
Now, organize your database such that every row of seats is associated with the name of a slice, say have columns
row_number, slice_name, booked
Run a query like
SELECT slice_name FROM seats WHERE booked
Now, php code similar to this one should do the job
while($occupied = mysql_fetch_row($result))
{ $slice = $occupied[0];
 $table = str_replace($slice. ".gif", $slice . "_f2.gif", $table);
}
when through it, just
print $table;
The code could be extended, if the theatre layout requires more than one slice per row - the slice_name column should have something like a comma-separated list in that case

Musicman
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!