Advertisement
numloxx

staff.php

Dec 27th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. // staff.php
  2. <?php
  3. $servername = "localhost";
  4. $username = "fids";
  5. $password = "password";
  6. $dbname = "fids";
  7.  
  8. // Create connection
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $sql = "SELECT id, flight_arrival, flight_departure, rego, pax_in, pax_out, bags, freight, origin, destination, sta, eta, std, fuel, ramp, taxi, burn, staff_flt_comment, bay FROM flights";
  16. $result = $conn->query($sql);
  17.  
  18.  
  19. echo "<!DOCTYPE html>
  20. <html>
  21. <head>
  22. <style>
  23. body {background-color: powderblue;}
  24. h1 {color: blue;}
  25. p {color: red;}
  26. table, th, td {
  27. border: 1px solid black;
  28. border-collapse: collapse;
  29. text-align: center;
  30. border-spacing: 5px;
  31. }
  32.  
  33. </style>
  34. </head>
  35. <body>
  36. <center>
  37. ";
  38.  
  39. if ($result->num_rows > 0) {
  40. // output data of each row
  41.  
  42. // header line
  43. echo "<table> <tr><th> ID </th> <th> Flight </th><th>Rego</th> <th>Origin</TH> <th>STA</th> <th>ETA</th> <TH>Dest</TH> <th>STD</th> <th>PAX</th> <th>BAGS</TH> <TH>FREIGHT</TH> <TH>BAY</TH> <TH>FUEL</TH> <th>ramp/taxi/burn</th><TH> C$
  44.  
  45. while($row = $result->fetch_assoc()) {
  46.  
  47.  
  48.  
  49. // data line - repeaters until all rows dispalyed
  50.  
  51. echo "<tr><td>".$row["id"]. "</td><td>".$row["flight_arrival"]."/".$row["flight_departure"]. "</td><td>".$row["rego"]. "</td>". "<td>".$row["origin"]. "</td>" . "<td>".$row["sta"]. "</td>" . "<td>".$row["eta"]. "</td>" . "<td>".$
  52.  
  53. }
  54.  
  55. echo "</table><P>";
  56. } else {
  57. echo "0 results";
  58. }
  59. $conn->close();
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement