myFlights.php 4.93 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>My Flights - RealOps</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/dashboard.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="js/ie-emulation-modes-warning.js"></script>

    <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" href="/fancy/jquery.fancybox.css" type="text/css" media="screen" />

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</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">My Booked Flights</h2>
<?php $myFlights = $get->myFlights($_SESSION['vatsimID']);
if(!empty($myFlights))
{
    foreach($myFlights as $row)
    { ?>
            <div class="panel panel-default" id="<?php echo $row['bookingID'] ?>Block">
  <div class="panel-heading">
    <h3 class="panel-title"><strong><?php echo $row['airline'].$row['flightnum']; ?></strong><?php echo "/".$row['fbnum']; ?></h3>
  </div>
  <div class="panel-body">
    <div class="col-lg-3">
    <img src="logos/<?php echo $row['airline'] ?>.png" /><br /><strong>Operator:</strong>
    <select name="va" class="vaSelect" style="width:100%;">
        <option value="0.<?php echo $row['bookingID'] ?>">No Virtual Airline</option>
        <?php foreach($get->vas() as $row2) 
        { ?>
        <option value="<?php echo $row2['id'] ?>.<?php echo $row['bookingID'] ?>" <?php if($row['va'] == $row2['id']) echo "selected"; ?>><?php echo $row2['name'] ?></option>
        <?php } ?>
    </select>
</div>
<div class="col-lg-4">
    <strong>Departing:</strong> <?php if($row['deparr'] == "0") echo "Sydney"; else echo $get->airport($row['icao'])['name'] /* ?> (Gate <?php echo $get->gate($row['fbnum']) ?>) <?php */ ?><br />
    <strong>Arriving:</strong> <?php if($row['deparr'] == "1") echo "Sydney"; else echo $get->airport($row['icao'])['name'] ?>
    </div>
    <div class="col-lg-3">
    <strong>Aircraft:</strong> <?php echo $get->aircraft($row['aircraft'])['name'] ?><br />
    <strong>ST<?php if($row['deparr'] == 0) echo "D"; else echo "A"; ?>:</strong> <?php echo date('H:i', strtotime($row['time'])); ?> Local/<?php echo date('H:i', strtotime($row['time'])- 60 * 60 * 10); ?> UTC
    </div>
    <div class="col-lg-2">
        <button type="button" class="btn btn-primary" disabled>Go to Dispatch</button>
        <button type="button" class="btn btn-primary" style="margin-top:10px;" disabled>File on VATSIM</button>
        <button type="button" class="btn btn-default removeBooking" id="<?php echo $row['bookingID'] ?>" style="margin-top:10px;">Remove Booking</button>
    </div>

  </div>
</div>
<?php
    }
}
else
{ ?>
<div class="alert alert-danger" role="alert">
  <strong>No flights booked.</strong> It looks like you haven't booked a flight yet. Please <a href="slots.php">book a flight</a> to get started!
</div>
<?php }
 ?>
            
    </div>
</div>
<?php include 'sections/loginBox.php'; ?>


</div>


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript" src="/fancy/jquery.fancybox.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
<script src="js/vendor/holder.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
<script src="js/script.js"></script>
<div id="pilot" style="display:none;"><?php echo $_SESSION['vatsimID']; ?></div>
</body>
</html>