Пример #1
0
function formulario($codigo, $accion, $activarFormulario)
{
    /*inicio datos*/
    $nombres = $_POST["nombres"];
    $apellidos = $_POST["apellidos"];
    $identificacion = $_POST["identificacion"];
    $pais = $_POST["pais"];
    $vegetariano = $_POST["vegetariano"];
    $talla = $_POST["talla"];
    $restriccion = $_POST["restriccion"];
    $empresa = $_POST["empresa"];
    $cargo = $_POST["cargo"];
    $correo = $_POST["correo"];
    $telefono = $_POST["telefono"];
    $celular = $_POST["celular"];
    $fechanacimiento_anio = $_POST["fechanacimiento_anio"];
    $fechanacimiento_mes = $_POST["fechanacimiento_mes"];
    $fechanacimiento_dia = $_POST["fechanacimiento_dia"];
    $ciudad = $_POST["ciudad"];
    $aeropuerto = $_POST["aeropuerto"];
    $perfil = $_POST["perfil"];
    $twitter = $_POST["twitter"];
    $facebook = $_POST["facebook"];
    $skype = $_POST["skype"];
    $otroidioma = $_POST["otroidioma"];
    $espanol = $_POST["espanol"];
    $ingles = $_POST["ingles"];
    $gruposanguineo = $_POST["gruposanguineo"];
    $rh = $_POST["rh"];
    $contacto = $_POST["contacto"];
    /*fin datos*/
    $cantidad = 0;
    $coloralerta = '#ffcc99';
    $colornormal = '#cccccc';
    /*----------------------------------------*/
    $activo = 'disabled="disabled"';
    $validacion = ' onblur="javascript:if(this.value==\'\')this.style.borderColor=\'' . $coloralerta . '\'; else this.style.borderColor=\'' . $colornormal . '\';"   ';
    if ($activarFormulario == 'SI') {
        $activo = '';
    }
    $activo .= $validacion;
    $htm .= '<form action="registro.php" method="post" enctype="multipart/form-data" >';
    $htm .= '    <table width="100%">';
    /*CABEZOTE*/
    $htm .= '        <tr>';
    $htm .= '            <td COLSPAN=2 ALIGN=CENTER  style="background-color: #336699">';
    $htm .= '                <font color="WHITE"><b>FORMULARIO (Información del rutero)</b></font>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*NOMBRES*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Nombres:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="nombres" ' . $activo . ' id="nombres" VALUE="' . $nombres . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*APELLIDOS*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Apellidos:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="apellidos" ' . $activo . ' id="apellidos" VALUE="' . $apellidos . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*IDENTIFICACION*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>No. Identificación:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="identificacion" ' . $activo . ' id="identificacion" VALUE="' . $identificacion . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*FECHA NACIMIENTO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Fecha de nacimiento:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <font size=2 color="#999999">año</font><input type="text" size=4 name="fechanacimiento_anio" ' . $activo . ' id="fechanacimiento_anio" VALUE="' . $fechanacimiento_anio . '" />-';
    $htm .= '                <font size=2 color="#999999">mes</font><input type="text" size=2 name="fechanacimiento_mes" ' . $activo . ' id="fechanacimiento_mes" VALUE="' . $fechanacimiento_mes . '" />-';
    $htm .= '                <font size=2 color="#999999">dia</font><input type="text" size=2 name="fechanacimiento_dia" ' . $activo . ' id="fechanacimiento_dia" VALUE="' . $fechanacimiento_dia . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*PAIS*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>País:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=12 name="pais" ' . $activo . ' id="pais" VALUE="' . $pais . '" />';
    $htm .= '                <font size=2 color="#999999">Ciudad:</font><input type="text" size=12 name="ciudad" ' . $activo . ' id="ciudad" VALUE="' . $ciudad . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*AEROPUERTO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Aeropuerto de partida (lugar de origen de viaje):</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="aeropuerto" ' . $activo . ' id="aeropuerto" VALUE="' . $aeropuerto . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*VEGETARIANO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Vegetariano:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <select id="vegetariano" name="vegetariano" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($vegetariano == 'Si') {
        $htm .= '                    <option selected value="Si">Si</option>';
    } else {
        $htm .= '                    <option value="Si">Si</option>';
    }
    if ($vegetariano == 'No') {
        $htm .= '                    <option selected value="No">No</option>';
    } else {
        $htm .= '                    <option value="No">No</option>';
    }
    $htm .= '                </select>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*TALLA CAMISA*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Talla Camisa:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <select id="talla" name="talla" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($talla == 'S') {
        $htm .= '                    <option selected value="S">S</option>';
    } else {
        $htm .= '                    <option value="S">S</option>';
    }
    if ($talla == 'M') {
        $htm .= '                    <option selected value="M">M</option>';
    } else {
        $htm .= '                    <option value="M">M</option>';
    }
    if ($talla == 'L') {
        $htm .= '                    <option selected value="L">L</option>';
    } else {
        $htm .= '                    <option value="L">L</option>';
    }
    if ($talla == 'XL') {
        $htm .= '                    <option selected value="XL">XL</option>';
    } else {
        $htm .= '                    <option value="XL">XL</option>';
    }
    $htm .= '                </select>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*RESTRICCION FISICA*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Restricción física:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="restriccion" ' . $activo . ' id="restriccion" VALUE="' . $restriccion . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*IDIOMAS*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>IDIOMAS:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <b>Ingles:</b><select id="ingles" name="ingles" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($ingles == 'Si') {
        $htm .= '                    <option selected value="Si">Si</option>';
    } else {
        $htm .= '                    <option value="Si">Si</option>';
    }
    if ($ingles == 'No') {
        $htm .= '                    <option selected value="No">No</option>';
    } else {
        $htm .= '                    <option value="No">No</option>';
    }
    $htm .= '                </select>';
    $htm .= '            <b>Español:</b>';
    $htm .= '                <select id="espanol" name="espanol" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($espanol == 'Si') {
        $htm .= '                    <option selected value="Si">Si</option>';
    } else {
        $htm .= '                    <option value="Si">Si</option>';
    }
    if ($espanol == 'No') {
        $htm .= '                    <option selected value="No">No</option>';
    } else {
        $htm .= '                    <option value="No">No</option>';
    }
    $htm .= '                </select>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Otro idioma:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="otroidioma" ' . $activo . ' id="otroidioma" VALUE="' . $otroidioma . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*GRUPO SANGUINEO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Grupo Sanguineo:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=12 name="gruposanguineo" ' . $activo . ' id="gruposanguineo" VALUE="' . $gruposanguineo . '" />';
    $htm .= '                <b>RH:</b> <input type="text" size=12 name="rh" ' . $activo . ' id="rh" VALUE="' . $rh . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*PERSONA CONTACTO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Persona de contacto:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="contacto" ' . $activo . ' id="contacto" VALUE="' . $contacto . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*EMPRESA*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Empresa o Institución que representa:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="empresa" ' . $activo . ' id="empresa" VALUE="' . $empresa . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*PERFIL OCUPACIONAL*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Perfil ocupacional , trayectoria y/o logros</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="perfil" ' . $activo . ' id="perfil" VALUE="' . $perfil . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*CARGO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Cargo:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="cargo" ' . $activo . ' id="cargo" VALUE="' . $cargo . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*CORREO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Correo:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="correo" ' . $activo . ' id="correo" VALUE="' . $correo . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*twitter*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>twitter:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="twitter" ' . $activo . ' id="twitter" VALUE="' . $twitter . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*facebook*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>facebook:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="facebook" ' . $activo . ' id="facebook" VALUE="' . $facebook . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*skype*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>skype:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="skype" ' . $activo . ' id="skype" VALUE="' . $skype . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*TELEFONO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Teléfono:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="telefono" ' . $activo . ' id="telefono" VALUE="' . $telefono . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*CELULAR*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                <b>Celular:</b>';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="celular" ' . $activo . ' id="celular" VALUE="' . $celular . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*FOTO*/
    $htm .= '        <tr>';
    $htm .= '            <td style="width:120px">';
    $htm .= '                <b>Foto:</b>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    $htm .= '        <tr>';
    $htm .= '            <td colspan=2>';
    $htm .= '                <input size=40 name="imagen" id="imagen" type="file"  ' . $activo . ' />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*--------------------------*/
    $htm .= '    </table>';
    $htm .= '    <input type="hidden" id="accion" name="accion" value="ingresarformulario" />';
    $htm .= '    <input type="hidden" id="codigo" name="codigo" value="' . $codigo . '" />';
    $htm .= '    <center><input type="submit" id=submit name=submit VALUE="Enviar" ' . $activo . '/></center>';
    if ($accion == 'ingresarformulario') {
        /*INICIO EN ESTE BLOQUE SE ESTABLECE QUE ES OBLIGATORIO*/
        $htm .= '<script>';
        $htm .= validarDato('nombres', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('apellidos', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('identificacion', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('pais', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('vegetariano', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('talla', $coloralerta, $colornormal, $cantidad);
        //$htm.=validarDato('restriccion',$coloralerta,$colornormal,$cantidad);
        $htm .= validarDato('empresa', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('cargo', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('correo', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('telefono', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('celular', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('fechanacimiento_anio', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('fechanacimiento_mes', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('fechanacimiento_dia', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('ciudad', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('aeropuerto', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('perfil', $coloralerta, $colornormal, $cantidad);
        /*$htm.=validarDato('twitter',$coloralerta,$colornormal,$cantidad);
        		$htm.=validarDato('facebook',$coloralerta,$colornormal,$cantidad);
        		$htm.=validarDato('skype',$coloralerta,$colornormal,$cantidad);
        		$htm.=validarDato('otroidioma',$coloralerta,$colornormal,$cantidad);*/
        $htm .= validarDato('espanol', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('ingles', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('gruposanguineo', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('rh', $coloralerta, $colornormal, $cantidad);
        //$htm.=validarDato('contacto',$coloralerta,$colornormal,$cantidad);
        $htm .= '</script>';
        /*FIN EN ESTE BLOQUE SE ESTABLECE QUE ES OBLIGATORIO*/
        if ($cantidad == 0) {
            $nuevoNombre = '';
            if (is_uploaded_file($_FILES['imagen']['tmp_name'])) {
                if ($_FILES['imagen']['type'] == "image/jpeg" || $_FILES['imagen']['type'] == "image/pjpeg") {
                    $nuevoNombre = $identificacion . ".jpg";
                }
                //mover la imagen
                move_uploaded_file($_FILES['imagen']['tmp_name'], "fotos/{$nuevoNombre}");
                //obtener la inforamción
                $data = GetImageSize("fotos/{$nuevoNombre}");
            }
            $query .= 'INSERT INTO exitosas_registro.registro (nombres, apellidos, identificacion, pais, vegetariano, talla, restriccion, empresa, cargo, correo, telefono, celular, fechanacimiento_anio,';
            $query .= 'fechanacimiento_mes, fechanacimiento_dia, ciudad, aeropuerto, perfil, twitter, facebook, skype, otroidioma, espanol, ingles, gruposanguineo, rh, contacto,foto) ';
            $query .= 'VALUES ("' . $nombres . '","' . $apellidos . '","' . $identificacion . '","' . $pais . '","' . $vegetariano . '","' . $talla . '","' . $restriccion . '","' . $empresa . '","' . $cargo . '",';
            $query .= '"' . $correo . '","' . $telefono . '","' . $celular . '","' . $fechanacimiento_anio . '","' . $fechanacimiento_mes . '","' . $fechanacimiento_dia . '","' . $ciudad . '",';
            $query .= '"' . $aeropuerto . '","' . $perfil . '","' . $twitter . '","' . $facebook . '","' . $skype . '","' . $otroidioma . '","' . $espanol . '","' . $ingles . '","' . $gruposanguineo . '",';
            $query .= '"' . $rh . '","' . $contacto . '","' . $nuevoNombre . '");';
            $result = mysql_query($query);
            if (!$result) {
                return "<font color=red>Consulta invalida: " . mysql_error() . "</font>";
                die('Invalid query: ' . mysql_error());
            } else {
                $htm .= '    <center>SUS DATOS SE HAN REGISTRADO CON EXITO!!</center>';
                $htm .= '<script>';
                $htm .= desactivar('nombres');
                $htm .= desactivar('apellidos');
                $htm .= desactivar('identificacion');
                $htm .= desactivar('pais');
                $htm .= desactivar('vegetariano');
                $htm .= desactivar('talla');
                $htm .= desactivar('restriccion');
                $htm .= desactivar('empresa');
                $htm .= desactivar('cargo');
                $htm .= desactivar('correo');
                $htm .= desactivar('telefono');
                $htm .= desactivar('celular');
                $htm .= desactivar('fechanacimiento_anio');
                $htm .= desactivar('fechanacimiento_mes');
                $htm .= desactivar('fechanacimiento_dia');
                $htm .= desactivar('ciudad');
                $htm .= desactivar('aeropuerto');
                $htm .= desactivar('perfil');
                $htm .= desactivar('twitter');
                $htm .= desactivar('facebook');
                $htm .= desactivar('skype');
                $htm .= desactivar('otroidioma');
                $htm .= desactivar('espanol');
                $htm .= desactivar('ingles');
                $htm .= desactivar('gruposanguineo');
                $htm .= desactivar('rh');
                $htm .= desactivar('contacto');
                $htm .= desactivar('submit');
                $htm .= '</script>';
                /*enviar correo*/
                $mensaje .= 'INSCRIPCION RUTA 2012

Nombres:                     ' . $nombres . ' 
-------------------------------------------------------------------------------
Apellidos:                   ' . $apellidos . ' 
-------------------------------------------------------------------------------
No. Identificacion:          ' . $identificacion . ' 
-------------------------------------------------------------------------------
Pais:                        ' . $pais . ' - ' . $ciudad . '   
-------------------------------------------------------------------------------
Aeropuerto:                  ' . $aeropuerto . '
-------------------------------------------------------------------------------
Vegetariano:                 ' . $vegetariano . '
-------------------------------------------------------------------------------
Ingles:                      ' . $ingles . '
-------------------------------------------------------------------------------
Español:                     ' . $espanol . '
-------------------------------------------------------------------------------
Talla Camisa:                ' . $talla . '
-------------------------------------------------------------------------------
Restriccion fisica:          ' . $restriccion . '
-------------------------------------------------------------------------------
Empresa o Institucion que representa: ' . $empresa . ' 
-------------------------------------------------------------------------------
Cargo:                       ' . $cargo . '
-------------------------------------------------------------------------------
Grupo Sanguineo:             ' . $gruposanguineo . ' ' . $rh . ' 
-------------------------------------------------------------------------------
Correo:                      ' . $correo . ' 
-------------------------------------------------------------------------------
Contacto:                    ' . $contacto . ' 
-------------------------------------------------------------------------------
Telefono:                    ' . $telefono . ' 
-------------------------------------------------------------------------------
Movil:                       ' . $celular . '
-------------------------------------------------------------------------------
No. de Inscripcion:          ' . $codigo . '
-------------------------------------------------------------------------------
FOTO: http://www.rutaexperienciasexitosas.com/ree2012/registro/fotos/' . $nuevoNombre;
                /*mail($correo,"INSCRIPCION RUTA 2012",$mensaje);*/
                mail('*****@*****.**', "INSCRIPCION RUTA 2012", $mensaje);
            }
        }
    }
    $htm .= '</form>';
    return $htm;
}
Пример #2
0
function formulario($codigo, $accion, $activarFormulario)
{
    /*inicio datos*/
    $nombres = $_POST["nombres"];
    $apellidos = $_POST["apellidos"];
    $identificacion = $_POST["identificacion"];
    $pais = $_POST["pais"];
    $vegetariano = $_POST["vegetariano"];
    $talla = $_POST["talla"];
    $restriccion = $_POST["restriccion"];
    $empresa = $_POST["empresa"];
    $cargo = $_POST["cargo"];
    $correo = $_POST["correo"];
    $telefono = $_POST["telefono"];
    $celular = $_POST["celular"];
    $fechanacimiento_anio = $_POST["fechanacimiento_anio"];
    $fechanacimiento_mes = $_POST["fechanacimiento_mes"];
    $fechanacimiento_dia = $_POST["fechanacimiento_dia"];
    $ciudad = $_POST["ciudad"];
    $aeropuerto = $_POST["aeropuerto"];
    $perfil = $_POST["perfil"];
    $twitter = $_POST["twitter"];
    $facebook = $_POST["facebook"];
    $skype = $_POST["skype"];
    $otroidioma = $_POST["otroidioma"];
    $espanol = $_POST["espanol"];
    $ingles = $_POST["ingles"];
    $gruposanguineo = $_POST["gruposanguineo"];
    $rh = $_POST["rh"];
    $contacto = $_POST["contacto"];
    /*fin datos*/
    $cantidad = 0;
    $coloralerta = '#ffcc99';
    $colornormal = '#cccccc';
    /*----------------------------------------*/
    $activo = 'disabled="disabled"';
    $validacion = ' onblur="javascript:if(this.value==\'\')this.style.borderColor=\'' . $coloralerta . '\'; else this.style.borderColor=\'' . $colornormal . '\';"   ';
    if ($activarFormulario == 'SI') {
        $activo = '';
    }
    $activo .= $validacion;
    $htm .= '<form action="registro.php" method="post" enctype="multipart/form-data" >';
    $htm .= '    <table width=600px>';
    /*CABEZOTE*/
    $htm .= '        <tr>';
    $htm .= '            <td COLSPAN=2">';
    $htm .= '                <h2>Información del Rutero</h2>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*NOMBRES*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Nombres:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="nombres" ' . $activo . ' id="nombres" VALUE="' . $nombres . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*APELLIDOS*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Apellidos:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="apellidos" ' . $activo . ' id="apellidos" VALUE="' . $apellidos . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*IDENTIFICACION*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                No. Identificación:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="identificacion" ' . $activo . ' id="identificacion" VALUE="' . $identificacion . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*FECHA NACIMIENTO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Fecha de nacimiento:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <font size=2 color="#999999">año &nbsp;</font><input class="inputpeque" type="text" size=4 name="fechanacimiento_anio" ' . $activo . ' id="fechanacimiento_anio" VALUE="' . $fechanacimiento_anio . '" />';
    $htm .= '                <font size=2 color="#999999">&nbsp; mes &nbsp;</font><input type="text" size=2 name="fechanacimiento_mes" ' . $activo . ' id="fechanacimiento_mes" VALUE="' . $fechanacimiento_mes . '" />';
    $htm .= '                <font size=2 color="#999999">&nbsp; dia &nbsp;</font><input type="text" size=2 name="fechanacimiento_dia" ' . $activo . ' id="fechanacimiento_dia" VALUE="' . $fechanacimiento_dia . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*PAIS*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                País:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=12 name="pais" ' . $activo . ' id="pais" VALUE="' . $pais . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Ciudad:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=12 name="ciudad" ' . $activo . ' id="ciudad" VALUE="' . $ciudad . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*AEROPUERTO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Aeropuerto de partida (lugar de origen de viaje):';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="aeropuerto" ' . $activo . ' id="aeropuerto" VALUE="' . $aeropuerto . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*VEGETARIANO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Vegetariano:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <select id="vegetariano" name="vegetariano" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($vegetariano == 'Si') {
        $htm .= '                    <option selected value="Si">Si</option>';
    } else {
        $htm .= '                    <option value="Si">Si</option>';
    }
    if ($vegetariano == 'No') {
        $htm .= '                    <option selected value="No">No</option>';
    } else {
        $htm .= '                    <option value="No">No</option>';
    }
    $htm .= '                </select>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*TALLA CAMISA*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Talla Camisa:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <select id="talla" name="talla" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($talla == 'S') {
        $htm .= '                    <option selected value="S">S</option>';
    } else {
        $htm .= '                    <option value="S">S</option>';
    }
    if ($talla == 'M') {
        $htm .= '                    <option selected value="M">M</option>';
    } else {
        $htm .= '                    <option value="M">M</option>';
    }
    if ($talla == 'L') {
        $htm .= '                    <option selected value="L">L</option>';
    } else {
        $htm .= '                    <option value="L">L</option>';
    }
    if ($talla == 'XL') {
        $htm .= '                    <option selected value="XL">XL</option>';
    } else {
        $htm .= '                    <option value="XL">XL</option>';
    }
    $htm .= '                </select>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*RESTRICCION FISICA*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Restricción física:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="restriccion" ' . $activo . ' id="restriccion" VALUE="' . $restriccion . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*IDIOMAS*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                IDIOMAS:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                Ingles:<select id="ingles" name="ingles" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($ingles == 'Si') {
        $htm .= '                    <option selected value="Si">Si</option>';
    } else {
        $htm .= '                    <option value="Si">Si</option>';
    }
    if ($ingles == 'No') {
        $htm .= '                    <option selected value="No">No</option>';
    } else {
        $htm .= '                    <option value="No">No</option>';
    }
    $htm .= '                </select>';
    $htm .= '            &nbsp; &nbsp;Español:';
    $htm .= '                <select id="espanol" name="espanol" ' . $activo . '>';
    $htm .= '                    <option value=""></option>';
    if ($espanol == 'Si') {
        $htm .= '                    <option selected value="Si">Si</option>';
    } else {
        $htm .= '                    <option value="Si">Si</option>';
    }
    if ($espanol == 'No') {
        $htm .= '                    <option selected value="No">No</option>';
    } else {
        $htm .= '                    <option value="No">No</option>';
    }
    $htm .= '                </select>';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Otro idioma:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="otroidioma" ' . $activo . ' id="otroidioma" VALUE="' . $otroidioma . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*GRUPO SANGUINEO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Grupo Sanguineo:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=12 name="gruposanguineo" ' . $activo . ' id="gruposanguineo" VALUE="' . $gruposanguineo . '" />';
    $htm .= '                &nbsp; &nbsp; &nbsp; &nbsp;RH: &nbsp; &nbsp; <input type="text" size=12 name="rh" ' . $activo . ' id="rh" VALUE="' . $rh . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*PERSONA CONTACTO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Persona de contacto:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="contacto" ' . $activo . ' id="contacto" VALUE="' . $contacto . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*EMPRESA*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Empresa o Institución que representa:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="empresa" ' . $activo . ' id="empresa" VALUE="' . $empresa . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*PERFIL OCUPACIONAL*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Perfil ocupacional , trayectoria y/o logros';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="perfil" ' . $activo . ' id="perfil" VALUE="' . $perfil . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*CARGO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Cargo:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="cargo" ' . $activo . ' id="cargo" VALUE="' . $cargo . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*CORREO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Correo:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="correo" ' . $activo . ' id="correo" VALUE="' . $correo . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*twitter*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                twitter:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="twitter" ' . $activo . ' id="twitter" VALUE="' . $twitter . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*facebook*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                facebook:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="facebook" ' . $activo . ' id="facebook" VALUE="' . $facebook . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*skype*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                skype:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="skype" ' . $activo . ' id="skype" VALUE="' . $skype . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*TELEFONO*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Teléfono:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="telefono" ' . $activo . ' id="telefono" VALUE="' . $telefono . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*CELULAR*/
    $htm .= '        <tr>';
    $htm .= '            <td>';
    $htm .= '                Celular:';
    $htm .= '            </td>';
    $htm .= '            <td>';
    $htm .= '                <input type="text" size=40 name="celular" ' . $activo . ' id="celular" VALUE="' . $celular . '" />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*FOTO*/
    $htm .= '        <tr>';
    $htm .= '            <td >';
    $htm .= '                Foto:';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    $htm .= '        <tr>';
    $htm .= '            <td colspan=2>';
    $htm .= '                <input size=40 name="imagen" id="imagen" type="file"  ' . $activo . ' />';
    $htm .= '            </td>';
    $htm .= '        </tr>';
    /*--------------------------*/
    $htm .= '    </table>';
    $htm .= '    <input type="hidden" id="accion" name="accion" value="ingresarformulario" />';
    $htm .= '    <input type="hidden" id="codigo" name="codigo" value="' . $codigo . '" />';
    $htm .= '		<br>';
    $htm .= '    <input type="submit" id=submit name=submit VALUE="Enviar" class="btn btn-primary" ' . $activo . '/>';
    if ($accion == 'ingresarformulario') {
        /*INICIO EN ESTE BLOQUE SE ESTABLECE QUE ES OBLIGATORIO*/
        $htm .= '<script>';
        $htm .= validarDato('nombres', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('apellidos', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('identificacion', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('pais', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('vegetariano', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('talla', $coloralerta, $colornormal, $cantidad);
        //$htm.=validarDato('restriccion',$coloralerta,$colornormal,$cantidad);
        $htm .= validarDato('empresa', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('cargo', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('correo', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('telefono', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('celular', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('fechanacimiento_anio', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('fechanacimiento_mes', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('fechanacimiento_dia', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('ciudad', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('aeropuerto', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('perfil', $coloralerta, $colornormal, $cantidad);
        /*$htm.=validarDato('twitter',$coloralerta,$colornormal,$cantidad);
        		$htm.=validarDato('facebook',$coloralerta,$colornormal,$cantidad);
        		$htm.=validarDato('skype',$coloralerta,$colornormal,$cantidad);
        		$htm.=validarDato('otroidioma',$coloralerta,$colornormal,$cantidad);*/
        $htm .= validarDato('espanol', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('ingles', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('gruposanguineo', $coloralerta, $colornormal, $cantidad);
        $htm .= validarDato('rh', $coloralerta, $colornormal, $cantidad);
        //$htm.=validarDato('contacto',$coloralerta,$colornormal,$cantidad);
        $htm .= '</script>';
        /*FIN EN ESTE BLOQUE SE ESTABLECE QUE ES OBLIGATORIO*/
        if ($cantidad == 0) {
            $nuevoNombre = '';
            if (is_uploaded_file($_FILES['imagen']['tmp_name'])) {
                if ($_FILES['imagen']['type'] == "image/jpeg" || $_FILES['imagen']['type'] == "image/pjpeg") {
                    $nuevoNombre = $identificacion . ".jpg";
                }
                //mover la imagen
                move_uploaded_file($_FILES['imagen']['tmp_name'], "fotos/{$nuevoNombre}");
                //obtener la inforamción
                $data = GetImageSize("fotos/{$nuevoNombre}");
            }
            $query .= 'INSERT INTO exitosas_registro.registro (nombres, apellidos, identificacion, pais, vegetariano, talla, restriccion, empresa, cargo, correo, telefono, celular, fechanacimiento_anio,';
            $query .= 'fechanacimiento_mes, fechanacimiento_dia, ciudad, aeropuerto, perfil, twitter, facebook, skype, otroidioma, espanol, ingles, gruposanguineo, rh, contacto,foto) ';
            $query .= 'VALUES ("' . $nombres . '","' . $apellidos . '","' . $identificacion . '","' . $pais . '","' . $vegetariano . '","' . $talla . '","' . $restriccion . '","' . $empresa . '","' . $cargo . '",';
            $query .= '"' . $correo . '","' . $telefono . '","' . $celular . '","' . $fechanacimiento_anio . '","' . $fechanacimiento_mes . '","' . $fechanacimiento_dia . '","' . $ciudad . '",';
            $query .= '"' . $aeropuerto . '","' . $perfil . '","' . $twitter . '","' . $facebook . '","' . $skype . '","' . $otroidioma . '","' . $espanol . '","' . $ingles . '","' . $gruposanguineo . '",';
            $query .= '"' . $rh . '","' . $contacto . '","' . $nuevoNombre . '");';
            $result = mysql_query($query);
            if (!$result) {
                return "<font color=red>Consulta invalida: " . mysql_error() . "</font>";
                die('Invalid query: ' . mysql_error());
            } else {
                $htm .= '<div class="modal hide fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: block; ">';
                $htm .= '  <div class="modal-header">';
                $htm .= '    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
                $htm .= '		<h3 id="myModalLabel">¡Felicitaciones!</h3>';
                $htm .= '  </div>';
                $htm .= '  <div class="modal-body" style="background: #DFF0D8;">';
                $htm .= '    <h2>Sus datos se han registrado con éxito</h2>';
                $htm .= '  </div>';
                $htm .= '  <div class="modal-footer">';
                $htm .= '    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>';
                $htm .= '  </div>';
                $htm .= '</div>';
                $htm .= '<script>';
                $htm .= desactivar('nombres');
                $htm .= desactivar('apellidos');
                $htm .= desactivar('identificacion');
                $htm .= desactivar('pais');
                $htm .= desactivar('vegetariano');
                $htm .= desactivar('talla');
                $htm .= desactivar('restriccion');
                $htm .= desactivar('empresa');
                $htm .= desactivar('cargo');
                $htm .= desactivar('correo');
                $htm .= desactivar('telefono');
                $htm .= desactivar('celular');
                $htm .= desactivar('fechanacimiento_anio');
                $htm .= desactivar('fechanacimiento_mes');
                $htm .= desactivar('fechanacimiento_dia');
                $htm .= desactivar('ciudad');
                $htm .= desactivar('aeropuerto');
                $htm .= desactivar('perfil');
                $htm .= desactivar('twitter');
                $htm .= desactivar('facebook');
                $htm .= desactivar('skype');
                $htm .= desactivar('otroidioma');
                $htm .= desactivar('espanol');
                $htm .= desactivar('ingles');
                $htm .= desactivar('gruposanguineo');
                $htm .= desactivar('rh');
                $htm .= desactivar('contacto');
                $htm .= desactivar('submit');
                $htm .= '</script>';
                /*envío de correo*/
                $mensaje .= '

' . $nombres . ' ' . $apellidos . ' Se ha inscrito a la REE 2012, estos son sus datos:

Nombres:						' . $nombres . ' 
-------------------------------------------------------------------------------
Apellidos:						' . $apellidos . ' 
-------------------------------------------------------------------------------
No. Identificación:				' . $identificacion . ' 
-------------------------------------------------------------------------------
Fecha de Nacimiento:			' . $fechanacimiento_dia . ' - ' . $fechanacimiento_mes . ' - ' . $fechanacimiento_anio . '
-------------------------------------------------------------------------------
Pais:							' . $pais . ' - ' . $ciudad . '   
-------------------------------------------------------------------------------
Aeropuerto:						' . $aeropuerto . '
-------------------------------------------------------------------------------
Vegetariano:					' . $vegetariano . '
-------------------------------------------------------------------------------
Talla Camisa:					' . $talla . '
-------------------------------------------------------------------------------
Restricción física:				' . $restriccion . '
-------------------------------------------------------------------------------
Ingles:							' . $ingles . '
-------------------------------------------------------------------------------
Español:						' . $espanol . '
-------------------------------------------------------------------------------
Otro idioma:					' . $otroidioma . '
-------------------------------------------------------------------------------
Grupo Sanguíneo:				' . $gruposanguineo . ' ' . $rh . ' 
-------------------------------------------------------------------------------
Contacto:						' . $contacto . ' 
-------------------------------------------------------------------------------
Empresa o Institución:			' . $empresa . ' 
-------------------------------------------------------------------------------
Perfil ocupacional:				' . $perfil . ' 
-------------------------------------------------------------------------------
Cargo:							' . $cargo . '
-------------------------------------------------------------------------------
Correo:							' . $correo . ' 
-------------------------------------------------------------------------------
Twitter:						' . $twitter . ' 
-------------------------------------------------------------------------------
Facebook:						' . $facebook . ' 
-------------------------------------------------------------------------------
Skype:							' . $skype . ' 
-------------------------------------------------------------------------------
Telefono:						' . $telefono . ' 
-------------------------------------------------------------------------------
Celular:						' . $celular . '
-------------------------------------------------------------------------------
No. de Inscripción:				' . $codigo . '
-------------------------------------------------------------------------------
FOTO: http://www.rutaexperienciasexitosas.com/ree2012/registro/fotos/' . $nuevoNombre;
                //mail($correo,"INSCRIPCION RUTA 2012",$mensaje); Envía una copia de los datos al correo de quien diligencia el form
                mail('*****@*****.**', "INSCRIPCION RUTA 2012", $mensaje);
            }
        }
    }
    $htm .= '</form>';
    return $htm;
}