Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 11 replies
- 23.4k 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, -
- 1 follower
- 10 replies
- 13.6k 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, -
- 2 replies
- 3.5k 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
- 2.2k 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
- 878 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, -
Recent 5 Flights 1 2
by Jeff- 49 replies
- 24k views
I'm trying to show a table of the 5 recent flights flown, and keep running into a brick wall here. Can someone please post the code to show the last 5 flight. Flight Number - Departure Airport - Arrival Airport - Flight Time - Pilot - Landing %
Last reply by Jiko, -
- 2 replies
- 2.1k 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, -
- 2 followers
- 55 replies
- 27.2k views
EDITED ON 20/03/14 - FORGOT ABOUT 3RD FILE AMEND AND ADDED SOME OPTIONAL TWEAKS. If like me, you want to have the route for each live flight shown on the ACARS map, you can make the amendments to three files in order to do so. I've tested this on a custom KACARS install. This will work for scheduled and charter flights as long as a route is entered either in the schedule, or entered into the ACARS program. If a route doesn't exist in the schedule, or one isn't entered in the ACARS program, a straight point to point line will be shown. Files to edit: ​​Make backups of these two files before you proceed!! /core/modules/ACARS/ACARS.php /common/NavData.class.php …
Last reply by Lebitek, -
- 2 followers
- 39 replies
- 12.5k views
This code prevents known spammers (checked against the stopforumspam.com email database) from registering. I've used it in core/modules/Registration/Registration.php within the ProcessRegistration function, as so: // Check email for known spammer $url = 'http://www.stopforumspam.com/api?email='.$data['email']; $file = new CodonWebService(); $contents = $file->get($url); $response = simplexml_load_string($contents); if($response->appears == 'yes'){ $spammer = true; } else { $spammer = false; } if($spammer){ $this->set('message', 'Your email appears on our spam database, we therefore assume you are a spammer and are rejecting your registration request. If …
Last reply by Cor, -
- 30 replies
- 11.6k views
Dear All, The Certificate Of Promotion V_1.1 is now released. Below please find out how it works: Thanks It is a simple module that generates an automatic certificate for its members according to their respective positions in your Virtual Company.. 1º Download the Certificate_Of_Promotion_V1.1 module 2º Extract the downloaded files 3º Login to your FTP account and send the files within the folder Certificate_Of_Promotion_V1.1 to your server 4º Open your profile_main.tpl page choose the location you want to insert the link below that will appear to its pilots. <li><script language="Javascript"> function abrir(URL) { var width = 800; var height =…
Last reply by VIELMA16, -
- 0 replies
- 2.8k 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, -
- 2 followers
- 28 replies
- 10k views
Hi all I have created this form to place in the pilot centre so that if a pilot would like a route added to the VA he/she can fill this in and send it to the schedules manager. I have built the front end but I am struggling with the back end (PHP) could someone help me out? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <form name="contactform" method="post" action="send_form_email.php"> <table width='100%' border='0'> <tr> &…
Last reply by Vangelis, -
- 0 replies
- 3.3k 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.4k 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
- 3k 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.3k 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.1k 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.2k 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.6k 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, -
- 1 follower
- 4 replies
- 7.6k views
Hello Im using chatroll chat in iframe tags and it works as well. Chatroll also has php application but i cant figure out howto make it work in my website. The code of Php Application <?php // Chatroll Single Sign-On (SSO) Parameters $uid = 1; // Current user id $uname = 'test'; // Current user name $ulink = 'http://example.com/profile/test'; // Current user profile URL (leave blank for none) $upic = ''; // Current user profile picture URL (leave blank for none) $ismod = 0; // Is current user a moderator? $sig = md5($uid . $uname . $ismod . 'dwcbbkhmrlldo28m'); $ssoParams = '&uid=' . $uid . "&uname=" . urlencode($uname) . "&ulink="…
Last reply by gio1961, -
- 2 replies
- 3.4k 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.5k 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, -
- 4 replies
- 5.7k views
Hello, I'm looking for the code to show the airline logo on the schedule list when pilots search for it? Does anybody have this code? Regards
Last reply by fardly83, -
- 1 follower
- 8 replies
- 4.5k 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, -
- 7 replies
- 6.2k views
Hi all I am trying to show the below code on the profile_main.php but can't get any of the data to show. Here is the code, I have taken this from pirep_viewreport.php <b>Departure Airport</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->depname?> (<?php echo $pirep->depicao; ?>)</p> </li> <li class="list-group-item"> <b>Arrival Airport</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->arrname?> (<?php echo $pirep->arricao; ?>)</p>…
Last reply by sayedzaafir, -
- 7 replies
- 6.5k views
UPDATE ON 1/30/2016 To start off thanks dave for the Simpilotgroup charter system ! I have modified this script so it would fit my needs and now i thought that i would share it with everyone so whoever had this script would be able to use my idea. My idea was to modify the script so that it would automatically calculate a price for each flight and so it does now. It calculates the price by how many miles the flight is in total and then multiplies 0.75 or however much you want it to be per mile. ps.. No i didnt take this idea from the Realschedule. You will have to have a valid version of this module whether it might be php or the tpl version i have edited a…
Last reply by smokey68, -
- 0 replies
- 3.2k 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.1k 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, -
- 20 replies
- 12.4k views
I know most of you would get this working yourself, but for you who dont here is a sample of the code I use to display custom chart snapshots and links in the pilot briefing page. Also included are the links we use for weather: First of all I gathered all the links for the airports we fly to, based the charts on the lokal vacc at vatsim because many AIP sites require you to log in: I placed snaphost of the ground layout with format ICAO.gif in folder named images/charts . Image size 387*594. It is a bit of work, but I think the result is good. Have only received possitve feedback so far ;D Links placed in the airporttable under 'chartlink' and added a row for link to l…
Last reply by jonesrobin, -
- 2 replies
- 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,