Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 1 follower
- 10 replies
- 14k views
Aloha Everyone! As a former CEO of a VA and a current web developer in self-training, I know how frustrating it is to spend hours playing with code trying to pull elements from your database or, maybe you just don't know where to find the scripts. To make your job easier, I have gone through the entire phpVMS Installation and pulled every PHP call I could find and compiled it into one document for easy use. If you find any errors, or more PHP calls, please post it here and I will update the original post. Cheers and happy coding! http://pastebin.com/ERuvPcmV I have updated this call sheet as of 5/20/14 to correct some bugs
Last reply by Vangelis, -
- 11 replies
- 23.8k views
Some people asked me how do I create the custom modules/pages (however you would like to call them ) For example the recruitment page ( http://www.airserbia...php/recruitment ) It is actually really easy but for people who are new with PHP and MVC pattern ( like me not long ago ) it can be quite challenging to understand. First off, there is good documentation on this matter but not many people take a look there unfortunately. First of, MVC. The MVC pattern is really easy to describe. You 'separate' your code in three different sections/files. Models, Views, Controllers (MVC) Models are in charge for work with the database, the views are what are displayed to the e…
Last reply by Heritage1, -
- 0 replies
- 2.3k views
Something i have been working on with a friend lately is creating a flight path line from the flown route on v5.5.2 This is still the early stages but everything is already there thats needed. when i do the corrections and other fun stuff to the code i will put it out. check it out for yourself. This is without the addons that cost $$$ and made with everything already given to you (but with leaflet) leaflet will be required to run this as im not paying $$$ for a google maps API So lets Continue on First thing is first, we have to make a db from your mysql CREATE TABLE [name of your table] ( i…
Last reply by swaluver480, -
- 3 replies
- 1.1k views
Hello, I have been searching the forums but I cannot find anything similar to what I am looking for. I was wondering if there may be a bit of code to check if flight bids are currently being flown. Im trying to display a flight status under the bids that are in progress such as "Departed", or "Scheduled Departure" Thanks!
Last reply by ProAvia, -
- 2 replies
- 2.3k views
Hello! I'm hoping someone can help! I'm looking to use a search text box instead of a dropdown menu on our Schedule Search page (http://flyhighva.net/index.php/schedules) I'm smart enough to realize that the file I want to play around with is schedule_searchform.php I am NOT smart enough, however, to mess around too much without breaking something. I'm good at editing and building off of someone else's start - but I for the life of me can't start something new (if that makes any sense, lol) The area of code I'm looking at changing to allow a pilot to enter a ICAO code instead of searching the never-ending dropdown menu is lines 16 thru 45: …
Last reply by Dyl1103, -
- 0 replies
- 2.9k views
Hey, Hope somebody can help? Is there a way to show the offblock/onblock times, start and finish, also takeoff and landing times? Need help to source a code? TIA
Last reply by Mickey, -
- 0 replies
- 3.4k views
I was wondering if anyone would have any idea on how to set different icons for the aircraft type on live map. I'm not great with jquery functions so anyone able to resolve this would be a great help I'm assuming it would be something along the lines of this const getHeadingIcon = (heading) => { if (!(heading in headingIcons)) { headingIcons[heading] = L.icon({ iconUrl: url + "/lib/images/inair/" + aircraft + heading + ".png", iconSize: [35, 35] }); } Many thanks
Last reply by miniarma, -
- 4 replies
- 3.6k views
Hi all. I have a section on the front page of my crew center that gives a snapshot of how many hours are left before the pilot reaches the next rank. The problem... When the pilot maxes out it starts to give a negative number. I would like to add an "if" statement to the following code that says basically, if the hours = < 0, then display "Congratulations<br>You have reached the highest rank." <div class="small-box bg-blue"> <div class="inner"> <h3><?php echo ($nextrank->minhours - $pilot_hours)?> Hours</h3> <p>until promotion to<…
Last reply by djtiger76, -
- 1 follower
- 0 replies
- 3.1k views
Hello guys, This is a little security snippet you can use for your website. The user needs to answer the multiplication question before proceeding: PHP: $rand1 = rand(1, 9); $rand2 = rand(1, 9); HTML: <div> <label><?php echo $rand1;?> x <?php echo $rand2;?> = </label> <input type="text" class="form-control" name="sum" id="ques" placeholder="<-- Your Answer" required> <input id="sendbtn" type="submit" name="submit" value='Send' disabled> </div> Jquery to check user's answer. If the answer is correct, as soon as the user move the mouse out of the field, the "Send" button is enabled othe…
Last reply by Parkho, -
- 1 reply
- 3.5k views
Hi everyone! Is there any code with which I can display the airline logo automatically depending on the flight number? Somewhere I don't remember, I found this one but it doesn't work: <td align="center"><img src="https://(website)/lib/skins/ocean_blue/images/airlines/<%=flight.flightcode%>.png"></td> Thank you!
Last reply by flyalaska, -
- 4 replies
- 4.3k views
Hello, I am wonder if some one would have the a code to allow me to issue pilots free jumpseats to work along side the fltbook V2 booking system.
Last reply by PikoSim, -
- 0 replies
- 3.3k views
Hello folks! I thought about to edit categories in the default download module and changed it to my needs. After you deactivate a download category, it wont show up in your list. Important information: BEFORE do this tutorial, backup the database tables and files you'll edit. lib/skins/pandaair_theme/downloads_list.php admin/modules/Downloads/Downloads.php admin/templates/downloads_categoryform.php core/common/DownloadData.class.php database table phpvms_downloads 1. Open your database and run the following command. It will add a column to your downloads table. Be sure to add the …
Last reply by Karamellwuerfel, -
- 2 replies
- 3.7k views
Is there a code out there that can hide content by rank? For example I only want certain links to show on for pilots above a certain rank. Is this possible? My site is phpVMS 5.5.2
Last reply by flyalaska, -
- 2 replies
- 3.6k views
You need to edit the MainController.class.php. You'll find it here: \core\classes\MainController.class.php In line 96 there's a function called loadModules(). Edit this function to the following: public static function loadModules() { global $NAVBAR; global $HTMLHead; self::$ModuleList = self::getModulesFromPath(CODON_MODULES_PATH); if(empty(self::$ModuleList)) { Debug::showCritical('No modules were found in module path! ('.CODON_MODULES_PATH.')'); return; } self::$listSize = sizeof(self::$ModuleList); self::$keys = array_keys(self::$ModuleList); ksort(self::$ModuleList); foreach (self::$Modul…
Last reply by Karamellwuerfel, -
- 1 reply
- 3.7k views
Hello all, (sorry my english) i’m trying to make the flightMarkers keep moving (with or without click marker) but no success. When i try, from multiple markers only one moves or all blink and jump to new position. Whem the marker moves and arrives to next destination/point and the map refresh, the marker go back and start again. Need to continue to next new position. This is the code i’m trying to adapt with speed: http://jsfiddle.net/HYuRR/2/ Can someone help to implement the code? Thank you This is the original acarsmap.js var flightMarkers = []; var routeMarkers = []; var flightPath = null; var depMarker = …
Last reply by piuozorio, -
- 1 follower
- 8 replies
- 4.7k views
Hello guys is there code for showing last recent flight details can anyone help me to get these information for last flight Callsign: Departure Airport: Arrival Airport: Aircraft: flight time: Date of Flight status of the pirep: thank you
Last reply by LeonardIGO4036, -
- 0 replies
- 3.3k views
Hello I want to delete expired bids per Crone Job. Is here a way to check if a pilot is inflight with the current bid? i Want so set the expired time to 2 or 3 hours but when the bid will be deleted, the flight is avaible for other pilots even if currently the pilot is still flying. I have tried to check the acarsdata table, but here is no unique id that has a reference to the bid. phpvms version is 5.5. Best regards, Jan Grimm
Last reply by Sovereign, -
- 1 reply
- 4.3k views
Surely this has been asked before, but I'd really like to implement a FR24 style flight tracker that when you click on the aircraft, instead of just showing a straight line from Dep to Arr, it shows a clear line where the aircraft has been, and a dotted line where it has got to go to. Cheers in advance
Last reply by Mickey, -
- 2 replies
- 2.2k views
This is half and half a code snippet post and also skinning however putting it here. Im using SimPilot's screen shot module, and was just wondering if there was a way of using the screen shot as a random image on the main page? I have an image that is 819 X 311 on the main page, and while I have the random image call working, I cant seem to make the image any larger. <?php Screenshots::show_random_screenshot(); ?> The actual code im using is : <center><?php $allpics = new Screenshots (); $allpics->show_random_screenshot();?></center> Adding any height= or width= seems to throw an error. Of course, in the past, ive made…
Last reply by topher2880, -
- 0 replies
- 3.8k views
Hello, How to recover some information on the log with the variables For example: 12:35 start engine 2, 12:50 overspeed .... Thanks for your help
Last reply by Salem, -
- 9 replies
- 3.5k views
Hey guys! I have a problem when coding this: <li class="list-group-item"> <b>Rank Progress</b> <div style="width: 80%;display: inline;" class="progress-group"> <span class="progress-number">XX%</span> <div class="progress sm"> <div class="progress-bar progress-bar-blue-light" style="width: XX%"></div> </div> </div> </li> I want to add code to display precentage to next rank and progress bar with it. Does someone have an idea? I would appreciate any help! Thanks, Relja
Last reply by CarlosEduardo2409, -
- 1 reply
- 2.1k views
I was wondering if there was a way we could check if pireps are accepted or unaccepted. I was think of something like we can check if the user is an admin or not if he is then the system would check if there are unaccepted pireps. If there are the user would be redirected to the admin page or could be given a notification?
Last reply by Heritage1, -
- 0 replies
- 1.7k views
hello, im use this module, but between to 50 files i want pagination.... <div class="table-responsive"> <table class="table table-hover"> <thead > <tr align="center"> <th>Tipo de Aeronave</th> <th>Matricula</th> <th>Rango</th> <th>Aerolinea</th> <th>Pasajeros</th> <th>Carga Maxima</th> <th>Detalles</th> </tr> </thead> …
Last reply by OWA001, -
- 6 replies
- 3.7k views
Just touching up my pilots list page and wanted to be able to click on Vatsim (mainly) or ivao ID on pilot profile to bring up their flight histories on relevant stats page.. <td> <div align="center"> <a href="<?php echo url('https://vatstats.net/flights/?pilot='.$pilot->pilotid, 'VATSIM ID');?>"> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </a></td> This is displaying their vatsim ID correctly as a clickable link, however its bringing up "http://www.susiairvirtual.com/index.php/https://vatstats.net/flights/?pilot=1" rather than the vatstats page, and its also using the pil…
Last reply by flyalaska, -
- 2 replies
- 4.3k views
Hey guys, I'm not sure about you but I got a lot of fake BS messages through my contact form, and I got really tired of it so I looked for a solution. The fix was fairly simple, and with the same technology you can also stop fake registrations! Since this forum is visible to everyone, and therefore also to those who might be behind these messages, I decided to not share it here directly. You can only view the solution on my blog: http://www.virtualairlines.eu/index.php/Blog when you are logged in!
Last reply by ProAvia, -
- 0 replies
- 1.5k views
Hello I was digging around in phpvms today and came across the functions for url, actionurl, adminurl etc. So I started thinking, it'd be really handy to have something similar for the skin url. So instead of href="<?php echo SITE_URL?>/lib/skins/crystal/styles.css" you would go href="<?php echo url('styles.css'); ?>" that's much shorter, and also if for some reason you'd want to change the folder of your skin you don't need to recode everything. so I wrote that little function, here it is: function skinurl($path="") { if($path[0] != '/') $path='/'.$path; return SITE_URL.'/lib/skins/'.CURRENT_SKIN.$path; } all you n…
Last reply by mischka, -
- 0 replies
- 1.6k views
Closed
Last reply by PedroBoreio, -
- 1 reply
- 1.8k views
Closed topic
Last reply by shakamonkey88, -
Hi i have loded it all up and all ok but when you click the generate button i get this error in the console.. https://imgur.com/3MJL04T
Last reply by sev, -
Flight Board
by sev- 0 replies
- 1.7k views
Hi im looking for the code to apply a acars map and flight board on a landing page before going into crew centre...Thanks Karl Alden
Last reply by sev,