Esempio n. 1
0
<?php

require './Controller/CoffeeController.php';
$coffeeController = new CoffeeController();
$title = "Add a new Coffee";
$content = "<form action='' method='post'>\n    <fieldset>\n        <legend>Add a new Coffee</legend>\n        <label for='name'>Name: </label>\n        <input type='text' class='inputField' name='txtName' /><br/>\n\n        <label for='type'>Type: </label>\n        <select class='inputField' name='ddlType'>\n            <option value='%'>All</option>" . $coffeeController->CreateOptionValues($coffeeController->GetCoffeeTypes()) . "</select><br/>\n\n        <label for='price'>Price: </label>\n        <input type='text' class='inputField' name='txtPrice' /><br/>\n\n        <label for='roast'>Roast: </label>\n        <input type='text' class='inputField' name='txtRoast' /><br/>\n\n        <label for='country'>Country: </label>\n        <input type='text' class='inputField' name='txtCountry' /><br/>\n\n        <label for='image'>Image: </label>\n        <select class='inputField' name='ddlImage'>" . $coffeeController->GetImages() . "</select></br>\n\n        <label for='review'>Review: </label>\n        <textarea cols='70' rows='12' name='txtReview'></textarea></br>\n\n        <input type='submit' value='Submit'>\n    </fieldset>\n</form>";
if (isset($_POST["txtName"])) {
    $coffeeController->InsertCoffee();
}
include './Template.php';
?>