private static function getInstance() { if (is_null(self::$pizzeria)) { //connect to a database self::$pizzeria = new Pizzeria(); } return self::$pizzeria; }
/** * Визит в пиццирию * * @param Pizzeria $p * * @return string */ public function visitPizzeria(Pizzeria $p) { return $p->buyPizza(); }
Sono stati riscontrati dei problemi nel salvataggio dell' ordine <a href="register.php" class="alert-link">Riprova qui</a> </div> <?php } } else { ?> <h1 class="well">Ordina le pizze</h1> <div class="col-lg-12 well"> <div class="row"> <div class="col-sm-12"> <div class="row"> <div class="col-sm-4 form-group"> <label>Pizza</label> <select id="pizza_nome" class="form-control"> <?php $pizze = Pizzeria::getPizza(); foreach ($pizze as $key => $value) { printf('<option value="%s" data-prezzo="%s" data-nome="%s" >%s</option>', $value['pizza_id'], $value['prezzo'], $value['nome'], $value['nome']); } ?> </select> </div> <div class="col-sm-4 form-group"> <label>Tipo</label> <select id="pizza_tipo" class="form-control"> <option value="normale">Rotonda</option> <option value="calzone">Calzone</option> </select> </div> <div class="col-sm-2 form-group"> <label>Quantità</label>
include_once 'assets/tmpl/navbar.inc.php'; ?> <div class="container"> <h3>Le nostre pizze</h3> <h4>Ecco il nostro catalogo pizze nostre pizze </h4> <div class="row"> <form id="pizza_search" class="navbar-form navbar-left" role="search" action="index.php" method="post"> <div class="form-group"> <input type="text" name="search" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default" onclick="$('#pizza_search').submit()">Submit</button> </form> </div> <?php $search = isset($_POST['search']) ? strtolower($_POST['search']) : NULL; if (!empty($search)) { printf("<div class=\"row\">Risultati della ricerca per <strong>%s</strong></div>", $search); } Pizzeria::getPizzaList($search); ?> <a class="btn btn-lg btn-primary" href="ordini.php" role="button">Ordina le pizze »</a> </div> <!-- /container --> <?php include_once 'assets/tmpl/footer.inc.php'; ?> </body> </html>