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>"; }
function getTable($res, $width = '850', $obj = '') { $extra_table_attr = array('width' => $width); $tbl = new HTML_Table(get_class($this), 'display', 0, 0, 2, $extra_table_attr); $frm = new HTML_Form(); $kk_trick = array(); $tbl->addRow('', $kk_trick, '<tfoot>'); $tbl->addCell(tableFooter($obj), NULL, 'data', array('colspan' => '5')); $tbl->addRow('main_table'); $tbl->addCell($frm->addInput('checkbox', 'checkboxall', '', array('class' => 'check-all')), 'first', 'header'); $tbl->addCell('Location', null, 'header'); $tbl->addCell('Time on site', null, 'header'); $tbl->addCell('User', null, 'header'); $tbl->addCell('On-Page', null, 'header'); $tbl->addCell('Referer', null, 'header'); $tbl->addCell('', null, 'header'); if ($res) { $objGeoIP = new GeoIP(); while ($res->fetch($res)) { $objGeoIP->search_ip($res->ip); if ($objGeoIP->found()) { $country = $objGeoIP->getCountryName(); } else { $country = $res->ip; } $check_this = $frm->addInput('checkbox', 'check_row[]', $res->id, array('id' => 'check_row[]')); $tbl->addRow($class); $tbl->addCell($check_this); $tbl->addCell('<a href="http://www.geoiptool.com/es/?IP=' . $res->ip . '" target="_blank">' . $country . '</a>'); $tbl->addCell(round(($res->hora - $res->conected_from) / 60, 2) . ' Min.'); $tbl->addCell($res->user != '' ? $res->user : '******'); $tbl->addCell('<a href="http://www.' . $web->domain . $res->page . '" target="_blank">' . $res->page . '</a>'); $tbl->addCell('<a href="' . $res->referer . '" target="_blank">' . substr($res->referer, 0, 20) . '</a>'); $tbl->addCell('<a href="admin-generic-edit.php?id=' . $res->id . '&fld=' . strtolower(get_class()) . '"> <img src="/template/kadmin/images/icons/pencil.png" alt="Edit" /> </a> <a href="admin-generic-list.php?id=' . $res->id . '&fld=' . strtolower(get_class()) . '&action=delete" onClick="return confirmDel();"> <img src="/template/kadmin/images/icons/cross.png" alt="Delete" /> </a>'); } } return $tbl->display(); }
/** * Produce a string containing the text provided inside a table row * * @param string $title the string used as the label * @param string $text a string to be displayed * @param string $thattr a string of additional attributes to be put * in the <th> element (example: 'class="foo"') * @param string $tdattr a string of additional attributes to be put * in the <td> element (example: 'class="foo"') * @return string * * @access public * @static * @see HTML_Form::displayPlaintext(), HTML_Form::displayPlaintextRow(), * HTML_Form::returnPlaintext(), HTML_Form::addPlaintext() */ function returnPlaintextRow($title, $text = ' ', $thattr = HTML_FORM_TH_ATTR, $tdattr = HTML_FORM_TD_ATTR) { $str = " <tr>\n"; $str .= ' <th ' . $thattr . '>' . $title . "</th>\n"; $str .= ' <td ' . $tdattr . ">\n "; $str .= HTML_Form::returnPlaintext($text) . "\n"; $str .= " </td>\n"; $str .= " </tr>\n"; return $str; }
<?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>";
$Id$ */ 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) {
print "<table>\n"; print " <tr>\n"; print " <td> </td>\n"; print " <td><b>{$errorMsg}</b></td>\n"; print " </tr>\n"; print "</table>\n"; } print "<form action=\"" . htmlspecialchars($_SERVER['PHP_SELF']) . "\" method=\"post\" name=\"request_form\">\n"; $bb = new BorderBox("Request a PECL account", "90%", "", 2, true); $bb->horizHeadRow("Username:"******"handle", $handle, 12)); $bb->horizHeadRow("First Name:", HTML_Form::returnText("firstname", $firstname)); $bb->horizHeadRow("Last Name:", HTML_Form::returnText("lastname", $lastname)); $bb->horizHeadRow("Password:"******"password", null, 10) . " Again: " . HTML_Form::returnPassword("password2", null, 10)); $bb->horizHeadRow("Need a php.net account?", HTML_Form::returnCheckbox("needsvn", $needsvn)); $bb->horizHeadRow("Email address:", HTML_Form::returnText("email", $email)); $bb->horizHeadRow("Show email address?", HTML_Form::returnCheckbox("showemail", $showemail)); $bb->horizHeadRow("Homepage", HTML_Form::returnText("homepage", $homepage)); $bb->horizHeadRow("Purpose of your PECL account<br />(No account is needed for using PECL or PECL packages):", HTML_Form::returnTextarea("purpose", stripslashes($purpose))); $bb->horizHeadRow("Sponsoring users<br />(Current php.net users who suggested you request an account and reviewed your extension/patch):", HTML_Form::returnTextarea("sponsor", stripslashes($sponsor))); $bb->horizHeadRow("More relevant information<br />about you (optional):", HTML_Form::returnTextarea("moreinfo", stripslashes($moreinfo))); $bb->horizHeadRow("Requested from IP address:", $_SERVER['REMOTE_ADDR']); $bb->horizHeadRow("<input type=\"submit\" name=\"submit\" value=\"Submit\" />"); $bb->end(); print "</form>"; if ($jumpto) { print "<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\n"; print "if (!document.forms[1].{$jumpto}.disabled) document.forms[1].{$jumpto}.focus();\n"; print "\n// -->\n</script>\n"; } } response_footer();
<?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>";
$month = isset($month) ? $month : null; $year = isset($year) ? $year : null; if (!isset($class)) { $class = 't'; } if (!isset($otherMonths)) { $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(); ?>
$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>";
| available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ $Id$ */ /** * Interface to update package information. */ auth_require(); require_once "HTML/Form.php"; $form = new HTML_Form(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES)); response_header("Edit package"); ?> <script language="javascript"> <!-- function confirmed_goto(url, message) { if (confirm(message)) { location = url; } } // --> </script> <?php
<?php ini_set("include_path", "/home/hromi1/kyberia/inc:/home/hromi1/kyberia/boxiky/"); include "redakce.inc"; $redakce = new CLASS_REDAKCE(); include "form.inc"; $LocalImageDir = "/home/hromi1/images/clanky/"; if ($id) { $article = $redakce->getArticleData($id); $article->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:", $article->getString("nazov")); $form->addText("autor", "Autor:", $article->getString("autor")); $form->addfile("title_image", "Titulni Obrazok:"); $form->addfile("image1", "Obrazok:"); $form->addfile("image2", "Obrazok:"); $form->addhidden("id", $id); $form->addfile("image3", "Obrazok:"); $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray()); $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray()); $form->addTextarea("short_desc", "Kraktky popis", $article->getString("short_desc"), 40, 6); $form->addTextarea("text1", "Text:", stripslashes($article->getString("text1")), 80, 23); $form->addTextarea("text2", "Text:", stripslashes($article->getString("text2")), 40, 6); $form->addTextarea("text3", "Text:", stripslashes($article->getString("text3")), 40, 6); $form->addTextarea("keywords", "Keywords:", stripslashes($article->getString("keywords")), 40, 6); $form->addSubmit("submit", "pridaj", ""); $form->display();
} echo $cmd; 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", "");
+----------------------------------------------------------------------+ $Id$ */ /** * Interface to delete a package. */ auth_require(true); response_header('Delete Package'); echo '<h1>Delete Package</h1>'; require_once "HTML/Form.php"; if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { report_error('No package ID specified.'); response_footer(); exit; } $form = new HTML_Form("/package-delete.php?id=" . $_GET['id'], "POST"); if (!isset($_POST['confirm'])) { $bb = new Borderbox("Confirmation"); $form->start(); echo "Are you sure that you want to delete the package?<br /><br />"; $form->displaySubmit("yes", "confirm"); echo " "; $form->displaySubmit("no", "confirm"); echo "<br /><br /><font color=\"#ff0000\"><b>Warning:</b> Deleting\n the package will remove all package information and all\n releases!</font>"; $form->end(); $bb->end(); } else { if ($_POST['confirm'] == "yes") { // XXX: Implement backup functionality // make_backup($_GET['id']); $tables = array("releases" => "package", "maintains" => "package", "deps" => "package", "files" => "package", "packages" => "id");
$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();