本文整理汇总了PHP中FormHandler类的典型用法代码示例。如果您正苦于以下问题:PHP FormHandler类的具体用法?PHP FormHandler怎么用?PHP FormHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: passbuilder_template
function passbuilder_template($template)
{
$url = new UrlParams();
$current_role = Helper::getRole();
$urlParams = $url->getQueryArray();
if (array_key_exists('pass-builder', $urlParams)) {
if (is_user_logged_in()) {
if ($current_role != '') {
// form submit handle here
if ($_POST['formAction']) {
$handler = new FormHandler($_POST['formAction']);
$handler->handleSubmit();
}
if ($_GET['action']) {
$handler = new ActionHandler($_GET['action']);
$handler->fireAction();
}
return dirname(__FILE__) . '/templates/page-pass-template.php';
} else {
return dirname(__FILE__) . '/templates/page-permission-exceptions.php';
}
} else {
$loginUrl = ICL_LANGUAGE_CODE == 'en' ? get_site_url() . '/log-in/' : get_site_url() . '/da/log-in-2/';
wp_redirect($loginUrl);
}
}
return $template;
}
示例2: _parseEditMachineForm
function _parseEditMachineForm()
{
$FH = new FormHandler("editMachineFH", $_POST);
$name = $FH->getPostValue("name");
$description = $FH->getPostValue("description");
$enabled = $FH->getPostValue("shareEnabled") == "on" ? True : "";
return array($name, $description, $enabled);
}
示例3: add
function add()
{
// make a new $form object
$form = new FormHandler();
// permit editing
$form->PermitEdit();
echo "<span class=\"pageHeading\">Add files</span><BR><BR>";
$form->TableSettings('100%', 0, 1, 2, 'font-family:Verdana;font-size:10px;border: 1px solid grey');
// upload config
$config = array('path' => '../files/', 'type' => 'jpg jpeg png gif', 'exists' => 'rename', 'size' => '1000000');
// uploadfield
$form->uploadField('Image', 'image', $config);
// save the resized image as...
// MAKE SURE THAT THIS DIR EXISTS!
$saveAs = UPLOAD_DIR . '/thumbs';
// resize the image
//echo $saveAs;
$form->imageResize('image', $saveAs, UPLOAD_RESIZE_WIDTH);
$form->SubmitBtn("Opslaan", false, "Annuleren");
// what to do after saving ?
$form->OnCorrect("doRun");
// flush the form
$form->FlushForm();
// 'commit after form' function
}
示例4: login
function login()
{
$this->_fix_failedlogins();
if(MEMBER_ID < 1)
{
$this->Messager("请先在前台进行<a href='index.php?mod=account&code=login'><b>登录</b></a>",null);
}
$loginperm = $this->_logincheck();
if(!$loginperm) {
$this->Messager("累计 5 次错误尝试,15 分钟内您将不能登录。",null);
}
$this->Title="用户登录";
if ($this->CookieHandler->GetVar('referer')=='')
{
$this->CookieHandler->Setvar('referer',referer());
}
$action="admin.php?mod=login&code=dologin";
$question_select=FormHandler::Select('question',ConfigHandler::get('member','question_list'),0);
$role_type_select=FormHandler::Radio('role_type',ConfigHandler::get('member','role_type_list'),'normal');
ob_clean();
include(handler('template')->file("@admin/login"));
}
示例5: getInstance
/**
* getInstance
* @return FormHandler object instance of the class
*/
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new FormHandler();
}
return self::$instance;
}
示例6: setValidator
public function setValidator($validator = null)
{
if (count($this->getValidators()) === 0 && $validator instanceof FormHandler\Validator\FunctionCallable && is_array($validator->getCallable())) {
$callable = $validator->getCallable();
//detect if it is an optional validator
if ($callable[0] instanceof Validator && substr($callable[1], 0, 1) !== '_') {
parent::setValidator(new \FormHandler\Validator\NotEmpty());
}
}
return parent::setValidator(FormHandler::parseValidator($validator, $this));
}
示例7: add
function add()
{
if (isset($_GET['id'])) {
echo "<span class=\"pageHeading\">Wijzigen categorie</span><BR><BR>";
} else {
echo "<span class=\"pageHeading\">Invoeren nieuwe categorie</span><BR><BR>";
}
$form = new FormHandler();
$form->PermitEdit();
$form->TableSettings('100%', 0, 1, 2, 'font-family:Verdana;font-size:10px;border: 1px solid grey');
//$form->AddHTML($myhtml);
// set the database data (data from another file or so ? )
$form->UseDatabase(DB_DATABASE, "categories");
$form->textfield("Naam", "categories_name", "", "50");
$form->SubmitBtn("Opslaan", false, "Annuleren");
$form->OnSaved("doRun");
// flush the form
$form->FlushForm();
}
示例8: Main
function Main()
{
$this->CheckAdminPrivs('ucenter');
if(!is_file(UC_CLIENT_ROOT . './client.php')){
$this->Messager('Ucenter的客户端文件 <b>' . UC_CLIENT_ROOT . './client.php' . "</b> 不存在,请检查",null);
}
if(!is_file(ROOT_PATH . './api/uc.php')){
$this->Messager('Ucenter的api文件 <b>' . UC_CLIENT_ROOT . './client.php' . "</b> 不存在,请检查",null);
}
$ucenter = ConfigHandler::get('ucenter');
$uc_enable_radio = FormHandler::YesNoRadio('ucenter[enable]',(bool) $ucenter['enable']);
${"uc_connect_{$ucenter['uc_connect']}_checked"} = " checked ";
include handler('template')->file('@admin/ucenter');
}
示例9: FormHandler
<?php
require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once DIR_COMMON . "Form.inc.php";
require_once DIR_COMMON . "Class.HelpElem.inc.php";
require_once DIR_COMMON . "Form/Class.SqlRefField.inc.php";
require_once DIR_COMMON . "Form/Class.TimeField.inc.php";
require_once DIR_COMMON . "Form/Class.ClauseField.inc.php";
$menu_section = 'menu_charge';
HelpElem::DoHelp(_("Charges are money transactions apart from calls. They are used to indicate that the customer should pay or receive extra money."));
$HD_Form = new FormHandler('cc_card_charge', _("Charges"), _("Charge"));
$HD_Form->checkRights(ACX_ACCESS);
$HD_Form->init();
// $HD_Form->views['list']=new ListView();
// $HD_Form->views['details'] = new DetailsView();
$PAGE_ELEMS[] =& $HD_Form;
//$PAGE_ELEMS[] = new AddNewButton($HD_Form);
// TODO: put static fields and fix them!
$HD_Form->views['ask-del'] = $HD_Form->views['delete'] = null;
$HD_Form->views['ask-add'] = $HD_Form->views['add'] = null;
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new ClauseField('agentid', $_SESSION['agent_id']);
$HD_Form->model[] = new SqlBigRefField(_("Card"), "card", "cc_card", "id", "username");
$HD_Form->model[] = new DateTimeFieldDH(_("Date"), 'creationdate');
$HD_Form->model[] = new SqlRefField(_("Type"), "chargetype", "cc_texts", "id", "txt");
$lng = getenv('LANG');
if (empty($lng) || $lng == 'en_US') {
$lng = 'C';
}
end($HD_Form->model)->refclause = "lang = '{$lng}'";
示例10: session_start
session_start();
// check if the script has been already called in the previous minute, no multiple signup
if (!isset($_SESSION["date_activation"]) || time() - $_SESSION["date_activation"] > 0) {
$_SESSION["date_activation"] = time();
} else {
sleep(3);
echo gettext("Sorry the activation has been sent already, please wait 1 minute before making any other try !");
exit;
}
// get include
include './lib/customer.defines.php';
include './lib/customer.module.access.php';
include './lib/Form/Class.FormHandler.inc.php';
include './lib/customer.smarty.php';
getpost_ifset(array('key'));
$HD_Form = new FormHandler("cc_card", "User");
$HD_Form->setDBHandler(DbConnect());
$HD_Form->init();
// HEADER SECTION
$smarty->display('signup_header.tpl');
if (empty($key)) {
$key = null;
}
$result = null;
$instance_sub_table = new Table('cc_card', "username, lastname, firstname, email, uipass, credit, useralias, loginkey, status, id");
$QUERY = "( loginkey = '" . $key . "' )";
$list = $instance_sub_table->Get_list($HD_Form->DBHandle, $QUERY);
if (isset($key) && $list[0][8] != "1") {
if ($A2B->config["signup"]['activated']) {
// Status : 1 - Active
$QUERY = "UPDATE cc_card SET status = 1 WHERE ( status = 2 OR status = 3 ) AND loginkey = '" . $key . "' ";
示例11: FormHandler
<tr>
<td class="bgcolor_004" align="left" > </td>
<td class="bgcolor_005" align="center" >
<input type="image" name="image16" align="top" border="0" src="<?php echo Images_Path;?>/button-search.gif" />
</td>
</tr>
</table>
</FORM>
<?php
$HD_Form = new FormHandler("pnl_report","PNL Report");
$HD_Form -> setDBHandler (DbConnect());
$HD_Form -> init();
$condition1=str_replace('cdr.starttime','date',$condition);
$condition2=str_replace('cdr.starttime','firstusedate',$condition);
$payphones=$A2B->config["webui"]["report_pnl_pay_phones"];
$tallfree=$A2B->config["webui"]["report_pnl_tall_free"];
$payphones=str_replace(' ','',$payphones);
$tallfree=str_replace(' ','',$tallfree);
$payphones=str_replace('),(',' ,1 as dnid_type union select ',$payphones);
$payphones=str_replace(')',' ,1 ',$payphones);
$tallfree=str_replace('),(',' ,2 union select ',$tallfree);
$tallfree=str_replace(')',' ,2 ',$tallfree);
示例12: FreeClauseField
$tmp->Form->views['list']->page_cols = 2;
$tmp->Form->model[] = new FreeClauseField("sessionbill IS NOT NULL");
$tmp->Form->model[] = new FreeClauseField("sessiontime > 0");
$tmp->Form->model[] = new DateTimeField(_("Time"), 'starttime');
$tmp->Form->model[] = new TextField(_("Number"), 'calledstation');
$tmp->Form->model[] = new TextField(_("Destination"), 'destination');
$tmp->Form->model[] = new SecondsField(_("Duration"), 'sessiontime');
end($tmp->Form->model)->fieldacr = _("Dur");
//$tmp->Form->model[] = new PKeyFieldTxt(_("ID"),'id');
$tmp->Form->model[] = new MoneyField(_("Bill"), 'sessionbill');
//one non-summed group
$tmp->Form->views['list']->sums[] = array('fns' => array('starttime' => true, 'calledstation' => true, 'destination' => true, 'sessiontime' => true, 'sessionbill' => true), 'order' => 'starttime');
//Per day/destination
$tmp->Form->views['list']->sums[] = array('title' => _("Sum per destination"), 'fns' => array('starttime' => false, 'destination' => true, 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'), 'order' => 'sessiontime', 'sens' => 'DESC');
$tmp->Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('calledstation' => 'COUNT', 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'));
$hform = new FormHandler('cc_card');
$hform->checkRights(ACX_INVOICING);
$hform->init(null, false);
$hform->setAction('details');
$hform->views['details'] = new DetailsView();
$hform->model[] = new FreeClauseField(str_dbparams(A2Billing::DBHandle(), 'id = (SELECT cardid FROM cc_invoices WHERE id = %#1)', array($dform->getpost_dirty('id'))));
//$hform->model[] = new PKeyField(_("ID"),'id');
$hform->model[] = new TextField(_("Local number"), 'useralias');
$hform->model[] = new TextFieldN(_("First name"), 'firstname');
$hform->model[] = new TextFieldN(_("Last name"), 'lastname');
$hform->model[] = new TextAreaField(_("Address"), 'address');
$hform->model[] = new TextFieldN(_("City"), 'city');
$hform->model[] = new TextFieldN(_("State"), 'state');
$hform->model[] = new TextFieldN(_("Country"), 'country');
$hform->model[] = new TextFieldN(_("Zipcode"), 'zipcode');
//$hform->model[] = new TextFieldN(_("Phone"),'phone');
示例13: _userquota_baseGroupEdit
function _userquota_baseGroupEdit($ldapArr, $postArr)
{
$FH = new FormHandler("editGroupQuota", $postArr);
$FH->setArr($ldapArr);
$components = getActiveComponents();
if ($components["disk"]) {
$f = new DivForModule(_T("Quota plugin - Filesystem", "userquota"), "#FDD");
$f->push(new Table());
$f = addDiskQuotas($f, $FH);
$f->add(new TrCommentElement(_T("Quota's applied here affect all members of the group", "userquota")));
$overwrite = new RadioTpl("diskoverwrite");
$overwrite->setChoices(array(_T("Overwrite all existing quotas", "userquota"), _T("Current quota is smaller than the new quota, or does not exist", "userquota"), _T("Current quota is larger than the new quota, or does not exist", "userquota"), _T("Don't overwrite any existing quotas", "userquota")));
$overwrite->setValues(array("all", "smaller", "larger", "none"));
$overwrite->setSelected("none");
$f->add(new TrFormElement(_T("Overwrite mode for existing quotas", "userquota"), $overwrite));
$f->pop();
$f->display();
}
if ($components["network"]) {
$f = new DivForModule(_T("Quota plugin - Network", "userquota"), "#FFD");
$f->push(new Table());
$f = addNetworkQuotas($f, $FH);
$f->add(new TrCommentElement(_T("Quota's applied here affect all members of the group", "userquota")));
$overwrite = new RadioTpl("networkoverwrite");
$overwrite->setChoices(array(_T("Overwrite all existing quotas", "userquota"), _T("Current quota is smaller than the new quota, or does not exist", "userquota"), _T("Current quota is larger than the new quota, or does not exist", "userquota"), _T("Don't overwrite any existing quotas", "userquota")));
$overwrite->setValues(array("all", "smaller", "larger", "none"));
$overwrite->setSelected("none");
$f->add(new TrFormElement(_T("Overwrite mode for existing quotas", "userquota"), $overwrite));
$f->pop();
$f->display();
}
}
示例14: FormHandler
require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.ClauseField.inc.php";
require_once "a2blib/Form/Class.TextSearchField.inc.php";
require_once "a2blib/Form/Class.SelectionForm.inc.php";
require_once "a2blib/Form/Class.TabField.inc.php";
require_once "a2blib/Class.JQuery.inc.php";
$menu_section = 'menu_customers';
HelpElem::DoHelp(gettext("Customers are listed below by card number. Each row corresponds to one customer, along with information such as their call plan, credit remaining, etc.</br>" . "The SIP and IAX buttons create SIP and IAX entries to allow direct VoIP connections to the Asterisk server without further authentication."), 'vcard.png');
$HD_Form = new FormHandler('cc_card', _("Customers"), _("Customer"));
$HD_Form->checkRights(ACX_CUSTOMER);
$HD_Form->init();
$HD_Form->views['tooltip'] = new DetailsMcView();
$HD_Form->model[] = new TabField(_("Card information"));
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Card number"), 'username', _('Card username. Also the PIN for callingcards'));
$HD_Form->model[] = new TextField(_("Card alias"), 'useralias', _("Alias, also the number *-*"));
$HD_Form->model[] = new SqlRefField(_("Group"), "grp", "cc_card_group", "id", "name");
if ($HD_Form->getAction() != 'tooltip') {
$HD_Form->model[] = dontList(new PasswdField(_("Card pass"), 'userpass', 'alnum', _("PIN")));
}
$HD_Form->model[] = new FloatVolField(_("Credit"), 'credit', _("Money now in the card. Positive is credit, negative owes us."));
$HD_Form->model[] = new FloatVolField(_("Credit Limit"), 'creditlimit', _("Maximum (negative) credit this card can reach, if postpaid."));
end($HD_Form->model)->fieldacr = _("CLim");
$cs_list = array();
示例15: customers
<?php
require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
$menu_section = 'menu_billing';
HelpElem::DoHelp(_("Subscriptions are customers (cards) being attached to a recurring fee or special service."));
$HD_Form = new FormHandler('card_subscription', _("Subscriptions"), _("Subscription"));
$HD_Form->checkRights(ACX_BILLING);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new SqlBigRefField(_("Card"), "card", "cc_card", "id", "username");
$HD_Form->model[] = new SqlRefField(_("Kind"), "template", "subscription_template", "id", "name");
$cs_list = array();
$cs_list[] = array("0", _("Inactive"));
$cs_list[] = array("1", _("Active"));
//$cs_list[] = array("2", _("..."));
$HD_Form->model[] = dontAdd(new RefField(_("Status"), 'status', $cs_list));
$HD_Form->model[] = dontAdd(dontList(new DateTimeField(_("Creation date"), "creationdate", _("Date the subscription was registered"))));
end($HD_Form->model)->fieldacr = _("Creat");
$HD_Form->model[] = new DateTimeFieldN(_("Activation date"), "activedate", _("Date it becomes active"));
end($HD_Form->model)->fieldacr = _("Activ");
$HD_Form->model[] = new DateTimeFieldN(_("Expire date"), "expiredate", _("After this date it is no longer charged or used."));
end($HD_Form->model)->fieldacr = _("Exp.");
// $HD_Form->model[] = dontList(new SqlRefFieldN(_("CLID Rules"), "rnplan","cc_re_numplan", "id", "name"));