<?php 
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{

  if ($_SESSION['almacen']==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> 
                    <a target="_blank" href='<?php echo SERVERURL ?>reportes/rptservicio.php'>
                    <button class="btn bg-blue btn-app" id="btnreporte"><i class="fa fa-clipboard"></i>Reporte</button></a></h1>
                    <div class="box-tools pull-right">
                      <h1 class="box-title">Tablas\Servicios
                    </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>Nombre</th>
                      <th>Descripción</th>
                      <th>Categoría</th>
                      <th>Modulo</th>
                      <th>Precio</th>
                      <th>Porcentaje</th>
                      
                      <th>Estado</th>
                    </thead>
                    <tbody>
                    </tbody>
                    <tfoot>
                    <th>Opciones</th>
                      <th>Nombre</th>
                      <th>Descripción</th>
                      <th>Categoría</th>
                      <th>Modulo</th>
                      <th>Precio</th>
                      <th>Porcentaje</th>
                      
                      
                      <th>Estado</th>
                    </tfoot>   
                  </table>
                </div>
              
                <div class="panel-body" style="height: 400px;" id="formularioregistros">
                  <form action="" name="formulario" id="formulario" method="POST">
                      <input class="form-control" type="hidden" name="idservicio" id="idservicio">
                      <input class="form-control" type="hidden" name="validado" id="validado">
                      <input class="form-control" type="hidden" name="tasa_dollar" id="tasa_dollar" value="<?php echo $_SESSION['tasa_dollar_empresa'] ?>">
                      <input class="form-control" type="hidden" name="tasa_euro" id="tasa_euro" value="<?php echo $_SESSION['tasa_euro_empresa'] ?>">
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Nombre:</label>
                        
                        <input class="form-control" type="text" name="nombre" id="nombre" maxlength="100" placeholder="Nombre" required>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Descripción</label>
                        <input class="form-control" type="text" name="descripcion" id="descripcion" maxlength="256" placeholder="Descripción">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Tipo</label>
                        <select name="idmodulo" id="idmodulo" class="form-control selectpicker" data-Live-search="true" required></select>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Tipo Servicio</label>
                        <select name="idtiposervicio" id="idtiposervicio" class="form-control selectpicker" data-Live-search="true" required></select>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Precio $</label>
                        <input class="form-control" type="text" name="preciosd" id="preciosd"  required>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Precio Bs.</label>
                        <input class="form-control" type="text" name="precios" id="precios"  required>
                      </div>

                      <div class="form-group col-lg-6 col-md-6 col-xs-12" id="porcentaje1">
                        <label for="">Porcentaje</label>
                        <input class="form-control" type="text" name="porcentaje" id="porcentaje"  required>
                      </div>

                     <div class="form-group col-lg-2 col-md-2 col-xs-12" id="islr1">
                        <label for="">Retención ISLR</label>
                        <br>
                        <input type="checkbox" name="islr" id="islr" value="no">
                      </div>
                          
                      <div class="form-group col-lg-10 col-md-10 col-xs-12" id="islr2">
                        <label for="">Tipo de Retención</label>
                        <select class="form-control select-picker" name="idimpuestoslr" id="idimpuestoslr" required>
                              

                        </select>
                      </div>

                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Código</label>
                        <input class="form-control" type="text" name="codigo" id="codigo" placeholder="código del servicio" required>
                        <div><br>
                          <button class="btn btn-success" type="button" onclick="generarbarcode()">Generar</button>
                          <button class="btn btn-info" type="button" onclick="imprimir()">Imprimir</button>
                        </div>
                        <div id="print">
                          <svg id="barcode"></svg>
                        </div>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Exento de iva</label><br>
                          <input type="checkbox" name="exento" id="exento" value="si">
                          <input type="hidden" name="exento1" id="exento1">
                                          
                      </div>
                  </form>  
                </div>
                <div class="box-footer" id="formularioregistros1">
                    <button class="btn bg-blue btn-app pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button>
                    <button class="btn bg-red btn-app pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                </div>
                
              <!--fin centro-->
            </div>
          </div>
        </div>
                    <!-- /.box -->

      </section>
      <!-- /.content -->
      </div>
          <!-- /.content-wrapper -->
  <?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/public/js/JsBarcode.all.min.js"></script>
      <script src="vistas/public/js/jquery.PrintArea.js"></script>
      <script src="vistas/scripts/servicios.js"></script>
  </body>
  </html> 
  <?php 
}
ob_end_flush();
?>