Page 1 of 1

Searching for a special

Posted: Tue May 14, 2002 6:56 pm
by hb_mpp
Hello, I´m searching for a script that enables the user to book or reservate a seat in a theatre or hall or big top by simply clicking on a self actualising seatplan (mysql-powered)

Scripts like this are used by lanparty sites allover, contacting them brought nothing but the answer, it would be a part of php-nuke.

I really can´t believe that i have to install php-nuke to get it work.

As nonprofi in php & mysql tips or script samples would be helpful.

Thanks to all!

Hb

No need for the nuke!

Posted: Tue May 14, 2002 9:08 pm
by pHaZed
Hey,
You dont need to use PHPNuke for this. It would be quite easy actually.
Im assuming you have a image of the seating layout?
Well if you do then use a program such as Dreamweaver to make a Image Map of the Seating Layout.
And link all the seats like so:
http://yoursite.com/filename.php?seat_id=1 (For seat #1)
http://yoursite.com/filename.php?seat_id=2 (For seat #2) etc...
Now when the click that seat we will retreive the seat # from the variable seat_id, And then increment the mysql row suited to that seat.

Code: Select all

<?PHP
$con = mysql_connect($host, $user, $pass);
$sel= mysql_select_db("dbname", $con);
if($seat_id == &#1111;&#1111;:ALPHA:]])
&#123;
   $sql= "INSERT INTO `tablename` (id, seat, purchaser) WHERE  seat=$seat_id  VALUES ('', '$seat_id', '$purchaser');
  $result= mysql_query($sql);
&#125;
?>
So when they click the link it will get the seat number and update the mysql row appropiate to the string...
Then you could also use an If and Else operators,
To make the seat link active or not... (depending on wether it is already booked)
Make the table row seat... To be INT(2), and default 0, And set it to 1 in the query above when its booked.
Hope that helps