Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // staff.php
- <?php
- $servername = "localhost";
- $username = "fids";
- $password = "password";
- $dbname = "fids";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $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";
- $result = $conn->query($sql);
- echo "<!DOCTYPE html>
- <html>
- <head>
- <style>
- body {background-color: powderblue;}
- h1 {color: blue;}
- p {color: red;}
- table, th, td {
- border: 1px solid black;
- border-collapse: collapse;
- text-align: center;
- border-spacing: 5px;
- }
- </style>
- </head>
- <body>
- <center>
- ";
- if ($result->num_rows > 0) {
- // output data of each row
- // header line
- 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$
- while($row = $result->fetch_assoc()) {
- // data line - repeaters until all rows dispalyed
- 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>".$
- }
- echo "</table><P>";
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement