OrderSprinter 1.2.12

This commit is contained in:
Geno 2020-11-19 23:00:35 +01:00
parent cd2ff7c097
commit 49650b8881
25 changed files with 193 additions and 310 deletions

Binary file not shown.

View File

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

View File

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

View File

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

View File

@ -6,8 +6,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -679,7 +679,7 @@ $(document).ready(function() {
<tr id=updateline>
<td>&nbsp;</td>
<td align=center>
<button id="updatebtn">Update -> 1.2.11</button>
<button id="updatebtn">Update -> 1.2.12</button>
</td>
<td>&nbsp;</td>
</tr>

View File

@ -1476,6 +1476,27 @@ return false;
}
}
function updateUserTable1211_1212($prefix, $version, $dbname) {
$pdo = $this->pdo;
try {
if ($version != "1.2.11") {
$ret = $this->updateUserTable1210_1211($prefix, $version, $dbname);
if (!$ret) {
return false;
}
}
DbUtils::overrulePrefix($prefix);
$this->execSql($pdo, "ALTER TABLE %histprod% MODIFY extras VARCHAR(300) NULL");
$this->updateVersion($pdo, '1.2.12');
return true;
} catch (PDOException $e) {
return false;
}
}
function setVersion($prefix,$theVersion) {
$pdo = $this->pdo;
try {
@ -1593,7 +1614,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'billlanguage', $billlanguage)");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'currency', '$currency')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'receiptfontsize', '12')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.2.11')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.2.12')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'paymentconfig', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'remoteaccesscode', null)");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')");
@ -1962,7 +1983,7 @@ $zones[] = $timezone_identifiers[$i];
echo json_encode($zones);
} else if ($command == 'update') {
$installerVersion = "1.2.11";
$installerVersion = "1.2.12";
$admin = new InstallAdmin();
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
@ -1992,7 +2013,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27"
"1.0.40","1.0.41","1.0.42","1.0.43",
"1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8", "1.1.9","1.1.10","1.1.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17",
"1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30",
"1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10"
"1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11"
);
if (!in_array($version, $supportedVersions)) {
@ -2000,7 +2021,7 @@ echo json_encode("Quellversion nicht unterstützt");
return;
}
$ret = $admin->updateUserTable1210_1211($_POST['prefix'], $version, $_POST['db']);
$ret = $admin->updateUserTable1211_1212($_POST['prefix'], $version, $_POST['db']);
if(session_id() == '') {
session_start();

View File

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

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -182,7 +182,8 @@ var MAN_REST_INFO = ["Der Import dauert eine Weile...","The import takes a while
var MAN_UPLOAD_FILE = ["Diese Datei hochladen (<i>importieren</i>): ", "Upload this file: ","Importar este file: "];
var MAN_BAK_REST_HEAD = ["Sicherung und Import","Backup and Restore","Exportar y Importar"];
var MAN_BAK_BTN = ["Sicherung (Konfiguration)","Backup (Configuration)","Exportar (configuración)"];
var MAN_BAK_BTN_ALL = ["Sicherung (Alles)","Backup (all)","Exportar (todo)"];
var MAN_BAK_BTN_ALL = ["Sicherung (Alles ohne Logs)","Backup (all without logs)","Exportar (todo sin protocolo)"];
var MAN_BAK_BTN_ALL_LOGS = ["Sicherung (Alles mit Logs)","Backup (all with logs)","Exportar (todo y protocolo)"];
var MAN_RESTORE_BTN = ["Importieren","Restore","Importar"];
var MAN_GO_LIVE = ["Starte Produktivbetrieb","Start productive mode","Empezar trabajar realmente"];
var MAN_SHUTDOWN = ["Server herunterfahren","Shutdown server","Apagar servidor"];
@ -421,6 +422,7 @@ function setLanguage(l) {
$("#bakrestxt").html(MAN_BAK_REST_HEAD[l]);
$("#backupbtntxt").html(MAN_BAK_BTN[l]);
$("#backupbtntxtall").html(MAN_BAK_BTN_ALL[l]);
$("#backupbtntxtalllogs").html(MAN_BAK_BTN_ALL_LOGS[l])
$("#restorebtntxt").html(MAN_RESTORE_BTN[l]);
$("#golivetxt").html(MAN_GO_LIVE[l]);
@ -1183,6 +1185,12 @@ function binding() {
e.preventDefault();
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=all";
});
$("#backup_btnalllogs").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=alllogs";
});
$("#restorebtntxt").off("click").on("click", function (e) {
$("#restinfoafterclick").html(MAN_REST_INFO[lang]);
@ -2743,12 +2751,13 @@ $(document).on("pageinit", "#admin-page", function () {
<div id=backuparea>
<form action='dummy'>
<button type="submit" data-theme="f" id="backup_btnall"><span id="backupbtntxtall">Sicherung</span></button>
<button type="submit" data-theme="f" id="backup_btnalllogs"><span id="backupbtntxtalllogs">Sicherung</span></button>
</form>
</div>
<div id=restorearea>
<form id="restoreform" enctype="multipart/form-data" action="php/contenthandler.php?module=admin&command=restore" method="POST" data-ajax="false">
<input type="hidden" name="MAX_FILE_SIZE" value="50000000" />
<input type="hidden" name="MAX_FILE_SIZE" value="600000000" />
<span id=uplfiletxt>Diese Datei hochladen (<i>importieren</i>):</span>
<input name="userfile" id="userfile" type="file" />
<div id=restinfoafterclick></div>

View File

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

View File

@ -290,7 +290,7 @@ class Admin {
$notActive = json_encode(array("status" => "OK","msg" => 0));
// check printmode
$pdo = DbUtils::openDbAndReturnPdoStatic();
$printMode = $this->getValueFromConfigTable($pdo,'payprinttype');
$printMode = CommonUtils::getConfigValue($pdo, 'payprinttype', "s");
if ($printMode != "s") {
echo $active;
return;
@ -751,184 +751,47 @@ class Admin {
$userLoggedIn = $this->isUserAlreadyLoggedInForPhp();
if ($userLoggedIn || (!$forHtml)) {
$sql = "SELECT count(id) as number,setting FROM %config% WHERE name=?";
if (is_null($pdo)) {
$pdo = $this->dbutils->openDbAndReturnPdo();
}
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array("companyinfo"));
$row = $stmt->fetchObject();
$companyInfo = $row->setting;
$stmt->execute(array("rectemplate"));
$row = $stmt->fetchObject();
$rectemplate = $row->setting;
$stmt->execute(array("foodtemplate"));
$row = $stmt->fetchObject();
$foodtemplate = $row->setting;
$stmt->execute(array("drinktemplate"));
$row = $stmt->fetchObject();
$drinktemplate = $row->setting;
$stmt->execute(array("decpoint"));
$row = $stmt->fetchObject();
$decpoint = $row->setting;
$stmt->execute(array("version"));
$row = $stmt->fetchObject();
$version = $row->setting;
$stmt->execute(array("payprinttype"));
$row = $stmt->fetchObject();
$payprinttype = $row->setting;
$stmt->execute(array("cancelunpaidcode"));
$row = $stmt->fetchObject();
$cancelunpaidcode = $row->setting;
$stmt->execute(array("tax"));
$row = $stmt->fetchObject();
$tax = $row->setting;
$stmt->execute(array("togotax"));
$row = $stmt->fetchObject();
$togotax = $row->setting;
$stmt->execute(array("taxaustrianormal"));
$row = $stmt->fetchObject();
$taxaustrianormal = $row->setting;
$stmt->execute(array("taxaustriaerm1"));
$row = $stmt->fetchObject();
$taxaustriaerm1 = $row->setting;
$stmt->execute(array("taxaustriaerm2"));
$row = $stmt->fetchObject();
$taxaustriaerm2 = $row->setting;
$stmt->execute(array("taxaustriaspecial"));
$row = $stmt->fetchObject();
$taxaustriaspecial = $row->setting;
$stmt->execute(array("serverurl"));
$row = $stmt->fetchObject();
$serverurl = $row->setting;
$stmt->execute(array("email"));
$row = $stmt->fetchObject();
$email = $row->setting;
$stmt->execute(array("bigfontworkreceipt"));
$row = $stmt->fetchObject();
$bigfontworkreceipt = $row->setting;
$stmt->execute(array("prominentsearch"));
$row = $stmt->fetchObject();
$prominentsearch = $row->setting;
$stmt->execute(array("discount1"));
$row = $stmt->fetchObject();
$discount1 = $row->setting;
$stmt->execute(array("discount2"));
$row = $stmt->fetchObject();
$discount2 = $row->setting;
$stmt->execute(array("discount3"));
$row = $stmt->fetchObject();
$discount3 = $row->setting;
$stmt->execute(array("austria"));
$row = $stmt->fetchObject();
$austria = $row->setting;
$stmt->execute(array("digigopaysetready"));
$row = $stmt->fetchObject();
$digigopaysetready = $row->setting;
if (is_null($digigopaysetready)) {
$digigopaysetready = 1;
}
$stmt->execute(array("waitergopayprint"));
$row = $stmt->fetchObject();
$waitergopayprint = $row->setting;
if (is_null($waitergopayprint)) {
$waitergopayprint = 0;
}
$stmt->execute(array("oneprodworkreceipts"));
$row = $stmt->fetchObject();
$oneprodworkreceipts = $row->setting;
if (is_null($oneprodworkreceipts)) {
$oneprodworkreceipts = 0;
}
$stmt->execute(array("digiprintwork"));
$row = $stmt->fetchObject();
$digiprintwork = $row->setting;
if (is_null($digiprintwork)) {
$digiprintwork = 1;
}
$stmt->execute(array("groupworkitems"));
$row = $stmt->fetchObject();
$groupworkitems = $row->setting;
if (is_null($groupworkitems)) {
$groupworkitems = 1;
}
// for update reasons check for null
$stmt->execute(array("receiveremail"));
$row = $stmt->fetchObject();
$receiveremail = "";
if (!is_null($row)) {
$receiveremail = $row->setting;
}
set_error_handler(function() { /* ignore errors */ });
try {
$stmt->execute(array("emailbadrating"));
$row = $stmt->fetchObject();
$emailbadrating = "";
if (!is_null($row)) {
$emailbadrating = $row->setting;
}
} catch (Exception $e) {
// in previous version this was not configurable
$emailbadrating = "";
}
try {
$stmt->execute(array("emailratingcontact"));
$row = $stmt->fetchObject();
$emailratingcontact = "";
if (!is_null($row)) {
$emailratingcontact = $row->setting;
}
} catch (Exception $e) {
// in previous version this was not configurable
$emailratingcontact = "";
}
restore_error_handler();
$stmt->execute(array("billlanguage"));
$row = $stmt->fetchObject();
$billlanguage = $row->setting;
$stmt->execute(array("currency"));
$row = $stmt->fetchObject();
$currency = $row->setting;
$stmt->execute(array("receiptfontsize"));
$row = $stmt->fetchObject();
$receiptfontsize = $row->setting;
$stmt->execute(array("reservationnote"));
$row = $stmt->fetchObject();
$reservationnote = $row->setting;
set_error_handler(function() { /* ignore errors */ });
$paymentconfig = $this->getConfigItemOrDefault("paymentconfig", $stmt, 0);
$workflowconfig = $this->getConfigItemOrDefault("workflowconfig", $stmt, 0);
$addreceipttoprinter = $this->getConfigItemOrDefault("addreceipttoprinter", $stmt, "");
$companyInfo = CommonUtils::getConfigValue($pdo,"companyinfo",null);
$rectemplate = CommonUtils::getConfigValue($pdo,"rectemplate",null);
$foodtemplate = CommonUtils::getConfigValue($pdo,"foodtemplate",null);
$drinktemplate = CommonUtils::getConfigValue($pdo,"drinktemplate",null);
$decpoint = CommonUtils::getConfigValue($pdo,"decpoint",null);
$version = CommonUtils::getConfigValue($pdo,"version",null);
$payprinttype = CommonUtils::getConfigValue($pdo,"payprinttype",null);
$cancelunpaidcode = CommonUtils::getConfigValue($pdo,"cancelunpaidcode",null);
$tax = CommonUtils::getConfigValue($pdo,"tax",null);
$togotax = CommonUtils::getConfigValue($pdo,"togotax",null);
$taxaustrianormal = CommonUtils::getConfigValue($pdo,"taxaustrianormal",null);
$taxaustriaerm1 = CommonUtils::getConfigValue($pdo,"taxaustriaerm1",null);
$taxaustriaerm2 = CommonUtils::getConfigValue($pdo,"taxaustriaerm2",null);
$taxaustriaspecial = CommonUtils::getConfigValue($pdo,"taxaustriaspecial",null);
$serverurl = CommonUtils::getConfigValue($pdo,"serverurl",null);
$email = CommonUtils::getConfigValue($pdo,"email",null);
$bigfontworkreceipt = CommonUtils::getConfigValue($pdo,"bigfontworkreceipt",null);
$prominentsearch = CommonUtils::getConfigValue($pdo,"prominentsearch",null);
$discount1 = CommonUtils::getConfigValue($pdo,"discount1",null);
$discount2 = CommonUtils::getConfigValue($pdo,"discount2",null);
$discount3 = CommonUtils::getConfigValue($pdo,"discount3",null);
$austria = CommonUtils::getConfigValue($pdo,"austria",null);
$digigopaysetready = CommonUtils::getConfigValue($pdo,"digigopaysetready",1);
$waitergopayprint = CommonUtils::getConfigValue($pdo,"waitergopayprint",0);
$oneprodworkreceipts = CommonUtils::getConfigValue($pdo,"oneprodworkreceipts",0);
$digiprintwork = CommonUtils::getConfigValue($pdo,"digiprintwork",1);
$groupworkitems = CommonUtils::getConfigValue($pdo,"groupworkitems",1);
$receiveremail = CommonUtils::getConfigValue($pdo,"receiveremail","");
$emailbadrating = CommonUtils::getConfigValue($pdo,"emailbadrating","");
$emailratingcontact = CommonUtils::getConfigValue($pdo,"emailratingcontact","");
$billlanguage = CommonUtils::getConfigValue($pdo,"billlanguage",null);
$currency = CommonUtils::getConfigValue($pdo,"currency",null);
$receiptfontsize = CommonUtils::getConfigValue($pdo,"receiptfontsize",null);
$reservationnote = CommonUtils::getConfigValue($pdo,"reservationnote",null);
$paymentconfig = CommonUtils::getConfigValue($pdo,"paymentconfig",0);
$workflowconfig = CommonUtils::getConfigValue($pdo,"workflowconfig",0);
$addreceipttoprinter = CommonUtils::getConfigValue($pdo,"addreceipttoprinter","");
$smtphost = "";
$smtpauth = 1;
@ -938,21 +801,18 @@ class Admin {
$smtpport = "";
if ($_SESSION['is_admin'] || $_SESSION['right_manager']) {
$smtphost = $this->getConfigItemOrDefault("smtphost",$stmt,"");
$smtpauth = $this->getConfigItemOrDefault("smtpauth",$stmt,1);
$smtpuser = $this->getConfigItemOrDefault("smtpuser",$stmt,"");
$smtppass = $this->getConfigItemOrDefault("smtppass",$stmt,"");
$smtpsecure = $this->getConfigItemOrDefault("smtpsecure",$stmt,1);
$smtpport = $this->getConfigItemOrDefault("smtpport",$stmt,"");
$smtphost = CommonUtils::getConfigValue($pdo,"smtphost","");
$smtpauth = CommonUtils::getConfigValue($pdo,"smtpauth",1);
$smtpuser = CommonUtils::getConfigValue($pdo,"smtpuser","");
$smtppass = CommonUtils::getConfigValue($pdo,"smtppass","");
$smtpsecure = CommonUtils::getConfigValue($pdo,"smtpsecure",1);
$smtpport = CommonUtils::getConfigValue($pdo,"smtpport","");
}
$paydeskid = $this->getConfigItemOrDefault("paydeskid",$stmt,"");
$aeskey = $this->getConfigItemOrDefault("aeskey",$stmt,"");
$certificatesn = $this->getConfigItemOrDefault("certificatesn", $stmt, "");
$webimpressum = $this->getConfigItemOrDefault("webimpressum",$stmt,"");
restore_error_handler();
$paydeskid = CommonUtils::getConfigValue($pdo,"paydeskid","");
$aeskey = CommonUtils::getConfigValue($pdo,"aeskey","");
$certificatesn = CommonUtils::getConfigValue($pdo,"certificatesn","");
$webimpressum = CommonUtils::getConfigValue($pdo,"webimpressum","");
$userlang = 0; // of no interest, if not called from web
$receiptprinter = 1; // of no interest, if not called from web
@ -997,25 +857,6 @@ class Admin {
}
}
function getConfigItemOrDefault($item,$stmt,$default) {
try {
$stmt->execute(array($item));
$row = $stmt->fetchObject();
$ret = $default;
if ($row) {
if (($row->number) > 0) {
$ret = $row->setting;
} else {
$ret = $default;
}
}
} catch (Exception $e) {
$ret = $default;
}
return $ret;
}
function getViewAfterLogin() {
if ($this->isUserAlreadyLoggedInForPhp()) {
$userid = $_SESSION['userid'];
@ -1091,7 +932,7 @@ class Admin {
$view = "preferences.html";
}
echo json_encode($view . "?v=1.2.11");
echo json_encode($view . "?v=1.2.12");
}
}
@ -1297,24 +1138,24 @@ class Admin {
if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.11"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.12"); };
} else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.2.11"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.2.12"); };
}
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.11"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.11"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.11"); };
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.12"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.12"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.12"); };
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.11"); };
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.12"); };
}
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.11"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.11"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.11"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.11"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.11"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.11"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.11");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.11");
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.12"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.12"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.12"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.12"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.12"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.12"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.12");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.12");
}
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -1323,7 +1164,7 @@ class Admin {
$waiterMessage = $this->getMessage(null, "waitermessage");
}
// CAUTION: change version also in config.txt!!!
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.11",
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.12",
"user" => $currentUser,
"menu" => $mainMenu,
"waitermessage" => $waiterMessage,
@ -1461,27 +1302,13 @@ class Admin {
}
function sendJsonValueFromConfigTable($pdo,$whichValue) {
$theVal = $this->getValueFromConfigTable($pdo,$whichValue);
$theVal = CommonUtils::getConfigValue($pdo, $whichValue, "");
if ($theVal == null) {
echo json_encode("");
} else {
echo json_encode($theVal);
}
}
function getValueFromConfigTable($pdo,$whichValue) {
$sql = "SELECT count(id) as countid,setting FROM %config% WHERE name=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($whichValue));
$row = $stmt->fetchObject();
$numberOfEntries = $row->countid;
$theValue = null;
if ($numberOfEntries == 1) {
$theValue = $row->setting;
}
return $theValue;
}
private function deletelogo() {
$pdo = $this->dbutils->openDbAndReturnPdo();
@ -1747,16 +1574,24 @@ class Admin {
function changepassword($userid,$password) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$sql = "SELECT count(id) as countid, is_admin FROM %user% WHERE active='1' AND id=?";
$sql = "SELECT count(id) as countid FROM %user% WHERE active='1' AND id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($userid));
$row = $stmt->fetchObject();
$userToChgPassIsAdm = false;
if ($row->countid == 1) {
if ($row->is_admin == 1) {
$userToChgPassIsAdm = true;
}
if ($row->countid == 0) {
echo json_encode("ERROR");
return;
}
$sql = "SELECT is_admin FROM %user% WHERE active='1' AND id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($userid));
$row = $stmt->fetchObject();
$userToChgPassIsAdm = false;
if ($row->is_admin == 1) {
$userToChgPassIsAdm = true;
}
if(session_id() == '') {
session_start();
@ -1830,19 +1665,22 @@ class Admin {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$ok = true;
// is old password correct?
$sql = "SELECT count(id) as countid,userpassword FROM %user% WHERE username=? AND active='1'";
$sql = "SELECT count(id) as countid FROM %user% WHERE username=? AND active='1'";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($currentuser));
$row = $stmt->fetchObject();
if ($row->countid == 0) {
echo json_encode("FAILED");
return;
}
$sql = "SELECT userpassword FROM %user% WHERE username=? AND active='1'";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($currentuser));
$row = $stmt->fetchObject();
$numberOfEntries = $row->countid;
if ($numberOfEntries == 1) {
if ($row->userpassword != $oldp_hash) {
$ok = false;
}
} else {
// user not found
if ($row->userpassword != $oldp_hash) {
$ok = false;
}
@ -1983,10 +1821,15 @@ class Admin {
}
private function getAllTablesToBackupRestore() {
return array("log","closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config",
return array("closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config",
"user","reservations","bill","queue","billproducts","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods","queueextras");
}
private function getAllWithLogsTablesToBackupRestore() {
return array("log","closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config",
"user","reservations","bill","queue","billproducts","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods","queueextras");
}
public function backup($theType,$remoteaccesscode) {
date_default_timezone_set(DbUtils::getTimeZone());
$nowtime = date('Y-m-d');
@ -1995,15 +1838,13 @@ class Admin {
$pdo = DButils::openDbAndReturnPdoStatic();
if ($theType == "auto") {
$sql = "SELECT count(id) as number,setting FROM %config% WHERE name=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array("remoteaccesscode"));
$row = $stmt->fetchObject();
if ($row->number == 0) {
$code = CommonUtils::getConfigValue($pdo, 'remoteaccesscode', null);
if (is_null($code)) {
echo "No remote access code available - backup not allowed";
return;
}
$code = $row->setting;
if (is_null($code) || (trim($code) == "")) {
echo "No remote access code set - backup not allowed";
return;
@ -2021,13 +1862,18 @@ class Admin {
$fileName = "backup-" . $version . "_" . $nowtime . "-configuration.json";
if ($theType == "all") {
$fileName = "backup-" . $version . "_" . $nowtime . "-all.json";
} else if ($theType == "alllogs") {
$fileName = "backup-" . $version . "_" . $nowtime . "-all-logs.json";
}
if ($theType == "configuration") {
$tables = $this->getConfigTablesToBackupRestore();
} else {
} else if (($theType == "all") || ($theType == "auto")) {
HistFiller::insertSaveHistEntry($pdo);
$tables = $this->getAllTablesToBackupRestore();
} else {
HistFiller::insertSaveHistEntry($pdo);
$tables = $this->getAllWithLogsTablesToBackupRestore();
}
$binaryFields = array("signature","img","setting","content");
@ -2083,9 +1929,9 @@ class Admin {
}
private function restore() {
ini_set('memory_limit', '1000M');
set_time_limit(60*5);
ini_set('memory_limit', '60000M');
set_time_limit(60*10);
if ($_FILES['userfile']['error'] != UPLOAD_ERR_OK //checks for errors
&& is_uploaded_file($_FILES['userfile']['tmp_name'])) { //checks that file is uploaded
header("Location: ../infopage.html?e=manager.html=Kann_Datei_nicht_laden.");
@ -2161,7 +2007,10 @@ class Admin {
$sql = "INSERT INTO $tablename ($colstr) VALUES ($queststr)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute($vals);
try {
$stmt->execute($vals);
} catch (Exception $e) {
}
}
if ($table['table'] == "bill") {

View File

@ -617,12 +617,9 @@ class Bill {
$currentTime = date('Y-m-d H:i:s');
// check if stornocode is correct
$sql = "SELECT count(id) as countid,setting FROM %config% WHERE name='stornocode'";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute();
$row = $stmt->fetchObject();
$numberOfVals = $row->countid;
if ($numberOfVals != 1) {
$stornocodeInDb = CommonUtils::getConfigValue($pdo, 'stornocode', null);
if (is_null($stornocodeInDb)) {
// stornocode not fixed
if ($doEcho) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_STORNO_CODE, "msg" => ERROR_BILL_NOT_STORNO_CODE_MSG));
@ -630,8 +627,6 @@ class Bill {
return false;
}
$stornocodeInDb = $row->setting;
if ($checkStornoCode) {
if ($stornocode != $stornocodeInDb) {
if ($doEcho) {
@ -780,15 +775,14 @@ class Bill {
private function autoBackupPdfSummary($remoteaccesscode) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$sql = "SELECT count(id) as number,setting FROM %config% WHERE name=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array("remoteaccesscode"));
$row = $stmt->fetchObject();
if ($row->number == 0) {
$code = CommonUtils::getConfigValue($pdo, 'remoteaccesscode', null);
if (is_null($code)) {
echo "No remote access code available - backup not allowed";
return;
}
$code = $row->setting;
if (is_null($code) || (trim($code) == "")) {
echo "No remote access code set - backup not allowed";
return;

View File

@ -210,7 +210,15 @@ echo json_encode(array("status" => "OK", "msg" => $content));
}
private function getSumOfBillsWithClosingId($pdo,$closingid,$onlyBar) {
$sql = "SELECT count(id) as countid,sum(brutto) as billsum FROM %bill% WHERE closingid=?";
$sql = "SELECT count(id) as countid FROM %bill% WHERE closingid=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($closingid));
$row = $stmt->fetchObject();
if ($row->countid == 0) {
return 0.0;
}
$sql = "SELECT sum(brutto) as billsum FROM %bill% WHERE closingid=?";
if ($onlyBar) {
$sql .= " AND paymentid='1'";
}
@ -218,11 +226,8 @@ $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($closingid));
$row = $stmt->fetchObject();
$numberOfReturns = $row->countid;
$sum = 0.0;
if ($numberOfReturns > 0) {
$sum = floatval($row->billsum);
}
return $sum;
}

View File

@ -286,7 +286,7 @@ class CommonUtils {
if ($row->countid == 0) {
return $default;
} else {
self::getExistingConfigValue($pdo, $item);
return self::getExistingConfigValue($pdo, $item);
}
}

View File

@ -96,7 +96,12 @@ class HistFiller {
private static function updateOrCreateEntryInHist($pdo,$id,$histaction,$colsInSourceTable,$idInHist,$sourcetable, $histtable,$extraCol,$extraVal) {
if (!is_null($extraVal)) {
if (strlen($extraVal) > 299) {
$extraVal = substr($extraVal, 0, 299);
}
}
$sql = "SELECT * from %". $sourcetable . "% WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($id));

View File

@ -576,7 +576,7 @@ class Basedb {
`available` INT(2) NOT NULL,
`favorite` INT(1) NULL,
`audio` VARCHAR ( 150 ) NULL,
`extras` VARCHAR ( 250 ) NULL,
`extras` VARCHAR ( 300 ) NULL,
FOREIGN KEY (prodid) REFERENCES %products%(id)
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb
";

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.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 name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.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 name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.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 name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.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 http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

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

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.12">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.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