Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="panel-body">
- <?php
- $db = new mysqli($db_host , $db_username , $db_password , $db_database);
- $db->set_charset("utf8");
- if ($db->connect_errno > 0) {
- die('Unable to connect to database [' . $db->connect_error . ']');
- }
- $sql = "SELECT v.gvauser_id,a1.name AS dep_name, a2.name AS arr_name, a1.iso_country AS dep_country,a2.iso_country AS arr_country,
- v.callsign,v.gvauser_id,v.departure,v.arrival, DATE_FORMAT(v.flight_date,'$va_date_format') AS date_string, v.flight_date,
- format(v.flight_duration,2) AS vtime, v.landing_vs FROM vampireps v, airports a1, airports a2
- INNER JOIN vampireps vp
- WHERE v.departure=a1.ident
- AND v.arrival=a2.ident
- AND vp.gvauser_id = v.gvauser_id
- AND v.flight_duration IS NOT NULL
- GROUP BY v.id DESC LIMIT 5";
- if (!$result = $db->query($sql)) {
- die('There was an error running the query [' . $db->error . ']');
- }
- ?>
- <div class="table-responsive">
- <table class="table table-hover">
- <?php
- echo "<thead><tr><th>" . LF_CALLSIG . "</th><th>" . LF_PILOT . "</th><th>" . LF_DEPARTURE . "</th><th>" . LF_ARRIVAL . "</th><th>" . LF_FLIGHTDATE . "</th><th>" . LF_FLIGHTTIME . "</th></tr></thead>";
- while ($row = $result->fetch_assoc()) {
- echo '<td>';
- echo '<a href="./index.php?page=pilot_details&pilot_id=' . $row["gvauser_id"] . '">' . $row["callsign"] . '</a></td><td>';
- echo $row["pilot_name"] . '</td><td>';
- echo '<IMG src="images/icons/ic_flight_takeoff_black_18dp_2x.png" WIDTH="20" HEIGHT="20" BORDER=0 ALT=""> <IMG src="images/country-flags/'.$row["dep_country"].'.png" WIDTH="25" HEIGHT="20" BORDER=0 ALT=""> <a href="./index.php?page=airport_info&airport=' . $row["departure"] . '">' . $row["departure"] . '</a></td><td>';
- echo '<IMG src="images/icons/ic_flight_land_black_18dp_2x.png" WIDTH="20" HEIGHT="20" BORDER=0 ALT=""> <IMG src="images/country-flags/'.$row["arr_country"].'.png" WIDTH="25" HEIGHT="20" BORDER=0 ALT=""> <a href="./index.php?page=airport_info&airport=' . $row["arrival"] . '">' . $row["arrival"] . '</a> </td><td>';
- echo $row["date_string"] . '</td><td>';
- echo '<i class="fa fa-clock-o"></i> '.convertTime($row["vtime"],$va_time_format). '</td></tr>';
- }
- ?>
- </table>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement