OrderSprinter 1.1.2
This commit is contained in:
parent
cac002e113
commit
cc038395f0
Binary file not shown.
Binary file not shown.
|
@ -553,3 +553,9 @@ table.prodtable .prodpriceC {
|
|||
border: 0;
|
||||
background-color: rgb(246, 246, 246, 0.0) !important;
|
||||
}
|
||||
|
||||
.changetableprodlist {
|
||||
width:100%;
|
||||
background-color: LightCyan;
|
||||
resize: none;
|
||||
}
|
|
@ -679,7 +679,7 @@ $(document).ready(function() {
|
|||
<tr id=updateline>
|
||||
<td> </td>
|
||||
<td align=center>
|
||||
<button id="updatebtn">Update -> 1.1.1</button>
|
||||
<button id="updatebtn">Update -> 1.1.2</button>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
|
|
@ -561,6 +561,34 @@ return false;
|
|||
}
|
||||
}
|
||||
|
||||
function updateUserTable1101_1102($prefix) {
|
||||
$pdo = $this->pdo;
|
||||
try {
|
||||
$adminCl = new Admin();
|
||||
DbUtils::overrulePrefix($prefix);
|
||||
|
||||
$sql = "ALTER TABLE %queue% ADD isclosed INT(1) NULL AFTER workprinted";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute();
|
||||
|
||||
$sql = "select max(closingdate) as lastdate from %closing%";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute();
|
||||
$row = $stmt->fetchObject();
|
||||
$lastclosingdate = $row->lastdate;
|
||||
if (!is_null($lastclosingdate)) {
|
||||
$sql = "UPDATE %queue% SET isclosed=? WHERE ordertime <= ?";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array(1,$lastclosingdate));
|
||||
}
|
||||
|
||||
$this->updateVersion($pdo, '1.1.2');
|
||||
return true;
|
||||
} catch (PDOException $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function setVersion($prefix,$theVersion) {
|
||||
$pdo = $this->pdo;
|
||||
try {
|
||||
|
@ -632,7 +660,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
|
|||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'billlanguage', $billlanguage)");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'currency', '$currency')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'receiptfontsize', '12')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.1.1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.1.2')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'paymentconfig', '0')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'remoteaccesscode', null)");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')");
|
||||
|
@ -670,6 +698,23 @@ return null;
|
|||
}
|
||||
}
|
||||
|
||||
public function isTherePreviousVersion($db,$prefix) {
|
||||
try {
|
||||
$pdo = $this->pdo;
|
||||
$sql = "SELECT count(*) as thecount FROM information_schema.tables WHERE table_schema = '$db' AND table_name = '" . $prefix . "config' LIMIT 1";
|
||||
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute();
|
||||
$row = $stmt->fetchObject();
|
||||
if ($row->thecount == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function readConfigTableAndSendToHist($pdo) {
|
||||
$sql_query = "SELECT * FROM %config%";
|
||||
|
||||
|
@ -702,10 +747,10 @@ $right_manager,$right_reservation,$right_rating,$lang,$prefertablemap) {
|
|||
$md5adminpass = md5($adminpass);
|
||||
$pdo = $this->pdo;
|
||||
|
||||
$userInsertSql = "INSERT INTO `%user%` (`id` , `username` , `userpassword`, `is_admin`, `right_waiter`,`right_kitchen`,`right_bar`,`right_supply`,`right_paydesk`,`right_statistics`,`right_bill`,`right_products`,`right_changeprice`,`right_manager`,`right_reservation`,`right_rating`,`language`,`prefertablemap`,`active`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'1')";
|
||||
$userInsertSql = "INSERT INTO `%user%` (`id` , `username` , `userpassword`, `is_admin`, `right_waiter`,`right_kitchen`,`right_bar`,`right_supply`,`right_paydesk`,`right_statistics`,`right_bill`,`right_products`,`right_changeprice`,`right_manager`,`right_reservation`,`right_rating`,`language`,`prefertablemap`,`keeptypelevel`,`active`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'1')";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($userInsertSql));
|
||||
|
||||
$stmt->execute(array($username,$md5adminpass,$is_admin,$right_waiter,$right_kitchen,$right_bar,$right_supply,$right_paydesk,$right_statistics,$right_bill,$right_products,$right_changeprice,$right_manager,$right_reservation,$right_rating,$lang,$prefertablemap));
|
||||
$stmt->execute(array($username,$md5adminpass,$is_admin,$right_waiter,$right_kitchen,$right_bar,$right_supply,$right_paydesk,$right_statistics,$right_bill,$right_products,$right_changeprice,$right_manager,$right_reservation,$right_rating,$lang,$prefertablemap,1));
|
||||
|
||||
$newUserIdForHist = $pdo->lastInsertId();
|
||||
|
||||
|
@ -970,6 +1015,12 @@ $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_P
|
|||
$admin->setPdo($pdo);
|
||||
$admin->setPrefix($_POST['prefix']);
|
||||
|
||||
$isPreviousInstallation = $admin->isTherePreviousVersion($_POST['db'],$_POST['prefix']);
|
||||
if (!$isPreviousInstallation) {
|
||||
echo json_encode("Stimmt der Tabellenpräfix?");
|
||||
return;
|
||||
}
|
||||
|
||||
$version = $admin->getCurrentVersion();
|
||||
if (is_null($version)) {
|
||||
echo json_encode("Version nicht bestimmbar");
|
||||
|
@ -1006,6 +1057,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if ($version == "1.0.14") {
|
||||
$ret &= $admin->updateUserTable1014_1015();
|
||||
$ret &= $admin->updateUserTable1015_1016();
|
||||
|
@ -1034,6 +1086,7 @@ $ret &= $admin->updateUserTable1040_1041($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if ($version == "1.0.15") {
|
||||
$ret &= $admin->updateUserTable1015_1016();
|
||||
$ret &= $admin->updateUserTable1016_1017();
|
||||
|
@ -1062,6 +1115,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if ($version == "1.0.16") {
|
||||
$ret &= $admin->updateUserTable1016_1017();
|
||||
$ret &= $admin->updateUserTable1017_1018();
|
||||
|
@ -1089,6 +1143,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.17") || ($version == "1.0.18")) {
|
||||
$ret &= $admin->updateUserTable1018_1019();
|
||||
$ret &= $admin->updateUserTable1019_1020();
|
||||
|
@ -1115,6 +1170,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if ($version == "1.0.19") {
|
||||
$ret &= $admin->updateUserTable1019_1020();
|
||||
$ret &= $admin->updateUserTable1022_1023($_POST['prefix']);
|
||||
|
@ -1140,6 +1196,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.20") || ($version == "1.0.21")) {
|
||||
// nothing to do... :) (but maybe user has pressed though)
|
||||
} else if (($version == "1.0.22")) {
|
||||
|
@ -1166,6 +1223,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.23")) {
|
||||
$ret &= $admin->updateUserTable1023_1024($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1024_1025($_POST['prefix']);
|
||||
|
@ -1189,6 +1247,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.24")) {
|
||||
$ret &= $admin->updateUserTable1024_1025($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1025_1026($_POST['prefix']);
|
||||
|
@ -1211,6 +1270,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.25")) {
|
||||
$ret &= $admin->updateUserTable1025_1026($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1026_1027($_POST['prefix']);
|
||||
|
@ -1232,6 +1292,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.26")) {
|
||||
$ret &= $admin->updateUserTable1026_1027($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1027_1028($_POST['prefix']);
|
||||
|
@ -1252,6 +1313,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.27")) {
|
||||
$ret &= $admin->updateUserTable1027_1028($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1028_1029($_POST['prefix']);
|
||||
|
@ -1271,6 +1333,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.28")) {
|
||||
$ret &= $admin->updateUserTable1028_1029($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1029_1030($_POST['prefix']);
|
||||
|
@ -1289,6 +1352,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.29")) {
|
||||
$ret &= $admin->updateUserTable1029_1030($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1030_1031($_POST['prefix']);
|
||||
|
@ -1306,6 +1370,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.30")) {
|
||||
$ret &= $admin->updateUserTable1030_1031($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1031_1032($_POST['prefix']);
|
||||
|
@ -1322,6 +1387,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.31")) {
|
||||
$ret &= $admin->updateUserTable1031_1032($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1032_1033($_POST['prefix']);
|
||||
|
@ -1337,6 +1403,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.32")) {
|
||||
$ret &= $admin->updateUserTable1032_1033($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1033_1034($_POST['prefix']);
|
||||
|
@ -1351,6 +1418,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.33")) {
|
||||
$ret &= $admin->updateUserTable1033_1034($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1034_1035($_POST['prefix']);
|
||||
|
@ -1364,6 +1432,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.34")) {
|
||||
$ret &= $admin->updateUserTable1034_1035($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1035_1036($_POST['prefix']);
|
||||
|
@ -1376,6 +1445,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.35")) {
|
||||
$ret &= $admin->updateUserTable1035_1036($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1036_1037($_POST['prefix']);
|
||||
|
@ -1387,6 +1457,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.36")) {
|
||||
$ret &= $admin->updateUserTable1036_1037($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1037_1038($_POST['prefix']);
|
||||
|
@ -1397,6 +1468,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.37")) {
|
||||
$ret &= $admin->updateUserTable1037_1038($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1038_1039($_POST['prefix']);
|
||||
|
@ -1406,6 +1478,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.38")) {
|
||||
$ret &= $admin->updateUserTable1038_1039($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1039_1040($_POST['prefix']);
|
||||
|
@ -1414,6 +1487,7 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.39")) {
|
||||
$ret &= $admin->updateUserTable1039_1040($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1040_1041($_POST['prefix']);
|
||||
|
@ -1421,26 +1495,34 @@ $ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
|||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.40")) {
|
||||
$ret &= $admin->updateUserTable1040_1041($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.41")) {
|
||||
$ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.42")) {
|
||||
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.0.43")) {
|
||||
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.1.0")) {
|
||||
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else if (($version == "1.1.1")) {
|
||||
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
|
||||
} else {
|
||||
echo json_encode("Quellversion nicht unterstützt");
|
||||
return;
|
||||
|
|
|
@ -16,7 +16,7 @@ $pfeil_links = __DIR__. '/vorlagen/classic/pfeil-links.png';
|
|||
$pfeil_rechts = __DIR__. '/vorlagen/classic/pfeil-rechts.png';
|
||||
|
||||
|
||||
$pdo = DbUtils::openDbAndReturnPdo();
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
$header = Pager::readAndSubstituteFile($pdo,$headerFileTemplate);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ $footerFileTemplate = __DIR__. '/vorlagen/classic/footer.html';
|
|||
$contentTemplate = __DIR__. '/vorlage-impressum.txt';
|
||||
|
||||
|
||||
$pdo = DbUtils::openDbAndReturnPdo();
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
$header = Pager::readAndSubstituteFile($pdo,$headerFileTemplate);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ $headerFileTemplate = __DIR__. '/vorlagen/classic/header.html';
|
|||
$footerFileTemplate = __DIR__. '/vorlagen/classic/footer.html';
|
||||
$contentTemplate = __DIR__. '/vorlage-startseite.txt';
|
||||
|
||||
$pdo = DbUtils::openDbAndReturnPdo();
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
$header = Pager::readAndSubstituteFile($pdo,$headerFileTemplate);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ $headerFileTemplate = __DIR__. '/vorlagen/classic/header.html';
|
|||
$footerFileTemplate = __DIR__. '/vorlagen/classic/footer.html';
|
||||
$contentTemplate = __DIR__. '/vorlage-menu.txt';
|
||||
|
||||
$pdo = DbUtils::openDbAndReturnPdo();
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
$prodtype = $_GET["pt"];
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class Imager {
|
|||
|
||||
public static function imagesInFolder($pdo) {
|
||||
if (is_null($pdo)) {
|
||||
$pdo = DbUtils::openDbAndReturnPdo();
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
}
|
||||
|
||||
$files = scandir("restaurantbilder");
|
||||
|
|
|
@ -1091,7 +1091,7 @@ class Admin {
|
|||
$waiterMessage = $this->getMessage(null, "waitermessage");
|
||||
}
|
||||
// CAUTION: change version also in config.txt!!!
|
||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.1.1",
|
||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.1.2",
|
||||
"user" => $currentUser,
|
||||
"menu" => $mainMenu,
|
||||
"waitermessage" => $waiterMessage,
|
||||
|
@ -1179,8 +1179,8 @@ class Admin {
|
|||
} else {
|
||||
// instead if password_hash (PHP > 5.5) use MD5...
|
||||
$password_hash = md5($password);
|
||||
$userInsertSql = "INSERT INTO `%user%` (`id` , `username` , `userpassword`, `is_admin`, `right_waiter`,`right_kitchen`,`right_bar`,`right_supply`,`right_paydesk`,`right_statistics`,`right_bill`,`right_products`,`right_reservation`,`right_rating`,`right_changeprice`,`right_manager`,`language`,`receiptprinter`,`prefertablemap`,`active`) VALUES (";
|
||||
$userInsertSql .= " NULL, '$username', '$password_hash' , '$isAdmin', '$rWaiter', '$rKitchen', '$rBar', '$rSupply', '$rPayDesk', '$rStat', '$rBill', '$rProducts', '$rReservation', '$rRating', '$rChangeprice', '$rManager', '$lang','1','1','1')";
|
||||
$userInsertSql = "INSERT INTO `%user%` (`id` , `username` , `userpassword`, `is_admin`, `right_waiter`,`right_kitchen`,`right_bar`,`right_supply`,`right_paydesk`,`right_statistics`,`right_bill`,`right_products`,`right_reservation`,`right_rating`,`right_changeprice`,`right_manager`,`language`,`receiptprinter`,`prefertablemap`,`keeptypelevel`,`active`) VALUES (";
|
||||
$userInsertSql .= " NULL, '$username', '$password_hash' , '$isAdmin', '$rWaiter', '$rKitchen', '$rBar', '$rSupply', '$rPayDesk', '$rStat', '$rBill', '$rProducts', '$rReservation', '$rRating', '$rChangeprice', '$rManager', '$lang','1','1','1','1')";
|
||||
$dbresult = $this->dbutils->performSqlCommandRetLastId($userInsertSql);
|
||||
$lastId = $dbresult['id'];
|
||||
echo json_encode("OK");
|
||||
|
@ -1850,7 +1850,6 @@ class Admin {
|
|||
if ($stmt->rowCount() == 0) {
|
||||
$this->changeOneConfigDbItem($pdo, "timezone", $timezone, "%config%", true);
|
||||
}
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
// logout (by the restore other user or rights may have been applied)
|
||||
|
|
|
@ -162,16 +162,18 @@ $sql = "UPDATE %queue% set paidtime=?,delivertime=? WHERE billid is not null AND
|
|||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($closingTime,$closingTime));
|
||||
|
||||
// if products are paid but not delivered they are counted for a table to check for completness
|
||||
// -> an closing must set the delivery time
|
||||
$sql = "UPDATE %queue% set delivertime=? WHERE billid is not null AND delivertime = '0000-00-00 00:00:00'";
|
||||
$sql = "UPDATE %queue% set delivertime=?,workprinted=? WHERE billid is not null AND delivertime = '0000-00-00 00:00:00'";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($closingTime));
|
||||
$stmt->execute(array($closingTime,1));
|
||||
|
||||
$sql = "DELETE FROM %printjobs%";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute();
|
||||
|
||||
$sql = "UPDATE %queue% SET isclosed=?";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array(1));
|
||||
|
||||
// commit must before email, because there direct access to db happens
|
||||
$pdo->commit();
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class QueueContent {
|
|||
}
|
||||
|
||||
// these command are only allowed for user with waiter rights
|
||||
$cmdArray = array('addProductListToQueue', 'removeProductFromQueue', 'changeTable');
|
||||
$cmdArray = array('addProductListToQueue', 'removeProductFromQueue', 'changeTable','getProdsForTableChange');
|
||||
if (in_array($command, $cmdArray)) {
|
||||
if (!($this->userrights->hasCurrentUserRight('right_waiter'))) {
|
||||
echo "Benutzerrechte nicht ausreichend!";
|
||||
|
@ -84,8 +84,10 @@ class QueueContent {
|
|||
$this->declareProductNotBeDelivered($_POST['queueid']);
|
||||
} else if ($command == 'getJsonLongNamesOfProdsForTableNotDelivered') {
|
||||
$this->getJsonLongNamesOfProdsForTableNotDelivered($_GET["tableid"]);
|
||||
} else if ($command == 'getProdsForTableChange') {
|
||||
$this->getProdsForTableChange($_GET['tableId']);
|
||||
} else if ($command == 'changeTable') {
|
||||
$this->changeTable($_POST['fromTableId'],$_POST['toTableId'],$_POST['alsoNotPayed']);
|
||||
$this->changeTable($_POST['fromTableId'],$_POST['toTableId'],$_POST['queueids']);
|
||||
} else if ($command == 'removeProductFromQueue') {
|
||||
$this->removeProductFromQueue($_POST["queueid"],$_POST["isPaid"],$_POST["isCooking"],$_POST["isReady"]);
|
||||
} else if ($command == 'getJsonAllQueueItemsToMake') {
|
||||
|
@ -187,6 +189,7 @@ class QueueContent {
|
|||
$sql .= "%queue%.tablenr = %resttables%.id AND ";
|
||||
$sql .= "%products%.category=%prodtype%.id AND ";
|
||||
$sql .= "%prodtype%.kind=? AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
|
@ -209,6 +212,7 @@ class QueueContent {
|
|||
$sql .= "%queue%.tablenr is null AND ";
|
||||
$sql .= "%products%.category=%prodtype%.id AND ";
|
||||
$sql .= "%prodtype%.kind=? AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
$sql .= "AND (%queue%.billid is null OR (";
|
||||
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
|
||||
|
@ -458,6 +462,7 @@ class QueueContent {
|
|||
$sql .= "%queue%.tablenr = %resttables%.id AND ";
|
||||
$sql .= "%products%.category=%prodtype%.id AND ";
|
||||
$sql .= "%prodtype%.kind=? AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
|
@ -484,6 +489,7 @@ class QueueContent {
|
|||
$sql .= "%queue%.tablenr is null AND ";
|
||||
$sql .= "%products%.category=%prodtype%.id AND ";
|
||||
$sql .= "%prodtype%.kind=? AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
|
@ -929,9 +935,9 @@ class QueueContent {
|
|||
$stmt->execute();
|
||||
$row = $stmt->fetchObject();
|
||||
if ($row->countid == 0) {
|
||||
$sql = "SELECT DISTINCT %queue%.id as quid FROM %queue% WHERE ordertime is not null AND ";
|
||||
$sql = "SELECT DISTINCT %queue%.id as quid FROM %queue% WHERE ordertime is not null AND isclosed is null AND ";
|
||||
} else {
|
||||
$sql = "SELECT DISTINCT %queue%.id as quid FROM %queue%,%bill% WHERE ordertime is not null AND ((%queue%.billid is null AND %queue%.paidtime is null) OR (%queue%.billid=%bill%.id AND %bill%.closingid is null)) AND ";
|
||||
$sql = "SELECT DISTINCT %queue%.id as quid FROM %queue%,%bill% WHERE ordertime is not null AND isclosed is null AND ((%queue%.billid is null AND %queue%.paidtime is null) OR (%queue%.billid=%bill%.id AND %bill%.closingid is null)) AND ";
|
||||
}
|
||||
|
||||
if ($tableid == 0) {
|
||||
|
@ -998,54 +1004,53 @@ class QueueContent {
|
|||
}
|
||||
|
||||
|
||||
function changeTable($fromTableId, $toTableId, $doAlsoNotPayed) {
|
||||
function getProdsForTableChange($tableid) {
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
if ($tableid == 0) {
|
||||
$tableid = null;
|
||||
}
|
||||
|
||||
$sql = "SELECT count(%queue%.id) as mycount,productname, GROUP_CONCAT(%queue%.id) AS queueids FROM ";
|
||||
$sql .= "%queue% WHERE ";
|
||||
$sql .= "(tablenr=? OR (tablenr IS NULL AND ? IS NULL)) AND ordertime is not null AND isclosed is null AND billid is null ";
|
||||
$sql .= "GROUP BY productid";
|
||||
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($tableid,$tableid));
|
||||
$unpaidresult = $stmt->fetchAll();
|
||||
|
||||
$sql = "SELECT count(%queue%.id) as mycount,productname, GROUP_CONCAT(%queue%.id) AS queueids FROM ";
|
||||
$sql .= "%queue% LEFT OUTER JOIN %bill% ON %queue%.billid=%bill%.id WHERE ";
|
||||
$sql .= "(tablenr=? OR (tablenr IS NULL AND ? IS NULL)) AND ordertime is not null AND isclosed is null AND billid is null AND (";
|
||||
$sql .= "%queue%.delivertime = '0000-00-00 00:00:00' OR ";
|
||||
$sql .= "(%queue%.delivertime <> '0000-00-00 00:00:00' AND workprinted='1')) ";
|
||||
$sql .= "GROUP BY productid";
|
||||
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($tableid,$tableid));
|
||||
$undeliveredresult = $stmt->fetchAll();
|
||||
|
||||
echo json_encode(array("status" => "OK","unpaid" => $unpaidresult,"undeliveredunpaid" => $undeliveredresult));
|
||||
}
|
||||
|
||||
|
||||
function changeTable($fromTableId, $toTableId, $queueids) {
|
||||
$ids = explode(",",$queueids);
|
||||
foreach($ids as $id) {
|
||||
if (!is_numeric($id)) {
|
||||
echo json_encode(array("status" => "ERROR", "code" => NUMBERFORMAT_ERROR, "msg" => NUMBERFORMAT_ERROR_MSG));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// not paid:
|
||||
$sql = "SELECT DISTINCT %queue%.id as id,longname,anoption,readytime,delivertime,paidtime ";
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$sql .= "FROM %queue%,%products%,%bill% ";
|
||||
} else {
|
||||
$sql .= "FROM %queue%,%products% ";
|
||||
}
|
||||
$sql = "UPDATE %queue% SET tablenr=? WHERE id IN($queueids) AND tablenr=?";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($toTableId,$fromTableId));
|
||||
|
||||
$whereClauseIncPaid = "WHERE (tablenr=? AND delivertime = '0000-00-00 00:00:00') ";
|
||||
$whereClauseIncPaid .= "AND ordertime is not null ";
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$whereClauseIncPaid .= " AND ";
|
||||
$whereClauseIncPaid .= "(%queue%.billid is null OR (";
|
||||
$whereClauseIncPaid .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
|
||||
}
|
||||
$sql_incl_paid = $sql . $whereClauseIncPaid . "ORDER BY ordertime";
|
||||
|
||||
$whereClauseNotPaid = "WHERE (tablenr=? AND delivertime = '0000-00-00 00:00:00') ";
|
||||
$whereClauseNotPaid .= "AND ordertime is not null ";
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$whereClauseNotPaid .= " AND ";
|
||||
$whereClauseNotPaid .= "(%queue%.billid is null) ";
|
||||
}
|
||||
$sql_not_paid = $sql . $whereClauseNotPaid . "ORDER BY ordertime";
|
||||
|
||||
if ($doAlsoNotPayed == 1) {
|
||||
// change table for items that are not delivered and unpaid
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$sql = "UPDATE %queue%,%bill% SET %queue%.tablenr=? " . $whereClauseNotPaid;
|
||||
} else {
|
||||
$sql = "UPDATE %queue% SET %queue%.tablenr=? " . $whereClauseNotPaid;
|
||||
}
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($toTableId,$fromTableId));
|
||||
} else {
|
||||
// change table for items that are not delieverd, independend on their paid status
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$sql = "UPDATE %queue%,%bill% SET %queue%.tablenr=? " . $whereClauseIncPaid;
|
||||
} else {
|
||||
$sql = "UPDATE %queue% SET %queue%.tablenr=? " . $whereClauseIncPaid;
|
||||
}
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($toTableId,$fromTableId));
|
||||
}
|
||||
$pdo->commit();
|
||||
echo json_encode(array("status" => "OK"));
|
||||
}
|
||||
|
@ -1065,7 +1070,7 @@ class QueueContent {
|
|||
} else {
|
||||
$sql .= "WHERE tablenr = $tableid ";
|
||||
}
|
||||
$sql .= "AND paidtime is null AND toremove <> '1' AND ordertime is not null ORDER BY ordertime;";
|
||||
$sql .= "AND paidtime is null AND toremove <> '1' AND ordertime is not null AND isclosed is null ORDER BY ordertime;";
|
||||
|
||||
$dbresult = $this->dbutils->performSqlCommand($sql);
|
||||
|
||||
|
@ -1168,6 +1173,7 @@ class QueueContent {
|
|||
$sql .= "WHERE (readytime <> '0000-00-00 00:00:00' and delivertime = '0000-00-00 00:00:00' ";
|
||||
$sql .= "AND %queue%.productid=%products%.id ";
|
||||
$sql .= "AND %queue%.tablenr=%resttables%.id ";
|
||||
$sql .= "AND %queue%.isclosed is null ";
|
||||
$sql .= "AND ordertime is not null ";
|
||||
$sql .= "AND %resttables%.id=" . $tableid . " ";
|
||||
$sql .= "AND toremove <> '1') ";
|
||||
|
@ -1191,6 +1197,7 @@ class QueueContent {
|
|||
$sql .= "AND %queue%.productid=%products%.id ";
|
||||
$sql .= "AND %queue%.tablenr is null ";
|
||||
$sql .= "AND ordertime is not null ";
|
||||
$sql .= "AND %queue%.isclosed is null ";
|
||||
$sql .= "AND toremove <> '1') ";
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$sql .= "AND (%queue%.billid is null OR (";
|
||||
|
@ -1243,6 +1250,7 @@ class QueueContent {
|
|||
}
|
||||
$sql .= "WHERE delivertime = '0000-00-00 00:00:00' ";
|
||||
$sql .= "AND ordertime is not null ";
|
||||
$sql .= "AND %queue%.isclosed is null ";
|
||||
$sql .= "AND workprinted='0' ";
|
||||
$sql .= "AND toremove <> '1' ";
|
||||
if (!is_null($tableid)) {
|
||||
|
@ -1275,6 +1283,7 @@ class QueueContent {
|
|||
$sql .= "AND toremove <> '1' ";
|
||||
$sql .= "AND %queue%.tablenr=%resttables%.id AND ";
|
||||
$sql .= "ordertime is not null AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
|
@ -1299,6 +1308,7 @@ class QueueContent {
|
|||
$sql .= "AND toremove <> '1' ";
|
||||
$sql .= "AND %queue%.tablenr is null AND ";
|
||||
$sql .= "ordertime is not null AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$sql .= "AND (%queue%.billid is null OR (";
|
||||
|
@ -1370,6 +1380,7 @@ class QueueContent {
|
|||
$sql .= "AND %queue%.tablenr=%resttables%.id ";
|
||||
$sql .= "AND toremove <> '1' AND ";
|
||||
$sql .= "ordertime is not null AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
|
@ -1396,6 +1407,7 @@ class QueueContent {
|
|||
$sql .= "AND %queue%.tablenr is null ";
|
||||
$sql .= "AND toremove <> '1' AND ";
|
||||
$sql .= "ordertime is not null AND ";
|
||||
$sql .= "%queue%.isclosed is null AND ";
|
||||
$sql .= "%queue%.workprinted='0') ";
|
||||
if ($this->areBillExisting($pdo)) {
|
||||
$sql .= "AND (%queue%.billid is null OR (";
|
||||
|
|
|
@ -85,7 +85,7 @@ class Roomtables {
|
|||
INNER JOIN %products% ON %queue%.productid = %products%.id
|
||||
INNER JOIN %pricelevel% ON %queue%.pricelevel = %pricelevel%.id
|
||||
WHERE tablenr = ? AND paidtime is null AND toremove <> '1'
|
||||
AND ordertime is not null";
|
||||
AND ordertime is not null AND isclosed is null";
|
||||
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($tableid));
|
||||
|
@ -195,7 +195,7 @@ class Roomtables {
|
|||
// now find the tables that are in that room
|
||||
$tablesArray = array();
|
||||
|
||||
$sql = "SELECT %resttables%.id as id,%resttables%.tableno as name,IFNULL(SUM(IF(%queue%.ordertime is not null AND %queue%.paidtime is null,%queue%.price,0.00)),0.00) as pricesum FROM %resttables% ";
|
||||
$sql = "SELECT %resttables%.id as id,%resttables%.tableno as name,IFNULL(SUM(IF(%queue%.ordertime is not null AND %queue%.paidtime is null AND %queue%.isclosed is null,%queue%.price,0.00)),0.00) as pricesum FROM %resttables% ";
|
||||
$sql .= " LEFT OUTER JOIN %queue% ON %queue%.tablenr=%resttables%.id WHERE %resttables%.removed is null AND ";
|
||||
$sql .= " %resttables%.roomid=? GROUP BY %resttables%.id";
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ class HistFiller {
|
|||
private function readSqlUserTableAndSendToHist($sql_query, $histaction) {
|
||||
$sql_insert_histuser = "INSERT INTO %histuser% (id,userid,username,
|
||||
is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,right_statistics,
|
||||
right_bill,right_products,right_reservation,right_manager,active) VALUES (
|
||||
NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
right_bill,right_products,right_reservation,right_rating,right_changeprice,right_manager,active) VALUES (
|
||||
NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$pdo->beginTransaction();
|
||||
|
@ -58,7 +58,7 @@ class HistFiller {
|
|||
$stmt_insert_histuser->execute(array($row['id'], $row['username'],
|
||||
$row['is_admin'],$row['right_waiter'],$row['right_kitchen'],$row['right_bar'],
|
||||
$row['right_supply'],$row['right_paydesk'],$row['right_statistics'],$row['right_bill'],
|
||||
$row['right_products'],$row['right_reservation'],$row['right_manager'],$row['active']));
|
||||
$row['right_products'],$row['right_reservation'],$row['right_rating'],$row['right_changeprice'],$row['right_manager'],$row['active']));
|
||||
$newRefIdForHist = $pdo->lastInsertId();
|
||||
$this->insertIntoHist($pdo, $histaction, $newRefIdForHist);
|
||||
}
|
||||
|
|
|
@ -499,6 +499,7 @@ class Basedb {
|
|||
`toremove` INT(3) NOT NULL,
|
||||
`cooking` INT(10) NULL,
|
||||
`workprinted` INT(2) NOT NULL,
|
||||
`isclosed` INT(1) NULL,
|
||||
FOREIGN KEY (tablenr) REFERENCES %resttables%(id),
|
||||
FOREIGN KEY (pricelevel) REFERENCES %pricelevel%(id),
|
||||
FOREIGN KEY (productid) REFERENCES %products%(id),
|
||||
|
|
|
@ -75,6 +75,10 @@ var W_SEARCHRESULTS = ["Suchergebnis","Search Result","Encontrado"];
|
|||
var W_WRONG_PIN = ["Falscher Stornocode","Wrong cancel code","Codigo falso"];
|
||||
var W_NO_ORDERS = ["Keine gebuchten Orders vorhanden!","No orders available!","No hay ningún orden!"];
|
||||
var W_TO_PAY = ["offen","to pay","a pagar"];
|
||||
var W_UNPAID = ["unbezahlt","unpaid","no pagado"];
|
||||
var W_UNDELIVERED = ["nicht serviert (+ unbezahlt)","not served (and unpaid)","no servidos (y non-pagado)"];
|
||||
var W_MOVE_PRODS = ["Produkte verschieben","Move products","Productos a otra mesa"];
|
||||
var W_NO_PRODS_SELECTED = ["Es wurden keine Produkte ausgewählt!","You have not chosen any products!","No ha seleccionado ningún producto!"];
|
||||
|
||||
var lang = 0;
|
||||
|
||||
|
@ -146,6 +150,10 @@ function setLanguage(language) {
|
|||
$("#discardnewordersask").html(W_DISCARD_NO_ASK[lang]);
|
||||
$("#discardnoheader").html(W_DISCARD_HEADER[lang]);
|
||||
|
||||
$("#change_unpaid_txt").html(W_UNPAID[lang]);
|
||||
$("#change_undelivered_txt").html(W_UNDELIVERED[lang]);
|
||||
$("#moveprods").html(W_MOVE_PRODS[lang]);
|
||||
|
||||
var searchField = '<div id=searchResult></div>';
|
||||
searchField += '<div>';
|
||||
searchField += '<input type="text" id="searchField" value="" data-mini="true" placeholder="' + W_SEARCH[lang] + '" />';
|
||||
|
@ -846,6 +854,113 @@ $(document).on("pagebeforeshow", "#tables-page", function () {
|
|||
|
||||
});
|
||||
|
||||
$(document).on("pagebeforeshow", "#changetablewhatdialog", function () {
|
||||
var fromTableId = $("#changetablewhatdialog").data("fromtableid");
|
||||
doJsonAjax("GET","php/contenthandler.php?module=queue&command=getProdsForTableChange",{ tableId: fromTableId },insertProductsToChangeTableDlg,"Tischartikel");
|
||||
});
|
||||
|
||||
function insertProductsToChangeTableDlg(jsonContent) {
|
||||
if (jsonContent.status != "OK") {
|
||||
alert("Fehler");
|
||||
return;
|
||||
}
|
||||
|
||||
$("#changetablewhatdialog").data("unpaid",jsonContent.unpaid);
|
||||
$("#changetablewhatdialog").data("undelivered",jsonContent.undeliveredunpaid);
|
||||
|
||||
$("#changetablewhatdialog").data("show_unpaid",1);
|
||||
$("#changetablewhatdialog").data("show_undelivered",1);
|
||||
|
||||
updateChangeTableDialog();
|
||||
}
|
||||
|
||||
function updateChangeTableDialog() {
|
||||
var txtUnpaid = createTextAreaForChangeTable($("#changetablewhatdialog").data("unpaid"));
|
||||
var txtUndelivered = createTextAreaForChangeTable($("#changetablewhatdialog").data("undelivered"));
|
||||
|
||||
var show_unpaid = $("#changetablewhatdialog").data("show_unpaid");
|
||||
var show_undelivered = $("#changetablewhatdialog").data("show_undelivered");
|
||||
if (show_unpaid == 1) {
|
||||
$('#change_unpaid').buttonMarkup({ icon: "check" });
|
||||
} else {
|
||||
$('#change_unpaid').buttonMarkup({ icon: "delete" });
|
||||
}
|
||||
if (show_undelivered == 1) {
|
||||
$('#change_undelivered').buttonMarkup({ icon: "check" });
|
||||
} else {
|
||||
$('#change_undelivered').buttonMarkup({ icon: "delete" });
|
||||
}
|
||||
|
||||
var txt = "";
|
||||
if (show_unpaid) {
|
||||
txt += W_UNPAID[lang] + ":<br>" + txtUnpaid + "<br><br>";
|
||||
}
|
||||
|
||||
if (show_undelivered) {
|
||||
txt += W_UNDELIVERED[lang] + ":<br>" + txtUndelivered;
|
||||
}
|
||||
|
||||
$("#changetablecontent").html(txt);
|
||||
|
||||
$("#change_unpaid").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
$("#changetablewhatdialog").data("show_unpaid",1-show_unpaid);
|
||||
updateChangeTableDialog();
|
||||
});
|
||||
$("#change_undelivered").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
$("#changetablewhatdialog").data("show_undelivered",1-show_undelivered);
|
||||
updateChangeTableDialog();
|
||||
});
|
||||
|
||||
$("#moveprods").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var show_unpaid = $("#changetablewhatdialog").data("show_unpaid");
|
||||
var show_undelivered = $("#changetablewhatdialog").data("show_undelivered");
|
||||
|
||||
var entries = [];
|
||||
if (show_unpaid == 1) {
|
||||
var unpaids = $("#changetablewhatdialog").data("unpaid");
|
||||
for (var i=0;i<unpaids.length;i++) {
|
||||
entries[entries.length] = unpaids[i].queueids;
|
||||
}
|
||||
}
|
||||
if (show_undelivered == 1) {
|
||||
var undelivs = $("#changetablewhatdialog").data("undelivered");
|
||||
for (var j=0;j<undelivs.length;j++) {
|
||||
entries[entries.length] = undelivs[j].queueids;
|
||||
}
|
||||
}
|
||||
if (entries.length == 0) {
|
||||
alert(W_NO_PRODS_SELECTED[lang]);
|
||||
} else {
|
||||
var entryCommaTxt = entries.join();
|
||||
|
||||
var fromTableId = $("#changetablewhatdialog").data("fromtableid");
|
||||
var toTableId = $("#changetablewhatdialog").data("totableid");
|
||||
var data = {
|
||||
fromTableId : fromTableId,
|
||||
toTableId : toTableId,
|
||||
queueids : entryCommaTxt
|
||||
};
|
||||
doJsonAjax("POST","php/contenthandler.php?module=queue&command=changeTable",data, resultOfChangeTable, "Fehler Tischwechsel");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createTextAreaForChangeTable(theList) {
|
||||
var txt = "<textarea class='changetableprodlist'>";
|
||||
for (var i=0;i<theList.length;i++) {
|
||||
var entry = theList[i];
|
||||
txt += entry.mycount + "x " + entry.productname + "\n";
|
||||
}
|
||||
txt += "</textarea>";
|
||||
return txt;
|
||||
}
|
||||
|
||||
function displayTablesListOrMap(listToFill) {
|
||||
var roomdetail = $("#tables-page").data("roomdetail");
|
||||
|
@ -1664,33 +1779,6 @@ function bindSendNewOrdersButton() {
|
|||
}
|
||||
}
|
||||
|
||||
function moveOrderItemsFromTables(alsoNotPayedItems) {
|
||||
var fromTableId = $("#changetablewhatdialog").data("fromtableid");
|
||||
var toTableId = $("#changetablewhatdialog").data("totableid");
|
||||
|
||||
var notDelProd = [];
|
||||
$(".notdelprod").each(function() {
|
||||
var el = $(this);
|
||||
var queueid = $(this).data("queueid");
|
||||
notDelProd[notDelProd.length] = queueid;
|
||||
});
|
||||
var data = {
|
||||
fromTableId : fromTableId,
|
||||
toTableId : toTableId,
|
||||
alsoNotPayed : (alsoNotPayedItems ? 1 : 0),
|
||||
queueids : notDelProd
|
||||
};
|
||||
doJsonAjax("POST",
|
||||
"php/contenthandler.php?module=queue&command=changeTable",
|
||||
data, resultOfChangeTable, "Fehler Tischwechsel");
|
||||
}
|
||||
function moveNotDeliveredItems() {
|
||||
moveOrderItemsFromTables(false);
|
||||
}
|
||||
|
||||
function moveNotPayedAndNotDeliveredItems() {
|
||||
moveOrderItemsFromTables(true);
|
||||
}
|
||||
|
||||
function resultOfChangeTable(jsonResult) {
|
||||
if (jsonResult.status != "OK") {
|
||||
|
@ -1750,18 +1838,6 @@ function bindSendNewOrdersButton() {
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
$("#move_not_del_items").off("click").on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
moveNotDeliveredItems();
|
||||
});
|
||||
|
||||
$("#move_notDel_notPayed_items").off("click").on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
moveNotPayedAndNotDeliveredItems();
|
||||
});
|
||||
}
|
||||
|
||||
function createHtmlOfKind(workItems, kind, printer) {
|
||||
|
@ -2350,13 +2426,19 @@ function bindSendNewOrdersButton() {
|
|||
<div data-role="dialog" id="changetablewhatdialog" data-title="Tischwechsel">
|
||||
<div data-role="content">
|
||||
<h3 class="sure-1">Auswahl der Orderelemente</h3>
|
||||
<p class="roomtabletitel">Welche Orderelemente sollen dem neuen Tisch zugewiesen werden?
|
||||
<div data-role="content">
|
||||
<a href="#" data-role="button" data-theme="f" data-rel="back" id="move_not_del_items">nicht zugestellte</a>
|
||||
<a href="#" data-role="button" data-theme="f" data-rel="back" id="move_notDel_notPayed_items">nicht zugestellte, nicht bezahlte</a>
|
||||
</div>
|
||||
<p class="roomtabletitel">Welche Orderelemente sollen dem neuen Tisch zugewiesen werden?</p>
|
||||
<div data-role="controlgroup" data-type="horizontal" id="paybuttongroup">
|
||||
<a href="#" data-role="button" data-theme="b" data-icon="check" id="change_unpaid"><span id="change_unpaid_txt">Unbezahlt</span></a>
|
||||
<a href="#" data-role="button" data-theme="b" data-icon="check" id="change_undelivered"><span id="change_undelivered_txt">Unserviert</span></a>
|
||||
</div>
|
||||
<p id=changetablecontent>
|
||||
|
||||
</p>
|
||||
<a href="#" data-role="button" data-theme="c" data-rel="back">Zurück</a>
|
||||
<div data-role="content">
|
||||
<a href="#" data-role="button" data-theme="f" data-rel="back" id="moveprods">Anwenden</a>
|
||||
<a href="#" data-role="button" data-theme="c" data-rel="back">Zurück</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> <!-- changetablewhatdialog -->
|
||||
|
||||
|
|
Loading…
Reference in New Issue