smokey68 Posted January 27, 2016 Report Posted January 27, 2016 (edited) 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 December 14, 2018 by vbegin72 1 Quote
smokey68 Posted January 28, 2016 Author Report Posted January 28, 2016 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. Quote
smokey68 Posted January 30, 2016 Author Report Posted January 30, 2016 LOOK AT TOP POSTING THERE IS A NEW UPDATE SORRY FOR INCON. Quote
mseiwald Posted January 31, 2016 Report Posted January 31, 2016 Thanks for your contribution but could you please use a normal font in the future. It's really difficult to read. Quote
smokey68 Posted January 31, 2016 Author Report Posted January 31, 2016 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) Quote
Moderators servetas Posted January 31, 2016 Moderators Report Posted January 31, 2016 Manuel was referring to the font size. Updated it accordingly. Quote
mseiwald Posted February 1, 2016 Report Posted February 1, 2016 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 Quote
smokey68 Posted November 26, 2018 Author Report Posted November 26, 2018 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 ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.