bookedFlights.php 2.93 KB
<?php
session_start();
require_once 'classes/realops.php';
$get = new Get();
$stats = new Stats();
date_default_timezone_set('Australia/Sydney');
$bookings = $get->bookings($_GET);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php include 'sections/header.php'; ?>
</head>
<body>
<div class="wrapper">
    <?php include 'sections/navbar.php' ?>
    <div class="container" id="realops-container">
        <div class="row">
            <article class="col-sm-12 panel panel-default" id="realops-body">

            <h2 class="sub-header">Booked Flights (<?=count($bookings)?>)</h2>
        

            <div class="table-responsive col-lg-12">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>Flight Number</th>
                        <th>Departure</th>
                        <th>Arrival</th>
                        <th>Aircraft</th>
                        <th>Slot Time</th>
                        <th>Stats</th>
                    </tr>
                    </thead>
                    <tbody>
                        <?php  
                        if(!empty($bookings)) {
                        foreach($bookings as $row) 
                        { 
                            ?>
                    <tr>
                        <td style=""><img src="logos/<?php echo $row['airline']; ?>.png" /><br /><strong><?php echo $row['airline'] . $row['flightnum']; ?></strong>/<?php echo $row['fbnum'] ?></td>
                        <td><?php if($row['deparr'] == "0") echo "Sydney (YSSY)"; else echo $get->airport($row['icao'])['name'] . " (" . $row['icao'] . ")"; ?></td>
                        <td><?php if($row['deparr'] == "1") echo "Sydney (YSSY)"; else echo $get->airport($row['icao'])['name'] . " (" . $row['icao'] . ")"; ?></td>
                        <td><?php echo $get->aircraft($row['aircraft'])['name'] ?></td>
                        <td><?php echo date('H:i', strtotime($row['time'])); ?> LOC<br /><?php echo date('H:i', strtotime($row['time'])- 60 * 60 * 10); ?> UTC</td>
                        <td><span class="label label-primary"><?php echo $row['pilotVatsimID']; ?></span><br /><span class="label label-success"><?php echo $row['pilotName']; ?></span><br /><span class="label label-<?php if($row['va']['id'] == 0) echo "info"; else echo "danger"; ?>"><?php echo $row['va']['name']; ?></span><br /></td>
                    </tr>
                    <?php } }
                    else {
                        echo "<br /><div class=\"alert alert-danger\" role=\"alert\"><strong>No Flights Found.</strong> Please adjust your search and try again.</div>";
                    }
                    ?>
                    </tbody>
                </table>
            </div>

            </article>
        </div><!-- /.row -->
    </div><!-- /.container -->
</div><!-- /.wrapper -->

<?php include 'sections/footer.php'; ?>