numloxx icon

public.php

numloxx | PRO | 12/27/18 11:17:11 AM UTC | 0 ⭐ | 344 👁️ | Never ⏰ | []
text |

2.49 KB

|

None

|

0 👍

/

0 👎

 <?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";
$sql = "SELECT id, flight_arrival, flight_departure, rego, origin, destination, sta, eta, std, bay, pax_flt_comment, arrival_comment, departure_comment FROM flights";
 $result = $conn->query($sql);
  echo "<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: black;}
h1   {color: white;}
p    {color: white;}
text { color: white;}
table, th, td {
 border: 1px solid white;
 border-collapse: collapse;
 text-align: center;
 border-spacing: 5px;
 text {color: white};
 }
 </style>
</head>
<body text=ffffff>
<center>
";
   if ($result->num_rows > 0) {
    // output data of each row
 echo "ARRIVALS<br>";
// header line arrivals
echo "<table> <tr><th> ID </th> <th> Flight </th> <th>Origin</TH>  <th>STA</th>  <th>ETA</th>  <TH> COMMENTS </tr>";
     while($row = $result->fetch_assoc()) {
   // data line - repeaters until all rows dispalyed
 echo "<tr><td>".$row["id"]. "</td>    <td>".$row["flight_arrival"]. "</td><td>".$row["origin"]. "</td><td>".$row["sta"]. "</td><td>".$row["eta"]. "</td><td>".$row["pax_flt_comment"]. "</td></tr>";
     }
 echo "</table><P>";
} else {
    echo "0 results";
}
 echo "<p align=center>";
   $result = $conn->query($sql);
//echo .$row["arrival_comment"];
  // deparutes section - to be fixed
 //echo "ARRIVALS<br>";
// header line arrivals
//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>$
 //    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();
?>

Comments