ordersprinter/webapp/kundenwebseite/menu.php

38 lines
1.1 KiB
PHP
Raw Normal View History

2020-11-19 22:47:44 +01:00
<?php
require_once (__DIR__. '/../php/config.php');
require_once (__DIR__. '/php/pager.php');
require_once (__DIR__. '/php/replacer.php');
require_once (__DIR__. '/php/menumanager.php');
require_once (__DIR__. '/php/imager.php');
require_once (__DIR__. '/../php/dbutils.php');
header('Content-Type: text/html; charset=utf-8');
$headerFileTemplate = __DIR__. '/vorlagen/classic/header.html';
$footerFileTemplate = __DIR__. '/vorlagen/classic/footer.html';
$contentTemplate = __DIR__. '/vorlage-menu.txt';
2020-11-19 22:50:09 +01:00
$pdo = DbUtils::openDbAndReturnPdoStatic();
2020-11-19 22:47:44 +01:00
$prodtype = $_GET["pt"];
$header = Pager::readAndSubstituteFile($pdo,$headerFileTemplate);
$menu = Pager::getMenuItems($pdo,"menu", $prodtype);
$footer = Pager::readAndSubstituteFile($pdo,$footerFileTemplate);
$content = "<div class='content'>" . Pager::readAndSubstituteFile($pdo, $contentTemplate) . "</div>";
$content = str_replace("{Produktkategorie}",Menumanager::getProdTypeName($pdo,$prodtype),$content);
$menutxt = Menumanager::getMenu($pdo, $prodtype);
$content = str_replace("{Menu}", $menutxt, $content);
$page = $header . $menu . $content . $footer;
echo $page;
?>