<?php
session_start();
$com = "C";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
include("DF30000.inc");
include("DF80000.php");
include("JQUERY.inc");
?>
<html>
    <link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
    <script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>

    <!--if(!isset($_GET['bot']))$_GET['bot']="";
    //$bot=$_GET['bot'];
    //echo $bot;
    -->
    <?php
    if (!isset($_REQUEST['bot']))
        $_REQUEST['bot'] = "";
    if ($_REQUEST['bot'] == "") {
        echo '<div align="center"><h2>!!! SELECCIONE UN REGISTRO !!!</h2></div>';
        echo '<meta content="1; url=res_registro_PR.php"  HTTP-EQUIV="REFRESH">';
    } else {


        include('res_registro_CL.php');
        $varible_clase = new clase();
        $res = $varible_clase->lista_busqueda($_POST["bot"]);
        $reg = mysqli_fetch_array($res);
        if (!isset($_POST['fcodtarifa'])) {
            $_REQUEST['fcodtarifa'] = $reg['fcodtarifa'];
            $_REQUEST['fnumres'] = $reg['fnumres'];
            $_REQUEST['fnumcto'] = $reg['fnumcto'];
            $_REQUEST['ffecllegada'] = chfecha($reg['ffecllegada'], 'Y-m-d', 'd/m/Y');
            $_REQUEST['ffecsalida'] = chfecha($reg['ffecsalida'], 'Y-m-d', 'd/m/Y');
            $_REQUEST['fnumadu'] = $reg['fnumadu'];
            $_REQUEST['fnummenor'] = $reg['fnummenor'];
            //    print_r($reg);
            $_REQUEST['fhorallega'] = $reg['fhorallega'];

            $_REQUEST['fnumctos'] = $reg['fnumctos'];
            $_REQUEST['ffecalt'] = chfecha($reg['ffecalt'], 'Y-m-d', 'd/m/Y');
            $_REQUEST['ftipocto'] = $reg['ftipocto'];
            $_REQUEST['ffeccam'] = $reg['ffeccam'];
            //forma de pago
            $_REQUEST['fformpago'] = $reg['fformpago'];
            $_REQUEST['fnumtar'] = $reg['fnumtar'];
            $_REQUEST['fsaldo'] = $reg['fsaldo'];
            $_REQUEST['flimite'] = $reg['flimite'];
            $_REQUEST['fcodseg'] = $reg['fcodseg'];
            //datos
            $_REQUEST['fcodgrupo'] = $reg['fcodgrupo'];
            $_REQUEST['fcodagen'] = $reg['fcodagen'];
            $_REQUEST['fcodmeca'] = $reg['fcodmeca'];
            $_REQUEST['fplan'] = $reg['fplan'];
            $_REQUEST['smerf'] = $reg['smerf'];
            $_REQUEST['fnorasvip'] = $reg['fnorasvip'];
            $_REQUEST['extra4'] = $reg['extra4'];
            //direccion
            $_REQUEST['fnombre'] = $reg['fnombre'];
            $_REQUEST['fapellido'] = $reg['fapellido'];
            $_REQUEST['flengua'] = $reg['flengua'];
            $_REQUEST['fempresa'] = $reg['fempresa'];
            $_REQUEST['ftelefono'] = $reg['ftelefono'];
            $_REQUEST['fvip'] = $reg['fvip'];
            $_REQUEST['femail'] = $reg['femail'];
            $_REQUEST['fmail'] = $reg['fmail'];
            $_REQUEST['fdireccion'] = $reg['fdireccion'];
            $_REQUEST['tcol'] = $reg['fgntd'];
            $_REQUEST['tcp'] = $reg['fcp'];
            $_REQUEST['pais'] = $reg['fpais'];
            $_REQUEST['estados'] = $reg['festado'];
            $_REQUEST['tmun'] = $reg['fciudad'];
            $_REQUEST['fvehiculo'] = $reg['fvehiculo'];
            $_REQUEST['fplacas'] = $reg['fplacas'];
            $_REQUEST['ftelemp'] = $reg['ftelemp'];
            $_REQUEST['ftiphuesped'] = $reg['ftiphuesped'];
            $_REQUEST['tex'] = $reg['tex'];
            $_REQUEST['tex2'] = $reg['tex2'];
            $_REQUEST['tex3'] = $reg['tex3'];
            $_REQUEST['tex4'] = $reg['tex4'];
            $_REQUEST['tex5'] = $reg['tex5'];
            $_REQUEST['tex6'] = $reg['tex6'];
            $_REQUEST['text1'] = $reg['text1'];
            $_REQUEST['text2'] = $reg['text2'];
            $_REQUEST['text3'] = $reg['text3'];
            $_REQUEST['text4'] = $reg['text4'];
            $_REQUEST['text5'] = $reg['text5'];
            $_REQUEST['text6'] = $reg['text6'];
            $_REQUEST['ftotal'] = $reg['ftotal'];
            $_REQUEST['n_reg'] = $reg['n_reg'];
            $_REQUEST['codseg'] = $reg['codseg'];
        }
        ?>
        <body
        <?php
        if (isset($_POST['bot3'])) {
            echo ' onLoad="deshab()"';
        }
        ?>
            >

            <div align="center">
                <form  name="frm1" method="post" action="">
                    <input name="bot" type="hidden" value="<?php echo $_POST["bot"] ?>">
                    <div id="width_cabe" align="center">
                        <table width="943" align="center">
                            <tr>
                                <th colspan="14" class=\"titulo\"><div align="center"> CONSULTAR REGISTRO DE RESERVACIONES INDIVIDUALES </div></th>
                            </tr>

                            <tr>
                                <td  ><span class="Estilo26"><strong>ALTA</strong></span></td>
                                <td width="48" style="#A15E8D"><input name="ffecalt" type="text"  class="styTabEspA" id="ffecalt" onKeyPress="return validar(event)" size="7" disabled="disabled" value="<?php
                                    $varff = (isset($_REQUEST['ffecalt'])) ? $_REQUEST['ffecalt'] : "0";
                                    echo $varff
                                    ?>"></td>
                                <td style="#A15E8D"><input name="fusualta" type="text" id="fusualta" disabled="disabled" size="20" value=" <?php echo $_SESSION['usuario']; ?>"></td>
                                <td width="67"  ><span class="Estilo26"><strong>CAMBIO</strong></span></td>
                                <td colspan="3" style="#A15E8D"><label><input name="ffeccam" type="text"  class="styTabEspA" id="ffeccam" onKeyPress="return validar(event)" size="7" disabled="disabled" value="<?php echo (isset($_REQUEST['ffeccam'])) ? $_REQUEST['ffeccam'] : "0"; ?>"></label></td>
                                <th width="51"  ><span class="Estilo26"><strong>FOLIO</strong></span></th>
                                <td width="58"><span class="consultar"><strong><?php echo (isset($_REQUEST['n_reg'])) ? $_REQUEST['n_reg'] : "0"; ?></strong></span></td>
                                <td colspan="2"  ><div align="right" class="Estilo26"><strong>STATUS</strong></div></td>
                                <td colspan="2" style="#A15E8D"><select name="select1">
                                        <option value="RESERVA INDIVIDUAL"<?php if (isset($_REQUEST['select1']) && $_REQUEST['select1'] == "RESERVA INDIVIDUAL") echo 'selected'; ?>>RESERVA INDIVIDUAL</option>
                                    </select></td>
                            </tr>
                            <tr>
                                <th colspan="2">FECHA DE LLEGADA</th> <td width="149"><span class="consultar"><strong><?php echo (isset($_REQUEST['ffecllegada'])) ? $_REQUEST['ffecllegada'] : "0"; ?></strong></span></td>
                                <th colspan="2">DIAS</th> <td><span class="consultar"><strong><?php echo (isset($_REQUEST['fnumctos'])) ? $_REQUEST['fnumctos'] : "0"; ?></strong></span></td>
                                <td colspan="3">&nbsp;</td>
                                <th colspan="2" rowspan="2">NOTAS</th>
                                <td colspan="4" rowspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['fnorasvip'])) ? $_REQUEST['fnorasvip'] : "0"; ?></strong></span></td>
                            </tr>
                        
                            <tr>
                                <th colspan="2">FECHA DE SALIDA</th>  <td><span class="consultar"><strong><?php echo (isset($_REQUEST['ffecsalida'])) ? $_REQUEST['ffecsalida'] : "0"; ?></strong></span></td>
                                <th colspan="2">NUMERO DE ADULTOS</th><td width="81"><span class="consultar"><strong><?php echo (isset($_REQUEST['fnumadu'])) ? $_REQUEST['fnumadu'] : "0"; ?></strong></span></td>
                                <th width="105">TIPO DE HABITACIONES</th>
                                <td colspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['ftipocto'])) ? $_REQUEST['ftipocto'] : "0"; ?></strong></span></td>
<!--                                <td colspan="4" rowspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['fnorasvip'])) ? $_REQUEST['fnorasvip'] : "0"; ?></strong></span></td>-->
                            </tr>
                            <tr>
                                <td colspan="2"  ><span class="Estilo26"><strong>HORA DE LLEGADA</strong></span></td>
                                <td style="#A15E8D"><input name="fhorallega" type="text" id="fhorallega" tabindex="20" onKeyPress="return validar(event)" disabled="disabled" size="6"  value="<?php echo (isset($_REQUEST['fhorallega'])) ? $_REQUEST['fhorallega'] : "0"; ?>"></td>
                                <td colspan="2"  ><span class="Estilo28">NUMERO DE MENORES</span></td>
                                <td style="#A15E8D"><input name="fnummenor" type="text" id="fnummenor" tabindex="20" onKeyPress="return validar(event)" disabled="disabled" size="5"  value="<?php echo (isset($_REQUEST['fnummenor'])) ? $_REQUEST['fnummenor'] : "0"; ?>"></td>
                                <td  ><span class="Estilo28">NUNERO DE HABITACION</span></td>
                                <td colspan="2" style="#A15E8D"><input name="fnumcto" type="text" id="fnumcto" tabindex="20" size="5" disabled="disabled" value="<?php echo (isset($_REQUEST['fnumcto'])) ? $_REQUEST['fnumcto'] : "0"; ?>"></td>
                                <th colspan="2" rowspan="2">NOTAS INTERNAS</th>
                                <td colspan="4" rowspan="2" ><span class="consultar"><strong><?php echo (isset($_REQUEST['extra4'])) ? $_REQUEST['extra4'] : "0"; ?></strong></span></td>
                            </tr>
                            

                            <tr>
                                <th colspan="14" class="titulo"><div align="center" class="Estilo18">CONSULTAR FORMA DE PAGO </div></th>
                            </tr>
                            <tr>
                                <td  ><span class="Estilo26"><strong>TARIFA ALTA </strong></span></td>
                                <td colspan="6" style="#A15E8D"><input name="tex" type="text" id="tex" value="<?php echo (isset($_REQUEST['tex'])) ? $_REQUEST['tex'] : "0"; ?>" size="6" disabled="disabled">
                                    <input name="tex2" type="text" id="tex2" value="<?php echo (isset($_REQUEST['tex2'])) ? $_REQUEST['tex2'] : "0"; ?>" size="20" disabled="disabled">
                                    <input name="tex3" type="text" id="tex3" value="<?php echo (isset($_REQUEST['tex3'])) ? $_REQUEST['tex3'] : "0"; ?>" size="3" disabled="disabled">
                                    <span class="Estilo17"><strong>$</strong></span>
                                    <input name="tex4" type="text" id="tex4" value="<?php echo (isset($_REQUEST['tex4'])) ? $_REQUEST['tex4'] : "0"; ?>" size="5" disabled="disabled">
                                    <input name="tex5" type="text" id="tex5" value="<?php echo (isset($_REQUEST['tex5'])) ? $_REQUEST['tex5'] : "0"; ?>" size="2" disabled="disabled">
                                    =<strong> </strong><span class="Estilo17"><strong>$</strong></span>
                                    <input name="tex6" type="text" id="tex6" size="10" value="<?php echo (isset($_REQUEST['tex6'])) ? $_REQUEST['tex6'] : "0"; ?>" disabled="disabled"></td>
                                <td  ><span class="Estilo26"><strong>FORMA DE PAGO</strong></span></td>
                                <td colspan="4" style="#A15E8D"><span class="Estilo18">
                                        <select name="fformpago" id="fformpago" onChange="javascript: document.getElementById('frm1').submit()" tabindex="14">
                                            <option value="">---SELECCIONE---</option>
                                            <?php
                                            $sql = mysqli_query($con ,"SELECT * FROM valeryus09 WHERE pmontomax = 'ABONO' AND ppago = 'SI'");
                                            while ($reg = mysqli_fetch_array($sql)) {
                                                if ($_POST['fformpago'] == $reg['descripcion']) {
                                                    echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
                                                } else {
                                                    echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>

                                    </span></td>
                            </tr>
                            <tr>
                                <td  ><span class="Estilo26"><strong>TARIFA BAJA </strong></span></td>
                                <td colspan="6" style="#A15E8D"><label>
                                        <input name="text1" type="text" id="text1" value="<?php echo (isset($_REQUEST['text1'])) ? $_REQUEST['text1'] : "0"; ?>" size="6" disabled="disabled">
                                    </label>
                                    <label>
                                        <input name="text2" type="text" id="text2" value="<?php echo (isset($_REQUEST['text2'])) ? $_REQUEST['text2'] : "0"; ?>" size="20" disabled="disabled">
                                    </label>
                                    <label>
                                        <input name="text3" type="text" id="text3" value="<?php echo (isset($_REQUEST['text3'])) ? $_REQUEST['text3'] : "0"; ?>" size="3" disabled="disabled">
                                        <span class="Estilo17"><strong>$</strong></span>
                                        <input name="text4" type="text" id="text4" value="<?php echo (isset($_REQUEST['text4'])) ? $_REQUEST['text4'] : "0"; ?>" size="5" disabled="disabled">
                                        <input name="text5" type="text" id="text5" value="<?php echo (isset($_REQUEST['text5'])) ? $_REQUEST['text5'] : "0"; ?>" size="2" disabled="disabled">
                                        =<strong> </strong><span class="Estilo17"><strong>$</strong></span>
                                        <input name="text6" type="text" id="text6" size="10" value="<?php echo (isset($_REQUEST['text6'])) ? $_REQUEST['text6'] : "0"; ?>" disabled="disabled">
                                    </label></td>
                                <td colspan="3"  ><span class="Estilo26"><strong>NUMERO DE TARJETA</strong></span></td>
                                <td colspan="2" style="#A15E8D"><input name="fnumtar" type="text" id="fnumtar" tabindex="20" size="30" disabled="disabled" value="<?php echo (isset($_REQUEST['fnumtar'])) ? $_REQUEST['fnumtar'] : "0"; ?>"></td>
                            </tr>
                            <tr>
                                <td  ><span class="Estilo30">TOTAL</span></td>
                                <td colspan="2" style="#A15E8D"><span class="Estilo19">$</span>
                                    <input name="ftotal" type="text" disabled="disabled" id="ftotal" value="<?php echo (isset($_REQUEST['ftotal'])) ? $_REQUEST['ftotal'] : "0"; ?>" size="15"></td>
                                <td  ><span class="Estilo26"><strong>DEPOSITO</strong></span></td>
                                <td colspan="2" style="#A15E8D"><span class="Estilo16">$</span>
                                    <input name="fsaldo" type="text" id="fsaldo" tabindex="20" size="5" disabled="disabled" value="<?php echo (isset($_REQUEST['fsaldo'])) ? $_REQUEST['fsaldo'] : "0"; ?>"></td>
                                <td  ><span class="Estilo26"><strong>CODIGO DE SEGURIDAD</strong></span></td>
                                <td colspan="3">
                                    <input name="fcodseg" type="text" id="fcodseg" size="15" disabled="disabled" value="<?php echo (isset($_REQUEST['fcodseg'])) ? $_REQUEST['fcodseg'] : "0"; ?>"></td>
                                <td  ><span class="Estilo26"><strong>LIMITE</strong></span></td>
                                <td width="193" style="#A15E8D"><input name="flimite" type="text" id="flimite" tabindex="20" size="15" disabled="disabled" value="<?php echo (isset($_REQUEST['flimite'])) ? $_REQUEST['flimite'] : "0"; ?>"></td>
                            </tr>


                            <tr><th colspan="14" class="titulo"><div align="center" class="Estilo18">CONSULTAR SEGMENTOS </div></th></tr>
                            <tr>
                                <th>GRUPO</th>   <td colspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['fcodgrupo'])) ? $_REQUEST['fcodgrupo'] : "0"; ?></strong></span></td>
                                <th>MERCADO</th> <td colspan="3"><span class="consultar"><strong><?php echo (isset($_REQUEST['fcodmeca'])) ? $_REQUEST['fcodmeca'] : "0"; ?></strong></span></td>
                                <th>SEGMENTO</th><td colspan="4"><span class="consultar"><strong><?php echo (isset($_REQUEST['codseg'])) ? $_REQUEST['codseg'] : "0"; ?></strong></span></td>
                            </tr>
                            <tr>
                                <th>AGENCIA</th> <td colspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['fcodagen'])) ? $_REQUEST['fcodagen'] : "0"; ?></strong></span></td>
                                <th>PLAN</th>    <td colspan="3"><span class="consultar"><strong><?php echo (isset($_REQUEST['fplan'])) ? $_REQUEST['fplan'] : "0"; ?></strong></span></td>
                                <th>TIPO DE HUESPED</th> <td colspan="4"><span class="consultar"><strong><?php echo (isset($_REQUEST['ftiphuesped'])) ? $_REQUEST['ftiphuesped'] : "0"; ?></strong></span></td>
                            </tr>
                            <tr>
                                <th>SMERF</th>   <td colspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['smerf'])) ? $_REQUEST['smerf'] : "0"; ?></strong></span></td>
                                <th>EMPRESA</th> <td colspan="8"><span class="consultar"><strong><?php echo (isset($_REQUEST['fempresa'])) ? $_REQUEST['fempresa'] : "0"; ?></strong></span></td>
                            </tr>



                            <tr>
                                <th colspan="14" class="titulo"><div align="center" class="Estilo18">CONSULTAR DATOS</div></th>
                            </tr>
                            <tr>
                                <th><span class="Estilo26"><strong>NOMBRE</strong></span></th>
                                <td colspan="2"><span class="consultar"><strong><?php echo (isset($_REQUEST['fnombre'])) ? $_REQUEST['fnombre'] : "0"; ?></strong></span></td>
                                <th><span class="Estilo26"><strong>APELLIDO</strong></span></th>
                                <td colspan="3"><span class="consultar"><strong><?php echo (isset($_REQUEST['fapellido'])) ? $_REQUEST['fapellido'] : "0"; ?></strong></span> <input type="submit" /></td>
                                <td  >&nbsp;</td>
                                <td colspan="3" style="#A15E8D">&nbsp;</td>
                                <td colspan="2" style="#A15E8D"><div align="center" class="Estilo1"><strong><span class="Estilo19">VIP</span></strong>
                                        <input name="fvip" type="checkbox" id="fvip" disabled="disabled" value="SI" <?php if (isset($_REQUEST['fvip']) && $_REQUEST['fvip'] == 'SI') echo 'checked'; ?>>
                                    </div></td>
                            </tr>
                            <tr>
                                <td  ><span class="Estilo29"><strong>TELEFONO</strong></span></td>
                                <td colspan="2" style="#A15E8D"><input name="ftelefono" type="text" id="ftelefono" tabindex="20" size="25" disabled="disabled" value="<?php echo (isset($_REQUEST['ftelefono'])) ? $_REQUEST['ftelefono'] : "0"; ?>"></td>
                                <td  ><span class="Estilo26"><strong>TELEFONO EMPRESA</strong></span></td>
                                <td colspan="3" style="#A15E8D"><input name="ftelemp" type="text" id="ftelemp" tabindex="20" size="25" disabled="disabled" value="<?php echo (isset($_REQUEST['ftelemp'])) ? $_REQUEST['ftelemp'] : "0"; ?>"></td>
                                <td  ><span class="Estilo26"><strong>E-MAIL</strong></span></td>
                                <td colspan="6" style="#A15E8D"><input name="fmail" type="text" id="fmail" tabindex="20" size="25" disabled="disabled" value="<?php echo (isset($_REQUEST['fmail'])) ? $_REQUEST['fmail'] : "0"; ?>"></td>
                            </tr>
                            <tr>
                                <td  ><span class="Estilo26"><strong>E-MAIL EMPRESA</strong></span></td>
                                <td colspan="2" style="#A15E8D"><input name="femail" type="text" id="femail" tabindex="20" size="25" disabled="disabled" value="<?php echo (isset($_REQUEST['femail'])) ? $_REQUEST['femail'] : "0"; ?>"></td>
                                <td  ><span class="Estilo26"><strong>DIRECCION</strong></span></td>
                                <td colspan="3" style="#A15E8D"><span class="Estilo18">
                                        <input name="fdireccion" type="text" id="fdireccion" tabindex="20" size="25" disabled="disabled" value="<?php echo (isset($_REQUEST['fdireccion'])) ? $_REQUEST['fdireccion'] : "0"; ?>">
                                    </span></td>
                                <td  ><span class="Estilo1 Estilo26"><strong>CODIGO POSTAL</strong></span></td>
                                <td colspan="2" style="#A15E8D"><input name="tcp" type="text" disabled="disabled" onKeyPress="return validar(event)" value="<?php echo (isset($_REQUEST['tcp'])) ? $_REQUEST['tcp'] : "0"; ?>" size="8" maxlength="5"></td>
                                <td  ><span class="Estilo26"><strong>COLONIA</strong></span></td>
                                <td style="#A15E8D"><span class="Estilo1">
                                        <input type="hidden" name="tcol1" id="tcve" value="<?php echo (isset($_REQUEST['tcve'])) ? $_REQUEST['tcve'] : "0"; ?>">
                                        <input name="tcol" type="text" disabled="disabled" id="tcol"value="<?php echo (isset($_REQUEST['tcol'])) ? $_REQUEST['tcol'] : "0"; ?>" size="20">
                                    </span></td>
                            </tr>
                            <tr>
                                <td height="29"  ><span class="Estilo26"><strong>PAIS</strong></span></td>
                                <td colspan="2" style="#A15E8D"><span class="Estilo1">
                                        <select name="pais" id="pais" onChange="javascript: document.getElementById('frm1').submit()">
                                            <option value="">-----Selecciona-----</option>
                                            <?php
                                            include("DMMYSQLG.php");
                                            @$resultado = mysqli_query($con ,"select * from dxpaises");
                                            if (!isset($_REQUEST['pais'])) {
                                                $dt_paises = mysqli_fetch_array($resultado);
                                                $selPais = $dt_paises['cve_pais'];
                                                if (mysqli_num_rows($resultado) > 0)
                                                    mysqli_data_seek($resultado, 0);
                                            } else {
                                                $selPais = $_REQUEST['pais'];
                                            }
                                            while ($registro = mysqli_fetch_array($resultado)) {
                                                if ($selPais == $registro['cve_pais']) {
                                                    echo '<option value="' . $registro['cve_pais'] . '" selected>' . $registro['des_pais'] . '</option>';
                                                } else {
                                                    echo '<option value="' . $registro['cve_pais'] . '">' . $registro['des_pais'] . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>
                                    </span></td>
                                <td  ><span class="Estilo26"><strong>ESTADO</strong></span></td>
                                <td colspan="3" style="#A15E8D"><span class="Estilo1">
                                        <select name="estados" onChange="javascript: document.getElementById('frm1').submit()">
                                            <option  value="">-----Selecciona-----</option>
                                            <?php
                                            @$resultado = mysqli_query($con ,"select * from dxestado where cve_pais='$selPais'");
                                            if (!isset($_REQUEST['estados'])) {
                                                $dt_estado = mysqli_fetch_array($resultado);
                                                $selEnt = $dt_estado['cve_estado'];
                                                if (mysqli_num_rows($resultado) > 0)
                                                    mysqli_data_seek($resultado, 0);
                                            } else {
                                                $selEnt = $_REQUEST['estados'];
                                            }
                                            while ($registro = mysqli_fetch_array($resultado)) {
                                                if ($selEnt == $registro['cve_estado']) {
                                                    echo '<option value="' . $registro['cve_estado'] . '" selected>' . $registro['des_estado'] . '</option>';
                                                } else {
                                                    echo '<option value="' . $registro['cve_estado'] . '">' . $registro['des_estado'] . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>
                                    </span></td>
                                <td colspan="2"  ><span class="Estilo26">
                                        <label><span class="Estilo1"><strong>DELEGACION O MUNICIPIO</strong></span></label>
                                    </span></td>
                                <td colspan="5" style="#A15E8D"><span class="Estilo1">
                                        <select name="tmun" id="tmun" >
                                            <option  value="">-----Selecciona-----</option>
                                            <?php
                                            @$resultado = mysqli_query($con ,"select * from dxdelmun where cve_estado='$selEnt' and cve_pais='$selPais'");
                                            if (!isset($_REQUEST['tmun'])) {
                                                $dt_delmun = mysqli_fetch_array($resultado);
                                                $selDelMun = $dt_delmun['cve_delmun'];
                                                if (mysqli_num_rows($resultado) > 0)
                                                    mysqli_data_seek($resultado, 0);
                                            } else {
                                                $selDelMun = $_REQUEST['tmun'];
                                            }
                                            while (@$registro = mysqli_fetch_array($resultado)) {
                                                if ($selDelMun == $registro['cve_delmun']) {
                                                    echo '<option value="' . $registro['cve_delmun'] . '" selected>' . $registro['des_delmun'] . '</option>';
                                                } else {
                                                    echo '<option value="' . $registro['cve_delmun'] . '">' . $registro['des_delmun'] . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>
                                    </span></td>
                            </tr>
                        </table>
                    </div>
                </form>
            </div>
            <?php
            echo '<div align="center">
	<form id="form1" name="form1" action="res_registro_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar" class="bot_WsW">
	</form>
	</div>';
            ?>
        </body>
        <?php
        mysqli_close($con);
    }
    ?>
</html>