ordersprinter/reports.html

123 lines
4.8 KiB
HTML

<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=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/bestformat.css">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="php/3rdparty/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>
</head>
<body>
<script>
function getStats() {
doAjax("GET","php/contenthandler.php?module=reports&command=getStats",null,fillPageWithStats,"Statistikreportzs nicht erhalten");
}
function fillPageWithStats(jsonText) {
var htmlToday = fillOnePart("Heute",jsonText.today,"Uhrzeit",
"Diese Übersicht umfasst alle Kassenbons, die bisher heute gedruckt wurden.",
"center",10,10,80);
var htmlYesterday = fillOnePart("Gestern",jsonText.yesterday,"Uhrzeit",
"Diese Übersicht umfasst die gestrigen Einnahmen, die in Tageslosungen erfasst wurden.",
"center",10,10,80);
// thismonth
var htmlThisMonth = fillOnePart(jsonText.thismonthname,jsonText.thismonth,"Tag",
"Diese Übersicht umfasst alle Einnahmen dieses Monats, die in Tageslosungen erfasst sind. ",
"center",10,10,80);
var htmlLastMonth = fillOnePart(jsonText.lastmonthname,jsonText.lastmonth,"Tag",
"Diese Übersicht umfasst Einnahmen des letzten Monats.",
"center",10,10,80);
var htmlProds = fillOnePart("Produktstatistik",jsonText.prodsums,"Produkt",
"Diese Übersicht zeigt die Einnahmen, die mit den in den letzten 30 Tagen verkauften"
+ " Produkten erzielt wurden.",
"left",30,10,60);
$("#content").html(htmlToday + htmlYesterday + htmlThisMonth + htmlLastMonth + htmlProds);
$("#content").trigger("create");
}
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>';
var maxValue = values.max;
var content = "Es liegen keine Daten vor.";
if (maxValue != 0.0) {
var content = "<table width=100% class='reporttable'>";
content += aTableHeader(iterObjName,"Summe","Graph",width1,width2,width3);
var contentValues = values.content;
// fill content
$.each(contentValues, function (i, aStatValue) {
var hourOrDay = aStatValue.iter;
var sum = aStatValue.sum;
content += aTableLine(hourOrDay,sum.toString().replace(".",","),sum/maxValue*98.0,iterAlignment,
width1,width2,width3);
});
content += "</table>";
}
var html = collapse_elem + header + content + "</p></div>";
return html;
}
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 aTableLine(val1,val2,porcent,iterAlignment,width1,width2,width3) {
var text = "<tr><td width=" + width1 + "% style='text-align:" + iterAlignment + ";'>" + val1 + "<td width=" + width2 + "% style='text-align:right;'>" + val2;
text += "<td width=" + width3 + "%><img src=img/green.png width=" + porcent + "% height=20px />";
return text;
}
$(document).on("pageinit", "#info-page", function () {
initializeMainMenu("#modulemenu");
hideMenu();
getStats();
});
</script>
<div data-role="page" id="info-page">
<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">
<li data-role="list-divider" data-theme="b" data-role="heading">Module</li>
</ul>
</div><!-- /panel -->
<div data-role="header" data-theme="b" data-position="fixed" id="theheader">
<h1>Statistik</h1>
<div data-type="horizontal" style="top:0px;position:absolute;float:right;z-index:10;display:inline;" align="right" class="ui-btn-right">
<a href="#" data-role="button" data-icon="arrow-d" data-ajax="false" id="menuswitch">Module</a>
</div>
</div>
<div data-role="content" id="content">
<h3>Kein Inhalt</h3>
</div>
<div data-role="footer" data-theme="b" id="thefooterr">
<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>
</html>