protected function remove_user_form() { $form_id = $this->getFormID("rem_user"); $form = new FormMaker(); $form->setID($form_id); $form->addLabel("Vyber užívateľa"); $data = CDatabaza::getInstance(); $connected = $data->connected(); if (!$connected) { $data->connect(); } $sql = "SELECT * FROM \n Uzivatel_info \n INNER JOIN\n (SELECT * FROM Clanok_uzivatel WHERE clanok_id=" . $this->article['id'] . ")\n AS clanky\n ON\n Uzivatel_info.uzivatel_id=clanky.uzivatel_id\n WHERE Uzivatel_info.uzivatel_id<>" . $_SESSION['user']; $query = $data->query($sql); $form->addSelect("user_id"); $form->addOption("user_id", "user_00", "--Vyber užívateľa", ""); while ($user = $query->fetch_array()) { $form->addOption("user_id", "user_" . $user['uzivatel_id'], $user['meno'] . " " . $user['priezvisko'] . "(" . $user['trieda'] . ")", $user['uzivatel_id']); } $form->registerForm(); $form->showForm(); if (!$connected) { $data->close(); } }
protected function set_user_rights_form() { $form_id = $this->getFormID("set_rights"); $form = new FormMaker(); $form->setID($form_id); $form->addLabel("Vyber užívateľa"); $form->addInputField("text", "user_id", "required cislo"); $form->addLabel("Zadaj prihlasovacie meno"); $form->addInputField("text", "login", "required login"); $form->addLabel("Práva"); $form->addInputField("checkbox", "rights"); $form->addOption("rights", "right01", "Spravovanie užívateľov", "EDIT_USERS"); $form->addOption("rights", "right02", "Úprava článkov", "EDIT_ALL"); $form->addOption("rights", "right03", "Pridanie článkov", "ADD"); $form->addOption("rights", "right04", "Odstránenie článkov", "REMOVE"); $form->addOption("rights", "right05", "Zverenenie článku", "RELEASE"); $form->addOption("rights", "right06", "Stiahnutie článku", "DROP"); $form->addOption("rights", "right07", "Priradenie užívateľa", "ASSIGN"); $form->addOption("rights", "right08", "Úprava zoznamov", "EDIT_ENUMS"); //,,'','','','','EDIT_ENUMS' $form->registerForm(); $form->showForm(); }
protected function add_post_form() { $this->readPosts(); $form_id = $this->getFormID("add_post"); $form = new FormMaker(); $form->setID($form_id); $form->addLabel("Zadaj kategoriu"); $form->addSelect("cat_id"); $form->addOption("cat_id", "cat_id_0", "--Vyber kategoriu--", ""); foreach ($this->categories as $cat) { $form->addOption("cat_id", "cat_id_" . $cat['id'], $cat['name'], $cat['id']); } $form->addLabel("Zadaj názov príspevku"); $form->addInputField("text", "name", "required nazov"); $form->addLabel("Zadaj príspevok"); $form->addTextArea("post"); $form->registerForm(); $form->showForm(); }
protected function add_img_form() { $form_id = $this->getFormID("add_img"); $form = new FormMaker(); $form->setID($form_id); $form->addLabel("Zadaj popis"); $form->addTextArea("desc"); $form->addLabel("Zadaj URL obrázka"); $form->addInputField("text", "img_url"); $form->registerForm(); $form->showForm(); echo "<div id='browse_button'><button onclick=\"window.open('redakcia/utilities/browser/browser.php?article_id=" . $this->article['id'] . "&target=img_url','image_browser','width=1000,height=500,scrollbars=yes')\">Prehľadávaj...</button></div>"; }
protected function remove_theme_form() { $form_id = $this->getFormID("remove_theme"); $form = new FormMaker(); $form->setID($form_id); $form->setClass("formular"); $form->addLabel("Vyber tému"); $form->addSelect('tema'); $form->addOption('tema', 'nazov', '---Vyber tému---', ''); foreach ($this->themes as $theme) { $form->addOption('tema', 'tema_' . $theme['id'], $theme['name'], $theme['id']); } $form->registerForm(); $form->showForm(); }
protected function change_password_form() { $form_id = $this->getFormID("change_pswd"); $form = new FormMaker(); $form->setID($form_id); $form->addInputField("hidden", "user_id"); $form->setValue("user_id", "'" . $_SESSION['user'] . "'"); $form->addLabel("Zadaj staré heslo"); $form->addInputField("password", "old_psswd", "required"); $form->addLabel("Zadaj nové heslo"); $form->addInputField("password", "new_psswd", "required psswd"); $form->addLabel("Potvrď heslo"); $form->addInputField("password", "confirm_psswd", "required psswd equals{new_psswd}"); $form->registerForm(); $form->showForm(); }
protected function add_article_form() { $form_id = $this->getFormID("add"); $form = new FormMaker(); $form->setID($form_id); $form->addLabel("Názov článku"); $form->addInputField("text", "name", "required nazov"); $form->addLabel("Zadaj typ článku"); $data = new DBQuery(CDatabaza::getInstance()); $data->setTable("Typ_clanku"); $types = $data->queryDB("select"); $form->addSelect("type"); $form->addOption("type", "", "--Zadaj typ článku--", ""); while ($type = $types->fetch_array()) { $form->addOption("type", "type_" . $type['typ_clanku_id'], $type['nazov'], $type['typ_clanku_id']); } $form->addLabel("Zadaj rubriku"); $data->setTable("Rubrika"); $topics = $data->queryDB("select"); $form->addSelect("topic"); $form->addOption("topic", "", "--Zadaj rubriku--", ""); while ($topic = $topics->fetch_array()) { $form->addOption("topic", "topic_" . $topic['rubrika_id'], $topic['nazov_rubriky'], $topic['rubrika_id']); } $form->showForm(); }