예제 #1
0
파일: tap_form.php 프로젝트: kryztof/dost
require_once __DIR__ . '/includes/managers/kegType_manager.php';
require_once __DIR__ . '/includes/managers/tap_manager.php';
$htmlHelper = new HtmlHelper();
$tapManager = new TapManager();
$beerManager = new BeerManager();
$kegManager = new KegManager();
$kegTypeManager = new KegTypeManager();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['saveTap'])) {
        $tap = new Tap();
        $tap->setFromArray($_POST);
        $tapManager->Save($tap);
    }
    redirect('tap_list.php');
}
$beerList = $beerManager->GetAllActive();
$kegList = $kegManager->GetAllAvailable();
$tapNumber = $_GET['tapNumber'];
if (isset($_GET['id'])) {
    $tap = $tapManager->GetById($_GET['id']);
    if (!array_key_exists($tap->get_kegId(), $kegList)) {
        $kegList[$tap->get_kegId()] = $kegManager->GetById($tap->get_kegId());
    }
} else {
    $tap = new Tap();
    $tap->set_tapNumber($tapNumber);
    $tap->set_active(true);
}
// Code to set config values
$config = array();
$sql = "SELECT * FROM config";
예제 #2
0
}
require_once __DIR__ . '/includes/conn.php';
require_once __DIR__ . '/../includes/config_names.php';
require_once __DIR__ . '/includes/html_helper.php';
require_once __DIR__ . '/includes/functions.php';
require_once __DIR__ . '/includes/models/beer.php';
require_once __DIR__ . '/includes/models/beerStyle.php';
require_once __DIR__ . '/includes/managers/beer_manager.php';
require_once __DIR__ . '/includes/managers/beerStyle_manager.php';
$htmlHelper = new HtmlHelper();
$beerManager = new BeerManager();
$beerStyleManager = new BeerStyleManager();
if (isset($_POST['inactivateBeer'])) {
    $beerManager->Inactivate($_POST['id']);
}
$beers = $beerManager->GetAllActive();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>RaspberryPints</title>
<link href="styles/layout.css" rel="stylesheet" type="text/css" />
<link href="styles/wysiwyg.css" rel="stylesheet" type="text/css" />
	<!-- Theme Start -->
<link href="styles.css" rel="stylesheet" type="text/css" />
	<!-- Theme End -->
<link href='http://fonts.googleapis.com/css?family=Fredoka+One' rel='stylesheet' type='text/css'>
</head>
	<!-- Start Header  -->