OrderSprinter 1.5.26

This commit is contained in:
Geno 2020-11-19 23:12:39 +01:00
parent 279efdd31f
commit ea17d50f5e
54 changed files with 864 additions and 389 deletions

View File

@ -24,7 +24,7 @@
background-color: graytext; background-color: graytext;
} }
#warningdiv { #warningdiv,#warningdiv2 {
border: 20px solid black; border: 20px solid black;
border-radius: 5px; border-radius: 5px;
padding: 40px; padding: 40px;

9
gastsystem/db/.htaccess Normal file
View File

@ -0,0 +1,9 @@
Options -Indexes
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
<FilesMatch "\.(db|txt)$">
Order allow,deny
Deny from all
</FilesMatch>

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" href="css/gueststyle.css?v=1.5.25" /> <link rel="stylesheet" href="css/gueststyle.css?v=1.5.26" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.5.25" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.5.26" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
@ -38,10 +38,15 @@
<div id="warningdiv" style="display:none;"> <div id="warningdiv" style="display:none;">
ACHTUNG: Eine Kommunikation mit dem Kernsystem ist derzeit nicht aktiv. Bitte weisen Sie das Bedienpersonal darauf hin oder geben die Bestellung beim Kellner auf. ACHTUNG: Eine Kommunikation mit dem Kernsystem ist derzeit nicht aktiv. Bitte weisen Sie das Bedienpersonal darauf hin oder geben die Bestellung beim Kellner auf.
</div> </div>
<div id="warningdiv2" style="display:none;">
ACHTUNG: Fehler im Gastbestellsystem, folgende Datei oder Verzeichnis ist schreibgeschützt: <span id="writeprotectedfile"></span>
</div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" data-theme="e" id="tableselection" style="display:none;" class="notcollapsible"> <div data-role="collapsible" data-content-theme="c" data-collapsed="false" data-theme="e" id="tableselection" style="display:none;" class="notcollapsible">
<H2>Tischauswahl</H2> <H2>Tischauswahl</H2>
<p style="text-align: center;"><img src="php/ossystem.php?command=getlogo" style="max-height:300px;"/> <p><div id="logoarea" style="text-align: center;">
<img src="php/ossystem.php?command=getlogo" style="max-height:300px;"/>
</div>
<p>Bitte wählen Sie den Tisch aus: <p>Bitte wählen Sie den Tisch aus:
<div id="tableselectionbox"></div> <div id="tableselectionbox"></div>
</div> </div>
@ -106,7 +111,7 @@
<div data-role="footer" data-theme="b" id="thefooter1"> <div data-role="footer" data-theme="b" id="thefooter1">
<div class="ui-grid-a"> <div class="ui-grid-a">
<div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div> <div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div>
<div class="ui-block-b grid_right" id="versioninfo">1.5.25&nbsp;&nbsp;</div> <div class="ui-block-b grid_right" id="versioninfo">1.5.26&nbsp;&nbsp;</div>
</div><!-- /grid-a --> </div><!-- /grid-a -->
</div> </div>
</div> </div>

View File

@ -2,6 +2,7 @@
require_once 'php/dbutils.php'; require_once 'php/dbutils.php';
require_once 'php/config.php'; require_once 'php/config.php';
defined('DB') || define ( 'DB','mysql' );
class Installer { class Installer {
@ -24,7 +25,7 @@ class Installer {
$sql = " $sql = "
CREATE TABLE `%images%` ( CREATE TABLE `%images%` (
`id` INT (2) NOT NULL AUTO_INCREMENT PRIMARY KEY , `id` INT (2) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR ( 100 ) , `imagename` VARCHAR ( 100 ) ,
`content` MEDIUMBLOB, `content` MEDIUMBLOB,
`contenttype` INT(1) NULL, `contenttype` INT(1) NULL,
`productid` INT(10) NULL `productid` INT(10) NULL
@ -76,13 +77,24 @@ class Installer {
} }
public static function install($code) { public static function install($code) {
$fileMsg = 'In der Konfiguration wurde festgelegt, dass die temporären Laufzeitdaten im Filesystem abgelegt werden sollen. ';
$fileMsg .= 'Daher ist keine Installation erforderlich und das Gastbestellsystem kann direkt aufgerufen werden.<br><br>';
$fileMsg .= '<form action="index.php" method="get"> <button type="submit">Weiter zur Gastbestellseite</button></form>';
if (DB == 'file') {
return array("status" => "ERROR", "msg" => $fileMsg);
};
if ($code != CODE) { if ($code != CODE) {
return array("status" => "ERROR", "msg" => "Falscher Installationscode!"); return array("status" => "ERROR", "msg" => "Falscher Installationscode!");
} }
try { try {
if (DB == 'mysql') {
if (!extension_loaded("pdo_mysql")) {
return array("status" => "ERROR", "msg" => "PHP Pdo-MySQL extension nicht geladen");
}
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
self::createSystemTable($pdo); self::createSystemTable($pdo);
return array("status" => "OK"); return array("status" => "OK");
}
} catch (Exception $ex) { } catch (Exception $ex) {
return array("status" => "ERROR", "msg" => $ex->getMessage()); return array("status" => "ERROR", "msg" => $ex->getMessage());
} }
@ -102,10 +114,10 @@ if (isset($_POST['code'])) {
} else { } else {
echo "<html>"; echo "<html>";
echo "<head><title>Installation Gastsystem</title>"; echo "<head><title>Installation Gastsystem</title>";
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.5.25">'; echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.5.26">';
echo "</head>"; echo "</head>";
echo "<body><div class=surround>"; echo "<body><div class=surround>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.5.25</span><br><br>"; echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.5.26</span><br><br>";
echo "<form action='install.php' method='post'><input class=installfield name=code id=code type=text placeholder='Installationscode' />"; echo "<form action='install.php' method='post'><input class=installfield name=code id=code type=text placeholder='Installationscode' />";
echo "<br><input type=submit value='Installation starten' class=installbtn />"; echo "<br><input type=submit value='Installation starten' class=installbtn />";
echo "</form></div></html>"; echo "</form></div></html>";

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,9 @@
<?php <?php
error_reporting(E_ERROR); error_reporting(E_ERROR);
// Database to use: 'mysql' or 'file'
defined('DB') || define ( 'DB','file' );
// Datenbank-Zugangsdaten // Datenbank-Zugangsdaten
defined('MYSQL_HOST') || define ( 'MYSQL_HOST','localhost' ); defined('MYSQL_HOST') || define ( 'MYSQL_HOST','localhost' );
defined('MYSQL_USER') || define ( 'MYSQL_USER', 'guestsystem' ); defined('MYSQL_USER') || define ( 'MYSQL_USER', 'guestsystem' );
@ -10,5 +13,15 @@ defined('MYSQL_DB') || define ( 'MYSQL_DB', 'guestdb' );
// Datenbanktabellen-Praefix // Datenbanktabellen-Praefix
defined('TAB_PREFIX') || define ('TAB_PREFIX', 'os_'); defined('TAB_PREFIX') || define ('TAB_PREFIX', 'os_');
// Code für die Installation, und als Gastsystemscode in der Kernapplikation einzutragen // Code muss als Gastsystemscode in der Kernapplikation eingetragen werden.
// Wird als DB eine Mysql-DB statt dem Filesystem benutzt, so ist eine Installation vorzunehmen, bei der der Code auch eingetragen werden muss.
defined('CODE') || define ('CODE', '123456xxx'); defined('CODE') || define ('CODE', '123456xxx');
// Falls als DB "file" angegeben wurde
defined('STATUS_FILE') || define ('STATUS_FILE', 'status.db');
defined('OSSYSTEM_FILE') || define ('OSSYSTEM_FILE', 'ossystem.db');
defined('IMAGES_FILE') || define ('IMAGES_FILE', 'images.db');
defined('QUEUE_FILE') || define ('QUEUE_FILE', 'queue.db');
defined('LOG') || define ('LOG', false);
defined('MAX_LOG_CHARS') || define ('MAX_LOG_CHARS', 10000);

View File

@ -1,10 +1,14 @@
<?php <?php
// Datenbank-Verbindungsparameter // Datenbank-Verbindungsparameter
require_once ('config.php'); require_once ('config.php');
defined('DB') || define ( 'DB','mysql' );
defined('LOG') || define ('LOG', false);
defined('MAX_LOG_CHARS') || define ('MAX_LOG_CHARS', 10000);
class DbUtils { class DbUtils {
public static $TYPE_LOGO = 1; public static $TYPE_LOGO = 1;
public static $TYPE_PRODIMG = 2; public static $TYPE_PRODIMG = 2;
private static $cachedTimezone = "Europe/Berlin";
public static function openDbAndReturnPdoStatic () { public static function openDbAndReturnPdoStatic () {
$dsn = 'mysql:host=' . MYSQL_HOST . ';dbname=' . MYSQL_DB; $dsn = 'mysql:host=' . MYSQL_HOST . ';dbname=' . MYSQL_DB;
@ -59,13 +63,110 @@ class DbUtils {
} }
public static function getConfigItem($pdo,$item,$default) { private static function getOsValueFromDbFile($item,$default) {
$sql = "SELECT value FROM %ossystem% WHERE item=?"; $filename = dirname(__FILE__) . '/../db/' . OSSYSTEM_FILE;
$result = self::fetchSqlAll($pdo, $sql, array($item)); try {
if (count($result) == 0) { if (file_exists($filename)) {
return $default; $allData = file_get_contents($filename);
$dataItems = json_decode($allData,true);
if (isset($dataItems[$item])) {
return $dataItems[$item];
} else { } else {
return $result[0]["value"]; return $default;
} }
} else {
return $default;
}
} catch (Exception $ex) {
return $default;
}
}
public static function getConfigItem($pdo,$item,$default) {
$val = $default;
if (DB == "mysql") {
$sql = "select value from %ossystem% where item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($item));
if (count($result) > 0) {
$val = $result[0]["value"];
}
} else {
$val = self::getOsValueFromDbFile($item, $default);
}
if ($item == "timezone") {
self::$cachedTimezone = $val;
}
return $val;
}
public static function getImageData($pdo,$imageName,$productid) {
if (DB == "mysql") {
if (is_null($productid)) {
$sql = "SELECT content FROM %images% WHERE imagename=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($imageName));
} else {
$sql = "SELECT content FROM %images% WHERE productid=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($productid));
}
if (count($result) > 0) {
return ($result[0]["content"]);
} else {
return null;
}
} else {
$filename = dirname(__FILE__) . '/../db/' . IMAGES_FILE;
try {
if (file_exists($filename)) {
$fileContent = file_get_contents($filename);
$images = json_decode($fileContent,true);
foreach($images as $img) {
if (is_null($productid)) {
if ($img["imagename"] == $imageName) {
return $img["content"];
}
} else {
if ($img["productid"] == $productid) {
return $img["content"];
}
}
}
}
} catch (Exception $ex) {
return null;
}
return null;
}
}
private static function logTruncated($filename, $max) {
try {
$offset = filesize($filename) - $max;
if ($offset > 0) {
$logsToKeep = file_get_contents($filename, NULL, NULL, $offset, $max);
file_put_contents($filename, $logsToKeep);
}
} catch (Exception $ex) {}
}
public static function log($str) {
if (LOG) {
try {
date_default_timezone_set(self::$cachedTimezone);
$logfile = dirname(__FILE__) . '/../db/log.txt';
self::logTruncated($logfile, MAX_LOG_CHARS);
$logtime = date('Y-m-d H:i:s');
file_put_contents($logfile, "$logtime: $str\r\n", FILE_APPEND);
} catch (Exception $ex) { }
}
}
public static function logVar($description,$v) {
ob_start();
print_r($v);
$result = ob_get_clean();
self::log($description . ": " . $result);
} }
} }

View File

@ -2,35 +2,31 @@
require_once 'dbutils.php'; require_once 'dbutils.php';
require_once 'config.php'; require_once 'config.php';
defined('DB') || define ( 'DB','mysql' );
class Menu { class Menu {
public static function getmenu($pdo) { public static function getmenu($pdo) {
$sql = "SELECT value FROM %ossystem% WHERE item=?"; $productsJson = DbUtils::getConfigItem($pdo, 'products', null);
$result = DbUtils::fetchSqlAll($pdo, $sql, array('products')); if (is_null($productsJson)) {
if (is_null($result) || (count($result) == 0)) {
return array("status" => "ERROR","msg" => "Keine Produktdefinition hinterlegt."); return array("status" => "ERROR","msg" => "Keine Produktdefinition hinterlegt.");
} }
$products = json_decode($productsJson,true);
$products = json_decode($result[0]["value"], true); $typesJson = DbUtils::getConfigItem($pdo, 'types', null);
if (is_null($typesJson)) {
$sql = "SELECT value FROM %ossystem% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array('types'));
if (is_null($result) || (count($result) == 0)) {
return array("status" => "ERROR","msg" => "Keine Produktdefinition hinterlegt."); return array("status" => "ERROR","msg" => "Keine Produktdefinition hinterlegt.");
} }
$types = json_decode($typesJson,true);
$types = json_decode($result[0]["value"], true);
foreach ($types as &$t) { foreach ($types as &$t) {
$typeid = $t["id"]; $typeid = $t["id"];
$t["hasprodimages"] = self::hasTypeProdImages($pdo, $types, $products, $typeid); $t["hasprodimages"] = self::hasTypeProdImages($pdo, $products, $typeid);
} }
return array("status" => "OK","msg" => array("types" => $types,"products" => $products)); return array("status" => "OK","msg" => array("types" => $types,"products" => $products));
} }
private static function hasTypeProdImages($pdo,$alltypes,$allproducts,$typeid) { private static function hasTypeProdImages($pdo,$allproducts,$typeid) {
$prodids = array(); $prodids = array();
foreach($allproducts as $p) { foreach($allproducts as $p) {
if ($p["ref"] == $typeid) { if ($p["ref"] == $typeid) {
@ -39,14 +35,11 @@ class Menu {
} }
$sql = "SELECT IFNULL(content,'') as content FROM %images% WHERE contenttype=? AND productid=?"; $sql = "SELECT IFNULL(content,'') as content FROM %images% WHERE contenttype=? AND productid=?";
foreach($prodids as $prodid) { foreach($prodids as $prodid) {
$img = DbUtils::fetchSqlAll($pdo, $sql, array(DbUtils::$TYPE_PRODIMG,$prodid)); $img = DbUtils::getImageData($pdo, '', $prodid);
if (count($img) > 0) { if (!is_null($img)) {
$imgdata = $img[0]["content"];
if ($imgdata != '') {
return 1; return 1;
} }
} }
}
return 0; return 0;
} }
@ -55,7 +48,10 @@ class Menu {
if (isset($_GET["command"])) { if (isset($_GET["command"])) {
$command = $_GET["command"]; $command = $_GET["command"];
$pdo = null;
if (DB == "mysql") {
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
}
switch ($command) { switch ($command) {
case "getmenu": case "getmenu":

View File

@ -2,6 +2,7 @@
require_once 'dbutils.php'; require_once 'dbutils.php';
require_once 'config.php'; require_once 'config.php';
defined('DB') || define ( 'DB','mysql' );
class OsSystem { class OsSystem {
private static function outputEmptyImage() { private static function outputEmptyImage() {
@ -16,26 +17,22 @@ class OsSystem {
} }
public static function getlogo($pdo) { public static function getlogo($pdo) {
$sql = "SELECT content as img FROM %images% WHERE name='logo'"; $img = DbUtils::getImageData($pdo, 'logo', null);
self::outputImageFromDb($pdo, $sql, null); self::outputImage($pdo, $img);
} }
public static function getprodimage($pdo,$prodid) { public static function getprodimage($pdo,$prodid) {
$sql = "SELECT content as img FROM %images% WHERE contenttype=? AND productid=?"; $img = DbUtils::getImageData($pdo, '', $prodid);
$params = array(DbUtils::$TYPE_PRODIMG,$prodid); self::outputImage($pdo, $img);
self::outputImageFromDb($pdo, $sql, $params);
} }
private static function outputImageFromDb($pdo,$sql,$params) { private static function outputImage($pdo,$imgDataInBase64) {
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache"); header("Pragma: no-cache");
header("Expires: Mon, 20 Dec 1998 01:00:00 GMT" ); header("Expires: Mon, 20 Dec 1998 01:00:00 GMT" );
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_PNG)); header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_PNG));
$result = DbUtils::fetchSqlAll($pdo, $sql, $params); if (!is_null($imgDataInBase64)) {
if (count($result) > 0) { $img = base64_decode($imgDataInBase64);
$logoImg = $result[0]["img"];
if ($logoImg != '') {
$img = base64_decode($logoImg);
$php_img = imagecreatefromstring($img); $php_img = imagecreatefromstring($img);
imagesavealpha($php_img, true); imagesavealpha($php_img, true);
@ -46,53 +43,86 @@ class OsSystem {
imagedestroy($php_img); imagedestroy($php_img);
return; return;
} }
}
self::outputEmptyImage(); self::outputEmptyImage();
} }
public static function checkLastOsAccess($pdo) { private static function checkIndividualFileWriteStatus($filename) {
$timezone = self::getTimeZone($pdo); if (file_exists($filename)) {
if (is_writable($filename)) {
return array("writeable" => 1);
} else {
return array("writeable" => 0,"file" => "Datei $filename nicht beschreibbar", "reason" => '');
}
}
}
private static function checkFileDbWriteStatus() {
$dir = dirname(__FILE__) . '/../db';
if (!file_exists($dir)) {
return array("writeable" => 0,"file" => $dir, "reason" => "Verzeichnis existiert nicht");
} else if (!is_writable($dir)) {
return array("writeable" => 0,"file" => $dir, "reason" => '');
}
$filesToCheck = array(STATUS_FILE,OSSYSTEM_FILE,IMAGES_FILE,QUEUE_FILE);
foreach ($filesToCheck as $aFile) {
$filename = $dir . '/' . $aFile;
$writeStatus = self::checkIndividualFileWriteStatus($filename);
if ($writeStatus["writeable"] == 0) {
return $writeStatus;
}
}
return array(1);
}
public static function getsystemstatus($pdo) {
$timezone = DbUtils::getConfigItem($pdo, "timezone", "Europe/Berlin");
date_default_timezone_set($timezone); date_default_timezone_set($timezone);
$writeStatus = array(1);
$lastaccess = null;
if (DB == "mysql") {
$sql = "SELECT date FROM %gueststatus% WHERE item=?"; $sql = "SELECT date FROM %gueststatus% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array('lastosaccess')); $result = DbUtils::fetchSqlAll($pdo, $sql, array('lastosaccess'));
if (count($result) == 0) { if (count($result) > 0) {
$msg = "0";
} else {
$lastaccess = $result[0]["date"]; $lastaccess = $result[0]["date"];
}
} else {
try {
$writeStatus = self::checkFileDbWriteStatus();
$lastaccess = file_get_contents("../db/" . STATUS_FILE);
} catch (Exception $ex) {
$lastaccess = null;
}
}
$date = new DateTime(); $date = new DateTime();
$currentTimeStamp = $date->getTimestamp(); $currentTimeStamp = $date->getTimestamp();
if (!is_null($lastaccess)) {
if (($currentTimeStamp - $lastaccess) > 60) { if (($currentTimeStamp - $lastaccess) > 60) {
$msg = 0; $lastaccessok = 0;
} else { } else {
$msg = 1; $lastaccessok = 1;
} }
} } else {
return array("status" => "OK","msg" => $msg); $lastaccessok = 0;
} }
public static function getTimeZone($pdo) { return array("status" => "OK","msg" => array("lastaccessok" => $lastaccessok,"dbwritestatus" => $writeStatus));
$sql = "select value from %ossystem% where item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array("timezone"));
if (count($result) == 1) {
return $result[0]["value"];
} else {
return "Europe/Berlin";
}
} }
} }
if (isset($_GET["command"])) { if (isset($_GET["command"])) {
$command = $_GET["command"]; $command = $_GET["command"];
$pdo = null;
if (DB == "mysql") {
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
}
switch ($command) { switch ($command) {
case "getlastosaccess": case "getsystemstatus":
$ret = OsSystem::checkLastOsAccess($pdo); $ret = OsSystem::getsystemstatus($pdo);
echo json_encode($ret); echo json_encode($ret);
break; break;
case "getlogo": case "getlogo":

View File

@ -2,19 +2,37 @@
require_once 'dbutils.php'; require_once 'dbutils.php';
require_once 'config.php'; require_once 'config.php';
defined('DB') || define ( 'DB','mysql' );
require_once 'ossystem.php'; require_once 'ossystem.php';
class Queue { class Queue {
public static function putintoqueue($pdo,$prodid,$tableid,$tablecode,$dailycode) { public static function putintoqueue($pdo,$prodid,$tableid,$tablecode,$dailycode) {
$timezone = OsSystem::getTimeZone($pdo); $timezone = DbUtils::getConfigItem($pdo, "timezone", "Europe/Berlin");
date_default_timezone_set($timezone); date_default_timezone_set($timezone);
$ordertime = date('Y-m-d H:i:s'); $ordertime = date('Y-m-d H:i:s');
if (DB == "mysql") {
$pdo->beginTransaction(); $pdo->beginTransaction();
$sql = "INSERT INTO %queue% (date,prodid,tableid,tablecode,dailycode) VALUES(?,?,?,?,?)"; $sql = "INSERT INTO %queue% (date,prodid,tableid,tablecode,dailycode) VALUES(?,?,?,?,?)";
DbUtils::execSql($pdo, $sql, array($ordertime,$prodid,$tableid,$tablecode,$dailycode)); DbUtils::execSql($pdo, $sql, array($ordertime,$prodid,$tableid,$tablecode,$dailycode));
$pdo->commit(); $pdo->commit();
DbUtils::log("Added product with id $prodid to mysql queue table");
return array("status" => "OK"); return array("status" => "OK");
} else {
$filename = dirname(__FILE__) . '/../db/' . QUEUE_FILE;
try {
$queueItems = array();
if (file_exists($filename)) {
$queueItemsFileContent = file_get_contents($filename);
$queueItems = json_decode($queueItemsFileContent,true);
}
$queueItems[] = array("date" => $ordertime,"prodid" => $prodid,"tableid" => $tableid, "tablecode" => $tablecode, "dailycode" => $dailycode);
file_put_contents($filename, json_encode($queueItems));
DbUtils::log("Add product with id $prodid to file queue");
return array("status" => "OK");
} catch (Exception $ex) {
return array("status" => "ERROR","msg" => $ex->getMessage());
}
}
} }
} }
@ -22,7 +40,10 @@ class Queue {
if (isset($_GET["command"])) { if (isset($_GET["command"])) {
$command = $_GET["command"]; $command = $_GET["command"];
$pdo = null;
if (DB == "mysql") {
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
}
switch ($command) { switch ($command) {
case "putintoqueue": case "putintoqueue":

View File

@ -2,24 +2,17 @@
require_once 'dbutils.php'; require_once 'dbutils.php';
require_once 'config.php'; require_once 'config.php';
defined('DB') || define ( 'DB','mysql' );
class Tables { class Tables {
public static function gettables($pdo) { public static function gettables($pdo) {
$sql = "SELECT value FROM %ossystem% WHERE item=?"; $tables = DbUtils::getConfigItem($pdo, 'resttables', null);
$result = DbUtils::fetchSqlAll($pdo, $sql, array('resttables'));
if (is_null($result) || (count($result) == 0)) { if (is_null($tables)) {
return array("status" => "ERROR","msg" => "Keine Tischdefinition hinterlegt.");
}
if (is_null($result[0]["value"])) {
return array("status" => "ERROR","msg" => "Keine Tischdefinition hinterlegt oder Tische für die Gastbestellung nicht eingerichtet."); return array("status" => "ERROR","msg" => "Keine Tischdefinition hinterlegt oder Tische für die Gastbestellung nicht eingerichtet.");
} }
$tables = json_decode($result[0]["value"], true); $tables = json_decode($tables,true);
$tablesArr = array(); $tablesArr = array();
foreach ($tables as $t) { foreach ($tables as $t) {
$tablesArr[] = array("id" => $t["id"],"name" => $t["name"]); $tablesArr[] = array("id" => $t["id"],"name" => $t["name"]);
@ -46,19 +39,22 @@ class Tables {
$askdaycode = DbUtils::getConfigItem($pdo, 'askdaycode', 1); $askdaycode = DbUtils::getConfigItem($pdo, 'askdaycode', 1);
$asktablecode = DbUtils::getConfigItem($pdo, 'asktablecode', 1); $asktablecode = DbUtils::getConfigItem($pdo, 'asktablecode', 1);
$dailycodeInDbUntrimmed = DbUtils::getConfigItem($pdo, 'dailycode', null);
$dailycodeInDb = null;
if (!is_null($dailycodeInDbUntrimmed)) {
$dailycodeInDb = trim($dailycodeInDbUntrimmed);
}
$sql = "SELECT value FROM %ossystem% WHERE item=?"; $resttables = DbUtils::getConfigItem($pdo, 'resttables', null);
$result = DbUtils::fetchSqlAll($pdo, $sql, array('resttables'));
if (count($result) == 0) { if (is_null($resttables)) {
return array("status" => "ERROR","msg" => "Keine Tischdefinition hinterlegt."); return array("status" => "ERROR","msg" => "Keine Tischdefinition hinterlegt.");
} }
if ($asktablecode == 1) { if ($asktablecode == 1) {
$resttables = $result[0]; $tables = json_decode($resttables, true);
$tables = json_decode($resttables["value"], true);
foreach ($tables as $t) { foreach ($tables as $t) {
DbUtils::log("CHECKE tid = " . $t["id"] . " mit tableid=" . $tableid);
if ($t["id"] == $tableid) { if ($t["id"] == $tableid) {
if (trim($t["code"]) == $tablecode) { if (trim($t["code"]) == $tablecode) {
break; break;
@ -70,14 +66,11 @@ class Tables {
} }
if ($askdaycode == 1) { if ($askdaycode == 1) {
$sql = "SELECT value FROM %ossystem% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array('dailycode'));
if (count($result) == 0) { if (is_null($dailycodeInDb)) {
return array("status" => "ERROR","msg" => "Keine Tageslosung wurde hinterlegt."); return array("status" => "ERROR","msg" => "Keine Tageslosung wurde hinterlegt.");
} }
$dailycodeInDb = trim($result[0]["value"]);
if ($dailycode == $dailycodeInDb) { if ($dailycode == $dailycodeInDb) {
return array("status" => "OK"); return array("status" => "OK");
} else { } else {

View File

@ -2,11 +2,13 @@
require_once 'php/dbutils.php'; require_once 'php/dbutils.php';
require_once 'php/config.php'; require_once 'php/config.php';
defined('DB') || define ( 'DB','mysql' );
class Sync { class Sync {
public static function insertSystemData($pdo,$systemdata) { public static function insertSystemData($pdo,$systemdata) {
try { try {
DbUtils::log("insertSystemData started");
if (!isset($systemdata["guestcode"])) { if (!isset($systemdata["guestcode"])) {
return array("status" => "ERROR","msg" => "No Access code transmitted!"); return array("status" => "ERROR","msg" => "No Access code transmitted!");
} }
@ -24,63 +26,220 @@ class Sync {
self::insertIntoSystemTable($pdo, $systemdata, 'currency'); self::insertIntoSystemTable($pdo, $systemdata, 'currency');
self::insertIntoSystemTable($pdo, $systemdata, 'decpoint'); self::insertIntoSystemTable($pdo, $systemdata, 'decpoint');
self::insertIntoSystemTableWithCheck($pdo, $systemdata, 'askdaycode'); self::insertIntoSystemTable($pdo, $systemdata, 'askdaycode');
self::insertIntoSystemTableWithCheck($pdo, $systemdata, 'asktablecode'); self::insertIntoSystemTable($pdo, $systemdata, 'asktablecode');
self::insertIntoSystemTableWithCheck($pdo, $systemdata, 'guesttimeout'); self::insertIntoSystemTable($pdo, $systemdata, 'guesttimeout');
if (isset($systemdata["timezone"])) { if (isset($systemdata["timezone"])) {
self::updateOsAccessStatus($pdo, $systemdata["timezone"]); self::updateOsAccessStatus($pdo, $systemdata["timezone"]);
} }
if (isset($systemdata["logo"])) { $logo = '';
if (isset($systemdata["logo"]) && ($systemdata["logo"] != '')) {
$logo = $systemdata["logo"]; $logo = $systemdata["logo"];
} else {
$logo = "";
} }
self::insertOrUpdateOrDeleteImage($pdo, 'logo', $logo, DbUtils::$TYPE_LOGO, null);
DbUtils::execSql($pdo, "DELETE FROM %images% WHERE name='logo'",null);
$sql = "INSERT INTO %images% (name,content,contenttype,productid) VALUES('logo',?,?,?)";
DbUtils::execSql($pdo, $sql, array($logo, DbUtils::$TYPE_LOGO,null));
$sql = "DELETE FROM %images% WHERE contenttype=?";
DbUtils::execSql($pdo, $sql, array(DbUtils::$TYPE_PRODIMG));
DbUtils::execSql($pdo, "OPTIMIZE TABLE %images%",null);
if (isset($systemdata["prodimages"])) { if (isset($systemdata["prodimages"])) {
self::insertProdImages($pdo, $systemdata["prodimages"]); DbUtils::log("prodimages are transmitted -> update now");
self::insertOrUpdateProdImages($pdo, $systemdata["prodimages"]);
} }
return array("status" => "OK"); return array("status" => "OK");
} catch (Exception $ex) { } catch (Exception $ex) {
return array("status" => "ERROR","msg" => $ex->getMessage()); return array("status" => "ERROR","msg" => $ex->getMessage());
} }
} }
private static function deleteImage_not_used($pdo,$imageName,$productid) {
if (DB == "mysql") {
if (is_null($productid)) {
$sql = "DELETE FROM %images% WHERE imagename=?";
DbUtils::execSql($pdo, $sql, array($imageName));
} else {
$sql = "DELETE FROM %images% WHERE productid=?";
DbUtils::execSql($pdo, $sql, array($productid));
}
} else {
}
}
private static function insertOrUpdateOrDeleteImage($pdo,$imageName,$content,$contenttype,$productid) {
$contentMd5 = null;
if ($content == '-') {
$content = '';
}
if (!is_null($content)) {
$contentMd5 = md5($content);
}
if (DB == "mysql") {
if (is_null($productid)) {
$sql = "SELECT id,content FROM %images% WHERE imagename=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($imageName));
} else {
$sql = "SELECT id,content FROM %images% WHERE productid=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($productid));
}
$delete = false;
if (!is_null($productid) && ($content == '')) {
$delete = true;
} else if (is_null($productid) && ($content == '')) {
$delete = true;
}
if ($delete) {
if (count($result) > 0) {
$id = $result[0]["id"];
$sql = "DELETE FROM %images% WHERE id=?";
DbUtils::execSql($pdo, $sql, array($id));
if (!is_null($productid)) {
DbUtils::log("Product image with id $productid deleted from mysql");
} else {
DbUtils::log("Product image with name $imageName deleted from mysql");
}
}
return;
}
if (count($result) == 0) {
$sql = "INSERT INTO %images% (imagename,content,contenttype,productid) VALUES(?,?,?,?)";
DbUtils::execSql($pdo, $sql, array($imageName,$content,$contenttype,$productid));
DbUtils::log("Image with name '" . $imageName . "' and product id=" . (is_null($productid) ? "null":$productid) . " inserted into mysql");
} else {
$origContentMd5 = md5($result[0]["content"]);
if ($contentMd5 != $origContentMd5) {
$rowId = $result[0]["id"];
$sql = "UPDATE %images% SET imagename=?,content=?,contenttype=?,productid=? WHERE id=?";
DbUtils::execSql($pdo, $sql, array($imageName,$content,$contenttype,$productid,$rowId));
DbUtils::log("Image updated with imagename='$imageName' and productid=" . (is_null($productid) ? "null":$productid) . " in mysql");
}
}
} else {
try {
$filename = "db/" . IMAGES_FILE;
$images = array();
if (file_exists($filename)) {
$imagesContent = file_get_contents($filename);
$images = json_decode($imagesContent,true);
}
$imgesWereChanged = false;
$foundImageAtKey = null;
$keys = array_keys($images);
foreach($keys as $aKey) {
$img = $images[$aKey];
if (is_null($productid)) {
if ($img["imagename"] == $imageName) {
$foundImageAtKey = $aKey;
break;
}
} else {
if ($img["productid"] == $productid) {
$foundImageAtKey = $aKey;
break;
}
}
}
$delete = false;
if ($imageName == 'logo') {
DbUtils::log("Logo content: " . $content);
}
if (!is_null($productid) && ($content == '')) {
$delete = true;
} else if (is_null($productid) && ($content == '')) {
$delete = true;
}
if ($delete) {
if (!is_null($foundImageAtKey)) {
unset ($images[$foundImageAtKey]);
file_put_contents($filename, json_encode($images));
if (!is_null($productid)) {
DbUtils::log("Product image with id $productid deleted from file");
} else {
DbUtils::log("Product image with name $imageName deleted from file");
}
}
return;
}
$img = array("imagename" => $imageName,"content" => $content, "contenttype" => $contenttype, "productid" => $productid);
if (is_null($foundImageAtKey)) {
$images[] = $img;
$imgesWereChanged = true;
DbUtils::log("Image with name '" . $imageName . "' and product id=" . (is_null($productid) ? "null":$productid) . " inserted into file db");
} else {
$origContentMd5 = md5($images[$foundImageAtKey]["content"]);
if ($contentMd5 != $origContentMd5) {
$images[$foundImageAtKey] = $img;
$imgesWereChanged = true;
DbUtils::log("Image updated with imagename='$imageName' and productid=" . (is_null($productid) ? "null":$productid) . " in file db");
}
}
if ($imgesWereChanged) {
file_put_contents($filename, json_encode($images));
}
} catch(Exception $ex) { }
}
}
private static function insertOrUpdateProdImages($pdo,$imagedata) {
foreach ($imagedata as $img) {
$productid = $img['prodid'];
$imgl = $img['imagedata'];
self::insertOrUpdateOrDeleteImage($pdo, '', $imgl, DbUtils::$TYPE_PRODIMG, $productid);
}
}
private static function insertIntoSystemTable($pdo,$data,$item) { private static function insertIntoSystemTable($pdo,$data,$item) {
if (isset($data[$item])) { if (isset($data[$item])) {
$value = $data[$item]; $value = $data[$item];
$valuemd5 = md5($value);
if (DB == "mysql") {
$sql = "SELECT value FROM %ossystem% WHERE item=?";
$origvalSql = DbUtils::fetchSqlAll($pdo, $sql, array($item));
if (count($origvalSql) == 0) {
$sql = "INSERT INTO %ossystem% (item,value) VALUES(?,?)";
DbUtils::execSql($pdo, $sql, array($item,$value));
} else {
// to avoid unnecessary write operations check if update is needed
$origvalmd5 = md5($origvalSql[0]["value"]);
if ($valuemd5 != $origvalmd5) {
$sql = "UPDATE %ossystem% SET value=? WHERE item=?"; $sql = "UPDATE %ossystem% SET value=? WHERE item=?";
DbUtils::execSql($pdo, $sql, array($value,$item)); DbUtils::execSql($pdo, $sql, array($value,$item));
} }
} }
private static function insertIntoSystemTableWithCheck($pdo,$data,$item) {
if (isset($data[$item])) {
$sql = "SELECT id FROM %ossystem% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($item));
if (count($result) == 0) {
$sql = "INSERT INTO %ossystem% (item,value) VALUES(?,?)";
DbUtils::execSql($pdo, $sql, array($item,$data[$item]));
} else { } else {
self::insertIntoSystemTable($pdo, $data, $item); $filename = "db/" . OSSYSTEM_FILE;
try {
if (file_exists($filename)) {
$allOssystemvalues = file_get_contents($filename);
$dataItems = json_decode($allOssystemvalues, true);
if (isset($dataItems[$item])) {
$origvalmd5 = md5($dataItems[$item]);
if ($valuemd5 != $origvalmd5) {
$dataItems[$item] = $value;
file_put_contents($filename, json_encode($dataItems));
DbUtils::log("In $filename update item $item with value $value");
} }
} else {
$dataItems[$item] = $value;
file_put_contents($filename, json_encode($dataItems));
DbUtils::log("In $filename insert item $item with value $value");
} }
} else {
$dataItems = [];
$dataItems[$item] = $value;
file_put_contents($filename, json_encode($dataItems));
DbUtils::log("Create $filename and insert item $item with value $value");
}
} catch (Exception $ex) { }
} }
private static function insertProdImages($pdo,$imagedata) {
$sql = "INSERT INTO %images% (name,content,contenttype,productid) VALUES(?,?,?,?)";
foreach ($imagedata as $img) {
$prodid = $img['prodid'];
$imgl = $img['imagedata'];
DbUtils::execSql($pdo, $sql, array('',$imgl, DbUtils::$TYPE_PRODIMG,$prodid));
} }
} }
@ -89,6 +248,7 @@ class Sync {
$date = new DateTime(); $date = new DateTime();
$currentTimeStamp = $date->getTimestamp(); $currentTimeStamp = $date->getTimestamp();
if (DB == "mysql") {
$sql = "SELECT id FROM %gueststatus% WHERE item=?"; $sql = "SELECT id FROM %gueststatus% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array('lastosaccess')); $result = DbUtils::fetchSqlAll($pdo, $sql, array('lastosaccess'));
if (count($result) == 0) { if (count($result) == 0) {
@ -97,24 +257,55 @@ class Sync {
$sql = "UPDATE %gueststatus% SET date=? WHERE item=?"; $sql = "UPDATE %gueststatus% SET date=? WHERE item=?";
} }
DbUtils::execSql($pdo, $sql, array($currentTimeStamp,'lastosaccess')); DbUtils::execSql($pdo, $sql, array($currentTimeStamp,'lastosaccess'));
} else {
$filename = "db/" . STATUS_FILE;
try {
if (file_exists($filename)) {
$lastaccess = file_get_contents($filename);
if ($currentTimeStamp != $lastaccess) {
file_put_contents($filename, $currentTimeStamp);
}
} else {
file_put_contents($filename, $currentTimeStamp);
}
} catch (Exception $ex) { }
}
} }
public static function fetchQueueData($pdo) { public static function fetchQueueData($pdo) {
// id | date | tableid | prodid | tablecode | dailycode if (DB == "mysql") {
$pdo->beginTransaction(); $pdo->beginTransaction();
$sql = "SELECT id,date,tableid,prodid,tablecode,dailycode FROM %queue%"; $sql = "SELECT id,date,tableid,prodid,tablecode,dailycode FROM %queue%";
$result = DbUtils::fetchSqlAll($pdo, $sql, null); $result = DbUtils::fetchSqlAll($pdo, $sql, null);
DbUtils::log("Transmit " . count($result) . " items to core system from mysql queue table");
$sql = "DELETE FROM %queue%"; $sql = "DELETE FROM %queue%";
DbUtils::execSql($pdo, $sql, null); DbUtils::execSql($pdo, $sql, null);
$pdo->commit(); $pdo->commit();
return $result; return $result;
} else {
$filename = "db/" . QUEUE_FILE;
if (file_exists($filename)) {
$queueItemsInFile = file_get_contents($filename);
$queueItems = json_decode($queueItemsInFile,true);
DbUtils::log("Transmit " . count($queueItems) . " items to core system from file queue");
$emptyContent = json_encode(array());
file_put_contents($filename, $emptyContent);
return $queueItems;
} else {
return array();
}
}
} }
} }
if (isset($_POST["data"])) { if (isset($_POST["data"])) {
$pdo = null;
if (DB == "mysql") {
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
}
$data = $_POST["data"]; $data = $_POST["data"];

View File

@ -85,7 +85,7 @@ class Installer {
} }
Database::dropTables($pdo); Database::dropTables($pdo);
Database::createEmptyTables($pdo, $prefix); Database::createEmptyTables($pdo, $prefix);
Database::setVersion($pdo,$prefix,"1.5.25"); Database::setVersion($pdo,$prefix,"1.5.26");
Database::setAccessPassword($pdo,$prefix,$adminpass); Database::setAccessPassword($pdo,$prefix,$adminpass);
Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour
return array("status" => "OK","msg" => "Installation successful"); return array("status" => "OK","msg" => "Installation successful");

Binary file not shown.

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,8 +13,8 @@
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-2.0.3.min.js"></script> <script src="php/3rdparty/jquery-2.0.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script>
<script src="utilities.js?v=1.5.25"></script> <script src="utilities.js?v=1.5.26"></script>
<script src="kitchenbar.js?v=1.5.25"></script> <script src="kitchenbar.js?v=1.5.26"></script>
<style> <style>
#tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook #tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -50,6 +50,8 @@ Speisen = KBF = 1
Vanilleteilchen; 3,40 # Bildnr: 22 Vanilleteilchen; 3,40 # Bildnr: 22
Suessigkeitenteller ; 10,00 # Bildnr:33 Suessigkeitenteller ; 10,00 # Bildnr:33
Eliseplätzchen ; 5,00 # Bildnr:30 Eliseplätzchen ; 5,00 # Bildnr:30
Waffeleis; 0,00
Bechereis; 0,00
Kategorie Selbstbedienung = F = 1 Kategorie Selbstbedienung = F = 1
Frühstücksbuffet; 8,00 # Bildnr: 1 Frühstücksbuffet; 8,00 # Bildnr: 1
Frühstücksbuffet + Kaffe; 12,00 # Bildnr: 1 Frühstücksbuffet + Kaffe; 12,00 # Bildnr: 1
@ -90,7 +92,10 @@ Getränke = KBD = 1
Wein lieblich; 6,00 # Bildnr: 1 Wein lieblich; 6,00 # Bildnr: 1
# #
# Es folgen die Extras # Es folgen die Extras
!Sahne # 0,50 ; Tasse Kaffee , Becher Kaffee !Sahne # Preis: 0,50 ; Max: 1; Zugewiesen: Tasse Kaffee , Becher Kaffee
!Karamellaroma # 0,50 ; Tasse Kaffee , Becher Kaffee , Latte Macchiato !Karamellaroma # Preis: 0,50 ; Max: 1; Zugewiesen: Tasse Kaffee , Becher Kaffee , Latte Macchiato
!Majo # 0,50 ; Pommes !Majo # Preis: 0,50 ; Max: 1; Zugewiesen: Pommes
!Ketchup # 0,50 ; Pommes !Ketchup # Preis: 0,50 ; Max: 1; Zugewiesen: Pommes
!Vanille # Preis: 1,00 ; Max: 8; Zugewiesen: Waffeleis, Bechereis
!Erdbeer # Preis: 1,00 ; Max: 8; Zugewiesen: Waffeleis, Bechereis
!Schoko-Riesenkugel # Preis: 1,50; Max: 4; Zugewiesen: Waffeleis, Bechereis

View File

@ -1,46 +1 @@
/** function newExtra(e,c,d,b){var a={id:e,name:c,price:d,maxamount:b,createTableStructureLine:function(g,f){if(e!=null){var h="<tr id='extra_"+e+"'><td><input id='extraname_"+e+"' type='text' class='extraname'></input><td><input id='extraprice_"+e+"' type='text' class='extraprice'></input><td><input id='extramaxamount_"+e+"' type='text' class='extramaxamount'></input><td><button id='delextra_"+e+"' class='extracmd'>&minus;</button><td><button id='applyextra_"+e+"' class='extracmd'>&crarr;</button><td><button id='upextra_"+e+"' class='extracmd'>&uarr;</button></tr>";return h}else{var h="<tr id='extra_new_"+e+"'><td><input id='newextraname' type='text' class='extraname'></input><td><input id='newextraprice' type='text' class='extraprice'></input><td><input id='newextramaxamount' type='text' class='extramaxamount'></input><td><button id='newextra_0' class='extracmd'>+</button></tr>";return h}},insertValuesIntoMenuTable:function(){$("#extra_"+this.id+" input.extraname").val(this.name);$("#extra_"+this.id+" input.extramaxamount").val(this.maxamount);if(this.price!=null){$("#extra_"+this.id+" input.extraprice").val(this.price)}},createApplyArea:function(g){var f='<p><fieldset><div><button id="'+g+'" type="submit" data-theme="b" class="extracmd" data-icon="check">'+PROD_APPLY[lang]+"</button></div></fieldset></p>";return f}};return a}function ExtrasManagement(){this.assignedextras=[];this.allextras=[];this.initAllExtras=function(){this.allextras.forEach(function(b,a){b.amount=0})};this.setAllExtras=function(a){if((a!=null)&&(a.length>0)){this.allextras=a}else{this.allextras=[]}this.initAllExtras()};this._renderMobile=function(d,i,a,f,b,g){var e='<span id="extraamount_'+a+'" class="extraamount">';var c=e+toHtml(f)+"</span>";var h='<li data-theme="'+b+'" data-icon="'+g+'"><a href="#" id="extra_'+a+"_"+d+'" class="extrasel '+i+'">'+c+"</a></li>";return h};this.renderExtras=function(e,n,a){var m="";for(var g=0;g<this.allextras.length;g++){var f=this.allextras[g];var b=f.extraid;var j=f.name;var c="d";var k="delete";var h=f.amount;var l="";if(h>0){c="f";k="check";l='<span id="extraamount_'+b+'" class="extraamount">'+h+"x </span>"}var d=l+toHtml(j);if(a){m+='<li data-theme="'+c+'" data-icon="'+k+'"><a href="#" id="extra_'+b+"_"+e+'" class="extrasel '+n+'">'+d+"</a></li>"}else{if(h==0){m+="<li id='extra_"+b+"_"+g+"' class='extraitem' >"+d+"</li>"}else{m+="<li id='extra_"+b+"_"+g+"' class='extraitemselected' >"+d+"</li>"}}}return m};this.extraClicked=function(a){for(var c=0;c<this.allextras.length;c++){var d=this.allextras[c];if(d.extraid==a){var b=parseInt(d.amount);if(b>=parseInt(d.maxamount)){d.amount=0}else{d.amount++}}}};this.getAssignedExtras=function(){var b=[];for(var e=0;e<this.allextras.length;e++){var f=this.allextras[e];var a=f.extraid;var d=f.name;var c=f.amount;if(c>0){b[b.length]={id:a,name:d,price:f.price,amount:c}}}return b};this.calcPriceOfAssignedExtras=function(b){var c=0;if(b!=null){for(var a=0;a<b.length;a++){var d=b[a];c+=parseFloat(d.price*d.amount)}}return c}};
*
*/
function newExtra(id, name, price) {
var extra = {
id:id,
name:name,
price: price,
createTableStructureLine:function (depth,audiofiles) {
if (id != null) {
var trline = "<tr id='extra_" + id + "'>"
+ "<td><input id='extraname_" + id + "' type='text' class='extraname'></input>"
+ "<td><input id='extraprice_" + id + "' type='text' class='extraprice'></input>"
+ "<td><button id='delextra_" + id + "' class='extracmd'>&minus;</button>"
+ "<td><button id='applyextra_" + id + "' class='extracmd'>&crarr;</button>"
+ "<td><button id='upextra_" + id + "' class='extracmd'>&uarr;</button>"
+ "</tr>";
return trline;
} else {
var trline = "<tr id='extra_new_" + id + "'>"
+ "<td><input id='newextraname' type='text' class='extraname'></input>"
+ "<td><input id='newextraprice' type='text' class='extraprice'></input>"
+ "<td><button id='newextra_0' class='extracmd'>+</button>"
+ "</tr>";
return trline;
}
},
insertValuesIntoMenuTable:function() {
$("#extra_" + this.id + " input.extraname").val(this.name);
if (this.price != null) {
$("#extra_" + this.id + " input.extraprice").val(this.price);
}
},
createApplyArea:function(idApply) {
var txt = '<p><fieldset>'
+ '<div><button id="' + idApply + '" type="submit" data-theme="b" class="extracmd" data-icon="check">' + PROD_APPLY[lang] + '</button></div>'
+ '</fieldset></p>';
return txt;
},
};
return extra;
}

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.26">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -231,7 +231,7 @@ function handleResultOfInstallCheck(is_installed) {
if (is_installed == "Yes") { if (is_installed == "Yes") {
useInstallation(); useInstallation();
} else { } else {
setTimeout(function(){document.location.href = "install.html?v=1.5.25"},500); setTimeout(function(){document.location.href = "install.html?v=1.5.26"},500);
} }
} }
@ -240,7 +240,18 @@ function askForCompanyInfo() {
} }
function handleCompanyInfo(answer) { function handleCompanyInfo(answer) {
if (answer.status == "OK") { if (answer.status == "OK") {
companyInfo = answer.msg; companyInfo = answer.msg.companyinfo;
var logolocation = answer.msg.logolocation;
if (logolocation == 0) {
$("#toplogolocation").hide();
$("#middlelogolocation").hide();
} else if (logolocation == 1) {
$("#toplogolocation").show();
$("#middlelogolocation").hide();
} else if (logolocation == 2) {
$("#toplogolocation").hide();
$("#middlelogolocation").show();
}
} }
} }
@ -274,10 +285,12 @@ $(document).on("pageinit", "#index-page", function () {
<div data-role="content"> <div data-role="content">
<p><div style="text-align: center;"><img src="php/contenthandler.php?module=printqueue&command=getLogoAsPng&v=1.5.25&style=always" style="max-height:150px;"/></div> <p><div id="toplogolocation" style="text-align: center;display:none;"><img src="php/contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel&v=1.5.26&style=always" style="max-height:150px;"/></div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" data-theme="e" id="loginmask"> <div data-role="collapsible" data-content-theme="c" data-collapsed="false" data-theme="e" id="loginmask">
<H2>Anmelden</H2> <H2>Anmelden</H2>
<p><div id="middlelogolocation" style="text-align: left;padding-left: 80px;padding-right:80px;display:none;"><img src="php/contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel&v=1.5.26&style=always" style="max-height:150px;"/></div>
<form method="post"> <form method="post">
<table border=0> <table border=0>
<tr><td>Name: <td id="userlist"></tr> <tr><td>Name: <td id="userlist"></tr>

View File

@ -912,7 +912,7 @@ El servicio web OrderSprinter no requiere una conexión a Internet. Sin embargo,
<tr id=updateline> <tr id=updateline>
<td>&nbsp;</td> <td>&nbsp;</td>
<td align=center> <td align=center>
<button id="updatebtn">Update -> 1.5.25</button> <button id="updatebtn">Update -> 1.5.26</button>
<span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span> <span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>

View File

@ -449,7 +449,7 @@ $zones[] = $timezone_identifiers[$i];
echo json_encode($zones); echo json_encode($zones);
} else if ($command == 'update') { } else if ($command == 'update') {
set_time_limit(60*30); set_time_limit(60*30);
$installerVersion = "1.5.25"; $installerVersion = "1.5.26";
$admin = new InstallAdmin(); $admin = new InstallAdmin();
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,8 +13,8 @@
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-2.0.3.min.js"></script> <script src="php/3rdparty/jquery-2.0.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script>
<script src="utilities.js?v=1.5.25"></script> <script src="utilities.js?v=1.5.26"></script>
<script src="kitchenbar.js?v=1.5.25"></script> <script src="kitchenbar.js?v=1.5.26"></script>
<style> <style>
#tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook #tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook

View File

@ -5,5 +5,5 @@
$hostname = $_SERVER['HTTP_HOST']; $hostname = $_SERVER['HTTP_HOST'];
$path = dirname($_SERVER['PHP_SELF']); $path = dirname($_SERVER['PHP_SELF']);
header('Location: http://'.$hostname.($path == '/' ? '' : $path).'/index.html'); header('Location: index.html');
?> ?>

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,10 +13,10 @@
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.25"></script> <script src="utilities.js?v=1.5.26"></script>
<script src="elements/tablemap.js?v=1.5.25"></script> <script src="elements/tablemap.js?v=1.5.26"></script>
<script src="elements/roommap.js?v=1.5.25"></script> <script src="elements/roommap.js?v=1.5.26"></script>
<script src="elements/groundplan.js?v=1.5.25"></script> <script src="elements/groundplan.js?v=1.5.26"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet"> <link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script> <script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
@ -450,6 +450,9 @@ var MAN_TMPDIRHINT = ["Wird das PHP-Tmp-Verzeichnis angegeben, so können z.B. k
"If the PHP tmp directory is set it is possible to create compressed backups and more. Usually the default value of the PHP framework should fit, but sometimes the providers change the tmp directory without adapting the PHP framework!", "If the PHP tmp directory is set it is possible to create compressed backups and more. Usually the default value of the PHP framework should fit, but sometimes the providers change the tmp directory without adapting the PHP framework!",
"Si el tmp esta espcificado es posible crear backups comprimidos por ejemplo. Normalmente el valor default es corecto pero de vez en cuando los providers cambian el valor sin adaptar el PHP framework!"]; "Si el tmp esta espcificado es posible crear backups comprimidos por ejemplo. Normalmente el valor default es corecto pero de vez en cuando los providers cambian el valor sin adaptar el PHP framework!"];
var MAN_IMPORT_IN_PROGRESS = ["Der Importvorgang ist aktiv. Bitte warten...","The import process is activated. Please wait...","El proceso del importe esta activo. Por favor espere un poco...."]; var MAN_IMPORT_IN_PROGRESS = ["Der Importvorgang ist aktiv. Bitte warten...","The import process is activated. Please wait...","El proceso del importe esta activo. Por favor espere un poco...."];
var MAN_LOGOLOCATION = ["Logo-Position auf Anmeldeseite","Position of logo on login page","Posición del logo"];
var MAN_LOGOLOC = [["Unsichtbar","Invisible","No logo"],["Oben","Top","Arriba"],["Im Anmeldefeld","In login area","En area de registrar"]];
var MAN_DAYNAMES = [ var MAN_DAYNAMES = [
["Montag","Monday","Lunes"], ["Montag","Monday","Lunes"],
["Dienstag","Tuesday","Martes"], ["Dienstag","Tuesday","Martes"],
@ -498,7 +501,7 @@ var MAN_LAST_CLOSING = ["Letzte Tageserfassung","Last closing","Cerrada última"
var MAN_PDF_REPORT_HINT = ["Erste und letzte Tageserfassung des Reports nach Eingrenzung des Datumsbereich (oben) auswählen:","Choose first and last closing after limit the time frame (above):","Seleccione la cerrada primera y última después de delimitar el intervalo de fechas (arriba):"]; var MAN_PDF_REPORT_HINT = ["Erste und letzte Tageserfassung des Reports nach Eingrenzung des Datumsbereich (oben) auswählen:","Choose first and last closing after limit the time frame (above):","Seleccione la cerrada primera y última después de delimitar el intervalo de fechas (arriba):"];
var lang = 0; var lang = 0;
var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1, 1,1,1,1,1,1,1,1,1,1, 1,2,3, 1,0, 1,0,1, 1,1,0,0, 0,0,0, 0,0,0,1,1, 0,1,0,1,1, 1,2,0, 0,0,1,1]; var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1, 1,1,1,1,1,1,1,1,1,1, 1,2,3, 1,0, 1,0,1, 1,1,0,0, 0,0,0, 0,0,0,1,1, 0,1,0,1,1, 1,2,0, 0,0,1,1,1];
var numberOfClosings = 0; var numberOfClosings = 0;
@ -650,7 +653,8 @@ var generalValuesSettings = [
["sumupfailuretext",MAN_SUMUPFAILURETEXT[lang],"i",0,""], ["sumupfailuretext",MAN_SUMUPFAILURETEXT[lang],"i",0,""],
["printcash",MAN_PRINTCASH[lang],"s",64], ["printcash",MAN_PRINTCASH[lang],"s",64],
["showerrorlog",MAN_SHOW_ERRORLOG[lang],"s",65], ["showerrorlog",MAN_SHOW_ERRORLOG[lang],"s",65],
["showtransferbtns",MAN_SHOWTRANSFERBTNS[lang],"s",66] ["showtransferbtns",MAN_SHOWTRANSFERBTNS[lang],"s",66],
["logolocation",MAN_LOGOLOCATION[lang],"s",67]
]; ];
var predef = ""; var predef = "";
@ -940,6 +944,9 @@ function saveValueIntoForm(aValue, decpoint, formid) {
function insertGeneralConfigItems(configResult) { function insertGeneralConfigItems(configResult) {
if (configResult.status == "OK") { if (configResult.status == "OK") {
d = new Date();
$("#logoimgpart").attr("src", "php/contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel&"+d.getTime());
var values = configResult.msg; var values = configResult.msg;
setLanguage(values.userlanguage); setLanguage(values.userlanguage);
@ -1148,6 +1155,7 @@ function insertGeneralConfigItems(configResult) {
generalVals[64] = values.printcash; generalVals[64] = values.printcash;
generalVals[65] = values.showerrorlog; generalVals[65] = values.showerrorlog;
generalVals[66] = values.showtransferbtns; generalVals[66] = values.showtransferbtns;
generalVals[67] = values.logolocation;
defaulttmp = values.defaulttmp; defaulttmp = values.defaulttmp;
@ -1191,6 +1199,7 @@ function insertGeneralConfigItems(configResult) {
$("#affiliatekey").val(values.affiliatekey); $("#affiliatekey").val(values.affiliatekey);
$("#appid").val(values.appid); $("#appid").val(values.appid);
$("#sumupfailuretext").val(values.sumupfailuretext); $("#sumupfailuretext").val(values.sumupfailuretext);
$("#partOfLogolocation").html(createLogolocation(values.logolocation));
$("#configpart").trigger("create"); $("#configpart").trigger("create");
bindConfig(); bindConfig();
@ -1521,6 +1530,21 @@ function createSMTPSecure(smtpauth) {
return html; return html;
} }
function createLogolocation(location) {
var html = '<div class="ui-field-contain">';
html += '<label for="logolocation">' + MAN_LOGOLOCATION[lang] + ':</label>';
html += '<select name="smtpsecure" id="logolocation" data-theme="e">';
for (var i=0;i<3;i++) {
if (location == i) {
html += '<option value="' + i + '" selected>' + MAN_LOGOLOC[i][lang] + '</option>';
} else {
html += '<option value="' + i + '">' + MAN_LOGOLOC[i][lang] + '</option>';
}
}
html += '</select></div>';
return html;
}
function createPayPrintTypePart(localOrServer) { function createPayPrintTypePart(localOrServer) {
var html = '<div class="ui-field-contain">'; var html = '<div class="ui-field-contain">';
html += '<label for="payprinttype">' + MAN_PRINT_CONCEPT[lang] + ':</label>'; html += '<label for="payprinttype">' + MAN_PRINT_CONCEPT[lang] + ':</label>';
@ -1609,7 +1633,7 @@ function initRestoreFileUpload() {
} else { } else {
alert("Import war erfolgreich."); alert("Import war erfolgreich.");
setTimeout(function(){ setTimeout(function(){
document.location.href = "index.html?v=1.5.25"; document.location.href = "index.html?v=1.5.26";
},250); },250);
} }
}, },
@ -2280,7 +2304,7 @@ function updateOneSingleFile() {
setTimeout(function(){ setTimeout(function(){
$("#sliderarea").hide(); $("#sliderarea").hide();
var millis=getMillis(); var millis=getMillis();
document.location.href = "install.html?v=1.5.25&mode=onlyupdate&n=" + millis; document.location.href = "install.html?v=1.5.26&mode=onlyupdate&n=" + millis;
},250); },250);
} }
} }
@ -2588,7 +2612,7 @@ function handleReprint(answer) {
} }
function handleDelLogo() { function handleDelLogo() {
d = new Date(); d = new Date();
$("#logoimgpart").attr("src", "php/contenthandler.php?module=printqueue&command=getLogoAsPng&"+d.getTime()); $("#logoimgpart").attr("src", "php/contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel&"+d.getTime());
} }
function handleAnswerShutdown(result) { function handleAnswerShutdown(result) {
@ -3806,6 +3830,8 @@ $(document).on("pageinit", "#admin-page", function () {
<div id="partOfAustria"></div> <div id="partOfAustria"></div>
<div id="partOfLogolocation"></div>
<div id="partIfAustriaEnabled"> <div id="partIfAustriaEnabled">
<i><b><span id=austriahint></span></b></i> <i><b><span id=austriahint></span></b></i>
<div data-role="fieldcontain" style="display:none;"> <div data-role="fieldcontain" style="display:none;">
@ -4312,7 +4338,7 @@ $(document).on("pageinit", "#admin-page", function () {
<br><b><u>Logo:</u></b><br><br> <br><b><u>Logo:</u></b><br><br>
<img id="logoimgpart" height="70px" src="php/contenthandler.php?module=printqueue&command=getLogoAsPng" /> <img id="logoimgpart" style="height:70px;" src="php/contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel" />
<form id="logoform" enctype="multipart/form-data" action="php/contenthandler.php?module=admin&command=readlogo" method="POST" data-ajax="false"> <form id="logoform" enctype="multipart/form-data" action="php/contenthandler.php?module=admin&command=readlogo" method="POST" data-ajax="false">
<input type="hidden" name="MAX_FILE_SIZE" value="16777210" /> <input type="hidden" name="MAX_FILE_SIZE" value="16777210" />
<span id=upllogotxt>Logo-Datei hochladen:</span> <span id=upllogotxt>Logo-Datei hochladen:</span>
@ -4474,12 +4500,16 @@ $(document).on("pageinit", "#admin-page", function () {
<h3>Extras</h3> <h3>Extras</h3>
<p>Extras werden mit einem Ausrufezeichen am Zeilenanfang deklariert. Nach dem Namen und der (vom OrderSprinter vergebenenen ID, die also <p>Extras werden mit einem Ausrufezeichen am Zeilenanfang deklariert. Nach dem Namen und der (vom OrderSprinter vergebenenen ID, die also
nicht vom Benutzer angegeben werden muss), können nach einem Semikolon die Produkte angegeben werden, die mit diesem Extra nicht vom Benutzer angegeben werden muss), können nach einem Doppelkreuz (#) weitere Parameter angegeben werden:
verkauft werden dürfen. Zur Angabe eines Produktes kann man dessen Name oder in Klammern dessen ID verwenden. Ein Eintrag <ul>
hat demnach folgendes Aussehen (Beispiel): <li>der Preis, den das Extra kostet</li>
<li>die maximale Anzahl, die dieses Extra einem Produkt zugewiesen werden darf</li>
<li>die Produkte, die mit diesem Extra verkauft werden dürfen. Zur Angabe eines Produktes kann man dessen Name oder in Klammern dessen ID verwenden.</li>
</ul>
<p> Ein Eintrag hat demnach folgendes Aussehen (Beispiel):
<pre> <pre>
!Extraname (ID:8) 12,34 ; (45),Produktname,(49),(50) !Extraname (ID:8) # Preis: 12,34 ; Max: 8; Zugewiesen: (45),Produktname,(49),(50)
</pre> </pre>
<p>Dabei gilt: <p>Dabei gilt:

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -208,7 +208,7 @@ var CALC_NONE=0;var CALC_TOTAL=1;var CALC_TIP=2;var lang=0;var receiptfontsize=1
als weiteren Wert den Kassenstand unter Berücksichtigung der eigenen Eingaben und Entnahmen.</span><p> als weiteren Wert den Kassenstand unter Berücksichtigung der eigenen Eingaben und Entnahmen.</span><p>
<p><i><span id="cashsum">Bewirtungseinnahmen:</span></i> <p><i><span id="cashsum">Bewirtungseinnahmen:</span></i>
<p><span id=cashbyguests></span></p> <p><span id=cashbyguests></span></p>
<p><i>Ein-/Auslagen: <b><span id="onlycashsum"></span></b> <span class="currencyplaceholder"></span> <p><i>Ein-/Auslagen:</i> <b><span id="onlycashsum"></span></b> <span class="currencyplaceholder"></span>
<p><i><span id="includeowncash">inkl. eigener Kassen-Eingaben/Entnahmen:</span></i> <b><span id=cashtotal></span></b> <span class="currencyplaceholder"></span><p> <p><i><span id="includeowncash">inkl. eigener Kassen-Eingaben/Entnahmen:</span></i> <b><span id=cashtotal></span></b> <span class="currencyplaceholder"></span><p>
<a href="#" data-role="button" data-theme="d" data-rel="back" id="cash_overview_ok">OK</a> <a href="#" data-role="button" data-theme="d" data-rel="back" id="cash_overview_ok">OK</a>
</div> </div>

View File

@ -1217,7 +1217,8 @@ class Admin {
array("sumupfailuretext","",false), array("sumupfailuretext","",false),
array("printcash",0,false), array("printcash",0,false),
array("showerrorlog",1,false) array("showerrorlog",1,false),
array("logolocation",1,false)
); );
if (is_null($pdo)) { if (is_null($pdo)) {
@ -1412,7 +1413,7 @@ class Admin {
$view = "preferences.html"; $view = "preferences.html";
} }
echo json_encode($view . "?v=1.5.25"); echo json_encode($view . "?v=1.5.26");
} }
} }
@ -1633,31 +1634,31 @@ class Admin {
if (!self::isOnlyRatingUser($rights, $right_rating, true)) { if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
if ($_SESSION['modus'] == 0) { if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.5.25"); } if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.5.26"); }
} else { } else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.5.25"); } if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.5.26"); }
} }
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.5.25"); } if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.5.26"); }
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.5.25"); } if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.5.26"); }
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.5.25"); } if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.5.26"); }
if ($_SESSION['modus'] == 0) { if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.5.25"); } if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.5.26"); }
} }
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.5.25"); } if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.5.26"); }
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.5.25"); } if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.5.26"); }
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.5.25"); } if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.5.26"); }
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.5.25"); } if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.5.26"); }
if ($_SESSION['right_tasks'] || $_SESSION['right_tasksmanagement']) { $mainMenu[] = array("name" => $taskstxt[$lang], "link" => "tasks.html?v=1.5.25"); } if ($_SESSION['right_tasks'] || $_SESSION['right_tasksmanagement']) { $mainMenu[] = array("name" => $taskstxt[$lang], "link" => "tasks.html?v=1.5.26"); }
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.5.25"); } if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.5.26"); }
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.5.25"); } if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.5.26"); }
if ($_SESSION['right_pickups']) { $mainMenu[] = array("name" => $pickupstxt[$lang], "link" => "pickups.html?v=1.5.25"); } if ($_SESSION['right_pickups']) { $mainMenu[] = array("name" => $pickupstxt[$lang], "link" => "pickups.html?v=1.5.26"); }
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.5.25"); } if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.5.26"); }
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.5.25"); } if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.5.26"); }
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.5.25"); $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.5.26");
if ($_SESSION['right_timetracking'] || $_SESSION['right_timemanager']) { $mainMenu[] = array("name" => $timetrackingtxt[$lang], "link" => "timetracking.html?v=1.5.25"); } if ($_SESSION['right_timetracking'] || $_SESSION['right_timemanager']) { $mainMenu[] = array("name" => $timetrackingtxt[$lang], "link" => "timetracking.html?v=1.5.26"); }
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.5.25"); $mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.5.26");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.5.25"); $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.5.26");
} }
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -2259,7 +2260,8 @@ class Admin {
"sumupfailuretext" => array("dbcol" => "sumupfailuretext","checknum" => 0), "sumupfailuretext" => array("dbcol" => "sumupfailuretext","checknum" => 0),
"printcash" => array("dbcol" => "printcash","checknum" => 0), "printcash" => array("dbcol" => "printcash","checknum" => 0),
"showerrorlog" => array("dbcol" => "showerrorlog","checknum" => 0) "showerrorlog" => array("dbcol" => "showerrorlog","checknum" => 0),
"logolocation" => array("dbcol" => "logolocation","checknum" => 1)
); );
$problem = false; $problem = false;
foreach ($changedValues as $aChangeSet) { foreach ($changedValues as $aChangeSet) {
@ -3499,7 +3501,8 @@ class Admin {
try { try {
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
$companyInfo = CommonUtils::getConfigValue($pdo, 'companyinfo', ''); $companyInfo = CommonUtils::getConfigValue($pdo, 'companyinfo', '');
echo json_encode(array("status" => "OK","msg" => $companyInfo)); $logolocation = CommonUtils::getConfigValue($pdo, 'logolocation', 1);
echo json_encode(array("status" => "OK","msg" => array("companyinfo" => $companyInfo,"logolocation" => $logolocation)));
} catch (Exception $ex) { } catch (Exception $ex) {
echo json_encode(array("status" => "ERROR","msg" => $ex->getMessage())); echo json_encode(array("status" => "ERROR","msg" => $ex->getMessage()));
} }

View File

@ -412,7 +412,7 @@ class Bill {
count(Q.productname) as count, count(Q.productname) as count,
PT.kind as kind, PT.kind as kind,
( (
SELECT GROUP_CONCAT(extraid ORDER BY extraid) SELECT GROUP_CONCAT(CONCAT(amount,'-',extraid) ORDER BY extraid)
FROM FROM
%queueextras% QE %queueextras% QE
WHERE WHERE
@ -456,11 +456,17 @@ class Bill {
if ($printExtras) { if ($printExtras) {
$extrasConcatStr = $zeile['concatstr']; $extrasConcatStr = $zeile['concatstr'];
if (!is_null($extrasConcatStr)) { if (!is_null($extrasConcatStr)) {
$sql = "SELECT name FROM %extras% WHERE id IN ($extrasConcatStr)"; $singleExtras = explode(',', $extrasConcatStr);
$allExtras = CommonUtils::fetchSqlAll($pdo, $sql, null); $sql = "SELECT name FROM %extras% WHERE id=?";
foreach($allExtras as $anExtra) { foreach ($singleExtras as $aSingleExtra) {
$singleExtraParts = explode('-', $aSingleExtra);
$amount = $singleExtraParts[0];
$singleExtraId = $singleExtraParts[1];
$extraNameRes = CommonUtils::fetchSqlAll($pdo, $sql, array($singleExtraId));
if (count($extraNameRes) > 0) {
$extraText = $amount . "x " . $extraNameRes[0]["name"];
$prodarray[] = array("count" => 0, $prodarray[] = array("count" => 0,
"productname" => ' + ' . $anExtra['name'], "productname" => ' + ' . $extraText,
"pricelevel" => $zeile['pricelevelname'], "pricelevel" => $zeile['pricelevelname'],
"price" => 0 "price" => 0
); );
@ -468,6 +474,7 @@ class Bill {
} }
} }
} }
}
$sql = "select tax,concat('$sign',round(sum(price) - sum(price / (1.0 + tax/100.0)),2)) as mwst, concat('$sign',round(sum(price / (1.0 + tax/100.0)),2)) as netto, concat('$sign',sum(price)) as brutto FROM %queue%,%billproducts% WHERE %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id group by tax ORDER BY tax"; $sql = "select tax,concat('$sign',round(sum(price) - sum(price / (1.0 + tax/100.0)),2)) as mwst, concat('$sign',round(sum(price / (1.0 + tax/100.0)),2)) as netto, concat('$sign',sum(price)) as brutto FROM %queue%,%billproducts% WHERE %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id group by tax ORDER BY tax";
@ -1283,10 +1290,12 @@ class Bill {
foreach($result as $z) { foreach($result as $z) {
set_time_limit(60*5); set_time_limit(60*5);
$prodprice = $z['productprice'];
$brutto = $z['brutto']; $brutto = $z['brutto'];
$netto = $z['netto']; $netto = $z['netto'];
$tax = $z['tax']; $tax = $z['tax'];
if ($exportFormat == DO_CSV) { if ($exportFormat == DO_CSV) {
$prodprice = number_format($prodprice, 2, $decpoint, '');
$brutto = number_format($brutto, 2, $decpoint, ''); $brutto = number_format($brutto, 2, $decpoint, '');
$netto = str_replace(".",$decpoint,$netto); $netto = str_replace(".",$decpoint,$netto);
if ($tax != '') { if ($tax != '') {
@ -1312,7 +1321,7 @@ class Bill {
$z['billdate'], $z['billdate'],
self::$daynamesStartSunday[intval($z['orderdayofweek'])][$l], self::$daynamesStartSunday[intval($z['orderdayofweek'])][$l],
$z['billid'],$z['tablename'], $z['billid'],$z['tablename'],
$z['productprice'],$brutto,$netto, $prodprice,$brutto,$netto,
$tax, $tax,
$z['host'], $z['host'],
$z['reference'], $z['reference'],

View File

@ -853,7 +853,7 @@ class Customers {
$txt = "<head>"; $txt = "<head>";
$txt .= "<title>" . self::$CUS_OVERVIEW[$lang] . "</title>"; $txt .= "<title>" . self::$CUS_OVERVIEW[$lang] . "</title>";
$txt .= '<meta http-equiv="content-type" content="text/html; charset=utf-8">'; $txt .= '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
$txt .= '<link rel="stylesheet" type="text/css" href="../css/guestreport.css?v=1.5.25">'; $txt .= '<link rel="stylesheet" type="text/css" href="../css/guestreport.css?v=1.5.26">';
$txt .= "</head>"; $txt .= "</head>";
return $txt; return $txt;
} }

View File

@ -27,7 +27,7 @@ if (isset($_POST["cmd"])) {
if (strlen($status) > 150) { if (strlen($status) > 150) {
$status = substr($status, 0,149); $status = substr($status, 0,149);
} }
$version = "1.5.25"; $version = "1.5.26";
$arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version,"phpversion" => $phpversion); $arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version,"phpversion" => $phpversion);
} else { } else {

View File

@ -113,10 +113,10 @@ class Guestsync {
} }
private static function insertWorkDataFromGuestSystem($pdo,$dataJson) { private static function insertWorkDataFromGuestSystem($pdo,$dataJson) {
$data = json_decode($dataJson, true); $dataDecoded = json_decode($dataJson,true);
if ($data["status"] == "OK") { if ($dataDecoded["status"] == "OK") {
try { try {
$entries = $data["msg"]; $entries = $dataDecoded["msg"];
foreach($entries as $entry) { foreach($entries as $entry) {
$date = $entry["date"]; $date = $entry["date"];
$tableid = $entry["tableid"]; $tableid = $entry["tableid"];
@ -202,9 +202,9 @@ class Guestsync {
if ($dayofweek == 7) { if ($dayofweek == 7) {
$dayofweek = 0; $dayofweek = 0;
} }
$sql = "SELECT P.id as prodid,I.imgl as imagedata "; $sql = "SELECT P.id as prodid,IFNULL(I.imgl,'-') as imagedata ";
$sql .= " FROM %products% P,%prodimages% I WHERE P.available='1' AND P.removed is null "; $sql .= " FROM %products% P LEFT JOIN %prodimages% I ON P.prodimageid=I.id ";
$sql .= " AND P.prodimageid=I.id "; $sql .= " WHERE P.available='1' AND P.removed is null ";
$sql .= " AND (days is null OR days like ?) AND (display = 'KG' OR display = 'G' OR display is null) "; $sql .= " AND (days is null OR days like ?) AND (display = 'KG' OR display = 'G' OR display is null) ";
$sql .= " AND (unit is null OR unit='0') "; $sql .= " AND (unit is null OR unit='0') ";

View File

@ -99,6 +99,8 @@ class PrintQueue {
$this->getReceiptConfig($fl); $this->getReceiptConfig($fl);
} else if ($command == 'getLogoAsPng') { } else if ($command == 'getLogoAsPng') {
$this->getLogoAsPng(); $this->getLogoAsPng();
} else if ($command == 'getLogoAsPngWithAlphaChannel') {
$this->getLogoAsPngWithAlphaChannel();
} else if ($command == 'getLogoAsWbmp') { } else if ($command == 'getLogoAsWbmp') {
$this->getLogoAsWbmp(); $this->getLogoAsWbmp();
} else if ($command == 'getPrintJobOverview') { } else if ($command == 'getPrintJobOverview') {
@ -492,14 +494,23 @@ class PrintQueue {
private static function outputEmptyImage() { private static function outputEmptyImage() {
$my_img = imagecreate( 1,1 ); $my_img = imagecreate( 1,1 );
$background = imagecolorallocate( $my_img, 0, 0, 255 ); $background = imagecolorallocate( $my_img, 0, 0, 255 );
$black = imagecolorallocate($im, 0, 0, 0); $black = imagecolorallocate($my_img, 0, 0, 0);
imagecolortransparent($my_img, $black); imagecolortransparent($my_img, $black);
imagepng( $my_img ); imagepng( $my_img );
imagecolordeallocate( $background ); imagecolordeallocate( $my_img, $background );
imagecolordeallocate( $my_img, $black );
imagedestroy( $my_img ); imagedestroy( $my_img );
} }
function getLogoAsPng() { function getLogoAsPng() {
$this->getLogoAsPngCore(false);
}
function getLogoAsPngWithAlphaChannel() {
$this->getLogoAsPngCore(true);
}
function getLogoAsPngCore($saveAlphaChannel) {
$sendEmptyImageInsteadOfNone = false; $sendEmptyImageInsteadOfNone = false;
if (isset($_GET["style"])) { if (isset($_GET["style"])) {
if ($_GET["style"] == "always") { if ($_GET["style"] == "always") {
@ -528,13 +539,35 @@ class PrintQueue {
} }
} else { } else {
$php_img = imagecreatefromstring($img); $php_img = imagecreatefromstring($img);
imagesavealpha($php_img, true);
$color = imagecolorallocatealpha($php_img, 0, 0, 0, 127);
$colorAlpha = null;
imagesavealpha($php_img, true);
if ($saveAlphaChannel) {
$colorAlpha = imagecolorallocatealpha($php_img, 0, 0, 0, 127);
imagepng($php_img, NULL); imagepng($php_img, NULL);
imagecolordeallocate( $color ); imagecolordeallocate($php_img,$colorAlpha);
} else {
$width = imagesx($php_img);
$height = imagesy($php_img);
$bgImg = imagecreatetruecolor($width, $height);
$white = imagecolorallocate($bgImg, 255, 255, 255);
imagefill($bgImg, 0, 0, $white);
imagecopyresampled(
$bgImg, $php_img,
0, 0, 0, 0,
$width, $height,
$width, $height);
imagepng($bgImg, NULL);
imagecolordeallocate($bgImg,$white);
imagedestroy($bgImg);
}
imagedestroy($php_img); imagedestroy($php_img);
} }
} else { } else {
if ($sendEmptyImageInsteadOfNone) { if ($sendEmptyImageInsteadOfNone) {
self::outputEmptyImage(); self::outputEmptyImage();

View File

@ -94,11 +94,11 @@ class Products {
$prodEntry->createFromPostData($_POST); $prodEntry->createFromPostData($_POST);
$this->applySingleProdData($prodEntry,$_POST['changeExtras'],$extras,$_POST['assignextrastotype']); $this->applySingleProdData($prodEntry,$_POST['changeExtras'],$extras,$_POST['assignextrastotype']);
} else if ($command == 'createExtra') { } else if ($command == 'createExtra') {
$this->createExtra($_POST['name'],$_POST['price']); $this->createExtra($_POST['name'],$_POST['price'],$_POST['maxamount']);
} else if ($command == 'delExtra') { } else if ($command == 'delExtra') {
$this->delExtra($_POST['id']); $this->delExtra($_POST['id']);
} else if ($command == 'applyExtra') { } else if ($command == 'applyExtra') {
$this->applyExtra($_POST['name'],$_POST['price'],$_POST['id']); $this->applyExtra($_POST['name'],$_POST['price'],$_POST['maxamount'],$_POST['id']);
} else if ($command == 'upExtra') { } else if ($command == 'upExtra') {
$this->upExtra($_POST['id']); $this->upExtra($_POST['id']);
} else if ($command == 'sortup') { } else if ($command == 'sortup') {
@ -294,7 +294,7 @@ class Products {
$fav = 0; $fav = 0;
} }
$sql = "SELECT DISTINCT %extras%.id AS extraid,%extras%.name AS name,%extras%.price as price,%extras%.sorting as sorting FROM %extras%,%extrasprods% $sql = "SELECT DISTINCT %extras%.id AS extraid,%extras%.name AS name,%extras%.price as price,IFNULL(%extras%.maxamount,1) as maxamount,%extras%.sorting as sorting FROM %extras%,%extrasprods%
WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null ORDER BY sorting,name"; WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null ORDER BY sorting,name";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
@ -397,14 +397,14 @@ class Products {
} }
function getAllExtrasAlphaSorted() { function getAllExtrasAlphaSorted() {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = DbUtils::openDbAndReturnPdoStatic();
$ret = $this->getAllExtrasAlphaSortedCore($pdo); $ret = $this->getAllExtrasAlphaSortedCore($pdo);
echo json_encode(array("status" => "OK", "msg" => $ret)); echo json_encode(array("status" => "OK", "msg" => $ret));
} }
function getAllExtrasAlphaSortedCore($pdo) { function getAllExtrasAlphaSortedCore($pdo) {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
$sql = "select id,name,price,sorting from %extras% WHERE removed is null ORDER BY sorting,name"; $sql = "select id,name,price,IFNULL(maxamount,1) as maxamount,sorting from %extras% WHERE removed is null ORDER BY sorting,name";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(); $stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_OBJ); $result = $stmt->fetchAll(PDO::FETCH_OBJ);
@ -558,18 +558,20 @@ class Products {
function readExtrasFromDb($pdo) { function readExtrasFromDb($pdo) {
if (is_null($pdo)) { if (is_null($pdo)) {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = DbUtils::openDbAndReturnPdoStatic();
} }
$sql = "SELECT id,name,price,sorting FROM %extras% WHERE removed is null ORDER by sorting"; $sql = "SELECT id,name,price,maxamount,sorting FROM %extras% WHERE removed is null ORDER by sorting";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(); $stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_OBJ); $result = $stmt->fetchAll(PDO::FETCH_OBJ);
$extrasTxt = ""; $extrasTxt = "";
$decpoint = $this->getDecPoint($pdo); $decpoint = $this->getDecPoint($pdo);
foreach ($result as $aRes) { foreach ($result as $aRes) {
$extrasTxt .= "!" . $aRes->name . " (ID:" . $aRes->id . ") #" ; $extrasTxt .= "!" . $aRes->name . " (ID:" . $aRes->id . ") # " ;
$priceTxt = number_format($aRes->price, 2, $decpoint, ''); $priceTxt = number_format($aRes->price, 2, $decpoint, '');
$extrasTxt .= $priceTxt; $extrasTxt .= "Preis: " . $priceTxt . "; ";
$maxamount = $aRes->maxamount;
$extrasTxt .= "Max: " . $maxamount . "; ";
$sql = "SELECT prodid FROM %extrasprods% WHERE extraid=?"; $sql = "SELECT prodid FROM %extrasprods% WHERE extraid=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
@ -579,10 +581,9 @@ class Products {
foreach ($assignedProds as $anAssProd) { foreach ($assignedProds as $anAssProd) {
$assProdArr[] = "(" . $anAssProd->prodid . ")"; $assProdArr[] = "(" . $anAssProd->prodid . ")";
} }
$extrasTxt .= " ; " . join(",",$assProdArr) . "\n"; $extrasTxt .= "Zugewiesen: " . join(",",$assProdArr) . "\n";
} }
return $extrasTxt; return $extrasTxt;
} }
@ -778,7 +779,7 @@ class Products {
return $ids; return $ids;
} }
public static function createExtraCore($pdo,$name,$price,$assignedProdIds) { public static function createExtraCore($pdo,$name,$price,$maxamount,$assignedProdIds) {
if (is_null($pdo)) { if (is_null($pdo)) {
$pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo = DbUtils::openDbAndReturnPdoStatic();
} }
@ -795,12 +796,12 @@ class Products {
$maxPos = self::getMaxSortingOfExtras($pdo); $maxPos = self::getMaxSortingOfExtras($pdo);
$sql = "INSERT INTO `%extras%` (`id`,`name`,`price`,`sorting`) VALUES(NULL,?,?,?)"; $sql = "INSERT INTO `%extras%` (`name`,`price`,`maxamount`,`sorting`) VALUES(?,?,?,?)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($name,$price,$maxPos+1)); $stmt->execute(array($name,$price,$maxamount,$maxPos+1));
$lastExtraId = $pdo->lastInsertId(); $lastExtraId = $pdo->lastInsertId();
$sql = "DELETE FROM %extrasprods% WHERE id=?"; $sql = "DELETE FROM %extrasprods% WHERE extraid=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($lastExtraId)); $stmt->execute(array($lastExtraId));
@ -817,12 +818,12 @@ class Products {
} }
} }
private function createExtra($name,$price) { private function createExtra($name,$price,$maxamount) {
try { try {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction(); $pdo->beginTransaction();
$ret = self::createExtraCore($pdo,$name,$price,array()); $ret = self::createExtraCore($pdo,$name,$price,$maxamount,array());
if ($ret == ERROR_NAME_EXISTS_ALREADY) { if ($ret == ERROR_NAME_EXISTS_ALREADY) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_NAME_EXISTS_ALREADY, "msg" => ERROR_NAME_EXISTS_ALREADY_MSG)); echo json_encode(array("status" => "ERROR", "code" => ERROR_NAME_EXISTS_ALREADY, "msg" => ERROR_NAME_EXISTS_ALREADY_MSG));
$pdo->rollBack(); $pdo->rollBack();
@ -860,7 +861,7 @@ class Products {
$this->getAllExtrasAlphaSorted(); $this->getAllExtrasAlphaSorted();
} }
private function applyExtra($name,$price,$id) { private function applyExtra($name,$price,$maxamount,$id) {
try { try {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction(); $pdo->beginTransaction();
@ -876,20 +877,21 @@ class Products {
} }
$sql = "SELECT name,price,sorting FROM %extras% WHERE id=?"; $sql = "SELECT name,price,maxamount,sorting FROM %extras% WHERE id=?";
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($id)); $result = CommonUtils::fetchSqlAll($pdo, $sql, array($id));
$oldname = $result[0]['name']; $oldname = $result[0]['name'];
$oldprice = $result[0]['price']; $oldprice = $result[0]['price'];
$oldmaxamount = $result[0]['maxamount'];
if (($oldname == $name) && ($oldprice == $price)) { if (($oldname == $name) && ($oldprice == $price) && ($oldmaxamount == $maxamount)) {
echo json_encode(array("status" => "ERROR", "code" => DB_NOT_CHANGED, "msg" => DB_NOT_CHANGED_MSG, "id" => $id)); echo json_encode(array("status" => "ERROR", "code" => DB_NOT_CHANGED, "msg" => DB_NOT_CHANGED_MSG, "id" => $id));
$pdo->rollBack(); $pdo->rollBack();
return; return;
} else { } else {
$oldsorting = $result[0]['sorting']; $oldsorting = $result[0]['sorting'];
$sql = "INSERT INTO %extras% (name,price,sorting,removed) VALUES(?,?,?,?)"; $sql = "INSERT INTO %extras% (name,price,maxamount,sorting,removed) VALUES(?,?,?,?,?)";
CommonUtils::execSql($pdo, $sql, array($name,$price,$oldsorting,null)); CommonUtils::execSql($pdo, $sql, array($name,$price,$maxamount,$oldsorting,null));
$newExtraId = $pdo->lastInsertId(); $newExtraId = $pdo->lastInsertId();
$sql = "UPDATE %extras% SET removed = ? WHERE id=?"; $sql = "UPDATE %extras% SET removed = ? WHERE id=?";
CommonUtils::execSql($pdo, $sql, array(1,$id)); CommonUtils::execSql($pdo, $sql, array(1,$id));

View File

@ -367,7 +367,7 @@ class QueueContent {
if (is_null($pdo)) { if (is_null($pdo)) {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
} }
$sql = "SELECT name FROM %queueextras% WHERE queueid=?"; $sql = "SELECT CONCAT(amount,'x ',name) as name FROM %queueextras% WHERE queueid=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($queueid)); $stmt->execute(array($queueid));
$extras = $stmt->fetchAll(); $extras = $stmt->fetchAll();
@ -382,7 +382,7 @@ class QueueContent {
if (is_null($pdo)) { if (is_null($pdo)) {
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
} }
$sql = "SELECT name,extraid FROM %queueextras% WHERE queueid=?"; $sql = "SELECT name,extraid,amount FROM %queueextras% WHERE queueid=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($queueid)); $stmt->execute(array($queueid));
$extras = $stmt->fetchAll(); $extras = $stmt->fetchAll();
@ -391,8 +391,9 @@ class QueueContent {
foreach($extras as $anExtra) { foreach($extras as $anExtra) {
$extrasnames[] = $anExtra["name"]; $extrasnames[] = $anExtra["name"];
$extrasids[] = $anExtra["extraid"]; $extrasids[] = $anExtra["extraid"];
$extrasamounts[] = $anExtra["amount"];
} }
return array("extrasnames" => $extrasnames,"extrasids" => $extrasids); return array("extrasnames" => $extrasnames,"extrasids" => $extrasids,"extrasamounts" => $extrasamounts);
} }
@ -979,7 +980,7 @@ class QueueContent {
break; break;
} }
$sql = "SELECT extraid,name FROM %queueextras% WHERE queueid=?"; $sql = "SELECT extraid,CONCAT(amount,'x ',name) as name FROM %queueextras% WHERE queueid=?";
$extras = CommonUtils::fetchSqlAll($pdo, $sql, array($queueid["queueid"])); $extras = CommonUtils::fetchSqlAll($pdo, $sql, array($queueid["queueid"]));
$extrasArr = array(); $extrasArr = array();
@ -1234,9 +1235,10 @@ class QueueContent {
$anExtra = $extras[$j]; $anExtra = $extras[$j];
$extraid = $anExtra["id"]; $extraid = $anExtra["id"];
$extraname = $anExtra["name"]; $extraname = $anExtra["name"];
$extraamount = $anExtra["amount"];
$sql = "SELECT price FROM %extras% WHERE id=?"; $sql = "SELECT price FROM %extras% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($extraid)); $row = CommonUtils::getRowSqlObject($pdo, $sql, array($extraid));
$price += floatval($row->price); $price += floatval($row->price * $extraamount);
} }
} }
} }
@ -1270,9 +1272,10 @@ class QueueContent {
$anExtra = $extras[$j]; $anExtra = $extras[$j];
$extraid = $anExtra["id"]; $extraid = $anExtra["id"];
$extraname = $anExtra["name"]; $extraname = $anExtra["name"];
$sql = "INSERT INTO %queueextras% (`id`,`queueid`,`extraid`,`name`) VALUES(NULL,?,?,?)"; $extraamount = $anExtra["amount"];
$sql = "INSERT INTO %queueextras% (`queueid`,`extraid`,`amount`,`name`) VALUES(?,?,?,?)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($queueid,$extraid,$extraname)); $stmt->execute(array($queueid,$extraid,$extraamount,$extraname));
} }
} }
@ -1610,6 +1613,7 @@ class QueueContent {
"unitamount" => $row->unitamount, "unitamount" => $row->unitamount,
"extras" => $extras["extrasnames"], "extras" => $extras["extrasnames"],
"extrasids" => $extras["extrasids"], "extrasids" => $extras["extrasids"],
"extrasamounts" => $extras["extrasamounts"],
"isready" => $isReady, "isready" => $isReady,
"isPaid" => $isPaid, "isPaid" => $isPaid,
"isCooking" => $isCooking); "isCooking" => $isCooking);

View File

@ -38,7 +38,7 @@ class Reports {
self::$sql_ratings = "select COUNT(id) as count FROM %ratings% WHERE date between ? AND ?"; self::$sql_ratings = "select COUNT(id) as count FROM %ratings% WHERE date between ? AND ?";
self::$sql_remarks = "SELECT DATE_FORMAT (date, '%e.%m.%Y %H:%i') AS date,remark FROM %ratings% WHERE CHAR_LENGTH(remark) > 2 AND date between ? AND ?"; self::$sql_remarks = "SELECT DATE_FORMAT(date, '%e.%m.%Y %H:%i') AS date,remark FROM %ratings% WHERE CHAR_LENGTH(remark) > 2 AND date between ? AND ?";
} }
function handleCommand($command) { function handleCommand($command) {

View File

@ -3,6 +3,7 @@
class ExtraItem { class ExtraItem {
private $name = ""; // name of the item (the text string in the line) private $name = ""; // name of the item (the text string in the line)
private $price = 0.00; // default (not set) private $price = 0.00; // default (not set)
private $maxamount = 1;
private $extraid = null; private $extraid = null;
private $assignedProdIds = array(); private $assignedProdIds = array();
@ -12,6 +13,19 @@ class ExtraItem {
$parts = explode ( '#' , $ofInterest ); $parts = explode ( '#' , $ofInterest );
$this->name = trim($parts[0]); $this->name = trim($parts[0]);
if (count($parts) == 1) {
return;
}
$thePrice = self::getValueFromItemText($parts[1], 'Preis', 0.0);
$aPrice = str_replace(',','.',$thePrice);
if (is_numeric($aPrice)) {
$this->price = floatval($aPrice);
}
$this->maxamount = self::getValueFromItemText($parts[1], 'Max', 1);
$assignedProdsTxt = self::getValueFromItemText($parts[1], 'Zugewiesen', 1);
$matches = array(); $matches = array();
preg_match('/\(ID:([0-9]+)\)$/', $this->name,$matches,PREG_OFFSET_CAPTURE); preg_match('/\(ID:([0-9]+)\)$/', $this->name,$matches,PREG_OFFSET_CAPTURE);
if (count($matches) > 0) { if (count($matches) > 0) {
@ -21,12 +35,7 @@ class ExtraItem {
$this->name = trim(substr($this->name,0,$theMatchPos-1)); $this->name = trim(substr($this->name,0,$theMatchPos-1));
} }
$priceAndProdsParts = explode(';',$parts[1]); $assignedProds = explode (',', $assignedProdsTxt );
$aPrice = str_replace(',','.',trim($priceAndProdsParts[0]));
if (is_numeric($aPrice)) {
$this->price = floatval($aPrice);
}
$assignedProds = explode (',', $priceAndProdsParts[1] );
foreach($assignedProds as $assProd) { foreach($assignedProds as $assProd) {
$assProd = trim($assProd); $assProd = trim($assProd);
$matches = array(); $matches = array();
@ -57,18 +66,38 @@ class ExtraItem {
// leave default values // leave default values
} }
} }
private static function getValueFromItemText($txt,$item,$default) {
$txtparts = explode(';',$txt);
foreach($txtparts as $itemvaluepair) {
$itemvalarr = explode(":",$itemvaluepair);
$itemintxt = trim($itemvalarr[0]);
$value = trim($itemvalarr[1]);
if ($item == $itemintxt) {
return $value;
}
}
return $default;
}
function getName() { function getName() {
return $this->name; return $this->name;
} }
function getPrice() { function getPrice() {
return $this->price; return $this->price;
} }
function getMaxamount() {
return $this->maxamount;
}
function setName($aName) { function setName($aName) {
$this->name = $aName; $this->name = $aName;
} }
function setPrice($aPrice) { function setPrice($aPrice) {
$this->price = $aPrice; $this->price = $aPrice;
} }
function setMaxamount($maxamount) {
$this->maxamount = $maxamount;
}
function getAssignedProdIds() { function getAssignedProdIds() {
return $this->assignedProdIds; return $this->assignedProdIds;
} }

View File

@ -51,7 +51,7 @@ class ProductEntry {
$this->days = '0123456'; $this->days = '0123456';
$this->audio = null; $this->audio = null;
$this->barcode = ""; $this->barcode = "";
$this->amount = 0; $this->amount = null;
} }
public function createFromPostData($postData) { public function createFromPostData($postData) {

View File

@ -534,7 +534,7 @@ class TypeAndProductFileManager {
foreach($this->extras as $anExtraLine) { foreach($this->extras as $anExtraLine) {
$anExtra = new ExtraItem($pdo,$anExtraLine); $anExtra = new ExtraItem($pdo,$anExtraLine);
$prodInstance->createExtraCore($pdo, $anExtra->getName(), $anExtra->getPrice(), $anExtra->getAssignedProdIds()); $prodInstance->createExtraCore($pdo, $anExtra->getName(), $anExtra->getPrice(), $anExtra->getMaxamount(), $anExtra->getAssignedProdIds());
$changedExtrasProdIds = $anExtra->getAssignedProdIds(); $changedExtrasProdIds = $anExtra->getAssignedProdIds();
foreach($changedExtrasProdIds as $anId) { foreach($changedExtrasProdIds as $anId) {

View File

@ -75,7 +75,7 @@ class ClosTemplater extends Basetemplater {
$sum = str_replace(".", $data["decpoint"], $data["bruttosum"]); $sum = str_replace(".", $data["decpoint"], $data["bruttosum"]);
$text = str_replace("{Bruttosumme}",$sum,$text); $text = str_replace("{Bruttosumme}",$sum,$text);
$imgurl = "contenthandler.php?module=printqueue&command=getLogoAsPng"; $imgurl = "contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel";
$text = str_replace("{Logo-klein}","<img src='$imgurl' style='width:100px;' />",$text); $text = str_replace("{Logo-klein}","<img src='$imgurl' style='width:100px;' />",$text);
$text = str_replace("{Logo-gross}","<img src='$imgurl' style='width:300px;' />",$text); $text = str_replace("{Logo-gross}","<img src='$imgurl' style='width:300px;' />",$text);
$text = str_replace("{Betriebsinfo}",$data["companyinfo"],$text); $text = str_replace("{Betriebsinfo}",$data["companyinfo"],$text);

View File

@ -1219,6 +1219,18 @@ class Version {
} }
} }
public static function upd_1525_1526($pdo, $prefix, $dbname) {
try {
self::insertOrUpdateConfigItem($pdo, 'logolocation', '1');
self::execSql($pdo, "ALTER TABLE %queueextras% ADD amount INT(3) NULL AFTER extraid");
self::execSql($pdo, "ALTER TABLE %extras% ADD maxamount INT(3) NULL AFTER price");
self::execSql($pdo, "UPDATE %extras% SET maxamount='1'");
return array(true);
} catch (PDOException $e) {
return array(false,$e);
}
}
public static $updateOrder = array( public static $updateOrder = array(
"1.3.0" => array("upd_1300_1301","1.3.1"), "1.3.0" => array("upd_1300_1301","1.3.1"),
"1.3.1" => array("upd_1301_1302","1.3.2"), "1.3.1" => array("upd_1301_1302","1.3.2"),
@ -1291,7 +1303,8 @@ class Version {
"1.5.21" => array("upd_1521_1522","1.5.22"), "1.5.21" => array("upd_1521_1522","1.5.22"),
"1.5.22" => array("upd_1522_1523","1.5.23"), "1.5.22" => array("upd_1522_1523","1.5.23"),
"1.5.23" => array("upd_1523_1524","1.5.24"), "1.5.23" => array("upd_1523_1524","1.5.24"),
"1.5.24" => array("upd_1524_1525","1.5.25") "1.5.24" => array("upd_1524_1525","1.5.25"),
"1.5.25" => array("upd_1525_1526","1.5.26")
); );
public static function runUpdateProcess($pdo,$prefix, $dbname, $untilVersion,$checkValidVersion) { public static function runUpdateProcess($pdo,$prefix, $dbname, $untilVersion,$checkValidVersion) {

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,7 +13,7 @@
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.25"></script> <script src="utilities.js?v=1.5.26"></script>
<link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" /> <link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" />
<script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script> <script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script>

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -15,8 +15,8 @@
<script src="php/3rdparty/jquery-2.0.3.min.js"></script> <script src="php/3rdparty/jquery-2.0.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script> <script src="utilities.js"></script>
<script src="elements/product.js?v=1.5.25"></script> <script src="elements/product.js?v=1.5.26"></script>
<script src="elements/extra.js?v=1.5.25"></script> <script src="elements/extra.js?v=1.5.26"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet"> <link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script> <script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
</head> </head>
@ -88,6 +88,9 @@ var PROD_SET_TITLE = ["Gesamtes Bildmaterial","Full image set","Todos los imagen
var PROD_CLEAN_PRODIMAGES = ["Entferne nicht zugewiesene Bilder in der DB","Remove unassigned images from database","Removar imagenes non usados"]; var PROD_CLEAN_PRODIMAGES = ["Entferne nicht zugewiesene Bilder in der DB","Remove unassigned images from database","Removar imagenes non usados"];
var PROD_DOWNLOAD_PRODIMAGES = ["Download gesamtes Bildmaterial","Download complete Image Set","Download todos los imagenes"]; var PROD_DOWNLOAD_PRODIMAGES = ["Download gesamtes Bildmaterial","Download complete Image Set","Download todos los imagenes"];
var PROD_GO_DESKTOP = ["Preisliste in Desktop-Ansicht öffnen","Open price list in desktop view","Abrir lista de precios en vista de desktop"]; var PROD_GO_DESKTOP = ["Preisliste in Desktop-Ansicht öffnen","Open price list in desktop view","Abrir lista de precios en vista de desktop"];
var PROD_EXTRA_COL_NAME = ["Name","Name","Nombre"];
var PROD_EXTRA_COL_PRICE = ["Preis","Price","Precio"];
var PROD_EXTRA_COL_MAXAMOUNT = ["Max. Anzahl","Max. amount","Max #"];
// this is the maximal price that a product may cost // this is the maximal price that a product may cost
var MAX_PRICE = 999.99; var MAX_PRICE = 999.99;
@ -1073,14 +1076,15 @@ function setLanguage(language) {
if (query.status == "OK") { if (query.status == "OK") {
var extras = query.msg; var extras = query.msg;
var txt = "<table>"; var txt = "<table>";
txt += "<tr><th>" + PROD_EXTRA_COL_NAME[lang] + "<th>" + PROD_EXTRA_COL_PRICE + "<th>" + PROD_EXTRA_COL_MAXAMOUNT + "</tr>";
var i=0; var i=0;
for (i=0;i<extras.length;i++) { for (i=0;i<extras.length;i++) {
var anExtraDb = extras[i]; var anExtraDb = extras[i];
var anExtra = newExtra(anExtraDb.id, anExtraDb.name, anExtraDb.price); var anExtra = newExtra(anExtraDb.id, anExtraDb.name, anExtraDb.price, anExtraDb.maxamount);
p_allextras[p_allextras.length] = anExtra; p_allextras[p_allextras.length] = anExtra;
txt += anExtra.createTableStructureLine(); txt += anExtra.createTableStructureLine();
} }
var anExtra = newExtra(null,"",null); var anExtra = newExtra(null,"",null,1);
txt += anExtra.createTableStructureLine(); txt += anExtra.createTableStructureLine();
txt += "</table>"; txt += "</table>";
@ -1097,19 +1101,21 @@ function setLanguage(language) {
function createNewExtra() { function createNewExtra() {
var name = $("#newextraname").val(); var name = $("#newextraname").val();
var price = $("#newextraprice").val(); var price = $("#newextraprice").val();
createOrApplyExtra(name,price,"createExtra",null); var maxamount = $("#newextramaxamount").val();
createOrApplyExtra(name,price,maxamount,"createExtra",null);
} }
function applyExtra(extraid) { function applyExtra(extraid) {
var name = $("#extraname_" + extraid).val(); var name = $("#extraname_" + extraid).val();
var price = $("#extraprice_" + extraid).val(); var price = $("#extraprice_" + extraid).val();
createOrApplyExtra(name,price,"applyExtra",extraid); var maxamount = $("#extramaxamount_" + extraid).val();
createOrApplyExtra(name,price,maxamount,"applyExtra",extraid);
} }
function upExtra(extraid) { function upExtra(extraid) {
doAjax("POST","php/contenthandler.php?module=products&command=upExtra",{id:extraid},handleExtraCreation,"Extras"); doAjax("POST","php/contenthandler.php?module=products&command=upExtra",{id:extraid},handleExtraCreation,"Extras");
} }
function createOrApplyExtra(name,price,fct,id) { function createOrApplyExtra(name,price,maxamount,fct,id) {
price = price.replace(",","."); price = price.replace(",",".");
if(isNaN(Number(price))) { if(isNaN(Number(price))) {
@ -1121,9 +1127,9 @@ function setLanguage(language) {
alert(PROD_ENTER_VALUES[lang]); alert(PROD_ENTER_VALUES[lang]);
} else { } else {
if (fct == "applyExtra") { if (fct == "applyExtra") {
doAjax("POST","php/contenthandler.php?module=products&command=" + fct,{name:name,price:price,id:id},handleExtraChange,"Extras"); doAjax("POST","php/contenthandler.php?module=products&command=" + fct,{name:name,price:price,maxamount:maxamount,id:id},handleExtraChange,"Extras");
} else { } else {
doAjax("POST","php/contenthandler.php?module=products&command=" + fct,{name:name,price:price,id:id},handleExtraCreation,"Extras"); doAjax("POST","php/contenthandler.php?module=products&command=" + fct,{name:name,price:price,maxamount:maxamount,id:id},handleExtraCreation,"Extras");
} }
} }
} }

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="css/ospage.css" /> <link rel="stylesheet" href="css/ospage.css" />
<link rel="stylesheet" href="css/tablepanel.css" /> <link rel="stylesheet" href="css/tablepanel.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -623,7 +623,7 @@ function bindCancelButtn() {
var year = date.getFullYear(); var year = date.getFullYear();
var dateStr = year + "-" + month + "-" + day; var dateStr = year + "-" + month + "-" + day;
setTimeout(function(){document.location.href = "reservation.html?v=1.5.25&date=" + dateStr;},500); setTimeout(function(){document.location.href = "reservation.html?v=1.5.26&date=" + dateStr;},500);
}); });
} }

View File

@ -30,7 +30,7 @@ var SUM_REASON = ["Grund","Reason","Razón"];
var SUM_CANCEL_ITEM = ["Stornierung","Cancellation","Revocación"]; var SUM_CANCEL_ITEM = ["Stornierung","Cancellation","Revocación"];
var SUM_CANCELLATION_OK = ["Die Zahlung wurde in OrderSprinter storniert.","The payment was cancelled in OrderSprinter.","El pago se canceló en OrderSprinter."]; var SUM_CANCELLATION_OK = ["Die Zahlung wurde in OrderSprinter storniert.","The payment was cancelled in OrderSprinter.","El pago se canceló en OrderSprinter."];
var nextpage = "paydesk.html?version=1.5.25"; var nextpage = "paydesk.html?version=1.5.26";
var lang; var lang;
@ -84,10 +84,10 @@ function setLanguage(language) {
if (nextPage == "p") { if (nextPage == "p") {
$("#nextpagebtntxt").html(SUM_TO_PAYMENT[lang]); $("#nextpagebtntxt").html(SUM_TO_PAYMENT[lang]);
nextpage = "paydesk.html?t=" + tableid + "&version=1.5.25"; nextpage = "paydesk.html?t=" + tableid + "&version=1.5.26";
} else { } else {
$("#nextpagebtntxt").html(SUM_TO_ORDER[lang]); $("#nextpagebtntxt").html(SUM_TO_ORDER[lang]);
nextpage = "waiter.html?version=1.5.25"; nextpage = "waiter.html?version=1.5.26";
} }
var txt = "<table class='viewtable'>"; var txt = "<table class='viewtable'>";

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,7 +13,7 @@
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.25"></script> <script src="utilities.js?v=1.5.26"></script>
<link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" /> <link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" />
<script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script> <script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script>

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel"> <meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.25"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.26">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long