...

View Full Version : Project Question



haseeb
11-07-2012, 08:28 AM
I have a question a big one iam doing a project and currently stuck with the process of it on how i should setup the way for it to work.
The project is that there is a deal on a site and the deal is about boat dinner cruise and there are 48 persons limit 30 for lower deck and 18 for upper.
And you can obtain these tickets for the following particular dates.
sat 17
sun 18
sat 23
sun 25
sat 1
sun 2
so that means everyday has its own 48 persons limit.

So is it possible to code? if yes please give me a summary how it will work just some help process wise.
Thanks

sunfighter
11-07-2012, 05:19 PM
So is it possible to code Yes. This is by no means the final code. I just got tired of doing it. It will give you some insight:


<!DOCTYPE html>
<html>
<head>
<style type="text/css">
div .daysend
{
height: 120px;
width: 180px;
padding-left: 30px;
padding-top: 10px;
border: 1px solid black;
}
#cent
{
height: 120px;
width: 180px;
padding-left: 30px;
padding-top: 10px;
border: 1px solid black;
position: absolute;
left: 390px;
top: 120px;
background-color: red;
}
</style>
<?php
$sat17u = 26;
$sat17l = 15;
$sun18u = 10;
$sun18l = 2;
?>
<script type="text/javascript">
function buy(dayid)
{
alert(dayid);
}
</script>
</head>
<body>

<div style="width: 960px;">
<div class="daysend" id="" style="float:left;">Sat 17<br />Upper Deck - <?php echo $sat17u; ?> Left<br />Lower Deck - <?php echo $sat17l; ?> Left<br /><br /><button id="sat17buy" onclick="buy('sat17buy');">Reserve A Table</button></div>
<div class="daysend" id="" style="float:right;">Sun 18<br />Upper Deck - <?php echo $sun18u; ?> Left<br />Lower Deck - <?php echo $sun18l; ?> Left</div>
<div class="daysend" id="" style="clear:both; float:left;">Sat 23<br />Upper Deck - <?php echo $sat17u; ?> Left<br />Lower Deck - <?php echo $sat17l; ?> Left</div>
<div class="daysend" id="" style="float:right;">Sun 25<br />Upper Deck - <?php echo $sat17u; ?> Left<br />Lower Deck - <?php echo $sat17l; ?> Left</div>
<div class="daysend" id="" style="clear:both; float:left;">Sat 1<br />Upper Deck - <?php echo $sat17u; ?> Left<br />Lower Deck - <?php echo $sat17l; ?> Left</div>
<div class="daysend" id="" style="float:right;">Sun 2<br />Upper Deck - <?php echo $sat17u; ?> Left<br />Lower Deck - <?php echo $sat17l; ?> Left</div>
</div>

<div id="cent">
Upper Deck <input type="radio" id="" name="decks"><br>
Lower Deck <input type="radio" id="" name="decks"><br>
Number of Seats <input type="text" name="seats" maxlength="3">

</div>
</body>
</html>

haseeb
11-08-2012, 07:48 AM
Thanks for the help though i wanted to know how i can interact it with the database like how many tables how many columns it would need.

sunfighter
11-08-2012, 01:03 PM
You need two tables. One for the boat seats and one for the people that have purchased a seat. The boat has columns for deck; upper and lower, number of seats, and the date. This table is read to produce the html page. You UPDATE this to keep track of the seats.

The people table needs personal info like name and if you need address etc. It needs to tie into the boat table so you need how many seats was bought, date of cruise and upper or lower, this is in case payment is not received, you can add the seats back and know where to add them. You need info on the payment. This should be the amount, how paid (credit card - paypal) , if the payment was confirmed, the date the reservations were made and when the payment was received. (you are going through a professional service to proccess the payment right?)

Finally the date of when the tickets were mailed to the person. You need the payment received date in case you have a time limit on how long you'll hold the seats for them. You add a row to this table when the reservation is made and UPDATE when payment is received.

haseeb
11-08-2012, 02:59 PM
Thanks for the help so the database should look like this
Boat seats
----------
Upper
Lower
Number of seats
Date of Purchase


People
----------
Name
Email
Message
?

sunfighter
11-09-2012, 02:57 PM
No:
Boat seats
----------
Upper
Lower
Number of seats LEFT
Date of VENUE

People
------------------
Name
Email
Physical Address
Number of Seats Purchased
Date of VENUE
UPPER or Lower = Labeled `deck`
Date Tickets were Purchased
Amount of Purchase = money
Payment Confirmation = this could be reserved or confirmed
Method of Payment
Date Payment Confirmed
Date Tickets Mailed
Tickets Mailed Confirmation

That's all I can think of at the present.

haseeb
11-10-2012, 02:59 PM
how to configure number of seats left?
i mean how to calculate it?

sunfighter
11-10-2012, 04:59 PM
Subtraction. man buys two tickets take 2 away from the venue.

Started with 18 for upper deck on the 18th. Take away 2. 16 left.

haseeb
11-10-2012, 05:23 PM
i got this point but i mean how i can do this subtraction in mysql?

sunfighter
11-11-2012, 03:33 PM
In the red box you collect the clients information in a form. When the submit button is clicked it is sent to a php file on the server. Here you INSERT the information into the people table.
You use the following info:


Number of Seats Purchased Lets say 2
Date of VENUE Lets say the 18th
UPPER or Lower = Labeled `deck` Lets say UPPER
To UPDATE the boat table.


UPDATE boats
SET `Number of seats LEFT` = Number of seats LEFT - 2
WHERE deck = "UPPER"
AND `Date of VENUE` = 18



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum