<?php include_once 'imports.php'; session_start(); $model = new CarModel(); $view = new CarView($model); $controller = new CarController($model, $view); if (isset($_POST['submit'])) { // Submit button clicked on form $controller->submitClicked(filter_input(INPUT_POST, 'selected_car_type'), filter_input(INPUT_POST, 'selected_engine_size'), filter_input(INPUT_POST, 'selected_colour')); } else { // Initial page before first submission $view->output(); }
<div class="form-group"> <label for="type">Minimale prijs:</label> <input type="text" class="form-control" id="type" name="minprijs" value=""> </div> <div class="form-group"> <label for="prijs">Maximale prijs:</label> <input type="text" class="form-control" id="prijs" name="maxprijs" value=""> </div> <button type="submit" name="knop" value="Bekijken" class="btn btn-default">Submit</button> </form> <div class="autocontainer"> <?php $cv = new CarView(); $cv->voegCarToe(new Car("Audi", 102500.0, "img/audi1.jpg")); $cv->voegCarToe(new Car("Ferrari", 99500.0, "img/ferrari2.jpg")); $cv->voegCarToe(new Car("Ferrari", 133800.5, "img/ferrari3.jpg")); $cv->voegCarToe(new Car("Fiat", 9500.0, "img/fiat1.jpg")); $cv->voegCarToe(new Car("Mercedes", 38001.0, "img/mercedes1.jpg")); $cv->voegCarToe(new Car("Opel", 18020.0, "img/opel1.jpg")); $cv->voegCarToe(new Car("Volkswagen", 23000.0, "img/vw1.jpg")); if (isset($_POST['knop'])) { $merk = $_POST['merk']; $minprijs = $_POST['minprijs']; $maxprijs = $_POST['maxprijs']; if ($minprijs == "") { $minprijs = 1; } if ($maxprijs == "") {