ordersprinter/webapp/pickups.html

177 lines
5.9 KiB
HTML
Raw Normal View History

2020-11-19 23:11:52 +01:00
<html>
<head>
<title>Ansicht Abholung</title>
<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">
2020-11-19 23:11:57 +01:00
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.10">
2020-11-19 23:11:52 +01:00
<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-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
2020-11-19 23:11:57 +01:00
<script src="utilities.js?v=1.5.10"></script>
2020-11-19 23:11:52 +01:00
<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>
</head>
<body>
<script>
var PICK_PICKUP_TITLE = ["Abholung","Pickup","Recogido"];
var PICK_INCOMPLETE_TITLE = ["In Arbeit","In progress","Procesando"];
var PICK_COMPLETE_TITLE = ["Abholbereit","Finished","Completado"];
var lang = 0;
var modus = 0;
function setLanguage(language) {
lang = language;
$("#timetitletxt").html(PICK_PICKUP_TITLE[lang]);
$("#incompletetitle").html(PICK_INCOMPLETE_TITLE[lang]);
$("#completetitle").html(PICK_COMPLETE_TITLE[lang]);
}
function getGeneralConfigItems() {
doAjax("GET", "php/contenthandler.php?module=admin&command=getGeneralConfigItemsAndUsers", null, insertGenConfigStartRest, "Fehler Konfigurationsdaten");
}
function insertGenConfigStartRest(configResult) {
if (configResult.status == "OK") {
var values = configResult.msg;
setLanguage(values.userlanguage);
requestModus();
} else {
setTimeout(function(){document.location.href = "index.html";},250); // not logged in
}
}
function requestModus() {
doAjax("GET", "php/contenthandler.php?module=pickup&command=getmodus", null, insertModus, "Fehler Modus");
}
function insertModus(answer) {
if (answer.status == "OK") {
modus = answer.msg;
if (modus == 2) {
$("#incompleteregion").show();
}
}
startUpdates();
}
function requestUpdateFromServer() {
doAjax("GET", "php/contenthandler.php?module=pickup&command=getjobs", null, insertJobs, null);
}
function insertJobs(answer) {
if (answer.status != "OK") {
return;
}
var completes = createItems(answer.msg.completes,"pickupitemcomplete");
$("#completeitemarea").html(completes);
if (modus == 2) {
var txt = createItems(answer.msg.incompletes,"pickupitemincomplete");
$("#incompleteitemarea").html(txt);
binding();
}
}
function createItems(numbers,theclass) {
var txt = "";
for (var i=0;i<numbers.length;i++) {
var item = numbers[i];
var id = item.id;
var workid = item.workid;
txt += createItem("item_" + id,workid,100,70,theclass);
}
return txt;
}
function startUpdates() {
requestUpdateFromServer();
var refreshId = setInterval(function() {
requestUpdateFromServer();
}, 5000);
$.ajaxSetup({ cache: false });
}
function createItem(id,title,sizew, sizeh, itemclass) {
var txt = "";
txt += "<div id='" + id + "' class='" + itemclass + " pickitemfont' style='width:" + sizew + "px;height:" + sizeh + "px;'>" + title + "</div>";
return txt;
}
function binding() {
$(".pickupitemincomplete").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
var id = this.id.split("_")[1];
doAjax("POST", "php/contenthandler.php?module=pickup&command=declarepickready", {id:id}, requestUpdateFromServer, null);
});
$(".pickupitemcomplete").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
var id = this.id.split("_")[1];
doAjax("POST", "php/contenthandler.php?module=pickup&command=declarepicknotready", {id:id}, requestUpdateFromServer, null);
});
}
$(document).on("pageinit", "#time-page", function () {
initializeMainMenu("#modulemenu");
hideMenu();
$.ajaxSetup({ cache: false });
getGeneralConfigItems();
});
</script>
<div data-role="page" id="time-page" data-theme="c">
<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-theme="b" data-role="heading">Hauptmenü</li>
</ul>
</div><!-- /panel -->
<div data-role="header" data-theme="b" data-position="fixed" id="theheader" style="background-color:black;">
<h1><span id="timetitletxt">Abholung</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>
<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"><span id="modulstxt2">Hauptmenü</span></a>
</div>
</div>
<div data-role="content" id="fullcontent">
<div id="incompleteregion" class="pickuparea pickuparea_incomplete" style="display:none;">
<div><span id="incompletetitle" class="picksections">Unfertig</span></div>
<div id="incompleteitemarea" class="incompleteitemarea"></div>
</div>
<div class="pickuparea pickuparea_complete">
<div><span id="completetitle" class="picksections">Abholbereit</span></div>
<div id="completeitemarea" class="completeitemarea"></div>
</div>
</div>
<div data-role="footer" data-theme="b" id="thefooterr" style="background-color:black;">
<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> <!-- first page -->
</body>
</html>