Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.13 KB | None | 0 0
  1. <?php
  2. //session started
  3. session_start();
  4. //include functions.php
  5. include("php/functions.php");
  6. //checks user secuirty level
  7. $currentuser=getUserLevel();
  8. //checking session userid
  9. $username=checkUser($_SESSION['userid'],session_id(),3,4);
  10. ?>
  11. <?php
  12. //Fetches all the data from the sailing table
  13. mysql_select_db("pe13006337", mysql_connect("comp-hons.uhi.ac.uk","pe13006337","13006337"));
  14. $sailingid = $_GET['sailingid'];
  15. $sailing_list ="";
  16. $sql = mysql_query("SELECT * FROM sailing WHERE sailingid='$sailingid'");
  17. $sailingcount = mysql_num_rows($sql);
  18.  
  19. if ($sailingcount > 0){
  20. while($row = mysql_fetch_array($sql)){
  21. $sailingid = $row['sailingid'];
  22. $departdate = $row['departdate'];
  23. $returndate = $row['returndate'];
  24. $boatname = $row['boatname'];
  25. $startlocation = $row['startlocation'];
  26. $endlocation = $row['endlocation'];
  27. $details = $row['details'];
  28. $duration = $row['duration'];
  29. $price = $row['price'];
  30. $sailing_list .= "<table border='0' cellpadding='6' cellspacing='0' width='100%'>
  31. <tr>
  32. <td>DEPARTURE DATE<br>
  33. $departdate
  34. </td>
  35. <td>RETURN DATE<br>
  36. $returndate
  37. </td>
  38. <td>BOAT NAME<br>
  39. $boatname
  40. </td
  41. <td>
  42. </td>
  43. <td>START LOCATION<br>
  44. $startlocation
  45. </td>
  46. <td>END LOCATION<br>
  47. $endlocation
  48. </td>
  49. <td>DETAILS<br>
  50. $details
  51. </td>
  52. <td>DURATION<br>
  53. $duration
  54. </td>
  55. <td>PRICE<br>
  56. $price
  57. </td>
  58. </tr>
  59. </table>";
  60.  
  61. }
  62.  
  63. } else {
  64. $sailing_list = "There are currently no sailings";
  65. }
  66.  
  67. ?>
  68. <!DOCTYPE html>
  69. <html>
  70. <head>
  71. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  72. <meta content=
  73. "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
  74. name="viewport">
  75. <meta content="IE=Edge,chrome=1" http-equiv="X-UA-Compatible">
  76. <title>Booking Details - Scotia Sea Life Trust</title>
  77. <link href="css/style.css" rel="stylesheet" type="text/css">
  78. <!--[if (lte IE 8)&!(IEMobile)]>
  79. <script src="js/iefix.js"></script>
  80. <link rel="stylesheet" type="text/css" href="css/ieold.css" />
  81. <link rel="stylesheet" type="text/css" href="css/medium.css" />
  82. <![endif]-->
  83. <link href="css/medium.css" media=
  84. "screen and (min-width: 840px) and (max-width:999px)" rel="stylesheet" type=
  85. "text/css">
  86. <link href="css/wide.css" media="screen and (min-width: 1000px)" rel=
  87. "stylesheet" type="text/css">
  88. <link href="css/medium_narrow.css" media=
  89. "screen and (min-width: 640px) and (max-width:839px)" rel="stylesheet" type=
  90. "text/css">
  91. <link href="css/narrow.css" media="screen and (max-width:639px)" rel=
  92. "stylesheet" type="text/css">
  93. <link href="css/print.css" media="print" rel="stylesheet" type="text/css">
  94. </head>
  95. <body>
  96. <header></header>
  97. <nav id="main">
  98. <div id="menubutton">Menu</div>
  99. <ul id="menu">
  100. <li><a href="index.php">Home</a></li>
  101. <li><a href="about.php">About</a></li>
  102. <li><a href="store.php">Store</a></li>
  103. <li><a href="contactus.php">Contact Us</a></li>
  104. <?php if($currentuser['userlevel']==2) { ?>
  105. <li><a href="volunteerapplication.php">Apply to be a Volunteer!</a></li>
  106. <?php } ?>
  107. <?php if($currentuser['userlevel']>2) { ?>
  108. <li><a href="booknow.php">Book Now</a></li>
  109. <?php } ?>
  110. <?php if($currentuser['userlevel']>2) { ?>
  111. <li><a href="sailing.php">Sailings</a></li>
  112. <?php } ?>
  113. <?php if($currentuser['userlevel']>2) { ?>
  114. <li><a href="viewbooking.php">View Bookings</a></li>
  115. <?php } ?>
  116. <?php if($currentuser['userlevel']==4) { ?>
  117. <li><a href="admin.php">Administration</a></li>
  118. <?php } ?>
  119. </ul>
  120. </nav>
  121. <?php if($currentuser['userlevel']<1) {//if users level is less than 1 then display login form ?>
  122. <form name="loginform" id="loginform" method="post" action="php/processlogin.php">
  123. <fieldset id="login">
  124. <label for="username">Username :
  125. </label>
  126. <input type="text" name="username" id="username" size="10" required />
  127. <label for="userpass">Password :
  128. </label>
  129. <input type="password" name="userpass" id="userpass" size="10" required />
  130. <button type="submit">Login
  131. </button>
  132. <?php if($currentuser['userlevel']==0) {//if user level is equal to 0 then display link to register ?>
  133. <a href="register.php">Register New Account
  134. </a>
  135. <?php } ?>
  136. </fieldset>
  137. </form>
  138. <?php } else {//if the user is logged in then there name, profile and a option to logout is displayed ?>
  139. <fieldset id="login">
  140. <h3>Welcome back
  141. <?php echo $currentuser['username']; ?>!
  142. </h3>
  143. <a href="edituser.php">Profile
  144. </a>
  145. <a href="php/logout.php">Log Out
  146. </a>
  147. <a href="cart.php">View Cart
  148. </a>
  149. <a href="userapplication.php">Application Status
  150. </a>
  151. </fieldset>
  152. <?php } ?>
  153. <section>
  154. <h1>Book A Trip</h1>
  155. <div align="right" style="margin-right:30px">
  156. </div>
  157. <div style="width: 50%;margin: 0 auto;">
  158. <h2>Selected Sailing:</h2>
  159. <?php echo $sailing_list; ?><br>
  160. </div><a id="sailingform" name="sailingform"></a>
  161. <h3>Stage 2. Please enter your billing details below:</h3>
  162. <form style="width: 50%;margin: 0 auto;" action="bookingcomplete.php" enctype="multipart/form-data" id=
  163. "bookingform" method="post" name="bookingform">
  164. <table border="0" cellpadding="6" cellspacing="0" width="90%">
  165. <tr>
  166. <input type="hidden" name="sailingid" value="<?php echo $sailingid; ?>" size="64"></input>
  167. </tr>
  168. <tr>
  169. <td align="right" width="20%">Forename</td>
  170. <td width="80%"><label><input id="forename" name="forename" size="64" type=
  171. "text"></label></td>
  172. </tr>
  173. <tr>
  174. <td align="right" width="20%">Surname</td>
  175. <td width="80%"><label><input id="surname" name="surname" size="64" type=
  176. "text"></label></td>
  177. </tr>
  178. <tr>
  179. <td align="right" width="20%">Address</td>
  180. <td width="80%"><label><input id="address" name="address" size="64" type=
  181. "text"></label></td>
  182. </tr>
  183. <tr>
  184. <td align="right">Town</td>
  185. <td><label> <input id="town" name="town" size="64" type=
  186. "text"></label></td>
  187. </tr>
  188. <tr>
  189. <td align="right" width="20%">Postcode</td>
  190. <td width="80%"><label><input id="postcode" name="postcode" size="64" type=
  191. "text"></label></td>
  192. </tr>
  193. <tr>
  194. <td align="right" width="20%">phonenumber</td>
  195. <td width="80%"><label><input id="phonenumber" name="phonenumber" size="64" type=
  196. "text"></label></td>
  197. </tr>
  198. <tr>
  199. <td align="right" width="20%">Card Fullname</td>
  200. <td width="80%"><label><input id="cardname" name="cardname" size="64" type=
  201. "text"></label></td>
  202. </tr>
  203. <tr>
  204. <td align="right" width="20%">Card Number</td>
  205. <td width="80%"><label><input id="cardnumber" name="cardnumber" size="64" type=
  206. "text"></label></td>
  207. </tr>
  208. <tr>
  209. <td align="right" width="20%">Card Expiry Date</td>
  210. <td width="80%"><label><input id="cardexp" name="cardexp" size="64" type=
  211. "text"></label></td>
  212. </tr>
  213. <tr>
  214. <td align="right">3 Digit Security Code (located on the back of your card)</td>
  215. <td><label> <input id="cardsecuritynum" name="cardsecuritynum" size="64" type=
  216. "text"></label></td>
  217. </tr>
  218. <tr>
  219. <td>&nbsp;</td>
  220. <td><label><input id="button" name="button" type="submit" value=
  221. "Book Now"></label></td>
  222. </tr>
  223. </table>
  224. </form>
  225. </section>
  226. <footer>
  227. <nav>
  228. <ul>
  229. <li><a href="#">Sitemap</a></li>
  230. <li><a href="#">Terms</a></li>
  231. <li><a href="#">Privacy</a></li>
  232. <li><a href="contactus.php">Contact Us</a></li>
  233. </ul>
  234. </nav>
  235. </footer>
  236. <script src="js/functions.js"></script>
  237. <script src="js/touch.js"></script>
  238. <script>
  239. document.onreadystatechange=function() {
  240. if(document.readyState=="complete") {
  241. prepareMenu();
  242. prepareTouch();
  243. }
  244. }
  245. </script>
  246. </body>
  247. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement