Jump to content

freshJet

Members
  • Posts

    1470
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by freshJet

  1. You probably have links to more than one version, because phpVMS has a link to it in the core_htmlhead.tpl. Because it's such an old version, maybe it's no longer hosted? I've noticed no issues with multiple versions, other than it annoys me.
  2. What Sava said. Have been doing non-phpVMS stuff lately without the use of classes.
  3. core/common. Be aware though that this will be overwritten in updates, you're probably best creating a new class file first, even if it is messy and annoying.
  4. function countAircraftByICAO($icao){ $sql = "SELECT COUNT(id) AS count FROM phpvms_aircraft WHERE icao='$icao' AND enabled='1'"; $result = DB::get_row($sql); return $result->count; } You can put that in OperationsData.class.php. That will get the count. If you want to display any fields then use this: function getAircraftByICAO($icao){ $sql = "SELECT * FROM phpvms_aircraft WHERE icao='$icao' AND enabled='1'"; return DB::get_results($sql); } Example usage: <?php $icao = 'A320'; $count = countAircraftByICAO($icao); $aircraft = getAircraftByICAO($icao); echo "There are $count aircraft <br/>"; foreach($aircraft as $item){ echo $item->registration.'<br />'; } ?>
  5. I'm not the best person to ask here as I do not use this module. I can only advise that you make sure that you have all parameters set correctly.
  6. That's not a great idea, because the distance will be the same regardless of the unit setting. The distance is always calculated in nautical miles.
  7. Just use round($schedule->distance) - As for universally, the decimal places make it more accurate, so I would leave it but if you really want, go to admin/modules/Import/Import.php and go to line 185: if($distance == 0 || $distance == '') { $distance = OperationsData::getAirportDistance($depicao, $arricao); } Change it to: if($distance == 0 || $distance == '') { $distance = OperationsData::getAirportDistance($depicao, $arricao); $distance = round($distance); } And in core/common/SchedulesData.class.php, after line 429, add: $data['distance'] = round($data['distance']);
  8. What is $epoch? You could try changing it to: $dt = new DateTime('@'.$epoch); // convert UNIX timestamp to PHP DateTime
  9. Going back to this because I forgot to share my solution. Although you said you were happy with that one, it's not ideal further down the line because if you for some reason need to load all your schedules it will only show 500. So, take out the $count = '500'. Instead, phpVMS has a few things included by default to accomodate the thing you wanted. In core/modules/Schedules/Schedules.php, you'll see around line 169 and 170 it says: # Show the routes. Remote this to not show them. $this->set('allroutes', SchedulesData::GetSchedules()); Do what it says and remote the $this->set ... part: # Show the routes. Remote this to not show them. # $this->set('allroutes', SchedulesData::GetSchedules()); That will hide the routes when you first load the schedules page, leaving only the form. It's as simple as adding '#'. After that, I recommend you use pagination like you mentioned in the first post, because loading all flights from major hubs like KPHX and KPHL might take a while.
  10. Export function now functional, so basic function of the module is working nicely. After that, a couple of things need added, as well as some minor tweaks before I implement it into my admin panel to test it that way (currently doing it externally at the moment). Final task will be to add the publish option, i.e upload the data directly to the phpvms_schedules table. At this time, I am still looking at this realistically being payware, but no more than £10 (about $15 or 16€ at current rates). Looking at an early March release
  11. If you search 'strict standards' on here you'll find a wealth of info. Have a look at this too.
  12. Sorry, wrote that in a hurry last night. Correct function is: <?php $bids = SchedulesData::getBids($userinfo->pilotid); ?> If you're having CSS issues then it won't be related to that, although the original code I gave you should have thrown a PHP error because getPilotBids() does not exist.
  13. Put this before you show the template. <?php $bids = SchedulesData::getPilotBids(Auth::$userinfo->pilotid); ?>
  14. Yeah, scratch that. Wait on simpilot.
  15. I said before 337. Probably won't work anyway. You could just ignore the errors through the config but it's best to find a fix.
  16. OK, long shot, just before line 337 add: $row = new stdClass();
  17. You need to load the data first, i.e $bids = ...
  18. Are you on a free host? Additionally, try replacing the contents of your PIREPData.class.php with the original: https://github.com/nshahzad/phpVMS/blob/master/core/common/PIREPData.class.php
  19. Afraid not, need to ask simpilot about that one. I'm not totally understanding the checkPermission() function as I can't even find it anywhere.
  20. Having done a bit of searching it is indeed related to the PHP version. I'm also having issues on my test site, I'll mess around a bit.
  21. Try replacing line 171 with: $key_month = date('MY', strtotime($start)); For the second error, that was probably due to the change you made to the permissions you described.
  22. 'DS' is a slash, not a directory. The problem is simply that the path is wrong, because you are not using the file in the root folder. What you could do is replace it with this: include '../core/codon.config.php';
  23. Looks like you are missing the link to the codon.config.php, or you have edited it and made it invalid. Replace it with this, just to make sure: include dirname(dirname(__FILE__)).'core'.DS.'codon.config.php'; Where you are running it from (like simpilot said) will affect it because of the use of dirname(__FILE__).
×
×
  • Create New...