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; }
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); }
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 }
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")); }
/** * getInstance * @return FormHandler object instance of the class */ public static function getInstance() { if (self::$instance == null) { self::$instance = new FormHandler(); } return self::$instance; }
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)); }
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(); }
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'); }
<?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}'";
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 . "' ";
<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);
$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');
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(); } }
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();
<?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"));
/** * dbFormHandler::isCorrect() * * Return if the form is filled correctly (for the fields which are set!) * * @return boolean: the form values valid or not * @access public * @author Teye Heimans */ function isCorrect() { $result = parent::isCorrect(); // check if there is no unique field error when the field is completly correct if ($result) { return $this->_checkUniqueFields(); } return false; }
<?php // include the class //include("includes/classes/class.FormHandler.php"); include "style.php"; // make a new $form object $form = new FormHandler(); // permit editing $form->PermitEdit(); echo "<span class=\"pageHeading\">Administratie gebruiker toevoegen</span><BR><BR>"; $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, "admin_users"); $form->textfield("Naam", "USER_NAME", "", "50"); $form->textfield("Loginnaam", "USER_LOGIN", "", "50"); $form->textfield("Wachtwoord", "USER_PASS", "", "50"); $form->textfield("E-mail", "USER_EMAIL", "", "50"); $form->hiddenfield("USER_IP", $_SERVER['REMOTE_ADDR']); // button beneath it (submit, reset and cancel!) $form->SubmitBtn("Opslaan", false, "Annuleren"); // what to do after saving ? $form->OnSaved("doRun"); // flush the form $form->FlushForm(); // 'commit after form' function function doRun($id, $data) { return "<META HTTP-EQUIV=\"Refresh\" Content= \"0; URL=index.php?page=adminusers\">"; } ?>
<?php 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.TabField.inc.php"); require_once "a2blib/Form/Class.TimeField.inc.php"; // require_once ("a2blib/Class.JQuery.inc.php"); $menu_section = 'menu_queues'; HelpElem::DoHelp(_("Logs are the technical entries, directly from asterisk, of queue events.")); $HD_Form = new FormHandler('ast_queue_log', _("Logs"), _("Log")); $HD_Form->checkRights(ACX_QUEUES); $HD_Form->default_order = 'tstamp'; $HD_Form->default_sens = 'DESC'; $HD_Form->init(); $PAGE_ELEMS[] =& $HD_Form; // $PAGE_ELEMS[] = new AddNewButton($HD_Form); $HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $HD_Form->model[] = new DateTimeFieldDH(_("Date"), "tstamp", _("Event date")); $HD_Form->model[] = new TextFieldN(_("Call"), 'callid', _("Asterisk call identifier.")); $HD_Form->model[] = new TextFieldN(_("Queue"), 'queuename', _("Queue name.")); $HD_Form->model[] = new TextFieldN(_("Agent"), 'agent', _("Agent which served the call, if any.")); $HD_Form->model[] = new TextFieldN(_("Event"), 'event', _("Asterisk event code.")); $HD_Form->model[] = dontList(new TextFieldN(_("P 1"), 'parm1', _("Event parameter 1."))); $HD_Form->model[] = dontList(new TextFieldN(_("P 2"), 'parm2', _("Event parameter 2."))); $HD_Form->model[] = dontList(new TextFieldN(_("P 3"), 'parm3', _("Event parameter 3."))); // $HD_Form->model[] = new DelBtnField(); require "PP_page.inc.php";
<?php 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"; $menu_section = 'menu_customers'; HelpElem::DoHelp(gettext("CallerID <br> Set the caller ID so that the customer calling in is authenticated on the basis of the callerID rather than with account number.")); $HD_Form = new FormHandler('cc_callerid', _("CallerIDs"), _("CallerID")); $HD_Form->checkRights(ACX_CUSTOMER); $HD_Form->init(); $PAGE_ELEMS[] =& $HD_Form; $PAGE_ELEMS[] = new AddNewButton($HD_Form); $HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $HD_Form->model[] = new TextFieldEH(_("Caller ID"), 'cid', _("Insert the CallerID")); $HD_Form->model[] = new SqlBigRefField(_("CardNumber"), "cardid", "cc_card", "id", "username"); end($HD_Form->model)->SetRefEntity("A2B_entity_card.php"); end($HD_Form->model)->SetRefEntityL("A2B_entity_card.php"); end($HD_Form->model)->SetEditTitle(_("Card ID")); $actived_list = array(); $actived_list[] = array('t', gettext("Active")); $actived_list[] = array('f', gettext("Inactive")); $HD_Form->model[] = new RefField(_("ACTIVATED"), "activated", $actived_list, _("Allow the callerID to operate"), "4%"); $HD_Form->model[] = new DelBtnField(); require "PP_page.inc.php"; ?>
<?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/Form/Class.RevRefForm.inc.php"; require_once "a2blib/Class.HelpElem.inc.php"; $menu_section = 'menu_did'; HelpElem::DoHelp(_("DID phonebooks help associate incoming CLIDs with names")); $HD_Form = new FormHandler('did_phonebook', _("DID Phonebooks"), _("DID phonebook")); $HD_Form->checkRights(ACX_DID); $HD_Form->init(); $PAGE_ELEMS[] =& $HD_Form; $PAGE_ELEMS[] = new AddNewButton($HD_Form); $HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $HD_Form->model[] = new TextFieldEH(_("Name"), 'name'); $HD_Form->model[] = new TextFieldN(_("Code"), 'code', _("A code, for syncing it with foreign ones.")); $HD_Form->model[] = dontList(new SqlRefFieldN(_("CLID Rules"), "rnplan", "cc_re_numplan", "id", "name", _("Use this book in those CLIDs only"))); $HD_Form->model[] = dontList(new SqlRefFieldN(_("Card Group"), "card_group", "cc_card_group", "id", "name", _("Use this book in that card group only"))); $HD_Form->model[] = dontList(new SqlBigRefField(_("Card"), "cardid", "cc_card", "id", "name", _("Use this book only for that card: private one."))); $HD_Form->model[] = new DelBtnField(); $tmp = new RevRefForm(_("Entries"), 'ints', 'id', 'did_pb_entry', 'pb'); $HD_Form->meta_elems[] = $tmp; $tmp->Form->checkRights(ACX_DID); $tmp->Form->init(); $tmp->Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $tmp->Form->model[] = new TextField(_("Name"), 'name'); $tmp->Form->model[] = new TextField(_("Number"), 'dnum', _('Number, in intermediate incoming format.'));
<?php 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.TabField.inc.php"); require_once "a2blib/Form/Class.TimeField.inc.php"; // require_once ("a2blib/Class.JQuery.inc.php"); $menu_section = 'menu_netmon'; HelpElem::DoHelp(_("Systems are any hardware or software entity.")); $HD_Form = new FormHandler('nm.system', _("Systems"), _("System")); $HD_Form->checkRights(ACX_NETMON); $HD_Form->default_order = 'id'; $HD_Form->default_sens = 'ASC'; $HD_Form->init(); $PAGE_ELEMS[] =& $HD_Form; $PAGE_ELEMS[] = new AddNewButton($HD_Form); $HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $HD_Form->model[] = new TextFieldEH(_("Name"), 'name'); $HD_Form->model[] = new TextField(_("Code"), 'code'); $HD_Form->model[] = new SqlRefFieldN(_("Parent"), "par_id", "nm.system", "id", "name"); //$HD_Form->model[] = new TextAreaField(_("Comment"),'comment'); $HD_Form->model[] = new DelBtnField(); require "PP_page.inc.php";
require "modules/base/includes/AjaxFilterLog.inc.php"; require_once "includes/FormHandler.php"; if (in_array("extticket", $_SESSION["supportModList"])) { require_once "modules/extticket/includes/menu_action.php"; } # infos messages global $result; # error messages global $error; # xmlrpc status global $errorStatus; // Class managing $_POST array if ($_POST) { $FH = new FormHandler("editUserFH", $_POST); } else { $FH = new FormHandler("editUserFH", array()); } switch ($_GET["action"]) { case "add": $mode = "add"; $title = _("Add user"); $activeItem = "add"; break; case "edit": $mode = "edit"; $title = _("Edit user"); $activeItem = "index"; $uid = $_GET["user"]; $FH->setArr(getDetailedUser($uid)); break; default:
<?php 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.TimeField.inc.php"; require_once "a2blib/Form/Class.ClauseField.inc.php"; $menu_section = 'menu_invoicing'; HelpElem::DoHelp(gettext("Invoices for regular clients")); $HD_Form = new FormHandler('cc_invoices', _("Invoices"), _("Invoice")); $HD_Form->checkRights(ACX_INVOICING); $HD_Form->default_order = 'id'; $HD_Form->default_sens = 'DESC'; $HD_Form->init(); $PAGE_ELEMS[] =& $HD_Form; // $PAGE_ELEMS[] = new AddNewButton($HD_Form); $HD_Form->model[] = new FreeClauseField('agentid IS NULL'); $HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $HD_Form->model[] = new SqlRefField(_("Card"), "cardid", "cc_card", "id", "username"); $HD_Form->model[] = new TextField(_("Ref"), "orderref"); $HD_Form->model[] = new DateTimeFieldDH(_("Start"), 'cover_startdate'); $HD_Form->model[] = new DateTimeField(_("Finish"), 'cover_enddate'); $HD_Form->model[] = dontList(new DateTimeField(_("Created"), 'created', _("Date this invoice was registered"))); $HD_Form->model[] = dontList(new MoneyField(_("Amount"), 'amount')); $HD_Form->model[] = dontList(new MoneyField(_("Tax"), 'tax')); $HD_Form->model[] = new MoneyField(_("Total"), 'total'); $HD_Form->model[] = new IntFieldN(_("Type"), "invoicetype"); //end($HD_Form->model)->refclause = "lang = 'C'"; $HD_Form->model[] = dontList(new TextFieldN(_("Filename"), "filename"));
end($SEL_Form->model)->does_add = false;*/ $SEL_Form->search_exprs['date_from'] = '>='; $SEL_Form->search_exprs['date_to'] = '<='; $SEL_Form->model[] = new TextSearchField(_("Destination"), 'destination'); $SEL_Form->model[] = new TextSearchField(_("Called number"), 'calledstation'); $SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Agent"), 'agid', 'cc_agent', 'id', 'name')); end($SEL_Form->model)->fieldexpr = '(SELECT agentid FROM cc_card,cc_card_group WHERE cc_card.grp = cc_card_group.id AND cc_card.id = cc_call_v.cardid)'; end($SEL_Form->model)->combofield = "name || ' ('|| login || ')'"; /*$SEL_Form->model[] = new SqlRefField(_("Plan"),'idrp','cc_retailplan','id','name', _("Retail plan")); end($SEL_Form->model)->does_add = false;*/ $SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Server"), 'srvid', 'cc_a2b_server', 'id', 'host')); $SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Trunk"), 'trunk', 'cc_trunk', 'id', 'trunkcode', _("Trunk used for the call"))); $PAGE_ELEMS[] =& $SEL_Form; // HelpElem::DoHelp(gettext("*-*"),'vcard.png'); $HD_Form = new FormHandler('cc_call_v', _("Calls"), _("Call")); $HD_Form->checkRights(ACX_CALL_REPORT); $HD_Form->default_order = 'starttime'; $HD_Form->default_sens = 'DESC'; $HD_Form->init(); $PAGE_ELEMS[] =& $HD_Form; $SEL_Form->enable($HD_Form->getAction() == 'list'); $HD_Form->model[] = DontList(new PKeyFieldTxt(_("Session ID"), 'sessionid')); $HD_Form->model[] = DontList(new PKeyFieldTxt(_("Unique ID"), 'uniqueid')); $HD_Form->model[] = DontList(new PKeyField(_("Card ID"), 'cardid')); // nasipaddress | text | // qval | double precision | $SEL_Form->appendClauses($HD_Form); $HD_Form->model[] = new DateTimeFieldDH(_("Start Time"), 'starttime'); $HD_Form->model[] = new TextField(_("Mode"), 'cmode'); $HD_Form->model[] = DontList(new DateTimeField(_("Stop Time"), 'stoptime'));
/** * Function to added new sign-ups in the notification * @public */ static public function create_notification_signup() { global $A2B; $FormHandler = FormHandler::GetInstance(); $id_card = $FormHandler -> RESULT_QUERY; NotificationsDAO::AddNotification("added_new_signup",Notification::$MEDIUM,Notification::$CUST,$id_card,Notification::$LINK_CARD,$id_card); }
* You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * **/ include '../lib/admin.defines.php'; include '../lib/admin.module.access.php'; include '../lib/Form/Class.FormHandler.inc.php'; include '../lib/admin.smarty.php'; set_time_limit(0); if (!has_rights(ACX_RATECARD)) { Header("HTTP/1.0 401 Unauthorized"); Header("Location: PP_error.php?c=accessdenied"); die; } $HD_Form = new FormHandler(); $HD_Form->setDBHandler(DbConnect()); $HD_Form->init(); $HD_Form->FG_DEBUG = 0; $HD_Form->FG_TABLE_ID = "id"; $HD_Form->FG_FILTER_SEARCH_SESSION_NAME = 'entity_ratecard_selection'; getpost_ifset(array('posted', 'ratecard_source', 'ratecard_destination', 'search_sources')); if ($posted == 1) { check_demo_mode(); $instance_table = new Table(); $bool = false; $ratecard_src_val = $ratecard_source; if (!is_numeric($ratecard_src_val)) { if ($bool) { $msg .= "<br>"; }
function FormHandler($tablename = null, $instance_name = null, $action = null, $tablename_count = null) { Console::log('Construct FormHandler'); Console::logMemory($this, 'FormHandler Class : Line ' . __LINE__); Console::logSpeed('FormHandler Class : Line ' . __LINE__); self::$Instance = $this; $this->FG_TABLE_NAME = $tablename; $this->FG_INSTANCE_NAME = $instance_name; $this->FG_TABLE_NAME_COUNT = $tablename_count; if ($this->FG_DEBUG) { echo "" . $this->Host . ""; } $this->set_regular_expression(); $this->_action = $action ? $action : $_SERVER['PHP_SELF']; $this->_vars = array_merge((array) $_GET, (array) $_POST); $this->def_list(); //initializing variables with gettext $this->CV_NO_FIELDS = gettext("No data found!"); $this->CV_TEXT_TITLE_ABOVE_TABLE = gettext("DIRECTORY"); $this->CV_TITLE_TEXT = $instance_name . ' ' . gettext("list"); $this->FG_FILTER_SEARCH_TOP_TEXT = gettext("Define criteria to make a precise search"); $this->FG_INTRO_TEXT = gettext("You can browse through our") . " #FG_INSTANCE_NAME# " . gettext("and modify their different properties") . '<br>'; $this->FG_DELETE_ALT = gettext("Delete this record"); $this->FG_EDIT_ALT = gettext("Edit this record"); $this->FG_ADITION_GO_EDITION_MESSAGE = gettext("The document has been created correctly. Now, you can define the different tariff that you want to associate."); $this->FG_INTRO_TEXT_EDITION = gettext("You can modify, through the following form, the different properties of your") . " #FG_INSTANCE_NAME#" . '<br>'; $this->FG_INTRO_TEXT_ASK_DELETION = gettext("If you really want remove this") . " #FG_INSTANCE_NAME#, " . gettext("Click on the delete button."); $this->FG_INTRO_TEXT_DELETION = gettext("One") . " #FG_INSTANCE_NAME# " . gettext("has been deleted!"); $this->FG_INTRO_TEXT_ADD = gettext("you can add easily a new") . " #FG_INSTANCE_NAME#.<br>" . gettext("Fill the following fields and confirm by clicking on the button add."); $this->FG_INTRO_TEXT_ADITION = gettext("Add a") . " \"#FG_INSTANCE_NAME#\" " . gettext("now."); $this->FG_TEXT_ADITION_CONFIRMATION = gettext("Your new") . " #FG_INSTANCE_NAME# " . gettext("has been inserted." . '<br>'); $this->FG_TEXT_ADITION_ERROR = '<font color="Red">' . gettext("Your new") . " #FG_INSTANCE_NAME# " . gettext("hasn't been inserted.") . '<br>' . "</font>"; $this->FG_TEXT_ERROR_DUPLICATION = gettext("You cannot choose more than one !"); $this->FG_FK_DELETE_MESSAGE = gettext("Are you sure to delete all records connected to this instance."); $this->FG_EDIT_PAGE_CONFIRM_BUTTON = gettext("CONFIRM DATA"); $this->FG_DELETE_PAGE_CONFIRM_BUTTON = gettext('DELETE'); $this->FG_ADD_PAGE_CONFIRM_BUTTON = gettext('CONFIRM DATA'); if ($this->FG_ENABLE_LOG == 1) { $this->logger = new Logger(); } }
$currencies_list = get_currencies(); $vat_amount= $amount*$vat/100; $mc_fee = (strcasecmp("paypal",$payment)==0)?round(($amount)/(1-0.049)-$amount,2)+0.36:0; //Test value: //$mc_fee = 0; $total_amount = $mc_fee+$amount+($amount*$vat/100); if (!isset($item_id) || is_null($item_id) || $item_id == "") { $item_id = 0; } if (!isset($item_type) || is_null($item_type)) { $item_type = ''; } $HD_Form = new FormHandler("cc_payment_methods","payment_method"); $HD_Form -> setDBHandler (DbConnect()); $HD_Form -> init(); $_SESSION["p_module"] = $payment; $_SESSION["p_amount"] = 3; $paymentTable = new Table(); $time_stamp = date("Y-m-d H:i:s"); $amount_string = sprintf("%.3F", $total_amount); $payment_modules = new payment($payment); $order = new order($amount_string); if (!isset($wm_purse_type)) { $paycur = 1;
Header("Location: PP_error.php?c=accessdenied"); die(); } $currencies_list = get_currencies(); $two_currency = false; if (!isset ($currencies_list[strtoupper($_SESSION['currency'])][2]) || !is_numeric($currencies_list[strtoupper($_SESSION['currency'])][2])) { $mycur = 1; } else { $mycur = $currencies_list[strtoupper($_SESSION['currency'])][2]; $display_currency = strtoupper($_SESSION['currency']); if (strtoupper($_SESSION['currency']) != strtoupper(BASE_CURRENCY)) $two_currency = true; } $HD_Form = new FormHandler("cc_payment_methods", "payment_method"); getpost_ifset(array ( 'item_id', 'item_type', 'payment_error' )); $DBHandle = DbConnect(); $HD_Form->setDBHandler($DBHandle); $HD_Form->init(); // #### HEADER SECTION $static_amount = false; $amount = 0;
<?php 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/Class.JQuery.inc.php"; $menu_section = 'menu_customers'; HelpElem::DoHelp(_("Asterisk users are the entries that provide SIP/IAX peers for asterisk."), 'vcard.png'); $HD_Form = new FormHandler('cc_ast_users', _("Users"), _("User")); $HD_Form->checkRights(ACX_CUSTOMER); $HD_Form->init(); $HD_Form->views['tooltip'] = new DetailsMcView(); $PAGE_ELEMS[] =& $HD_Form; $PAGE_ELEMS[] = new AddNewButton($HD_Form); $HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id'); $HD_Form->model[] = new SqlBigRefField(_("Card"), 'card_id', 'cc_card', 'id', 'username', _("Corresponding card")); $HD_Form->model[] = new SqlBigRefField(_("Booth"), 'booth_id', 'cc_booth', 'id', 'peername', _("Booth (if no card)")); $HD_Form->model[] = new SqlRefField(_("Config"), "config", "cc_ast_users_config", "id", "cfg_name"); $HD_Form->model[] = new BoolField(_("SIP"), 'has_sip', _("If true, the peer will have a SIP entry")); $HD_Form->model[] = new BoolField(_("IAX"), 'has_iax', _("If true, the peer will have a IAX2 entry")); $HD_Form->model[] = DontList(new TextFieldN(_("Default IP"), 'defaultip', _("Default IP to ring user at."))); $HD_Form->model[] = new TextField(_("Host"), 'host', _("Statically bind user with some IP/DNS or 'dynamic' for users that will register.")); end($HD_Form->model)->def_value = 'dynamic'; $HD_Form->model[] = new TextFieldN(_("Name B"), 'peernameb', _("Override asterisk username, so that a second device can be registered")); if (!session_readonly()) { $HD_Form->model[] = dontList(new TextFieldN(_("Secret B"), 'secretb', _("Override asterisk secret from card/booth, so that a second device can be registered"))); }