Advertisement
numloxx

Untitled

Dec 27th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "fids";
  4. $password = "password";
  5. $dbname = "fids";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. // $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";
  15. $sql = "SELECT id, flight_arrival, flight_departure, rego, origin, destination, sta, eta, std, bay, pax_flt_comment, arrival_comment, departure_comment FROM flights";
  16.  
  17. $result = $conn->query($sql);
  18.  
  19.  
  20. echo "<!DOCTYPE html>
  21. <html>
  22. <head>
  23. <style>
  24. body {background-color: black;}
  25. h1 {color: white;}
  26. p {color: white;}
  27. text { color: white;}
  28. table, th, td {
  29. border: 1px solid white;
  30. border-collapse: collapse;
  31. text-align: center;
  32. border-spacing: 5px;
  33. text {color: white};
  34. }
  35.  
  36. </style>
  37. </head>
  38. <body text=ffffff>
  39. <center>";
  40.  
  41.  
  42.  
  43. if ($result->num_rows > 0) {
  44. // output data of each row
  45.  
  46. echo "ARRIVALS<br>";
  47. // header line arrivals
  48. echo "<table> <tr><th> ID </th> <th> Flight </th> <th>Origin</TH> <th>STA</th> <th>ETA</th> <TH> COMMENTS </tr>";
  49.  
  50.  
  51. // while($row = $result->fetch_assoc()) {
  52.  
  53.  
  54.  
  55. // data line - repeaters until all rows dispalyed
  56.  
  57.  
  58. $arrivals = [];
  59. $departures = [];
  60. while($row = $result->fetch_assoc()) {
  61. array_push($arrival, $row);
  62. array_push($departure, $row);
  63.  
  64.  
  65.  
  66.  
  67. echo "<tr><td>".$arrival["id"]. "</td> <td>".$arrival["flight_arrival"]. "</td><td>".$arrival["origin"]. "</td><td>".$arrival["sta"]. "</td><td>".$arrival["eta"]. "</td><td>".$arrival["pax_flt_comment"]. "</td></tr>";
  68.  
  69. }
  70.  
  71. echo "</table><P>";
  72. } else {
  73. echo "0 results";
  74. }
  75.  
  76. echo "<p align=center>";
  77.  
  78.  
  79.  
  80. //echo .$row["arrival_comment"];
  81.  
  82.  
  83.  
  84. // deparutes section - to be fixed
  85.  
  86. //echo "DEPARTURES<br>";
  87. // header line arrivals
  88. // echo "<table> <tr><th> ID </th> <th> Flight </th> <TH> Dest </TH> <th> STD </th> <TH>BAY</TH> ";
  89.  
  90. // while($row = $result->fetch_assoc()) {
  91.  
  92.  
  93.  
  94. // data line - repeaters until all rows dispalyed
  95.  
  96. // echo "<tr><td>".$row["id"]. "</td><td>".$row["flight_departure"]. "</td><td>".$row["destination"]. "</td><td>".$row["std"]. "</td><td>".$row["pax_comment"]. "</td></tr>";
  97.  
  98. // }
  99.  
  100. //echo "</table><P>";
  101. //} else {
  102. // echo "0 results";
  103. //}
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. $conn->close();
  119. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement