Jump to content

Stats by aircraft type


CPC900

Recommended Posts

On my old site, I had a page that showed a pilots stats by aircraft type. It listed how many hours a pilot flew per aircraft and had a "certified" picture if he flew enough hours....

Anyways, how is the best way to go about pulling out that info from the database? To give you an idea of what I had a long time ago...

<?
print "<center>";
print "<b><font size=+3 color=#D86C4D>$callsign Fleet Stats</font></b><br>";
print "<hr width=800 align=center>";

$conn = mysql_connect
mysql_select_db

$query = "SELECT pilotid, equipment, ROUND((SUM(time_to_sec(duration))/3600),2) AS block, COUNT(duration) AS flights FROM pireps WHERE callsign = '$callsign' GROUP BY equipment"; 

$result = mysql_query($query) or die(mysql_error());

echo "<table border='1'>";
echo "<tr> <th>Aircraft</th> <th>Flights</th> <th>Hours</th> <th>Certified</th></tr>";

while($row = mysql_fetch_array($result)){

   echo "<tr><td align=left>";    
echo $row['equipment'];
echo "</td><td align=center>";
echo $row['flights'];
echo "</td><td align=center>";
echo $row['block'];
echo "</td><td align=center>";
 $var1 = '<img src="../pics/misc/orangerank.gif">';  
    if($row['block']>9.9 && $row['equipment']=='DC3'){
    echo $var1;
 }if($row['block']>9.9 && $row['equipment']=='DC6'){
    echo $var1;
    }if($row['block']>99.9 && $row['equipment']=='B737-200'){
    echo $var1;
 }if($row['block']>124.9 && $row['equipment']=='B727-100'){
    echo $var1;
 }if($row['block']>124.9 && $row['equipment']=='B727-200'){
    echo $var1;
 }if($row['block']>159.9 && $row['equipment']=='DC8-43'){
    echo $var1;
 }if($row['block']>159.9 && $row['equipment']=='DC8-53'){
    echo $var1;
 }if($row['block']>159.9 && $row['equipment']=='DC8-55'){
    echo $var1;
 }if($row['block']>199.9 && $row['equipment']=='DC8-63'){
    echo $var1;
 }if($row['block']>274.9 && $row['equipment']=='DC10-10'){
    echo $var1;
 }if($row['block']>299.9 && $row['equipment']=='DC10-30'){
    echo $var1;
 }if($row['block']>499.9 && $row['equipment']=='B747-200'){
    echo $var1;
 }if($row['block']>39.9 && $row['equipment']=='ATR72-500'){
    echo $var1;
 }if($row['block']>59.9 && $row['equipment']=='CRJ-200'){
    echo $var1;
 }if($row['block']>74.9 && $row['equipment']=='BAe146-200'){
    echo $var1;
 }if($row['block']>124.9 && $row['equipment']=='B737-300'){
    echo $var1;
 }if($row['block']>124.9 && $row['equipment']=='B737-700'){
    echo $var1;
 }if($row['block']>149.9 && $row['equipment']=='B757-200'){
    echo $var1;
 }if($row['block']>299.9 && $row['equipment']=='B767-300'){
    echo $var1;
 }if($row['block']>399.9 && $row['equipment']=='MD11'){
    echo $var1;
 }if($row['block']>499.9 && $row['equipment']=='B747-400'){
    echo $var1;
}
echo "</td></tr>";

}
echo "</table>";
?>

Is there a template that already does something like that?

Link to comment
Share on other sites

BTW, I know we have the "my stats" thing through the pilot center; I just wanted to basically add the listing of flight hours by numbers with a graphical "certified" pic in a separate chart, maybe below the current pie chart....if you see what I mean. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...