Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //session started
- session_start();
- //include functions.php
- include("php/functions.php");
- //checks user secuirty level
- $currentuser=getUserLevel();
- //checking session userid
- $username=checkUser($_SESSION['userid'],session_id(),3,4);
- ?>
- <?php
- //Fetches all the data from the sailing table
- mysql_select_db("pe13006337", mysql_connect("comp-hons.uhi.ac.uk","pe13006337","13006337"));
- $sailingid = $_GET['sailingid'];
- $sailing_list ="";
- $sql = mysql_query("SELECT * FROM sailing WHERE sailingid='$sailingid'");
- $sailingcount = mysql_num_rows($sql);
- if ($sailingcount > 0){
- while($row = mysql_fetch_array($sql)){
- $sailingid = $row['sailingid'];
- $departdate = $row['departdate'];
- $returndate = $row['returndate'];
- $boatname = $row['boatname'];
- $startlocation = $row['startlocation'];
- $endlocation = $row['endlocation'];
- $details = $row['details'];
- $duration = $row['duration'];
- $price = $row['price'];
- $sailing_list .= "<table border='0' cellpadding='6' cellspacing='0' width='100%'>
- <tr>
- <td>DEPARTURE DATE<br>
- $departdate
- </td>
- <td>RETURN DATE<br>
- $returndate
- </td>
- <td>BOAT NAME<br>
- $boatname
- </td
- <td>
- </td>
- <td>START LOCATION<br>
- $startlocation
- </td>
- <td>END LOCATION<br>
- $endlocation
- </td>
- <td>DETAILS<br>
- $details
- </td>
- <td>DURATION<br>
- $duration
- </td>
- <td>PRICE<br>
- $price
- </td>
- </tr>
- </table>";
- }
- } else {
- $sailing_list = "There are currently no sailings";
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
- <meta content=
- "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
- name="viewport">
- <meta content="IE=Edge,chrome=1" http-equiv="X-UA-Compatible">
- <title>Booking Details - Scotia Sea Life Trust</title>
- <link href="css/style.css" rel="stylesheet" type="text/css">
- <!--[if (lte IE 8)&!(IEMobile)]>
- <script src="js/iefix.js"></script>
- <link rel="stylesheet" type="text/css" href="css/ieold.css" />
- <link rel="stylesheet" type="text/css" href="css/medium.css" />
- <![endif]-->
- <link href="css/medium.css" media=
- "screen and (min-width: 840px) and (max-width:999px)" rel="stylesheet" type=
- "text/css">
- <link href="css/wide.css" media="screen and (min-width: 1000px)" rel=
- "stylesheet" type="text/css">
- <link href="css/medium_narrow.css" media=
- "screen and (min-width: 640px) and (max-width:839px)" rel="stylesheet" type=
- "text/css">
- <link href="css/narrow.css" media="screen and (max-width:639px)" rel=
- "stylesheet" type="text/css">
- <link href="css/print.css" media="print" rel="stylesheet" type="text/css">
- </head>
- <body>
- <header></header>
- <nav id="main">
- <div id="menubutton">Menu</div>
- <ul id="menu">
- <li><a href="index.php">Home</a></li>
- <li><a href="about.php">About</a></li>
- <li><a href="store.php">Store</a></li>
- <li><a href="contactus.php">Contact Us</a></li>
- <?php if($currentuser['userlevel']==2) { ?>
- <li><a href="volunteerapplication.php">Apply to be a Volunteer!</a></li>
- <?php } ?>
- <?php if($currentuser['userlevel']>2) { ?>
- <li><a href="booknow.php">Book Now</a></li>
- <?php } ?>
- <?php if($currentuser['userlevel']>2) { ?>
- <li><a href="sailing.php">Sailings</a></li>
- <?php } ?>
- <?php if($currentuser['userlevel']>2) { ?>
- <li><a href="viewbooking.php">View Bookings</a></li>
- <?php } ?>
- <?php if($currentuser['userlevel']==4) { ?>
- <li><a href="admin.php">Administration</a></li>
- <?php } ?>
- </ul>
- </nav>
- <?php if($currentuser['userlevel']<1) {//if users level is less than 1 then display login form ?>
- <form name="loginform" id="loginform" method="post" action="php/processlogin.php">
- <fieldset id="login">
- <label for="username">Username :
- </label>
- <input type="text" name="username" id="username" size="10" required />
- <label for="userpass">Password :
- </label>
- <input type="password" name="userpass" id="userpass" size="10" required />
- <button type="submit">Login
- </button>
- <?php if($currentuser['userlevel']==0) {//if user level is equal to 0 then display link to register ?>
- <a href="register.php">Register New Account
- </a>
- <?php } ?>
- </fieldset>
- </form>
- <?php } else {//if the user is logged in then there name, profile and a option to logout is displayed ?>
- <fieldset id="login">
- <h3>Welcome back
- <?php echo $currentuser['username']; ?>!
- </h3>
- <a href="edituser.php">Profile
- </a>
- <a href="php/logout.php">Log Out
- </a>
- <a href="cart.php">View Cart
- </a>
- <a href="userapplication.php">Application Status
- </a>
- </fieldset>
- <?php } ?>
- <section>
- <h1>Book A Trip</h1>
- <div align="right" style="margin-right:30px">
- </div>
- <div style="width: 50%;margin: 0 auto;">
- <h2>Selected Sailing:</h2>
- <?php echo $sailing_list; ?><br>
- </div><a id="sailingform" name="sailingform"></a>
- <h3>Stage 2. Please enter your billing details below:</h3>
- <form style="width: 50%;margin: 0 auto;" action="bookingcomplete.php" enctype="multipart/form-data" id=
- "bookingform" method="post" name="bookingform">
- <table border="0" cellpadding="6" cellspacing="0" width="90%">
- <tr>
- <input type="hidden" name="sailingid" value="<?php echo $sailingid; ?>" size="64"></input>
- </tr>
- <tr>
- <td align="right" width="20%">Forename</td>
- <td width="80%"><label><input id="forename" name="forename" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">Surname</td>
- <td width="80%"><label><input id="surname" name="surname" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">Address</td>
- <td width="80%"><label><input id="address" name="address" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right">Town</td>
- <td><label> <input id="town" name="town" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">Postcode</td>
- <td width="80%"><label><input id="postcode" name="postcode" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">phonenumber</td>
- <td width="80%"><label><input id="phonenumber" name="phonenumber" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">Card Fullname</td>
- <td width="80%"><label><input id="cardname" name="cardname" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">Card Number</td>
- <td width="80%"><label><input id="cardnumber" name="cardnumber" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right" width="20%">Card Expiry Date</td>
- <td width="80%"><label><input id="cardexp" name="cardexp" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td align="right">3 Digit Security Code (located on the back of your card)</td>
- <td><label> <input id="cardsecuritynum" name="cardsecuritynum" size="64" type=
- "text"></label></td>
- </tr>
- <tr>
- <td> </td>
- <td><label><input id="button" name="button" type="submit" value=
- "Book Now"></label></td>
- </tr>
- </table>
- </form>
- </section>
- <footer>
- <nav>
- <ul>
- <li><a href="#">Sitemap</a></li>
- <li><a href="#">Terms</a></li>
- <li><a href="#">Privacy</a></li>
- <li><a href="contactus.php">Contact Us</a></li>
- </ul>
- </nav>
- </footer>
- <script src="js/functions.js"></script>
- <script src="js/touch.js"></script>
- <script>
- document.onreadystatechange=function() {
- if(document.readyState=="complete") {
- prepareMenu();
- prepareTouch();
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement