Jump to content

elfrost

Members
  • Posts

    56
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by elfrost

  1. 1 hour ago, ProAvia said:

    Are you using MySQL or MariaDB?

    What version number of MySQL or MariaDB are you using?

     

     

     

    Database server

    Server: Localhost via UNIX socket

    Server type: MariaDB

    Server connection: SSL is not being used 

    Server version: 10.3.24-MariaDB - MariaDB Server

    Protocol version: 10

     

    Web server

    cpsrvd 11.90.0.8

    Database client version: libmysql - 5.6.43

    PHP extension: mysqli curl mbstring

    PHP version: 7.3.6

    phpMyAdmin

    Version information: 4.9.5

     

  2. On 9/6/2020 at 6:24 PM, ProAvia said:

     

    phpVMS version? 

    PHP version?

    MySQL or MariaDB version? 

    Shared or dedicated hosting? 

    VPN?

     

    I'd say that I use same for very long time and suddenly, it stopped.
    I can add manually into mysql but nothing at all from external. (site, admin or acars)

     

    Version simpilot 5.5.2
    PHP 5.5
    shared hosting
    no vpn...

  3. other question

    whats wrong:

    <!--Begin ATC Online -->
    <div class="blueIce-block clearfix">
    <div class="blueIce-blockheader">
    <h3 class="t">ATC Online (YYC-YYZ-YVR)</h3>
    </div>
    <div class="blueIce-blockcontent">
    <?php MainController::Run('Vatsim', 'create_vatsim_data_atc', '!CLIENTS:', 'ATC', array('CZEG', 'TOR', 'CZYZ', 'CYYC', 'CYYZ', 'CYVR', 'CZVR')); ?>
    </div>
    </div>
    <!--End ATC Online -->

    it does not work and that code was working in my old theme.

    cheers

  4. 4 minutes ago, RamiAbouZahra said:

    Looks and sounds awesome! I see what you did there without using the api <_< (I'm not even mad that's impressive).

    This is just a project I did to learn to work with api's and curl in php, but it's pretty cool what you can do!

    pretty cool indeed :)

    Here a code I have written long time ago and I do not use anymore. not sure if it still working
     

    <?php
    
    $options = array(
       'trace' => true,
       'exceptions' => 0,
       'login' => '',
       'password' => ''
    );
    $client = new SoapClient('http://flightxml.flightaware.com/soap/FlightXML2/wsdl', $options);
    
    $params = array(
       'fleet' => 'WJA',
       'howMany' => 15,   
       'offset' => 0,
       'maxDepartureAge' => '3 days',
       'maxFileAge' =>  '5 days'    
    );
    
    $data = array();
    
    
    
    $output = fopen('php://output', 'w');
    
    
    $result = $client->FleetScheduled($params);
    $result1 = $client->RoutesBetweenAirportsEx($params);
    $i = 0;
    $data = array();
        foreach ($result->FleetScheduledResult->scheduled as $flightObj)
    	foreach ($result1->RoutesBetweenAirportsExResult->data as $flightObj) {
    
          $data[] = $flightObj;
          $i++;
    
        
        $origdestarr[]=$flightObj->origin."_".$flightObj->destination;
        
     
        }
       
         
         
    if (is_soap_fault($result)) {
      
       echo 'ERROR: ' . $result->getMessage() . "\n";
       die();
    } 
    
    
    
    
    
      function objectToArray($d) {
        if (is_object($d)) {
          // Gets the properties of the given object
          // with get_object_vars function
          $d = get_object_vars($d);
        }
        
        if (is_array($d)) {
          /*
          * Return array converted to object
          * Using __FUNCTION__ (Magic constant)
          * for recursive call
          */
          return array_map(__FUNCTION__, $d);
        }
        else {
          // Return array
          return $d;
        }
      }
    $my = objectToArray($data);
    function array2csv(array &$array)
    {
       if (count($array) == 0) {
         return null;
       }
       ob_start();
       $df = fopen("php://output", 'w');
       fputcsv($df, array_keys(reset($array)));
       foreach ($array as $row) {
          fputcsv($df, $row);
       }
       fclose($df);
       return ob_get_clean();
    }
    
    
    
    
    
    function download_send_headers($filename) {
        // disable caching
        $now = gmdate("D, d M Y H:i:s");
        header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
        header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
        header("Last-Modified: {$now} GMT");
    
        // force download  
        header("Content-Type: application/force-download");
        header("Content-Type: application/octet-stream");
        header("Content-Type: application/download");
    
        // disposition / encoding on response body
        header("Content-Disposition: attachment;filename={$filename}");
        header("Content-Transfer-Encoding: binary");
    }
    
    date_default_timezone_set("UTC");
    download_send_headers("data_export_WJA_" . date("Y-m-d") . ".csv");
    echo array2csv($my);
    die();
    ?>

     

    • Thanks 1
  5. I'm using something like that.
    I created my own php script and i run it with a cronjob.

    It keeps my schedule databse up to date and I grab data from Flightaware totally free.

    Basically, the scrip go to 

     $ch = curl_init("http://flightaware.com/live/fleet/".$code."?;offset=".($i*40)."&sort=ASC;order=actualdeparturetime");

    $code is defined by whatever you want ( WJA-JBU-AAL-DAL...)

    The script is connected directly with your phpvms database so it updates/upload all datas in there.

    If flight does not exist = it creates
    If flight exist = check for update
    if exist and up to date = do nothing

    and also, if flight do not receive any update for x days, then delete it

    So you understand here that my schedule is always up to date and synchroinized with flightaware :)
     

    I'm pretty proud of it because i'm not a php expert and I'm working on it for one year lol
    I used flightaware API before but I found out a way to get data for free...

    • Like 1
  6. I tried to get it working but now im getting 
    I ve replaced public by public static and some minor thing read above ..


    Fatal error: Using $this when not in object context in /core/modules/vStatsCenter/vStatsCenter.php on line 29

  7. Thank you for your post. 

    I tried out some but did not find yet

    In fact., any possibilities to edit this code below to get flights for the day
    It could detect also the current day

     

    <?php
    //simpilotgroup addon module for phpVMS virtual airline system
    //
    //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-2012, David Clark
    //@license http://creativecommons.org/licenses/by-nc-sa/3.0/
    ?>
    
    <?php $lastreport = PIREPData::GetLastReports(Auth::$userinfo, 1);
    if(!$lastreport) {$location = Auth::$userinfo->hub; }
    else {$location = $lastreport->arricao;} ?>
    
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <h3><?php echo SITE_NAME; ?> Schedule Search</h3><hr />
        <form class="form-horizontal" role="form" method="post" action="<?php echo url('/schedulesearch');?>">
        <div class="form-group">
            <label for="depicao" class="col-lg-3 control-label">Departure Airfield</label>
            <div class="col-lg-9">
                <select class="form-control" name="depicao" id="depicao">
    <?php if(Auth::LoggedIn()) {echo '<option value="'.$location.'">Your Current Location</option>';}?>
    		<option value="">All</option>
                    <?php
                        foreach ($airports as $airport)
                            {echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>';}
                    ?>
                </select>
            </div>
        </div>
        
        <div class="form-group">
            <label for="arricao" class="col-lg-3 control-label">Arrival Airfield</label>
            <div class="col-lg-9">
                <select class="form-control" name="arricao" id="arricao">
    		<option value="">All</option>
                    <?php
                        foreach ($airports as $airport)
                            {echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>';}
                    ?>
                </select>
            </div>
        </div>
        
        <div class="form-group">
            <label for="aircraft" class="col-lg-3 control-label">Aircraft Type</label>
            <div class="col-lg-9">
                <select class="form-control" name="aircraft" id="aircraft">
    		<option value="">All</option>
                    <?php
                        foreach ($aircrafts as $aircraft)
                            {echo '<option value="'.$aircraft->icao.'">'.$aircraft->icao.'</option>';}
                    ?>
                </select>
            </div>
        </div>
        
        <div class="form-group">
            <label for="airline" class="col-lg-3 control-label">Airline</label>
            <div class="col-lg-9">
                <select class="form-control" name="airline" id="airline">
    		<option value="">All</option>
                    <?php
                        foreach ($airlines as $airline)
                            {echo '<option value="'.$airline->code.'">'.$airline->name.'</option>';}
                    ?>
                </select>
            </div>
        </div>
    
          <div class="form-group">
            <label for="arricao" class="col-lg-3 control-label">Search By Day</label>
            <div class="col-lg-9">
               <select class="search" name="daysofweek">
                       <option value="">All days</option>
                       <?php
                           foreach ($daysofweek as $days)
                               {echo '<option value="'.$days->name.'">'.$days->name.'</option>';}
                       ?>
                   </select>
            </div>
        </div>
    
        <div class="form-group">
            <label for="sortby" class="col-lg-3 control-label">Sort Results By</label>
            <div class="col-lg-9">
                <select class="form-control" name="sortby" id="sortby">
    		<option value="">None</option>
                    <option value="s.deptime">Departure Time</option>
                    <option value="s.flighttime">Flight Duration</option>
                </select>
            </div>
        </div>
        
        
        <div class="form-group">
            <label for="sortby" class="col-lg-3 control-label">&nbsp;</label>
            <div class="col-lg-9">
                <div class="radio">
                    <label>
    
                        <input type="radio" name="sortdir" id="optionsRadios1" value="ASC" checked>
                        Ascending
                    </label>
                </div>
                <div class="radio">
                    <label>
                        <input type="radio" name="sortdir" id="optionsRadios2" value="DESC">
                        Descending
                    </label>
                </div>
            </div>
        </div>
        
        
        
            <input type="hidden" name="action" value="findflight" />
            <input class="btn btn-primary btn-block"type="submit" name="submit" value="Search Schedules" />
    </form>
    </div>
    </div>
    

     

  8. Hello,

    Is anyone of you guys use custom Schedule Searh Form like Today's Flight?

    I would like to get :

    Form using : From current location (can be changed)
    the result should be all flights available from current location today.
    results with details like: From, To, Aircraft, Dep time ... and Bid on

    I'm starting to work on now but asking for help :)

     


     

×
×
  • Create New...