Jump to content

freshJet

Members
  • Posts

    1470
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by freshJet

  1. freshJet

    HubStats Class

    The SQL DATE function is needed. 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; } That should be it now
  2. So they should invest in a skin then? It doesn't even need to be custom, as long as it's not the default.
  3. Why the hell are you running a VA then?
  4. freshJet

    HubStats Class

    ICAO is a string, it should be: <?php echo HubStats::TotalHoursBetweenDates('CYQH', date("Y-m-01"), date("Y-m-t"));?>
  5. Didn't look at your destinations, but in the real world, the smallest of those are served by aircraft like the Dash 8-100.
  6. This was originally a cry for help, but here's a nifty piece of code for you all to use. It shows the top five most frequent flights flown bu the airline. public function topRoutes(){ $query = "SELECT depicao, arricao, COUNT(*) AS count FROM phpvms_pireps GROUP BY depicao, arricao ORDER BY count DESC LIMIT 5"; $results = DB::get_results($query); return $results; } You can then return the depicao, arricao and count.
  7. Place this after the foreach($allpilots as $pilot) line: $bids = SchedulesData::getBids($pilot->pilotid); And then, where you want them displayed: foreach($bids as $bid){ echo $bid->depicao.' - '.$bid->arricao.'<br />'; }
  8. Not too keen on the name, but it's a nice concept! Livery looks very similar to Nordwind Airlines.
  9. freshJet

    HubStats Class

    From my PM to Taran, for those interested: Using manual dates: $start = strtotime("2014-1-1"); $end= strtotime("2014-2-1"); If you are doing these dynamically, you need to use: $start = date("Y-m-01"); $end = date("Y-m-t");
  10. Could you please? Can anyone verify all is OK with it too?
  11. freshJet

    HubStats Class

    <?php echo HubStats::TotalHoursBetweenDates($icao, $startdate, $enddate);?> Make sure you have values for the three parameters...
  12. <?php echo Auth::$userinfo>hub;?>
  13. Using the bids page as an example, how can success/error messages be displayed at the top of the page? For example, if a bid is removed, show the success message at the top of the page. Currently, mine redirects to a new page just to show the message so you then have to go back to view them again. I think this is a default function but I did some modifications a while back.
  14. 1. I don't have this module, so I can only guess the module's code. In the module's class file (core/common): $weekago = strftime("d/m/Y", date() - 60*60*24*7); An then, in the SQL code that retrieves the PIREPs, add this: AND submitdate > '$weekago' 2. Here's an example for the most flights per pilot for this month. Variables might not be correct in the table I'm afraid, I'm doing this quickly. <table> <?php $month = date('m'); $year = date('Y'); $mostflights = TopPilot::top_pilot_flights($month, $year, 5); foreach($mostflights as $flight){ <tr> <td><?php echo $flight->pilotid;?></td> <td><?php echo $flight->flights;?></td> </tr> } ?> </table> Both untested, give it a go.
  15. Yes, I found a few jQuery plugins: https://www.google.co.uk/search?q=jquery+twitter&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&gws_rd=cr&ei=jzK_UoKJEtSShQeJl4G4Bg
  16. Not bad at all I would add a little more left padding on those h3 headers though.
  17. In your CSS: a { color:#FF0000; }
  18. My bad Not up to date with HTML5 yet...
  19. Yeah remove it from the frontpage though. There should be no layout divs on the frontpage_main.tpl. Your frontpage_main code should be the content that appears in the main bit, the sidebar will appear automatically.
  20. <aside>, <section> and <article> are not HTML tags. Use <div> instead. Your basic answer is to do this in your CSS: #sidebar { float:left; width:20%; } #main { float:left; width:70%; } The percentages deliberately add up to 90% to allow for margins and padding. Then, in your layout.tpl: <div id="sidebar"> <!-- sidebar content goes here --> </div> <div id="main"> <?php echo $page_content;?> </div>
  21. Copy what Maciej has done with the frontpage_main.tpl on the layout.tpl
  22. Sorry I was talking about the wrong thing... Did you try Jeffrey's solution?
  23. It should be in registration_mainform.tpl. For just Calgary, do this: <select name="hub"> <option value="CYYC">CYYC - Calgary</option> </select>
×
×
  • Create New...