Jump to content

Aircraft Type Usage Chart


Jeff

Recommended Posts

I'm trying to create a table in the pilot_public_profile.tpl that will show the Aircraft Usage Statistics of every aircraft type that the pilot uses, so I can award them with an aircraft typerating award. I am not sure if I am anywhere close to getting it to work, as I keep getting this error...

Parse error: syntax error, unexpected T_CLASS in /home/virtualf/public_html/core/templates/pilot_public_profile.tpl on line 120

<p>
                       <h3><?php echo $userinfo->firstname; ?>'s Aircraft Statistics</br></h3>

                       <table width="100%" border="1" bgcolor="#042233" id="tabledlist" class="tablesorter">
<thead>
    <tr>
       <th><font color="F78F1E">Aircraft</font></th>
       <th><font color="F78F1E">Times Flown</font></th>
       <th><font color="F78F1E">Hours Flown</font></th>
    </tr>
</thead>


<?php echo StatsData.class.php::PilotAircraftFlownCounts($pilotid) //This is Line 120......

echo '<tr><td align = "center">'.$aircraft->icao.'</td>
         <td align = "center">'.$aircraft->totalflights.'</td>
         <td align = "center">'.$aircraft->totalhours.'</td></tr>';
?>

</p>
<p>
</p>     

Link to comment
Share on other sites

Now I get this error:

Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /home/virtualf/public_html/core/templates/pilot_public_profile.tpl on line 88

<p>
                       <h3><?php echo $userinfo->firstname; ?>'s Aircraft Statistics</br></h3>

                       <table width="100%" border="1" bgcolor="#042233" id="tabledlist" class="tablesorter">
<thead>
    <tr>
       <th><font color="F78F1E">Aircraft</font></th>
       <th><font color="F78F1E">Times Flown</font></th>
       <th><font color="F78F1E">Hours Flown</font></th>
    </tr>
</thead>


<?php echo StatsData::PilotAircraftFlownCounts($pilotid)

echo '<tr><td align = "center">'.$aircraft->icao.'</td>           //This is line 88
         <td align = "center">'.$aircraft->totalflights.'</td>
         <td align = "center">'.$aircraft->totalhours.'</td></tr>';
?>

</p>
<p>
</p>     

So something is still not coded correctly on there. I'm stuck. :huh:

Link to comment
Share on other sites

Okay, it is displaying, but nothing is showing up where the aircraft information is supposed to be showing. It is showing the text: Aircraft, Times Flown, Hours Flown, but under those it is just blank. What coding is needed to make that information display. i know those pilots have flown before because it is showing in their profile, but just not in that chart I am creating.

Link to comment
Share on other sites

I've never used this before and the documentation doesn't really explain it, but I screwed around with it and found out this:

StatsData::PilotAircraftFlownCounts returns an array of aircraft,counts and hours for the given PilotID (I don't know what else it returns).

So, you'll need to loop through the array and echo the results, something like this:

$stats=StatsData::PilotAircraftFlownCounts($pilotid);
foreach($stats as $stat)
{
echo $stat->aircraft.' '.$stat->count.' '.$stat->hours.'<br>';
}

Obviously, you want to put the data in your table, but this is an example.

Link to comment
Share on other sites

  • 3 years later...

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...