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>";
$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 { } #html_cal_cell_label { } #html_cal_cell { } xth {
$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>";
$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();