Jump to content

freshJet

Members
  • Posts

    1470
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by freshJet

  1. Ok, it appears that it's not calculating correctly at all by month. It just reduced the numbers but I can't tell exactly what it's calculating. At the start of February UTC time it should have reset to 0 for all, but did not. Any ideas?

    Try clearing your cache.

  2. I am trying to return the total distance of a route, rather than the great circle distance. I have a complicated method, but I'm not convinced with the result:

    function getFPDistance(){
    
    $schedule = SchedulesData::getScheduleDetailed($_GET['plan']);
    $params->deplat = $schedule->deplat;
    $params->deplng = $schedule->deplng;
    $params->arrlat = $schedule->arrlat;
    $params->arrlng = $schedule->arrlng;
    $params->route = $_POST['route'];
    $routedata = NavData::parseRoute($params);
    $depairport = OperationsData::getAirportInfo($schedule->depicao);
    $arrairport = OperationsData::getAirportInfo($schedule->arricao);
    $end = (count($routedata) - 1);
    
    $total = 0;
    $a = -1;
    $b = 0;
    
    # Put lat/lng of each waypoint into array
    $lat = array();
    $lng = array();
    
    foreach($routedata as $wp){
    $lat[] = $wp->lat;
    $lng[] = $wp->lng;
    }
    
    # Calculate the distance between each waypoint in the array
    for($i=0; $i<$end; $i++){
    
    $a++;
    $b++;
    
    $dist1 = distance($lat[$a], $lng[$a], $arrairport->lat, $arrairport->lng);
    $dist2 = distance($lat[$b], $lng[$b], $arrairport->lat, $arrairport->lng);
    $dist = $dist1 - $dist2;
    
    $total = $total + $dist;
    }
    
    # Get the distance between the departure airport and the first waypoint
    $dep_to_first = distance($depairport->lat, $depairport->lng, $lat[0], $lng[0]);
    
    # Get the distance between the last waypoint and arrival airport
    $last_to_arr = distance($lat[$end], $lng[$end], $arrairport->lat, $arrairport->lng);
    
    # Add these to the total
    $total = $total + $dep_to_first + $last_to_arr;
    
    return round($total);
    }

    For EGCC-GCTS, this returns 1650nm, with GC distance being 1648nm, route shown below.

    NOKIN UN862 LAMAT UN90 NOTRO UM30 SALCO UN864 MONTO UN857 TERTO

    Any ideas?

  3. I hate to ask for more, but is there a way to get the data from only ACCEPTED PIREPs and have it ignore the data from rejected PIREPs? right now we have completely delete the rejected pireps for the data to stay correct.

    public static function TotalCargoBetweenDates($icao, $startdate, $enddate) { //Count total cargo
    $query = "SELECT SUM(cargo) as cargo FROM phpvms_pireps WHERE depicao = '$icao' OR arricao = '$icao' AND flighttype = 'C' AND DATE(submitdate) >= '$startdate' AND DATE(submitdate) <= '$enddate' AND accepted = '1'";
    $result = DB::get_row($query);
    return $result->cargo;
    }

  4. You can also use the built in function

    StatsData::TopRoutes($airline_code)
    

    which also will cache the data for a couple of hours (on release versions of phpVMS) to lighten the load on the system.

    I looked at the default, mine is better as the default only shows the top routes based on the timesflown in the schedules. When you overwrite your schedules, these are reset to zero. With mine, it counts the routes manually from the PIREPs.

  5. public static function TotalCargoBetweenDates($icao, $startdate, $enddate) { //Count total cargo
    $query = "SELECT SUM(cargo) as cargo FROM phpvms_pireps WHERE depicao = '$icao' OR arricao = '$icao' AND flighttype = 'C' AND DATE(submitdate) >= '$startdate' AND DATE(submitdate) <= '$enddate'";
    $result = DB::get_row($query);
    return $result->cargo;
    }

  6. Oops, it was something very minor ^_^

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

  7. Your carousel seems to be much taller than the content.

    Also what's with the modal it's really annoying. If I wasn't trying to give feedback I would've just left as soon as that popped up.

    I like where the design is going (esp compared to your previous designs) but there seems to be a strange mix of flat and shadows/gradients...

    Can't see what you mean about the carousel though? Can I see a screenshot?

    There is only one gradient, and shadows are limited to where they're necessary - even then they're very faint.

    And I did contemplate the use of the modal on the homepage, I'll just get rid of it.

×
×
  • Create New...