Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post

    Project Question

    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

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,226
    Thanks
    23
    Thanked 606 Times in 605 Posts
    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:
    Code:
    <!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>

  • #3
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post
    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.

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,226
    Thanks
    23
    Thanked 606 Times in 605 Posts
    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.

  • Users who have thanked sunfighter for this post:

    haseeb (11-08-2012)

  • #5
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post
    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
    ?

  • #6
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,226
    Thanks
    23
    Thanked 606 Times in 605 Posts
    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.

  • Users who have thanked sunfighter for this post:

    haseeb (11-10-2012)

  • #7
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post
    how to configure number of seats left?
    i mean how to calculate it?

  • #8
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,226
    Thanks
    23
    Thanked 606 Times in 605 Posts
    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.

  • #9
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post
    i got this point but i mean how i can do this subtraction in mysql?

  • #10
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,226
    Thanks
    23
    Thanked 606 Times in 605 Posts
    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:
    Code:
    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.
    Code:
    UPDATE boats
     SET `Number of seats LEFT` = Number of seats LEFT - 2
    WHERE deck = "UPPER"
    AND `Date of VENUE` = 18


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •