Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 8 replies
- 3k views
Hello everyone, i am trying to built my own award module for my virtual airline in order to have the possibility to add the same award multiple times to a pilot. For now i have stucked on a "silly" part: I want to make an auto count the <tr> of my table awards. Fore example: Auto Number Award Type Issued 1. Good Pilot 10/10/10 2. Good Landing 11/10/12 I just want to create the bold numbers automatically . servetas
Last reply by Strider, -
- 1 reply
- 1.7k views
Would like to see what the code is to show the number of pending pilots.
Last reply by Kyle, -
- 4 replies
- 2.8k views
The latest pilots to join thing on the index is nice and dandy if you keep consecutive Pilot IDs. If you change the Pilot IDs on registration (say, for hub purposes) there is an unfortunate problem where it only shows the highest Pilot ID, which may not necessarily be the newest pilot. I whipped up a work-around that should benefit airlines that do this. This simple change can be condensed even more, but I figured I would create a new Method just to keep things clean (and give me something to fall back on later). Open core/common/PilotData.class.php Add this snippet somewhere (perhaps after the getLatestPilots method, Line ~227) public static function getLatestPilot…
Last reply by Vidofnir, -
- 13 replies
- 3.5k views
i have a question. Is it possible that when I search on airports that when I choose EHAM that only the airports are visible from EHAM and not my Full airport list in arrival? Exmaple: Airliner: British airways Departures EHAM (Amsterdam) Arrival and now only the airports from EHAM. When you do now than have you the full airports list and that is a big list. haha Select aircraft B737-800 I hope that you understand me ïŠ Greets Michael Kraan
Last reply by jacktimo, -
- 4 replies
- 2.4k views
I want to add a link on my website so pilots can download or view a word document. Problem is, I don't know where I can post the document so I can link to it. I tried googledocs but it only stores files, you can't link to the file. I tried uploading them via my cpanel, but the link is not recognized. I'm assuming that is because you need to log in to view that page. Any ideas where I could upload these files to?
Last reply by rpalmer800, -
There is no field for this so if I want the booking date I presume I would just find the phpvms_bids table and add a date field to for a timestamp? And if so is that all or is there more to it?
Last reply by Txmmy83, -
- 0 replies
- 1.7k views
Hi all,Iwould like someonecould help me, ImountedmyAVsystembutwhen I connectFSFKto trackon the map, insteadof maintaininga line tothe pilot and theflight dataposition andeachonceIupdatedacarsgeneratesa new lineandsoindefinitely, asinthe mapdoes not generatea singleplaneiconbutit generatesan icon ineach positionwith the correspondingaspect ofthe planerow of iconsfor eachpositionthatI triedsendingtheacars.Lowithfsacarsand does not generatethiserror, but reportsthat buildsFSFKare much morecomplete. I hopeyour help. Thanksand sorry forthe grammarbecauseI do not speakEnglishproperly
Last reply by AirLevante, -
- 3 replies
- 1.5k views
Hi, there is some error in getReportsByAcceptStatus function in PIREPData.class.php. It is in around line 438. Change /** * Get all of a pilot's reports by status * * @param int $pilotid The Pilot ID to find * @param integer $accept PIREP_PENDING, PIREP_ACCEPTED, PIREP_REJECTED, PIREP_INPROGRESS * @return */ public static function getReportsByAcceptStatus($pilotid, $accept = 0) { return self::findPIREPS(array( 'pilotid' => intval($pilotid), 'accepted' => intval($accept) ) ); } to /** * Get all of a pilot's reports by status * * @param int $pilotid The Pilot ID to find * @param integer $accept PIREP_PENDING, PIREP_ACCEPTED, PIREP_REJEC…
Last reply by Kyle, -
- 2 replies
- 2.3k views
I have the currently booked flights showing on my main page of my site. I am having a problem trying to show the airline image for the current booked flight. I can get it to show the spot for the Airline in the title, but I cannot get the image to pull from my image folder. Can someone please please assist me with this. I have been up searching on here for hours and trying to make it work: this is my code:\ Thanks to anyone that can help me with this <h3>Currently Booked Flights</h3> <?php if(!$lastbids) { echo '<p align="left">No flights have currently been booked</p>'; return; } ?> <table width="100%" cellpadding="1" cellspacin…
Last reply by smoke2312, -
- 1 follower
- 8 replies
- 2.7k views
Hi made a little Snippet in /core/templates/schedule_results.tpl It shows like this : Here is the code (Line 14-78 in my code) <tbody> <?php foreach($schedule_list as $schedule) { ?> <tr> <td> <a href="<?php echo url('/schedules/details/'.$schedule->id);?>"><?php echo $schedule->code . $schedule->flightnum?> <?php echo '('.$schedule->depicao.' - '.$schedule->arricao.')'?> </a> <br /> <strong>Departure: </strong><?php echo $schedule->deptime;?> <strong>Arrival: </strong><?php echo $schedule->arrtime;?><br /> <strong>Equipm…
Last reply by tutmeister, -
- 7 replies
- 3.1k views
Hello, Is there a way in PHPVMS to show the route that a pilot has flown so far on the ACARS page like this: http://screenshooter.net/9948368/rwksmof Greets, Martijn
Last reply by Scandi7, -
Hello guys, Is there a way to show a route that is generated from a website like this: http://www.vataware....om=LEMD&to=GCTS directly into a flightplan? So that it will show in this example the following route: "CCS UN975 BIRBA UN873 SOTEX UZ223 BEXAL UN866 KONBA ` Regards, Martijn
Last reply by tgycgijoes, -
- 5 replies
- 3k views
Hey guys, Just wondering if anyone have some code so that on the sidebar menu it will have "My Bookings" and underneath it will say "you havent booked a flight yet<br />Click Here to to get a flight. And when you have Bid for a flight it will shouw the departure and destination??? Thanks for the help (See ya in the skies) Kieran
Last reply by HighFlyerPL185, -
- 7 replies
- 3.4k views
Hi, I'm trying to add a color part in the touchdowns, but when i add this code: echo '<td>'.if($stat->landingrate > -300) echo '<font color="green">'.$stat->landingrate.' ft/m</font>'; elseif($stat->landingrate <= -300)echo '<font color="red">'.$stat->landingrate.' ft/m</font>'.'</td>'; I'm getting this error: Parse error: syntax error, unexpected T_IF in Why i put it on a different part of the page outside the <td> </td> it is working, so i'm doing something wrong, but can't figure out what. Hope someone can help me out. Edwin
Last reply by Edwin, -
- 1 reply
- 2.1k views
I've got an arrivals board with latest flights but I want it to display whether it's early, on time or delayed. Here's my code: $actualtime = $pirep->flighttime; $schedtime = $schedule->flighttime; if($actualtime < $schedtime){ echo '<td>Early</td>'; } elseif($actualtime > $schedtime){ echo '<td>Delayed</td>'; } else { echo '<td>On Time</td>'; } It only shows it as delayed at the moment though. Anyone help? http://www.freshjetvirtual.com/
Last reply by Txmmy83, -
- 0 replies
- 1.5k views
If you have manual rank settings, this code seems more appropriate for promotion information than the default. Default file name: profile_main.tpl default code: <p>You have <?php echo ($nextrank->minhours - $pilot_hours)?> hours left until your promotion to <?php echo $nextrank->rank?></p replacement code: <p>You must have at least <?php echo ($nextrank->minhours)?> hours to be eligible for <?php echo $nextrank->rank?>.</p>
Last reply by C1971W, -
- 7 replies
- 3.4k views
There's an excellent post on this forum for calculating percentage complete. After scratching my head figuring out why this wouldn't work for me, I realized that xacars, and subsequently kacars as well, does not calculate distance remaining. Which explains why this data never shows up on my map. I modifed ACARS.PHP to manually calculate the distance remaining no matter what client you're using. I've only tested this with xacars client. I'll also post the percentage complete code here as well as I've modified that slightly. ASCARS.PHP located in core/modules/ACARS <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad *…
Last reply by CarlosGarcia, -
- 0 replies
- 1.8k views
Hi, i like have the module with Awards in the Pilot's Profile, with the comment: Issued by .... and the date and/or other comments from the staff member... Like IVAO's profile, or you can view it: http://www.transavia-virtual.com/index.php?action=rosterdetail〈=en&name=Nino&prefix=&surname=Beerens If you click in the images on the left you have this: Dispatch qualified by: Byron Visser @ 06-01-2010 18:09z Exam/training did on 6-01-2010, goodluck en have fun with dispatching ! I really like it... Do you know any code for do that? Thank you so much!
Last reply by Blu-Express VA, -
- 5 replies
- 3.8k views
Can somebody please explain to me how to get the vatsim ID on the pilot roster. If it is already here, i just cant find it... sorry, Thanks!
Last reply by rpalmer800, -
- 0 replies
- 1.8k views
The Europe Weather Maps have been down for a few months now, but here's the fix! Replace your old code with the following: <div align="center"> <img src="http://www.jetplan.com/weather/data/maps/euwt10006.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_st.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_st_anim.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_rh.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_rh_anim.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_ws.gif" /> <img src="http://icons-ak.wunderground.com/data/…
Last reply by freshJet, -
- 4 replies
- 2.8k views
Hello and Happy New Year to all, At my virtual airline, each pilot is required to submit two (2) PIREPs each month. I'm curious to know how I can modify either my app.config.php or local.config.php file to verify this for each pilot before declaring them inactive. I'm also looking to obtain a script that will send a pilot three (3) emails: 1) One email that alerts them that I've reached inactive status and need to complete two (2) flights to remain active. 2) Another email that gets sent out two (2) weeks after the previous one which will warn them that they are nearing termination. And 3) the third one will alert them that they are terminated following two (2) weeks of…
Last reply by AGuyFawkesMask, -
- 0 replies
- 1.7k views
friends, I wonder if you can, make a simple flight. example: A pilot with an initial rating, can operate for 6 airports to complete your scale flight. The pilot rating and an average amount of time is released routes to 12 airports to complete your scale flight. When you get to the last rating will be released all domestic and international flights, is it possible? the idea is good? tks.
Last reply by CN@ndo, -
- 0 replies
- 1.3k views
How can i make it that the search schedules on the site .../pireps/routesmap on several undersides are indicated. Any help would be great... Regards from Germany
Last reply by AEUfly, -
- 0 replies
- 1.4k views
Hey, I'm searching for an addon that let me see all the aircraft and their current location on a map (airport)... not like the Live map thanks
Last reply by Moritus, -
- 1 reply
- 2.3k views
Hello, I'm trying to create a code that alter the condition of the aircraft when a pirep is been submitted. it looks to the landing rate, so when the landing rate is below 200 than 0.5% off the condition. when a landing rate is higher than 200 than 2% of condition. when a landing rate is higher than 500 than 50% off condition. so far i have: $pos = find_in_fsacars_log('TouchDown:Rate', $log); $landingrate = str_replace('TouchDown:Rate', '', $log[$pos]); $count = preg_match('/([0-9]*:[0-9]*).*([-+]\d*).*/i', $landingrate, $matches); if($count > 0) { PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2])); } PIREPData…
Last reply by Jakes, -
- 1 follower
- 3 replies
- 2.3k views
Is it possible? So that you can have the latest route from vRoute in the schedules for all flights?
Last reply by druptown, -
- 2 replies
- 2k views
Is there any way to get like a roster of the pilots in a hub on to a hub page?
Last reply by rpalmer800, -
- 8 replies
- 3.4k views
I know this should be pretty simple but I can't get it to work! I've got this on my layout.tpl (it's part of the auth login code): $pilotname = PilotData::GetPilotData(Auth::$userinfo->$firstname); But it just shows blank - no errors or anything. Any ideas?
Last reply by freshJet, -
- 5 replies
- 5.8k views
No charts are displayed for any airports in the schdule briefing, so I modified the code to display charts found in the database. If no charts are found it will display the default link for airnav.com plus the message "No local charts found, try - [airnavlink]". You can see it here: http://www.flybritair.com/index.php/schedules/brief/1 You have to edit schedule_briefing.tpl Replace: <table width="98%" align="center"> <tr style="background-color: #333; color: #FFF;"> <td>Charts for <?php echo $schedule->depicao?></td> <td>Charts for <?php echo $schedule->arricao?></td> </tr> <tr align="center"> &l…
Last reply by tgycgijoes, -
need help with free Pirep code
by Guest- 8 replies
- 2.6k views
this is HTML code for Free Pirep and i want use this code in my site can any one help me to change this code and how can i use it in my site <!doctype html public "-//w3c//dtd html 4.01 transitional//en"><HTML> <!-- saved from url=(0031)http://xxxxx/pirep.asp --> <!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Language" content="en-us"> <!-- Validated at 10/27/2011 10:10:38 PM --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin templat…