dispatch.php 8.7 KB
<?php
session_start();
require_once 'classes/realops.php';
$get = new Get();
$stats = new Stats();
$flight = $get->extendedBooking($_GET['booking']);
$dispatch = new Dispatch();
date_default_timezone_set('Australia/Sydney');
?>
    <!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"><?php echo $flight['airline'] . $flight['flightnum'] ?> Flight Dispatch</h2>
                <div class="alert alert-info" role="alert">
                    <strong>Some routes not available for international flights.</strong> We apologise for any inconvenience. Real world flown routes into Sydney <a href="http://flightaware.com/statistics/ifr-route/" target="_blank">can be found here</a>.
                </div>
                <div class="alert alert-info" role="alert">
                    <strong>Some load data may be missing.</strong> Please double check your loadsheet. If it appears incomplete, please use an alternate fuel planning service as aicraft data is limited.
                </div>
                <div class="row">

    <div class="well" style="min-height:190px">
        <div class="col-md-6">
            <img src="logos/<?php echo $flight['airline'] ?>.png" /> <br />
            <span style="font-size:24px;"><?php echo $flight['airline']; // echo $get->airline($flight['airline']) ?> flight <?php echo $flight['flightnum']; ?></span><br />
            <strong style="font-size:22px;">Slot Time: <?php echo $flight['time'] ?> Local</strong><br />
            <span style="font-size:17px;">
                <?php if($flight['deparr'] == 0) echo "Sydney - " . $get->airport($flight['icao'])['name']; else echo $get->airport($flight['icao'])['name'] . "-Sydney"; ?><br />
                <?php if($flight['deparr'] == 0) echo "YSSY-" . $flight['icao']; else echo $flight['icao'] . "-YSSY"; ?>
            </span>
        </div>
        <div class="col-md-6">
            Recorded Block Out: <?php if(empty($flight['blockOut']))
                echo "----Z";
            else echo $flight['blockOut'] . "Z"; ?><br />
            Recorded Block Off:
                <?php if(empty($flight['blockOff']))
                    echo "----Z";
                else echo $flight['blockOff'] . "Z"; ?><br />
            Recorded Block On:
            <?php if(empty($flight['blockOn']))
                echo "----Z";
            else echo $flight['blockOn'] . "Z"; ?><br />
            Recorded Block In:
            <?php if(empty($flight['blockIn']))
                echo "----Z";
            else echo $flight['blockIn'] . "Z"; ?>
        </div>
</div>
                </div>
<div class="row">
<div class="col-md-6">
        <div class="well">
            <h4>ATS Plan:</h4>
            <div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
                <?php
                if($flight['deparr'] == 0)
                {
                    $depairport = "YSSY";
                    $arrairport = $flight['icao'];
                }
                else
                {
                    $depairport = $flight['icao'];
                    $arrairport = "YSSY";
                }
                $route = $dispatch->getRoute($flight['aircraft'], $depairport, $arrairport);
                $remarks = $dispatch->getRemarks($flight['airline'], $flight['va']['name'], $_GET['registration'], $flight['aircraft'], $_GET['selcal']);
                echo "(FPL-" . $flight['airline'] . $flight['flightnum'] . "-IS <br />
            -" . $flight['aircraft'] . "/" . $dispatch->getWeightCategory($flight['aircraft']) . "-SDE3FGHIRWYZ/LB1 <br />
            -" . $depairport . date('Hi', strtotime($flight['time']) - 60 * 60 * 10) . " <br />
            -" . $route . " <br />
            -" . $arrairport . "0" . $flight['flightTime'] . " <br />
            -" . $remarks . ") ";

                ?>
            </div>
        </div>
        </div>
    <div class="col-md-6">
        <div class="well">
            <h4>Fuel Data:</h4>
            <div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
                <?php
                $load = $get->load($flight['aircraft'], $depairport, $arrairport); ?>
                <?php echo $flight['airline'] . $flight['flightnum'] . " " ."LOADSHEET (PREPARED FOR " . strtoupper($_SESSION['firstName']) . " " . strtoupper($_SESSION['lastName']) . ")"; ?>
                <br />ALL WEIGHTS IN KILOGRAMS (KG)
                <br />
                AS CALCULATED FOR: <?php echo strtoupper($load->aircraft); ?><br /><br />
                -----------------------<br />
                <table style="width:100%;">
                    <thead>
                    <tr>
                        <th></th>
                        <th>WEIGHT</th>
                        <th>ENDURANCE</th>
                    </tr>
                    </thead>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>FLIGHT FUEL:</td>
                        <td><?php echo $load->estimatedFuelUsage; ?></td>
                        <td><?php echo str_replace(".", ":", $load->flightFuel); ?></td>
                    </tr>
                    <tr>
                        <td>RESERVE FUEL:</td>
                        <td><?php echo $load->reserveFuel; ?></td>
                        <td><?php echo $load->reserveTime; ?></td>
                    </tr>
                    <tr>
                        <td>RELEASE FUEL:</td>
                        <td><?php echo $load->takeOffFuel; ?></td>
                        <td><?php echo $load->totalEndurance; ?></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>OPERATING EMPTY WEIGHT:</td>
                        <td><?php echo $load->operatingEmptyWeight; ?></td>
                    </tr>
                    <tr>
                        <td>ZERO FUEL WEIGHT:</td>
                        <td><?php echo $load->zeroFuelWeight; ?></td>
                    </tr>
                    <tr>
                        <td>TAKEOFF WEIGHT:</td>
                        <td><?php echo $load->takeOffWeight; ?></td>
                    </tr>
                    <tr>
                        <td>LANDING WEIGHT:</td>
                        <td><?php echo $load->landingWeight; ?></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <div class="well">
                <h4>Weather Data:</h4>
                <strong>Sydney (YSSY) Metar:</strong>
                <div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
                    <?php echo $get->metar("YSSY"); ?>
                </div>
                <strong><?php echo $get->airport($flight['icao'])['name']; ?> (<?php echo $flight['icao'] ?>) Metar:</strong>
                <div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
                    <?php echo $get->metar($flight['icao']); ?>
                </div>
            </div>
            </div>
        <div class="col-md-6">
            <div class="well">
                <h4>Dispatch Options:</h4><br />
                <?php $flight['time'] = date('Hi', strtotime($flight['time'])- 60 * 60 * 10); ?>
                 <a class="btn-primary btn-lg" target="_blank" href="http://www.vatsim.net/fp/index.php?2=<?php echo $flight['airline'] . $flight['flightnum']; ?>&3=<?php echo $flight['aircraft']; ?>/L&5=<?php echo $depairport ?>&6=<?php echo $flight['time'] ?>&9=<?php echo $arrairport ?>&8=<?php echo str_replace(" ", "+", $route); ?>&10a=<?php echo substr($flight['flightTime'], 0, 1); ?>&10b=<?php echo substr($flight['flightTime'], 1, 3); ?>&voice=/V/&11=<?php echo $remarks; ?>&12a=<?php echo substr($load->totalEndurance, 0, 2); ?>&12b=<?php echo substr($load->totalEndurance, 3, 4); ?>&14=<?php echo $_SESSION['firstName']. "+" . $_SESSION['lastName']; ?>">File on VATSIM</a>
            <br />
            </div>
        </div>
    </div>
    </div>

</div>

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

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