diff --git a/javaprinter/javaprinter.jar b/javaprinter/javaprinter.jar index 85c22a5..acf3def 100644 Binary files a/javaprinter/javaprinter.jar and b/javaprinter/javaprinter.jar differ diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe index 9adef07..c15a1af 100644 Binary files a/printserver/OrderSprinterPrintserver.exe and b/printserver/OrderSprinterPrintserver.exe differ diff --git a/spider/install/installer.php b/spider/install/installer.php index e3d8cf3..23487d3 100644 --- a/spider/install/installer.php +++ b/spider/install/installer.php @@ -85,7 +85,7 @@ class Installer { } Database::dropTables($pdo); Database::createEmptyTables($pdo, $prefix); - Database::setVersion($pdo,$prefix,"1.3.14"); + Database::setVersion($pdo,$prefix,"1.3.15"); Database::setAccessPassword($pdo,$prefix,$adminpass); Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour return array("status" => "OK","msg" => "Installation successful"); diff --git a/webapp/OrderSprinterPrintserver.exe b/webapp/OrderSprinterPrintserver.exe index 9adef07..c15a1af 100644 Binary files a/webapp/OrderSprinterPrintserver.exe and b/webapp/OrderSprinterPrintserver.exe differ diff --git a/webapp/bar.html b/webapp/bar.html index ec8d1fd..e43f4dd 100644 --- a/webapp/bar.html +++ b/webapp/bar.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/bill.html b/webapp/bill.html index 7b2d41a..7c73ee1 100644 --- a/webapp/bill.html +++ b/webapp/bill.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/dash.php b/webapp/dash.php index 0359eed..f0c58ba 100644 --- a/webapp/dash.php +++ b/webapp/dash.php @@ -8,10 +8,15 @@ - - - + + + + + + + + @@ -56,7 +61,9 @@ $(document).ready(function () { getGeneralConfigItems(); - doAjax("GET", "php/contenthandler.php?module=admin&command=getJsonMenuItemsAndVersion", null, saveMenuInfo, null, true); + initializeMainMenu("#modulemenu"); + hideMenu(); + //doAjax("GET", "php/contenthandler.php?module=admin&command=getJsonMenuItemsAndVersion", null, saveMenuInfo, null, true); }); function getGeneralConfigItems() { @@ -177,7 +184,6 @@ function createDashSlot(dash,slotId,diagramNumber,stat) { if (diagramNumber == 0) { - // REM* nothing $(slotId).hide(); return; } @@ -194,17 +200,29 @@ dash.createMonthReport(slotId,stat.thismonth, currency); } else if (diagramNumber == 6) { dash.createDayReport(slotId,stat.today, currency); + } else if (diagramNumber == 7) { + dash.createDurationReport(slotId,stat.durations, currency); }; } -
- Dashboard - -
+
+
+ +
+
+

OrderSprinter

+ +
+ +
+ -
@@ -218,10 +236,13 @@ -
- - -
+
+
+
+
+
+
+ diff --git a/webapp/elements/dash.js b/webapp/elements/dash.js index 96617a5..0267e93 100644 --- a/webapp/elements/dash.js +++ b/webapp/elements/dash.js @@ -64,6 +64,11 @@ function Dash() { }); }; + this.createDurationReport = function(slotid,hourdata,currency) { + $(slotid + " h1").html('Verweildauer (Minuten)'); + this.createDashReport(slotid,hourdata,'Verweildauer (Minuten)',"hour","average",'line'); + }; + this.createMonthReport = function(slotid,monthdata,currency) { $(slotid + " h1").html('Monatseinnahme (' + currency + ")"); this.createDashReport(slotid,monthdata.content,'Monatseinnahme (' + currency + ")","iter","sum",'line'); diff --git a/webapp/feedback.html b/webapp/feedback.html index eecb832..c2b04c0 100644 --- a/webapp/feedback.html +++ b/webapp/feedback.html @@ -4,7 +4,7 @@ - + diff --git a/webapp/index.html b/webapp/index.html index 48d81ba..0111a1a 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -9,8 +9,8 @@ - - + + @@ -206,7 +206,7 @@ function handleResultOfInstallCheck(is_installed) { if (is_installed == "Yes") { useInstallation(); } else { - setTimeout(function(){document.location.href = "install.html?v=1.3.14"},500); + setTimeout(function(){document.location.href = "install.html?v=1.3.15"},500); } } diff --git a/webapp/install.html b/webapp/install.html index 39e9ee5..3177c46 100644 --- a/webapp/install.html +++ b/webapp/install.html @@ -725,7 +725,7 @@ $(document).ready(function() { diff --git a/webapp/install/installer.php b/webapp/install/installer.php index c5565df..c6ac09b 100644 --- a/webapp/install/installer.php +++ b/webapp/install/installer.php @@ -2215,6 +2215,28 @@ return false; } } +function updateUserTable1314_1315($prefix, $version, $dbname) { +$pdo = $this->pdo; +try { +if ($version != "1.3.14") { +$ret = $this->updateUserTable1313_1314($prefix, $version, $dbname); +if (!$ret) { +echo "Version update v1.3.13 to 1.3.14 not successful."; +return false; +} +} + +DbUtils::overrulePrefix($prefix); + +$this->updateVersion($pdo, '1.3.15'); + +return true; +} catch (PDOException $e) { +echo "Error in v1.3.14 to 1.3.15: $e"; +return false; +} +} + function setVersion($prefix,$theVersion) { $pdo = $this->pdo; @@ -2341,7 +2363,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.3.14')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.15')"); $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')"); @@ -2769,7 +2791,7 @@ $zones[] = $timezone_identifiers[$i]; } echo json_encode($zones); } else if ($command == 'update') { -$installerVersion = "1.3.14"; +$installerVersion = "1.3.15"; $admin = new InstallAdmin(); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); @@ -2800,7 +2822,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27" "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.11","1.2.12","1.2.13","1.2.14","1.2.15","1.2.16","1.2.17", "1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.3.10","1.3.11","1.3.12", -"1.3.13" +"1.3.13","1.3.14" ); if (!in_array($version, $supportedVersions)) { @@ -2808,7 +2830,7 @@ echo json_encode("Quellversion nicht unterstützt"); return; } -$ret = $admin->updateUserTable1313_1314($_POST['prefix'], $version, $_POST['db']); +$ret = $admin->updateUserTable1314_1315($_POST['prefix'], $version, $_POST['db']); if(session_id() == '') { session_start(); diff --git a/webapp/kitchen.html b/webapp/kitchen.html index b68bf60..e56b1f8 100644 --- a/webapp/kitchen.html +++ b/webapp/kitchen.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/manager.html b/webapp/manager.html index 66caf6f..6baa756 100644 --- a/webapp/manager.html +++ b/webapp/manager.html @@ -5,7 +5,7 @@ - + @@ -1018,6 +1018,7 @@ function createDashslotPart(number,value) { html += ''; html += ''; html += ''; + html += ''; html += ''; @@ -1650,9 +1651,9 @@ function handleUpdateCheckResult(answer) { var millis=getMillis(); setTimeout(function(){ - document.location.href = "install.html?v=1.3.14&mode=onlyupdate&n=" + millis; + document.location.href = "install.html?v=1.3.15&mode=onlyupdate&n=" + millis; },250); - document.location.href = "install.html?v=1.3.14&mode=onlyupdate&n=" + millis; + document.location.href = "install.html?v=1.3.15&mode=onlyupdate&n=" + millis; } function handleUpdateReplace(answer) { diff --git a/webapp/paydesk.html b/webapp/paydesk.html index 13fd5eb..41a85b3 100644 --- a/webapp/paydesk.html +++ b/webapp/paydesk.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/php/admin.php b/webapp/php/admin.php index 39df186..e14143a 100644 --- a/webapp/php/admin.php +++ b/webapp/php/admin.php @@ -887,69 +887,72 @@ class Admin { $pdo = $this->dbutils->openDbAndReturnPdo(); } - $companyInfo = CommonUtils::getConfigValue($pdo,"companyinfo",null); - $hosttext = CommonUtils::getConfigValue($pdo,"hosttext",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); - $cancelguestcode = CommonUtils::getConfigValue($pdo,"cancelguestcode",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); - $hotelinterface = CommonUtils::getConfigValue($pdo,"hotelinterface",0); - $hsinfile = CommonUtils::getConfigValue($pdo,"hsinfile",null); - $hsoutfile = CommonUtils::getConfigValue($pdo,"hsoutfile",null); - $hscurrency = CommonUtils::getConfigValue($pdo,"hscurrency",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); - $dashslot1 = CommonUtils::getConfigValue($pdo,"dashslot1",1); - $dashslot2 = CommonUtils::getConfigValue($pdo,"dashslot2",2); - $dashslot3 = CommonUtils::getConfigValue($pdo,"dashslot3",3); - $addreceipttoprinter = CommonUtils::getConfigValue($pdo,"addreceipttoprinter",""); - $printandqueuejobs = CommonUtils::getConfigValue($pdo,"printandqueuejobs",0); - $cashenabled = CommonUtils::getConfigValue($pdo,"cashenabled",1); - $returntoorder = CommonUtils::getConfigValue($pdo,"returntoorder",1); - $beepcooked = CommonUtils::getConfigValue($pdo,"beepcooked",0); + $sql = "SELECT count(id) as countid FROM %config% WHERE name=?"; + $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); + + $companyInfo = CommonUtils::getConfigValueStmt($pdo,$stmt,"companyinfo",null); + $hosttext = CommonUtils::getConfigValueStmt($pdo,$stmt,"hosttext",null); + $rectemplate = CommonUtils::getConfigValueStmt($pdo,$stmt,"rectemplate",null); + $foodtemplate = CommonUtils::getConfigValueStmt($pdo,$stmt,"foodtemplate",null); + $drinktemplate = CommonUtils::getConfigValueStmt($pdo,$stmt,"drinktemplate",null); + $decpoint = CommonUtils::getConfigValueStmt($pdo,$stmt,"decpoint",null); + $version = CommonUtils::getConfigValueStmt($pdo,$stmt,"version",null); + $payprinttype = CommonUtils::getConfigValueStmt($pdo,$stmt,"payprinttype",null); + $cancelunpaidcode = CommonUtils::getConfigValueStmt($pdo,$stmt,"cancelunpaidcode",null); + $cancelguestcode = CommonUtils::getConfigValueStmt($pdo,$stmt,"cancelguestcode",null); + $tax = CommonUtils::getConfigValueStmt($pdo,$stmt,"tax",null); + $togotax = CommonUtils::getConfigValueStmt($pdo,$stmt,"togotax",null); + $taxaustrianormal = CommonUtils::getConfigValueStmt($pdo,$stmt,"taxaustrianormal",null); + $taxaustriaerm1 = CommonUtils::getConfigValueStmt($pdo,$stmt,"taxaustriaerm1",null); + $taxaustriaerm2 = CommonUtils::getConfigValueStmt($pdo,$stmt,"taxaustriaerm2",null); + $taxaustriaspecial = CommonUtils::getConfigValueStmt($pdo,$stmt,"taxaustriaspecial",null); + $serverurl = CommonUtils::getConfigValueStmt($pdo,$stmt,"serverurl",null); + $email = CommonUtils::getConfigValueStmt($pdo,$stmt,"email",null); + $bigfontworkreceipt = CommonUtils::getConfigValueStmt($pdo,$stmt,"bigfontworkreceipt",null); + $prominentsearch = CommonUtils::getConfigValueStmt($pdo,$stmt,"prominentsearch",null); + $discount1 = CommonUtils::getConfigValueStmt($pdo,$stmt,"discount1",null); + $discount2 = CommonUtils::getConfigValueStmt($pdo,$stmt,"discount2",null); + $discount3 = CommonUtils::getConfigValueStmt($pdo,$stmt,"discount3",null); + $austria = CommonUtils::getConfigValueStmt($pdo,$stmt,"austria",null); + $digigopaysetready = CommonUtils::getConfigValueStmt($pdo,$stmt,"digigopaysetready",1); + $waitergopayprint = CommonUtils::getConfigValueStmt($pdo,$stmt,"waitergopayprint",0); + $oneprodworkreceipts = CommonUtils::getConfigValueStmt($pdo,$stmt,"oneprodworkreceipts",0); + $digiprintwork = CommonUtils::getConfigValueStmt($pdo,$stmt,"digiprintwork",1); + $groupworkitems = CommonUtils::getConfigValueStmt($pdo,$stmt,"groupworkitems",1); + $receiveremail = CommonUtils::getConfigValueStmt($pdo,$stmt,"receiveremail",""); + $emailbadrating = CommonUtils::getConfigValueStmt($pdo,$stmt,"emailbadrating",""); + $emailratingcontact = CommonUtils::getConfigValueStmt($pdo,$stmt,"emailratingcontact",""); + $billlanguage = CommonUtils::getConfigValueStmt($pdo,$stmt,"billlanguage",null); + $hotelinterface = CommonUtils::getConfigValueStmt($pdo,$stmt,"hotelinterface",0); + $hsinfile = CommonUtils::getConfigValueStmt($pdo,$stmt,"hsinfile",null); + $hsoutfile = CommonUtils::getConfigValueStmt($pdo,$stmt,"hsoutfile",null); + $hscurrency = CommonUtils::getConfigValueStmt($pdo,$stmt,"hscurrency",null); + $currency = CommonUtils::getConfigValueStmt($pdo,$stmt,"currency",null); + $receiptfontsize = CommonUtils::getConfigValueStmt($pdo,$stmt,"receiptfontsize",null); + $reservationnote = CommonUtils::getConfigValueStmt($pdo,$stmt,"reservationnote",null); + $paymentconfig = CommonUtils::getConfigValueStmt($pdo,$stmt,"paymentconfig",0); + $workflowconfig = CommonUtils::getConfigValueStmt($pdo,$stmt,"workflowconfig",0); + $dashslot1 = CommonUtils::getConfigValueStmt($pdo,$stmt,"dashslot1",1); + $dashslot2 = CommonUtils::getConfigValueStmt($pdo,$stmt,"dashslot2",2); + $dashslot3 = CommonUtils::getConfigValueStmt($pdo,$stmt,"dashslot3",3); + $addreceipttoprinter = CommonUtils::getConfigValueStmt($pdo,$stmt,"addreceipttoprinter",""); + $printandqueuejobs = CommonUtils::getConfigValueStmt($pdo,$stmt,"printandqueuejobs",0); + $cashenabled = CommonUtils::getConfigValueStmt($pdo,$stmt,"cashenabled",1); + $returntoorder = CommonUtils::getConfigValueStmt($pdo,$stmt,"returntoorder",1); + $beepcooked = CommonUtils::getConfigValueStmt($pdo,$stmt,"beepcooked",0); - $closshowci = CommonUtils::getConfigValue($pdo,"closshowci",1); - $closshowpaytaxes = CommonUtils::getConfigValue($pdo,"closshowpaytaxes",1); - $closshowprods = CommonUtils::getConfigValue($pdo,"closshowprods",1); - $showpayment2 = CommonUtils::getConfigValue($pdo,"showpayment2",1); - $showpayment3 = CommonUtils::getConfigValue($pdo,"showpayment3",1); - $showpayment4 = CommonUtils::getConfigValue($pdo,"showpayment4",1); - $showpayment5 = CommonUtils::getConfigValue($pdo,"showpayment5",1); - $showpayment6 = CommonUtils::getConfigValue($pdo,"showpayment6",1); - $showpayment7 = CommonUtils::getConfigValue($pdo,"showpayment7",1); - $showpayment8 = CommonUtils::getConfigValue($pdo,"showpayment8",1); + $closshowci = CommonUtils::getConfigValueStmt($pdo,$stmt,"closshowci",1); + $closshowpaytaxes = CommonUtils::getConfigValueStmt($pdo,$stmt,"closshowpaytaxes",1); + $closshowprods = CommonUtils::getConfigValueStmt($pdo,$stmt,"closshowprods",1); + $showpayment2 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment2",1); + $showpayment3 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment3",1); + $showpayment4 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment4",1); + $showpayment5 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment5",1); + $showpayment6 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment6",1); + $showpayment7 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment7",1); + $showpayment8 = CommonUtils::getConfigValueStmt($pdo,$stmt,"showpayment8",1); - $restaurantmode = CommonUtils::getConfigValue($pdo,"restaurantmode",1); + $restaurantmode = CommonUtils::getConfigValueStmt($pdo,$stmt,"restaurantmode",1); $smtphost = ""; $smtpauth = 1; @@ -959,27 +962,27 @@ class Admin { $smtpport = ""; if ( (isset($_SESSION['is_admin']) && ($_SESSION['is_admin'] == 1)) || (isset($_SESSION['right_manager']) && ($_SESSION['right_manager'] == 1))) { - $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",""); + $smtphost = CommonUtils::getConfigValueStmt($pdo,$stmt,"smtphost",""); + $smtpauth = CommonUtils::getConfigValueStmt($pdo,$stmt,"smtpauth",1); + $smtpuser = CommonUtils::getConfigValueStmt($pdo,$stmt,"smtpuser",""); + $smtppass = CommonUtils::getConfigValueStmt($pdo,$stmt,"smtppass",""); + $smtpsecure = CommonUtils::getConfigValueStmt($pdo,$stmt,"smtpsecure",1); + $smtpport = CommonUtils::getConfigValueStmt($pdo,$stmt,"smtpport",""); } - $discountname1 = trim(CommonUtils::getConfigValue($pdo, "discountname1", '')); - $discountname2 = trim(CommonUtils::getConfigValue($pdo, "discountname2", '')); - $discountname3 = trim(CommonUtils::getConfigValue($pdo, "discountname3", '')); + $discountname1 = trim(CommonUtils::getConfigValueStmt($pdo,$stmt, "discountname1", '')); + $discountname2 = trim(CommonUtils::getConfigValueStmt($pdo,$stmt, "discountname2", '')); + $discountname3 = trim(CommonUtils::getConfigValueStmt($pdo,$stmt, "discountname3", '')); - $memorylimit = CommonUtils::getConfigValue($pdo,"memorylimit",256); - $updateurl = CommonUtils::getConfigValue($pdo,"updateurl",""); - $hs3refresh = CommonUtils::getConfigValue($pdo, "hs3refresh", 60); + $memorylimit = CommonUtils::getConfigValueStmt($pdo,$stmt,"memorylimit",256); + $updateurl = CommonUtils::getConfigValueStmt($pdo,$stmt,"updateurl",""); + $hs3refresh = CommonUtils::getConfigValueStmt($pdo,$stmt, "hs3refresh", 60); - $paydeskid = CommonUtils::getConfigValue($pdo,"paydeskid",""); - $aeskey = CommonUtils::getConfigValue($pdo,"aeskey",""); - $certificatesn = CommonUtils::getConfigValue($pdo,"certificatesn",""); - $rksvserver = CommonUtils::getConfigValue($pdo,"rksvserver",""); - $webimpressum = CommonUtils::getConfigValue($pdo,"webimpressum",""); + $paydeskid = CommonUtils::getConfigValueStmt($pdo,$stmt,"paydeskid",""); + $aeskey = CommonUtils::getConfigValueStmt($pdo,$stmt,"aeskey",""); + $certificatesn = CommonUtils::getConfigValueStmt($pdo,$stmt,"certificatesn",""); + $rksvserver = CommonUtils::getConfigValueStmt($pdo,$stmt,"rksvserver",""); + $webimpressum = CommonUtils::getConfigValueStmt($pdo,$stmt,"webimpressum",""); $userlang = 0; // of no interest, if not called from web $receiptprinter = 1; // of no interest, if not called from web @@ -1112,7 +1115,7 @@ class Admin { $view = "preferences.html"; } - echo json_encode($view . "?v=1.3.14"); + echo json_encode($view . "?v=1.3.15"); } } @@ -1315,26 +1318,26 @@ 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.3.14"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.15"); }; } else { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.14"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.15"); }; } - if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.14"); }; - if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.14"); }; - if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.14"); }; + if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.15"); }; + if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.15"); }; + if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.15"); }; if ($_SESSION['modus'] == 0) { - if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.14"); }; + if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.15"); }; } - if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.14"); }; - if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.14"); }; - if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.14"); }; - if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.14"); }; - if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.14"); }; - if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.14"); }; - if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.3.14"); }; - if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.14"); }; - $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.14"); - $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.14"); + if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.15"); }; + if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.15"); }; + if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.15"); }; + if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.15"); }; + if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.15"); }; + if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.15"); }; + if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.3.15"); }; + if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.15"); }; + $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.15"); + $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.15"); } $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); @@ -1342,7 +1345,7 @@ class Admin { $waiterMessage = $this->getMessage(null, "waitermessage"); } - $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.14", + $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.15", "user" => $currentUser, "menu" => $mainMenu, "waitermessage" => $waiterMessage, diff --git a/webapp/php/commonutils.php b/webapp/php/commonutils.php index f219893..60a62cd 100644 --- a/webapp/php/commonutils.php +++ b/webapp/php/commonutils.php @@ -306,6 +306,16 @@ class CommonUtils { } } + public static function getConfigValueStmt($pdo,$stmt,$item,$default) { + $stmt->execute(array($item)); + $row =$stmt->fetchObject(); + if ($row->countid == 0) { + return $default; + } else { + return self::getExistingConfigValue($pdo, $item); + } + } + public static function getConfigValue($pdo,$item,$default) { $sql = "SELECT count(id) as countid FROM %config% WHERE name=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); diff --git a/webapp/php/config.php b/webapp/php/config.php old mode 100755 new mode 100644 diff --git a/webapp/php/reports.php b/webapp/php/reports.php index a782bf3..1bc92d4 100644 --- a/webapp/php/reports.php +++ b/webapp/php/reports.php @@ -188,6 +188,7 @@ class Reports { $retArray["tables"] = self::getOpenTables($pdo); $retArray["prodscount"] = self::getMaxSoldProductsCount($pdo); $retArray["prodssum"] = self::getMaxSoldProductsSum($pdo); + $retArray["durations"] = self::getGuestDuration($pdo); } return $retArray; @@ -481,4 +482,25 @@ class Reports { return $result; } + + public static function getGuestDuration($pdo) { + date_default_timezone_set(DbUtils::getTimeZone()); + $currentHour = date('H'); + + $stat = array(); + $sql = "SELECT productname, ordertime,paidtime,HOUR(paidtime) as hour,ROUND(AVG(TIME_TO_SEC(TIMEDIFF(paidtime,ordertime))/60)) as average"; + $sql .= " FROM %queue% WHERE paidtime is not null AND ordertime is not null AND DATE(paidtime) = DATE(NOW()) AND HOUR(paidtime)=? GROUP BY hour"; + $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); + for ($hour = 0; $hour <= $currentHour; $hour++) { + $stmt->execute(array($hour)); + $result = $stmt->fetchAll(); + if (count($result) > 0) { + $stat[] = array("hour" => $hour,"average" => $result[0]["average"]); + } else { + $stat[] = array("hour" => $hour,"average" => 0); + } + } + + return $stat; + } } diff --git a/webapp/php/updater.php b/webapp/php/updater.php index 938c636..831f2a7 100644 --- a/webapp/php/updater.php +++ b/webapp/php/updater.php @@ -117,7 +117,7 @@ class Updater { $infoFileLines = $infoFile["msg"]; if (count($infoFileLines) > 1) { - $checkIfNewerVersion = self::isV2Newer('1.3.14',trim($infoFileLines[0])); + $checkIfNewerVersion = self::isV2Newer('1.3.15',trim($infoFileLines[0])); return array("status" => "OK","msg" => $infoFileLines[0],"url" => $url,"neweravailable" => ($checkIfNewerVersion ? 1 : 0)); } else { return array("status" => "ERROR","msg" => "Info file not valid","url" => $url); diff --git a/webapp/preferences.html b/webapp/preferences.html index b431912..767068b 100644 --- a/webapp/preferences.html +++ b/webapp/preferences.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/products.html b/webapp/products.html index 5eb39e2..ece0913 100644 --- a/webapp/products.html +++ b/webapp/products.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/rating.html b/webapp/rating.html index e3a90c8..86f0447 100644 --- a/webapp/rating.html +++ b/webapp/rating.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reports.html b/webapp/reports.html index 7b79e31..9582d5d 100644 --- a/webapp/reports.html +++ b/webapp/reports.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reservation.html b/webapp/reservation.html index 9060d2e..383a854 100644 --- a/webapp/reservation.html +++ b/webapp/reservation.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/supplydesk.html b/webapp/supplydesk.html index e277f92..e23ffb9 100644 --- a/webapp/supplydesk.html +++ b/webapp/supplydesk.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/waiter.html b/webapp/waiter.html index c40fcb1..11a1aa2 100644 --- a/webapp/waiter.html +++ b/webapp/waiter.html @@ -4,8 +4,8 @@ - - + +
  - +