OrderSprinter 1.2.14
This commit is contained in:
parent
93af22adb8
commit
2d6faf9e3b
Binary file not shown.
Binary file not shown.
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -6,8 +6,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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -679,7 +679,7 @@ $(document).ready(function() {
|
|||
<tr id=updateline>
|
||||
<td> </td>
|
||||
<td align=center>
|
||||
<button id="updatebtn">Update -> 1.2.13</button>
|
||||
<button id="updatebtn">Update -> 1.2.14</button>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
|
|
@ -1516,6 +1516,25 @@ return false;
|
|||
}
|
||||
}
|
||||
|
||||
function updateUserTable1213_1214($prefix, $version, $dbname) {
|
||||
$pdo = $this->pdo;
|
||||
try {
|
||||
if ($version != "1.2.13") {
|
||||
$ret = $this->updateUserTable1212_1213($prefix, $version, $dbname);
|
||||
if (!$ret) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DbUtils::overrulePrefix($prefix);
|
||||
|
||||
$this->updateVersion($pdo, '1.2.14');
|
||||
return true;
|
||||
} catch (PDOException $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function setVersion($prefix,$theVersion) {
|
||||
$pdo = $this->pdo;
|
||||
try {
|
||||
|
@ -1633,7 +1652,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.2.13')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.2.14')");
|
||||
$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')");
|
||||
|
@ -2002,7 +2021,7 @@ $zones[] = $timezone_identifiers[$i];
|
|||
echo json_encode($zones);
|
||||
} else if ($command == 'update') {
|
||||
|
||||
$installerVersion = "1.2.13";
|
||||
$installerVersion = "1.2.14";
|
||||
|
||||
$admin = new InstallAdmin();
|
||||
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
|
||||
|
@ -2032,7 +2051,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27"
|
|||
"1.0.40","1.0.41","1.0.42","1.0.43",
|
||||
"1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8", "1.1.9","1.1.10","1.1.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17",
|
||||
"1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30",
|
||||
"1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11","1.2.12"
|
||||
"1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11","1.2.12","1.2.13"
|
||||
);
|
||||
|
||||
if (!in_array($version, $supportedVersions)) {
|
||||
|
@ -2040,7 +2059,7 @@ echo json_encode("Quellversion nicht unterstützt");
|
|||
return;
|
||||
}
|
||||
|
||||
$ret = $admin->updateUserTable1212_1213($_POST['prefix'], $version, $_POST['db']);
|
||||
$ret = $admin->updateUserTable1213_1214($_POST['prefix'], $version, $_POST['db']);
|
||||
|
||||
if(session_id() == '') {
|
||||
session_start();
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
|
@ -932,7 +932,7 @@ class Admin {
|
|||
$view = "preferences.html";
|
||||
}
|
||||
|
||||
echo json_encode($view . "?v=1.2.13");
|
||||
echo json_encode($view . "?v=1.2.14");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1138,24 +1138,24 @@ 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.2.13"); };
|
||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.14"); };
|
||||
} else {
|
||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.2.13"); };
|
||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.2.14"); };
|
||||
}
|
||||
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.14"); };
|
||||
if ($_SESSION['modus'] == 0) {
|
||||
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.14"); };
|
||||
}
|
||||
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.13"); };
|
||||
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.13"); };
|
||||
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.13");
|
||||
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.13");
|
||||
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.14"); };
|
||||
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.14"); };
|
||||
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.14");
|
||||
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.14");
|
||||
}
|
||||
|
||||
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
|
||||
|
@ -1164,7 +1164,7 @@ class Admin {
|
|||
$waiterMessage = $this->getMessage(null, "waitermessage");
|
||||
}
|
||||
// CAUTION: change version also in config.txt!!!
|
||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.13",
|
||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.14",
|
||||
"user" => $currentUser,
|
||||
"menu" => $mainMenu,
|
||||
"waitermessage" => $waiterMessage,
|
||||
|
|
|
@ -190,20 +190,20 @@ class DbUtils {
|
|||
|
||||
|
||||
public static $prodCols = array(
|
||||
array("col" => 'id', "hist" => 1),
|
||||
array("col" => 'shortname', "hist" => 1),
|
||||
array("col" => 'longname', "hist" => 1),
|
||||
array("col" => 'priceA', "hist" => 1),
|
||||
array("col" => 'priceB', "hist" => 1),
|
||||
array("col" => 'priceC', "hist" => 1),
|
||||
array("col" => 'tax', "hist" => 1),
|
||||
array("col" => 'taxaustria', "hist" => 1),
|
||||
array("col" => 'amount', "hist" => 0),
|
||||
array("col" => 'category', "hist" => 0),
|
||||
array("col" => 'favorite', "hist" => 1),
|
||||
array("col" => 'id', "hist" => 1, "property" => "prodid"),
|
||||
array("col" => 'shortname', "hist" => 1, "property" => "shortName"),
|
||||
array("col" => 'longname', "hist" => 1, "property" => "longName"),
|
||||
array("col" => 'priceA', "hist" => 1, "property" => "priceA"),
|
||||
array("col" => 'priceB', "hist" => 1, "property" => "priceB"),
|
||||
array("col" => 'priceC', "hist" => 1, "property" => "priceC"),
|
||||
array("col" => 'tax', "hist" => 1, "property" => "tax"),
|
||||
array("col" => 'taxaustria', "hist" => 1, "property" => "taxaustria"),
|
||||
array("col" => 'amount', "hist" => 0, "property" => "amount"),
|
||||
array("col" => 'category', "hist" => 0, "property" => "category"),
|
||||
array("col" => 'favorite', "hist" => 1, "property" => "favorite"),
|
||||
array("col" => 'sorting', "hist" => 1),
|
||||
array("col" => 'available', "hist" => 1),
|
||||
array("col" => 'audio', "hist" => 1),
|
||||
array("col" => 'available', "hist" => 1, "property" => "available"),
|
||||
array("col" => 'audio', "hist" => 1, "property" => "audio"),
|
||||
array("col" => 'removed', "hist" => 0)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,9 @@ class Products {
|
|||
if(isset($_POST['extras'])) {
|
||||
$extras = $_POST['extras'];
|
||||
}
|
||||
$this->applySingleProdData($_POST['id'],$_POST['longname'],$_POST['shortname'],$_POST['priceA'],$_POST['priceB'],$_POST['priceC'],$_POST['tax'],$_POST['taxaustria'],$_POST['amount'],$_POST['available'],$_POST['audioFile'],$_POST['changeExtras'],$extras,$_POST['favorite'],$_POST['assignextrastotype']);
|
||||
$prodEntry = new ProductEntry();
|
||||
$prodEntry->createFromPostData($_POST);
|
||||
$this->applySingleProdData($prodEntry,$_POST['changeExtras'],$extras,$_POST['assignextrastotype']);
|
||||
} else if ($command == 'createExtra') {
|
||||
$this->createExtra($_POST['name'],$_POST['price']);
|
||||
} else if ($command == 'delExtra') {
|
||||
|
@ -98,7 +100,9 @@ class Products {
|
|||
} else if ($command == 'delproduct') {
|
||||
$this->delproduct($_POST['prodid']);
|
||||
} else if ($command == 'createProduct') {
|
||||
$this->createProduct($_POST['longname'],$_POST['shortname'],$_POST['priceA'],$_POST['priceB'],$_POST['priceC'],$_POST['tax'],$_POST['taxaustria'],$_POST['amount'],$_POST['available'],$_POST['prodTypeId'],$_POST['audioFile'],$_POST['favorite']);
|
||||
$prodEntry = new ProductEntry();
|
||||
$prodEntry->createFromPostData($_POST);
|
||||
$this->createProduct($prodEntry);
|
||||
} else if ($command == 'reassign') {
|
||||
$this->reassign($_POST['productid'],$_POST['typeid']);
|
||||
} else if ($command == 'createProdType') {
|
||||
|
@ -891,27 +895,15 @@ class Products {
|
|||
echo json_encode("OK");
|
||||
}
|
||||
|
||||
function applySingleProdData(ProductEntry $prodEntry,$changeExtras,$extras,$assignextrastotype) {
|
||||
$id = $prodEntry->getProdId();
|
||||
if (!is_numeric($id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
function applySingleProdData($id,$longname,$shortname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$audioFile,$changeExtras,$extras,$favorite,$assignextrastotype) {
|
||||
if (!is_numeric($id) || !is_numeric($available) || !is_numeric($favorite) ||!is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC) || (!is_numeric($tax) && ($tax != "null")) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($tax == "null") {
|
||||
$tax = null;
|
||||
}
|
||||
if ($amount == "null") {
|
||||
$amount = null;
|
||||
}
|
||||
if ($audioFile == '') {
|
||||
$audioFile = null;
|
||||
}
|
||||
$updateSql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=?, tax=?, taxaustria=?, amount=?,available=?, audio=?, favorite=? WHERE id=?";
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql));
|
||||
$stmt->execute(array($shortname,$longname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$audioFile,$favorite,$id));
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
$pdo->beginTransaction();
|
||||
$prodEntry->applyProductInDb($pdo);
|
||||
|
||||
if ($assignextrastotype == 0) {
|
||||
if ($changeExtras == 1) {
|
||||
|
@ -1001,35 +993,37 @@ class Products {
|
|||
echo json_encode(array("status" => "OK"));
|
||||
}
|
||||
|
||||
function createProduct($longname,$shortname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$typeId,$audioFile,$favorite) {
|
||||
if (!is_numeric($typeId) || !is_numeric($available) || !is_numeric($favorite)|| !is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC)) {
|
||||
function createProduct(ProductEntry $prodEntry) {
|
||||
$typeId = $prodEntry->getCategory();
|
||||
$available = $prodEntry->getAvailable();
|
||||
$favorite = $prodEntry->getFavorite();
|
||||
$priceA = $prodEntry->getPriceA();
|
||||
$priceB = $prodEntry->getPriceB();
|
||||
$priceC = $prodEntry->getPriceC();
|
||||
$tax = $prodEntry->getTax();
|
||||
$taxaustria = $prodEntry->getTaxAustria();
|
||||
$audioFile = $prodEntry->getAudio();
|
||||
$shortname = $prodEntry->getShortName();
|
||||
$longname = $prodEntry->getLongName();
|
||||
$amount = $prodEntry->getAmount();
|
||||
|
||||
if (!is_numeric($typeId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($tax == "null") {
|
||||
$tax = null;
|
||||
try {
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
$pdo->beginTransaction();
|
||||
$newProdId = $prodEntry->createProductInDb($pdo);
|
||||
|
||||
$this->sorter->setMaxSortingForProdId($pdo, $newProdId);
|
||||
|
||||
$pdo->commit();
|
||||
} catch (Exception $e) {
|
||||
echo json_encode("ERROR: " . $e->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if ($audioFile == '') {
|
||||
$audioFile = null;
|
||||
}
|
||||
|
||||
if (trim($shortname) == "") {
|
||||
$shortname = $longname;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `taxaustria`,`amount`,`category`,`favorite`,`available`,`audio`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?)";
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($shortname,$longname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$typeId,$favorite,$available,$audioFile));
|
||||
|
||||
$newProdId = $pdo->lastInsertId();
|
||||
$this->sorter->setMaxSortingForProdId($pdo, $newProdId);
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
// now this has to be logged in the history tables...
|
||||
HistFiller::createProdInHist($pdo, $newProdId);
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ class ProductEntry {
|
|||
private $longName; // the name that shall appear on the receipt
|
||||
private $prodid = null;
|
||||
private $available = 1;
|
||||
private $favorite = "";
|
||||
private $audio = "";
|
||||
private $category = null;
|
||||
|
||||
private static $PRICE_B = "PreisB";
|
||||
private static $PRICE_C = "PreisC";
|
||||
|
@ -22,6 +25,61 @@ class ProductEntry {
|
|||
private static $AVAILABLE = "vorhanden";
|
||||
private static $ID = "ID";
|
||||
|
||||
|
||||
public function createFromPostData($postData) {
|
||||
$prodCols = DbUtils::$prodCols;
|
||||
foreach($prodCols as $aCol) {
|
||||
if (isset($aCol["property"])) {
|
||||
$memberVar = $aCol["property"];
|
||||
if (isset($postData[$aCol["col"]])) {
|
||||
$this->$memberVar = $postData[$aCol["col"]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_numeric($this->available)) {
|
||||
$this->available = 1;
|
||||
}
|
||||
if (!is_numeric($this->favorite)) {
|
||||
$this->favorite = 0;
|
||||
}
|
||||
if (!is_numeric($this->priceA)) {
|
||||
$this->priceA = 0.00;
|
||||
}
|
||||
if (!is_numeric($this->priceB)) {
|
||||
$this->priceB = 0.00;
|
||||
}
|
||||
if (!is_numeric($this->priceC)) {
|
||||
$this->priceC = 0.00;
|
||||
}
|
||||
if ($this->tax == "null") {
|
||||
$this->tax = null;
|
||||
}
|
||||
if ($this->audio == '') {
|
||||
$this->audio = null;
|
||||
}
|
||||
if (trim($this->shortName) == "") {
|
||||
$this->shortName = $this->longName;
|
||||
}
|
||||
if ($this->amount == "null") {
|
||||
$this->amount = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function createProductInDb($pdo) {
|
||||
$sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `taxaustria`,`amount`,`category`,`favorite`,`available`,`audio`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($this->shortName,$this->longName,$this->priceA,$this->priceB,$this->priceC,$this->tax,$this->taxaustria,$this->amount,$this->category,$this->favorite,$this->available,$this->audio));
|
||||
|
||||
return ($pdo->lastInsertId());
|
||||
}
|
||||
|
||||
public function applyProductInDb($pdo) {
|
||||
$updateSql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=?, tax=?, taxaustria=?, amount=?,available=?, audio=?, favorite=? WHERE id=?";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($updateSql));
|
||||
$stmt->execute(array($this->shortName,$this->longName,$this->priceA,$this->priceB,$this->priceC,$this->tax,$this->taxaustria,$this->amount,$this->available,$this->audio,$this->favorite,$this->prodid));
|
||||
}
|
||||
|
||||
//
|
||||
public static function createProductStr($aProd, $decpoint) {
|
||||
|
||||
|
@ -182,6 +240,15 @@ class ProductEntry {
|
|||
return $this->amount;
|
||||
}
|
||||
|
||||
function getCategory() {
|
||||
return $this->category;
|
||||
}
|
||||
function getAudio() {
|
||||
return $this->audio;
|
||||
}
|
||||
function getFavorite() {
|
||||
return $this->favorite;
|
||||
}
|
||||
function toString() {
|
||||
return "S:" . $this->shortName . " PA:" . $this->priceA . " PB:" . $this->priceB . " PC:" . $this->priceC . " Tax:" . $this->tax . " R:" . $this->longName;
|
||||
}
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -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=1.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
@ -486,7 +486,7 @@ function setLanguage(language) {
|
|||
taxaustria: props.taxaustria,
|
||||
amount: props.amount,
|
||||
available: props.available,
|
||||
audioFile: props.selectedAudioFile,
|
||||
audio: props.selectedAudioFile,
|
||||
changeExtras: doChangeExtras,
|
||||
favorite:props.favorite,
|
||||
extras: assignedExtras,
|
||||
|
@ -545,8 +545,8 @@ function setLanguage(language) {
|
|||
taxaustria: props.taxaustria,
|
||||
amount: amount,
|
||||
available: props.available,
|
||||
prodTypeId: tid,
|
||||
audioFile: props.selectedAudioFile,
|
||||
category: tid,
|
||||
audio: props.selectedAudioFile,
|
||||
favorite: props.favorite
|
||||
};
|
||||
doAjax("POST","php/contenthandler.php?module=products&command=createProduct",data,location.reload(),"Neues Produkt nicht anlegbar");
|
||||
|
|
|
@ -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=1.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
|
@ -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=1.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -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.2.13">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.14">
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue