dbutils = new DbUtils();
// $this->products = new Products(); --> endless loop!
// $this->lastSettingOfDisplayMode = "all";
}
function createGridTableWithSqrtSizeOfButtons ($inputArray) {
// create a table that is optimal (sqrt-like size)
$numberOfIcons = count($inputArray);
if ($numberOfIcons == 0) {
// no items to display
return;
}
$numberOfCols = ceil(sqrt($numberOfIcons));
$porcentageWidth = floor(100/$numberOfCols);
echo '
";
}
function createGridTableWithSqrtSizeOfStyleButtons($inputArray) {
$this->createGridTableWithSqrtSizeOfStyleButtonsAndHeader($inputArray,'','dummy');
}
function getTableNameFromId($tableid) {
$sql = "SELECT tableno FROM " . DB_RESTTABLES_TABLE . " WHERE id=". $tableid;
$dbresult = $this->dbutils->performSqlCommand($sql);
$zeile = mysqli_fetch_array( $dbresult, MYSQL_ASSOC);
$tablename = $zeile['tableno'];
mysqli_free_result( $dbresult );
return $tablename;
}
function getCurrentPriceLevel() {
$sql = "SELECT setting FROM %config% WHERE name='pricelevel'";
$dbresult = $this->dbutils->performSqlCommand($sql);
$zeile = mysqli_fetch_array( $dbresult, MYSQL_ASSOC);
$pricelevelid = $zeile['setting'];
mysqli_free_result( $dbresult );
$sql = "SELECT id,name FROM %pricelevel% WHERE id=$pricelevelid";
$dbresult = $this->dbutils->performSqlCommand($sql);
$zeile = mysqli_fetch_array( $dbresult, MYSQL_ASSOC);
$pricelevelname = $zeile['name'];
mysqli_free_result( $dbresult );
return (array("id" => $pricelevelid, "name" => $pricelevelname));
}
function createGridTableWithSqrtSizeOfStyleButtonsAndHeader ($inputArray,$headline,$headercolor) {
// create a table that is optimal (sqrt-like size)
$numberOfIcons = count($inputArray);
if ($numberOfIcons == 0) {
// no items to display
return;
}
$numberOfCols = ceil(sqrt($numberOfIcons));
$porcentageWidth = floor(100.0/$numberOfCols);
echo '";
}
}
?>