OrderSprinter 1.5.28

This commit is contained in:
Geno 2020-11-19 23:12:46 +01:00
parent 3abd7290f0
commit ca318485c9
45 changed files with 739 additions and 322 deletions

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" href="css/gueststyle.css?v=1.5.27" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.5.27" />
<link rel="stylesheet" href="css/gueststyle.css?v=1.5.28" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.5.28" />
<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" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script>
@ -101,6 +101,8 @@
<div class="ui-block-a"><button type="submit" data-theme="d" data-icon="back" id="askformorenobtn">Nein</button></div>
<div class="ui-block-b"><button type="submit" data-theme="f" data-icon="check" id="askformoreyesbtn">Ja</button></div>
</div><!-- /grid-a -->
<p><div id="orderslist"></div>
</div>
@ -111,7 +113,7 @@
<div data-role="footer" data-theme="b" id="thefooter1">
<div class="ui-grid-a">
<div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div>
<div class="ui-block-b grid_right" id="versioninfo">1.5.27&nbsp;&nbsp;</div>
<div class="ui-block-b grid_right" id="versioninfo">1.5.28&nbsp;&nbsp;</div>
</div><!-- /grid-a -->
</div>
</div>

View File

@ -114,10 +114,10 @@ if (isset($_POST['code'])) {
} else {
echo "<html>";
echo "<head><title>Installation Gastsystem</title>";
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.5.27">';
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.5.28">';
echo "</head>";
echo "<body><div class=surround>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.5.27</span><br><br>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.5.28</span><br><br>";
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 "</form></div></html>";

File diff suppressed because one or more lines are too long

View File

@ -53,6 +53,8 @@ class OsSystem {
} else {
return array("writeable" => 0,"file" => "Datei $filename nicht beschreibbar", "reason" => '');
}
} else {
return array("writeable" => 1);
}
}
private static function checkFileDbWriteStatus() {
@ -70,14 +72,14 @@ class OsSystem {
return $writeStatus;
}
}
return array(1);
return array("writeable" => 1);
}
public static function getsystemstatus($pdo) {
$timezone = DbUtils::getConfigItem($pdo, "timezone", "Europe/Berlin");
date_default_timezone_set($timezone);
$writeStatus = array(1);
$writeStatus = array("writeable" => 1);
$lastaccess = null;
if (DB == "mysql") {
$sql = "SELECT date FROM %gueststatus% WHERE item=?";
@ -93,7 +95,8 @@ class OsSystem {
} catch (Exception $ex) {
$lastaccess = null;
}
}
}
$date = new DateTime();
$currentTimeStamp = $date->getTimestamp();

Binary file not shown.

View File

@ -85,7 +85,7 @@ class Installer {
}
Database::dropTables($pdo);
Database::createEmptyTables($pdo, $prefix);
Database::setVersion($pdo,$prefix,"1.5.27");
Database::setVersion($pdo,$prefix,"1.5.28");
Database::setAccessPassword($pdo,$prefix,$adminpass);
Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour
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 name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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" />
<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="utilities.js?v=1.5.27"></script>
<script src="kitchenbar.js?v=1.5.27"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="kitchenbar.js?v=1.5.28"></script>
<style>
#tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -21,7 +21,7 @@
<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-i18n.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="receiptutils.js"></script>
<script>

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={VERSION}">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -23,7 +23,7 @@
<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-i18n.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="elements/customers.js"></script>
</head>

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={VERSION}">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="css/ospage.css" />
@ -17,7 +17,7 @@
<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="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="receiptutils.js"></script>
<script src="elements/dash.js"></script>
<script src="php/3rdparty/Chart.bundle.min.js"></script>

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -12,7 +12,7 @@
<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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="kitchenbar.js"></script>
<style>

View File

@ -9,8 +9,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={VERSION}">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v={VERSION}">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.28">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -18,7 +18,7 @@
<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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
</head>
<body>

View File

@ -9,8 +9,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.5.27">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.28">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -18,7 +18,7 @@
<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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
</head>
<body>
@ -231,7 +231,7 @@ function handleResultOfInstallCheck(is_installed) {
if (is_installed == "Yes") {
useInstallation();
} else {
setTimeout(function(){document.location.href = "install.html?v=1.5.27"},500);
setTimeout(function(){document.location.href = "install.html?v=1.5.28"},500);
}
}
@ -285,11 +285,11 @@ $(document).on("pageinit", "#index-page", function () {
<div data-role="content">
<p><div id="toplogolocation" style="text-align: center;display:none;"><img src="php/contenthandler.php?module=printqueue&command=getLogoAsPngWithAlphaChannel&v=1.5.27&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.28&style=always" style="max-height:150px;"/></div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" data-theme="e" id="loginmask">
<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.27&style=always" style="max-height:150px;"/></div>
<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.28&style=always" style="max-height:150px;"/></div>
<form method="post">
<table border=0>

View File

@ -212,7 +212,7 @@ function getDbVals() {
doAjax("GET",
"install/installer.php?command=getConfig",
null,fillDbVals,
"Kommunikation zum Server fehlerhaft");
"Kommunikation zum Server fehlerhaft", true);
}
function fillDbVals(dbVals) {
@ -243,7 +243,7 @@ function checkWriteAccess() {
"install/installer.php?command=checkWriteAccess",
null,
insertWriteAccessVals,
"Kommunikation mit Webserver fehlerhaft");
"Kommunikation mit Webserver fehlerhaft",true);
}
function checkPhpStatus() {
@ -251,7 +251,7 @@ function checkPhpStatus() {
"install/installer.php?command=checkPhpStatus",
null,
insertPhpStatus,
"Kommunikation mit Webserver fehlerhaft");
"Kommunikation mit Webserver fehlerhaft",true);
}
function insertBoolVal(id,boolval) {
@ -378,8 +378,8 @@ function startinstall() {
printpass: gen_printpass,
defaultview: gen_defaultview
}
$("#progress").html("<b style='color:red;'>" + WORKING[langid] + "</b>");
//$("#startinstall").attr("disabled", "disabled");
$("#progress").html("<img src='php/3rdparty/images/ajax-loader.gif' alt='Progress indication' /> <b style='color:red;'>" + WORKING[langid] + "</b>");
setTimeout(function(){$("#installprogressindicator").show();},500);
doAjax("POST",
"install/installer.php?command=install",
data,
@ -398,14 +398,18 @@ function resultOfUpdate(jsonAnswer) {
} else {
alert(AUTO_UPDATE_OK[lang]);
}
setTimeout(function(){document.location.href = "index.html";},500);
} else {
alert(ERROR[lang] + jsonAnswer);
setTimeout(function(){$("#installprogressindicator").hide();},500);
$("#installprogressindicator").hide();
}
}
function resultOfSampleData(jsonAnswer) {
setTimeout(function(){
$("#sampleinprogressindicator").hide();
},500);
if (jsonAnswer == "OK") {
var langid = $("#formid").data("lang");
@ -559,7 +563,7 @@ function insertSampleContent(e,level) {
e.stopImmediatePropagation();
e.preventDefault();
var langid = $("#formid").data("lang");
$("#samplesettings").html("<b style='color:red;'><center><br><br>" + WORKING[langid] + "</b></center>");
$("#samplesettings").html("<b style='color:red;'><center><br><img id='sampleinprogressindicator' src='php/3rdparty/images/ajax-loader.gif' alt='Progress indication' /><br>" + WORKING[langid] + "</b></center>");
var data = {
host: $("#db_host").val(),
db: $("#db_name").val(),
@ -912,8 +916,8 @@ El servicio web OrderSprinter no requiere una conexión a Internet. Sin embargo,
<tr id=updateline>
<td>&nbsp;</td>
<td align=center>
<button id="updatebtn">Update -> 1.5.27</button>
<span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span>
<button id="updatebtn">Update -> 1.5.28</button>
<span id="updateinprogresstxt" style="display:none;"><img id="installprogressindicator" src="php/3rdparty/images/ajax-loader.gif" alt="Progress indication" style="display:none;"/> Update... bitte warten.</span>
</td>
<td>&nbsp;</td>
</tr>

View File

@ -455,7 +455,7 @@ return;
}
set_time_limit(60*30);
$installerVersion = "1.5.27";
$installerVersion = "1.5.28";
$admin = new InstallAdmin();
$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 name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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" />
<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="utilities.js?v=1.5.27"></script>
<script src="kitchenbar.js?v=1.5.27"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="kitchenbar.js?v=1.5.28"></script>
<style>
#tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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" />
<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="utilities.js?v=1.5.27"></script>
<script src="elements/tablemap.js?v=1.5.27"></script>
<script src="elements/roommap.js?v=1.5.27"></script>
<script src="elements/groundplan.js?v=1.5.27"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="elements/tablemap.js?v=1.5.28"></script>
<script src="elements/roommap.js?v=1.5.28"></script>
<script src="elements/groundplan.js?v=1.5.28"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
@ -216,6 +216,8 @@ var MAN_SHUTDOWN_HINT = ["(Herunterfahren nur möglich, wenn Webserver die erfor
"(Shutdown only possible if web server has the required privileges to do so.)",
"(Apagar el servidor sólo es posible si webserver tiene el derecho para hacerlo.)"];
var MAN_OPTIMIZE = ["Datenbank optimieren","Optimize database","Arreglar base de datos"];
var MAN_INSERT_DEMO_DATA = ["Demo-Daten einfügen","Insert some demo data","Insertar datos de demonstracíon"];
var MAN_INSERT_DEMO_DATA_HINT = ["Das Einfügen von Demo-Daten sollte niemals auf einer produktiven Datenbank vorgenommen werden!","Never insert any demo data in a productive system!","No inserte datos de demonstracíon en sistemas productivos!"];
var MAN_OPTIMIZE_HINT = ["Beim Optimieren der Datenbank werden Haupttabellen aufgeräumt. Dieser Prozess kann bei einer großen Datenbank etwas Zeit in Anspruch nehmen. Die Optimierung sollte immer dann vorgenommen werden, wenn die Server-Geschwindigkeit abgenommen hat.",
"Optimize data base means that the main tables are cleaned. This process may take a while for big databases. The optimization should always be executed in ase the server's performance has worsened.",
"La arreglación de la base de datos es para mejorar la velocidad del servidor. El proceso puede durar un poco."];
@ -456,6 +458,7 @@ var MAN_LOGOLOCATION = ["Logo-Position auf Anmeldeseite","Position of logo on lo
var MAN_LOGOLOC = [["Unsichtbar","Invisible","No logo"],["Oben","Top","Arriba"],["Im Anmeldefeld","In login area","En area de registrar"]];
var MAN_AUSTRIA_BIND = ["Anbindung","Binding","Coneción"];
var MAN_AUSTRIABIND_OPTIONS = ["-","cbird","QRK R2B", "QRK Receipt"];
var MAN_ARE_YOU_SURE_DEMO_DATA = ["Sind Sie sicher?","Are you sure?","Cuidado! Realmente quiere insertar demo data?"];
var MAN_DAYNAMES = [
["Montag","Monday","Lunes"],
@ -503,9 +506,10 @@ var MAN_START_END_HINT = ["Start- und Enddatum dienen zur zeitlichen Eingrenzung
var MAN_1ST_CLOSING = ["Erste Tageserfassung","First closing","Cerrada primera"];
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_PRINT_EXTRAPRICE = ["Preisangabe bei Extras auf Bon","Show price next to extra on receipt","Precio al lado del extra"];
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,1, 0,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,1, 0,0,1];
var numberOfClosings = 0;
@ -661,7 +665,8 @@ var generalValuesSettings = [
["logolocation",MAN_LOGOLOCATION[lang],"s",67],
["austriabind",MAN_AUSTRIA_BIND[lang],"s",68],
["doublereceipt",MAN_DOUBLERECEIPT[lang],"s",69]
["doublereceipt",MAN_DOUBLERECEIPT[lang],"s",69],
["printextraprice",MAN_PRINT_EXTRAPRICE[lang],"s",70]
];
var predef = "";
@ -762,6 +767,8 @@ function setLanguage(l) {
$("#optimizebtntxt").html(MAN_OPTIMIZE[l]);
// $("#initreceiptbtntxt").html(MAN_INIT_AUSTRIA[l]);
$("#optimizehinttxt").html(MAN_OPTIMIZE_HINT[l]);
$("#insertdemodatabtntxt").html(MAN_INSERT_DEMO_DATA[l]);
$("#insertdemodatahinttxt").html(MAN_INSERT_DEMO_DATA_HINT[l]);
$("#upllogotxt").html(MAN_UPLOAD_LOGO[l]);
$("#dellogobtn").html(MAN_NO_LOGO_BTN[l]);
@ -1038,6 +1045,7 @@ function insertGeneralConfigItems(configResult) {
$("#partOfBillprintjobs").html(createBillprintjobsConfigPart(values.billprintjobs));
$("#partOfForceprint").html(createYesNo("forceprint",MAN_FORCE_PRINT, values.forceprint));
$("#partOfPrintextras").html(createYesNo("printextras",MAN_PRINT_EXTRAS, values.printextras));
$("#partOfPrintextraprice").html(createYesNo("printextraprice",MAN_PRINT_EXTRAPRICE, values.printextraprice));
$("#partOfPriceinlist").html(createYesNo("priceinlist",MAN_PRICE_IN_LIST, values.priceinlist));
$("#partOfGuestjobprint").html(createYesNo("guestjobprint",MAN_GUEST_JOB_PRINT, values.guestjobprint));
$("#partOfAskdaycode").html(createYesNo("askdaycode",MAN_ASK_DAYCODE, values.askdaycode));
@ -1169,6 +1177,7 @@ function insertGeneralConfigItems(configResult) {
generalVals[67] = values.logolocation;
generalVals[68] = values.austriabind;
generalVals[69] = values.doublereceipt;
generalVals[70] = values.printextraprice;
defaulttmp = values.defaulttmp;
@ -1658,7 +1667,7 @@ function initRestoreFileUpload() {
} else {
alert("Import war erfolgreich.");
setTimeout(function(){
document.location.href = "index.html?v=1.5.27";
document.location.href = "index.html?v=1.5.28";
},250);
}
},
@ -2131,38 +2140,38 @@ function binding() {
$("#backup_btn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=configuration&v=1.5.27";
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=configuration&v=1.5.28";
});
$("#backup_btnall").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=all&v=1.5.27";
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=all&v=1.5.28";
});
$("#backup_btnalllogs").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=alllogs&v=1.5.27";
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=alllogs&v=1.5.28";
});
$("#backup_btnftpall").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
showProgressPopup();
doAjax("GET","php/contenthandler.php?module=admin&command=ftpbackup&type=all&v=1.5.27",null,handleFtpResult,null);
doAjax("GET","php/contenthandler.php?module=admin&command=ftpbackup&type=all&v=1.5.28",null,handleFtpResult,null);
});
$("#backup_debugdata").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
window.open("php/contenthandler.php?module=admin&command=backup&type=debugdata&v=1.5.27",'_blank');
window.open("php/contenthandler.php?module=admin&command=backup&type=debugdata&v=1.5.28",'_blank');
});
$("#backupguests_btn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=confandguests&v=1.5.27";
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=confandguests&v=1.5.28";
});
$("#golive").off("click").on("click", function (e) {
@ -2196,6 +2205,14 @@ function binding() {
e.preventDefault();
doAjax("GET","php/contenthandler.php?module=admin&command=optimize",null,handleAnswerOptimize,"Skriptproblem");
});
$("#insertdemodata_btn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
var r = confirm(MAN_ARE_YOU_SURE_DEMO_DATA[lang]);
if (r == true) {
doAjax("GET","php/contenthandler.php?module=demodata&command=insertdemodata",null,handleAnswerInsertDemoData,"Skriptproblem");
}
});
// $("#initreceiptbutton").off("click").on("click", function (e) {
// e.stopImmediatePropagation();
// e.preventDefault();
@ -2335,7 +2352,7 @@ function updateOneSingleFile() {
setTimeout(function(){
$("#sliderarea").hide();
var millis=getMillis();
document.location.href = "install.html?v=1.5.27&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.5.28&mode=onlyupdate&n=" + millis;
},250);
}
}
@ -2661,6 +2678,13 @@ function handleAnswerOptimize(result) {
alert("Fehler " + result.code + ": " + result.msg);
}
}
function handleAnswerInsertDemoData(result) {
if (result.status == "OK") {
alert("Es wurden Demo-Daten eingefügt.");
} else {
alert("Fehler " + result.code + ": " + result.msg);
}
}
function handleAnswerInitReceipt(answer) {
if (answer.status == "OK") {
alert("Startbeleg wurde erzeugt.");
@ -3978,7 +4002,7 @@ $(document).on("pageinit", "#admin-page", function () {
<div id="partOfForceprint"></div>
<div id="partOfPrintextras"></div>
<i id="printextrashint" style="padding-left: 50px;padding-right: 50px;">Hinweis: erfordert 1.4.17</i>
<div id="partOfPrintextraprice"></div>
<div id="partOfShowhostprint"></div>
<div id="partAddrecPrinterIfServerPrint">
<div id="partOfAddRecPrinter"></div>
@ -4772,6 +4796,8 @@ $(document).on("pageinit", "#admin-page", function () {
<!-- <button type="submit" data-theme="e" id="initreceiptbutton"><span id="initreceiptbtntxt">Startbeleg</span></button>-->
<button type="submit" data-theme="d" id="optimize_btn"><span id="optimizebtntxt">Datenbank optimieren</span></button>
<div id="optimizehinttxt"></div><br>
<button type="submit" data-theme="d" id="insertdemodata_btn"><span id="insertdemodatabtntxt">Demo-Daten</span></button>
<div id="insertdemodatahinttxt"></div><br>
<button type="submit" data-theme="d" id="shutdown_btn"><span id="shutdownbtntxt">Shutdown</span></button>
<div id="shutdownhinttxt"></div>
</form>

File diff suppressed because one or more lines are too long

View File

@ -418,18 +418,22 @@ class Admin {
}
private function isPrinterServerActive() {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$active = json_encode(array("status" => "OK", "msg" => 1, "tasksforme" => $tasksForMe));
$notActive = json_encode(array("status" => "OK", "msg" => 0, "tasksforme" => $tasksForMe));
$pdo = DbUtils::openDbAndReturnPdoStatic(false);
if (is_null($pdo)) {
echo $notActive;
return;
}
Hotelinterface::hs3sync($pdo);
Guestsync::sync($pdo);
$tasksForMe = Tasks::areThereTasksForMe($pdo);
$TIMEOUT = 40;
$active = json_encode(array("status" => "OK","msg" => 1, "tasksforme" => $tasksForMe));
$notActive = json_encode(array("status" => "OK","msg" => 0, "tasksforme" => $tasksForMe));
$TIMEOUT = 40;
// check printmode
$printMode = CommonUtils::getConfigValue($pdo, 'payprinttype', "s");
@ -538,8 +542,7 @@ class Admin {
$authenticated = true;
}
}
if ($authenticated) {
date_default_timezone_set(DbUtils::getTimeZone());
$now = getdate();
@ -1220,7 +1223,8 @@ class Admin {
array("showerrorlog",1,false),
array("logolocation",1,false),
array("austriabind",0,false),
array("doublereceipt",0,false)
array("doublereceipt",0,false),
array("printextraprice",1,false)
);
if (is_null($pdo)) {
@ -1415,7 +1419,7 @@ class Admin {
$view = "preferences.html";
}
echo json_encode($view . "?v=1.5.27");
echo json_encode($view . "?v=1.5.28");
}
}
@ -1636,31 +1640,31 @@ 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.5.27"); }
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.5.28"); }
} else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.5.27"); }
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.5.28"); }
}
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.5.27"); }
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.5.27"); }
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.5.27"); }
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.5.28"); }
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.5.28"); }
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.5.28"); }
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.5.27"); }
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.5.28"); }
}
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.5.27"); }
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.5.27"); }
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.5.27"); }
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.5.27"); }
if ($_SESSION['right_tasks'] || $_SESSION['right_tasksmanagement']) { $mainMenu[] = array("name" => $taskstxt[$lang], "link" => "tasks.html?v=1.5.27"); }
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.5.27"); }
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.5.27"); }
if ($_SESSION['right_pickups']) { $mainMenu[] = array("name" => $pickupstxt[$lang], "link" => "pickups.html?v=1.5.27"); }
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.5.27"); }
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.5.27"); }
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.5.27");
if ($_SESSION['right_timetracking'] || $_SESSION['right_timemanager']) { $mainMenu[] = array("name" => $timetrackingtxt[$lang], "link" => "timetracking.html?v=1.5.27"); }
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.5.28"); }
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.5.28"); }
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.5.28"); }
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.5.28"); }
if ($_SESSION['right_tasks'] || $_SESSION['right_tasksmanagement']) { $mainMenu[] = array("name" => $taskstxt[$lang], "link" => "tasks.html?v=1.5.28"); }
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.5.28"); }
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.5.28"); }
if ($_SESSION['right_pickups']) { $mainMenu[] = array("name" => $pickupstxt[$lang], "link" => "pickups.html?v=1.5.28"); }
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.5.28"); }
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.5.28"); }
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.5.28");
if ($_SESSION['right_timetracking'] || $_SESSION['right_timemanager']) { $mainMenu[] = array("name" => $timetrackingtxt[$lang], "link" => "timetracking.html?v=1.5.28"); }
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.5.27");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.5.27");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.5.28");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.5.28");
}
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -1755,7 +1759,11 @@ class Admin {
private function getDailycode() {
try {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$pdo = DbUtils::openDbAndReturnPdoStatic(false);
if (is_null($pdo)) {
echo json_encode(array("status" => "ERROR","msg" => "Error: " . $ex->getMessage()));
return;
}
$dailycode = CommonUtils::getConfigValue($pdo, 'dailycode', "");
echo json_encode(array("status" => "OK","msg" => $dailycode));
} catch (Exception $ex) {
@ -2265,7 +2273,8 @@ class Admin {
"showerrorlog" => array("dbcol" => "showerrorlog","checknum" => 0),
"logolocation" => array("dbcol" => "logolocation","checknum" => 1),
"austriabind" => array("dbcol" => "austriabind","checknum" => 0),
"doublereceipt" => array("dbcol" => "doublereceipt","checknum" => 0)
"doublereceipt" => array("dbcol" => "doublereceipt","checknum" => 0),
"printextraprice" => array("dbcol" => "printextraprice","checknum" => 0)
);
$problem = false;
foreach ($changedValues as $aChangeSet) {

View File

@ -113,7 +113,7 @@ class Bill {
if(isset($_POST["remark"])) {
$remark = $_POST['remark'];
}
$this->doCashAction($_POST['money'],$remark);
self::doCashAction($_POST['money'],$remark);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_PAYDESK_NOT_AUTHOTRIZED, "msg" => ERROR_PAYDESK_NOT_AUTHOTRIZED_MSG));
}
@ -471,7 +471,19 @@ class Bill {
$extrasConcatStr = $zeile['concatstr'];
if (!is_null($extrasConcatStr)) {
$singleExtras = explode(',', $extrasConcatStr);
$printextraprice = CommonUtils::getConfigValue($pdo, 'printextraprice', 1);
$sql = "SELECT name FROM %extras% WHERE id=?";
if ($printextraprice == 1) {
$decpoint = CommonUtils::getConfigValue($pdo, 'decpoint', ';');
if (($decpoint != '.') && ($decpoint != ',')) {
$decpoint = ',';
}
$sql = "SELECT CONCAT(name,' (',REPLACE(price,'.','$decpoint'),')') as name FROM %extras% WHERE id=?";
}
foreach ($singleExtras as $aSingleExtra) {
$singleExtraParts = explode('-', $aSingleExtra);
$amount = $singleExtraParts[0];
@ -546,45 +558,46 @@ class Bill {
return $result;
}
/*
* insert or take out cash money. The direction done by sign of $money value
*/
private function doCashAction($money,$remark) {
private static function doCashAction($money,$remark) {
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
$pdo = $this->dbutils->openDbAndReturnPdo();
CommonUtils::log($pdo, "QUEUE", "Cash action with money '$money' at billtime '$currentTime'");
$userId = self::getUserIdStatic();
$result = self::doCashActionCore($money, $remark, $currentTime,$userId);
echo json_encode($result);
}
public static function doCashActionCore($money,$remark, $datetime,$userId) {
date_default_timezone_set(DbUtils::getTimeZone());
$pdo = DbUtils::openDbAndReturnPdoStatic();
CommonUtils::log($pdo, "QUEUE", "Cash action with money '$money' at billtime '$datetime'");
$pdo->beginTransaction();
$sql = "SELECT sum(brutto) as bruttosum FROM %bill% WHERE closingid is null AND paymentid='1'";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute();
$row =$stmt->fetchObject();
if ($row != null) {
$sum = $row->bruttosum;
$sql = "SELECT sum(brutto) as bruttosum FROM %bill% WHERE closingid is null AND paymentid=?";
$res = CommonUtils::fetchSqlAll($pdo, $sql, array(1));
if (count($res) > 0) {
$sum = $res[0]["bruttosum"];
if (is_null($sum)) {
$sum = 0.0;
}
if (($sum + floatval($money)) >= 0.0) {
$nextbillid = $this->testForNewBillIdAndUpdateWorkTable($pdo);
$nextbillid = self::testForNewBillIdAndUpdateWorkTable($pdo);
if ($nextbillid < 0) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));
$pdo->rollBack();
return(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));
}
$userId = $this->getUserId();
$commonUtils = new CommonUtils();
if (trim($money) == '') {
$money = '0.00';
}
CommonUtils::log($pdo, "QUEUE", "Calc bill signature for cash money '$money' at billtime '$currentTime'");
$signature = CommonUtils::calcSignatureForBill($currentTime, $money, $money, $userId);
CommonUtils::log($pdo, "QUEUE", "Calc bill signature for cash money '$money' at billtime '$datetime'");
$signature = CommonUtils::calcSignatureForBill($datetime, $money, $money, $userId);
$sql = "INSERT INTO `%bill%` (`id` , `billdate`,`brutto`,`netto`,`tax`,`tableid`, `status`, `paymentid`,`userid`,`ref`,`reason`,`signature`) VALUES ( ?, ? , ?,?,?, ?, 'c', ?,?,?,?,?)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($nextbillid,$currentTime,$money,$money,'0.00',-1,1,$userId,NULL,$remark,$signature));
CommonUtils::execSql($pdo, $sql, array($nextbillid,$datetime,$money,$money,'0.00',-1,1,$userId,NULL,$remark,$signature));
$lastId = $pdo->lastInsertId();
$prevbrutto = 0;
@ -608,14 +621,13 @@ class Bill {
PrintQueue::internalQueueReceiptPrintjob($pdo, $nextbillid, $printer);
}
$pdo->commit();
echo json_encode(array("status" => "OK"));
return(array("status" => "OK"));
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_LESS_MONEY_TO_TAKE_OUT, "msg" => ERROR_BILL_LESS_MONEY_TO_TAKE_OUT_MSG));
return(array("status" => "ERROR", "code" => ERROR_BILL_LESS_MONEY_TO_TAKE_OUT, "msg" => ERROR_BILL_LESS_MONEY_TO_TAKE_OUT_MSG));
}
} else {
$pdo->rollBack();
echo json_encode(array("status" => "ERROR", "code" => ERROR_GENERAL_PAYDESK_SUM, "msg" => ERROR_GENERAL_PAYDESK_SUM_MSG));
return;
return(array("status" => "ERROR", "code" => ERROR_GENERAL_PAYDESK_SUM, "msg" => ERROR_GENERAL_PAYDESK_SUM_MSG));
}
}
@ -754,18 +766,29 @@ class Bill {
return $_SESSION['userid'];
}
private static function getUserIdStatic() {
if(session_id() == '') {
session_start();
}
return $_SESSION['userid'];
}
/**
* Test if it is allowed to insert new bill as storno bill or if manipulation has happened
*
* Returns (-1) in case of an error, a positive return value is the new id, (which is already updated in work table)
*/
private function testForNewBillIdAndUpdateWorkTable($pdo) {
$commonUtils = new CommonUtils();
private static function testForNewBillIdAndUpdateWorkTable($pdo) {
$sql = "SELECT MAX(id) as maxbillid FROM %bill%";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute();
$row = $stmt->fetchObject();
$nextbillid = intval($row->maxbillid) + 1;
$res = CommonUtils::fetchSqlAll($pdo, $sql);
$maxbillid = 0;
if (count($res) > 0) {
$maxbillid = $res[0]["maxbillid"];
if (is_null($maxbillid)) {
$maxbillid = 0;
}
}
$nextbillid = intval($maxbillid) + 1;
$commonUtils = new CommonUtils();
if (!$commonUtils->verifyLastBillId($pdo, $nextbillid)) {
return (-1);
} else {
@ -913,10 +936,14 @@ class Bill {
/*
* Cancel a bill - set all queue items to not paid and drop the bill entry
* Public: because it is called by demodata
*/
private function cancelBill($pdo,$billid,$stornocode,$reason,$doOwnTransaction,$doEcho,$checkStornoCode,$removeproducts = 0) {
public function cancelBill($pdo,$billid,$stornocode,$reason,$doOwnTransaction,$doEcho,$checkStornoCode,$removeproducts = 0,$dateTime = null) {
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
if (!is_null($dateTime)) {
$currentTime = $dateTime;
}
$recordaction = T_BILLSTORNO;
if ($removeproducts) {
@ -1007,7 +1034,7 @@ class Bill {
return false;
}
$nextbillid = $this->testForNewBillIdAndUpdateWorkTable($pdo);
$nextbillid = self::testForNewBillIdAndUpdateWorkTable($pdo);
if ($nextbillid < 0) {
if ($doEcho) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));

View File

@ -137,6 +137,17 @@ echo json_encode("Remote access code not correct!");
}
private function createClosing ($remark,$doPrint = 1) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
date_default_timezone_set(DbUtils::getTimeZone());
if (!$this->isClosingAllowed($pdo)) {
return(array("status" => "ERROR", "msg" => "Time between closings too short", "code" => ERROR_CLOSING_TIME_LIMIT));
}
$closingTime = date('Y-m-d H:i:s');
$result = $this->createClosingCore($pdo,$remark,$doPrint,$closingTime,true);
echo json_encode($result);
}
public function createClosingCore ($pdo,$remark,$doPrint, $closingTime,$checkForNewVersionAvailable) {
set_time_limit(60*60);
if (is_null($remark)) {
@ -148,14 +159,6 @@ $decpoint = $this->getDecPoint();
// first create a closing entry
date_default_timezone_set(DbUtils::getTimeZone());
$closingTime = date('Y-m-d H:i:s');
$pdo = DbUtils::openDbAndReturnPdoStatic();
if (!$this->isClosingAllowed($pdo)) {
echo json_encode(array("status" => "ERROR", "msg" => "Time between closings too short", "code" => ERROR_CLOSING_TIME_LIMIT));
return;
}
$pdo->beginTransaction();
@ -199,8 +202,7 @@ break;
}
}
if (!$ok) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));
return;
return(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));
}
$sql = "UPDATE %bill% SET closingid='$newClosingId' WHERE closingid is null AND (tableid >= '0' OR status='c') ";
@ -294,6 +296,7 @@ $admin = new Admin();
$versionInfo = $admin->getEnv($pdo);
$content = array("env" => $versionInfo,"result" => $pricesum, "closingid" => $newClosingId);
if ($checkForNewVersionAvailable) {
// check if new version is evailable
// (do not inform user if last install or update is right before new version - let new version mature a bit..)
$url = "http://www.ordersprinter.de/version/checkversion.php?";
@ -306,12 +309,13 @@ array(
$newversionavailable = @file_get_contents($url, false, $ctx);
// TODO: has to be forwarded to user to inform him
}
CommonUtils::keepOnlyLastLog($pdo);
// call plugin after completion of closing
CommonUtils::callPlugin($pdo, "createClosing", "after");
echo json_encode(array("status" => "OK", "msg" => $content, "print" => $doPrint));
return(array("status" => "OK", "msg" => $content, "print" => $doPrint));
}
private function getSumOfBillsWithClosingId($pdo,$closingid,$onlyBar) {

View File

@ -22,6 +22,7 @@ require_once ('utilities/roles.php');
require_once ('utilities/permissions.php');
require_once ('utilities/basetemplater.php');
require_once ('utilities/clostemplater.php');
require_once ('utilities/demodata.php');
require_once ('guestsync.php');
require_once ('timetracking.php');
require_once ('tasks.php');
@ -97,6 +98,8 @@ if ($module == 'admin') {
Tasks::handleCommand($command);
} else if ($module == 'pickup') {
Pickup::handleCommand($command);
} else if ($module == 'demodata') {
Demodata::handleCommand($command);
}

View File

@ -181,7 +181,7 @@ class Customers {
}
}
private function createNewCustomer($pdo,$name,$email,$addr,$remark,$phone,$mobil,$www,$hello,$regards,$checkin,$checkout,$room) {
public function createNewCustomer($pdo,$name,$email,$addr,$remark,$phone,$mobil,$www,$hello,$regards,$checkin,$checkout,$room) {
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
@ -333,6 +333,8 @@ class Customers {
$sql = "UPDATE %bill% SET intguestpaid=? WHERE id=?";
CommonUtils::execSql($pdo, $sql, array($value,$id));
QueueContent::sendBillToQRK($pdo, $value, $id);
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
if(session_id() == '') {
@ -853,7 +855,7 @@ class Customers {
$txt = "<head>";
$txt .= "<title>" . self::$CUS_OVERVIEW[$lang] . "</title>";
$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.27">';
$txt .= '<link rel="stylesheet" type="text/css" href="../css/guestreport.css?v=1.5.28">';
$txt .= "</head>";
return $txt;
}

View File

@ -24,7 +24,7 @@ class DbUtils {
return $db;
}
public static function openDbAndReturnPdoStatic () {
public static function openDbAndReturnPdoStatic ($doEchoError = true) {
$dsn = 'mysql:host=' . MYSQL_HOST . ';dbname=' . MYSQL_DB;
$user = MYSQL_USER;
$password = MYSQL_PASSWORD;
@ -34,7 +34,9 @@ class DbUtils {
$pdo ->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
if ($doEchoError) {
echo 'Connection failed: ' . $e->getMessage();
}
}
return $pdo;
}

View File

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

View File

@ -114,7 +114,7 @@ class QueueContent {
$this->getJsonProductsOfTableToPay($_GET['tableid']);
} else if ($command == 'declarePaidCreateBillReturnBillId') {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$this->declarePaidCreateBillReturnBillId($pdo,$_POST['ids'],$_POST['tableid'],$_POST['paymentid'],$_POST['declareready'],$_POST['host'],false,$_POST['reservationid'],$_POST['guestinfo'],$_POST['intguestid'],null);
$this->declarePaidCreateBillReturnBillId($pdo,$_POST['ids'],$_POST['tableid'],$_POST['paymentid'],$_POST['declareready'],$_POST['host'],false,$_POST['reservationid'],$_POST['guestinfo'],$_POST['intguestid'],null,null);
} else {
echo "Command not supported.";
}
@ -789,10 +789,10 @@ class QueueContent {
$productid = $row->productid;
if ($action == 'r') {
$this->reallyDeclareAsCooked($pdo,$queueid);
self::reallyDeclareAsCooked($pdo,$queueid);
$useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid);
if ($useConditions["usesupply"] == 0) {
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
self::declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
} else {
self::setNewProductsToServe($pdo, 1);
}
@ -829,12 +829,11 @@ class QueueContent {
}
}
private function reallyDeclareAsCooked($pdo,$queueid) {
private static function reallyDeclareAsCooked($pdo,$queueid) {
date_default_timezone_set(DbUtils::getTimeZone());
$readytime = date('Y-m-d H:i:s');
$insertSql = "UPDATE %queue% SET readytime=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($insertSql));
$stmt->execute(array($readytime,$queueid));
CommonUtils::execSql($pdo, $insertSql, array($readytime,$queueid));
}
/*
@ -885,7 +884,7 @@ class QueueContent {
return $this->getUseKitchenAndSupplyForProdInCat($pdo,$catid);
}
private function getUseKitchenAndSupplyForProdWithPdo($pdo,$prodid) {
private static function getUseKitchenAndSupplyForProdWithPdo($pdo,$prodid) {
$sql = "SELECT usekitchen, usesupplydesk FROM %prodtype%,%products% WHERE %products%.category=%prodtype%.id AND %products%.id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($prodid));
if ($row != null) {
@ -1101,6 +1100,16 @@ class QueueContent {
echo json_encode(array("status" => "OK"));
}
function addProductListToQueue($theTableid,$prods,$doPrint,$payprinttype) {
date_default_timezone_set(DbUtils::getTimeZone());
$ordertime = date('Y-m-d H:i:s');
if(session_id() == '') {
session_start();
}
$pdo = DbUtils::openDbAndReturnPdoStatic();
$ret = self::addProductListToQueueCore($pdo, $ordertime, $theTableid, $prods, $doPrint, $payprinttype,$_SESSION['userid']);
echo json_encode($ret);
}
/*
* Add a product list to the queue as if it was ordered by the waiter.
* The ordertime is set by the time that this method is invoked.
@ -1108,21 +1117,13 @@ class QueueContent {
* If product shall not be run over kitchen or supplydesk this is
* managed here as well
*/
function addProductListToQueue($theTableid,$prods,$doPrint,$payprinttype) {
public static function addProductListToQueueCore($pdo,$ordertime,$theTableid,$prods,$doPrint,$payprinttype,$userid) {
if (intval($theTableid) == 0) {
$theTableid = null; // togo room
}
if(session_id() == '') {
session_start();
}
date_default_timezone_set(DbUtils::getTimeZone());
$ordertime = date('Y-m-d H:i:s');
$pdo = $this->dbutils->openDbAndReturnPdo();
$printAndQueueJobs = CommonUtils::getConfigValue($pdo, "printandqueuejobs", 0);
if ($printAndQueueJobs == 1) {
$doPrint = 1;
@ -1135,13 +1136,14 @@ class QueueContent {
$workflowconfig = CommonUtils::getExistingConfigValue($pdo, 'workflowconfig');
$austria = CommonUtils::getExistingConfigValue($pdo, 'austria');
$currentPriceLevel = $this->commonUtils->getCurrentPriceLevel($pdo);
$commUtils = new CommonUtils();
$currentPriceLevel = $commUtils->getCurrentPriceLevel($pdo);
$currentPriceLevelId = $currentPriceLevel["id"];
$insertedQueueIds = array();
$sql = "INSERT INTO %records% (date,userid,tableid,action) VALUES(?,?,?,?)";
CommonUtils::execSql($pdo, $sql, array($ordertime,$_SESSION['userid'],$theTableid,T_ORDER));
CommonUtils::execSql($pdo, $sql, array($ordertime,$userid,$theTableid,T_ORDER));
$recordid = $pdo->lastInsertId();
$i = 0;
@ -1246,22 +1248,22 @@ class QueueContent {
if (is_numeric($unit) && ($unit > 1)) {
if (!is_numeric($unitamount)) {
$pdo->rollBack();
echo json_encode(array("status" => "ERROR", "msg" => "Mengenangabe nicht numerisch"));
return(array("status" => "ERROR", "msg" => "Mengenangabe nicht numerisch"));
} else {
$price = $price * $unitamount;
}
}
if (is_null($theTableid) || (is_numeric($theTableid) && is_numeric($productid))) {
$useConditions = $this->getUseKitchenAndSupplyForProdWithPdo($pdo,$productid);
$useConditions = self::getUseKitchenAndSupplyForProdWithPdo($pdo,$productid);
$insertSql = "INSERT INTO `%queue%` (
`id` , `tablenr`,`productid`,`pricelevel`,`price`,`unit`,`unitamount`,`tax`,`taxaustria`,`productname`,`ordertime`,`orderuser`,`anoption`,`pricechanged`,`togo`,`readytime`,`delivertime`,`paidtime`,`billid`,`toremove`,`cooking`,`workprinted`)
VALUES (
NULL , ?,?,?,?,?,?,?,?,?,?,?,?,?,?, null, null, NULL,NULL,'0',NULL,'0');";
$stmt = $pdo->prepare(DbUtils::substTableAlias($insertSql));
$stmt->execute(array($theTableid,$productid,$currentPriceLevelId,$price,$unit,$unitamount,$tax,$taxaustrianumber,$productname,$ordertime,$_SESSION['userid'],$theOption,($theChangedPrice == "NO" ? 0 : 1),$togo));
CommonUtils::execSql($pdo, $insertSql, array($theTableid,$productid,$currentPriceLevelId,$price,$unit,$unitamount,$tax,$taxaustrianumber,$productname,$ordertime,$userid,$theOption,($theChangedPrice == "NO" ? 0 : 1),$togo));
$queueid = $pdo->lastInsertId();
$sql = "INSERT INTO %recordsqueue% (recordid,queueid) VALUES(?,?)";
@ -1274,19 +1276,18 @@ class QueueContent {
$extraname = $anExtra["name"];
$extraamount = $anExtra["amount"];
$sql = "INSERT INTO %queueextras% (`queueid`,`extraid`,`amount`,`name`) VALUES(?,?,?,?)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($queueid,$extraid,$extraamount,$extraname));
CommonUtils::execSql($pdo, $sql, array($queueid,$extraid,$extraamount,$extraname));
}
}
if (($workflowconfig == 3) && ($doPrint == 0)) {
$this->reallyDeclareAsCooked($pdo,$queueid);
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
self::reallyDeclareAsCooked($pdo,$queueid);
self::declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
} else {
if ($useConditions["usekitchen"] == 0) {
$this->reallyDeclareAsCooked($pdo,$queueid);
self::reallyDeclareAsCooked($pdo,$queueid);
if ($useConditions["usesupply"] == 0) {
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
self::declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
}
} else {
$insertedQueueIds[] = $queueid;
@ -1317,16 +1318,14 @@ class QueueContent {
if ($doPrint == 1) {
if ($payprinttype == "s") {
$this->doWorkPrint($pdo,$theTableid,$insertedQueueIds,$_SESSION['currentuser'],$payprinttype, $_SESSION['language']);
echo json_encode(array("status" => "OK"));
return(array("status" => "OK"));
} else {
$result = $this->doWorkPrint($pdo,$theTableid,$insertedQueueIds,$_SESSION['currentuser'],$payprinttype, $_SESSION['language']);
echo json_encode(array("status" => "OK", "msg" => $result));
return(array("status" => "OK", "msg" => $result));
}
} else {
echo json_encode(array("status" => "OK"));
}
$pdo->commit();
return(array("status" => "OK","queueids" => $insertedQueueIds));
}
function addProductListToQueueForGuest($pdo,$ordertime,$theTableid,$prodid,$doPrint) {
@ -1391,7 +1390,7 @@ class QueueContent {
if (is_null($theTableid) || (is_numeric($theTableid) && is_numeric($productid))) {
$useConditions = $this->getUseKitchenAndSupplyForProdWithPdo($pdo,$productid);
$useConditions = self::getUseKitchenAndSupplyForProdWithPdo($pdo,$productid);
$insertSql = "INSERT INTO `%queue%` (
`tablenr`,`productid`,`pricelevel`,`price`,`tax`,`taxaustria`,`productname`,`ordertime`,`orderuser`,`anoption`,`pricechanged`,`togo`,`readytime`,`delivertime`,`paidtime`,`billid`,`toremove`,`cooking`,`workprinted`)
@ -1406,13 +1405,13 @@ class QueueContent {
if (($workflowconfig == 3) && ($doPrint == 0)) {
$this->reallyDeclareAsCooked($pdo,$queueid);
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
self::reallyDeclareAsCooked($pdo,$queueid);
self::declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
} else {
if ($useConditions["usekitchen"] == 0) {
$this->reallyDeclareAsCooked($pdo,$queueid);
self::reallyDeclareAsCooked($pdo,$queueid);
if ($useConditions["usesupply"] == 0) {
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
self::declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
}
} else {
$insertedQueueIds[] = $queueid;
@ -1765,25 +1764,23 @@ class QueueContent {
function declareProductBeDeliveredWithGivenPdo($pdo,$queueid) {
static function declareProductBeDeliveredWithGivenPdo($pdo,$queueid) {
if (is_numeric($queueid)) {
date_default_timezone_set(DbUtils::getTimeZone());
$delivertime = date('Y-m-d H:i:s');
$updateSql = "UPDATE %queue% SET delivertime=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql));
$stmt->execute(array($delivertime,$queueid));
CommonUtils::execSql($pdo, $updateSql, array($delivertime,$queueid));
$updateSql = "UPDATE %queue% SET readytime=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql));
$stmt->execute(array($delivertime,$queueid));
CommonUtils::execSql($pdo, $updateSql, array($delivertime,$queueid));
}
}
function declareProductBeDelivered($queueid) {
if (is_numeric($queueid)) {
$pdo = $this->dbutils->openDbAndReturnPdo();
$this->declareProductBeDeliveredWithGivenPdo($pdo, $queueid);
self::declareProductBeDeliveredWithGivenPdo($pdo, $queueid);
}
}
@ -1795,7 +1792,7 @@ class QueueContent {
for ($i=0;$i < count($ids); $i++) {
$aQueueId = $ids[$i];
if (is_numeric($aQueueId)) {
$this->declareProductBeDeliveredWithGivenPdo($pdo,$aQueueId);
self::declareProductBeDeliveredWithGivenPdo($pdo,$aQueueId);
}
}
$pdo->commit();
@ -2073,9 +2070,12 @@ class QueueContent {
* Create bill
* Return a bill id
*/
function declarePaidCreateBillReturnBillId($pdo,$ids,$tableid,$paymentId,$declareready,$host,$calledInternally = false,$reservationid='',$guestinfo='',$intguestid='',$userid=null) {
public function declarePaidCreateBillReturnBillId($pdo,$ids,$tableid,$paymentId,$declareready,$host,$calledInternally = false,$reservationid='',$guestinfo='',$intguestid='',$userid=null, $billdate=null) {
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
if (!is_null($billdate)) {
$currentTime = $billdate;
}
if ($intguestid == '') {
$intguestid = null;
@ -2245,36 +2245,8 @@ class QueueContent {
$filename = $cbirdFolder . "/" . $currentTime . "-" . $longid . ".json";
file_put_contents($filename, $cbirdEntryJson);
} else if (($austriabind == 2) && self::isPaymentSupportedByQRK($paymentId)) {
$bruttoFormatted = number_format($brutto, 2, '.', '');
$qrkPaidby = strval(self::getPayedByForQRK($paymentId));
$qrkbill = array("receiptNum" => strval($billid),
"gross" => "$bruttoFormatted",
"payedBy" => "$qrkPaidby",
"customerText" => "");
$qrkcontainer = array("r2b" => array($qrkbill));
$qrkfilecontent = json_encode($qrkcontainer);
$filename = $cbirdFolder . "/QRK_R2B_" . $billid . ".json";
file_put_contents($filename, $qrkfilecontent);
} else if (($austriabind == 3) && self::isPaymentSupportedByQRK($paymentId)) {
$qrkPaidby = strval(self::getPayedByForQRK($paymentId));
$positionen = array();
foreach ($cbirdEntries as $aPosition) {
$thePrice = $aPosition["price"];
$thePriceFormatted = number_format($thePrice, 2, '.', '');
$theTax = $aPosition["tax"];
$theTaxFormatted = number_format($theTax, 2, '.', '');
$aPos = array("count" => strval($aPosition["mycount"]),
"name" => $aPosition["productname"],
"gross" => $thePriceFormatted,
"tax" => $theTaxFormatted);
$positionen[] = $aPos;
}
$qrkbill = array("customerText" => "","payedBy" => $qrkPaidby,"items" => $positionen);
$qrkreceipt = array("receipt" => array($qrkbill));
$qrkfilecontent = json_encode($qrkreceipt);
$filename = $cbirdFolder . "/QRK_Receipt_" . $billid . ".json";
file_put_contents($filename, $qrkfilecontent);
} else if (($austriabind == 2) || ($austriabind == 3)) {
self::sendBillToQRK($pdo, $paymentId, $billid);
}
}
@ -2289,6 +2261,72 @@ class QueueContent {
}
}
public static function sendBillToQRK($pdo,$paymentId,$billid) {
$austriaEnabled = CommonUtils::getConfigValue($pdo, "austria", 0);
$cbirdFolder = trim(CommonUtils::getConfigValue($pdo, 'cbirdfolder', ''));
if (($austriaEnabled == 0) || ($cbirdFolder == "")) {
return;
}
if (!self::isPaymentSupportedByQRK($paymentId)) {
return;
}
$austriabind = CommonUtils::getConfigValue($pdo, 'austriabind', 0);
if ($austriabind == 2) {
self::sendBillToQRKAsR2B($pdo, $paymentId, $billid);
} else if ($austriabind == 3) {
self::sendBillToQRKAsReceipt($pdo, $paymentId, $billid);
}
}
private static function sendBillToQRKAsReceipt($pdo,$paymentId,$billid) {
$cbirdFolder = trim(CommonUtils::getConfigValue($pdo, 'cbirdfolder', ''));
$qrkPaidby = strval(self::getPayedByForQRK($paymentId));
$positionen = array();
$sql = "SELECT count(queueid) as mycount,Q.id,productname,tax,price FROM %queue% Q,%billproducts% BP where ";
$sql .= " BP.queueid=Q.id AND ";
$sql .= " BP.billid=? ";
$sql .= " GROUP BY productname,tax,price";
$entries = CommonUtils::fetchSqlAll($pdo, $sql, array($billid));
foreach ($entries as $aPosition) {
$thePrice = $aPosition["price"];
$thePriceFormatted = number_format($thePrice, 2, '.', '');
$theTax = $aPosition["tax"];
$theTaxFormatted = number_format($theTax, 2, '.', '');
$aPos = array("count" => strval($aPosition["mycount"]),
"name" => $aPosition["productname"],
"gross" => $thePriceFormatted,
"tax" => $theTaxFormatted);
$positionen[] = $aPos;
}
$qrkbill = array("customerText" => "","payedBy" => $qrkPaidby,"items" => $positionen);
$qrkreceipt = array("receipt" => array($qrkbill));
$qrkfilecontent = json_encode($qrkreceipt);
$filename = $cbirdFolder . "/QRK_Receipt_" . $billid . ".json";
file_put_contents($filename, $qrkfilecontent);
}
private static function sendBillToQRKAsR2B($pdo,$paymentId,$billid) {
$cbirdFolder = trim(CommonUtils::getConfigValue($pdo, 'cbirdfolder', ''));
$qrkPaidby = strval(self::getPayedByForQRK($paymentId));
$bruttoDb = CommonUtils::fetchSqlAll($pdo, "SELECT brutto FROM %bill% WHERE id=?", array($billid));
$brutto = $bruttoDb[0]["brutto"];
$bruttoFormatted = number_format($brutto, 2, '.', '');
$qrkPaidby = strval(self::getPayedByForQRK($paymentId));
$qrkbill = array("receiptNum" => strval($billid),
"gross" => "$bruttoFormatted",
"payedBy" => "$qrkPaidby",
"customerText" => "");
$qrkcontainer = array("r2b" => array($qrkbill));
$qrkfilecontent = json_encode($qrkcontainer);
$filename = $cbirdFolder . "/QRK_R2B_" . $billid . ".json";
file_put_contents($filename, $qrkfilecontent);
}
private static function isPaymentSupportedByQRK($paymentid) {
if (($paymentid == 1) || ($paymentid == 2) || ($paymentid == 3)) {
return true;

View File

@ -55,15 +55,54 @@ class Reports {
}
}
if($command == 'getStats') {
$this->getStats();
} else {
echo "Command not supported.";
$this->createSqlPhrases();
$allDates = self::getDates();
$pdo = DbUtils::openDbAndReturnPdoStatic();
switch($command) {
case 'getStats':
$this->getStats($pdo);
break;
case 'getUsersums':
$values = $this->getUsersums($pdo);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getToday':
$values = $this->iterateForHours($pdo, $allDates['todayDate'], intval($allDates['todayHour'])+1,false);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getYesterday':
$values = $this->iterateForHours($pdo, $allDates['yesterdayDate'], 24,true);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getThismonth':
$values = $this->iterateForDays($pdo, $allDates['monthAndYearOfThisMonth'],intval($allDates['currentDay']),true);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getLastmonth':
$values = $this->iterateForDays($pdo, $allDates['monthAndYearOfLastMonth'],intval($allDates['lastDayOfLastMonth']),true);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getProds':
$values = $this->sumSortedByProducts($pdo, $allDates['last30days'][0], $allDates['currentTimeStr']);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getRatings':
$values = $this->getRatings($pdo,$allDates['last30days'],$allDates['lastMonthComplete'], $allDates['currentTimeStr']);
echo json_encode(array("status" => "OK","msg" => $values));
break;
case 'getMonthNames':
echo json_encode(array("status" => "OK","thismonth" => $allDates['thisMonthName'],"lastmonth" => $allDates['lastMonthName']));
break;
default:
echo "Command not supported.";
}
}
private function getStats() {
$pdo = DbUtils::openDbAndReturnPdoStatic();
private function getStats($pdo = null) {
if (is_null($pdo)) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
}
$this->createSqlPhrases();
$alldates = self::getDates();

View File

@ -132,7 +132,7 @@ class Reservation {
$timeSortedReservations = $this->getReservationsCore($pdo,$day,$month,$year,$sql . " ORDER BY starttime,roomsorting,tablesorting");
// REM* and now by table
$sql = "SELECT DISTINCT R.tableid as tableid,ROOM.id as roomid FROM %reservations% R,%room% ROOM,%resttables% T ";
$sql = "SELECT DISTINCT R.tableid as tableid,ROOM.id as roomid,ROOM.sorting as roomsorting,T.sorting as tablesorting FROM %reservations% R,%room% ROOM,%resttables% T ";
$sql .= " WHERE DATE(scheduledate)=? AND tableid is not null AND tableid >= '0' ";
$sql .= " AND R.tableid = T.id AND T.roomid=ROOM.id ";
$sql .= " ORDER BY ROOM.sorting,T.sorting ";

View File

@ -17,6 +17,7 @@ class Roomtables {
session_start();
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_NOT_AUTHOTRIZED, "msg" => ERROR_NOT_AUTHOTRIZED_MSG));
return;
}
}
@ -108,9 +109,9 @@ class Roomtables {
}
function getUnpaidTables($roomid) {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo = DbUtils::openDbAndReturnPdoStatic();
$priceTakeAway = $this->getUnpaidSumOfTakeAway($pdo);
echo json_encode(array("tables" => self::getUnpaidTablesCore($pdo,$roomid), "takeawayprice" => $priceTakeAway));
echo json_encode(array("status" => "OK", "tables" => self::getUnpaidTablesCore($pdo,$roomid), "takeawayprice" => $priceTakeAway));
}
function showAllRoomsAndTablesWithUnpaidItems() {

View File

@ -0,0 +1,199 @@
<?php
class Demodata {
public static function insertdemodata() {
try {
$pdo = DbUtils::openDbAndReturnPdoStatic();
date_default_timezone_set(DbUtils::getTimeZone());
$today = date('Y-m-d');
$yesterdayDT = new DateTime('yesterday');
$yesterday = $yesterdayDT->format('Y-m-d');
$previousmonth = date("Y-m", strtotime("first day of previous month")) . "-01";
$secondDayOfPreviosMonth = date("Y-m", strtotime("first day of previous month")) . "-02";
$thirdDayOfPreviosMonth = date("Y-m", strtotime("first day of previous month")) . "-03";
$sql = "SELECT id,priceA as price FROM %products% WHERE available='1' AND unit is NULL AND removed is null ORDER BY id LIMIT 40";
$prods = CommonUtils::fetchSqlAll($pdo, $sql);
if (count($prods) == 0) {
echo json_encode(array("status" => "ERROR","msg" => "Keine bestellbaren Produkte vorhanden"));
return;
}
$sql = "SELECT id from %resttables% WHERE active='1' AND removed is null ORDER BY roomid,sorting LIMIT 18";
$tablesCore = CommonUtils::fetchSqlAll($pdo, $sql);
if (count($tablesCore) == 0) {
echo json_encode(array("status" => "ERROR","msg" => "Keine aktiven Tische angelegt"));
return;
}
$sql = "SELECT id FROM %user% WHERE active=1 ORDER BY id";
$users = CommonUtils::fetchSqlAll($pdo, $sql);
if (count($users) == 0) {
echo json_encode(array("status" => "ERROR","msg" => "Keine aktiven Benutzer angelegt"));
return;
}
$tables = self::createDemoForADate($pdo, $previousmonth, $users, $prods, $tablesCore);
$tables = self::createSomeBills($pdo, $tables, $users, $secondDayOfPreviosMonth);
// TODO: cash insert!
Bill::doCashActionCore(123.45, "Bareinlage 1", $previousmonth . " 18:31:00", $users[0]["id"]);
if (count($users) > 1) {
Bill::doCashActionCore(234.56, "Bareinlage 2", $previousmonth . " 18:42:00", $users[1]["id"]);
}
$billModule = new Bill();
$ok = $billModule->cancelBill($pdo, $tables[0]["billid"], "", "Demo-Storno", false, false, false, 0, $thirdDayOfPreviosMonth . " 22:10:00");
if (count($tables) > 1) {
$ok = $billModule->cancelBill($pdo, $tables[2]["billid"], "", "Demo-Storno", false, false, false, 1, $thirdDayOfPreviosMonth . " 22:12:20");
}
$dateOfClosing = $thirdDayOfPreviosMonth . " 23:55:00";
$sql = "SELECT closingdate FROM %closing% ORDER BY closingdate DESC LIMIT 1";
$result = CommonUtils::fetchSqlAll($pdo, $sql);
if (count($result) > 0) {
$dateOfClosing = $result[0]["closingdate"];
}
$closing = new Closing();
$result = $closing->createClosingCore($pdo, "Tageserfassung letzten Monat", 0, $dateOfClosing, false);
$sql = "SELECT closingdate FROM %closing% WHERE DATE(closingdate) >= DATE(NOW() - INTERVAL 2 DAY)";
$result = CommonUtils::fetchSqlAll($pdo, $sql);
if (count($result) == 0) {
$tables = self::createDemoForADate($pdo, $yesterday, $users, $prods, $tablesCore);
$tables = self::createSomeBills($pdo, $tables, $users, $yesterday);
// TODO: cash insert!
Bill::doCashActionCore(200.45, "Bareinlage 1", $today . " 18:30:00", $users[0]["id"]);
if (count($users) > 1) {
Bill::doCashActionCore(400, "Bareinlage 2", $today . " 18:35:00", $users[1]["id"]);
}
$result = $closing->createClosingCore($pdo, "Tageserfassung diesen Monat", 0, $yesterday . " 22:00:00", false);
$tables = self::createDemoForADate($pdo, $today, $users, $prods, $tablesCore);
$tables = self::createSomeBills($pdo, $tables, $users, $today);
}
// reateNewCustomer($pdo,$name,$email,$addr,$remark,$phone,$mobil,$www,$hello,$regards,$checkin,$checkout,$room)
$customersModule = new Customers();
$customersModule->createNewCustomer($pdo, "Max Mustermann", "max@nospam.de", '', '', '', '', '', 'Herr', '', $previousmonth, null, "1");
$customersModule->createNewCustomer($pdo, "Silke Musterfrau", "silke@nospam.de", '', '', '', '', '', 'Frau', '', $previousmonth, null, "2");
$customersModule->createNewCustomer($pdo, "Donald Duck", "donald@nospam.de", '', '', '', '', '', 'Herr', '', $yesterday, null, "3");
$customersModule->createNewCustomer($pdo, "Harry Potter", "harry@nospam.de", '', '', '', '', '', 'Herr', '', $yesterday, null, "4");
$customersModule->createNewCustomer($pdo, "Jack Smith", "jack@nospam.de", '', '', '', '', '', 'Mr', '', $previousmonth, $yesterday, "5");
echo json_encode(array("status" => "OK"));
} catch (Exception $ex) {
echo json_encode(array("status" => "ERROR","msg" => $ex->getMessage()));
}
}
private static function createDemoForADate($pdo,$dateStr,$users,$prods,$tables) {
$prodindex = 0;
$userindex = 0;
for ($hour = 0; $hour < 18; $hour++, $hour++) {
$tableindex = 0;
while ($tableindex < count($tables)) {
$tableid = $tables[$tableindex]["id"];
$prod = $prods[$prodindex];
$prodElement = array(
"changedPrice" => "NO",
"extras" => "",
"option" => "",
"price" => $prod["price"],
"prodid" => $prod["id"],
"togo" => 0,
"unit" => 0,
"unitamount" => 1);
$prodArr = array($prodElement);
$userid = $users[$userindex]["id"];
$time = $dateStr . " " . self::leadingzeronumber($hour) . ":05:20";
$ret = QueueContent::addProductListToQueueCore($pdo, $time, $tableid, $prodArr, 0, 's', $userid);
if ($ret["status"] != "OK") {
echo json_encode($ret);
return;
}
if (!isset($tables[$tableindex]["queueids"])) {
$tables[$tableindex]["queueids"] = [];
}
$tables[$tableindex]["queueids"] = array_merge($tables[$tableindex]["queueids"], $ret['queueids']);
$prodindex = ($prodindex + 1) % count($prods);
$userindex = ($userindex + 1) % count($users);
$tableindex += 2;
}
}
return $tables;
}
private static function createSomeBills($pdo,$tables,$users,$date) {
$queue = new QueueContent;
$tables[0]["billid"] = self::createBillOfTable($pdo, $queue, join(',', $tables[0]["queueids"]), $tables[0]["id"], 1, $users[0 % count($users)]["id"], $date . " 19:14:15");
if (count($tables) >= 3) {
$tables[2]["billid"] = self::createBillOfTable($pdo, $queue, join(',', $tables[2]["queueids"]), $tables[2]["id"], 2, $users[1 % count($users)]["id"], $date . " 19:14:25");
}
if (count($tables) >= 5) {
$tables[4]["billid"] = self::createBillOfTable($pdo, $queue, join(',', $tables[4]["queueids"]), $tables[4]["id"], 3, $users[2 % count($users)]["id"], $date . " 19:15:15");
}
if (count($tables) >= 7) {
$tables[6]["billid"] = self::createBillOfTable($pdo, $queue, join(',', $tables[6]["queueids"]), $tables[6]["id"], 1, $users[3 % count($users)]["id"], $date . " 20:15:15");
}
if (count($tables) >= 8) {
$tables[7]["billid"] = self::createBillOfTable($pdo, $queue, join(',', $tables[7]["queueids"]), $tables[7]["id"], 1, $users[4 % count($users)]["id"], $date . " 20:15:15");
}
if (count($tables) >= 10) {
$tables[9]["billid"] = self::createBillOfTable($pdo, $queue, join(',', $tables[9]["queueids"]), $tables[9]["id"], 1, $users[5 % count($users)]["id"], $date . " 21:10:00");
}
return $tables;
}
private static function createBillOfTable($pdo,$queue,$tablequeueids,$tableid,$paymentid,$userid,$datetime) {
$billid = $queue->declarePaidCreateBillReturnBillId($pdo,$tablequeueids,$tableid,$paymentid,1,0,true,'','','',$userid,$datetime);
return $billid;
}
private static function leadingzeronumber($number) {
$number = intval($number);
if ($number < 10) {
$number = "0" . $number;
}
return number;
}
public static function handleCommand($command) {
if (!self::checkRights($command)) {
return false;
}
if ($command == 'insertdemodata') {
self::insertdemodata();
}
}
private static function checkRights($command) {
if (session_id() == '') {
session_start();
}
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_NOT_AUTHOTRIZED, "msg" => ERROR_NOT_AUTHOTRIZED_MSG));
return false;
}
if ($command == 'insertdemodata') {
if ($_SESSION['is_admin'] == false) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_COMMAND_NOT_ADMIN, "msg" => ERROR_COMMAND_NOT_ADMIN_MSG));
return false;
} else {
return true;
}
}
return false;
}
}

View File

@ -1246,6 +1246,16 @@ class Version {
}
}
public static function upd_1527_1528($pdo, $prefix, $dbname) {
try {
self::insertOrUpdateConfigItem($pdo, 'printextraprice', '1');
return array(true);
} catch (PDOException $e) {
return array(false,$e);
}
}
public static $updateOrder = array(
"1.3.0" => array("upd_1300_1301","1.3.1"),
"1.3.1" => array("upd_1301_1302","1.3.2"),
@ -1320,7 +1330,8 @@ class Version {
"1.5.23" => array("upd_1523_1524","1.5.24"),
"1.5.24" => array("upd_1524_1525","1.5.25"),
"1.5.25" => array("upd_1525_1526","1.5.26"),
"1.5.26" => array("upd_1526_1527","1.5.27")
"1.5.26" => array("upd_1526_1527","1.5.27"),
"1.5.27" => array("upd_1527_1528","1.5.28")
);
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 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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.27"></script>
<script src="utilities.js?v=1.5.28"></script>
<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>

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,7 +13,7 @@
<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.mobile-1.4.5.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
</head>

View File

@ -7,16 +7,16 @@
<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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<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/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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="elements/product.js?v=1.5.27"></script>
<script src="elements/extra.js?v=1.5.27"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="elements/product.js?v=1.5.28"></script>
<script src="elements/extra.js?v=1.5.28"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
</head>
@ -1076,7 +1076,7 @@ function setLanguage(language) {
if (query.status == "OK") {
var extras = query.msg;
var txt = "<table>";
txt += "<tr><th>" + PROD_EXTRA_COL_NAME[lang] + "<th>" + PROD_EXTRA_COL_PRICE + "<th>" + PROD_EXTRA_COL_MAXAMOUNT + "</tr>";
txt += "<tr><th>" + PROD_EXTRA_COL_NAME[lang] + "<th>" + PROD_EXTRA_COL_PRICE[lang] + "<th>" + PROD_EXTRA_COL_MAXAMOUNT[lang] + "</tr>";
var i=0;
for (i=0;i<extras.length;i++) {
var anExtraDb = extras[i];

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="css/ospage.css" />
<link rel="stylesheet" href="css/tablepanel.css" />
@ -15,7 +15,7 @@
<script src="php/3rdparty/jquery-2.2.4.min.js"></script>
<script src="php/3rdparty/jqueryui1-12-0/jquery-ui.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<script>

View File

@ -7,14 +7,14 @@
<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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<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/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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
</head>
<body>

View File

@ -7,14 +7,14 @@
<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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<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/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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<script src="elements/rating.js"></script>
</head>
@ -42,10 +42,10 @@ var REP_SUM = ["Summe","Sum","Total"];
var REP_TODAY_TXT = ["Diese Übersicht umfasst alle Kassenbons, die bisher heute gedruckt wurden.",
"This overview shows all receipts that have been printed today.",
"Este parte contiene todos los tiques de este día."];
var REP_YEST_TXT = ["Diese Übersicht umfasst die gestrigen Einnahmen, die in Tageslosungen erfasst wurden.",
var REP_YEST_TXT = ["Diese Übersicht umfasst die gestrigen Einnahmen, die in Tagesabschlüssen erfasst wurden.",
"This overview shows all revenues of yesterday that are part of a closing.",
"Este parte muestra todo el cobro de tiques cerrados de ayer."];
var REP_THIS_MONTH_TXT = ["Diese Übersicht umfasst alle Einnahmen dieses Monats, die in Tageslosungen erfasst sind.",
var REP_THIS_MONTH_TXT = ["Diese Übersicht umfasst alle Einnahmen dieses Monats, die in Tagesabschlüssen erfasst sind.",
"This overview shows all revenues of this month that are part of a closing.",
"Este parte muestra todo el cobro de tiques cerrados de este mes."];
var REP_LAST_MONTH_TXT = ["Diese Übersicht umfasst Einnahmen des letzten Monats.",
@ -87,52 +87,29 @@ function setLanguage(language) {
lang = language;
$("#reportttitletxt").html(REP_TITLE[lang]);
}
function getStats() {
doAjax("GET","php/contenthandler.php?module=reports&command=getStats",null,fillPageWithStats,"Statistikreports nicht erhalten");
}
function fillPageWithStats(jsonText) {
var htmlToday = fillOnePart(REP_TODAY[lang],jsonText.today,REP_HOUR[lang],
REP_TODAY_TXT[lang],
"center",10,10,80);
var htmlYesterday = fillOnePart(REP_YESTERDAY[lang],jsonText.yesterday,REP_HOUR[lang],
REP_YEST_TXT[lang],
"center",10,10,80);
var htmlThisMonth = fillOnePart(jsonText.thismonthname,jsonText.thismonth,REP_DAY[lang],
REP_THIS_MONTH_TXT[lang],
"center",10,10,80);
var htmlLastMonth = fillOnePart(jsonText.lastmonthname,jsonText.lastmonth,REP_DAY[lang],
REP_LAST_MONTH_TXT[lang],
"center",10,10,80);
var htmlProds = fillOnePart(REP_PRODREP[lang],jsonText.prodsums,REP_PROD[lang],
REP_PROD_LAST30_TXT[lang],
"left",30,10,60);
var htmlRatings = fillRatingsPart(jsonText.ratings,REP_DAY[lang],10,10,40,40);
var htmlUserSumsPart = fillOnePart(REP_USERSUM[lang],jsonText.usersums,REP_USER[lang],
REP_USER_TXT[lang],
"center",15,10,75);
function fillPageWithStats() {
var htmlTableReports = createStub("table_reports_section",REP_TABLE_REPORTS[lang],REP_TABLE_REPORTS_INFO[lang],"","");
var search = '<p><input id="searchfieldorders" style="background-color:white;color:black;" placeholder="Suche" />';
var selBoxForOrdersPaid = "<div id='selBoxForOrdersFilter'>" + createSelBoxForOrderFilter() + "</div>";
var selBoxForOrdersCancelled = "<div id='selBoxForOrdersCancelled'>" + createSelBoxForCancelledFilter() + "</div>";
var updateBtn = "<button id='updateordersbtn' data-theme='f'>Aktualisieren</button>";
var htmlTodaySums = createStub("today_section",REP_TODAY[lang],REP_TODAY_TXT[lang],"","");
var htmlYesterdaySums = createStub("yesterday_section",REP_YESTERDAY[lang],REP_YEST_TXT[lang],"","");
var htmlThismonthSums = createStub("thismonth_section",'',REP_THIS_MONTH_TXT[lang],"","");
var htmlLastmonthSums = createStub("lastmonth_section",'',REP_LAST_MONTH_TXT[lang],"","");
var htmlProdSums = createStub("prods_section",REP_PRODREP[lang],REP_PROD_LAST30_TXT[lang],"","");
var htmlRatingSums = createStub("ratings_section",REP_RATINGS[lang],REP_RATINFO[lang],"","");
var htmlUsersums = createStub("usersums_section",REP_USERSUM[lang],REP_USER_TXT[lang],"","");
var htmlOrderReports = createStub("order_reports_section",REP_ORDER_REPORTS[lang],REP_ORDER_REPORTS_INFO[lang],search + selBoxForOrdersPaid + selBoxForOrdersCancelled,updateBtn);
$("#content").html(htmlToday + htmlYesterday + htmlThisMonth + htmlLastMonth + htmlProds + htmlRatings + htmlUserSumsPart + htmlTableReports + htmlOrderReports);
$("#content").html(htmlTodaySums + htmlYesterdaySums + htmlThismonthSums + htmlLastmonthSums + htmlProdSums + htmlRatingSums + htmlUsersums + htmlTableReports + htmlOrderReports);
$("#content").trigger("create");
bindExpandAreas();
bindUpdateBtns();
bindSelBoxChange();
requestMonthNamesAndInsert();
}
function createSelBoxForOrderFilter() {
@ -174,9 +151,39 @@ function setLanguage(language) {
return sel;
}
function requestMonthNamesAndInsert() {
doAjax("GET", "php/contenthandler.php?module=reports&command=getMonthNames", null, insertMonthNames, "Fehler keine Monatsnamen");
}
function insertMonthNames(answer) {
if (answer.status == "OK") {
$("#header_thismonth_section").html(answer.thismonth);
$("#header_lastmonth_section").html(answer.lastmonth);
};
}
function bindExpandAreas() {
$("#today_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getToday", null, fillToday, "Fehler keine Heute-Verkäufe",true);
});
$("#yesterday_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getYesterday", null, fillYesterday, "Fehler keine Gestern-Verkäufe",true);
});
$("#thismonth_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getThismonth", null, fillThismonth, "Fehler keine Daten für diesen Monat",true);
});
$("#lastmonth_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getLastmonth", null, fillLastmonth, "Fehler keine Daten für letzten Monat",true);
});
$("#prods_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getProds", null, fillProds, "Fehler keine Daten für Produktverkäufe",true);
});
$("#ratings_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getRatings", null, fillRatings, "Fehler keine Bewertungsdaten",true);
});
$("#usersums_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=reports&command=getUsersums", null, fillUsersums, "Fehler keine Kassenbestände",true);
});
$("#table_reports_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
doAjax("GET", "php/contenthandler.php?module=queue&command=getAllTableRecords", null, fillTableRecords, "Fehler keine Tischprotokolle");
doAjax("GET", "php/contenthandler.php?module=queue&command=getAllTableRecords", null, fillTableRecords, "Fehler keine Tischprotokolle",true);
});
$("#order_reports_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
requestAllOrders();
@ -186,6 +193,54 @@ function setLanguage(language) {
});
}
function fillUsersums(answer) {
if (answer.status == "OK") {
var htmlTable = createTableWithData(answer.msg,REP_USER[lang],"center",15,10,75);
$("#content_usersums_section").html(htmlTable);
}
}
function fillToday(answer) {
if (answer.status == "OK") {
var htmlTable = createTableWithData(answer.msg,REP_HOUR[lang],"center",10,10,80);
$("#content_today_section").html(htmlTable);
}
}
function fillYesterday(answer) {
if (answer.status == "OK") {
var htmlTable = createTableWithData(answer.msg,REP_HOUR[lang],"center",10,10,80);
$("#content_yesterday_section").html(htmlTable);
}
}
function fillThismonth(answer) {
if (answer.status == "OK") {
var htmlTable = createTableWithData(answer.msg,REP_DAY[lang],"center",10,10,80);
$("#content_thismonth_section").html(htmlTable);
}
}
function fillLastmonth(answer) {
if (answer.status == "OK") {
var htmlTable = createTableWithData(answer.msg,REP_DAY[lang],"center",10,10,80);
$("#content_lastmonth_section").html(htmlTable);
}
}
function fillProds(answer) {
if (answer.status == "OK") {
var htmlTable = createTableWithData(answer.msg,REP_PROD[lang],"left",30,10,60);
$("#content_prods_section").html(htmlTable);
}
}
function fillRatings(answer) {
if (answer.status == "OK") {
var htmlPart = createRatingsPartCore(answer.msg,REP_DAY[lang],10,10,40,40);
$("#content_ratings_section").html(htmlPart);
}
}
function bindUpdateBtns() {
$("#updateordersbtn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
@ -195,7 +250,7 @@ function setLanguage(language) {
}
function requestAllOrders() {
doAjax("GET", "php/contenthandler.php?module=queue&command=getAllOrders", null, fillOrdersArea, "Fehler keine Bestellprotokolle");
doAjax("GET", "php/contenthandler.php?module=queue&command=getAllOrders", null, fillOrdersArea, "Fehler keine Bestellprotokolle",true);
}
function bindSelBoxChange() {
@ -358,12 +413,8 @@ function setLanguage(language) {
return goodTxt + okTxt + badTxt;
}
function fillRatingsPart(ratingReport,iterObjName,width1,width2,width3,width4) {
var ratings = ratingReport.statistics;
var collapse_elem = '<div data-role="collapsible" data-content-theme="e" data-collapsed="true" data-theme="c">';
var header = '<h3>'+REP_RATINGS[lang] + '</h3><p>' + REP_RATINFO[lang] + '</p><p>';
function createRatingsPartCore(ratingReport,iterObjName,width1,width2,width3,width4) {
var ratings = ratingReport.statistics;
var legend = getLegend(REP_GOOD[lang],REP_OK[lang],REP_BAD[lang]) + "</p><p>";
var content = "<table width=100% class='reporttable'>";
@ -389,14 +440,14 @@ function setLanguage(language) {
content += "<i>" + aRemark.date + "</i>: " + aRemark.remark + "<br>";
}
}
var html = collapse_elem + header + legend + content + "</p></div>";
var html = legend + content + "</p></div>";
return html;
}
}
function createStub(id,aName,infoText,additionalFirstElement,additionalLastEl) {
var collapse_elem = '<div id="' + id + '" data-role="collapsible" data-content-theme="e" data-collapsed="true" data-theme="c">';
var header = '<h3>'+aName + '</h3><p><i>' + infoText + '</i></p><p>';
var header = '<h3><span id="header_' + id + '">'+aName + '</span></h3><p><i>' + infoText + '</i></p><p>';
var content = additionalFirstElement + '<div id="content_' + id + '">';
content += '<p /><img id="progressimginpopup" src="php/3rdparty/images/ajax-loader.gif" /></div>';
@ -405,10 +456,8 @@ function setLanguage(language) {
return html;
}
function fillOnePart(aName,values,iterObjName,infoText,iterAlignment,width1,width2,width3) {
var collapse_elem = '<div data-role="collapsible" data-content-theme="e" data-collapsed="true" data-theme="c">';
var header = '<h3>'+aName + '</h3><p>' + infoText + '</p><p>';
function createTableWithData(values,iterObjName,iterAlignment,width1,width2,width3) {
var maxValue = values.max;
var content = REP_NO_DATA[lang];
if (maxValue != 0.0) {
@ -428,11 +477,8 @@ function setLanguage(language) {
content += "</table>";
}
var html = collapse_elem + header + content + "</p></div>";
return html;
}
return content;
}
function aTableHeader(val1,val2,val3,width1,width2,width3) {
var text = "<tr><th width=" + width1 + "%>" + val1 + "<th width=" + width2 + "%>" + val2 + "<th width=" + width3 + "%>" + val3;
@ -459,7 +505,7 @@ function setLanguage(language) {
currency = values.currency;
$("#info-page").data("decpoint",values.decpoint);
setLanguage(values.userlanguage);
getStats();
fillPageWithStats();
} else {
setTimeout(function(){document.location.href = "index.html"},250); // not logged in
}

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -14,7 +14,7 @@
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="elements/tablemap.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<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>
@ -623,7 +623,7 @@ function bindCancelButtn() {
var year = date.getFullYear();
var dateStr = year + "-" + month + "-" + day;
setTimeout(function(){document.location.href = "reservation.html?v=1.5.27&date=" + dateStr;},500);
setTimeout(function(){document.location.href = "reservation.html?v=1.5.28&date=" + dateStr;},500);
});
}

View File

@ -14,7 +14,7 @@
<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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
</head>
<body>
@ -30,7 +30,7 @@ var SUM_REASON = ["Grund","Reason","Razó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 nextpage = "paydesk.html?version=1.5.27";
var nextpage = "paydesk.html?version=1.5.28";
var lang;
@ -84,10 +84,10 @@ function setLanguage(language) {
if (nextPage == "p") {
$("#nextpagebtntxt").html(SUM_TO_PAYMENT[lang]);
nextpage = "paydesk.html?t=" + tableid + "&version=1.5.27";
nextpage = "paydesk.html?t=" + tableid + "&version=1.5.28";
} else {
$("#nextpagebtntxt").html(SUM_TO_ORDER[lang]);
nextpage = "waiter.html?version=1.5.27";
nextpage = "waiter.html?version=1.5.28";
}
var txt = "<table class='viewtable'>";

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,7 +13,7 @@
<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.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<style>
#tableWithPreparedProds,#tableWithDeliveredEntries,#headertableToCook

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.27"></script>
<script src="utilities.js?v=1.5.28"></script>
<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>

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.5.27">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.28">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.mobile-1.4.5.min.js"></script>
<script src="utilities.js"></script>
<script src="utilities.js?v=1.5.28"></script>
<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>

File diff suppressed because one or more lines are too long