Jump to content
simpilot

Timetable 1.0

Recommended Posts

Hi Dave,

2 questions after I have said, another great addon :D

1) I have put in the line so it does not show the inactive route, but it still shows the airportname if there are no further routes.

2) I would like within the airport the flight sorted on departure time.

Hope somebody cab help me,

Regards,

Cor

Share this post


Link to post
Share on other sites

You should be able to add

if($schedule->enabled <> '1'){continue;}

on line 45 of the original timetable_index.tpl file and it should skip any schedule that is not enabled.

Sweet, worked out great! Added to our site. Thank you for making so many great things for VMS

Share this post


Link to post
Share on other sites

Hi Dave,

2 questions after I have said, another great addon :D

1) I have put in the line so it does not show the inactive route, but it still shows the airportname if there are no further routes.

2) I would like within the airport the flight sorted on departure time.

Hope somebody cab help me,

Regards,

Cor

The module really isnt capable of sorting the schedules that way. It can be done but it would have to be approached from a different direction than getting all the airfields forst then the flights as it si structured now. You could write it to collect all the enabled routes and group them by airfield then create a display from that.

  • Like 2

Share this post


Link to post
Share on other sites

Nr 1 is good now, just had to put

if($schedule->enabled <> '1'){continue;}

on line 41 and not on line 45

Nr2 not fixed yet as I have no idea how to do that. I have noticed that it makes the list in order of route entry in the databse.

Regards,

Cor

Share this post


Link to post
Share on other sites

Hi Dave. Great module. I just now got around to checking this one out. Wonderful! +1 for sure.

Thanks for all the hard work you do. This is a great add on.

Share this post


Link to post
Share on other sites

I was messing around on a test site of mine that I have this time table on and where it shows the aircraft that is used for the flight, I also made it show the registration for that flight.

As always, please create a backup of the file before editing.

Line 51 timetable_index.tpl

FIND

echo '<td>'.$aircraft->icao.'</td>';

REPLACE WITH

echo '<td>'.$aircraft->icao.' - '.$aircraft->registration.'</td>';

SAVE FILE AND UPLOAD TO SERVER

Not sure if this is of use to anyone but if so, have at it. ;)

Share this post


Link to post
Share on other sites

Fantastic module. Thanx for it, Dave. I've modified it a little bit, so now it is sorted by departure or arrival times, shows airport full names, flight types (pax, cargo) and arrival times. And for this great work I've added a link to simpilotgroup.com at the bottom of the page. Example: Colonia VA.

Share this post


Link to post
Share on other sites

one thing I discovered is that schedule count is always one higher like it should be!

means if you have 150 schedules it says 151 for example

that solve that problem

Total Flights: <?php echo $total-1; ?>

best regards

Thomas Schedl

Share this post


Link to post
Share on other sites

The data is not there, the tpl only calls the field name for the departure field once for each departure field. You can use the coding on line 49 of timetable_index.tpl as guide to get the field name you are looking for.

$field1 = OperationsData::getAirportInfo($schedule->arricao);

echo '<td>'.$schedule->arricao.' - '.$field1->name.'</td>';

Share this post


Link to post
Share on other sites

Gentlemen,

I know this is older code but anyone know how to adjust the file to get ride of the following strict standards error in php 5.5:

Strict Standards: Non-static method TimetableData::get_schedules() should not be called statically, assuming $this from incompatible context in /homepages/4/d597168468/htdocs/phpvms/core/templates/timetable/timetable_index.php on line 38

Share this post


Link to post
Share on other sites

Error timetable

Timetable Install Manager 1.0 with pluguins PHPVMS 5.5.x

to run the link I get this error

Notice: The template file "/home/mundoairlines/www/core/templates/timetable/timetable_index.php" does not exist in /home/mundoairlines/www/core/classes/TemplateSet.class.php on line 231

Line 231 de TemplateSet.class.php

if (!file_exists($tpl_path)) {

trigger_error('The template file "' . $tpl_path . '" doesn\'t exist');

return false;

}

This plugin is not valid for phpvms 5.5.x?

Share this post


Link to post
Share on other sites

I have this in TimetableData.class

class TimetableData extends CodonData {

public static function get_schedules($offset) {

$query = "SELECT * FROM ".TABLE_PREFIX."schedules

ORDER BY depicao ASC

LIMIT 30

OFFSET $offset";

return DB::get_results($query);

}

}

  • Like 1

Share this post


Link to post
Share on other sites

Did you install it with the plugin manager, or did you install it manually?

If you installed it manually, try re-uploading the files

Share this post


Link to post
Share on other sites

is there a way the module to show only the schedules from one airline?? i have 3 airlines AXN, AXG and CH and i watt the schedules for the CH not to been showed!!

Share this post


Link to post
Share on other sites

Go into core/common/TimetableData.class.php

And replace the first function with this one

   public function get_schedules($offset) {
    $query = "SELECT * FROM ".TABLE_PREFIX."schedules
  WHERE code <> 'CH'
			    ORDER BY depicao ASC
			    LIMIT 30
			    OFFSET $offset";
    return DB::get_results($query);
   }

  • Like 2

Share this post


Link to post
Share on other sites

Go into core/common/TimetableData.class.php

And replace the first function with this one

public function get_schedules($offset) {
 $query = "SELECT * FROM ".TABLE_PREFIX."schedules
 WHERE code <> 'CH'
			 ORDER BY depicao ASC
			 LIMIT 30
			 OFFSET $offset";
 return DB::get_results($query);
}

thanks a lot!! Worked like a charm!!!!

Share this post


Link to post
Share on other sites
On 12.2.2016 at 9:53 PM, polirom said:

I have this in TimetableData.class

class TimetableData extends CodonData {

public static function get_schedules($offset) {

$query = "SELECT * FROM ".TABLE_PREFIX."schedules

ORDER BY depicao ASC

LIMIT 30

OFFSET $offset";

return DB::get_results($query);

}

}

Thanks for this.

Searched a long time how to change the sort of Flights.

With this post i finaly got it.

Just change here the "ORDER BY depicao ASC" to "ORDER BY flightnum ASC"

Edited by thomasha

Share this post


Link to post
Share on other sites

Hello,

I made some changes. I add some extra columns from templates page and works good only problen this: I want banner comes till end.

0cd54de26db54efeab1cadac16fe042f.png

Here is my code:

$offset = 0;
$total = 1;
$page = 1;
while($offset < $numschedules) {
    ?>
<center>
    <h3><?php echo SITE_NAME; ?> Timetable</h3>
</center>
<table width="100%" frame="box">
    <tr align="center">
        <?php
            $count = 1;
            while($count <= 1) {
        ?>

        <td width="100%" valign="top">
            <table width="100%">
                <tr bgcolor="#cccccc">

                    <td width="13%">Arr</td>
                    <td width="12%">Code</td>
                    <td width="13%">Flight</td>
                    <td width="12%">Type</td>
                    <td width="13%">Freq</td>
                    <td width="12%">Dep. Time</td>
                    <td width="13%">Arr. Time</td>
                    <td width="12%">Duration</td>
                </tr>
        <?php
            $schedules = TimetableData::get_schedules($offset);
                        foreach($schedules as $schedule) {
                            if($departure <> $schedule->depicao) {
                                $field = OperationsData::getAirportInfo($schedule->depicao);
                                echo '<tr>';
                                echo '<td bgcolor="#cccccc" colspan="5"><b>'.$schedule->depicao.' - '.$field->name.'</b></td>';
                                echo '</tr>';
                            }
                            $departure = $schedule->depicao;
                            echo '<tr>';
                            echo '<td>'.$schedule->arricao.'</td>';
                            echo '<td>'.$schedule->code.'</td>';
                            echo '<td>'.$schedule->flightnum.'</td>';
                            $aircraft = OperationsData::getAircraftInfo($schedule->aircraft);
                            echo '<td>'.$aircraft->icao.'</td>';
                            echo '<td>'.Util::GetDaysCompact($schedule->daysofweek).'</td>';
                            echo '<td>'.$schedule->deptime.'</td>';
                            echo '<td>'.$schedule->arrtime.'</td>';
                            echo '<td>'.$schedule->flighttime.' Hr/s</td>';
                            echo '</tr>';
                            $total++;
                        }
                        $offset = $offset + 30;
         ?>
            </table>
        </td>
        <?php
            $count++;
                if($offset >= $numschedules) {
                    while($count <= 1) {
                        echo '<td width="100%" valign="top">
                                    <table width="100%">
                                    <tr bgcolor="#cccccc">

                                    <td width="13%">Arr</td>
                                    <td width="12%">Code</td>
                                    <td width="13%">Flight</td>
                                    <td width="12%">Type</td>
                                    <td width="13%">Freq</td>
                                    <td width="12%">Dep. Time</td>
                                    <td width="13%">Arr. Time</td>
                                    <td width="12%">Duration</td>
                                    </tr>
                                    </table>';
                        $count++;
                    }
                }
            }
        ?>
    </tr>
</table>
<center>
    <br />
    <h5>Page <?php echo $page;
            $page++; ?></h5>
</center>
<hr />
<br />
    <?php
}
        ?>
Total Flights: <?php echo $total; ?>
<br /><br />

Thanks...

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

×