<?php
session_start();
require_once('../conexion.php');
require_once('../include/sesiones.php');
?>
<script type="text/javascript">
$(setup)
function setup() {
      $('#intro select').zelect({ placeholder:'' })
}
</script>
<div id="datoscxc"></div>
<div id="ventanacxc">
    <form method="post" action="" id="form_buscarcxc" name="form_buscarcxc">
       
        <div class="form-group">
            <label class="pull-left">Documento o Nombre</label>
            <section id="intro" >
                <select name="cliente" id="cliente" class="form-control name_list" >
                    <option value=""> - </option>
                    <?php
                        $datos2=mysqli_query($con,"SELECT clie_id, clie_cc, clie_nombre FROM cliente WHERE empresa='$empresa' and clie_nombre<>'CLIENTE MOSTRADOR'") ;
                        while($fila2=mysqli_fetch_array($datos2))
                        {
                         echo' <option value="'.$fila2['clie_id'].'">'.$fila2['clie_cc'].' - '.$fila2['clie_nombre'].'</option>';
                        }
                    ?>
                </select>
            </section>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
            <button type="submit" class="btn btn-success" name="btn_buscarcxc" value="btn_buscarcxc" id="btn_buscarcxc">Buscar</button>
        </div>
    </form>
</div>
<script>
$("#form_buscarcxc").submit(function( event ) {
$('#btn_buscarcxc').attr("disabled", true);
var parametros=$(this).serialize();
    $.ajax({
    type: "POST",
    url: "php_movimientos/forms_cxc.php",
    data: parametros,
    beforeSend: function(objeto){
     $('#datoscxc').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
    },
    success: function(datos){
    $("#datoscxc").html(datos);
    $('#btn_buscarcxc').attr("disabled", false);
    document.getElementById("form_buscarcxc").reset();
    }
    });
    event.preventDefault();
})
</script>