public function formularioAction()
 {
     $form = new Formularios("form");
     $form->get("lenguaje")->setValueOptions(array('0' => 'Ingl�s', '1' => 'Espa�ol'));
     $form->get("genero")->setValueOptions(array('f' => 'Femenino', 'm' => 'Masculino', 'n' => 'no definido'));
     $form->get("oculto")->setAttribute("value", "87");
     $form->get("preferencias")->setValueOptions(array('m' => 'M�sica', 'd' => 'Deporte', 'o' => 'Ocio'));
     return new ViewModel(array("titulo" => "Formularios en ZF2", "form" => $form, 'url' => $this->getRequest()->getBaseUrl()));
 }
Пример #2
0
    /**
     * Back-end widget form.
     *
     * @see WP_Widget::form()
     *
     * @param array $instance Previously saved values from database.
     */
    function form($instance)
    {
        include_once "Formularios.php";
        include_once "EnvialoSimple.php";
        $ev = new EnvialoSimple();
        $ev->checkSetup("NoRedirect");
        $fo = new Formularios();
        $forms = $fo->listarFormularios();
        if (isset($instance['AdministratorID'])) {
            $AdministratorID = $instance['AdministratorID'];
        } else {
            $AdministratorID = $forms['AdministratorID'];
        }
        ?>
        <p>
         <input type="hidden" name="<?php 
        echo $this->get_field_name('AdministratorID');
        ?>
" value="<?php 
        echo $AdministratorID;
        ?>
" />
         <label for="<?php 
        echo $this->get_field_id('FormID');
        ?>
"><?php 
        _e('Formularios Disponibles:', 'envialo-simple');
        ?>
</label>
         <select id="<?php 
        echo $this->get_field_id('FormID');
        ?>
" name="<?php 
        echo $this->get_field_name('FormID');
        ?>
">
             <option><?php 
        _e("Seleccionar..", 'envialo-simple');
        ?>
</option>
             <?php 
        $htmlOption = "";
        foreach ($forms['list']['item'] as $f) {
            $selected = "";
            if ($f['FormID'] == $instance['FormID']) {
                $selected = "selected='selected'";
            }
            $htmlOption .= "<option {$selected} value='{$f['FormID']}'> {$f['Name']}</option>";
        }
        echo $htmlOption;
        ?>
         </select>
        </p>
        <?php 
    }
<?php

include_once ENVIALO_DIR . "/clases/EnvialoSimple.php";
include_once ENVIALO_DIR . "/clases/Formularios.php";
$ev = new EnvialoSimple();
$ev->checkSetup();
if (isset($GLOBALS["APIKey"])) {
    $fo = new Formularios();
    $formularios = $fo->mostrarFormularios();
} else {
    e_('Problema en la Configuración del Plugin', 'envialo-simple');
}
?>


<?php 
include_once ENVIALO_DIR . "/paginas/header.php";
?>
    
    <script type="text/javascript"> 
       
      jQuery(document).ready(function(){
                    
          jQuery("#modal-obtener-codigo").dialog({
                autoOpen : false,
                height : "500",
                width : "999",
                modal : true,
                position:"top",              
                title : "Obtener Código",
                close : function(event, ui) {
Пример #4
0
$user = isset($_GET['user']) ? $_GET['user'] : '';
$pass = isset($_GET['password']) ? $_GET['password'] : '';
$db = new DBmysql();
$conn = $db->connect();
$query = "SELECT * FROM usuarios";
$result = $conn->query($query);
$valid = false;
while ($row = mysqli_fetch_assoc($result)) {
    if ($row['usuario'] == $user && $row['password_android'] == $pass) {
        $valid = true;
    }
    //print_r($row);echo "<br>";
}
if (!$valid) {
    $enviar['respuesta'] = 0;
    $enviar['mensaje'] = "Credenciales incorrectas";
    $enviar['muestras'] = array();
    print_r($enviar);
} else {
    $formulario = new Formularios();
    $formularios = $formulario->getMuestras();
    $enviar = array();
    $enviar['respuesta'] = 1;
    $enviar['mensaje'] = "validado exitosamente";
    $enviar['muestras'] = $formularios;
    print_r($enviar);
    return json_encode($formulario->utf8ize($enviar));
    print_r($formularios);
    return $formularios;
}
return 0;
Пример #5
0
<?php

include_once ENVIALO_DIR . "/clases/EnvialoSimple.php";
include_once ENVIALO_DIR . "/clases/Campanas.php";
include_once ENVIALO_DIR . "/clases/Contactos.php";
include_once ENVIALO_DIR . "/clases/Formularios.php";
$ev = new EnvialoSimple();
$ev->checkSetup();
include_once ENVIALO_DIR . "/paginas/header.php";
$fo = new Formularios();
$emailsAdmin = $ev->obtenerEmailAdministrador();
$htmlSelectEmailAdminFrom = "";
foreach ($emailsAdmin["item"] as $e) {
    $htmlSelectEmailAdminFrom .= "<option value='{$e['EmailID']}'> {$e['Name']} ({$e["EmailAddress"]}) </option>";
}
$htmlSelectEmailAdminReply = $htmlSelectEmailAdminFrom;
if (isset($_GET['idFormulario']) && $_GET['idFormulario'] != 0) {
    $idFormulario = filter_var($_GET['idFormulario'], FILTER_SANITIZE_NUMBER_INT);
    $f = $fo->traerFormulario($idFormulario);
    $htmlSelectEmailAdminFrom = "<option selected='selected'>{$f['email']['FromName']} ({$f['email']['FromEmail']}) </option>" . $htmlSelectEmailAdminFrom;
    $htmlSelectEmailAdminReply = "<option selected='selected'>{$f['email']['ReplyToName']} ({$f['email']['ReplyToEmail']}) </option>" . $htmlSelectEmailAdminReply;
    $AdministratorID = $f['AdministratorID'];
} else {
    $f = array();
    $f['form']['Name'] = __('Nuevo Formulario de Suscripción', 'envialo-simple');
    $f['form']['LabelEmailAddress'] = __('Direccion de email:', 'envialo-simple');
    $f['form']['LabelSubmit'] = __('Suscribir', 'envialo-simple');
    $f['form']['BackgroundColor'] = '#E9E9E9';
    $f['form']['Width'] = "200";
    $f['form']['Font'] = 'Arial';
    $f['form']['FontSize'] = '12';
Пример #6
0
         echo json_encode($respuesta);
     }
     $json = array();
     $json['form'] = $respuesta['root']['ajaxResponse']['form'];
     $FormID = !empty($_POST["FormID"]) ? $_POST["FormID"] : $respuesta['root']['ajaxResponse']['form']['FormID'];
     $respuesta = json_decode($fo->guardarRemitenteResponder($FormID, $_POST['EmailID'], $_POST['Name'], $_POST['FromName'], $_POST['FromEmail'], $_POST['ReplyToName'], $_POST['ReplyToEmail'], $_POST['Content']), TRUE);
     if (!isset($respuesta['root']['ajaxResponse']['success'])) {
         echo json_encode($respuesta);
     }
     $json['email'] = $respuesta['root']['ajaxResponse']['email'];
     $json['success'] = TRUE;
     echo json_encode($json);
     break;
 case "eliminarForm":
     $ev->checkSetup();
     $fo = new Formularios();
     echo $fo->eliminarFormulario($_POST['FormID']);
     break;
 case "feedback":
     $ev->checkSetup();
     echo json_encode($ev->dejarFeedback($_POST["mensaje"]));
     break;
 case "copypaste":
     $ev->checkSetup();
     $co = new Contactos();
     if ($co->importarCopyPaste($_POST['CopyPaste'])) {
         echo $co->importarPreProcess();
     } else {
         echo json_encode(array("error", "importarCopyPaste"));
     }
     break;
Пример #7
0
<?php

include_once 'FormularioEntity.php';
include_once 'MunicipioEntity.php';
$formulario = new Formularios();
$formularios = $formulario->getFormularios();
$municipio = new Municipios();
$municipios = $municipio->getMunicipios();
$mun = json_decode($municipios);
$for = json_decode($formularios);
$dato = array();
$dato["municipios"] = $mun;
$dato["formularios"] = $for;
$dato = json_encode($dato);
print_r($dato);
return $dato;