Jump to content

mattsmith

Members
  • Posts

    373
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by mattsmith

  1. I am still getting the "oops something went wrong" on my live map after add the api code.

     

     

    <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
    <?php
    /**
     *     STOP! HAMMER TIME!
     *
     * ====> READ THIS !!!!!
     *
     * I really really, REALLY suggest you don't edit this file.
     * Why? This is the "main header" file where I put changes for updates.
     * And you don't want to have to manually go through and figure those out.
     *
     * That equals headache for you, and headache for me to figure out what went wrong.
     *
     * BUT BUT WAIT, you say... I want to include more javascript, css, etc...!
     * Well - in your skin's header.tpl file, this file is included as:
     *
     * Template::Show('core_htmlhead.tpl');
     *
     * Just add your stuff under that line there. That way, it's in the proper
     * spot, and this file stays intact for the system (and me) to be able to
     * make clean updates whenever needed. Less bugs = happy users (and happy me)
     *
     * THANKS!
     */
    ?>
    <script type="text/javascript">
    var baseurl = "<?php echo SITE_URL;?>";
    </script>

    <link rel="stylesheet" media="all" type="text/css" href="<?php echo fileurl('lib/css/phpvms.css')?>" />
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::Get('PAGE_ENCODING');?>" />

    <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBorb_ELH8kXiXxDGpfbz1dgyQk5Gmo7NE&callback=initMap"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script type="text/javascript" src="<?php echo fileurl('lib/js/jquery.form.js');?>"></script>
    <script type="text/javascript" src="<?php echo fileurl('lib/js/phpvms.js');?>"></script>

    <?php
    echo $MODULE_HEAD_INC;

  2. Im just learning coding so i haven,t got any yet I've just been using this and changing things in core/modules/ACARS

     

    $allflights = array();
    $myairline = ACARSData::GetACARSData();
    // If you have multiple airlines, you could also loop this through
    $another_airline = json_decode(file_get_contents('va_url_here'), true); // specify true for an array conversion
    $allflights = array_merge($myairline, $another_airline);
    
    foreach($allflights as $flight) {
    ...

     

  3. On 02/01/2017 at 10:24 PM, web541 said:

    Well first you'd have to ask the airline's if they're ok with it, then you can proceed.

    Second, the ACARS function that outputs the data is found here https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/modules/ACARS/ACARS.php#L52

    And luckily that returns an array of data which is easy to merge.

    I haven't tested it and have probably forgotten something, but you can build on something like this

    
    $allflights = array();
    $myairline = ACARSData::GetACARSData();
    // If you have multiple airlines, you could also loop this through
    $another_airline = json_decode(file_get_contents('va_url_here'), true); // specify true for an array conversion
    $allflights = array_merge($myairline, $another_airline);
    
    foreach($allflights as $flight) {
    ...

    You'd also have to verify what data is actually being returned to make it all fit together.

    Can't get it to work, any idea?

  4. <?php
    //simpilotgroup addon module for phpVMS virtual airline system
    //
    //simpilotgroup addon modules are licenced under the following license:
    //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
    //To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/
    //
    //@author David Clark (simpilot)
    //@copyright Copyright (c) 2009-2010, David Clark
    //@license http://creativecommons.org/licenses/by-nc-sa/3.0/
    
    $offset = 0;
    $total = 1;
    $page = 1;
    while($offset < $numschedules) {
        ?>
    <center>
        <h3><?php echo SITE_NAME; ?> Timetable</h3>
    </center>
    <table width="100%" frame="box">
        <tr align="center">
            <?php
                $count = 1;
                while($count <= 4) {
            ?>
    
            <td width="25%" valign="top">
                <table width="100%">
                    <tr bgcolor="#cccccc">
    
                        <td>Arr</td>
                        <td>Flight</td>
                        <td>Type</td>
                        <td width="30%">Freq</td>
                        <td>Time</td>
                    </tr>
            <?php
                $schedules = TimetableData::get_schedules($offset);
                            foreach($schedules as $schedule) {
                                if($departure <> $schedule->depicao) {
                                    $field = OperationsData::getAirportInfo($schedule->depicao);
                                    echo '<tr>';
                                    echo '<td bgcolor="#cccccc" colspan="5"><b>'.$schedule->depicao.' - '.$field->name.'</b></td>';
                                    echo '</tr>';
                                }
                                $departure = $schedule->depicao;
                                echo '<tr>';
                                echo '<td>'.$schedule->arricao.'</td>';
                                echo '<td>'.$schedule->flightnum.'</td>';
                                $aircraft = OperationsData::getAircraftInfo($schedule->aircraft);
                                echo '<td>'.$aircraft->icao.'</td>';
                                echo '<td>'.Util::GetDaysCompact($schedule->daysofweek).'</td>';
                                echo '<td>'.$schedule->deptime.'</td>';
                                echo '</tr>';
                                $total++;
                            }
                            $offset = $offset + 30;
             ?>
                </table>
            </td>
            <?php
                $count++;
                    if($offset >= $numschedules) {
                        while($count <= 4) {
                            echo '<td width="25%" valign="top">
                                        <table width="100%">
                                        <tr bgcolor="#cccccc">
                                            <td>Arr</td>
                                            <td>Flight</td>
                                            <td>Type</td>
                                            <td width="30%">Freq</td>
                                            <td>Dur</td>
                                        </tr>
                                        </table>';
                            $count++;
                        }
                    }
                }
            ?>
        </tr>
    </table>
    <center>
        <br />
        <h5>Page <?php echo $page;
                $page++; ?></h5>
    </center>
    <hr />
    <br />
        <?php
    }
            ?>
    Total Flights: <?php echo $total; ?>
    <br /><br />

     

×
×
  • Create New...