ordersprinter/webapp/reports.html

547 lines
23 KiB
HTML
Raw Normal View History

2020-11-19 22:47:44 +01:00
<html>
<head>
<title>Ansicht Statistik</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
2020-11-19 22:48:24 +01:00
<meta name="author" content="Stefan Pichel">
2020-11-19 22:47:44 +01:00
2020-11-19 23:12:48 +01:00
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.29">
2020-11-19 23:02:42 +01:00
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
2020-11-19 22:47:44 +01:00
<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>
2020-11-19 23:12:48 +01:00
<script src="utilities.js?v=1.5.29"></script>
2020-11-19 22:47:44 +01:00
<script src="elements/rating.js"></script>
</head>
<body>
<script>
2020-11-19 22:51:21 +01:00
var REP_USERSUM = ["Kassenbestände ","Open paydesks", "Cajas" ];
2020-11-19 23:12:13 +01:00
var REP_TABLE_REPORTS = ["Tischprotokolle","Table reports","Records of tables","Historia de las mesas"];
var REP_TABLE_REPORTS_INFO = ["In diesem Bereich werden alle Buchungen, Umbuchungen und Stornierungen für alle Tische seit der letzten Tageserfassung angezeigt.",
"This area displays all postings, transfers, and cancellations for all tables since the last closing.",
"Esta área visualiza todas las contabilizaciones, traslados y anulaciones de todas las tablas desde la última cerra de día."];
2020-11-19 23:12:30 +01:00
var REP_ORDER_REPORTS = ["Aktuelle Bestellungen","Current orders","Ordenes de momento"];
2020-11-19 23:12:48 +01:00
var REP_ORDER_REPORTS_INFO = ["In diesem Bereich werden alle Bestellungen seit der letzten Tageserfassung aufgeführt. Auf Gäste ausgestellt Rechnungen werden unabh. von ihrem Bezahlstatus als bezahlt betrachtet.","In this area yu can see all orders since the last closing.","En esta area puede ver todas las ordenes desde la última cerrada"];
2020-11-19 22:51:21 +01:00
var REP_USER = ["Benutzer","User","Usario"];
2020-11-19 23:12:48 +01:00
var REP_USER_TXT = ["Diese Übersicht umfasst den derzeitigen Brutto-Kassenbestand pro Kasse inkl. aller Zahlungswege und Ein-/Auslagen. Auf Gäste ausgestellt Rechnungen werden unabh. von ihrem Bezahlstatus eingerechnet.",
"This overview contains the current sum of all paydesks including all payment types and cash inserts/extracs and guest bills.",
2020-11-19 22:51:21 +01:00
"Esta table contiene todos las cajas incluyendo todas los tipos the pagamientos"];
2020-11-19 22:47:44 +01:00
var REP_TODAY = ["Heute","Today","Hoy"];
var REP_YESTERDAY = ["Gestern","Yesterday","Ayer"];
var REP_HOUR = ["Uhrzeit","Time","Hora"];
var REP_DAY = ["Tag","Day","Día"];
var REP_PROD = ["Produkt","Product","Producto"];
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."];
2020-11-19 23:12:46 +01:00
var REP_YEST_TXT = ["Diese Übersicht umfasst die gestrigen Einnahmen, die in Tagesabschlüssen erfasst wurden.",
2020-11-19 22:47:44 +01:00
"This overview shows all revenues of yesterday that are part of a closing.",
"Este parte muestra todo el cobro de tiques cerrados de ayer."];
2020-11-19 23:12:46 +01:00
var REP_THIS_MONTH_TXT = ["Diese Übersicht umfasst alle Einnahmen dieses Monats, die in Tagesabschlüssen erfasst sind.",
2020-11-19 22:47:44 +01:00
"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.",
"This overview shows all revenues of the last month.",
"Este parte muestra todo el cobro del mes pasado."];
var REP_PROD_LAST30_TXT = ["Diese Übersicht zeigt die Einnahmen, die mit den in den letzten 30 Tagen verkauften Produkten erzielt wurden.",
"This overview displays the revenue that could be achieved with all sold products in the last 30 days.",
"Este parte muestra el cobro con el productos vendido en los últimos 30 días."];
var REP_NO_DATA = ["Es liegen keine Daten vor.", "There is no data.", "No hay ningún datos."];
var REP_PRODREP = ["Produktstatistik","Product report","Estadistica de productos"];
var REP_TITLE = ["Statistik","Statistics","Estadisticas"];
var REP_RATINGS = ["Bewertungen","Ratings","Valoraciones"];
var REP_RATINFO = ["Übersicht der Bewertung der letzten 30 Tage","Overview of all ratings in the last 30 days","Valoraciones de los últimos 30 dias"];
var REP_SERVICE = ["Bedienung und Service","Service","Servicio"];
var REP_KITCHEN = ["Küche","Kitchen","Cocina"];
var REP_GOOD = ["Zufriedener Kunde","Customer is happy","Cliente esta contento"];
var REP_OK = ["Passabel","ok","Pues..."];
var REP_BAD = ["Kunde ist unzufrieden","Customer is not satisfied","Cliente no esta contento"];
var REP_COUNT = ["Anzahl","Number","Número"];
var REP_REMARKS = ["Kundenmeinungen","Customer remarks","Notas de los clientes"];
2020-11-19 23:12:13 +01:00
var REP_RECORD_ACTION = [
["Bestellung","Ordering","Ordenar"],
["Rechnung","Bill","Pagar"],
["Produktstorno","Discard product","Descartar producto"],
["Rechnungsstorno","Discard bill","Descartar pago"],
["Rechnungs- und Produktstorno","Discard bill and product","Descrtar pago y producto"],
["Tischwechsel Produktentfernung","Move products to other table","Productos a otra mesa"],
["Tischwechsel Produktbuchung","Received moved products","Recibo productos de otra mesa"]
];
var REP_NO_ENTRIES = ["Keine Einträge","No entries","Ningún data"];
2020-11-19 22:47:44 +01:00
var lang = 0;
2020-11-19 23:12:30 +01:00
var allorders = [];
var filterOnlyUnpaidOrdersSelection = 0;
var filterCancelledOrders = 0;
var currency = "";
2020-11-19 22:47:44 +01:00
function setLanguage(language) {
lang = language;
$("#reportttitletxt").html(REP_TITLE[lang]);
}
2020-11-19 23:12:46 +01:00
function fillPageWithStats() {
2020-11-19 23:12:30 +01:00
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>";
2020-11-19 23:12:46 +01:00
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],"","");
2020-11-19 23:12:30 +01:00
var htmlOrderReports = createStub("order_reports_section",REP_ORDER_REPORTS[lang],REP_ORDER_REPORTS_INFO[lang],search + selBoxForOrdersPaid + selBoxForOrdersCancelled,updateBtn);
2020-11-19 22:51:21 +01:00
2020-11-19 23:12:46 +01:00
$("#content").html(htmlTodaySums + htmlYesterdaySums + htmlThismonthSums + htmlLastmonthSums + htmlProdSums + htmlRatingSums + htmlUsersums + htmlTableReports + htmlOrderReports);
2020-11-19 22:47:44 +01:00
$("#content").trigger("create");
2020-11-19 23:12:30 +01:00
bindExpandAreas();
bindUpdateBtns();
bindSelBoxChange();
2020-11-19 23:12:46 +01:00
requestMonthNamesAndInsert();
2020-11-19 22:47:44 +01:00
}
2020-11-19 23:12:13 +01:00
2020-11-19 23:12:30 +01:00
function createSelBoxForOrderFilter() {
var sel = "<select data-theme='f' id='showOnlyUnpaidOrders'>";
if (filterOnlyUnpaidOrdersSelection == 0) {
sel += "<option value='0' selected>Nur unbezahlte Bestellungen</option>";
} else {
sel += "<option value='0'>Nur unbezahlte Bestellungen</option>";
}
if (filterOnlyUnpaidOrdersSelection == 1) {
sel += "<option value='1' selected>Alle Bestellungen</option>";
} else {
sel += "<option value='1'>Alle Bestellungen</option>";
}
sel += "</select>";
return sel;
}
function createSelBoxForCancelledFilter() {
var sel = "<select data-theme='f' id='filterForCancelledOrders'>";
if (filterCancelledOrders == 0) {
sel += "<option value='0' selected>Stornostatus ignorieren</option>";
} else {
sel += "<option value='0'>Stornostatus ignorieren</option>";
}
if (filterCancelledOrders == 1) {
sel += "<option value='1' selected>Nur unstornierte Produkte</option>";
} else {
sel += "<option value='1'>Nur unstornierte Produkte</option>";
}
if (filterCancelledOrders == 2) {
sel += "<option value='2' selected>Nur stornierte Produkte</option>";
} else {
sel += "<option value='2'>Nur stornierte Produkte</option>";
}
sel += "</select>";
return sel;
}
2020-11-19 23:12:46 +01:00
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);
};
}
2020-11-19 23:12:30 +01:00
function bindExpandAreas() {
2020-11-19 23:12:46 +01:00
$("#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);
});
2020-11-19 23:12:13 +01:00
$("#table_reports_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
2020-11-19 23:12:46 +01:00
doAjax("GET", "php/contenthandler.php?module=queue&command=getAllTableRecords", null, fillTableRecords, "Fehler keine Tischprotokolle",true);
2020-11-19 23:12:13 +01:00
});
2020-11-19 23:12:30 +01:00
$("#order_reports_section").off("collapsibleexpand").on("collapsibleexpand", function (e) {
requestAllOrders();
});
$("#searchfieldorders").off("keyup").on("keyup", function (e) {
displayAllOrdersDueToFilter();
});
}
2020-11-19 23:12:46 +01:00
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);
}
}
2020-11-19 23:12:30 +01:00
function bindUpdateBtns() {
$("#updateordersbtn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
requestAllOrders();
});
}
function requestAllOrders() {
2020-11-19 23:12:46 +01:00
doAjax("GET", "php/contenthandler.php?module=queue&command=getAllOrders", null, fillOrdersArea, "Fehler keine Bestellprotokolle",true);
2020-11-19 23:12:30 +01:00
}
function bindSelBoxChange() {
$("#showOnlyUnpaidOrders").off("change").on("change", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
filterOnlyUnpaidOrdersSelection = $("#showOnlyUnpaidOrders").val();
$("#selBoxForOrdersFilter").html(createSelBoxForOrderFilter());
$("#selBoxForOrdersFilter").trigger("create");
displayAllOrdersDueToFilter();
bindSelBoxChange();
});
// filterCancelledOrders
$("#filterForCancelledOrders").off("change").on("change", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
filterCancelledOrders = $("#filterForCancelledOrders").val();
$("#selBoxForOrdersCancelled").html(createSelBoxForCancelledFilter());
$("#selBoxForOrdersCancelled").trigger("create");
displayAllOrdersDueToFilter();
bindSelBoxChange();
});
}
function fillOrdersArea(answer) {
if (answer.status == "OK") {
allorders = answer.msg;
displayAllOrdersDueToFilter();
}
}
function displayAllOrdersDueToFilter() {
var decpoint = $("#info-page").data("decpoint");
var filterText = $("#searchfieldorders").val().trim().toLowerCase();
var txt = "<table class='reporttable'>";
txt += "<tr><th>Anzahl<th>Produkt<th>Information</tr>";
allorders.list.forEach(function(entry) {
var countid = toHtml(entry.countid);
var productname = toHtml(entry.productname);
var ordertime = toHtml(entry.ordertime);
var username = toHtml(entry.username);
var ispaid = entry.ispaid;
var tablename = toHtml(entry.tablename);
var toremove = entry.toremove;
var price = toHtml(entry.price);
var priceStr = price.replace(".",decpoint) + " " + currency;
var show = true;
if (filterText != "") {
if ((productname.toLowerCase().indexOf(filterText) == -1) &&
(username.toLowerCase().indexOf(filterText) == -1) &&
(tablename.toLowerCase().indexOf(filterText) == -1)) {
show = false;
}
}
if ((filterOnlyUnpaidOrdersSelection == 0) && (ispaid == 1)) {
show = false;
}
if ((filterCancelledOrders == 1) && (toremove == 1)) {
show = false;
}
if ((filterCancelledOrders == 2) && (toremove == 0)) {
show = false;
}
if (show) {
txt += '<tr><td>' + countid + "<td>" + productname + "<td>";
txt += ordertime + "<br>";
txt += username + "<br>";
txt += priceStr + "<br>";
txt += (ispaid == 1 ? "bezahlt<br>" : "noch unbezahlt<br>");
txt += tablename;
if (toremove == 1) {
txt += "<br>(storniert)";
}
txt += "</tr>";
}
});
txt += "</table>";
var sumall = allorders.sumall.replace(".",decpoint) + " " + currency;
var sumunpaid = allorders.sumunpaid.replace(".",decpoint) + " " + currency;
var sumpaid = allorders.sumpaid.replace(".",decpoint) + " " + currency;
var sumcancelled = allorders.sumcancelled.replace(".",decpoint) + " " + currency;
txt += "<p><table class='reporttable'>";
txt += "<tr><th>Summe<th>Betrag</tr>";
txt += "<tr><td>Unbezahlt<td>" + sumunpaid + "</tr>";
txt += "<tr><td>Bezahlt<td>" + sumpaid + "</tr>";
txt += "<tr><td>Bezahlt und unbezahlt<td>" + sumall + "</tr>";
txt += "<tr><td>Stornierungen<td>" + sumcancelled + "</tr>";
txt += "</table>";
$("#content_order_reports_section").html(txt);
2020-11-19 23:12:13 +01:00
}
function fillTableRecords(answer) {
if (answer.status == "OK") {
var txt = "";
var rooms = answer.msg;
$.each(rooms, function (i, aRoom) {
var roomname = toHtml(aRoom["roomname"]);
var tables = aRoom["tables"];
var tablesTxt = "";
$.each(tables, function (j, aTable) {
var tablename = toHtml(aTable["tablename"]);
var tablesRecordTxt = recordsOfTableAsTxt(aTable["records"]);
tablesTxt += "<h2>" + tablename + "</h2>" + tablesRecordTxt;
});
txt += "<h1>" + roomname + "<h1>";
txt += tablesTxt;
txt += "<hr>";
});
$("#content_table_reports_section").html(txt);
}
}
2020-11-19 22:47:44 +01:00
2020-11-19 23:12:13 +01:00
function recordsOfTableAsTxt(answer) {
var txt = "";
if (answer.status == "OK") {
var entries = answer.msg;
if (entries.length == 0) {
txt += REP_NO_ENTRIES[lang];
return txt;
}
txt += "<ul>";
entries.forEach(function(entry, index) {
var time = toHtml(entry.time);
var username = toHtml(entry.username);
var action = toHtml(entry.action);
var actionStr = REP_RECORD_ACTION[action][lang];
txt += "<li>" + time + " " + username + " - <b>" + actionStr + "</b>:<br>";
var prods = entry.prods;
txt += "<ul>";
prods.forEach(function(prod,i) {
var name = toHtml(prod.name);
var extras = toHtml(prod.extras);
txt += "<li>" + name;
if (extras != "") {
txt += " (" + extras + ")";
}
});
txt += "</ul>";
});
txt += "</ul>";
}
return txt;
}
2020-11-19 22:47:44 +01:00
function getLegend (good,ok,bad) {
var goodTxt = "<img src=img/green.png style='height:20px;width:40px;' />: " + good + "<br>";
var okTxt = "<img src=img/yellow.png style='height:20px;width:40px;' />: " + ok + "<br>";
var badTxt = "<img src=img/red.png style='height:20px;width:40px;' />: " + bad + "<br>";
return goodTxt + okTxt + badTxt;
}
2020-11-19 23:12:46 +01:00
function createRatingsPartCore(ratingReport,iterObjName,width1,width2,width3,width4) {
var ratings = ratingReport.statistics;
2020-11-19 22:47:44 +01:00
var legend = getLegend(REP_GOOD[lang],REP_OK[lang],REP_BAD[lang]) + "</p><p>";
var content = "<table width=100% class='reporttable'>";
content += aTableRatingHeader(iterObjName,REP_COUNT[lang],REP_SERVICE[lang],REP_KITCHEN[lang],width1,width2,width3,width4);
var i=0;
for (i=0;i<ratings.length;i++) {
var aRating = ratings[i];
var aRatingEl = new Rating(aRating.day,aRating.service,aRating.kitchen,aRating.total);
content += "<tr><td style='text-align:center;'>" + aRating.day
+ "<td style='text-align:center;'>" + aRatingEl.getTotal()
+ "<td>" + aRatingEl.getServiceInfo() + "<td>" + aRatingEl.getKitchenInfo() + "</tr>";
}
content += "</table>";
var remarks = ratingReport.remarks;
if (remarks.length > 0) {
content += "</p><p><b>" + REP_REMARKS[lang] + "</b><br>";
var i=0;
for (i=0;i<remarks.length;i++) {
var aRemark = remarks[i];
content += "<i>" + aRemark.date + "</i>: " + aRemark.remark + "<br>";
}
}
2020-11-19 23:12:46 +01:00
var html = legend + content + "</p></div>";
2020-11-19 22:47:44 +01:00
return html;
2020-11-19 23:12:46 +01:00
}
2020-11-19 22:47:44 +01:00
2020-11-19 23:12:30 +01:00
function createStub(id,aName,infoText,additionalFirstElement,additionalLastEl) {
2020-11-19 23:12:13 +01:00
var collapse_elem = '<div id="' + id + '" data-role="collapsible" data-content-theme="e" data-collapsed="true" data-theme="c">';
2020-11-19 23:12:46 +01:00
var header = '<h3><span id="header_' + id + '">'+aName + '</span></h3><p><i>' + infoText + '</i></p><p>';
2020-11-19 23:12:30 +01:00
var content = additionalFirstElement + '<div id="content_' + id + '">';
content += '<p /><img id="progressimginpopup" src="php/3rdparty/images/ajax-loader.gif" /></div>';
2020-11-19 23:12:13 +01:00
2020-11-19 23:12:30 +01:00
var html = collapse_elem + header + content + additionalLastEl + "</p></div>";
2020-11-19 23:12:13 +01:00
return html;
}
2020-11-19 23:12:46 +01:00
function createTableWithData(values,iterObjName,iterAlignment,width1,width2,width3) {
2020-11-19 22:47:44 +01:00
var maxValue = values.max;
var content = REP_NO_DATA[lang];
if (maxValue != 0.0) {
var content = "<table width=100% class='reporttable'>";
content += aTableHeader(iterObjName,REP_SUM[lang],"Graph",width1,width2,width3);
var contentValues = values.content;
var decpoint = $("#info-page").data("decpoint");
$.each(contentValues, function (i, aStatValue) {
var hourOrDay = aStatValue.iter;
2020-11-19 22:51:21 +01:00
2020-11-19 22:47:44 +01:00
var sum = aStatValue.sum;
content += aTableLine(hourOrDay,sum.toString().replace(".",decpoint),sum/maxValue*98.0,iterAlignment,
width1,width2,width3);
});
content += "</table>";
}
2020-11-19 23:12:46 +01:00
return content;
}
2020-11-19 22:47:44 +01:00
function aTableHeader(val1,val2,val3,width1,width2,width3) {
var text = "<tr><th width=" + width1 + "%>" + val1 + "<th width=" + width2 + "%>" + val2 + "<th width=" + width3 + "%>" + val3;
return text;
}
function aTableRatingHeader(val1,val2,val3,val4,width1,width2,width3,width4) {
var text = "<tr><th width=" + width1 + "%>" + val1 + "<th width=" + width2 + "%>" + val2 + "<th width=" + width3 + "%>" + val3 + "<th width=" + width4 + "%>" + val4;
return text;
}
function aTableLine(val1,val2,porcent,iterAlignment,width1,width2,width3) {
var text = "<tr><td width=" + width1 + "% style='text-align:" + iterAlignment + ";'>" + toHtml(val1) + "<td width=" + width2 + "% style='text-align:right;'>" + val2;
text += "<td width=" + width3 + "%><img src=img/green.png width=" + porcent + "% height=20px />";
return text;
}
function getGeneralConfigItems() {
doAjax("GET", "php/contenthandler.php?module=admin&command=getGeneralConfigItems", null, insertDecPointStartRest, "Fehler Konfigurationsdaten");
}
function insertDecPointStartRest(configResult) {
if (configResult.status == "OK") {
var values = configResult.msg;
var decpoint = values.decpoint;
2020-11-19 23:12:30 +01:00
currency = values.currency;
2020-11-19 22:47:44 +01:00
$("#info-page").data("decpoint",values.decpoint);
setLanguage(values.userlanguage);
2020-11-19 23:12:46 +01:00
fillPageWithStats();
2020-11-19 22:47:44 +01:00
} else {
setTimeout(function(){document.location.href = "index.html"},250); // not logged in
}
}
$(document).on("pageinit", "#info-page", function () {
initializeMainMenu("#modulemenu");
hideMenu();
getGeneralConfigItems();
});
</script>
2020-11-19 23:11:29 +01:00
<div data-role="page" id="info-page" data-theme="c">
2020-11-19 22:47:44 +01:00
<div data-role="panel" id="modulepanel" data-position="right" data-display="overlay">
<ul data-role="listview" id="modulemenu" data-divider-theme="a" data-inset="true">
2020-11-19 23:02:16 +01:00
<li data-role="list-divider" data-theme="b" data-role="heading">Hauptmenü</li>
2020-11-19 22:47:44 +01:00
</ul>
</div><!-- /panel -->
2020-11-19 23:11:29 +01:00
<div data-role="header" data-theme="b" data-position="fixed" id="theheader" style="background-color:black;">
2020-11-19 23:11:33 +01:00
<h1><span id="reportttitletxt">Statistik</span> <img src="img/connection.png" class="connectionstatus" style="display:none;" /> <img src="img/printerstatus.png" class="printerstatus" style="display:none;" /> <img src="img/tasksstatus.png" class="tasksstatus" style="display:none;" /></h1>
2020-11-19 22:47:44 +01:00
<div data-type="horizontal" style="top:0px;position:absolute;float:right;z-index:10;display:inline;" align="right" class="ui-btn-right">
2020-11-19 23:02:16 +01:00
<a href="#" data-role="button" data-icon="arrow-d" data-ajax="false" id="menuswitch">Hauptmenü</a>
2020-11-19 22:47:44 +01:00
</div>
</div>
<div data-role="content" id="content">
<h3>Kein Inhalt</h3>
</div>
2020-11-19 23:11:29 +01:00
<div data-role="footer" data-theme="b" id="thefooterr" style="background-color:black;">
2020-11-19 22:47:44 +01:00
<div class="ui-grid-a">
<div class="ui-block-a userinfo" id="loggedinuser"></div>
<div class="ui-block-b grid_right" id="versioninfo"></div>
</div><!-- /grid-a -->
</div> <!-- footer -->
</div>
</body>
2020-11-19 22:58:39 +01:00
</html>