Charter Flight System v1.1.0 (UPDATED!)

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](< base_url >/applications/core/interface/file/attachment.php?id=969)

Give your pilots some liberty !

Let them experience something they never experienced ,EVER!

by Charter Flight System …

post-3295-0-99188600-1349628589.jpg

You may check announcement.

thanks

2 days passed…13 downloads…

any comment?

any question?

is this module good? bad? or what?

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.

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!

just be advise that we use the $price field to keep the $pilotid info for each schedule!

this is the trick of this module

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!

Great. Thanks a lot.

It works great for me so far, Very useful module. Thanks!

ur welcome

I did something wrong.

EDIT: My bad. found the problem. It works fine now.

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.

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.

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>';

}

}

?>

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 == ‘’

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?

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

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