Jump to content
vbegin72

Simpilotgroup charter (auto-price)

Recommended Posts

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 few file to make the changes and i have posted them below in a code box feel free to use this just as i did.

Files that you will be editing are listed below and i have also told you where to locate them.

CharterCenter.php - Can be found in - yourphpvmsfolder/core/modules/CharterCenter

You will only be placing the last line of code in the box below the other three are reference points you will find this code around 157 paste in the last line of code in the box below exactly where i have it placed based on the reference points ! or it will not work correctly !

 $depicao = DB::escape($this->post->depicao);
 $arricao = DB::escape($this->post->arricao);
 $distance = DB::escape($this->post->distance);
$price = DB::escape($this->post->price); <--this is the snippet you are placing
 

Same as above you are only placing the third line in the box below the other two are reference points you will find this code around 175 paste in the last line of code in the box below exactly where i have it placed based on the reference points ! or it will not work correctly !

 $charter[flighttime] = '';
$charter[daysofweek] = '0123456';
$charter[price] = $price; <--this is the snippet you are placing[/b][/font]
 

Then we will be editing the template so when you create a new charter the distance will be able to calculate with price per mile.

Chartercenter_verify.tpl or php - after line 75 make a new line and will will paste the code below on line now 76. you will see where i have 1.45 you may change that to whatever to be your price per mile

<input type="hidden" name="price" value="<?php echo round ($distance, 0) * 1.45 * 0.20 + round ($distance, 0) * 1.45;?>" />
 

understand how its written -

it will find the distance of your flight and multiply the price per mile and then multiply that by .20 % and then round the distance once again and then it multiplies that number by 1.45 trust me its not repeating itself on the first go around it was just getting .20% to add to the end to be able to make the price more accurate and then multiplied the distance and ppm again and added it to the end.

---------

I will soon figure out how to make it calculate passengers then multiply how much per person per mile and use that and adding .20 - .30 % percent to the end to cover fuel costs if it goes over.

I have had fun making this and had fun seeing daves work i hope this helps and if you are confused just reply !

Sincerely,

Vince

-----------

Thanks again Dave !

Edited by vbegin72
  • Like 1

Share this post


Link to post
Share on other sites

I have changed one small thing take a look

<input type="hidden" name="price" value="<?php echo round ($distance, 0) * 1.45 * 0.20 + round ($distance, 0) * 1.45;?>" />

i am now calculating the distance and multiply that times 1.45 (ticket price per mile) then multiply that by 0.20% then add my price per mile back to that number i get after pecent helps in revenue when pirep is submitted.

Share this post


Link to post
Share on other sites

Thanks for your contribution but could you please use a normal font in the future.

It's really difficult to read.

Share this post


Link to post
Share on other sites

Thanks for your contribution but could you please use a normal font in the future.

It's really difficult to read.

Sorry about that i really didn't notice it changing fonts thanks though but (my browser had conic sans set as default)

Share this post


Link to post
Share on other sites

No problem i just thought i'd mention it as it was really hard to read. It looked like some handwritten font on my chrome and Safari browsers.

Now it's perfect ;)

Share this post


Link to post
Share on other sites
On 1/31/2016 at 9:01 PM, mseiwald said:

No problem i just thought i'd mention it as it was really hard to read. It looked like some handwritten font on my chrome and Safari browsers.

Now it's perfect ;)

Has anyone used this script or has the prices affected your airline in a good or bad way ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×