Compare commits
No commits in common. "master" and "development" have entirely different histories.
master
...
developmen
@ -47,14 +47,7 @@
|
|||||||
{
|
{
|
||||||
if(DBLink::$sqlLink == null)
|
if(DBLink::$sqlLink == null)
|
||||||
{
|
{
|
||||||
DBLink::$sqlLink = mysqli_init();
|
DBLink::$sqlLink = new mysqli(Configuration::$mysqlserver, Configuration::$mysqluser, Configuration::$mysqlpw, Configuration::$mysqldb, Configuration::$mysqlPort);
|
||||||
|
|
||||||
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
|
// Verbindung überprüfen
|
||||||
if (mysqli_connect_errno())
|
if (mysqli_connect_errno())
|
||||||
@ -213,7 +206,6 @@
|
|||||||
if ($mysqli_result)
|
if ($mysqli_result)
|
||||||
{
|
{
|
||||||
$this->ensurePlausibility();
|
$this->ensurePlausibility();
|
||||||
$this->setID(DBLink::getDbLink()->insert_id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,10 +341,7 @@
|
|||||||
$mysqli_result = DBLink::getDbLink()->query($SQL_command);
|
$mysqli_result = DBLink::getDbLink()->query($SQL_command);
|
||||||
|
|
||||||
if ($mysqli_result)
|
if ($mysqli_result)
|
||||||
{
|
|
||||||
$this->setID(DBLink::getDbLink()->insert_id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -490,7 +479,6 @@
|
|||||||
|
|
||||||
if ($mysqli_result)
|
if ($mysqli_result)
|
||||||
{
|
{
|
||||||
$this->setID(DBLink::getDbLink()->insert_id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,7 +619,6 @@
|
|||||||
|
|
||||||
if ($mysqli_result)
|
if ($mysqli_result)
|
||||||
{
|
{
|
||||||
$this->setID(DBLink::getDbLink()->insert_id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,7 +778,6 @@
|
|||||||
|
|
||||||
if ($mysqli_result)
|
if ($mysqli_result)
|
||||||
{
|
{
|
||||||
$this->setID(DBLink::getDbLink()->insert_id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -892,7 +878,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
?>
|
||||||
|
|
||||||
|
<!--
|
||||||
▄▄ ▄▄ ▄▄▄▄▄▄ ▄▄▄ ▄▄ ▄
|
▄▄ ▄▄ ▄▄▄▄▄▄ ▄▄▄ ▄▄ ▄
|
||||||
█ █▄█ █ █ █ █ █ █
|
█ █▄█ █ █ █ █ █ █
|
||||||
█ █ ▄ █ █ █▄█ █
|
█ █ ▄ █ █ █▄█ █
|
||||||
@ -917,8 +905,7 @@
|
|||||||
█ █ █ █ █ ▄ █
|
█ █ █ █ █ ▄ █
|
||||||
█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄█ █▄▄█
|
█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄█ █▄▄█
|
||||||
|
|
||||||
*/
|
-->
|
||||||
?>
|
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -1096,10 +1083,7 @@
|
|||||||
$p->setStoreType(StoreType::getById($_POST['productStoreTypeId']));
|
$p->setStoreType(StoreType::getById($_POST['productStoreTypeId']));
|
||||||
|
|
||||||
if($p->create())
|
if($p->create())
|
||||||
{
|
|
||||||
echo "Product has been created.";
|
echo "Product has been created.";
|
||||||
$justCreatedProductId = $p->getID();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
echo "Product could not be created: ".mysqli_error(DBLink::getDbLink());
|
echo "Product could not be created: ".mysqli_error(DBLink::getDbLink());
|
||||||
}
|
}
|
||||||
@ -1255,6 +1239,7 @@
|
|||||||
|
|
||||||
mysqli_close(DBLink::getDbLink());
|
mysqli_close(DBLink::getDbLink());
|
||||||
|
|
||||||
|
|
||||||
function addToList($productId, $amount, $unitId)
|
function addToList($productId, $amount, $unitId)
|
||||||
{
|
{
|
||||||
if($productId > 0 && $amount != 0 && isset($unitId) && strlen($unitId) > 0)
|
if($productId > 0 && $amount != 0 && isset($unitId) && strlen($unitId) > 0)
|
||||||
@ -1307,6 +1292,7 @@
|
|||||||
echo "Specifiy product, amount and unit.";
|
echo "Specifiy product, amount and unit.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function removeFromList($productId, $listId, $amount, $unitId)
|
function removeFromList($productId, $listId, $amount, $unitId)
|
||||||
{
|
{
|
||||||
if($productId > 0 && $amount != null && $unitId > 0)
|
if($productId > 0 && $amount != null && $unitId > 0)
|
||||||
@ -1334,7 +1320,19 @@
|
|||||||
<select name=\"productId\" id=\"productId\">
|
<select name=\"productId\" id=\"productId\">
|
||||||
<option value=\"0\">Select product to add</option>
|
<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)
|
foreach(Product::getAllProducts() as $product)
|
||||||
{
|
{
|
||||||
$currentId = (int)$product->getID();
|
$currentId = (int)$product->getID();
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
public static $mysqlpw = 'somePassword'; //Password
|
public static $mysqlpw = 'somePassword'; //Password
|
||||||
public static $mysqldb = 'shoppingList'; //Database
|
public static $mysqldb = 'shoppingList'; //Database
|
||||||
public static $mysqlPort = 3306;
|
public static $mysqlPort = 3306;
|
||||||
public static $mysqlSSL = false;
|
|
||||||
public static $mysqlSslCertificatePath = "/etc/ssl/certs/yourCert.crt";
|
|
||||||
public static $rhasspyMasterUrl = "http://rhasspy-master:12101"; // URL of your Rhasspy master webpage WITHOUT ending slash. It is required if you want to trigger a retraining.
|
public static $rhasspyMasterUrl = "http://rhasspy-master:12101"; // URL of your Rhasspy master webpage WITHOUT ending slash. It is required if you want to trigger a retraining.
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user