Jump to content

Parkho

Moderators
  • Posts

    1375
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Parkho

  1. Download new version at Github.
  2. This is a module to calculate an estimated flight time duration. It will help you choose the correct amount of time to put in when creating an schedule. Download & Install: FlightDuration_V1.0 Screenshots: Try out: Go to my website. Click on "Module Test". Log in using the provided info. Click "try out center-pilot". Click on "FlightDuration_V1.0" and see how it works. Thanks for your supports.
  3. Yes. Use "round(number, 2)" command in results.tpl. Number is the number you wanna round and 2 is the decimal you wanna round it by, so you put 2 it'll be 1.57 you put 3 it'll be 1.571 Good luck.
  4. Yes. Use "round(number, 2)" command in results.tpl. Number is the number you wanna round and 2 is the decimal you wanna round it by, so you put 2 it'll be 1.57 you put 3 it'll be 1.571 Good luck.
  5. That requires creating a new module, so you can start the module yourself and get help from the forum or if you have no knowledge you can ask this in paid services but only if you're willing to pay.
  6. Noted and changed, Please re download the tpl at github and keep in mind there will be only 3 options: blank, warning, welcome. Thanks Re download pilotmanager.php too and consider this as an update.
  7. There are no mistakes cause only three options are in that drop down.
  8. Are you an admin of the site? Cause only admins can determine whether you did jump seat or not by looking at the database and your pilot ID.
  9. You can simply remove the file Manual PIREP link from pilot profile in "core/templates/profile_main.tpl".
  10. If you mean you want it to have its own page then you have 2 ways. 1. would be adding a page in admin area and clicking the "Source" button and adding your entire codes there. 2. would be creating a module and adding the codes to a template and then showing the template in a page. If your team know how to create a module in phpVMS then I would suggest you go with #2.
  11. Parkho

    Awards

    Here is one by Vansers at Github: https://github.com/V.../phpVMS_vAwards Good luck.
  12. Jump seat I believe is not installed by default, so depends on the module you're using, you'll need to access database for that module and pull the data out. For that you'll need a function placed in "common/operations/operations.php" file and then in your template call the function and show the results. If you give us some more specific information we might be able to help you out.
  13. Can yo send me the skin you're using to parkho[at]parkho.ir so that I can install it and see what's wrong?
  14. Fernando, I think you better move this to the module's post where the author can help you out.
  15. Parkho

    Ranks

    Well! one thing you can do is to upload the default files for that area. That will reset the whole thing for you.
  16. Okay. But if you needed any help let us know. To start with, use the default fleet page and change what you need.
  17. Sorry didn't mean to be rude. In order to display the results only for one aircraft, you'll need to pass the id of the aircraft to the function and the function will return only one record and that case the loop is not needed but if you have a table for all your aircraft then you'll definitely need a loop because the results will not be just one record. What I understood from your question is that you want to have a fleet page with all the info for each aircraft if I'm not wrong.
  18. Okay. First off do you know how to create a module in phpVMS? Secondly, in first stack of codes, where are they located right now. This is important. Third, variable "$id" where do you get the value for it? where is the rest of the code? Forth, in second stack of codes, you're missing a loop to go through the results back from data base. Fifth, You have a lot of issues with your code to resolve.
  19. Okay, where do you want to use this? if it's in a public area where other pilots are then use the following: public function TotalFlightsByPilot($pilotid) { $sql = "SELECT * FROM phpvms_pireps WHERE pilotid = '$pilotid'"; return DB::get_results($sql); } And the following: <p> Total flight by pilot: <?php echo count( PilotData::TotalFlightsByPilot('25')) ; //25 is the pilot id.?></p>
  20. Open PilotData.class.php and add the following function at the end before the last bracket closes: public function TotalFlightsByPilot() { $pilotid = Auth::$userinfo->pilotid; $sql = "SELECT * FROM phpvms_pireps WHERE pilotid = '$pilotid'"; return DB::get_results($sql); } Then if you need to access the flights use the following: <p> Total flight by pilot: <?php echo count( PilotData::TotalFlightsByPilot()) ;?></p> Let us know what happens.
  21. Open PilotData.class.php and add the following function at the end before the last bracket closes: public function TotalFlightsByPilot() { $pilotid = Auth::$userinfo->pilotid; $sql = "SELECT * FROM phpvms_pireps WHERE pilotid = '$pilotid'"; return DB::get_results($sql); } Then if you need to access the flights use the following: <p> Total flight by pilot: <?php echo count( PilotData::TotalFlightsByPilot()) ;?></p> Let us know what happens.
  22. Ok it's done! If you want the code pm me.
  23. I found it! Add this to your StatsData.class.php at the end before the last bracket closes: public static function getTotalForCol($params) { $params = array_merge(array( 'table' => '', 'column' => '', 'airline_code' => '', // optional 'where' => array(), // optional 'func' => 'COUNT', //optional ), $params ); if($params['table'] == '' || $params['table'] == '') { return false; } if($params['func'] == '') { $params['func'] = 'COUNT'; } if(!is_array($params['where'])) { $params['where'] = array(); } if(!empty($params['airline_code'])) { $params['airline_code'] = strtoupper($params['airline_code']); $params['where']['code'] = $params['airline_code']; } $mixed = substr(md5(implode('', $params)), 0, 8); $key = 'total_'.$mixed; $total = CodonCache::read($key); if($total === false) { $params['column'] = trim($params['column']); if($params['column'] != '*') { $params['column'] = '`'.$params['column'].'`'; } $sql="SELECT ".$params['func']."(".$params['column'].") as `total` " ."FROM ".TABLE_PREFIX.$params['table']; $sql .= DB::build_where($params['where']); $total = DB::get_row($sql); if(!$total) { $total = 0; } else { $total = $total->total; } CodonCache::write($key, $total, '15minute'); } return $total; }
×
×
  • Create New...