PATH:
root
/
alutechnikadmin1234produkty
<?php if(!isset($_SESSION["id_konta"])) { header("Location: ../index.php"); } if(isset ($_GET["o"])) { $opcja = $_GET["o"]; } else { $opcja = 0; } $a = new Module($db, LANGS, "produkty", $kat); $p = new Panel($a, LANGS, $a->ref); $options = [ "addDisplayText" => "produkt", "options" => "enableGrouping", "groupTable" => "kategorie", "groupDisplayTextColumn" => "nazwa", "groupParentColumn" => "rodzic", "groupIDColumn" => "id", "groupLabelText" => "Wybierz kategorię:", "groupIndentStr" => " ", "groupIndentSeparator" => "", "dataTable" => true, "orderColumn" => "kolejnosc", "swapColumns" => "kolejnosc", "defaultSortBy" => 4, "inputSorting" => 4, "checkboxSorting" => "5,6" ]; $renderTable = [ "id" => [ "name" => "ID", "styles" => "width: 50px; text-align: center" ], "nazwa" => [ "name" => "Nazwa", "styles" => "width: 20%", "valueStyles" => "text-align: left" ], "kategorie" => [ "name" => "Kategorie", "valueStyles" => "text-align: left", "valueFromTable" => "kategorie", "valueFromField" => "id", "valueDisplayTextFromField" => "nazwa", "multiValues" => "string", "multiValuesSeparator" => ",", "multiValuesDisplayTextSeparator" => ", " ], "kolejnosc" => [ "name" => "Kolejność", "styles" => "width: 50px; text-align: center", "value" => function($data) { return "<form id=\"kolejnosc" . $data['row']['id'] . "\" method=\"POST\"><input name=\"id\" type=\"hidden\" value=\"" . $data['row']['id'] . "\" /><input class=\"inline-edit-width-50 inline-edit-text-center\" type=\"text\" name=\"kolejnosc\" value=\"" . $data['row']['kolejnosc'] . "\" autocomplete=\"off\" /></form>"; } ], "pokaz" => [ "name" => "Aktywny", "styles" => "width: 10%; text-align: center", "value" => function($data) { return "<form id=\"pokaz" . $data['row']['id'] . "\" method=\"POST\"><input name=\"id\" type=\"hidden\" value=\"" . $data['row']['id'] . "\" /><input name=\"pokaz\" type=\"hidden\" value=\"0\" /><input type=\"checkbox\" name=\"pokaz\"" . ($data['row']['pokaz'] != 0 ? " checked=\"checked\"" : "") . " /></form>"; } ], "glowna" => [ "name" => "Na głównej", "styles" => "width: 10%; text-align: center", "value" => function($data) { return "<form id=\"glowna" . $data['row']['id'] . "\" method=\"POST\"><input name=\"id\" type=\"hidden\" value=\"" . $data['row']['id'] . "\" /><input name=\"glowna\" type=\"hidden\" value=\"0\" /><input type=\"checkbox\" name=\"glowna\"" . ($data['row']['glowna'] != 0 ? " checked=\"checked\"" : "") . " /></form>"; } ] /*, "kolekcja" => [ "name" => "Kolekcja", "styles" => "text-align: center", "value" => function($data, $dataGiven) { return $dataGiven[$data['row']['kolekcja'] - 1]['nazwa']; } ]*/ ]; $renderTableSort = "ORDER BY `kolejnosc` ASC, `id` ASC"; $renderTableData = ""; //$renderTableData = $db->select("kolekcje"); $renderEditor = [ "nazwa" => [ "lang" => "single", "displayName" => "Nazwa", "displayStyles" => "width: 150px", "type" => "text" ], "opis" => [ "lang" => "single", "displayName" => "Opis", "displayStyles" => "width: 150px", "type" => "html" ], "atrybuty" => [ "lang" => "single", "displayName" => "Atrybuty", "displayStyles" => "width: 150px; vertical-align: top; padding-top: 20px", "fieldStyles" => "width: 278px", "valueFromTable" => "atrybuty", "valueFromField" => "id", "valueDisplayTextFromField" => "nazwa", "multiValues" => "string", "multiValuesSeparator" => ",", "multiValuesDisplayTextSeparator" => ", ", "addButtonDisplayText" => "Dodaj atrybut", "type" => "multiSelectFromTableWithFields", "saveColumn" => "atr", "fields" => [ "value" => [ "styles" => "width: 260px; line-height: 17px; float: left; margin-left: 10px" ]/*, "image" => [ "type" => "file", "styles" => "width: 260px; line-height: 17px; float: left; margin-left: 10px" ]*/ ] ], "kategorie" => [ "lang" => "all", "displayName" => "Kategorie", "displayStyles" => "width: 150px; vertical-align: top; padding-top: 20px", "valueFromTable" => "kategorie", "valueFromField" => "id", "valueDisplayTextFromField" => "nazwa", "multiValues" => "string", "multiValuesSeparator" => ",", "multiValuesDisplayTextSeparator" => ", ", "addButtonDisplayText" => "Dodaj kategorię", "type" => "multiSelectFromTable" ], "kolejnosc" => [ "lang" => "all", "displayName" => "Kolejność", "displayStyles" => "width: 150px", "type" => "text" ], "galeria" => [ "lang" => "all", "displayName" => "Zdjęcie (wybrane zostanie wyświetlone jako główne, reszta w folderze będzie wyświetlana do opisu)", "displayStyles" => "width: 150px", "type" => "image", "buttonStyles" => "margin-left: 20px" ], "galeria_css" => [ "lang" => "all", "displayName" => "CSS background-size", "displayStyles" => "width: 150px", "type" => "text" ], "pokaz" => [ "lang" => "all", "displayName" => "Aktywny", "displayStyles" => "width: 150px", "type" => "checkbox", "fieldStyles" => "width: unset" ], "glowna" => [ "lang" => "all", "displayName" => "Na głównej", "displayStyles" => "width: 150px", "type" => "checkbox", "fieldStyles" => "width: unset" ]/*, "kolekcja" => [ "lang" => "all", "displayName" => "Kolekcja", "displayStyles" => "width: 150px", "type" => "select", "from" => ["data" => $db->select("kolekcje"), "name" => "nazwa", "value" => "id"], "buttonStyles" => "margin-left: 20px" ]*/ ]; switch ($opcja){ case 1: case 2: include_once 'dodaj_produkt.php'; break; default: include_once 'produkt.php'; break; } // https://stackoverflow.com/questions/5015403/mysql-find-in-set-with-multiple-search-string // SEARCHING CUSTOM SET LIKE CATEGORIES ID "12,13" IN COLUMN "KATEGORIE" LIKE "1,2,3" // EVERY ONE AND EACH //$categories = $db->select("produkty$lang", "*", NULL, "WHERE CONCAT(\",\", `kategorie`, \",\") REGEXP \",(" . (implode("|", $categoriesID)) . "),\" "); // $currentProducts = $db->select("produkty$lang", "*", NULL, "WHERE CONCAT(',', `kategorie`, ',') LIKE '%,{$_GET['c']},%'"); ?>
[+]
..
[-] dodaj_produkt.php
[edit]
[-] produkt.php
[edit]
[-] index.php
[edit]