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 ''; $colcounter = 0; for ($index=0;$index<$numberOfIcons;$index++) { if ($colcounter == 0) { echo ""; } } echo ""; echo "
"; } $anEntry = $inputArray[$index]; $textOfButton = $anEntry["textOfButton"]; # $onClickMethod = $anEntry["onClickMethod"]; // With parameters! $button = ''; echo $button; $colcounter++; if ($colcounter == $numberOfCols) { $colcounter = 0; 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 ''; // Headline if ($headline <> '') { echo ''; } $colcounter = 0; for ($index=0;$index<$numberOfIcons;$index++) { if ($colcounter == 0) { echo ""; } } echo ""; echo "
' . $headline . '
"; } $anEntry = $inputArray[$index]; $textOfButton = $anEntry["textOfButton"]; # $onClickMethod = $anEntry["onClickMethod"]; // With parameters! $style = $anEntry["style"]; $button = ''; echo $button; $colcounter++; if ($colcounter == $numberOfCols) { $colcounter = 0; echo "
"; } } ?>