Jump to content

CPC900

Members
  • Posts

    621
  • Joined

  • Last visited

Everything posted by CPC900

  1. On second attempt it worked?! I don't know, must have missed something before
  2. That works fine, but I want the other to do the same!? <li><strong><?php echo 'VA average landing rate: '.round(TouchdownStatsData::airline_average(), 2); ?></strong></li> That doesn't seem to work?!
  3. Sorry, but how do I round to 2 decimal places again for:
  4. I think (and I could be wrong) he is wanting the code to show the map for JUST the individual pilots in addition to the map for all pilots, maybe?
  5. CP Air Virtual Airlines - http://www.canadianclassicairlines.com/CPC/
  6. Yes, looks good Roger!
  7. Are you trying to envelop all those airlines into one? That will be a bit of work. I have enough trouble with just one
  8. CPC900

    Error

    It magically was fixed this morning all by itself
  9. CPC900

    Error

    Any idea what would cause this error, out of the blue?! : Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
  10. Yes......Merry Xmas to all and a happy new year! Nabeel, I can't thank you enough!
  11. Yes, I would like it. Thanks.
  12. Yes, I saw it worked for you Just not with my current code. I will look at it more thoroughly and get back to you. Probably just me
  13. Got the first one to work, from IVP001......but the second one from Henrikkir is not?!
  14. CPC900

    Stats Page

    Yes, I appreciate that info: I will try to experiment with that. I will also try to touch base with you on this through msn. Send me an IM on your id, I couldn't add you as "simpilot"?! Much appreciated
  15. CPC900

    Stats Page

    Nabeel, I have read them, I just don't understand them. I know this may seem obvious to you and others, but not to me. Let me try to get a grasp of this. Okay in the api docs example of: $pilots = PilotData::getAllPilots(); foreach($pilots as $pilot) { echo "{$pilot->firstname} {$pilot->lastname}"; } It says it will output the pilots name. Now when I am testing this in a module, all I get is firstname} {$pilot->lastname}"; } ?> . It doesn't echo the data, just what I typed in after echo " So I don't know what I am missing here. I think the more I read to understand phpvms, the more I am confused on how it works. Am I the only one?! I want to be able to create some things on my own, instead of just using what others have created; but I am having a problem grasping it. I am not a programmer and when I created my old site, it was just basic html/sql stuff. And I still had to get some help with that stuff.
  16. CPC900

    Stats Page

    Ok, lets say with this first example....I would add that to a page I create. Say a module I have created that the php codon extends part is done. So it knows there is a module. Then the .tpl file for said module has that line of code "StatsData.class.php::PilotAircraftFlownCounts($pilotid)" in it. Then?? I create a table to display the results in?
  17. CPC900

    Stats Page

    Ok, I will try a different approach If I was trying to get the pilot stats for flights and/or hours for aircraft type, for individual pilots, what would I be looking to code?!
  18. Ok, I really don't understand the workings of phpvms to try and do my own modules. So, I am asking for some guidance on one of my old sites stats pages..... Here is my original code of an html page. It basically showed the amount of hours pilots had per aircraft. I am hoping someone can sort of guide me in how/what I could do to make this function in phpvms. I used to pull all the data from the sql database, and obviously, you can tell I was doing it the long/hard way. I think I get confused by how to grab the data, how to add the data together from different tables, etc. inside the phpvms environment. I would really like to understand phpvms so I can help, rather than asking questions all the time and feeling stupid <body> <? print "<center>"; print "<b><font size=+3 color=#D86C4D>$callsign Fleet Stats</font></b><br>"; print "<hr width=800 align=center>"; $conn = mysql_connect( "canadianclassicairlines.com", "******", "******" ); mysql_select_db( "******_pireps" ); $query = "SELECT callsign, equipment, ROUND((SUM(time_to_sec(duration))/3600),2) AS block, COUNT(duration) AS flights FROM reports 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>"; ?> <? print "<center>"; print "<b><font size=+3 color=#D86C4D>$callsign Flights</font></b><br>"; print "<hr width=908 align=center>"; $query = "SELECT * FROM reports WHERE callsign = '$callsign' ORDER BY date, report_id"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th><font color=#D86C4D>Date of Flight</font></th> <th><font color=#D86C4D>Dep Airport</font></th> <th><font color=#D86C4D>Arr Airport</font></th> <th><font color=#D86C4D>Aircraft Reg</font></th> <th><font color=#D86C4D>Aircraft Type</font></th> <th><font color=#D86C4D>Block Time</font></th> <th><font color=#D86C4D>Fuel</font></th> <th><font color=#D86C4D>Distance</font></th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['date']; echo "</td><td>"; echo $row['origin_id']; echo "</td><td>"; echo $row['destination_id']; echo "</td><td>"; echo $row['registration']; echo "</td><td>"; echo $row['equipment']; echo "</td><td>"; echo $row['duration']; echo "</td><td>"; echo $row['fuel']; echo "</td><td>"; echo $row['distance']; echo "</td></tr>"; } echo "</table>"; ?> </p> <p align="center" class="style17"> </p> </td> </tr> <tr> <td bgcolor="#C6C6C6"> </td> <td colspan="2" bgcolor="#C6C6C6"> </td> </tr> <tr> <td colspan="3" bgcolor="#C6C6C6"> </td> </tr> </table> </body> </html>
  19. Thanks Lucas, that is what I wanted. Now, how would I add Average Landing rate per pilot, to your code?
  20. Sorry, I see I am not done yet So, in the Pilots.php and PilotData.class, what am I adding?
  21. Ok, so that is in addition to what I said above, correct?!
  22. Ok, I have been looking through the forums and tinkering with my site, and I need to try to wrap my head around it.... For adding the vatsim link info to my site, I need to: 1. Add a text column to the phpvms_pilots table in the sql database, called Vatsim ID?! 2. Add a box for the inclusion of the Vatsim ID in the registration_mainform.tpl file?! 3. Change the pilots.tpl file to include the vstsim info already mentioned many times in the forum?! Is that basically correct. I find reading so many posts about this topic, has only messed up my head
×
×
  • Create New...