public function procede() { try { if ($this->oRequest->existParam('sitename')) { if (!$this->oRequest->existParam('lastfm')) { throw new Error('Une clé Last.FM est nécessaire au bon fonctionnement du script.', 4004); } if (!$this->oRequest->existParam('tvdb')) { throw new Error('Une clé TVDB est nécessaire au bon fonctionnement du script.', 4004); } $_SESSION['sitename'] = $this->oRequest->getParam('sitename', 'string'); $_SESSION['lastfm'] = $this->oRequest->getParam('lastfm', 'string'); $_SESSION['tvdb'] = $this->oRequest->getParam('tvdb', 'string'); $this->oView->addAlert('Application configurée. <b><a href="install.php?step=5">Poursuivre</a></b>', 'success'); } } catch (Exception $ex) { $this->oView->addAlert($ex, 'danger'); } finally { $this->oView->addData('titre', 'Etape 4 : Configuration'); //Création du formulaire $oForm = new FormGenerator(); $oForm->setAction('install.php?step=4'); $oForm->addInput('Nom du site', 'sitename', true, false, 'text', '', 'TKSearch'); $oForm->addInput('Clé API Last.FM', 'lastfm', true, false, 'text', 'Last.FM'); $oForm->addInput('Clé API TVDB', 'tvdb', true, false, 'text', 'TheTVDB.com'); $oForm->create(); $this->oView->addData('content', $oForm->getCode()); $this->oView->create(); } }
/** * Generate Form metafile * @return array array that contain file name of Form object metafile */ public function genFormMeta() { if (!$this->doGen) { $this->doGen = new DOGenerator($this->module, $this->dbname, $this->table, $this->dbConfig, $this->opts); $this->doGen->prepareData(); } $this->formGen = new FormGenerator($this->module, $this->doGen, $this->opts); $formFiles = $this->formGen->generateAllForms(); return $formFiles; }
public function procede() { try { if ($this->oRequest->existParam('login')) { //Connection à la base de donnée $oMysqli = new mysqli($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password'], $_SESSION['name']); if ($oMysqli->connect_error) { throw new Error('Impossible de se connecter à la base de donnée.', 4033); } $oMysqli->set_charset("utf8"); //Création de l'utilisateur if (!$this->oRequest->existParam('password')) { throw new Error('Vous devez renseigner un password.', 4033); } if (!$this->oRequest->existParam('email')) { throw new Error('Vous devez renseigner une adresse email.', 4033); } $sPassword = $this->oRequest->getParam('password', 'string'); $sConfirmation = $this->oRequest->getParam('confirmation', 'string'); if ($sPassword != $sConfirmation) { throw new Error("Le password et la confirmation ne correspondent pas.", 4033); } $sPassword = User::cryptPassword($sPassword); $oResult = $oMysqli->query("INSERT INTO `tks_users` (`id` ,`login` ,`pass` ,`mail` ,`passkey` ,`id_rank`)\r\n VALUES ('',\r\n '" . $this->oRequest->getParam('login', 'string') . "',\r\n '{$sPassword}',\r\n '" . $this->oRequest->getParam('email', 'string') . "', \r\n '" . md5($sPassword * rand()) . "',\r\n '1'); "); if ($oResult == false) { throw new Error('Impossible de créer l\'utilisateur.', 4034); } $this->oView->addAlert('Utilisateur créé. <b><a href="install.php?step=4">Poursuivre</a></b>', 'success'); } } catch (Exception $ex) { $this->oView->addAlert($ex, 'danger'); } finally { $this->oView->addData('titre', 'Etape 3 : Création du premier utilisateur'); //Création du formulaire $oForm = new FormGenerator(); $oForm->setAction('install.php?step=3'); $oForm->addInput('Identifiant', 'login', true, false, 'text', 'Username'); $oForm->addInput('Password', 'password', true, false, 'password', 'Password'); $oForm->addInput('Confirmation', 'confirmation', true, false, 'password', 'Password'); $oForm->addInput('Email', 'email', true, false, 'mail', '*****@*****.**'); $oForm->create(); $this->oView->addData('content', $oForm->getCode()); $this->oView->create(); } }
/** * This function checks if a form is valid * * @access protected * @global array $_ARRAYLANG array containing the language variables * @return boolean true if form is valid */ protected function validateForm() { global $_ARRAYLANG; if ($this->formGenerator === false) { // cannot save, no such entry \Message::add($_ARRAYLANG['TXT_CORE_RECORD_NO_SUCH_ENTRY'], \Message::CLASS_ERROR); return false; } else { if (!$this->formGenerator->isValid() || isset($this->options['validate']) && !$this->options['validate']($this->formGenerator)) { // data validation failed \Message::add($_ARRAYLANG['TXT_CORE_RECORD_VALIDATION_FAILED'], \Message::CLASS_ERROR); return false; } } return true; }
public function procede() { try { if ($this->oRequest->existParam('hostname')) { if (!$this->oRequest->existParam('username')) { throw new Error('Vous devez renseigner un Utilisateur.', 4013); } if (!$this->oRequest->existParam('password')) { throw new Error('Vous devez renseigner un Password.', 4013); } if (!$this->oRequest->existParam('name')) { throw new Error('Vous devez renseigner un Nom pour la base de donnée.', 4013); } //Connection à MySQL $_SESSION['hostname'] = $this->oRequest->getParam('hostname', 'string'); $_SESSION['username'] = $this->oRequest->getParam('username', 'string'); $_SESSION['password'] = $this->oRequest->getParam('password', 'string'); $_SESSION['name'] = $this->oRequest->getParam('name', 'string'); $oMysqli = new mysqli($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password']); if ($oMysqli->connect_error) { throw new Error('Impossible de se connecter à la base de donnée.', 4013); } $oMysqli->set_charset("utf8"); //Création de la table $oMysqli->query("CREATE DATABASE IF NOT EXISTS " . $_SESSION['name']); $this->oView->addAlert('Base de donnée configurée. <b><a href="install.php?step=2">Poursuivre</a></b>', 'success'); } } catch (Exception $ex) { $this->oView->addAlert($ex, 'danger'); } finally { $this->oView->addData('titre', 'Etape 1 : Création de la BDD'); //Création du formulaire $oForm = new FormGenerator(); $oForm->setAction('install.php'); $oForm->addInput('Hostname', 'hostname', true, false, 'text', '', 'localhost'); $oForm->addInput('Utilisateur', 'username', true, false, 'text', 'Username'); $oForm->addInput('Password', 'password', true, false, 'text', 'Password'); $oForm->addInput('Nom de la base', 'name', true, false, 'text', 'Name'); $oForm->create(); $this->oView->addData('content', $oForm->getCode()); $this->oView->create(); } }
/** * Create Add Popup * @param array $p_aCategories * @return string Code HTML */ private function createAddPopup($p_aCategories) { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addparser'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', Language::translate('PARSER_ADMIN_ADD_ADD')); $oPopupAdd->addData('title', Language::translate('PARSER_ADMIN_ADD_TITLE')); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=adminparser'); $oFormAdd->addInput(Language::translate('PARSER_ADMIN_ADD_NAME'), 'name', true, false, 'text', 'Nom ...'); $oFormAdd->addInput(Language::translate('PARSER_ADMIN_ADD_REGEX'), 'regex', true, false, 'text', 'expression1|expression2 ...'); $oFormAdd->addSelect(Language::translate('PARSER_ADMIN_ADD_CATEGORIE'), 'categorie', $p_aCategories); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
<?php session_start(); extract($_REQUEST); include_once "classes/commonfunctions.php"; include_once "form_generator.class.php"; $FormGeneratorClass = new FormGenerator(); unset($_SESSION['tmpField']); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Dynamic Form Builder</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script language="javascript" type="text/javascript" src="js/client.js"></script> </head> <body> <div align="left"> <h1>Create Dynamic Forms with javascript validatation and php script</h1> <br /><br /> </div> <?php if (isset($_REQUEST['ValidateCreateFormFlag']) && $_REQUEST['ValidateCreateFormFlag'] == 'true') { // Save basic form in db - Start $TableName = TableName($FormTitle); $FormGeneratorClass->setTableName($TableName); $FormGeneratorClass->setFormName($FormTitle); $SaveInDB = 0; if (isset($_REQUEST['SaveInDB'])) { $SaveInDB = 1;
case "DeleteStep": DeleteStep(); case "ChangeLevel": ChangeLevel(); //........................ //........................ case "SelectElements": SelectElements(); case "elementDelete": elementDelete(); case "SaveElement": SaveElement(); //........................ //........................ case "GetPursuitCode": echo FormGenerator::GetPursuitCode($_POST["LetterID"]); die; } function formsSelect() { $where = "1=1" . dataReader::makeOrder(); $dt = FGR_forms::select($where); $no = $dt->rowCount(); $temp = PdoDataAccess::fetchAll($dt, $_GET["start"], $_GET["limit"]); echo dataReader::getJsonData($temp, $no, $_GET["callback"]); die; } function formDelete() { $res = FGR_forms::RemoveForm($_POST["FormID"]); echo Response::createObjectiveResponse($res, "");
/** * Create ADD popup * @return string Code HTML */ private function createAddPopup() { //Popup d'ajout $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addkey'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', Language::translate('API_ADMIN_ADD_ADD')); $oPopupAdd->addData('title', Language::translate('API_ADMIN_ADD_TITLE')); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=adminapi'); $aOptions = User::getUsersSelect(); $oFormAdd->addSelect(Language::translate('API_ADMIN_ADD_USER'), 'user', $aOptions); $oFormAdd->addCheckbox(Language::translate('API_ADMIN_ADD_READ'), 'read', true); $oFormAdd->addCheckbox(Language::translate('API_ADMIN_ADD_WRITE'), 'write', false); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
<?php session_start(); extract($_REQUEST); include_once "classes/commonfunctions.php"; include_once "form_generator.class.php"; $FormGeneratorClass = new FormGenerator(); if (isset($_REQUEST['TableID']) && $_REQUEST['TableID'] != '') { $db->query("select * from form_elements where TableID='" . $_REQUEST['TableID'] . "'"); if ($db->num_rows() > 0) { $db->next_Record(); $FieldName = $db->f('HTML_Name'); $FormID = $db->f('FormID'); $FormDetails = FetchRecordByID($FormID, "TableID", "forms"); $DirectoryName = $FormDetails['TableName']; //delete_directory("forms/$DirectoryName"); $db->query("delete from form_elements where TableID='" . $_REQUEST['TableID'] . "'"); $db->query("ALTER TABLE {$DirectoryName} DROP COLUMN {$FieldName}"); $FormGeneratorClass->setTableName($DirectoryName); $FormGeneratorClass->setFormID($FormID); $FormInfo = $FormGeneratorClass->SetValuesSession(); $FormInfo["SaveInDB"] = 1; $FormGeneratorClass->UpdateForm($FormInfo); } showmessage("Form all related items deleted successfully"); } redirect("index.php", 0);
/** * Create ADD Popup * @param array $aTrackersSelect * @param array $aCategoriesSelect * @return string Code HTML */ private function createAddPopup($aTrackersSelect, $aCategoriesSelect) { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addrss'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', Language::translate('RSS_ADMIN_ADD_ADD')); $oPopupAdd->addData('title', Language::translate('RSS_ADMIN_ADD_TITLE')); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=adminrss'); $oFormAdd->addSelect(Language::translate('RSS_ADMIN_ADD_TRACKER'), 'tracker', $aTrackersSelect); $oFormAdd->addSelect(Language::translate('RSS_ADMIN_ADD_ENCODE'), 'encoding', Config::getEncodes()); $oFormAdd->addInput(Language::translate('RSS_ADMIN_ADD_URL'), 'url', true, false, 'text', 'URL ...'); $oFormAdd->addInput(Language::translate('RSS_ADMIN_ADD_MASK'), 'mask', true, false, 'text', 'http://montracker.fr/download/{PASSKEY}/{IDTORRENT}'); $oFormAdd->addCheckbox(Language::translate('RSS_ADMIN_ADD_DATE'), 'forcedate'); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
} $result = $thing->SearchRecipe($srchcriteria); if ($result == 0) { $message = "Recipe does not exist"; } } ?> <body> <div style="border-style: outset; width: 450px" align="left"> <h2 style="color: red" align="center">Welcome to Recipe System</h2> <h4 align="center"><label id=questionLabel ><? echo $message; ?></label></h4> <?php ini_set("display_errors", "On"); $thing = new Thing(); $form = new FormGenerator(); $form->generate($thing); ?> <input type="submit" name="Check" title="Check" value="Search Recipe"/> <h4> <a href='Add.php'>Add</a> </h4> <h4> <a href='UpdateRecipe.php'>Update</a> </h4> <h4> <a href='DeleteRecipe.php'>Delete</a> </h4> </div> </body> </form>
$col->width = 20; //--------------------------- $col = $dg->addColumn("عملیات", "", ""); $col->renderer = "operationRender"; $col->sortable = false; $col->width = 20; //--------------------------- $dg->height = 400; $dg->title = $ArchiveFlag ? "بایگانی شخصی" : "فرم های دریافتی"; $dg->width = 700; $dg->DefaultSortField = "regDate"; $dg->DefaultSortDir = "asc"; $dg->EnableSearch = false; $dg->makeGrid(); //..................................................... $drp_forms = FormGenerator::Drp_AllForms("FormsList", "---"); $drp_users = user_management::Drp_AllUsers("PersonID", "", "---"); //..................................................... ?> <script type="text/javascript"> dg_grid.getView().getRowClass = function(record, index) { if(record.data.ViewFlag == "0") return "yellowRow"; return; } </script> <style> .fail{background-image:url('../img/error.gif') !important;} .warning{background-image:url('../img/warning.gif') !important;} </style>
/** * Créer la popup d'importation de config * @return string Code HTML */ private function createImportPopup() { $aDir = scandir('./trackers/'); $aSelect = array(); foreach ($aDir as $sFile) { $iEnd = strpos($sFile, '.xml'); if ($iEnd != false) { $sTracker = substr($sFile, 0, $iEnd); $aSelect[$sTracker] = $sTracker; } } $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'importtracker'); $oPopupAdd->addData('buttonstyle', 'btn-warning'); $oPopupAdd->addData('buttonicon', 'fa-code'); $oPopupAdd->addData('buttontext', 'Importer'); $oPopupAdd->addData('title', 'Importer un Tracker'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=admintrackers'); $oFormAdd->addSelect('Tracker', 'import', $aSelect); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
$dg->addColumn('', "StepID", "string", true); //--------------------------- $col = $dg->addColumn("عملیات", "", ""); $col->renderer = "operationRender"; $col->sortable = false; $col->width = 30; //--------------------------- $dg->addButton("Add", "ایجاد", "add", "AddingAction"); $dg->height = 400; $dg->title = "فرم های ایجاد شده"; $dg->width = 700; $dg->DefaultSortField = "regDate"; $dg->DefaultSortDir = "asc"; $dg->makeGrid(); //..................................................... $drp_forms = FormGenerator::Drp_AllForms("FormsList", "---", "changeForm"); //..................................................... ?> <script type="text/javascript"> var forms_EXTData = <?php echo common_component::PHPArray_to_JSArray(dataAccess::RUNQUERY("select * from fm_forms order by FormName"), "FormName", "FormID", "reference"); ?> ; //------------------------------------------------------------------- BasisData.DevotionStore = <?php echo dataReader::MakeStoreObject("../devotions/dvt.data.php?task=select", "'dvt01','dvt2','dvt3','dvt10'"); ?> //----------------------------------------------------------------- BasisData.StateStore = <?php echo dataReader::MakeStoreObject("../states/states.data.php?task=select", "'sta02','sta2','sta5'");
public static function print_custom_fields($post, $callback_args = '') { //return; $content_type = $callback_args['args']; // the 7th arg from add_meta_box() $custom_fields = self::_get_custom_fields($content_type); $output = ''; // If no custom content fields are defined... if (empty($custom_fields)) { global $post; $post_type = $post->post_type; $url = sprintf('<a href="options-general.php?page=' . CCTM::admin_menu_slug . '&' . CCTM::action_param . '=4&' . CCTM::post_type_param . '=' . $post_type . '">%s</a>', __('Settings Page', CCTM::txtdomain)); print '<p>'; printf(__('Custom fields can be added and configured using the %1$s %2$s', CCTM::txtdomain), CCTM::name, $url); print '</p>'; return; } foreach ($custom_fields as $def_i => &$field) { $output_this_field = ''; $field['label'] = $field['label'] . ' (' . $field['name'] . ')'; // to display the name used in templates $field['value'] = htmlspecialchars(get_post_meta($post->ID, $field['name'], true)); $field['name'] = self::$prefix . $field['name']; // this ensures unique keys in $_POST } $output = FormGenerator::generate($custom_fields); // Print the form print '<div class="form-wrap">'; wp_nonce_field('update_custom_content_fields', 'custom_content_fields_nonce'); print $output; print '</div>'; }
/** * Create add popup * @return string HTML Code */ private function createAddPopup() { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addrank'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', Language::translate('RANKS_ADMIN_ADD_ADD')); $oPopupAdd->addData('title', Language::translate('RANKS_ADMIN_ADD_TITLE')); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=adminranks'); $oFormAdd->addInput(Language::translate('RANKS_ADMIN_ADD_NAME'), 'name', true, false, 'text', 'Nom ...'); $oFormAdd->addCheckbox(Language::translate('RANKS_ADMIN_ADD_DEFAULT'), 'default', false); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
private function createNewPasswordPopup() { //Création de la popup $oPopup = new View('popup'); $oPopup->addData('id', 'resetpass'); $oPopup->addData('buttonstyle', 'btn-default'); $oPopup->addData('buttonicon', 'fa-edit'); $oPopup->addData('buttontext', 'J\'ai perdu mes identifiants'); $oPopup->addData('title', 'Demande de mot de passe'); //Création du formulaire $oFormEdit = new FormGenerator(); $oFormEdit->setAction('index.php?p=login'); $oFormEdit->addInput('Email', 'email', true, false, 'text', 'Adresse email du compte'); $oFormEdit->create(); $oPopup->addData('content', $oFormEdit->getCode()); $oPopup->create(); return $oPopup->getCode(); }
private static function _page_edit_post_type($post_type) { // We can't edit built-in post types if (!self::_is_existing_post_type($post_type, false)) { self::_page_display_error(); return; } // Variables for our template (TODO: register this instead of this cheap inline trick) $style = '<style>' . file_get_contents(self::get_basepath() . '/css/create_or_edit_post_type_class.css') . '</style>'; $page_header = __('Edit Content Type: ') . $post_type; $fields = ''; $action_name = 'custom_content_type_mgr_edit_content_type'; $nonce_name = 'custom_content_type_mgr_edit_content_type_nonce'; $submit = __('Save', CCTM::txtdomain); $msg = ''; // Any validation errors $def = self::$post_type_form_definition; // Save data if it was properly submitted if (!empty($_POST) && check_admin_referer($action_name, $nonce_name)) { $sanitized_vals = self::_sanitize_post_type_def($_POST); $error_msg = self::_post_type_name_has_errors($sanitized_vals['post_type']); if (empty($error_msg)) { self::_save_post_type_settings($sanitized_vals); $msg = ' <script type="text/javascript"> window.location.replace("?page=' . self::admin_menu_slug . '"); </script>'; $msg .= '<div class="updated"><p>' . sprintf(__('Settings for %s have been updated.', CCTM::txtdomain), '<em>' . $sanitized_vals['post_type'] . '</em>') . '</p></div>'; self::_page_show_all_post_types($msg); // TODO: make this message persist across page refreshes return; } else { // This is for repopulating the form $def = self::_populate_form_def_from_data($def, $sanitized_vals); $msg = "<div class='error'>{$error_msg}</div>"; } } // get current values from database $data = get_option(self::db_key, array()); // Populate the form $def with values from the database $def = self::_populate_form_def_from_data($def, $data[$post_type]); $fields = FormGenerator::generate($def); include 'pages/basic_form.php'; }
<link REL="StyleSheet" TYPE="text/css" HREF="style.css"/> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://autobahn.tablesorter.com/jquery.tablesorter.js"></script> <script type="text/javascript" src="jsscripts.js"></script> </head> <body> <form method="post" name="addRecipe" > <input type="hidden" id="recordId" name="recordId" value="<?php echo $_GET['id'] ?>"/> <?php ini_set("display_errors", "On"); include_once 'Recipe.php'; include_once 'FormGenerator.php'; $recipe = new Recipe(); $testForm = new FormGenerator(); $testForm->generate($recipe, "Add"); if (empty($_POST["name"]) && empty($_POST["description"]) && empty($_POST["image"]) && empty($_POST["name"])) { echo 'Please Enter Recipe Information.'; } else { $thing = new Recipe(); echo $thing->saveRecipeWork(); echo 'Recipe Saved Successfully.'; } ?> </form> </body> </html>
/** * Créer la Popup d'ajout d'un utilisateur * @param \Rank $p_aRanks Rangs possibles * @return string */ private function createAddPopup($p_aRanks) { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'adduser'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', 'Ajouter'); $oPopupAdd->addData('title', 'Ajouter un utilisateur'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=adminusers'); $oFormAdd->addInput('Identifiant', 'login', true, false, 'text', 'Identifiant ...'); $oFormAdd->addInput('Password', 'password', true, false, 'password', 'Password ...'); $oFormAdd->addInput('Confirmation', 'confirmation', true, false, 'password', 'Confirmation ...'); $oFormAdd->addInput('Email', 'mail', true, false, 'text', 'Email ...'); $oFormAdd->addSelect('Rang', 'rank', $p_aRanks, Rank::getDefaultRank()->getId()); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
<?php require_once 'common.php'; $form = new FormGenerator($formArray, '', TRUE); if ($form->isValid()) { echo '<pre>'; var_dump($_POST); } else { ?> <!DOCTYPE html> <html> <head> <title>Page Title</title> <script type="text/javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.validation/1.14.0/jquery.validate.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.validation/1.14.0/additional-methods.min.js"></script> <style type="text/css"> label.error { color: red; font-weight: bold;} </style> </head> <body> <?php echo $form->display(); ?> </body> </html> <?php }
private function createTagsEdit() { //Suppression d'un tag $sTags = ''; foreach ($this->oRelease->getTags() as $iTagId => $oRegex) { $oButton = new View('button'); $oButton->addData('link', 'index.php?p=modrelease&a=deletetag&id=' . $this->oRelease->getId() . '&tag=' . $iTagId); $oButton->addData('icon', 'fa-times'); $oButton->addData('style', 'info'); $oButton->addData('text', $oRegex->getName()); $oButton->create(); $sTags .= $oButton->getCode() . ' '; } //Ajout d'un tag $aRegex = Regex::getSelectRegex(); $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addtag'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', 'Ajouter'); $oPopupAdd->addData('title', 'Ajouter un tag'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=modrelease&a=addtag&id=' . $this->oRelease->getId()); $oFormAdd->addSelect('Tag', 'tag', $aRegex); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); $sTags .= $oPopupAdd->getCode(); $this->oView->addData('tagsdelete', $sTags); }
// programmer: Jafarkhani // create Date: 89.02 //--------------------------- require_once 'header.php'; include_once '../global/public.php'; include_once '../formGenerator/form.class.php'; include_once '../devotions/dvt.class.php'; include_once '../states/states.class.php'; include_once '../rents/rnt.class.php'; $FormID = $_GET["FormID"]; $referenceID = $_GET["referenceID"]; $LetterID = isset($_GET["LetterID"]) ? $_GET["LetterID"] : ""; $fromPage = isset($_GET["from"]) ? $_GET["from"] : ""; $RefID = isset($_GET["RefID"]) ? $_GET["RefID"] : "0"; //__________________________________________________________ $formRecord = FormGenerator::select("FormID=" . $FormID); $formFile = $formRecord[0]["FileType"] == "" ? false : true; if ($formFile) { $fileContent = "<tr><td>" . file_get_contents("../../" . FormImagePath . "form" . $FormID . "." . $formRecord[0]["FileType"]) . "</td></tr>"; } $output = ""; //__________________________________________________________ switch ($formRecord[0]["reference"]) { case "devotions": $mainDateRecord = be_devotion::select("dvt01=" . $referenceID); $mainDateRecord = $mainDateRecord[0]; break; case "states": $mainDateRecord = be_state::select("sta02=" . $referenceID); $mainDateRecord = $mainDateRecord[0]; break;
function __autoload($class_name) { include $class_name . '.php'; } if (empty($_POST["name"]) && empty($_POST["description"]) && empty($_POST["image"]) && empty($_POST["url"])) { echo 'Please Enter Recipe Information.'; } else { $thing = new Recipe('', '', ''); //As Thing, the super parent class extends Tag. Tag construtor is invoked. echo $thing->RemoveThing("name", $_POST["name"]); //echo $thing->RemoveCreativeWork(); //echo $thing->RemoveRecipe(); echo 'Recipe Deleted Successfully.'; } ?> <body> <div style="border-style: outset; width: 450px" align="left"> <h2 align="center" style="color: red">Delete Recipe</h2> <h5 style="color: red"> <h5> <?php $recipe = new Recipe(); $form = new FormGenerator(); $form->generate($recipe); ?> <input type="submit" name="Check" title="Check" value="Delete Recipe" > <h4><a href='index.php'>Home</a></h4></td> </div> </body> </form> </html>
<?php require_once 'common.php'; ?> <!DOCTYPE html> <html> <head> <title>Demo of Form Generator class</title> <script type="text/javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.validation/1.14.0/jquery.validate.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.validation/1.14.0/additional-methods.min.js"></script> <style type="text/css"> label.error { color: red; font-weight: bold;} </style> </head> <body> <?php $form = new FormGenerator($formArray); echo $form->display(); ?> </body> </html>
/** * Créer la popup de signalisation * @return string Code HTML */ private function createSignalPopup($p_sType, $p_iId) { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'signal'); $oPopupAdd->addData('buttonstyle', 'btn-warning'); $oPopupAdd->addData('buttonicon', 'fa-exclamation-triangle'); $oPopupAdd->addData('buttontext', 'Signaler la fiche'); $oPopupAdd->addData('title', 'Signaler la fiche'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=fiche' . $p_sType . '&id=' . $p_iId); $oFormAdd->addTextArea('Commentaire', 'comment'); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Schema Creator</title> <link REL="StyleSheet" TYPE="text/css" HREF="style.css"/> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://autobahn.tablesorter.com/jquery.tablesorter.js"></script> <script type="text/javascript" src="jsscripts.js"></script> </head> <body> <form action="UpdateRecipe.php" method="post" name="updateRecipe"> <?php ini_set("display_errors", "On"); include_once 'Recipe.php'; include_once 'FormGenerator.php'; $recipe = new Recipe(); $form = new FormGenerator(); $form->generate($recipe, "Update"); if (strlen($_GET['id']) > 0) { $dal = new DBLayer(); $array = $dal->findone(array('_id' => new MongoId($_GET['id']))); echo "<script> $(document).ready(function(){ document.getElementById('name').value = '{$array['name']}'; document.getElementById('description').value = '{$array['description']}'; document.getElementById('image').value = '{$array['image']}'; document.getElementById('about').value = '{$array['author']}'; document.getElementById('author').value = '{$array['author']}'; document.getElementById('url').value = '{$array['url']}';
/** * This function returns the elementGroup for a DataElement * * @param string $field name of the field * @param object $dataElement the element of the field * @param array $fieldOptions options for the field * @return \Cx\Core\Html\Model\Entity\HtmlElement */ public function getDataElementGroup($field, $dataElement, $fieldOptions = array()) { $group = new \Cx\Core\Html\Model\Entity\HtmlElement('div'); $group->setAttribute('class', 'group'); $label = new \Cx\Core\Html\Model\Entity\HtmlElement('label'); $label->setAttribute('for', 'form-' . $this->formId . '-' . $field); $fieldHeader = $field; if (isset($fieldOptions['formtext'])) { $fieldHeader = FormGenerator::getFormLabel($fieldOptions, 'formtext'); } else { if (isset($fieldOptions['header'])) { $fieldHeader = FormGenerator::getFormLabel($fieldOptions, 'header'); } } $label->addChild(new \Cx\Core\Html\Model\Entity\TextElement($fieldHeader . ' ')); $group->addChild($label); $controls = new \Cx\Core\Html\Model\Entity\HtmlElement('div'); $controls->setAttribute('class', 'controls'); $controls->addChild($dataElement); if (isset($fieldOptions['tooltip'])) { $tooltipTrigger = new \Cx\Core\Html\Model\Entity\HtmlElement('span'); $tooltipTrigger->setAttribute('class', 'icon-info tooltip-trigger'); $tooltipTrigger->allowDirectClose(false); $tooltipMessage = new \Cx\Core\Html\Model\Entity\HtmlElement('span'); $tooltipMessage->setAttribute('class', 'tooltip-message'); $tooltipMessage->addChild(new \Cx\Core\Html\Model\Entity\TextElement($fieldOptions['tooltip'])); $controls->addChild($tooltipTrigger); $controls->addChild($tooltipMessage); } $group->addChild($controls); return $group; }
/** * Créer la popup d'ajout d'un passkey * @param array $aTrackers */ private function createPkAddPopup($aTrackers) { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addpk'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', 'Ajouter'); $oPopupAdd->addData('title', 'Ajouter un passkey'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=profil'); $oFormAdd->addSelect('Tracker', 'tracker', $aTrackers); $oFormAdd->addInput('Passkey', 'passkey', true, false, 'text', 'Mon passkey ...'); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }