Jump to content

web541

Members
  • Posts

    700
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by web541

  1. Yeah it'll do that until they refresh the page at least once (and at that point their current location will be set to their hub). I did that so that I didn't have to modify any of the default phpVMS files for the module but since you asked, go to this file: https://github.com/DavidJClark/phpvms_5.5.x/blob/master/admin/modules/PilotAdmin/PilotAdmin.php#L663 And after that line, put this: FltbookData::updatePilotLocation($pilot->pilotid, $pilot->hub); Now every time a pilot is approved, it will update their location accordingly.
  2. There's a thousand ways to do this, but this would be easiest to explain: 1. Go to this file and after this line https://github.com/nabeelio/phpvms/blob/dev/app/Http/Controllers/Frontend/HomeController.php#L16 Put this User::find(1)->attachRole('admin'); 2. Go to your home page (http://siteurl.com/) and refresh the page and it should be there again. 3. Remove the line of code This is assuming you are User number 1 in your database (id of 1 in the users table). There are other ways to do it such as putting it in the routes file, editing the database tables (but not recommended as it adds it into a few), using the Auth::user() instead once you are logged in.
  3. Oops forgot to close the bracket Try this: <div class="small-box bg-blue"> <div class="inner"> <?php $hours = ($nextrank->minhours - $pilot_hours); if ($hours < 0) { echo '<h3>Congratulations <br> You have reached the highest rank.</h3>'; } else { echo '<h3>'.$hours.' Hours</h3>'; echo '<p>until promotion to <br> '.$nextrank->rank.'!</p>'; } ?> </div> <div class="icon"> <i class="ion ion-checkmark"></i> </div> </div>
  4. No I haven't, but I have seen others using different ACARS systems with success. Most ACARS you use will require slight changes to the module files to read the aircraft properly, but the bid should still show up normally without any adjustment.
  5. Try this: <div class="small-box bg-blue"> <div class="inner"> <?php $hours = ($nextrank->minhours - $pilot_hours); if ($hours < 0) { echo '<h3>Congratulations <br> You have reached the highest rank.</h3>'; } else { echo '<h3>'.$hours.' Hours</h3>'; echo '<p>until promotion to <br> '.$nextrank->rank.'!</p>'; ?> </div> <div class="icon"> <i class="ion ion-checkmark"></i> </div> </div>
  6. Are you sure you installed the full module, including uploading the .sql file to your database?
  7. Yeah it appears the app/Http/Routes directory has changed. The closest I can find to it is here but I don't think you should be editing that file. I know that the routing for modules has changed recently, so you may have to edit another file somewhere else. Nabeel is changing up things at light speed 😉 @Nabeel You wanna chime in here? Just where to add custom routes now.
  8. Is that section in your config.php, or have you added more info in your .env file? Yeah, the docs aren't quite up to date just yet, but once you've added that info the emails should work normally through Mailgun. If you try to send an email (for example the password reset email), does it go through Mailgun (or at all)? If you search Google for "Using Mailgun with Laravel" and you may get more info.
  9. Try just name {$last_location->name} or (if the table isn't joined), try this $airport = OperationsData::getAirportInfo($last_location->arricao); echo $airport->name;
  10. Hmmm, are you sure you still have a bid? Make sure that there is a flight booked on the website first then it should show up. If not, try replacing this (around line 113) $biddata = self::getLatestBid($pilotid); with this $biddata = FltbookData::getLatestBid($pilotid); If that doesn't work then there's something else going on as it should be pulling straight from the phpvms_bids table. The ACARS software you choose is up to you, but if you want to use Fltbook then there is sometimes extra work that's needed regardless of the ACARS.
  11. If you are only going to use it for when the pilot is logged in, then try this: <?php $last_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; ?> As the $userinfo variable is only populated in some modules within phpVMS and isn't entirely global (e.g. some places it may be $pilot->pilotid or otherwise).
  12. Not sure exactly as I have never used that ACARS software, but from a quick look at the module (in core/modules/CCFTracker/CCFTracker.php) around line 397, if you change this AND s.aircraft=a.id to this AND b.aircraftid=a.id You may have some success
  13. So in your console, this will work to zoom in/out map.setZoom(5); At the end of the file here: https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L203 Try putting this: <script> map.setZoom(5); </script> That should overwrite anything that's there. Also as a sidenote, to remove one of the google maps console messages, you will want to take your <script async defer src="https://maps.googleapis.com/maps/api/js?key=KEY"type="text/javascript"></script> line (I think from your skin) and replace this in your core_htmlhead.php file (either in your skin or copy it from core/templates into your skins folder and edit it there) <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
  14. Yes only the PIREPAdmin.php file, try this public function deletecomment() { if (!isset($this->post)) { return; } $commentid = DB::escape($this->post->id); $comment = DB::get_row("SELECT * FROM ".TABLE_PREFIX."pirepcomments WHERE `id` = '$commentid'"); LogData::addLog(Auth::$userinfo->pilotid, 'Deleted a comment to PIREP #: '.$comment->pirepid); PIREPData::deleteComment($this->post->id); $this->set('message', 'Comment deleted!'); $this->render('core_success.tpl'); } The query looks right, I think it might have been deleting the comment and then trying to find it which wouldn't work. You could also do it this way I would think (that way it will only log it if it has been deleted, but it should do it 99% of the time anyway) $commentid = DB::escape($this->post->id); $comment = DB::get_row("SELECT * FROM ".TABLE_PREFIX."pirepcomments WHERE `id` = '$commentid'"); PIREPData::deleteComment($this->post->id); LogData::addLog(Auth::$userinfo->pilotid, 'Deleted a comment to PIREP #: '.$comment->pirepid);
  15. Oh I see I was looking at the wrong file for that page, it should've been the view.php. Have you tried changing the zoom on this line? https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L81 then try removing these lines temporarily and test https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L94-L102 And if still nothing, try this in the console and PM me your url: var m = document.getElementById("currentlocation"); m.setZoom(12);
  16. Oops I forgot a line before, try this: public function deletecomment() { if (!isset($this->post)) { return; } PIREPData::deleteComment($this->post->id); $commentid = DB::escape($this->post->id); $pirep = DB::get_row("SELECT * FROM ".TABLE_PREFIX."pirepcomments WHERE `id` = '$commentid'"); LogData::addLog(Auth::$userinfo->pilotid, 'Deleted a comment to PIREP #: '.$pirep->pirepid); $this->set('message', 'Comment deleted!'); $this->render('core_success.tpl'); }
  17. That shouldn't be happening, try this instead: map.setZoom(12); and check what the id="" tag is on the map div, it should look like this <div id="routemap" style="width: 960px; height: 520px;"></div> Are you sure it's a zoom issue? So in that image, if you manually zoom out it shows imagery or still nothing no matter how far you zoom? The first two console messages could have something to do with it (linked google maps api .js more than once on the page, check your page source). It could be it's being overwritten somewhere else on the page or in another file.
  18. Is this a duplicate of your issue here Or related to a different module? If so, what version of phpVMS are you on? Are you still on Google Maps or have you swapped it out for Leaflet or different? If Google Maps, you should be able to change this value here: https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/map.php#L7 Increasing it should zoom in, decreasing should zoom out. If that doesn't work, try going to the page and going into the console and running this (one line at a time): var m = document.getElementById("routemap"); m.setZoom(12);
  19. It shouldn't be showing just 117, because the $pirep->code would show the airline the schedule has and as far as I know you must have an airline to create the schedule. Actually this might make sense. If all you want is to show CF for all PIREPS then ry this: echo '<td><a href="'.SITE_URL.'/index.php/pireps/viewreport/'.$pirep->pirepid.'">CF'.$pirep->flightnum.'</a></td>';
  20. The comment id is posted but not the PIREPID so you would have to find it like this: $commentid = DB::escape($this->post->id); $pirep = "SELECT * FROM ".TABLE_PREFIX."pirepcomments WHERE `id` = '$commentid'"; LogData::addLog(Auth::$userinfo->pilotid, 'Deleted a comment to PIREP #: '.$pirep->pirepid); I would usually put the query into the PIREP Data class, but for this small example (since there's no method already available) it should be fine to leave it this way.
  21. It's working fine for me (unless you have fixed it already). It's most likely a bootstrap conflict (see gio1961's linked post above) or a jQuery conflict, so you'd have to fiddle around with what and where you have them linked (and if you have them linked in your skin, take them out of the Fltbook/schedule_results.php page). If you are using Bootstrap 4 (which I don't think you are), then it will require some tweaking as I haven't made it compatible yet.
  22. You'd have to adjust the schedule_results.php file and add some lines of code there, maybe before this line https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/schedule_results.php#L18 For example: <?php $allbids = SchedulesData::getAllBids(); foreach($allbids as $bid) { if ($bid->aircraft == $schedule->aircraft) { continue; } } ?> That will hide the schedule completely if the aircraft has been booked already, if you want to show the schedule but not show the "Add to bid" button then you will need to add that further down in the file and adjust the code here https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/schedule_results.php#L43
  23. The first line there public static function get_stats_by_cur_month($howmany) public static function TotalPilotMiles($pilotid) shouldn't have two 'public static function' declarations on it. I'm not sure which ones the docs say to use, but you'd have to remove one (maybe remove one, try it and if it doesn't work try the other?). Remember to keep the { on the second line there.
  24. It's not possible right now but it's being looked into for a future update Ref: https://github.com/nabeelio/phpvms/issues/472
×
×
  • Create New...