Esempio n. 1
0
    $flight = new Flight();
    $flightList->seek($var);
    $flight = $flightList->current();
    $checkFlight = ContextManager::$Model->flight != null ? ContextManager::$Model->flight : new Flight();
    $checked = "";
    if ($checkFlight->checked == true && $flight->Id == $checkFlight->Id) {
        //echo $flight->checked;
        $checked = "checked='checked'";
    }
    $status = "";
    if ($flight->status == 0 || $flight->status == '0') {
        $status = "passive";
    } else {
        $status = "active";
    }
    $name = $aplanes->GetName($flight->planeID);
    echo "<tr>\r\n                        <td>{$var}</td>\r\n                        <td>{$name}</td>\r\n                        <td>{$flight->from}</td>\r\n                        <td>{$flight->to}</td>\r\n                        <td>{$flight->deptureDate}</td>\r\n                        <td>{$flight->landindDate}</td>\r\n                        <td>{$flight->boardingTime}</td>\r\n                        <td>{$flight->Landingtime}</td>\r\n                       <td>{$flight->stops}</td>\r\n                       <td>{$flight->ticketPrice}</td>\r\n                        <td>{$flight->seats}</td>\r\n                        <td>{$status}</td>\r\n                        <td><input type='checkbox' value='{$flight->Id}' name='chkflights[]' {$checked} ></td>\r\n                    </tr>\r\n                    ";
}
?>

            </table>
            <div id="btn_panel_modifier">
                <input type="submit" class="btn btn-primary" value="Edit/Modify" name="btnEdit"/>
                <input type="submit" class="btn btn-primary" value="Delete" name="btnDelete"/>
            </div>

            <?php 
ContextManager::EndForm();
?>
        </div>
Esempio n. 2
0
        </tr>

        <?php 
    include_once "models/PlaneModel.php";
    $plane = new PlaneModel();
    for ($v = 0; $v < $list->count(); $v++) {
        $flight = new Flight();
        $list->seek($v);
        $flight = $list->current();
        $highprice = $plane->getHighestPrice($flight->planeID);
        $lowPrice = $plane->getLowerPrice($flight->planeID);
        $range = "£{$lowPrice} to £{$highprice}";
        $arrparam = new ArrayIterator();
        $idflight = $flight->Id;
        $link = "<a class='btn btn-primary btn-small' href='?url=Booking&action=Flight&id={$idflight}'>Book Now</a>";
        if ($highprice == $lowPrice) {
            $range = "£{$highprice}";
        }
        $sn = $v + 1;
        $name = $plane->GetName($flight->planeID);
        echo "<tr>\r\n                     <th>{$sn}</th>\r\n                     <th>{$name}</th>\r\n                     <th>{$flight->from}</th>\r\n                     <th>{$flight->to}</th>\r\n                     <th>{$flight->deptureDate}</th>\r\n                     <th>{$flight->landindDate}</th> \r\n                     <th>{$flight->boardingTime}</th> \r\n                     <th>{$flight->Landingtime}</th> \r\n                     <th>{$flight->stops}</th> \r\n                     <th>{$range}</th> \r\n                     <th>Seats Left</th> \r\n                     <th colspan='2'>{$link} </th>\r\n                      \r\n                     </tr>";
    }
    ?>

    </table>

    <?php 
    Session::delete("seach_find");
}
// other page