Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 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
- 2.1k views
Hey, I think,if have a way to get routes direct from other sites,because if you have a lot of a routes do add, is very tiring and time consuming to add with admin panel. Waiting. Thanx
Last reply by Gabriel Fernandez, -
- 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, -
- 28 replies
- 9.5k views
$last_location = PIREPData::getLastReports([PILOT_ID], 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; Of course, replacing the [PILOT ID] with the variable holding the pilot's ID
Last reply by Marmus, -
Getting airport country names
by Guest chikolol- 3 replies
- 2.8k views
sorry to post this again, i know i have posted this before but no one answers me, how can i call for the country name of the airport to show in schedules details along with the airport name, i know something like $schedules->name pulls our the airport name but how about $schedules->country would that work?
-
- 20 replies
- 4.4k views
Hello, I am looking for the aircraft registration, the flight number without the IATA Code, the departure hour, departure minute, arrival hour, arrival minute and the route on the briefing page. Does someone have this codes? Greetings Julius
Last reply by alpsJet, -
- 4 replies
- 2.4k views
How can I get the Great Circle Mapper Code only show the Pilots flights. <?php $flights = PIREPData::getRecentReportsByCount(5); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=790x400&PM=permr:diamond7:green%2b%22%25I%22:white&PC=%fffff" /><br /> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> It should only show the logged in pilots flights on the map. Thanks in Advance.
Last reply by Stealthbird97, -
- 2 replies
- 1.6k views
Hello I have set up a module in my phpvms and when I link my button in the nav bar it show to everybody as normal but what I would like to do is only show the button to people in a group I have made up in the admin panel. I have found this but it doesn't work just returns and error on the line with the link on. <?php if(Auth::UserInGroup('GroupName')) { echo '<li>Your link here</li>'; } ?> Any ideas how to fix this? Thanks
Last reply by lancaster123, -
- 5 replies
- 2.5k views
I would like to set something up on Pilots Profile where only people in Groups can see the content, this has failed. I wondered whether anyone knew a code that would work were only Certain groups can see the content.
Last reply by TAV1702, -
- 0 replies
- 1.4k views
Hello all, is possible to compress phpvms with something like this? if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); I have tried but allways get errors and css problems. My homepage(root) isn't phpvms and is compressed, the foruns phpbb3(root/phpbb3) is compressed too. The phpvms is in root/folder/phpvms but can´t compress. To do the tests i used this website http://www.gidnetwor...s/gzip-test.php Anyone ever tried? Thank you
Last reply by piuozorio, -
- 5 replies
- 2.1k views
vFleetTracker I try to make so that page (indeks.tpl) shows the status of each aircraft. - This plane is not booked - This plane is booked - The aircraft in flight - You do not have access to this aircraft. If the aircraft is free - it is possible to click and see which flight you can do it in view of what he's airport. <?php $data = OperationsData::getAllAircraft(); $online = ACARSData::GetACARSData(); $lastbid = ACARSData::GetACARSData(); $airports = array(); foreach(OperationsData::getAllAirports() as $aircraft) $airports[$aircraft->icao] = $aircraft; foreach($data as $aircraft){ if($aircraft->charter == 0) { if($aircraft->icao != 'SU95') conti…
Last reply by bass, -
- 0 replies
- 2k views
Hello help me? I'm having trouble because my phpvms not this show the information in pafina / index / profile I already tried the tutotial (Getting variables in templates) more will not Tutorial:(http://forum.phpvms.net/page/index.html/_/skinning-and-customization-guides/getting-variables-in-templates-r34) <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link href="<?php echo SITE_URL?>/lib/skins/flytam/style.css" rel="stylesheet" media="all" /> <?php /*Any custom Javascript should be placed below this line, after t…
Last reply by pedrobrandine, -
- 1 follower
- 8 replies
- 1.9k views
I have code in which I list the flights. Help write the code, so if flight is not found, displays a message that NO schedules! <table class="table table-bordered" width="40%" border="0" cellspacing="0" cellpadding="0"> <tr class="active"> <th colspan="7"><center> СпиÑок рейÑов из ÐÑропорта </center></th> </tr> <tr class="active"> <th>Ðомер рейÑа <i class="soap-icon-status"></i></th> <th>ÐÑропорт вылета <i class="soap-icon-securevault"></i></th> <th>ÐÑропорт Ð¿Ñ€Ð¸Ð±Ñ‹Ñ‚Ð¸Ñ <i class="soap-icon-securevault"&…
Last reply by Vangelis, -
- 1 reply
- 1.9k views
Hi Guys, What im trying to do is when a manual PIREP is submitted on my website I need the arricao to go into a custom field in my aircraft table called location. I have tried changing this section in PIREPData.class.php but it don't work: $sql = "INSERT INTO ".TABLE_PREFIX."pireps( `pilotid`, `code`, `flightnum`, `depicao`, `arricao`, `location`, `route`, `route_details`, `distance`, `aircraft`, `flighttime`, `flighttime_stamp`, `landingrate`, `submitdate`, `accepted`, `log`, `load`, `fuelused`, `expenselist`, `source`, `pob`, `exported`, `rawdata`) VALUES ( {$pirepdata['pilotid']}, '{$pirepdata['code']}', '{$pirepdata['flightnum']}', '{$pi…
Last reply by simpilot, -
- 1 follower
- 3 replies
- 5.1k views
Hello, i'm trying to use google flight search api but dont know how to "decode" the result. The search is ok, i'm using this code with (solutions => "1") i put 1 just for tests, but want more <?php $data = array ( "request" => array( "passengers" => array( adultCount => 1 ), "slice" => array( array( origin => "LIS", destination => "OPO", date => "2015-05-09"), ), solutions => "1" ), ); $data_string = json_encode($data);$ch = curl_init('https://www.googleap...ch?key=MyAPIKey'); curl_setopt($ch, CURLOPT…
Last reply by aliatwa, -
- 1 follower
- 4 replies
- 1.9k views
Prompt how to report (pirep_viewreport.tpl) on the flight of the log page to display a pitch angle of (...) deg.?
Last reply by bass, -
- 1 reply
- 1.7k views
I am a web designer and would like to build my own VA website, do you guys have all the codes that i would need to add different functionality to my site and is there any video tutorial that explains step by step how to go about adding such scripts in for some who may not know who are beginners....reason i ask is because i have many folks here who is into aviation looking to start a VA and get their sites up but i have to first get clearification as to building one and teaching them how i got it done.
Last reply by Sava, -
- 2 replies
- 1.9k views
I have domicile managers that serve three hubs. I would like them to be able to view there three hubs when they are in the admin center. Right now they can only view the hub they are assigned to. Does anyone know how i can get this to work? Thanks Jorge O'Connor
Last reply by jeep865, -
- 2 replies
- 1.8k views
How can I add Notam's to the pilot center for that the pilots can see?
Last reply by souljony, -
- 2 replies
- 1.8k views
Hi how do I align my pilot roster so all the ranks and everything are all aligned under each other?
Last reply by bunoire14, -
- 1 follower
- 3 replies
- 1.9k views
Hello all , i am trying to add the Airport Metar in frontpage_main can anyone help how to do it ? i am trying with several ways but dose not work . also NOTAMS if possible Thank and Regrade.
Last reply by alyousafi, -
- 0 replies
- 1.5k 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, -
- 12 replies
- 4.2k views
Hi guys, I'm trying to populate the the route_detais in phpvms_acarsdata table. Now im using a custom KACARS by Jeff. But, at this moment, he can't get any new order. Thanks for any help,
Last reply by Ademar Andrade, -
- 4 replies
- 2.1k views
I have tried <?php echo $price;?> and it didn't giveme error codes but it didn't show it ether is here something im missing? like the guy had code it it put it like this <td><?php echo util::FormatDration($route->flighttime) ; >--></td>
Last reply by jusromaine, -
- 3 replies
- 2.1k views
Hey all, I just tried this and it works a treat. It basically uses Great Circle Mapper instead of Google Maps to display the flight on the flight details page. I'm using it because I'm having problems regarding Google Maps. I'll be surprised if anyone uses it. <img src="http://www.gcmap.com/map?P=<?php echo $schedule->depicao ?>-<?php echo $schedule->arricao ?>&MS=wls&MR=15&MX=720x360&PM=*" /> Obviously, you can change the size by editing the '720x360' part. Hope this helped.
Last reply by mark1million, -
- 11 replies
- 3.5k views
Hello, Would anybody know the code to split up the hubs into airline categories on the registration page like this?. Regards Michael
Last reply by Stealthbird97, -
- 4 replies
- 5.7k views
is there a code that allows you to put the pilots hub next to their name in the pilot roster without sorting the roster by hubs?
Last reply by web541, -
- 1 reply
- 1.6k views
A little snipet that will help you add links for pilots over an amount of logged hours Example i let people over 80 hours to access charter flights so when they go over 80 hours a link comes up in their profile Change number 10 to less or more hours accordingly <?php $url = "http://www.websiteurl.net/index.php/charter"; $site_title = "Charter Flights"; if((Auth::$userinfo->totalhours + Auth::$userinfo->transferhours)<10) { //Dont show anything if hours are less than needed } else { Echo "<a href=$url>$site_title</a>" ; } ?>
Last reply by servetas, -
- 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, -
- 1 follower
- 3 replies
- 2.2k views
Is it possible? So that you can have the latest route from vRoute in the schedules for all flights?
Last reply by druptown,