<div id="utilidad" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Perdidas y Ganancias</h4>
            </div>
            <div class="modal-body">
                <form method="get" action="" target="_blank">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="pull-left">Desde</label>
                            <input type="date" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="desde" autocomplete="off" value="<?php echo date('Y-m-d');?>" >
                            <label class="pull-left">Hasta</label>
                            <input type="date" class="form-control date-picker" data-date-format="dd-mm-yyyy" name="hasta" autocomplete="off" value="<?php echo date('Y-m-d');?>">                    
                            <label class="pull-left">Tipo Factura</label>
                            <select name="tipo_factura" class="form-control name_list" required>
                                <option value="0">Todas</option>
                                <option value="pos electronico">Documento Equivalente POS</option>
                                <option value="electronica">Factura de Venta Electronica</option>
                                <?php if ($activar_remisiones=='Si') { ?>
                                <option value="remision">Remisiones</option>
                                <?php } ?>
                            </select>
                        </div>
                    </div> <!-- /.form-group -->
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button type="submit" class="btn btn-danger" name="util_neta" value="util_neta" id="util_neta" dir="libraries/pdf/pdf_reportes/utilidad_ganancia.php" >PDF</button>
                        <button type="submit" class="btn btn-success" name="uti2_neta" value="uti2_neta" id="uti2_neta" dir="libraries/php_excel/excel_utilidad_ganancia.php">EXCEL</button>
                    </div>
                </form>
            </div><!-- /.modal-content -->
         </div><!-- /.modal-dialog -->
    </div> 
</div>

<div id="utilidad_detallada" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> Utilidad Detallada</h4>
            </div>
            <div class="modal-body">
                <form method="get" action="" target=”_blank”>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="pull-left">Desde</label>
                            <input type="date" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="desde" autocomplete="off" value="<?php echo date('Y-m-d');?>" >

                            <label class="pull-left">Hasta</label>
                            <input type="date" class="form-control date-picker" data-date-format="dd-mm-yyyy" name="hasta" autocomplete="off" value="<?php echo date('Y-m-d');?>">   
                            <label class="pull-left">Tipo Factura</label>
                            <select name="tipo_factura" class="form-control name_list" required>
                                <option value="0">Todas</option>
                                <option value="pos electronico">Documento Equivalente POS</option>
                                <option value="electronica">Factura de Venta Electronica</option>
                                <?php if ($activar_remisiones=='Si') { ?>
                                <option value="remision">Remisiones</option>
                                <?php } ?>
                            </select>        
                        </div>
                    </div> <!-- /.form-group -->
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button type="submit" class="btn btn-danger" name="util_deta" value="util_deta" id="util_deta" dir="libraries/pdf/pdf_reportes/utilidad_detallada.php" >PDF</button>
                        <button type="submit" class="btn btn-success" name="util2_deta" value="util2_deta" id="util2_deta" dir="libraries/php_excel/excel_utilidad_detallada.php">EXCEL</button>
                    </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div> 
</div>



<div id="ganancia_empleado" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> Ganancia Por Empleado</h4>
            </div>
            <div class="modal-body">
                <form method="get" action="" target=”_blank”>
                    <div class="col-md-12">
                        <div class="form-group">

                            <div class="col-md-6" style="padding-left: 0px;">
                                <label class="pull-left">Fecha Desde</label>
                                <input type="date" class="form-control date-picker input-sm" value="<?php echo date('Y-m-d');?>" data-date-format="yyyy-mm-dd" name="fecha_desde">
                            </div>
                            <div class="col-md-6" style="padding-left: 0px;padding-right: 0px;">
                                <label class="pull-left">Hora Desde</label>
                                <input type="time" class="form-control input-sm" name="hora_desde" value="00:00:00">
                            </div>
                            <div class="col-md-6" style="padding-left: 0px;">
                                <label class="pull-left">Fecha Hasta</label>
                                <input type="date" class="form-control date-picker input-sm" value="<?php echo date('Y-m-d');?>" data-date-format="dd-mm-yyyy" name="fecha_hasta">
                            </div>
                            <div class="col-md-6" style="padding-left: 0px;padding-right: 0px;">
                                <label class="pull-left">Hora Hasta</label>
                                <input type="time" class="form-control input-sm" name="hora_hasta" value="23:59:59">
                            </div>

                            <label class="pull-left">Empleado</label>
                            <section id="intro" >
                                <select name="empleadoo" id="empleadoo" class="form-control name_list" required>

                                    <?php
                                    if($rol_ven<> $rol_id)
                                    {
                                        $datos = mysqli_query($con,"SELECT * FROM usuario WHERE empresa_emp_id='$empresa'  ") ;
                                        while( $fila = mysqli_fetch_array( $datos ) )
                                        {
                                        echo' <option value="'.$fila['usu_id'].'">'.$fila['usu_nombre'].'</option>';
                                        }
                                    }
                                    else
                                    {
                                         $datos = mysqli_query($con,"SELECT * FROM usuario WHERE sucursal='$sucursal' and empresa_emp_id='$empresa'  ") ;
                                        while( $fila = mysqli_fetch_array( $datos ) )
                                        {
                                        echo' <option value="'.$fila['usu_id'].'">'.$fila['usu_nombre'].'</option>';
                                        }
                                    }
                                    ?>
                                </select>
                            </section>
                        </div>
                    </div> <!-- /.form-group -->
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button type="submit"  class="btn btn-danger" name="util_emple" value="util_emple" id="util_emple" dir="libraries/pdf/pdf_reportes/utilidad_empleado.php" >PDF</button>

                         <button type="submit" class="btn btn-success" name="util2_emple" value="util2_emple" id="util2_emple"  dir="libraries/php_excel/excel_utilidad_empleado.php">EXCEL</button>
                    </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div> 
</div>


<div id="ganancia_articulo" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> Ganancia Por Articulos</h4>
            </div>
            <div class="modal-body">
                <form method="get" action="" target=”_blank”>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="pull-left">Desde</label>
                            <input type="date" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="desde" autocomplete="off" value="<?php echo date('Y-m-d');?>" >
                            <label class="pull-left">Hasta</label>
                            <input type="date" class="form-control date-picker" data-date-format="dd-mm-yyyy"  name="hasta" autocomplete="off" value="<?php echo date('Y-m-d');?>">
                            <label class="pull-left">Articulos</label>
                            <section id="intro" >
                                <select name="art_id" id="art_id"  class="form-control name_list" required>
                                    <?php
                                        $datos=mysqli_query($con,"SELECT * FROM articulos WHERE art_estado='Activo'  and empresa='$empresa'");
                                            while( $fila=mysqli_fetch_array($datos))
                                            {
                                              echo' <option value="'.$fila['art_id'].'">'.mb_strtoupper($fila['art_referencia']).' - '.mb_strtoupper($fila['art_nombre']).'</option>';
                                            }
                                    ?>
                                </select>
                            </section>
                        </div>
                    </div> <!-- /.form-group -->
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button type="submit"  class="btn btn-danger" name="util_arti" value="util_arti" id="util_arti" dir="libraries/pdf/pdf_reportes/utilidad_articulos.php" >PDF</button>

                         <button type="submit" class="btn btn-success" name="util2_arti" value="util2_arti" id="util2_arti"  dir="libraries/php_excel/excel_utilidad_articulo.php">EXCEL</button>
                    </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div> 
</div>



<div id="ganancia_combos" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> Ganancia Por Combos</h4>
            </div>
            <div class="modal-body">
                <form method="get" action="libraries/pdf/pdf_reportes/utilidad_combos.php" target=”_blank”>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="pull-left">Desde</label>
                            <input type="date" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="desde" autocomplete="off" value="<?php echo date('Y-m-d');?>" >
                            <label class="pull-left">Hasta</label>
                            <input type="date" class="form-control date-picker" data-date-format="dd-mm-yyyy"  name="hasta" autocomplete="off" value="<?php echo date('Y-m-d');?>">
                            <label class="pull-left">Articulos</label>
                            <section id="intro" >
                                <select name="com_id" id="com_id"  class="form-control name_list" required>
                                    <?php
                                        $datos=mysqli_query($con,"SELECT * FROM combos WHERE empresa='$empresa'");
                                            while( $fila=mysqli_fetch_array($datos))
                                            {
                                              echo' <option value="'.$fila['com_id'].'">'.mb_strtoupper($fila['com_referencia']).' - '.mb_strtoupper($fila['com_nombre']).'</option>';
                                            }
                                    ?>
                                </select>
                            </section>
                        </div>
                    </div> <!-- /.form-group -->
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button type="submit"  class="btn btn-danger" name="util_comb" value="util_comb" id="util_comb" dir="libraries/pdf/pdf_reportes/utilidad_combos.php" >PDF</button>

                         <button type="submit" class="btn btn-success" name="util2_comb" value="util2_comb" id="util2_comb"  dir="libraries/php_excel/excel_utilidad_combos.php">EXCEL</button>
                    </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div> 
</div>

<!-- script para formulario con dos botones y redireccionamiento a paginas desde boton-->

<script type="text/javascript">
$(document).ready(function()
{
  $("button[type=submit]").click(function()
   {
    var accion = $(this).attr('dir');

    $('form').attr('action', accion);
  
   });
  
});
</script> 