Jump to content

Timetable 1.0


simpilot

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

Link to comment
Share on other sites

  • Administrators

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
Link to comment
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

Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
  • 5 months later...

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

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

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
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

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?

Link to comment
Share on other sites

  • 6 months later...

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
Link to comment
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!!!!

Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...
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
Link to comment
Share on other sites

  • 2 months later...

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

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