Add Restaurant QR menu
This commit is contained in:
parent
3cc249a887
commit
8abe60db0b
144
htdocs/takepos/public/css/style.css
Normal file
144
htdocs/takepos/public/css/style.css
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
/* -- footer -- */
|
||||||
|
html {
|
||||||
|
position: relative;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin-bottom: 60px;
|
||||||
|
font-family: 'Khand', sans-serif;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
.container .text-muted {
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
.footer > .container {
|
||||||
|
padding-right: 15px;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
/* -- -- */
|
||||||
|
h3 {
|
||||||
|
display:inline-block;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 36px;
|
||||||
|
position: relative;
|
||||||
|
margin-top:28px;
|
||||||
|
margin-bottom:15px;
|
||||||
|
}
|
||||||
|
h3:before{
|
||||||
|
left: -40px;
|
||||||
|
height: 0;
|
||||||
|
height:1px;
|
||||||
|
}
|
||||||
|
h3:before, h3:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
height: 1px;
|
||||||
|
width: 40px;
|
||||||
|
margin: 0 -15px;
|
||||||
|
background-color: #533834;
|
||||||
|
}
|
||||||
|
h3:after{
|
||||||
|
right: -40px;
|
||||||
|
}
|
||||||
|
h5 {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 22px;
|
||||||
|
margin: 0 0 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
.item {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom:20px;
|
||||||
|
}
|
||||||
|
.item h4, .price {
|
||||||
|
z-index: 0;
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
right: 0;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.item .price {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
.item h4, .item p {
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
color: #533834;
|
||||||
|
}
|
||||||
|
.item p {
|
||||||
|
clear: both;
|
||||||
|
color: #938372;
|
||||||
|
margin-left:10px;
|
||||||
|
}
|
||||||
|
.dots {
|
||||||
|
background-image: linear-gradient(to right,rgba(56,47,47,.5) 33%,rgba(0,0,0,0) 0%);
|
||||||
|
background-position: bottom;
|
||||||
|
background-size: 3px 1px;
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
height: 1px;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 22px;
|
||||||
|
}
|
||||||
|
/* Dots in IE */
|
||||||
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
||||||
|
.dots {
|
||||||
|
background: transparent url('/img/dot.gif') repeat-x bottom left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 10px;
|
||||||
|
background: #d2c82a;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 26px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-transform: uppercase;
|
||||||
|
border: 1px solid rgba(0,0,0,.05);
|
||||||
|
letter-spacing: 1px;
|
||||||
|
border-radius: 3px;
|
||||||
|
margin: -5px 5px 0 0;
|
||||||
|
}
|
||||||
|
.note {
|
||||||
|
padding: 0 6px;
|
||||||
|
min-width: 23px;
|
||||||
|
background: rgba(0,0,0,0);
|
||||||
|
border: 1px solid #382f2f;
|
||||||
|
color: #382f2f;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 500px;
|
||||||
|
line-height: 21px;
|
||||||
|
}
|
||||||
|
.veggie {
|
||||||
|
color:#82b440;
|
||||||
|
border-color:#82b440;
|
||||||
|
}
|
||||||
|
.spicy {
|
||||||
|
color:#ec4e00;
|
||||||
|
border-color:#ec4e00;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
position: absolute;
|
||||||
|
font-size:22px;
|
||||||
|
font-weight:400;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
.item h4 {
|
||||||
|
display: inline-block;
|
||||||
|
padding-right: 8px;
|
||||||
|
max-width: 80%;
|
||||||
|
text-transform: capitalize;
|
||||||
|
margin-bottom:4px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
1
htdocs/takepos/public/js/script.js
Normal file
1
htdocs/takepos/public/js/script.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
$(document).foundation();
|
||||||
117
htdocs/takepos/public/menu.php
Normal file
117
htdocs/takepos/public/menu.php
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) - 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/takepos/public/menu.php
|
||||||
|
* \ingroup takepos
|
||||||
|
* \brief Public menu for customers
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
||||||
|
if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
|
|
||||||
|
if (!$conf->global->TAKEPOS_QR_MENU) accessforbidden(); // If Restaurant Menu is disabled never allow NO LOGIN access
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title><?php echo $mysoc->name; ?></title>
|
||||||
|
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/foundation-sites@6.6.3/dist/css/foundation.min.css'>
|
||||||
|
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Khand:400,300,500,600,700'><link rel="stylesheet" href="css/style.css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- partial:index.partial.html -->
|
||||||
|
<body>
|
||||||
|
<div class="grid-container">
|
||||||
|
<div class="grid-x grid-padding-x menu2">
|
||||||
|
<div class="cell small-12">
|
||||||
|
<h1><?php print $mysoc->name; ?> <small><?php print $langs->trans('RestaurantMenu'); ?></small></h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$categorie = new Categorie($db);
|
||||||
|
$categories = $categorie->get_full_arbo('product', (($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) ? $conf->global->TAKEPOS_ROOT_CATEGORY_ID : 0), 1);
|
||||||
|
$levelofrootcategory = 0;
|
||||||
|
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0)
|
||||||
|
{
|
||||||
|
foreach ($categories as $key => $categorycursor)
|
||||||
|
{
|
||||||
|
if ($categorycursor['id'] == $conf->global->TAKEPOS_ROOT_CATEGORY_ID)
|
||||||
|
{
|
||||||
|
$levelofrootcategory = $categorycursor['level'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$levelofmaincategories = $levelofrootcategory + 1;
|
||||||
|
|
||||||
|
$maincategories = array();
|
||||||
|
$subcategories = array();
|
||||||
|
foreach ($categories as $key => $categorycursor)
|
||||||
|
{
|
||||||
|
if ($categorycursor['level'] == $levelofmaincategories)
|
||||||
|
{
|
||||||
|
$maincategories[$key] = $categorycursor;
|
||||||
|
} else {
|
||||||
|
$subcategories[$key] = $categorycursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$maincategories = dol_sort_array($maincategories, 'label');
|
||||||
|
|
||||||
|
foreach ($maincategories as $cat){
|
||||||
|
print '<div class="text-center">
|
||||||
|
<a id="'.$cat['id'].'"></a><h3>'.$cat['label'].'</h3>
|
||||||
|
</div>
|
||||||
|
<div class="grid-x grid-padding-x">';
|
||||||
|
|
||||||
|
$object = new Categorie($db);
|
||||||
|
$result = $object->fetch($cat['id']);
|
||||||
|
$prods = $object->getObjectsInCateg("product", 0, 0, 0, $conf->global->TAKEPOS_SORTPRODUCTFIELD, 'ASC');
|
||||||
|
foreach ($prods as $pro){
|
||||||
|
print '
|
||||||
|
<div class="cell small-6 medium-4">
|
||||||
|
<div class="item">
|
||||||
|
<h4>'.$pro->label.'</h4>
|
||||||
|
<span class="dots"></span>
|
||||||
|
<span class="price">'.price($pro->price_ttc,1).'</span>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="container">
|
||||||
|
<p class="text-muted"><?php print $mysoc->name; ?></p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
<!-- partial -->
|
||||||
|
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
|
||||||
|
<script src='https://cdn.jsdelivr.net/npm/foundation-sites@6.6.3/dist/js/foundation.min.js'></script><script src="js/script.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user