bookedFlights.php 3.26 KB
<?php 
session_start();
require_once 'classes/realops.php';
$get = new Get();
date_default_timezone_set('Australia/Sydney');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Flights</title>

<?php include 'sections/header.php'; ?>
</head>

<body>
<?php include 'sections/navbar.php'; ?>
<div class="container-fluid">
    <div class="row">
        <?php include 'sections/sidebar.php'; ?>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

            <h2 class="sub-header">Booked Flights</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>Actions</th>
                    </tr>
                    </thead>
                    <tbody>
                        <?php  
                        $bookings = $get->bookings($_GET);
                        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 * Z); ?> UTC</td>
                        <td><span class="label label-primary"><?php echo $row['pilotVatsimID']; ?></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>
        </div>
    </div>
</div>

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


</div>

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