iva Posted October 7, 2012 Report Share Posted October 7, 2012 Charter Flight System (Using PHP-VMS defult Temps and Modules) [updated V1.1.0] By Reza Farzam Hello dear webmaster; To be honest, just noticed that this madule is a developed version of the PHP-VMS defult temps and madules which used in order to add and edit SCHEDULES from the Admin Panel . So first of all I am going to admire the PHP-VMS Board! We all know that there is already a pay-module owned by PHP-VMS Board that worths more than any charter modules! But I believe this Charter Module is the Best Free-Module ever! I think this module covers 80 precent of your demands! This module works by giving access to your pilots to add and edit the limited number of flights. These flights will be added to an specific airline which Its name is “Charter Flight†and its code is “CHâ€! These flights can ONLY be ADD or EDIT by its owner (Specific Pilot)! and also ADMIN of site! Means that all pilots have a list of their own flights and have no access to others’! Inorder to keep this activity onder control of ADMIN, I put the range limitation for flight numbers! So we have work to do! I appreciate all of you if help to improve this module ____________________________________ UPDATED! change log : - graphics added and images attached - instructions modified - module modified - .tpl files modified - error templates added Charter_Flight_System_v1.1.0by.Reza.Farzamupdated.zip 8 Quote Link to comment Share on other sites More sharing options...
iva Posted October 7, 2012 Author Report Share Posted October 7, 2012 Give your pilots some liberty ! Let them experience something they never experienced ,EVER! by Charter Flight System ... Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted October 7, 2012 Moderators Report Share Posted October 7, 2012 You may check this announcement. Quote Link to comment Share on other sites More sharing options...
iva Posted October 7, 2012 Author Report Share Posted October 7, 2012 thanks Quote Link to comment Share on other sites More sharing options...
iva Posted October 9, 2012 Author Report Share Posted October 9, 2012 2 days passed...13 downloads... any comment? any question? is this module good? bad? or what? Quote Link to comment Share on other sites More sharing options...
magicflyer Posted October 10, 2012 Report Share Posted October 10, 2012 Hello, So far I cant wait to test it, it seems interesting. But, I do have an issue: Fatal error: Call to undefined method SchedulesData::countCharterSchedules() in .../core/templates/charter/ops_schedules.tpl on line 50 Thanks for your help. Quote Link to comment Share on other sites More sharing options...
iva Posted October 10, 2012 Author Report Share Posted October 10, 2012 hi , as I explained in the manuall, you have to ...Put the codes below in your SchedulesData.class (make a backup first!). /** * Get the total number of schedules based on criterea for charters * * @param array $params key => value list * @return int Returns the total number * */ public static function CountCharterSchedules($icao, $price) { //Count schedules $query = "SELECT * FROM ".TABLE_PREFIX."schedules WHERE price = '".$price."' AND code = '".$icao."'"; $results = DB::get_results($query); return DB::num_rows($results); } you can find SchedulesData.class here: YOUR WEBSITE ROOT/core/common/... this code will count the charter flights of each pilot! Quote Link to comment Share on other sites More sharing options...
iva Posted October 10, 2012 Author Report Share Posted October 10, 2012 just be advise that we use the $price field to keep the $pilotid info for each schedule! this is the trick of this module Quote Link to comment Share on other sites More sharing options...
iva Posted October 10, 2012 Author Report Share Posted October 10, 2012 note# you can limit the aircrafts for your charter flights! just need to change the code for AIRCRAFT SELECTION FIELD (DROPDOWN) in your ops_editscheduleform.tpl and ops_scheduleform.tpl from <?php foreach($allaircraft as $aircraft) { if($aircraft->registration == $schedule->registration) $sel = 'selected'; else $sel = ''; echo '<option value="'.$aircraft->id.'" '.$sel.'>'.$aircraft->name.' ('.$aircraft->registration.')</option>'; } ?> to this : <?php foreach($allaircraft as $aircraft) { if($aircraft->icao == "Your FIRST aircraft ICAO code you dont want to show, goes here!" || $aircraft->icao == "Your SECOND aircraft ICAO code you dont want to show, goes here!" || $aircraft->icao == "and more...!" ) { continue; } else { if($aircraft->registration == $schedule->registration) $sel = 'selected'; else $sel = ''; echo '<option value="'.$aircraft->id.'" '.$sel.'>'.$aircraft->fullname.'</option>'; } } ?> also when you use $aircraft->fullname it's show the Full Name of your aircrafts! you can do more simillar codings! Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 10, 2012 Moderators Report Share Posted October 10, 2012 Great. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
magicflyer Posted October 10, 2012 Report Share Posted October 10, 2012 It works great for me so far, Very useful module. Thanks! Quote Link to comment Share on other sites More sharing options...
iva Posted October 10, 2012 Author Report Share Posted October 10, 2012 ur welcome Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 10, 2012 Report Share Posted October 10, 2012 I did something wrong. EDIT: My bad. found the problem. It works fine now. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 10, 2012 Report Share Posted October 10, 2012 My bad again, but I hadn't changed the code to hide the CH airline. When I do, I get a bit of a problem. In looking at your code, which is this, <?php foreach($allairlines as $airline) { If($airline->code == “CHâ€) { Continue; } else { echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>'; } ?> Isn't there a mismatch of curly brackets, there? The problem is without another one before the closing "?>", I get an error, but with it added, it doesn't hide the CH airline in registration. Sorry if I seem confused. Quote Link to comment Share on other sites More sharing options...
michael Kraan Posted October 11, 2012 Report Share Posted October 11, 2012 i have a big problem, when i add a schedule than say he this: All of the requierd fields must be filled out See the image, I filled everything what needed. Quote Link to comment Share on other sites More sharing options...
iva Posted October 11, 2012 Author Report Share Posted October 11, 2012 My bad again, but I hadn't changed the code to hide the CH airline. When I do, I get a bit of a problem. In looking at your code, which is this, <?php foreach($allairlines as $airline) { If($airline->code == “CHâ€) { Continue; } else { echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>'; } ?> Isn't there a mismatch of curly brackets, there? The problem is without another one before the closing "?>", I get an error, but with it added, it doesn't hide the CH airline in registration. Sorry if I seem confused. ok I'm so sorry, I forgot } at the end of the code to close FOREACH function !! here is the correct code : <?php foreach($allairlines as $airline) { If($airline->code == “CHâ€) { Continue; } else { echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>'; } } ?> Quote Link to comment Share on other sites More sharing options...
iva Posted October 11, 2012 Author Report Share Posted October 11, 2012 i have a big problem, when i add a schedule than say he this: All of the requierd fields must be filled out See the image, I filled everything what needed. in CHARTER MODULE at line 798 , $this->post->code == '' || $this->post->flightnum == '' || $this->post->deptime == '' || $this->post->arrtime == '' || $this->post->depicao == '' || $this->post->arricao == '' || $this->post->price == '' here you can add or remove your RIQUIRED FIELDS! for example if you want to remove Departure Time from your Riquired Fields, you have to remove $this->post->deptime == '' || from the code, and save the changes! try this and find the field that has the problem! but be advise that we use the $price field to keep the $pilotid info for each schedule! so do NOT remove $this->post->price == '' Quote Link to comment Share on other sites More sharing options...
michael Kraan Posted October 11, 2012 Report Share Posted October 11, 2012 in CHARTER MODULE at line 798 , $this->post->code == '' || $this->post->flightnum == '' || $this->post->deptime == '' || $this->post->arrtime == '' || $this->post->depicao == '' || $this->post->arricao == '' || $this->post->price == '' here you can add or remove your RIQUIRED FIELDS! for example if you want to remove Departure Time from your Riquired Fields, you have to remove $this->post->deptime == '' || from the code, and save the changes! try this and find the field that has the problem! but be advise that we use the $price field to keep the $pilotid info for each schedule! so do NOT remove $this->post->price == '' i go to test that. but i it possible that flight number automatic add ? then there come no problems with flight numbers update: have it removed. and look what it was. I can not find the problem. i think that the problem is flight type: is that possible? Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 11, 2012 Report Share Posted October 11, 2012 ok I'm so sorry, I forgot } at the end of the code to close FOREACH function !! here is the correct code : <?php foreach($allairlines as $airline) { If($airline->code == “CHâ€) { Continue; } else { echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>'; } } ?> That was the conclusion I came to, as well. There is a problem in that it does not hide the CH and someone can register with it. While I can, as administrator, edit the pilot, I'd still prefer to have CH not visible BTW, I'd make the suggestion that for this package, you come up with a way that there are no dependencies on your site. While installing it took only a few minutes, downloading the necessary images and changing all the links to your site, took over an hour.. Quote Link to comment Share on other sites More sharing options...
iva Posted October 11, 2012 Author Report Share Posted October 11, 2012 That was the conclusion I came to, as well. There is a problem in that it does not hide the CH and someone can register with it. While I can, as administrator, edit the pilot, I'd still prefer to have CH not visible do you add the Charter Flight as an airline with exact "CH" code from your admin panel? if so, it can not be cuse any problem! because I have 17 airlines in my va and i already use this code to hide 17 airlines in my REGISTRATION FORM please check the code for Charter airline. it have to be "CH" with no space or any character.. BTW, I'd make the suggestion that for this package, you come up with a way that there are no dependencies on your site. While installing it took only a few minutes, downloading the necessary images and changing all the links to your site, took over an hour.. ok, thanks, i'll do it Quote Link to comment Share on other sites More sharing options...
iva Posted October 11, 2012 Author Report Share Posted October 11, 2012 i go to test that. but i it possible that flight number automatic add ? then there come no problems with flight numbers update: have it removed. and look what it was. I can not find the problem. i think that the problem is flight type: is that possible? did you edit the tpl files? if so, please send them and i'll check them for you. thanks my email : datmir@yahoo.com Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 11, 2012 Report Share Posted October 11, 2012 do you add the Charter Flight as an airline with exact "CH" code from your admin panel? if so, it can not be cuse any problem! because I have 17 airlines in my va and i already use this code to hide 17 airlines in my REGISTRATION FORM please check the code for Charter airline. it have to be "CH" with no space or any character.. I guess we have a mystery. Code: echo '<p class="error">Please enter your email address</p>'; ?> </dd> <dt>Select Airline: *</dt> <dd> <select name="code" id="code"> <?php foreach($allairlines as $airline) { If($airline->code == “CHâ€) { Continue; } else { echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>'; } } ?> </select> </dd> Admin Panel: Registration: Quote Link to comment Share on other sites More sharing options...
michael Kraan Posted October 11, 2012 Report Share Posted October 11, 2012 did you edit the tpl files? if so, please send them and i'll check them for you. thanks my email : datmir@yahoo.com Done! I guess we have a mystery. Code: echo '<p class="error">Please enter your email address</p>'; ?> </dd> <dt>Select Airline: *</dt> <dd> <select name="code" id="code"> <?php foreach($allairlines as $airline) { If($airline->code == “CHâ€) { Continue; } else { echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>'; } } ?> </select> </dd> Admin Panel: Registration: i have that problem to. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 11, 2012 Report Share Posted October 11, 2012 For some reason, that makes me feel better. Quote Link to comment Share on other sites More sharing options...
iva Posted October 12, 2012 Author Report Share Posted October 12, 2012 ok, this module working perfect for me in my va. so, I copied all my files from my va and made the module from the first step please get the module from the first reply in this topic agian. i think the module will work perfect now, I HOPE So it seems that we have just one simillar prob and that is HOW TO HIDE THE CH AIRLINE... IF any body had problem with this step ,please send me all the TPL files you want to hide CH in them...I'LL FIX THEM for you here is my email : datmir@yahoo.com by the way be advise that sth simillar to this module have a price for 40$ us just kiding but it's real Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 12, 2012 Report Share Posted October 12, 2012 It is good to see active support. I'll look at the new version in the morning. I've been sitting at my keyboard for over 15 hours and don't think I trust myself to do anything until I get some sleep.. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 12, 2012 Report Share Posted October 12, 2012 FYI, there is a spelling error in line 193 of ops_schedules.tpl. It is, currently: Flight <span lang="en-us">Brifing</span></font></th> It should be: Flight <span lang="en-us">Briefing</span></font></th> Quote Link to comment Share on other sites More sharing options...
iva Posted October 12, 2012 Author Report Share Posted October 12, 2012 FYI, there is a spelling error in line 193 of ops_schedules.tpl. It is, currently: Flight <span lang="en-us">Brifing</span></font></th> It should be: Flight <span lang="en-us">Briefing</span></font></th> my bad! sorry. any other problem?? Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 12, 2012 Report Share Posted October 12, 2012 No need to apologize. Nothing else I can see. I haven't looked further into hiding the CH, but will do that after I run some errands. Putting all the graphics locally, makes modifying the appearance quite easy. 1 Quote Link to comment Share on other sites More sharing options...
michael Kraan Posted October 12, 2012 Report Share Posted October 12, 2012 (edited) my bad! sorry. any other problem?? yes, i have the same problem and error:( i think that the problem is: flight type: why? that field is empty Edited October 12, 2012 by michael Kraan Quote Link to comment Share on other sites More sharing options...
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.