<?php
//activamos almacenamiento en el buffer
//ob_start();
//session_start();
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{
  if ($_SESSION['compras']==1) {
  ?>
      <!-- Main content -->
      <section class="content">
        <!-- Default box -->
        <div class="row">
          <div class="col-md-12">
            <div class="box">
              <div class="box-header with-border">
                <button class="btn bg-green btn-app" onclick="mostrarform(true)" id="btnagregar"><i class="fa fa-plus-circle"></i> Agregar</button></h1>
                <div class="box-tools pull-right">
                  <h1 class="box-title">Promociones\Movimiento Inventario Mayor a Individual  
                </div>
              </div>
              <!--box-header-->
              <!--centro-->
              <div class="panel-body table-responsive" id="listadoregistros">
                <table id="tbllistado" class="table table-striped table-bordered table-condensed table-hover">
                  <thead>
                    <th>Opciones</th>
                    <th>Fecha</th>
                    <th>AlmacenSalida</th>
                    <th>AlmacenEntrada</th>
                    <th>Número</th>
                    <th>Cantidad</th>
                    <th>Estado</th>
                  </thead>
                  <tbody>
                  </tbody>
                  <tfoot>
                  <th>Opciones</th>
                    <th>Fecha</th>
                    <th>AlmacenSalida</th>
                    <th>AlmacenEntrada</th>
                    <th>Número</th>
                    <th>Cantidad</th>
                    <th>Estado</th>
                  </tfoot>   
                </table>
              </div>
              
              <div class="form-group col-lg-12 col-md-12 col-xs-12">
                <div class="panel-body" style="height: 400px;" id="formularioregistros">
                  <form action="" name="formulario" id="formulario" method="POST">
                    
                    <input class="form-control" type="hidden" name="idmovimientoinventario" id="idmovimientoinventario">
                    <input class="form-control" type="hidden" name="validar" id="validar">
                    
                    <input class="form-control" type="hidden" name="idempresa_venta" id="idempresa_venta" value="<?php echo $_SESSION['idempresa_venta_empresa'] ?>" >
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Almacen Salida</label>
                      <select class="form-control select-picker" name="idalmacensalida" id="idalmacensalida" required>
                      </select>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Almacen Entrada</label>
                      <select class="form-control select-picker" name="idalmacenentrada" id="idalmacenentrada" required>
                      </select>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-6">
                      <label for="">Nro. Control: </label>
                      <input class="form-control" type="text" name="nromovimientoinventario" id="nromovimientoinventario" maxlength="20" placeholder="Serie" readonly>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Fecha(*): </label>
                      <input class="form-control" type="date" name="fecha_hora" id="fecha_hora" required>
                    </div>
                                      
                    <!-- table table-bordered table-hover -->
                    <!-- table table-striped table-bordered table-condensed table-hover -->
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                      <table id="detalles" class="table table-bordered table-condensed table-hover">
                          <thead style="background-color:#A9D0F5">
                            <th width=10>Opciones</th>
                            <th>Stock</th>
                            <th>Articulo Salida</th>
                            <th>Cantidad Salida</th>
                            <th>Articulo Entrada</th>
                            <th>Cantidad Entrada</th>
                            <th width=10>Subtotal</th>
                            <th>Estado</th>
                          </thead>
                          <tfoot>
                            <th width=10>TOTAL</th>
                            <th></th>
                            <th></th>
                            <th width=5><h4 id="totals"></h4>
                              <input type="text" name="total_salida1" id="total_salida1"  style="text-align:right" disabled>
                              <input type="hidden" name="total_salida" id="total_salida">
                            </th>
                            <th></th>
                            <th width=5><h4 id="totale"></h4>
                              <input type="text" name="total_entrada1" id="total_entrada1"  style="text-align:right" disabled>
                              <input type="hidden" name="total_entrada" id="total_entrada">
                            </th>
                            
                            <th width=5><h4 id="total"></h4>
                              <input type="text" name="total_venta1" id="total_venta1"  style="text-align:right" disabled>
                              <input type="hidden" name="total_venta" id="total_venta">
                            </th>
                            <th></th>
                          </tfoot>
                          <tbody>
                            
                          </tbody>
                      </table>
                    </div>
                  
                  </form>
                </div>  
                <div class="box-footer" id="formularioregistros1">
                    <div class="btn-group col-lg-12 col-md-12 col-xs-12">
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <button type="button" class="btn bg-blue btn-app pull-left" id="btnAgregarArt"><i class="fa fa-inbox"></i>Producto</button>
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12" >
                        <label for="">Ingrese en codigo de barra </label>
                        <input class="form-control" type="text" name="cod_barra" id="cod_barra" maxlength="30" placeholder="Codigo Barra Producto" >
                        
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <!-- <button class="btn bg-blue btn-app pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button> -->
                        <!-- <a data-toggle="modal" href="#myModalT"> -->
                          <button class="btn bg-blue btn-app pull-right" type="submit" id="btnGuardar"><i class="fa fa-bank"></i>  Guardar</button>
                        <!-- </a> -->  
                        <button class="btn bg-red btn-app pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                      </div>
                    </div>
                </div>
               
                <!--Modal-->
                <div class="modal fade" id="myModalA" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 55% !important;">
                    <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">Seleccione un Articulo</h4>
                      </div>
                    
                      <div class="modal-body">
                        <table id="tblarticulosa" class="table table-striped table-bordered table-condensed table-hover">
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre33</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="modal fade" id="myModalB" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 55% !important;">
                    <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">Seleccione un Articulo</h4>
                      </div>
                      <div class="modal-body">
                        <table id="tblarticulosb" class="table table-striped table-bordered table-condensed table-hover">
                          <thead>
                          <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                          <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>
              
                  <!-- fin Modal-->

                <!--fin centro-->
              </div>
              
          </div>
        </div>
      <!-- /.box -->
      </section>
      <!-- /.content -->
    </div>
    
  <?php 
  }else{
    require 'vistas/contenidos/noacceso-view.php';
  }
 ?>
  <!-- Main Footer -->
  <?php include "vistas/modulos/mainfooter.php";?>
  </div>
  <!-- ./wrapper -->
  <!-- REQUIRED JS SCRIPTS -->
  <?php include "vistas/modulos/script.php";?>
  <script src="vistas/scripts/movimientoinventariomayorindividual.js"></script>
  </body>
  </html> 
<?php 
}

ob_end_flush();
  ?>

