<?php
// check if classes are valid and load classes
$strKlasse = '';
function __autoload($strKlasse)
{ try { if(!preg_match('=^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$=m',$strKlasse))
{ throw new Exception("Class '$strKlasse' is not valid."); }
$strIncludeFile = 'classes/'.$strKlasse. '.class.php';
if (!file_exists($strIncludeFile))
{ throw new Exception("Include file <i>$strIncludeFile</i> not found.<br>"); }
require_once($strIncludeFile);
if(!class_exists($strKlasse))
{ throw new Exception("Include file <i>$strIncludeFile</i>
contains no class '$strKlasse'.<br>"); }
return true; }
catch(Exception $e)
{ die($e->getMessage()); }
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>MyRentABike / show all vehicles and details</title>
<link href="css/filesqlite.css" rel="stylesheet" media="screen">
</head>
<body>
<a href="index.html">back</a>
<h3>MyRentABike / Vehicle fleet</h3>
<p>
<?php
$vrview = new VRViewAll();
if(isset($_GET['id'])) {
try {
$id = $_GET['id'];
$num = $_GET['num'];
$quantity = $_GET['miete'];
$marke = $_GET['marke'];
$raeder = $_GET['groesse'];
$typ = $_GET['typ'];
$vrview->isId($id);
$vrview->isQuantity($num);
$vrview->isVehicle($marke);
// error exceptions
} catch(IdException $e) {
die($e->getMessage());
} catch(QtyException $e) {
die($e->getMessage());
} catch(VehicleException $e) {
die($e->getMessage());
} catch (Exception $e) {
print $e;
exit();
}
}
$vrview->openFile();
echo $vrview->htmlvehicle;
if(isset($id)) {
// load HTML from view
if (file_exists('vr_single_vehicle.php')) {
require 'vr_single_vehicle.php'; }
else { die("Error."); }
}
?></p>
</body>
</html>