Jump to content

Nuclear

Members
  • Posts

    48
  • Joined

  • Last visited

Posts posted by Nuclear

  1. Try passing the airline: StatsData::TotalPaxCarried('MER')

    That's how I tested it, see if it makes a difference. According to the documentation, passing the airline is optional, so I assume by not passing anything it returns the total for all airlines (which should be the same value if you only have one airline), but either I'm wrong or there's a bug in the method.

  2. This was just an example. I don't know what your existing code is, so I can't tell you exactly what you need to do, but once you get $dist, you need to 'echo' the value where you want it.

    Using the above example:

    </php $flightinfo=SchedulesData::findFlight($flightno);
    $dist=$flightinfo->distance;
    echo 'Distance: '.$dist;?>
    

    • Like 1
  3. By flight number: SchedulesData::findFlight($flightnum)

    By flight id: SchedulesData::getSchedule($flightid)

    Example:

    $flightinfo=SchedulesData::findFlight($flightno);
    $dist=$flightinfo->distance;
    

  4. I just tested it and it returned a reasonable value for me (2945 pax for 38 flights). Can you post the actual code you're using?

    As for the total cargo, I don't see any built-in methods for that. You'd have to write an SQL query to sum the 'load' field for all filed PIREPs.

    • Like 1
  5. Well, one way to do it would be this:

    Make a copy of the frontpage_main.tpl from /core/templates/

    Edit the new copy and replace this:

    <?php MainController::Run('Pilots', 'RecentFrontPage', 5); ?>

    With this:

    <?php
    $query='SELECT * FROM phpvms_pilots ORDER BY joindate DESC LIMIT 5';
    $pilots=DB::get_results($query);
    foreach($pilots as $pilot)
    {
    	echo '<a href='.SITE_URL.'/index.php/profile/view/'.$pilot->pilotid.'>';
    	echo PilotData::getPilotCode($pilot->code,$pilot->pilotid).' '.$pilot->firstname.' '.$pilot->lastname.'</a><br><br>';
    }?>
    

    Now place the edited file into your skins directory (/lib/skins/crystal/ if you're using the default crystal skin).

    That will show the 5 most recent pilots sorted by date starting with the most recent.

  6. How are you currently getting the recent pilots? The default template retrieves the records by descending pilotid. Since pilotid is an auto-increment field, it should return the latest pilots. You certainly can list them by date, but I'd have to see how you're retrieving the records first.

  7. To delete an airport, you need to delete it directly from the database - there is no option in the Admin section. After you delete it from the database, you'll probably need to clear the cache from the Admin panel also.

    Note: I'm not sure what this might do to any existing PIREPS to or from a deleted airport. I've deleted airports before, but there had not been any PIREPS filed for these airports.

  8. I've never used this before and the documentation doesn't really explain it, but I screwed around with it and found out this:

    StatsData::PilotAircraftFlownCounts returns an array of aircraft,counts and hours for the given PilotID (I don't know what else it returns).

    So, you'll need to loop through the array and echo the results, something like this:

    $stats=StatsData::PilotAircraftFlownCounts($pilotid);
    foreach($stats as $stat)
    {
    echo $stat->aircraft.' '.$stat->count.' '.$stat->hours.'<br>';
    }
    

    Obviously, you want to put the data in your table, but this is an example.

  9. The { and } (curly brackets) are used to contain statement blocks. You don't need to put one after every statement. They are used for blocks of statements which are grouped together. For example:

    if ($x==1)
    {
     statement 1;
     statement 2;
     statement 3;
    }
    statement 4;
    

    In this example, if $x=1, then statements 1-3 will be executed, otherwise it will skip that block and continue with statement 4.

  10. Midway Virtual Airlines is based on the real-world Midway Airlines. There were actually two Midway Airlines, both now defunct. The original Midway operated from 1976-1991 and was based out of Chicago Midway Airport. The second airline, based out of Raleigh-Durham Airport, was in operation from 1993-2003.

    Currently, Midway Virtual uses routes from the original Midway Airlines, although we use aircraft from both airlines. Routes vary from extreme short-hops to trans-continental and everything in between. Our ACARS application allows pilots to automatically record their flights and send a PIREP directly to our system. Although not required, we encourage pilots to fly online on VATSIM. If you've never flown on VATSIM, we are more than happy to get you started.

    Midway Virtual also incorporates a financial model: flights incur expenses and generate revenue, and hopefully pilots and the company make a profit.

    We are very newbie-friendly and are more than willing to help anyone out new to virtual airlines or VATSIM.

    Check us out at: http://www.mdwva.org

    mdwlogo.jpg

  11. If anyone is interested, I've managed to compile a current Navdata file ready for import to your database. NOTE: although it contains all navaids and waypoints, it does not have any airway information, therefore phpVMS will not expand any airways in the route (tbh, I'm not sure if it does this anyway).

    Since the files are too large to attach, they are available here:

    Gzipped CVS file

    Gzipped SQL file

    It would probably be a good idea to back up your database first - I assume no resposibility for loss off data :)

×
×
  • Create New...