Jump to content

Parkho

Moderators
  • Posts

    1375
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Parkho

  1. Inside the foreach loop add the following: if($pilot->retired == 1) { continue; } This will exclude retired pilots. If by active pilots you mean pilots who had filed any reports then add the following: $pirep = $pilot->lastpirep; $check = date("d", $pirep); $today = date("d"); $days = $today - $check; if($days < 3) { continue; } This will check if the pilot has filed any reports for the last 3 days and if true it will show the pilot otherwise it will hide the pilot from the list.
  2. Open the common file provided with the module and change function to static function save and replace. example: pulic function pilot() { stuff.... } to: public static function pilot() { stuff... }
  3. I'm using this: <?php $dbm="SELECT t1.pilotid,t1.distance,t2.firstname,t2.lastname FROM (SELECT pilotid, sum(distance) as distance FROM phpvms_pireps WHERE date_format(submitdate, '%Y-%m') = date_format(now(), '%Y-%m') AND accepted = 1 GROUP BY pilotid) t1 LEFT JOIN phpvms_pilots t2 ON t1.pilotid = t2.pilotid ORDER BY distance DESC LIMIT 10"; $bstm = DB::get_results($dbm); foreach ($bstm as $btm) { if($bstm == '') { ?> <tr><td align="center" colspan="2">No Records yet!</td></tr> <?php } else { ?> <tr><td><?php echo $btm->lastname ;?></td><td align="center"><?php echo $btm->distance ;?> NM</td></tr> <?php } } ?> This will give u top miles in current month. If you need top miles for all time use this: <?php $dbm="SELECT t1.pilotid,t1.distance,t2.firstname,t2.lastname FROM (SELECT pilotid, sum(distance) as distance FROM phpvms_pireps WHERE accepted = 1 GROUP BY pilotid) t1 LEFT JOIN phpvms_pilots t2 ON t1.pilotid = t2.pilotid ORDER BY distance DESC LIMIT 10"; $bstm = DB::get_results($dbm); foreach ($bstm as $btm) { ?> <tr><td><?php echo $btm->lastname ;?></td><td align="center"><?php echo $btm->distance ;?> NM</td></tr> <?php } ?>
  4. What did you put in the first time? I think you have added records to your DB without knowing it. I suggest you check your tables and if you see any records, empty the table and try again. If the problem remains, I suggest you re-install phpvms including a new fresh DB.
  5. You can't just delete the recaptcha code in registration form and expect process to go through. If you don't need the recaptcha, you'll need to modify 'Registration' module too.
  6. Try this: public static function get_ivao_log($id) { $sql = "SELECT * FROM phpvms_pireps WHERE pirepid = '$id'"; $result = DB::get_row($sql); $log = explode('*', $result->log); foreach($log as $line) { if (strpos($line, "IVAO") !== false) { $temp = $line; break; } } $temp = explode(' ', $temp); $title = $temp[1]; return $title; } And to call it: YourCommonFile::get_ivao_log($pirep->pirepid); You could assign this to a variable like: $ivao = YourCommonFile::get_ivao_log($pirep->pirepid); And say it like : if($ivao == "IVAO") { $pilotbonus = "500"; $userinfo = PilotData::getPilotData($pirep_details->pilotid); if($pirep_details->landingrate > -50 OR $pirep_details->flighttime > 8) { $totalpay = $pilotbonus + $userinfo->totalpay ; $bonus = $pilotbonus +$userinfo->bonus; $fields = array ( 'totalpay' => $totalpay, 'bonus' => $bonus, ); PilotData::updateProfile($userinfo->pilotid, $fields); } }
  7. Hi, is 'IVAO' part of your flight log? Meaning do you see that word in your flight log when you open it?
  8. Hi, I just installed the module and I don't get anything on my page. Any idea? Thanks
  9. Unfortunately, you can't due to some issues it's been having.
  10. Back up your tables and re-install phpvms. then replace your tables and you'll get pretty much everything as far as the records then it's just the skin you'll need to worry about. Also, if you already don't have a full back up of your website then do yourself a favor and make one after re-installation. Cheers
  11. Have you imported the sql file provided into your DB?
  12. What's you table prefix in DB?
  13. Do you have aircraft added to your fleet?
  14. Where do you not see the aircraft listed? In admin or In module?
  15. Some minor changes have been made. Please download and replace the following files at Github: Files: 1. FCalculator.class.php in core/common folder. 2. fuelcalculator.tpl in core/templates/fc folder. 3. info.png in lib/images folder. Change Log: 1. Multiple aircraft types showing in drop down menu is fixed. 2. Info image added explaining things. 3. Fields are now required before the form can be submitted. Enjoy
  16. In order to submit changes you'll need to pass those values to a function that eventually stores those values in the db table. Also for your pilots to be able to fill those fields you'll need to modify the codes to store those field values as well unless you have used the add field feature which is a lot easier.
  17. The field is required to calculate the climbing fuel. About your aircraft, you have multiple A320s with different registration and that's why you'll see more than 1 in the drop box. I'll have to rewrite the code to pull out the aircraft by type only. We'll let you know.
  18. Are you using phpvms? If not, then we can not help u here as this is the forum for phpvms only.
  19. There is payware made by Simpilot you can buy at his website
  20. Okay. I created this module to only give my pilots an estimated fuel required for a trip and that doesn't mean they shouldn't consider their own calculations. About the altitude, I know that has nothing to do with the calculations but It needed to be there, so the user feel confident they had entered the correct amount as their altitude. It's kind of a mental matter that when you use the module you know you've done everything correctly if you know what I mean.
  21. That's it. The prefix!!!!!!! Open fcalculator.class.php and in the first function remove "phpvms" leave it as "aircraft".
×
×
  • Create New...