-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect_car.php
More file actions
36 lines (33 loc) · 1.35 KB
/
select_car.php
File metadata and controls
36 lines (33 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require 'Model/CarController.php';
$carController = new CarController();
$carTables="";
if (isset($_POST['brand']) && isset($_POST['type']) && isset($_POST['price'])) {
$carTables="<h3>Selecting cars and displaying nearest result sorted on Price</h3><hr class='dhr'/>" ;
$carTables = $carTables . $carController->CreateMixedTypes($_POST['brand'],$_POST['type'],$_POST['price']);
}
elseif(isset($_POST['type']))
{
//Fill page with type of car of the selected type
$ptype=$_POST['type'];
$carTables="<h3>Selecting cars of Type $ptype</h3><hr class='dhr'/>" ;
$carTables = $carTables . $carController->CreateCarTypes($_POST['type']);
}
elseif (isset($_POST['price'])) {
// Fill page with car price
$carTables="<h3>Selecting cars of given Price and displaying nearest result sorted on Price</h3><hr class='dhr'/>" ;
$carTables = $carTables . $carController->CreateCarPrice($_POST['price']);
}
else
{
//Page is loaded for the first time, no type selected -> Fetch all types
//$coffeeTables = $coffeeController->CreateCoffeeTables('%');
echo "Error select type";
}
//Output page data
$title = 'Select Car';
$content = $carTables;
$excss="css\selectstyle.css";
$jsfile="";
include 'CarTemplate.php';
?>