Example #1
0
    $new_dir = new Direction($route_id, $dir, $descr);
    $new_dir->WriteToDatabase();
    echo '<p>route direction created as ID ' . $new_dir->GetID() . ', adding stops... ';
    $sequence = 0;
    foreach ($stops as $stopValue) {
        $stop = trim($stopValue);
        $new_dir->AddStop($stop, $sequence);
        $sequence++;
    }
    echo $sequence . ' stops added.</p>';
    echo '<hr/>';
}
if (isset($_GET['routeID'])) {
    $route = new Route(false, false, $_GET['routeID']);
    echo '<p>Route: ' . $route->short_name . ' ' . $route->long_name;
    $route_directions = $route->GetDirections();
    if (count($route_directions) > 0) {
        echo '<blockquote><p>Existing directions (editing not currently supported)';
        foreach ($route_directions as $route_dir) {
            echo '<p>Direction #' . $route_dir->direction . ': ' . $route_dir->description;
            $stops = $route_dir->GetStops();
            if (count($stops) > 0) {
                echo '<blockquote><p>Stops:';
                echo '<table border=1 cellpadding=3>';
                echo '<tr>';
                foreach ($stops as $stop) {
                    echo '<td>';
                    if ($stop->timepoint) {
                        echo '<strong>';
                    }
                    echo $stop->code;
Example #2
0
<?php

include_once '../common/headers.php';
$selectForm = new Form();
$selectForm->Add(new DropDown('routeID', Route::GetAllRoutes()));
$selectForm->Add(new SubmitButton());
echo $selectForm->ToString();
if (isset($_GET['routeID'])) {
    $route = new Route(false, false, $_GET['routeID']);
    echo '<p>Route: ' . $route->short_name . ' ' . $route->long_name;
    $routedirs = $route->GetDirections();
    if (count($routedirs) > 0) {
        foreach ($routedirs as $route_dir) {
            echo '<p>Direction: ' . $route_dir->description;
            $stops = $route_dir->GetStops();
            if (count($stops) > 0) {
                echo '<blockquote><p>Stops:';
                echo '<table border=1 cellpadding=3>';
                echo '<tr>';
                //<td>&nbsp;</td>';
                foreach ($stops as $stop) {
                    echo '<td>';
                    if ($stop->timepoint) {
                        echo '<strong>';
                    }
                    echo $stop->ToString();
                    echo '</td>';
                }
                echo '</tr>' . "\n";
                /*	for($i = 0; $i < 5; $i++)
                			{