I’m not one to do scripting, so if I could get some help, would be great. I’ll ask questions regarding what I’m doing in this post.
First off, how is a module created that shows up in the admin area as well as frontpage? Next, how can I show only 1 of each of the aicraft in the fleet on a page?
For the fleet page I use this: , with a query like this:
$sql = 'SELECT a.*, a.name AS aircraft,
COUNT(p.pirepid) AS routesflown,
SUM(p.distance) AS distance,
SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
AVG(p.distance) AS averagedistance,
AVG(p.flighttime) as averagetime
FROM '.TABLE_PREFIX.'aircraft a
LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
GROUP BY a.icao ORDER BY a.registration';
in the php page.
Modules are either on the admin panel or pilot/public side, not both at the same time. You will need to create a separate module for the admin panel.
For the fleet page I use this: , with a query like this:
$sql = 'SELECT a., a.name AS aircraft,
COUNT(p.pirepid) AS routesflown,
SUM(p.distance) AS distance,
SEC_TO_TIME(SUM(p.flighttime60*60)) AS totaltime,
AVG(p.distance) AS averagedistance,
AVG(p.flighttime) as averagetime
FROM '.TABLE_PREFIX.'aircraft a
LEFT OUTER JOIN '.TABLE_PREFIX.‘pireps p ON (p.aircraft = a.id)
GROUP BY a.icao ORDER BY a.registration’;
in the php page.
Modules are either on the admin panel or pilot/public side, not both at the same time. You will need to create a separate module for the admin panel.
Ok, is the .tpl files the seperation?
Edit: Is there a class or function that’s cleaner than pulling direct sql?