Jump to content

freshJet

Members
  • Posts

    1470
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by freshJet

  1. freshJet

    HubStats Class

    Try clearing your cache.
  2. That would also have worked actually. Thanks again.
  3. Yeah, that's what I was trying to do. It seemed logical at the time Your version returns 1100nm. EDIT: Fixed, thanks. I changed: for($i=1; $i<$end; $i++){ to: for($i=1; $i<=$end; $i++){
  4. 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?
  5. AFAIK the charter flight option in kACARS does not depend on the flighttype in the schedules. The flighttype can be P or H, but the pilot can still select charter flight in kACARS. Ensure that the passenger count exists, as the charter option allows the user to enter the passenger count manually.
  6. Takes far too long to load.
  7. Woops, that's a very embarrassing mistake
  8. freshJet

    HubStats Class

    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; }
  9. 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.
  10. Refreshed admin panel to go with the new site. Still a few touch ups needed here and there.
  11. Those are unrelated to the skin, the skin is how the site looks. Modules usually come with installation instructions. Simpilot always provides detailed installation guides.
  12. freshJet

    CAVacars

    As does kACARS.
  13. freshJet

    HubStats Class

    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; }
  14. Oh, I didn't realise there was a default function
  15. freshJet

    HubStats Class

    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; }
  16. You can either place it in PilotStats.class.php or in your own class file. Call it by doing: echo PilotStats::topRoutes();
  17. Cheers guys Some pics of pilot features: Stats page is still WIP
  18. I don't know what you mean? Yeah that's just while I get it fixed
  19. Well, it doesn't like webkit anyway...
  20. Cheers, try it now. Thinking back, it did look like that originally but I cleaned it up using CSS. EDIT: That didn't work, lineheight is the only property relating to height. I've just noticed it's cutting off the bottom of the image in Chrome.
  21. That is odd, looks fine from my end. What browser are you using? Everything looked OK in Chrome when I tested it.
  22. Yeah, wondered that too.
  23. 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.
  24. It's been a long time and a lot of work. I'm all coded out, but here's my new site www.freshjetvirtual.com
  25. It's been a long time and a lot of work. I'm all coded out, but here's my new site www.freshjetvirtual.com
      • 2
      • Like
×
×
  • Create New...