Jump to content

Charter Flight System v1.1.0 (UPDATED!)


iva

  

50 members have voted

  1. 1. What is your opinion on this module?

    • It is really useful and simple
      30
    • A little complicated, but useful
      16
    • Useless and extremely complicated
      4


Recommended Posts

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 :rolleyes:

____________________________________

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

  • Like 8
Link to comment
Share on other sites

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! ;)

Link to comment
Share on other sites

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! :rolleyes:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 !! :unsure:

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

}

}

?>
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

ok I'm so sorry, I forgot } at the end of the code to close FOREACH function !! :unsure:

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

Link to comment
Share on other sites

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 :huh:

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

ok, thanks, i'll do it

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :huh:

please check the code for Charter airline. it have to be "CH" with no space or any character..

I guess we have a mystery. :D

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:

ch1.jpg

Registration:

ch2.jpg

Link to comment
Share on other sites

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

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:

ch1.jpg

Registration:

ch2.jpg

i have that problem to.

Link to comment
Share on other sites

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 :wacko:

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 :blink:

just kiding but it's real :P

Link to comment
Share on other sites

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>

:wacko: my bad! sorry.

any other problem??

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...