# Code Snippets

**URL:** https://forum.phpvms.net/c/legacy-archive/code-snippets/22.md

[Latest](https://forum.phpvms.net/latest.md) · [Categories](https://forum.phpvms.net/categories.md) · [Tags](https://forum.phpvms.net/tags.md)

---

## [About the Code Snippets category](https://forum.phpvms.net/t/about-the-code-snippets-category/24)

<div class="topic-metadata">

**Author:** [@system](https://forum.phpvms.net/u/system)\
**Replies:** 0\
**Last updated:** [March 8, 2026, 9:34pm UTC](https://forum.phpvms.net/t/about-the-code-snippets-category/24 "2026-03-08T21:34:09Z")

</div>

Pieces of code you can use around your site

---

## [phpVMS Database Call Sheet](https://forum.phpvms.net/t/phpvms-database-call-sheet/9181)

<div class="topic-metadata">

**Author:** [@StartVM](https://forum.phpvms.net/u/StartVM)\
**Replies:** 10\
**Last updated:** [June 22, 2017, 7:12am UTC](https://forum.phpvms.net/t/phpvms-database-call-sheet/9181 "2017-06-22T07:12:30Z")

</div>

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…

---

## [Developing Custom Pages/Modules and MVC](https://forum.phpvms.net/t/developing-custom-pages-modules-and-mvc/6931)

<div class="topic-metadata">

**Author:** [@Sava](https://forum.phpvms.net/u/Sava)\
**Replies:** 11\
**Last updated:** [June 29, 2017, 10:20am UTC](https://forum.phpvms.net/t/developing-custom-pages-modules-and-mvc/6931 "2017-06-29T10:20:41Z")

</div>

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 w…

---

## [5 minute fix to stop fake registrations and contact form spam](https://forum.phpvms.net/t/5-minute-fix-to-stop-fake-registrations-and-contact-form-spam/12042)

<div class="topic-metadata">

**Author:** [@mischka](https://forum.phpvms.net/u/mischka)\
**Replies:** 2\
**Last updated:** [May 17, 2024, 7:10pm UTC](https://forum.phpvms.net/t/5-minute-fix-to-stop-fake-registrations-and-contact-form-spam/12042 "2024-05-17T19:10:12Z")

</div>

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 als…

---

## [Geodesic Line Flight Path for v5.5.2](https://forum.phpvms.net/t/geodesic-line-flight-path-for-v5-5-2/13920)

<div class="topic-metadata">

**Author:** [@swaluver480](https://forum.phpvms.net/u/swaluver480)\
**Replies:** 0\
**Last updated:** [July 13, 2023, 5:44pm UTC](https://forum.phpvms.net/t/geodesic-line-flight-path-for-v5-5-2/13920 "2023-07-13T17:44:31Z")

</div>

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 …

---

## [Flight bids and Live Flights](https://forum.phpvms.net/t/flight-bids-and-live-flights/13863)

<div class="topic-metadata">

**Author:** [@Atcarrillo](https://forum.phpvms.net/u/Atcarrillo)\
**Replies:** 3\
**Last updated:** [February 5, 2023, 12:59am UTC](https://forum.phpvms.net/t/flight-bids-and-live-flights/13863 "2023-02-05T00:59:42Z")

</div>

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 displ…

---

## [Recent 5 Flights](https://forum.phpvms.net/t/recent-5-flights/3038)

<div class="topic-metadata">

**Author:** [@Jeff](https://forum.phpvms.net/u/Jeff)\
**Replies:** 36\
**Last updated:** [December 9, 2020, 2:19am UTC](https://forum.phpvms.net/t/recent-5-flights/3038 "2020-12-09T02:19:53Z")

</div>

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…

---

## [Using textbox instead of Dropdown in Schedule Search](https://forum.phpvms.net/t/using-textbox-instead-of-dropdown-in-schedule-search/13447)

<div class="topic-metadata">

**Author:** [@Dyl1103](https://forum.phpvms.net/u/Dyl1103)\
**Replies:** 2\
**Last updated:** [October 29, 2020, 4:34pm UTC](https://forum.phpvms.net/t/using-textbox-instead-of-dropdown-in-schedule-search/13447 "2020-10-29T16:34:17Z")

</div>

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 w…

---

## [Flight Route on Live ACARS Map](https://forum.phpvms.net/t/flight-route-on-live-acars-map/9061)

<div class="topic-metadata">

**Author:** [@stuartpb](https://forum.phpvms.net/u/stuartpb)\
**Replies:** 55\
**Last updated:** [September 1, 2020, 2:08pm UTC](https://forum.phpvms.net/t/flight-route-on-live-acars-map/9061 "2020-09-01T14:08:18Z")

</div>

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…

---

## [Prevent known spammers](https://forum.phpvms.net/t/prevent-known-spammers/4669)

<div class="topic-metadata">

**Author:** [@Tom](https://forum.phpvms.net/u/Tom)\
**Replies:** 39\
**Last updated:** [August 3, 2020, 2:54am UTC](https://forum.phpvms.net/t/prevent-known-spammers/4669 "2020-08-03T02:54:06Z")

</div>

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: // C…

---

## [Certificate Of Promotion V1.1](https://forum.phpvms.net/t/certificate-of-promotion-v1-1/10015)

<div class="topic-metadata">

**Author:** [@Fernando](https://forum.phpvms.net/u/Fernando)\
**Replies:** 30\
**Last updated:** [July 6, 2020, 9:15pm UTC](https://forum.phpvms.net/t/certificate-of-promotion-v1-1/10015 "2020-07-06T21:15:11Z")

</div>

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 posi…

---

## [Pirep Times](https://forum.phpvms.net/t/pirep-times/13353)

<div class="topic-metadata">

**Author:** [@Mickey](https://forum.phpvms.net/u/Mickey)\
**Replies:** 0\
**Last updated:** [June 30, 2020, 9:57pm UTC](https://forum.phpvms.net/t/pirep-times/13353 "2020-06-30T21:57:48Z")

</div>

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

---

## [Pilot submitted route](https://forum.phpvms.net/t/pilot-submitted-route/10132)

<div class="topic-metadata">

**Author:** [@Angel\_Air](https://forum.phpvms.net/u/Angel_Air)\
**Replies:** 28\
**Last updated:** [June 9, 2020, 11:07am UTC](https://forum.phpvms.net/t/pilot-submitted-route/10132 "2020-06-09T11:07:19Z")

</div>

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 strugg…

---

## [Different icons for different aircraft type on live map (Code help request)](https://forum.phpvms.net/t/different-icons-for-different-aircraft-type-on-live-map-code-help-request/13228)

<div class="topic-metadata">

**Author:** [@miniarma](https://forum.phpvms.net/u/miniarma)\
**Replies:** 0\
**Last updated:** [April 13, 2020, 3:39pm UTC](https://forum.phpvms.net/t/different-icons-for-different-aircraft-type-on-live-map-code-help-request/13228 "2020-04-13T15:39:39Z")

</div>

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 …

---

## [Total hours to Next Rank - Code request](https://forum.phpvms.net/t/total-hours-to-next-rank-code-request/13212)

<div class="topic-metadata">

**Author:** [@djtiger76](https://forum.phpvms.net/u/djtiger76)\
**Replies:** 4\
**Last updated:** [April 4, 2020, 11:19pm UTC](https://forum.phpvms.net/t/total-hours-to-next-rank-code-request/13212 "2020-04-04T23:19:00Z")

</div>

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 n…

---

## [Little security check snippet](https://forum.phpvms.net/t/little-security-check-snippet/13188)

<div class="topic-metadata">

**Author:** [@Parkho](https://forum.phpvms.net/u/Parkho)\
**Replies:** 0\
**Last updated:** [March 25, 2020, 5:58pm UTC](https://forum.phpvms.net/t/little-security-check-snippet/13188 "2020-03-25T17:58:51Z")

</div>

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\\\> \\\<l…

---

## [code to show airline logo](https://forum.phpvms.net/t/code-to-show-airline-logo/13151)

<div class="topic-metadata">

**Author:** [@VIELMA16](https://forum.phpvms.net/u/VIELMA16)\
**Replies:** 1\
**Last updated:** [March 2, 2020, 7:56pm UTC](https://forum.phpvms.net/t/code-to-show-airline-logo/13151 "2020-03-02T19:56:35Z")

</div>

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…

---

## [Free jumpseat](https://forum.phpvms.net/t/free-jumpseat/12950)

<div class="topic-metadata">

**Author:** [@Highskies](https://forum.phpvms.net/u/Highskies)\
**Replies:** 4\
**Last updated:** [November 3, 2019, 2:28am UTC](https://forum.phpvms.net/t/free-jumpseat/12950 "2019-11-03T02:28:07Z")

</div>

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.

---

## [\[Tutorial\] Add option to disable download category](https://forum.phpvms.net/t/tutorial-add-option-to-disable-download-category/12911)

<div class="topic-metadata">

**Author:** [@Karamellwuerfel](https://forum.phpvms.net/u/Karamellwuerfel)\
**Replies:** 0\
**Last updated:** [July 4, 2019, 11:14am UTC](https://forum.phpvms.net/t/tutorial-add-option-to-disable-download-category/12911 "2019-07-04T11:14:31Z")

</div>

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 informati…

---

## [Content by Rank](https://forum.phpvms.net/t/content-by-rank/12898)

<div class="topic-metadata">

**Author:** [@flyalaska](https://forum.phpvms.net/u/flyalaska)\
**Replies:** 2\
**Last updated:** [June 23, 2019, 1:47am UTC](https://forum.phpvms.net/t/content-by-rank/12898 "2019-06-23T01:47:41Z")

</div>

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

---

## [Chatroll Php Chat](https://forum.phpvms.net/t/chatroll-php-chat/8037)

<div class="topic-metadata">

**Author:** [@TK0001](https://forum.phpvms.net/u/TK0001)\
**Replies:** 4\
**Last updated:** [June 11, 2019, 7:30pm UTC](https://forum.phpvms.net/t/chatroll-php-chat/8037 "2019-06-11T19:30:39Z")

</div>

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 (…

---

## [Alphabetic add-on list (admin)](https://forum.phpvms.net/t/alphabetic-add-on-list-admin/12874)

<div class="topic-metadata">

**Author:** [@Karamellwuerfel](https://forum.phpvms.net/u/Karamellwuerfel)\
**Replies:** 2\
**Last updated:** [May 25, 2019, 6:37pm UTC](https://forum.phpvms.net/t/alphabetic-add-on-list-admin/12874 "2019-05-25T18:37:12Z")

</div>

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 fun…

---

## [Move flightMarkers smoothly to new position](https://forum.phpvms.net/t/move-flightmarkers-smoothly-to-new-position/12853)

<div class="topic-metadata">

**Author:** [@piuozorio](https://forum.phpvms.net/u/piuozorio)\
**Replies:** 1\
**Last updated:** [April 26, 2019, 10:31am UTC](https://forum.phpvms.net/t/move-flightmarkers-smoothly-to-new-position/12853 "2019-04-26T10:31:04Z")

</div>

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. Whe…

---

## [Airline Logo on Schedules List](https://forum.phpvms.net/t/airline-logo-on-schedules-list/10257)

<div class="topic-metadata">

**Author:** [@MC1028](https://forum.phpvms.net/u/MC1028)\
**Replies:** 4\
**Last updated:** [April 8, 2019, 4:05am UTC](https://forum.phpvms.net/t/airline-logo-on-schedules-list/10257 "2019-04-08T04:05:19Z")

</div>

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 Flight](https://forum.phpvms.net/t/last-flight/12826)

<div class="topic-metadata">

**Author:** [@sayedzaafir](https://forum.phpvms.net/u/sayedzaafir)\
**Replies:** 8\
**Last updated:** [March 28, 2019, 6:07pm UTC](https://forum.phpvms.net/t/last-flight/12826 "2019-03-28T18:07:25Z")

</div>

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 Fli…

---

## [Pilots Last Flight](https://forum.phpvms.net/t/pilots-last-flight/11676)

<div class="topic-metadata">

**Author:** [@Angel\_Air](https://forum.phpvms.net/u/Angel_Air)\
**Replies:** 7\
**Last updated:** [March 19, 2019, 11:19pm UTC](https://forum.phpvms.net/t/pilots-last-flight/11676 "2019-03-19T23:19:27Z")

</div>

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…

---

## [Simpilotgroup charter (auto-price)](https://forum.phpvms.net/t/simpilotgroup-charter-auto-price/10797)

<div class="topic-metadata">

**Author:** [@smokey68](https://forum.phpvms.net/u/smokey68)\
**Replies:** 7\
**Last updated:** [November 26, 2018, 12:40am UTC](https://forum.phpvms.net/t/simpilotgroup-charter-auto-price/10797 "2018-11-26T00:40:17Z")

</div>

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 …

---

## [Check Bid inflight before delete expired bid](https://forum.phpvms.net/t/check-bid-inflight-before-delete-expired-bid/12741)

<div class="topic-metadata">

**Author:** [@Sovereign](https://forum.phpvms.net/u/Sovereign)\
**Replies:** 0\
**Last updated:** [November 21, 2018, 2:14pm UTC](https://forum.phpvms.net/t/check-bid-inflight-before-delete-expired-bid/12741 "2018-11-21T14:14:14Z")

</div>

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 ava…

---

## [Flight 'snail trail' on the ACARS map](https://forum.phpvms.net/t/flight-snail-trail-on-the-acars-map/12651)

<div class="topic-metadata">

**Author:** [@Baileypellow](https://forum.phpvms.net/u/Baileypellow)\
**Replies:** 1\
**Last updated:** [November 19, 2018, 3:45pm UTC](https://forum.phpvms.net/t/flight-snail-trail-on-the-acars-map/12651 "2018-11-19T15:45:05Z")

</div>

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 th…

---

## [Adding custom chart database](https://forum.phpvms.net/t/adding-custom-chart-database/1246)

<div class="topic-metadata">

**Author:** [@jantorre](https://forum.phpvms.net/u/jantorre)\
**Replies:** 18\
**Last updated:** [September 6, 2018, 9:45pm UTC](https://forum.phpvms.net/t/adding-custom-chart-database/1246 "2018-09-06T21:45:23Z")

</div>

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 w…

[Next page](https://forum.phpvms.net/c/legacy-archive/code-snippets/22.md?page=1)
