Jump to content

Taran

Members
  • Posts

    204
  • Joined

  • Last visited

Posts posted by Taran

  1. Taran, you can modify the SQL for the TotalHours function to create another to specify a date range:

    public static function TotalHoursBetweenDates($icao, $startdate, $enddate) { //Count total hours
    $query = "SELECT SUM(flighttime) as hours FROM ".TABLE_PREFIX."pireps WHERE depicao = '".$icao."' OR arricao = '".$icao."' AND '".$startdate."' < submitdate < '".$enddate."'";
    $result = DB::get_row($query);
    return $result->hours;
    }
    

    (Not tested)

    I figured out to put that in HubStats.class.php but what is the exact code to pull that data on my website?

  2. No sir, it is real world money. Now, we don't pay per hour :P It's bi-annually. It won't help you make a living, but it'll help toward your next big addon to your FS experience :D I'm paying this out of pocket. It costs nothing to join of course. I'm still debating on what I'm paying though. possibly going to be $25-$50 to each of our paid staff members. It's just a way for me to say thank you for all the hard work our staff puts into the airline.

    • Like 1
  3. We operate with five hubs all around the world, which means that one should have the opportunity to fly whereever they want - whenever they want. Our opening date will be December 28th. However, we are open to pre-hire pilots and they may start flying NOW! Please check our website:

    http://www.victorvirtual.org and apply now!

    - Paid staff

    - Custom VVACARS

    - Custom site

    - Friendly personnel

    - Discounts on payware products just for being a pilot!

    - Giveaways to pilots who win our competitions (pilot of the month, screenshot contest, etc.)

    - MUCH MORE!

    1527086_786430078040230_840063379_n.jpg

  4. Does anybody know a way for me to get the stats for a certain region?

    We're wanting to run our airline by Regions instead of HUBS (our Regions would obviously consist of a large part of a continent).

    Is there a way for us to get the stats for different regions (like you can do with HUBs)?

    Maybe a code to get the stats for multiple airports and have them all add together?

    Please help!

    Thanks in advance,

    Taran

    • Like 2
  5. Add this to TouchdownstatsData ->

    public function pilot_stats($pilotid) {
    $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps`
    WHERE landingrate < '0'
    AND pilotid = '$pilotid'
    ORDER BY landingrate DESC";
    
    return DB::get_results($query);
    }
    
    public function pilot_average($pilotid) {
    $stats = self::pilot_stats($pilotid);
    $total = 0;
    $count = 0;
    
    foreach ($stats as $stat)
    {
    $total = $total + $stat->landingrate;
    $count++;
    }
    $average = $total / $count;
    
    return $average;
    }
    
    public function airline_average() {
    $stats = self::get_all_stats();
    $total = 0;
    $count = 0;
    
    foreach ($stats as $stat)
    {
    $total = $total + $stat->landingrate;
    $count++;
    }
    $average = $total / $count;
    
    return $average;
    }
    
    

    Then where you want to show a pilots average do ->

    <?php echo 'Pilot average landing rate '.TouchdownStatsData::pilot_average('pilot#'); ?>

    and replace pilot# with the database id for the pilot you want to show the stat for - ie in pilot_public_profile it would be $userinfo->pilotid

    or for the VA's average ->

    <?php echo 'VA average landing rate '.TouchdownStatsData::airline_average(); ?>

    I did all this but how would I get the data to show the pilot's avg rate in their crew center? I want it to automatically get the pilot id.

  6. Okay, here's what's in the attached file... (All stats are per pilot!)

    • Average Landing Rate
    • Average Hours
    • Average Miles
    • Total Hours
    • Total Flights
    • Total Miles
    • Total Passengers
    • Table with Greased Landings
    • Table with Top Flight Hours
    • Table with Top Flight Time with Year

    I'll add more in the file later, maybe release a new module.

    Enjoy the good stuff! B)

    I can't seem to get this to work. Could you past the EXACT code that i should put into this to get it to list the data in the red part? (The red is what i got from your code). I put that the file in: core/templates/custom_stats.tpl

    <td valign="top" width="20%" align="left"><strong>Pax Carried:</strong></td>

    <td valign="top" width="30%" align="left"><?php echo getTotalPassengersPilot();?></td>

    <td valign="top" width="20%" align="left"><strong>Pax Carried:</strong></td>
    <td valign="top" width="30%" align="left"><?php echo getTotalPassengersPilot();?></td>
    

  7. Is there a way to add a roll call option in the admin side of this module?

    Basically, instead of pilot rankings for events going up once they sign up for it, the staff will tell the system who was at the event based upon who signed up and who showed up and that will then add to their event ranking?

×
×
  • Create New...