Example #1
0
<?php

require_once '../application/config.php';
require_once APPLICATION_DIR . '/models/WishListDAO.php';
$wishListDAO = new WishListDAO();
if (isset($_POST['edit'])) {
    $wishListDAO->editItem($_POST['id'], $_POST['name'], $_POST['desc']);
    header('location: /');
    exit;
}
if (isset($_POST['delete'])) {
    $wishListDAO->deleteItem($_POST['id']);
    header('location: /');
    exit;
}
$item = $wishListDAO->getItem($_GET['id']);
require_once APPLICATION_DIR . '/views/header.php';
require_once APPLICATION_DIR . '/views/edititem.php';
require_once APPLICATION_DIR . '/views/footer.php';
Example #2
0
<?php

require_once '../application/config.php';
require_once APPLICATION_DIR . '/models/WishListDAO.php';
$wishListDAO = new WishListDAO();
if (isset($_POST['add'])) {
    $wishListDAO->addItem($_POST['name'], $_POST['desc']);
    header('location: /');
    exit;
}
require_once APPLICATION_DIR . '/views/header.php';
require_once APPLICATION_DIR . '/views/additem.php';
require_once APPLICATION_DIR . '/views/footer.php';
Example #3
0
<?php

require_once '../application/config.php';
require_once APPLICATION_DIR . '/models/WishListDAO.php';
$wishListDAO = new WishListDAO();
$items = $wishListDAO->getAllItems();
require_once APPLICATION_DIR . '/views/header.php';
require_once APPLICATION_DIR . '/views/allitems.php';
require_once APPLICATION_DIR . '/views/footer.php';