<?php
session_start();
require_once('conexion.php');
require_once('include/sesiones.php');
if (isset($_SESSION['usu_nombre']))
{
    $regis=mysqli_query($con,"SELECT * from permiso where modulo_mod_id='20' and usuario_usu_id='$usu_id' ") or die(mysqli_error($con));
    $reg=mysqli_fetch_array($regis);
    if($reg['per_visualizar']=="Activo")
    {
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php include ('head.php');?>
</head>
<body >
<?php
$inicio="";
$M_inventario="";
$M_contactos="";
$M_compras="";
$M_ventas="active";
$M_pedidos="";
$M_pos="";
$R_reportes="";

$cotizacion="";
$ventas="active";
$periodica="";
$clientes="";
$cartera="";
$garantias="";
$abonos=""; 
$cotizacion_online="";

    include ('menu.php');
?> 
<div class="main">
   <div class="col-md-2"> 
        <?php include ('include/menu_ventas.php');?>
    </div> <!-- /span6 -->
    <div class="col-md-10">  
        <div class="widget stacked">
            <div class="widget-content">
                <div class="tabbable">
                    <ul class="nav nav-tabs">
                        <li><a href="V_documento_equivalente.php">DOCUMENTO EQUIVALENTE POS</a> </li>
                        <li><a href="V_factura_electronica.php">FACTURA ELECTRONICA</a> </li>
                        <li class="active"><a href="V_remisiones.php">REMISIONES</a> </li>
                        <li><a href="V_nomina.php">NOMINA</a></li>
                        <li><a href="V_documento_soporte.php">DOCUMENTO DE SOPORTE</a></li>
                         <!--<li><a href="V_eventos_radian.php">EVENTOS RADIAN</a></li>-->

                    </ul>
                    <div class="tab-content">
                        <div class="widget stacked">
                            <div class="widget-content">
                                <section id="buttons">
                                    <div class="col-md-5"></div>
                                    <div class="col-md-3">
                                        <input id="ser" type="text" class="form-control" autocomplete="off" placeholder="Serial de Articulo" onKeyUp='load(1);' >
                                    </div>
                                    <div class="col-md-4">
                                        <input type="text" class="form-control" id="q" placeholder="Buscador" onKeyUp='load(1);' autofocus value="">
                                    </div>
                                </section>
                            </div> 
                        </div>
                        <center> <span id="loader"></span></center> 
                        <div class='outer_div'></div><!-- Carga los datos ajax -->
                    </div>
                </div>
            </div>
        </div>
    </div> <!-- /row -->
</div>
<div class="modal fade" id="dian" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">CONVERTIR VENTA Y ENVIAR </h4>
            </div>
            <div class="modal-body">
                <div id="form-dian"></div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="factura" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Editar Factura </h4>
            </div>
            <div class="modal-body">
                <div id="form-editar"></div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="detalle" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Detalle de Venta</h4>
            </div>
            <div class="modal-body">
                <div id="form-detalle"></div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<?php
    include ('php_caja/caja_abrir.php');
    include ('script.php');
?>
<script >
$(document).ready(function(){
  load(1);
});
    
function load(page)
{
    var ser= $("#ser").val();
    var q= $("#q").val();

    $("#loader").fadeIn('slow');
    $.ajax({
        url:'php_ventas/tabla_remisiones.php?action=ajax&page='+page+'&ser='+ser+'&q='+q,
        beforeSend: function(objeto){
        $('#loader').html('<img src="./img/ajax-loader.gif"> Cargando...');
        },
        success:function(data){
        $(".outer_div").html(data).fadeIn('slow');
        $('#loader').html('');
        }
    })
}

</script>
</body>
</html>
<?php
    }
    else
    {
        echo '<script>alert("No tienes permiso para ver esta pagina")</script>';
        echo '<script> setTimeout("history.back(1)", 0); </script>';
    }
} 
else
{
    echo '<script>location.href = "index.php";</script>';
}
?>