function displayForm($camposPendientes) { if ($camposPendientes) { $error = '<p class="error">Hubo algunos problemas con el formulario que usted presentó. Por favor, complete correctamente los campos remarcados de abajo y haga clic en Enviar para volver a enviar el formulario.</p>'; } else { $error = '<p>por favor, rellene sus datos a continuación y haga clic en Enviar. Los campos marcados con un asterisco (*) son obligatorios.</p>'; } $resultados = array("error" => $error, "scriptUrl" => "index.php", "validacionNombreUsuario" => validateField("nombreUsuario", $camposPendientes), "valorNombreUsuario" => setValue("nombreUsuario"), "validacionApellidos" => validateField("apellidos", $camposPendientes), "valorApellidos" => setValue("apellidos"), "tipoMusicaRock" => setSelected("tipoMusica", "Rock"), "tipoMusicaPop" => setSelected("tipoMusica", "Pop"), "tipoMusicaRegee" => setSelected("tipoMusica", "Regee"), "tipoMusicaClasica" => setSelected("tipoMusica", "Clasica"), "tipoLibrosNovelaNegra" => setChecked("tipoLibros", "Novela Negra"), "tipoLibrosCienciaFiccion" => setChecked("tipoLibros", "Ciencia Ficcion"), "tipoLibrosFantasia" => setChecked("tipoLibros", "Fantasia")); $plantilla = "plantillas/encuestaForm.html"; $formulario = vista($resultados, $plantilla); $datos = array("titulo" => TITULO, "formulario" => $formulario); $plantilla = "plantillas/plantilla.html"; $html = vista($datos, $plantilla); print $html; }
function displayForm($missingFields) { $results = array("pageTitle" => "Membership Form", "scriptUrl" => "registration.php", "missingFields" => $missingFields, "firstNameAttrs" => validateField("firstName", $missingFields), "firstNameValue" => setValue("firstName"), "lastNameAttrs" => validateField("lastName", $missingFields), "lastNameValue" => setValue("lastName"), "genderAttrs" => validateField("gender", $missingFields), "genderMChecked" => setChecked("gender", "M"), "genderFChecked" => setChecked("gender", "F"), "favoriteWidgetOptions" => array("superWidget" => setSelected("favoriteWidget", "superWidget"), "megaWidget" => setSelected("favoriteWidget", "megaWidget"), "wonderWidget" => setSelected("favoriteWidget", "wonderWidget")), "newsletterChecked" => setChecked("newsletter", "yes"), "commentsValue" => setValue("comments")); require "templates/registration_form.php"; }
$zone_string .= '<option value="-1"' . setSelected('-1', $_POST['store_zone']) . '>' . '-- Please Select --' . '</option>'; $zone_string .= '<option value="0"' . setSelected('0', $_POST['store_zone']) . '>' . '-None-' . '</option>'; while (!$zone->EOF) { $zone_string .= '<option value="' . $zone->fields['zone_id'] . '"' . setSelected($zone->fields['zone_id'], $_POST['store_zone']) . '>' . $zone->fields['zone_name'] . '</option>'; $zone->MoveNext(); } $sql = "select code, name from " . DB_PREFIX . "languages"; $store_language = $db->Execute($sql); $language_string = ''; while (!$store_language->EOF) { $language_string .= '<option value="' . $store_language->fields['code'] . '"' . setSelected($store_language->fields['code'], $_POST['store_default_language']) . '>' . $store_language->fields['name'] . '</option>'; $store_language->MoveNext(); } $sql = "select title, code from " . DB_PREFIX . "currencies"; $currency = $db->Execute($sql) or die("error in {$sql}" . $db->ErrorMsg()); $currency_string = ''; while (!$currency->EOF) { $currency_string .= '<option value="' . $currency->fields['code'] . '"' . setSelected($currency->fields['code'], $_POST['store_default_currency']) . '>' . $currency->fields['title'] . '</option>'; $currency->MoveNext(); } $db->Close(); if (!isset($_POST['demo_install'])) { $_POST['demo_install'] = false; } setInputValue($_POST['store_name'], 'STORE_NAME_VALUE', ''); setInputValue($_POST['store_owner'], 'STORE_OWNER_VALUE', ''); setInputValue($_POST['store_owner_email'], 'STORE_OWNER_EMAIL_VALUE', ''); setInputValue($_POST['store_address'], 'STORE_ADDRESS_VALUE', STORE_ADDRESS_DEFAULT_VALUE); setRadioChecked($_POST['demo_install'], 'DEMO_INSTALL', 'false'); // this sets the first field to email address on login - setting in /common/tpl_main_page.php $zc_first_field = 'onload="document.getElementById(\'store_name\').focus()"';
function displayForm($missingFields) { ?> <h1>Membership Form</h1> <?php if ($missingFields) { ?> <p class="error">There were some problems with the form you submitted. Please complete the fields highlighted below and click Send Details to resend the form.</p> <?php } else { ?> <p>Thanks for choosing to join The Widget Club. To register, please fill in your details below and click Send Details. Fields marked with an asterisk (*) are required.</p> <?php } ?> <form action="registration.php" method="post"> <div style="width: 30em;"> <label for="firstName"<?php validateField("firstName", $missingFields); ?> >First name *</label> <input type="text" name="firstName" id="firstName" value="<?php setValue("firstName"); ?> " /> <label for="lastName"<?php validateField("lastName", $missingFields); ?> >Last name *</label> <input type="text" name="lastName" id="lastName" value="<?php setValue("lastName"); ?> " /> <label for="password1"<?php if ($missingFields) { echo ' class="error"'; } ?> >Choose a password *</label> <input type="password" name="password1" id="password1" value="" /> <label for="password2"<?php if ($missingFields) { echo ' class="error"'; } ?> >Retype password *</label> <input type="password" name="password2" id="password2" value="" /> <label<?php validateField("gender", $missingFields); ?> >Your gender: *</label> <label for="genderMale">Male</label> <input type="radio" name="gender" id="genderMale" value="M"<?php setChecked("gender", "M"); ?> /> <label for="genderFemale">Female</label> <input type="radio" name="gender" id="genderFemale" value="F"<?php setChecked("gender", "F"); ?> /> <label for="favoriteWidget">What's your favorite widget? *</label> <select name="favoriteWidget" id="favoriteWidget" size="1"> <option value="superWidget"<?php setSelected("favoriteWidget", "superWidget"); ?> >The SuperWidget</option> <option value="megaWidget"<?php setSelected("favoriteWidget", "megaWidget"); ?> >The MegaWidget</option> <option value="wonderWidget"<?php setSelected("favoriteWidget", "wonderWidget"); ?> >The WonderWidget</option> </select> <label for="newsletter">Do you want to receive our newsletter?</label> <input type="checkbox" name="newsletter" id="newsletter" value="yes"<?php setChecked("newsletter", "yes"); ?> /> <label for="comments">Any comments?</label> <textarea name="comments" id="comments" rows="4" cols="50"><?php setValue("comments"); ?> </textarea> <div style="clear: both;"> <input type="submit" name="submitButton" id="submitButton" value="Send Details" /> <input type="reset" name="resetButton" id="resetButton" value="Reset Form" style="margin-right: 20px;" /> </div> </div> </form> <?php }
function displaypaso2() { $datos = array("nombre" => setValue("nombre"), "apellidos" => setValue("apellidos"), "direccion" => setValue("direccion"), "telefono" => setValue("telefono"), "email" => setValue("email"), "foto" => $_FILES["foto"]["name"], "ciudadesRoma" => setSelected("ciudades", "Roma"), "ciudadesParis" => setSelected("ciudades", "Paris"), "ciudadesNueva York" => setSelected("ciudades", "Nueva York"), "ciudadesLondres" => setSelected("ciudades", "Londres"), "ciudadesBerlin" => setSelected("ciudades", "Berlin"), "ciudadesAtenas" => setSelected("ciudades", "Atenas"), "informacionCorreoPostal" => setChecked("informacion", "Correo Postal"), "informacionEmail" => setChecked("informacion", "Email")); $plantilla = "plantillas/paso2.html"; $formulario = vista($datos, $plantilla); $datos = array("titulo" => TITULO, "formulario" => $formulario); $plantilla = "plantillas/plantilla.html"; $html = vista($datos, $plantilla); print $html; }
function displayStep2() { ?> <h1>Member Signup: Step 2</h1> <form action="registration_multistep.php" method="post"> <div style="width: 30em;"> <input type="hidden" name="step" value="2" /> <input type="hidden" name="firstName" value="<?php setValue("firstName"); ?> " /> <input type="hidden" name="lastName" value="<?php setValue("lastName"); ?> " /> <input type="hidden" name="newsletter" value="<?php setValue("newsletter"); ?> " /> <input type="hidden" name="comments" value="<?php setValue("comments"); ?> " /> <label>Your gender:</label> <label for="genderMale">Male</label> <input type="radio" name="gender" id="genderMale" value="M"<?php setChecked("gender", "M"); ?> /> <label for="genderFemale">Female</label> <input type="radio" name="gender" id="genderFemale" value="F"<?php setChecked("gender", "F"); ?> /> <label for="favoriteWidget">What's your favorite widget? *</label> <select name="favoriteWidget" id="favoriteWidget" size="1"> <option value="superWidget"<?php setSelected("favoriteWidget", "superWidget"); ?> >The SuperWidget</option> <option value="megaWidget"<?php setSelected("favoriteWidget", "megaWidget"); ?> >The MegaWidget</option> <option value="wonderWidget"<?php setSelected("favoriteWidget", "wonderWidget"); ?> >The WonderWidget</option> </select> <div style="clear: both;"> <input type="submit" name="submitButton" id="nextButton" value="Next >" /> <input type="submit" name="submitButton" id="backButton" value="< Back" style="margin-right: 20px;" /> </div> </div> </form> <?php }
function displayForm($camposPendientes) { cabecera(); if ($camposPendientes) { ?> <p class="error">Hubo algunos problemas con el formulario que usted presentó. Por favor, complete correctamente los campos remarcados de abajo y haga clic en Enviar para volver a enviar el formulario.</p> <?php } else { ?> <p>por favor, rellene sus datos a continuación y haga clic en Enviar. Los campos marcados con un asterisco (*) son obligatorios.</p> <?php } ?> <form action = "" method = "post"> <fieldset> <label for="nombreUsuario" <?php validateField("nombreUsuario", $camposPendientes); ?> >Introduce tu nombre * </label> <input type = "text" name = "nombreUsuario" id="nombreUsuario" value="<?php setValue("nombreUsuario"); ?> "> <label for="apellidos" <?php validateField("apellidos", $camposPendientes); ?> >y tus apellidos *</label> <input type = "text" name = "apellidos" id="apellidos" value="<?php setValue("apellidos"); ?> " ><br><br> <label for="tipoMusica">¿Qué tipo de música te gusta escuchar?</label> <select name="tipoMusica[]" id="tipoMusica" size="4" multiple="multiple"> <option value="Rock"<?php setSelected("tipoMusica", "Rock"); ?> >Rock </option> <option value="Pop"<?php setSelected("tipoMusica", "Pop"); ?> >Pop </option> <option value="Regee"<?php setSelected("tipoMusica", "Regee"); ?> >Regee </option> <option value="Clásica"<?php setSelected("tipoMusica", "Clásica"); ?> >Clásica </option> </select><br><br> ¿Que tipo de libros lees? <br> <label for="novelaNegra">Novela Negra</label> <input type="checkbox" name="tipoLibros[]" id="novelaNegra" value="Novela Negra"<?php setChecked("tipoLibros", "Novela Negra"); ?> ><br> <label for="cienciaFiccion">Ciencia Ficción</label> <input type="checkbox" name="tipoLibros[]" id="cienciaFiccion" value="Ciencia Ficción" <?php setChecked("tipoLibros", "Ciencia Ficción"); ?> ><br> <label for="fantasia">Fantasía</label> <input type="checkbox" name="tipoLibros[]" id="fantasia" value="Fantasía" <?php setChecked("tipoLibros", "Fantasía"); ?> ><br><br> <input type = "submit" name="enviar" value="Enviar"> </fieldset> </form> <?php pie(); }
function displayForm($errorMessages, $missingFields, $member) { displayPageHeader("Sign up for the book club!"); if ($errorMessages) { foreach ($errorMessages as $errorMessage) { echo $errorMessage; } } else { ?> <p>Thanks for choosing to join our book club.</p> <p>To register, please fill in your details below and click Send Details.</p> <p>Fields marked with an asterisk (*) are required.</p> <?php } ?> <form action="register.php" method="post" style="margin-bottom: 50px;"> <div style="width: 30em;"> <input type="hidden" name="action" value="register" /> <label for="username"<?php validateField("username", $missingFields); ?> >Choose a username *</label> <input type="text" name="username" id="username" value="<?php echo $member->getValueEncoded("username"); ?> " /> <label for="password1"<?php if ($missingFields) { echo ' class="error"'; } ?> >Choose a password *</label> <input type="password" name="password1" id="password1" value="" /> <label for="password2"<?php if ($missingFields) { echo ' class="error"'; } ?> >Retype password *</label> <input type="password" name="password2" id="password2" value="" /> <label for="emailAddress"<?php validateField("emailAddress", $missingFields); ?> >Email address *</label> <input type="text" name="emailAddress" id="emailAddress" value="<?php echo $member->getValueEncoded("emailAddress"); ?> " /> <label for="firstName"<?php validateField("firstName", $missingFields); ?> >First name *</label> <input type="text" name="firstName" id="firstName" value="<?php echo $member->getValueEncoded("firstName"); ?> " /> <label for="lastName"<?php validateField("lastName", $missingFields); ?> >Last name *</label> <input type="text" name="lastName" id="lastName" value="<?php echo $member->getValueEncoded("lastName"); ?> " /> <label<?php validateField("gender", $missingFields); ?> >Your gender: *</label> <label for="genderMale">Male</label> <input type="radio" name="gender" id="genderMale" value="m"<?php setChecked($member, "gender", "m"); ?> /> <label for="genderFemale">Female</label> <input type="radio" name="gender" id="genderFemale" value="f"<?php setChecked($member, "gender", "f"); ?> /> <label for="favoriteGenre">What's your favorite genre?</label> <select name="favoriteGenre" id="favoriteGenre" size="1"> <?php foreach ($member->getGenres() as $value => $label) { ?> <option value="<?php echo $value; ?> "<?php setSelected($member, "favoriteGenre", $value); ?> ><?php echo $label; ?> </option> <?php } ?> </select> <label for="otherInterests">What are your other interests?</label> <textarea name="otherInterests" id="otherInterests" rows="4" cols="50"><?php echo $member->getValueEncoded("otherInterests"); ?> </textarea> <div style="clear: both;"> <input type="submit" name="submitButton" id="submitButton" value="Send Details" /> <input type="reset" name="resetButton" id="resetButton" value="Reset Form" style="margin-right: 20px;" /> </div> </div> </form> <?php displayPageFooter(); }
function displayForm($errorMessages, $missingFields, $member) { $logEntries = LogEntry::getLogEntries($member->getValue("id")); displayPageHeader("View member: " . $member->getValueEncoded("firstName") . " " . $member->getValueEncoded("lastName")); if ($errorMessages) { foreach ($errorMessages as $errorMessage) { echo $errorMessage; } } $start = isset($_REQUEST["start"]) ? (int) $_REQUEST["start"] : 0; $order = isset($_REQUEST["order"]) ? preg_replace("/[^ a-zA-Z]/", "", $_REQUEST["order"]) : "username"; ?> <form action="view_member.php" method="post" style="margin-bottom: 50px;"> <div style="width: 30em;"> <input type="hidden" name="memberId" id="memberId" value="<?php echo $member->getValueEncoded("id"); ?> " /> <input type="hidden" name="start" id="start" value="<?php echo $start; ?> " /> <input type="hidden" name="order" id="order" value="<?php echo $order; ?> " /> <label for="username"<?php validateField("username", $missingFields); ?> >Username *</label> <input type="text" name="username" id="username" value="<?php echo $member->getValueEncoded("username"); ?> " /> <label for="password">New password</label> <input type="password" name="password" id="password" value="" /> <label for="emailAddress"<?php validateField("emailAddress", $missingFields); ?> >Email address *</label> <input type="text" name="emailAddress" id="emailAddress" value="<?php echo $member->getValueEncoded("emailAddress"); ?> " /> <label for="firstName"<?php validateField("firstName", $missingFields); ?> >First name *</label> <input type="text" name="firstName" id="firstName" value="<?php echo $member->getValueEncoded("firstName"); ?> " /> <label for="lastName"<?php validateField("lastName", $missingFields); ?> >Last name *</label> <input type="text" name="lastName" id="lastName" value="<?php echo $member->getValueEncoded("lastName"); ?> " /> <label for="joinDate"<?php validateField("joinDate", $missingFields); ?> >Joined on *</label> <input type="text" name="joinDate" id="joinDate" value="<?php echo $member->getValueEncoded("joinDate"); ?> " /> <label<?php validateField("gender", $missingFields); ?> >Gender *</label> <label for="genderMale">Male</label> <input type="radio" name="gender" id="genderMale" value="m"<?php setChecked($member, "gender", "m"); ?> /> <label for="genderFemale">Female</label> <input type="radio" name="gender" id="genderFemale" value="f"<?php setChecked($member, "gender", "f"); ?> /> <label for="favoriteGenre">Favorite genre</label> <select name="favoriteGenre" id="favoriteGenre" size="1"> <?php foreach ($member->getGenres() as $value => $label) { ?> <option value="<?php echo $value; ?> "<?php setSelected($member, "favoriteGenre", $value); ?> ><?php echo $label; ?> </option> <?php } ?> </select> <label for="otherInterests">Other interests</label> <textarea name="otherInterests" id="otherInterests" rows="4" cols="50"><?php echo $member->getValueEncoded("otherInterests"); ?> </textarea> <div style="clear: both;"> <input type="submit" name="action" id="saveButton" value="Save Changes" /> <input type="submit" name="action" id="deleteButton" value="Delete Member" style="margin-right: 20px;" /> </div> </div> </form> <h2>Access log</h2> <table cellspacing="0" style="width: 30em; border: 1px solid #666;"> <tr> <th>Web page</th> <th>Number of visits</th> <th>Last visit</th> </tr> <?php $rowCount = 0; foreach ($logEntries as $logEntry) { $rowCount++; ?> <tr<?php if ($rowCount % 2 == 0) { echo ' class="alt"'; } ?> > <td><?php echo $logEntry->getValueEncoded("pageUrl"); ?> </td> <td><?php echo $logEntry->getValueEncoded("numVisits"); ?> </td> <td><?php echo $logEntry->getValueEncoded("lastAccess"); ?> </td> </tr> <?php } ?> </table> <div style="width: 30em; margin-top: 20px; text-align: center;"> <a href="view_members.php?start=<?php echo $start; ?> &order=<?php echo $order; ?> ">Back</a> </div> <?php displayPageFooter(); }
function displaypaso2() { $datos = array("nombre" => setValue("nombre"), "edad" => setValue("edad"), "email" => setValue("email"), "foto1" => $_FILES["foto1"]["name"], "foto2" => $_FILES["foto2"]["name"], "generosWestern" => setSelected("generos", "Western"), "generosComedia" => setSelected("generos", "Comedia"), "generosCiencia" => setSelected("generos", "Ciencia"), "generosTerror" => setSelected("generos", "Terror"), "generosSuspense" => setSelected("generos", "Suspense"), "generosDeportes" => setSelected("generos", "Deportes")); $plantilla = "plantillas/paso2.html"; $formulario = vista($datos, $plantilla); $datos = array("titulo" => TITULO, "formulario" => $formulario); $plantilla = "plantillas/plantilla.html"; $html = vista($datos, $plantilla); print $html; }
echo DATABASE_SESSION_INSTRUCTION . '<a href="javascript:popupWindow(\'popup_help_screen.php?error_code=22\')"> ' . TEXT_HELP_LINK . '</a>'; ?> </p> </div> <div class="section"> <select id="cache_type" name="cache_type" tabindex="13"> <option value="none"<?php echo setSelected('none', $_POST['cache_type']); ?> >None</option> <option value="file"<?php echo setSelected('file', $_POST['cache_type']); ?> >File</option> <option value="database"<?php echo setSelected('database', $_POST['cache_type']); ?> >Database</option> </select> <label for="cache_type"><?php echo CACHE_TYPE; ?> </label> <p><?php echo CACHE_TYPE_INSTRUCTION . '<a href="javascript:popupWindow(\'popup_help_screen.php?error_code=60\')"> ' . TEXT_HELP_LINK . '</a>'; ?> </p> </div> <div class="section"> <input type="text" id="sql_cache_dir" name="sql_cache_dir" tabindex="14" size="55" value="<?php echo SQL_CACHE_VALUE;
echo $_GET['enable_ssl']; ?> "> <fieldset> <legend><?php echo DATABASE_INFORMATION; ?> </legend> <div class="section"> <select id="db_type" name="db_type" tabindex="1"> <option value="mysql"<?php echo setSelected('mysql', $_POST['db_type']); ?> >MySQL</option> <!-- <option value="postgres"<?php echo setSelected('postgres', $_POST['db_type']); ?> >PostgreSQL</option> --> </select> <label for="db_type"><?php echo DATABASE_TYPE; ?> </label> <p><?php echo DATABASE_TYPE_INSTRUCTION . '<a href="javascript:popupWindow(\'popup_help_screen.php?language=' . $language . '&error_code=14\')"> ' . TEXT_HELP_LINK . '</a>'; ?> </p> </div> <?php if (!$zc_install->fatal_error) { //do not display prefix field if upgrading ... prefix can be edited on the database-upgrade page, next.
function displayForm2() { $datos = array( "error" => "", "scriptUrl" => "", "valorNombreUsuario" => setValue("nombre"), "valorApellidos" => setValue("apellidos"), "direccion" => setValue("direccion"), "telefono" => setValue("telefono"), "email" => setValue("email"), "foto" => $_FILES['foto']['name'], "ciudadesRoma" => setSelected('ciudades', 'Roma'), "ciudadesParis" => setSelected('ciudades', 'Paris'), "ciudadesNuevaYork" =>setSelected('ciudades', 'Nueva York'), "ciudadesLondres" =>setSelected('ciudades', 'Londres'), "ciudadesBerlin" => setSelected('ciudades', 'Berlin'), "ciudadesAtenas" => setSelected('ciudades', 'Atenas'), "informacionCorreoPostal" => setChecked('informacion', 'Correo Postal'), "informacionEmail" => setChecked("informacion", 'Email'), "valorMayorEdad" => setValue("mayorEdad") ); $plantilla = "plantillas/paso2.html"; $formulario = vista($datos, $plantilla); $datos = array( "titulo" => TITULO, "formulario" => $formulario ); $plantilla = "plantillas/plantilla.html"; $html = vista($datos, $plantilla); print ($html); }