function printForm($data = array()) { // The first field that's empty $focus = ''; foreach (array('name', 'email', 'subject', 'text') as $key) { if (!isset($data[$key])) { $data[$key] = ''; $focus == '' ? $focus = $key : ''; } } $bb = new BorderBox('Send email'); $form = new HTML_Form(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES) . '?handle=' . htmlspecialchars($_GET['handle'], ENT_QUOTES), 'post', 'contact'); $form->addText('name', 'Your name:', $data['name'], 30); $form->addText('email', 'EMail address:', $data['email'], 30); $form->addText('subject', 'Subject:', $data['subject'], 30); $form->addTextarea('text', 'Text:', $data['text'], 35, 10); $form->addSubmit('submit', 'Submit'); $form->display(); $bb->end(); echo "<script language=\"JavaScript\">\n"; echo "<!--\n"; echo "document.forms.contact." . $focus . ".focus();\n"; echo "-->\n"; echo "</script>"; }
<?php include "../inc/redakce.inc"; $redakce = new CLASS_REDAKCE(); include "../inc/form.inc"; if ($submit == "pridaj") { $redakce->addRubrika($HTTP_POST_VARS); } $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie rubriky</title></head><body>\n"; $form->addText("nazov", "Nazov:", ""); $form->addText("description", "Popis:", ""); $form->addSelect("id_parent", "Rodicovska rubrika", $redakce->listRubrikyArray()); $form->addSubmit("submit", "pridaj", ""); $form->display(); echo "</body></html>";
require_once "HTML/Form.php"; response_header("PEAR Administration - Package maintainers"); if (isset($_GET['pid'])) { $id = (int) $_GET['pid']; } else { $id = 0; } $self = htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES); // Select package first if (empty($id)) { auth_require(true); $values = package::listAllNames(); $bb = new BorderBox("Select package"); $form = new HTML_Form($self); $form->addSelect("pid", "Package:", $values); $form->addSubmit(); $form->display(); $bb->end(); } else { if (!empty($_GET['update'])) { if (!isAllowed($id)) { PEAR::raiseError("Only the lead maintainer of the package or PEAR\n administrators can edit the maintainers."); response_footer(); exit; } $all = maintainer::get($id); // Transform $new_list = array(); foreach ((array) $_GET['maintainers'] as $maintainer) { list($handle, $role) = explode("||", $maintainer); $new_list[$handle] = $role;
<?php include "./inc/redakce.inc"; $redakce = new CLASS_REDAKCE(); include "./inc/form.inc"; $LocalImageDir = "/testwebs/kyberia/images/"; $LocalTitleImageDir = "/testwebs/kyberia/title_images/"; if ($submit == "update") { Copy($title_image, $LocalTitleImageDir . $title_image_name); Copy($image, $LocaImageDir . $image_name); $redakce->updateArticle($HTTP_POST_VARS, $title_image_name, $image_name); } $set = $redakce->getArticle($id); $set->next(); echo "<html><head><link rel=stylesheet type=\"text/css\" href=\"./kyberia.css\"></head>"; $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie clanku</title></head><body>\n"; $redakce->listArticles(); echo "<body><table><tr>\n"; $form->addText("nazov", "Nazov:", $set->getString('nazov')); $form->addText("autor", "Autor:", $set->getString('nazov')); $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray()); $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray()); $form->addText("id_forum", "ID forum:", $set->getString('id_forum')); $form->addText("id_forum_secondary", "ID forum sekundarne:", $set->getString('id_forum_secondary')); $form->addTextarea("short_desc", "Kratky popis", $set->getString('short_desc'), 40, 6); $form->addTextarea("text", "Text:", $set->getString('text'), 40, 6); $form->addSubmit("submit", "update", ""); $form->display(); echo "</body></html>";
$otherMonths = 't'; } if (!isset($navLinks)) { $navLinks = 't'; } if (!isset($size)) { $size = HTML_CALENDAR_FULL; } $tf = array('t' => 'True', 'f' => 'False'); $f = new HTML_Form($_SERVER['PHP_SELF'], 'post'); //$f->start(); $f->addSelect('class', 'Class:', $tf, $class); $f->addSelect('navLinks', 'Nav Links:', $tf, $navLinks); $f->addSelect('otherMonths', 'Other Months:', $tf, $otherMonths); $f->addSelect('size', 'Size:', array(HTML_CALENDAR_FULL => 'Full', HTML_CALENDAR_TINY => 'Tiny'), $size); $f->addSubmit(); //$f->end(); $cal = new MyHTML_Calendar(); $cal->setClass($class == 't'); $cal->setNavLinks($navLinks == 't'); $cal->setOtherMonths($otherMonths == 't'); $cal->setSize($size); $html = $cal->toHTML($day, $month, $year); $f->display(); ?> <style type="text/css"> #html_cal_table { } #html_cal_cell_table { }
$redakce->addIntro($HTTP_POST_VARS); } if ($submit == "pridajskin") { $redakce->addSkin($nazov, $address); } $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie rubriky</title></head><body>\n"; $form->addText("nazov", "Nazov:", ""); $form->addFile("obrazok", "Obrazok:", ""); $form->addSelect("id_parent", "Rodicovska rubrika", $redakce->listRubrikyArray()); $form->addSubmit("submit", "pridajrubriku", ""); $form->display(); echo "<br>"; $form2 = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); $form2->addText("title", "Titulok:", ""); $form2->addSubmit("submit", "pridajtitle", ""); $form2->display(); echo "<br>"; $form3 = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); $form3->addTextarea("text", "Text uvodniku:", "", 60, 60); $form3->addText("id_autor", "ID Autora:", ""); $form3->addSubmit("submit", "pridajintro", ""); $form3->display(); echo "<BR>"; $form4 = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); $form4->addText("nazov", "Nazov:", ""); $form4->addText("address", "Adresa:", ""); $form4->addSubmit("submit", "pridajskin", ""); $form4->display(); echo "<br>"; echo "</body></html>";
if ($cmd) { exec($cmd); } } if ($submit == "save") { if (isset($title_image_name)) { $redakce->addArticle($HTTP_POST_VARS, $title_image_name); } else { $redakce->addArticle($HTTP_POST_VARS); } } print_r($HTTP_POST_VARS); echo "<html><head><link rel=stylesheet type=\"text/css\" href=\"./kyberia.css\"></head>"; $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie clanku</title></head><body>\n"; $redakce->listArticles(); echo "<body><table><tr>\n"; $form->addText("nazov", "Nazov:", ""); $form->addText("autor", "Autor:", ""); $form->addfile("title_image", "Titulni Obrazok:"); $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray()); $form->addSelect("gallery", "Gallery", $redakce->listGalleryArray()); $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray()); $form->addTextarea("short_desc", "Kraktky popis", "", 40, 6); $form->addTextarea("text1", "Text:", "", 40, 6); $form->addTextarea("text2", "Text:", "", 40, 6); $form->addTextarea("text3", "Text:", "", 40, 6); $form->addSubmit("submit", "save", ""); $form->addSubmit("submit", "preview", ""); $form->display(); echo "</body></html>";
$row = $dbh->getRow('SELECT * FROM users WHERE handle = ?', array($handle)); $cvs_acl_arr = $dbh->getCol('SELECT path FROM cvs_acl' . ' WHERE username = ? AND access = 1', 0, array($handle)); $cvs_acl = implode("\n", $cvs_acl_arr); if ($row === null) { error_handler($handle . ' is not a valid account name.', 'Invalid Account'); } $form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post'); $form->addText('name', '<span class="accesskey">N</span>ame:', $row['name'], 40, null, 'accesskey="n"'); $form->addText('email', 'Email:', $row['email'], 40, null); $form->addCheckbox('showemail', 'Show email address?', $row['showemail']); $form->addText('homepage', 'Homepage:', $row['homepage'], 40, null); $form->addText('wishlist', 'Wishlist URI:', $row['wishlist'], 40, null); $form->addText('pgpkeyid', 'PGP Key ID:' . '<p class="cell_note">(Without leading 0x)</p>', $row['pgpkeyid'], 40, 20); $form->addTextarea('userinfo', 'Additional User Information:' . '<p class="cell_note">(limited to 255 chars)</p>', $row['userinfo'], 40, 5, null); $form->addTextarea('cvs_acl', 'SVN Access:', $cvs_acl, 40, 5, null); $form->addSubmit('submit', 'Submit'); $form->addHidden('handle', $handle); $form->addHidden('command', 'update'); $form->display('class="form-holder" style="margin-bottom: 2em;"' . ' cellspacing="1"', 'Edit Your Information', 'class="form-caption"'); print '<a name="password"></a>' . "\n"; print '<h2>» Manage your password</h2>' . "\n"; $form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post'); $form->addPlaintext('<span class="accesskey">O</span>ld Password:'******'password_old', '', 40, 0, 'accesskey="o"')); $form->addPassword('password', 'Password', '', 10, null); $form->addCheckbox('PEAR_PERSIST', 'Remember username and password?', ''); $form->addSubmit('submit', 'Submit'); $form->addHidden('handle', $handle); $form->addHidden('command', 'change_password'); $form->display('class="form-holder" cellspacing="1"', 'Change Password', 'class="form-caption"'); ob_end_flush(); response_footer();