Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 9 replies
- 4.9k views
Hi is there a quick way of displaying the current flight bids on another page just like they are in the admin section?
Last reply by Aaryan, -
Live Fuel Problem work around
by Guest lorathon- 9 replies
- 5.9k views
Since the live fuel server stopped allowing phpVMS users to access the live fuel I have been seeing too many flights with a zero for fuel price. I am assuming this was due to the copy that Nabeel put up for the live lookup. I still wanted to use the live lookup ( I dont like the idea of all of the airports having the same fuel price) so I just looked for a work around. What I wanted was to be able to poll the live fuel server, if there was a price there then use it. If not then use the default. The problem became that sometimes a zero was sent back. The script would then run the fuel calc with zero as the fuel price. So I dug in and worked out a way to accomplish…
Last reply by Ghiby, -
- 9 replies
- 3.1k views
Hello, Could Some one provide me the code to echo the password for the signed in pilot, for creation of kAcars config file. pilot id was: <?php echo $pilotcode?> is there some same code but, for the password? greetz, Jacques
Last reply by Oxymoron290, -
- 9 replies
- 3.8k views
Hi all I have adapted my code to show country and rank but I have a problem it shows the country fine but not the rank here is my code any help would be great thanks. <div id="box"> <div> <h2>Users Online</h2> <p> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); ?> <h4>Pilots Online</h4> <?php $shown = array(); foreach($usersonline as $pilot) { if(in_array($pilot->pilotid, $shown)) continue; else $shown[] = $pilot->pilotid; echo "<p>"; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot-&…
Last reply by Stealthbird97, -
- 1 follower
- 9 replies
- 3.7k views
I posted this question in a older skinning thread, but the thread appears to be closed or at least does not show up on the "new posts list and no one may have seen my post. There is a great code snippet for adding the GC Maps to the site. thread: http://forum.phpvms.net/topic/8040-adding-map/page__hl__+great%20+circle#entry53587 The above thread lists code that will plot the last 10 flights on the main page and ALSO the last 10 flights by a pilot on the pilot's profile page. I would like to modify so that the last 10 flights by a particular airline are shown. My code snippet question: how to make only the flights from one airline appear? I assume you can use some form…
Last reply by Marmus, -
- 9 replies
- 3.2k views
I have top 5 pilots on home page, however the callsign and total hours show like this ... callsign is EIN1234 and the hours are 67 there isnt a space. Could you tell me how to do this. I have added the code below. Thanks in advance. EN123467 <?php $year = date("Y"); $month = date("m")-1; if($month == 0) { //If it's january, previous month is december. $month = 12; $year -= 1; } $pilot = TopPilotData::top_pilot_hours($month, $year, 5); echo '<table>'; foreach ($pilot as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td>'.$pilot->firstname.' '.$pilot->lastname…
Last reply by shaun105, -
- 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, -
- 8 replies
- 4.2k views
Hi How can i change recaptcha theme ? <script type="text/javascript"> var RecaptchaOptions = { theme : 'theme_name' }; </script>
Last reply by joeri, -
- 8 replies
- 4.5k views
Hello All, does anybody have the code for this, I need the green table around it as well. it is on Alaska adventures virtual. Thanks
Last reply by Cor, -
- 8 replies
- 5.4k views
Hey guys, I have a new project that I want to do. I noticed the boarding pass does this thing where is gets a random gate, how can I make it randomly select the specific gate at an airport? For example, I have 14 gates at Las Vegas, and 11 gates at San Jose. If a pilot views the boarding pass I want it to randomly select one of the gate numbers I put in for Vegas. Then I plan on taking this method and putting it in my flight dispatch for pilots. So, how would I go about doing this? Would if be possible to write something like if $airport = KLAS select gates x - x or something of the sort? I'm not all to great with php..
Last reply by CPC900, -
need help with free Pirep code
by Guest- 8 replies
- 2.8k 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…
-
- 8 replies
- 3.7k 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, -
- 1 follower
- 8 replies
- 3.1k 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, -
- 8 replies
- 3.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, -
- 8 replies
- 4.7k views
The rule n° 17 for a va on ivao say: §17: 17. If the VA is active also on other networks and/or allows pilots to fly off-line, thence not necessarily registered on the IVAO network, the pilot roster page on the website should clearly emphasize those registered on the IVAO network. The pilot roster could be divided in 2 or more sections (IVAO pilots, other network pilots, pilots flying off-line etc.) or show, close to each pilot name or callsign, the logo of the network the pilot belongs to with his Vid. for this I modified the code of my phpvms ... anyone is interested?
Last reply by Tato123, -
- 8 replies
- 2.8k views
Hi all, I'm trying to determinate witch flights have been done on time. The logic is: if the flight time is bigger than the estimated, the result is Delayed, else On time. So i simple code: <?php if ($pirep->flighttime > $schedules->flighttime) { echo "Delayed"; } else { echo "On time"; } ?> On results, all flights are "Delayed", and it's not truth. Help guys, what is wrong with my code? Thanks for attention!
Last reply by mseiwald, -
- 1 follower
- 8 replies
- 3.3k views
I've finished a little code snippet for everyone, I was prompted to create this in regards to a particular individual that posted someone else's PHPVMS Skin. Well, the only way this person got this, was either through Fire Fox FireBug plugin, or just plain hacked it. ( the code source that is.) Easy to do now a days, so here, this is for Everyone, and is really simple, short and to the point. This will Protect against a right click to view the page source, if you put this into the ---> layout.php page, and/or the , frontpage_main.php "Anywhere", and of course this can be used anywhere you want. And it IS HTML compliant !! Period. php,htm, html, xml, and xhtml. B…
Last reply by Vangelis, -
- 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, -
- 7 replies
- 4.3k views
Hey, Does anyone know how to make a popup box appear on login? For example, a survey, or a status telling the pilot how many messages they have, their bids, etc. So: Pilot Logs in > PopUp displays > Pilot can then click on one of the links or click 'Close'.
Last reply by freshJet, -
- 7 replies
- 3.4k views
I was looking for this code as I want to put a link on the frond page saying: there are 5 xacars flights - click hee to view Thanks for all the help, james
Last reply by James142, -
- 7 replies
- 4.8k views
Anyone know how I can show the live flights on my home page?? Thanks
Last reply by Jeff, -
- 7 replies
- 3.2k views
I DO NOT TAKE ANY CREDIT FROM SIMPILOT'S SCREENSHOT MODULE! This is a new function to delete the screenshot.
Last reply by TAV1702, -
- 7 replies
- 5.2k views
need help with code to put up stats from a whazzup.txt file. I have this info...and am not sure what to do with it.... <? $whazzuptxt = "whazzup.txt"; //get file $file = file_get_contents('whazzup.txt'); //get clients preg_match('/!CLIENTS(.*?)!SERVERS/ms', $file, $results); $content = trim($results[1]); //get out \r\n so on $lines = preg_split('/(\015\012)|(\015)|(\012)/', $content); //filter for pilot and atc clients function filter ($value) { if (strpos($value, 'PILOT') !== false){ return true; }elseif(strpos($value, 'ATC') !== false){ return true; }else{ return false; } } $lines = array_filter($lines, 'filter'); $br = "<br>"; /g…
Last reply by Jeff, -
- 7 replies
- 3.8k 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, -
- 7 replies
- 3.8k 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, -
- 7 replies
- 3.5k 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, -
- 7 replies
- 4.1k views
Exist module or way to display list of aircraft locations as follow based on pireps? maybe last 10 flights for each.... for example: Aircraft A date: LZIB-LZKZ date: LZKZ-EDDM ... Aircraft B date: XXXX-YYYY date: YYYY-FFFF Thans for help. Peter
Last reply by shiljo, -
- 7 replies
- 3.3k views
Has anyone got a script which creates a different pilot badge depending on the pilot rank? Thanks
-
- 1 follower
- 7 replies
- 4.1k views
How would I go about getting each pilot's total miles flown (all time) on the roster? Like they have the flights and hours, how would I add the miles?
Last reply by ercio, -
- 7 replies
- 6.7k 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,