|
|
|
@ -47,7 +47,14 @@
|
|
|
|
|
{
|
|
|
|
|
if(DBLink::$sqlLink == null)
|
|
|
|
|
{
|
|
|
|
|
DBLink::$sqlLink = new mysqli(Configuration::$mysqlserver, Configuration::$mysqluser, Configuration::$mysqlpw, Configuration::$mysqldb, Configuration::$mysqlPort);
|
|
|
|
|
DBLink::$sqlLink = mysqli_init();
|
|
|
|
|
|
|
|
|
|
if(Configuration::$mysqlSSL)
|
|
|
|
|
{
|
|
|
|
|
DBLink::$sqlLink->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true);
|
|
|
|
|
DBLink::$sqlLink->ssl_set(NULL, NULL, Configuration::$mysqlSslCertificatePath, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
DBLink::$sqlLink->real_connect(Configuration::$mysqlserver, Configuration::$mysqluser, Configuration::$mysqlpw, Configuration::$mysqldb, Configuration::$mysqlPort);
|
|
|
|
|
|
|
|
|
|
// Verbindung überprüfen
|
|
|
|
|
if (mysqli_connect_errno())
|
|
|
|
@ -206,6 +213,7 @@
|
|
|
|
|
if ($mysqli_result)
|
|
|
|
|
{
|
|
|
|
|
$this->ensurePlausibility();
|
|
|
|
|
$this->setID(DBLink::getDbLink()->insert_id);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -341,7 +349,10 @@
|
|
|
|
|
$mysqli_result = DBLink::getDbLink()->query($SQL_command);
|
|
|
|
|
|
|
|
|
|
if ($mysqli_result)
|
|
|
|
|
{
|
|
|
|
|
$this->setID(DBLink::getDbLink()->insert_id);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -479,6 +490,7 @@
|
|
|
|
|
|
|
|
|
|
if ($mysqli_result)
|
|
|
|
|
{
|
|
|
|
|
$this->setID(DBLink::getDbLink()->insert_id);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -619,6 +631,7 @@
|
|
|
|
|
|
|
|
|
|
if ($mysqli_result)
|
|
|
|
|
{
|
|
|
|
|
$this->setID(DBLink::getDbLink()->insert_id);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -778,6 +791,7 @@
|
|
|
|
|
|
|
|
|
|
if ($mysqli_result)
|
|
|
|
|
{
|
|
|
|
|
$this->setID(DBLink::getDbLink()->insert_id);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -878,9 +892,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
/*
|
|
|
|
|
▄▄ ▄▄ ▄▄▄▄▄▄ ▄▄▄ ▄▄ ▄
|
|
|
|
|
█ █▄█ █ █ █ █ █ █
|
|
|
|
|
█ █ ▄ █ █ █▄█ █
|
|
|
|
@ -905,7 +917,8 @@
|
|
|
|
|
█ █ █ █ █ ▄ █
|
|
|
|
|
█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄█ █▄▄█
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
*/
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
@ -1083,7 +1096,10 @@
|
|
|
|
|
$p->setStoreType(StoreType::getById($_POST['productStoreTypeId']));
|
|
|
|
|
|
|
|
|
|
if($p->create())
|
|
|
|
|
{
|
|
|
|
|
echo "Product has been created.";
|
|
|
|
|
$justCreatedProductId = $p->getID();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
echo "Product could not be created: ".mysqli_error(DBLink::getDbLink());
|
|
|
|
|
}
|
|
|
|
@ -1239,7 +1255,6 @@
|
|
|
|
|
|
|
|
|
|
mysqli_close(DBLink::getDbLink());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function addToList($productId, $amount, $unitId)
|
|
|
|
|
{
|
|
|
|
|
if($productId > 0 && $amount != 0 && isset($unitId) && strlen($unitId) > 0)
|
|
|
|
@ -1292,7 +1307,6 @@
|
|
|
|
|
echo "Specifiy product, amount and unit.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function removeFromList($productId, $listId, $amount, $unitId)
|
|
|
|
|
{
|
|
|
|
|
if($productId > 0 && $amount != null && $unitId > 0)
|
|
|
|
@ -1320,19 +1334,7 @@
|
|
|
|
|
<select name=\"productId\" id=\"productId\">
|
|
|
|
|
<option value=\"0\">Select product to add</option>
|
|
|
|
|
";
|
|
|
|
|
/*
|
|
|
|
|
$SQL_command = "SELECT id, name FROM `products` ORDER BY name ASC";
|
|
|
|
|
$mysqli_result = DBLink::getDbLink()->query($SQL_command);
|
|
|
|
|
while ($row = mysqli_fetch_object($mysqli_result))
|
|
|
|
|
{
|
|
|
|
|
$currentId = (int)$row->id;
|
|
|
|
|
|
|
|
|
|
if(isset($justCreatedProductId) && $justCreatedProductId === $currentId)
|
|
|
|
|
echo "<option value=\"".$row->id."\" selected="selected">".$row->name."</option>";
|
|
|
|
|
else
|
|
|
|
|
echo "<option value=\"".$row->id."\">".$row->name."</option>";
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
foreach(Product::getAllProducts() as $product)
|
|
|
|
|
{
|
|
|
|
|
$currentId = (int)$product->getID();
|
|
|
|
|