Jump to content

Parkho

Moderators
  • Posts

    1381
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Parkho

  1. Yes it's possible but you'll have to change several core files to achieve that. profile_edit.php would be a start for you.
  2. You'll need to fetch each airline's data separately and show it to its own page. What I understand is that you have total hours for all airlines in each airline page. For that, you need a function to sum the hours based on airline code: public static function airline_hours($code) { $sql="SELECT SUM(flighttime) FROM phpvms_pireps WHERE code = '$code'"; return DB::get_row($sql); } Now to show this for each airline you need to give it the airline code variable (ex. AIC) like this: Your Common File::airline_hours(AIC);
  3. I have been trying to make the table update time shorter and wasn't successful. Where can I change the interval for updating the table?
  4. When a flight is booked the bid ID goes into schedules bidid column. When the pirep is submitted or filed the schedules table gets updated and bidid column changes to 0. For some reason that's not happening when the pirep is filed in your website. If you open schedules table in DB and sort the bidid column you can see the bid IDs that were inserted and then you can change them all to 0. This will temporary resolves your issue but you need to find out why your schedules table doesn't get updated on pirep submit.
  5. Yes you can. You'll need to delete the recaptcha code from registration form but that's not all since you'll have to modify the registration module and delete the code that checks for recaptcha before the process can go through which I wouldn't suggest!
  6. Try this: $sql = "SELECT * FROM ".TABLE_PREFIX."pireps WHERE pilotid='$pilotid' AND flighttype = 'H' AND accepted=1"; 'C' is for charter flights. 'H' is for cargo.
  7. 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.
  8. 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... }
  9. 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 } ?>
  10. 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.
  11. 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.
  12. did it work?
  13. Yeah! supposedly.
  14. 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); } }
  15. Hi, is 'IVAO' part of your flight log? Meaning do you see that word in your flight log when you open it?
  16. Hi, I just installed the module and I don't get anything on my page. Any idea? Thanks
  17. Fixed!
  18. Unfortunately, you can't due to some issues it's been having.
  19. 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
  20. Have you imported the sql file provided into your DB?
  21. What's you table prefix in DB?
  22. Do you have aircraft added to your fleet?
  23. Where do you not see the aircraft listed? In admin or In module?
  24. 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
  25. 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.
×
×
  • Create New...