Jump to content

freshJet

Members
  • Posts

    1470
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by freshJet

  1. A lot of the items on my VA's site have stopped working, I have put the newest jquery up, but it doesn't seem to read that it is there. Does anyone know why it would stop using jquery or jquery only being selective on what it allows to work, as the acars map works fine.

    You probably have links to more than one version, because phpVMS has a link to it in the core_htmlhead.tpl. Because it's such an old version, maybe it's no longer hosted?

    I've noticed no issues with multiple versions, other than it annoys me.

  2. function countAircraftByICAO($icao){
    $sql = "SELECT COUNT(id) AS count FROM phpvms_aircraft WHERE icao='$icao' AND enabled='1'";
    $result = DB::get_row($sql);
    return $result->count;
    }
    

    You can put that in OperationsData.class.php. That will get the count. If you want to display any fields then use this:

    function getAircraftByICAO($icao){
    $sql = "SELECT * FROM phpvms_aircraft WHERE icao='$icao' AND enabled='1'";
    return DB::get_results($sql);
    }
    

    Example usage:

    <?php
    $icao = 'A320';
    $count = countAircraftByICAO($icao);
    $aircraft = getAircraftByICAO($icao);
    
    echo "There are $count aircraft <br/>";
    
    foreach($aircraft as $item){
    echo $item->registration.'<br />';
    }
    ?>
    

    • Like 1
  3. Just use

    round($schedule->distance)

    -

    As for universally, the decimal places make it more accurate, so I would leave it but if you really want, go to admin/modules/Import/Import.php and go to line 185:

    if($distance == 0 || $distance == '')
    {
    $distance = OperationsData::getAirportDistance($depicao, $arricao);
    }
    

    Change it to:

    if($distance == 0 || $distance == '')
    {
    $distance = OperationsData::getAirportDistance($depicao, $arricao);
    $distance = round($distance);
    }
    

    And in core/common/SchedulesData.class.php, after line 429, add:

    $data['distance'] = round($data['distance']);
    

  4. Going back to this because I forgot to share my solution. Although you said you were happy with that one, it's not ideal further down the line because if you for some reason need to load all your schedules it will only show 500. So, take out the $count = '500'.

    Instead, phpVMS has a few things included by default to accomodate the thing you wanted.

    In core/modules/Schedules/Schedules.php, you'll see around line 169 and 170 it says:

    # Show the routes. Remote this to not show them.
    $this->set('allroutes', SchedulesData::GetSchedules());

    Do what it says and remote the $this->set ... part:

    # Show the routes. Remote this to not show them.
    # $this->set('allroutes', SchedulesData::GetSchedules());

    That will hide the routes when you first load the schedules page, leaving only the form. It's as simple as adding '#'.

    After that, I recommend you use pagination like you mentioned in the first post, because loading all flights from major hubs like KPHX and KPHL might take a while.

  5. Export function now functional, so basic function of the module is working nicely. After that, a couple of things need added, as well as some minor tweaks before I implement it into my admin panel to test it that way (currently doing it externally at the moment). Final task will be to add the publish option, i.e upload the data directly to the phpvms_schedules table.

    At this time, I am still looking at this realistically being payware, but no more than £10 (about $15 or 16€ at current rates).

    Looking at an early March release :)

  6. Sorry, wrote that in a hurry last night. Correct function is:

    <?php $bids = SchedulesData::getBids($userinfo->pilotid); ?>

    If you're having CSS issues then it won't be related to that, although the original code I gave you should have thrown a PHP error because getPilotBids() does not exist.

×
×
  • Create New...