Exemplo n.º 1
0
<body>
	<div class="container">
		<?php 
include '../menu_top.php';
?>
		<h2>Add brewery</h2>
		<?php 
require_once "../../models/brewery.php";
if (isset($_POST['name'])) {
    $name = $_POST['name'];
    if (empty($name)) {
        echo "<br><div class='alert alert-info col-md-8'>Fill the name!</div>";
    } else {
        $brewery = new Brewery();
        if ($brewery->insert($name)) {
            header('location: index.php');
            die;
        }
    }
}
?>
		<form action='', method='POST'>
			<div class="col-md-8">
				<table class="table table-striped">
					<tr>
						<th>Name:</th>
						<td><input type='text', name='name', class='form-control'></td>
					</tr>
				</table>
				<input type='submit', value='Add' class='btn btn-primary'>