<?php 
//activamos almacenamiento en el buffer
//ob_start();
//session_start();
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{
  //Solo para daniel es acceso y no venta
  if ($_SESSION['acceso']==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> 
              <div class="box-tools pull-right">
                <h1 class="box-title">Configuración\Empresa
              </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>Documento</th>
                  <th>Número Documento</th>
                  <th>Teléfono</th>
                  <th>Email</th>
                  <th>Logo</th>
                  <th>Estado</th>
                </thead>
                <tbody>
                </tbody>
                <tfoot>
                  <th>Opciones</th>
                  <th>Nombre</th>
                  <th>Documento</th>
                  <th>Número Documento</th>
                  <th>Teléfono</th>
                  <th>Email</th>
                  <th>Logo</th>
                  <th>Estado</th>
                </tfoot>   
              </table>
            </div>
            <!-- Menu de tab -->
            <div class="nav-tabs-custom" id="formularioregistros">
              <ul class="nav nav-tabs">
                <li class="active"><a href="#tab_1" data-toggle="tab">Empresa</a></li>
                <li><a href="#tab_2" data-toggle="tab">Venta</a></li>
                <li><a href="#tab_3" data-toggle="tab">Tasa de Cambio</a></li>
                <li><a href="#tab_4" data-toggle="tab">Impuestos</a></li>
                <li><a href="#tab_5" data-toggle="tab">Productos</a></li>
                <li><a href="#tab_6" data-toggle="tab">Datos Adicionales</a></li>
                <li><a href="#tab_7" data-toggle="tab">Sucursal</a></li>
                <li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-gear"></i></a></li>
              </ul>
              <div class="tab-content">
                <div class="tab-pane active" id="tab_1">
                  <div class="panel-body">
                      <form action="" name="formulario" id="formulario" method="POST">
                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                          <label for="">Nombre(*):</label>
                          <input class="form-control" type="hidden" name="idempresa" id="idempresa">
                          <input class="form-control" type="text" name="nombre" id="nombre" maxlength="100" placeholder="Nombre" required>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                          <label for="">Dirección</label>
                          <input class="form-control" type="text" name="direccion" id="direccion" placeholder="Dirección">
                        </div>
                        <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Tipo Documento(*):</label>
                          <select name="tipo_documento" id="tipo_documento" class="form-control select-picker" required>
                            <option value="RIF">RIF</option>
                            <option value="CEDULA">CÉDULA</option>
                          </select>
                        </div>
                        <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Rif/Cédula</label>
                          <input type="text" class="form-control" name="num_documento" id="num_documento" placeholder="Rif/Cédula" required>
                        </div>
                        <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Licencia de Licor</label>
                          <input type="text" class="form-control" name="licenciadelicor" id="licenciadelicor" placeholder="Licencia de Licor" >
                        </div>
                        <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Teléfono</label>
                          <input class="form-control" type="text" name="telefono" id="telefono" placeholder="Número de teléfono">
                        </div>
                        
                        <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Email: </label>
                          <input class="form-control" type="email" name="email" id="email" placeholder="email">
                        </div>
                        <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Logo:</label>
                          <input class="form-control" type="file" name="imagen" id="imagen">
                          <input type="hidden" name="imagenactual" id="imagenactual">
                          <img src="" alt="" width="150px" height="120" id="imagenmuestra">
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                          <button class="btn btn-primary pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button>
                          <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                        </div>
                      </form>
                  </div>
                </div>
                
                <div class="tab-pane" id="tab_2">
                  <div class="panel-body">
                    <form action="" name="formulario1" id="formulario1" method="POST">
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Número de Factura(*):</label>
                        <input type="text" class="form-control" name="num_factura" id="num_factura" placeholder="Nro. Factura" maxlength="20">
                        <input class="form-control" type="hidden" name="idempresa1" id="idempresa1">
                        <input class="form-control" type="hidden" name="idempresa_venta" id="idempresa_venta">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Número Control Factura</label>
                        <input class="form-control" type="text" name="num_control" id="num_control" placeholder="Nro. Control" maxlength="20">
                      </div>
                     

                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Número Nota Crédito</label>
                        <input class="form-control" type="text" name="num_notacredito" id="num_notacredito" placeholder="Nro. Nota Crédito" maxlength="20">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Número Control Nota Crédito</label>
                        <input class="form-control" type="text" name="numcontrol_notacredito" id="numcontrol_notacredito" placeholder="Nro. Control Nota Crédito" maxlength="20">
                      </div>

                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Número Nota Entrega</label>
                        <input class="form-control" type="text" name="num_notaentrega" id="num_notaentrega" placeholder="Nro. Nota de Entrega" maxlength="20">
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Número Control Nota Entrega</label>
                        <input class="form-control" type="text" name="numcontrol_notaentrega" id="numcontrol_notaentrega" placeholder="Nro. Control Nota Entrega" maxlength="20">
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Usuario</label>
                        <select name="idusuario" id="idusuario" class="form-control select-picker" required>
                           
                        </select>
                      </div>

                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Número Nota Entrega - 2</label>
                        <input class="form-control" type="text" name="num_notaentrega2" id="num_notaentrega2" placeholder="Nro. Nota de Entrega" maxlength="20">
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Número Control Nota Entrega - 2</label>
                        <input class="form-control" type="text" name="numcontrol_notaentrega2" id="numcontrol_notaentrega2" placeholder="Nro. Control Nota Entrega" maxlength="20">
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Usuario - 2</label>
                        <select name="idusuario2" id="idusuario2" class="form-control select-picker" required>
                           
                        </select>
                       
                      </div>

                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Número Pedido</label>
                        <input class="form-control" type="text" name="num_pedido" id="num_pedido" placeholder="Nro. Pedido" maxlength="20">
                      </div>
                      
                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <button class="btn btn-primary pull-right" type="submit" id="btnGuardarVenta"><i class="fa fa-save"></i>  Guardar</button>
                        <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                      </div>
                    </form>
                  </div> 
                </div>

                <div class="tab-pane" id="tab_3">
                  <div class="panel-body">
                    <form action="" name="formulario2" id="formulario2" method="POST">
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Tasa cambio en Dollar(*):</label>
                        <input type="text" class="form-control" name="tasa_dollar" id="tasa_dollar" placeholder="Tasa en Dollar" maxlength="20">
                        <input class="form-control" type="hidden" name="idempresa2" id="idempresa2">
                        <input class="form-control" type="hidden" name="idempresa_tasacambio" id="idempresa_tasacambio">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Tasa cambio en EURO</label>
                        <input class="form-control" type="text" name="tasa_euro" id="tasa_euro" placeholder="Tasa en EURO" maxlength="20">
                      </div>
                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <button class="btn btn-primary pull-right" type="submit" id="btnGuardarTasaCambio"><i class="fa fa-save"></i>  Guardar</button>
                        <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                      </div>
                    </form>
                  </div> 
                </div>

                <div class="tab-pane" id="tab_4">
                  <div class="panel-body">
                    <form action="" name="formulario3" id="formulario3" method="POST">
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Impuesto del Valor Agregado (IVA):</label>
                        <input type="text" class="form-control" name="iva" id="iva" placeholder="IVA" maxlength="20">
                        <input class="form-control" type="hidden" name="idempresa3" id="idempresa3">
                        <input class="form-control" type="hidden" name="idempresa_impuesto" id="idempresa_impuesto">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Impuestos aduanero:</label>
                        <input class="form-control" type="text" name="aduanero" id="aduanero" placeholder="Impuestos aduanero" maxlength="20">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Impuesto Artículo 18</label>
                        <br>
                        <input type="checkbox" name="impuestoart18" id="impuestoart18" value="no">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">% en precio (Cálculo del PVP) </label>
                        <input class="form-control" type="text" name="porcentajeprecio" id="porcentajeprecio" placeholder="Impuestos aduanero" maxlength="20">
                      </div>
                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <button class="btn btn-primary pull-right" type="submit" id="btnGuardarImpuesto"><i class="fa fa-save"></i>  Guardar</button>
                        <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                      </div>
                    </form>
                  </div> 
                </div>

                <div class="tab-pane" id="tab_5">
                  <div class="panel-body">
                    <form action="" name="formulario4" id="formulario4" method="POST">
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">    
                        <div class="social-auth-links text-center">
                          <button type="botton" class="btn btn-default btn-block btn-flat" id="btnActualizarPrecio">Actualizar Precios</button>
                          <input class="form-control" type="hidden" name="idempresa4" id="idempresa4">
                          <input class="form-control" type="hidden" name="idempresa_articulo" id="idempresa_articulo">
                        </div>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">    
                        <div class="social-auth-links text-center">
                          <button type="botton" class="btn btn-default btn-block btn-flat" id="btnActualizarCosto">Actualizar Costo</button>
                        </div>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">    
                        <div class="social-auth-links text-center">
                          <button type="botton" class="btn btn-default btn-block btn-flat" id="btnActualizarArt18"></i>Actualizar Articulo 18</button>
                        </div>
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">    
                        <div class="social-auth-links text-center">
                          <button type="botton" class="btn btn-default btn-block btn-flat" id="btnActualizarTodo"></i>Actualizar Todo</button>
                        </div>
                      </div>
                     
                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                       <!--  <button class="btn btn-primary pull-right" type="submit" id="btnGuardarImpuesto"><i class="fa fa-save"></i>  Guardar</button> -->
                        <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                      </div>
                    </form>
                  </div> 
                </div>

                <div class="tab-pane" id="tab_6">
                  <div class="panel-body">
                    <form action="" name="formulario5" id="formulario5" method="POST">
                        <input class="form-control" type="hidden" name="idempresa5" id="idempresa5">
                        <input class="form-control" type="hidden" name="idempresa_datosadicionales" id="idempresa_datosadicionales">
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">País de Origen</label>
                        <br>
                        <input type="checkbox" name="paisdeorigen" id="paisdeorigen" value="no">
                      </div>
                      
                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <button class="btn btn-primary pull-right" type="submit" id="btnGuardardatosadicionales"><i class="fa fa-save"></i>  Guardar</button>
                        <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                      </div>
                    </form>
                  </div> 
                </div>

                <div class="tab-pane" id="tab_7">
                  <form action="" name="formulario6" id="formulario6" method="POST">
                    <div class="col-md-12">
                      <div class="box box-primary">  
                        <div class="panel-body">
                          
                            <div class="form-group col-lg-6 col-md-6 col-xs-12">
                              <label for="">Sucursal:</label>
                              <input class="form-control" type="hidden" name="idempresa6" id="idempresa6">
                              <input class="form-control" type="hidden" name="idempresa_ventas" id="idempresa_ventas">
                              <input class="form-control" type="text" name="nombres" id="nombres" maxlength="100" placeholder="Nombre" required>
                            </div>
                            <div class="form-group col-lg-6 col-md-6 col-xs-12">
                              <label for="">Dirección</label>
                              <input class="form-control" type="text" name="direccions" id="direccions" placeholder="Dirección">
                            </div>
                            <div class="form-group col-lg-3 col-md-3 col-xs-12">
                              <label for="">Tipo Documento:</label>
                              <select name="tipo_documentos" id="tipo_documentos" class="form-control select-picker" required>
                                <option value="RIF">RIF</option>
                                <option value="CEDULA">CÉDULA</option>
                              </select>
                            </div>
                            <div class="form-group col-lg-3 col-md-3 col-xs-12">
                              <label for="">Rif/Cédula</label>
                              <input type="text" class="form-control" name="num_documentos" id="num_documentos" placeholder="Rif/Cédula" required>
                            </div>
                            <div class="form-group col-lg-3 col-md-3 col-xs-12">
                              <label for="">Licencia de Licor</label>
                              <input type="text" class="form-control" name="licenciadelicors" id="licenciadelicors" placeholder="Licencia de Licor" >
                            </div>
                            <div class="form-group col-lg-3 col-md-3 col-xs-12">
                              <label for="">Teléfono</label>
                              <input class="form-control" type="text" name="telefonos" id="telefonos" placeholder="Número de teléfono">
                            </div>
                            <!--
                            <div class="form-group col-lg-6 col-md-6 col-xs-12">
                              <label for="">Email: </label>
                              <input class="form-control" type="email" name="email" id="email" placeholder="email">
                            </div>
                            <div class="form-group col-lg-6 col-md-6 col-xs-12">
                              <label for="">Logo:</label>
                              <input class="form-control" type="file" name="imagen" id="imagen">
                              <input type="hidden" name="imagenactual" id="imagenactual">
                              <img src="" alt="" width="150px" height="120" id="imagenmuestra">
                            </div>
                            <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                              <button class="btn btn-primary pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button>
                              <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                            </div> -->
                          
                        </div>
                      </div>
                    </div>
                    <div class="col-md-12">
                      <div class="box box-info">
                        <div class="panel-body">
                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número de Factura:</label>
                            <input type="text" class="form-control" name="num_facturas" id="num_facturas" placeholder="Nro. Factura" maxlength="20">
                          </div>
                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número Control Factura</label>
                            <input class="form-control" type="text" name="num_controls" id="num_controls" placeholder="Nro. Control" maxlength="20">
                          </div>
                        

                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número Nota Crédito</label>
                            <input class="form-control" type="text" name="num_notacreditos" id="num_notacreditos" placeholder="Nro. Nota Crédito" maxlength="20">
                          </div>
                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número Control Nota Crédito</label>
                            <input class="form-control" type="text" name="numcontrol_notacreditos" id="numcontrol_notacreditos" placeholder="Nro. Control Nota Crédito" maxlength="20">
                          </div>

                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número Nota Entrega</label>
                            <input class="form-control" type="text" name="num_notaentregas" id="num_notaentregas" placeholder="Nro. Nota de Entrega" maxlength="20">
                          </div>
                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número Control Nota Entrega</label>
                            <input class="form-control" type="text" name="numcontrol_notaentregas" id="numcontrol_notaentregas" placeholder="Nro. Control Nota Entrega" maxlength="20">
                          </div>
                          

                          <!-- <div class="form-group col-lg-4 col-md-4 col-xs-12">
                            <label for="">Número Nota Entrega - 2</label>
                            <input class="form-control" type="text" name="num_notaentrega2" id="num_notaentrega2" placeholder="Nro. Nota de Entrega" maxlength="20">
                          </div>
                          <div class="form-group col-lg-4 col-md-4 col-xs-12">
                            <label for="">Número Control Nota Entrega - 2</label>
                            <input class="form-control" type="text" name="numcontrol_notaentrega2" id="numcontrol_notaentrega2" placeholder="Nro. Control Nota Entrega" maxlength="20">
                          </div>
                          <div class="form-group col-lg-4 col-md-4 col-xs-12">
                            <label for="">Usuario - 2</label>
                            <select name="idusuario2" id="idusuario2" class="form-control select-picker" required>
                              
                            </select>
                          
                          </div> -->

                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Número Pedido</label>
                            <input class="form-control" type="text" name="num_pedido" id="num_pedido" placeholder="Nro. Pedido" maxlength="20">
                          </div>
                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Usuario 1</label>
                            <select name="idusuarios" id="idusuarios" class="form-control select-picker" required>
                              
                            </select>
                          </div>
                          <div class="form-group col-lg-6 col-md-6 col-xs-12">
                            <label for="">Usuario 2</label>
                            <select name="idusuario2s" id="idusuario2s" class="form-control select-picker" required>
                              
                            </select>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <button class="btn btn-primary pull-right" type="submit" id="btnGuardarsucursal"><i class="fa fa-save"></i>  Guardar</button>
                        <button class="btn btn-danger pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
                    </div> 
                  </form>  
                </div>
                
                <!-- /.tab-pane -->
                
                
                </div>
                <!-- /.tab-pane -->
                <!-- /.tab-content -->
              </div>
                <!-- Fin de Menu de Tab -->
                 <!--fin centro-->
            </div>
            <div class="box-footer" id="formularioregistros1">
                    
            </div>
          </div>
        </div>
      <!-- /.box -->
      </div>
    </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/empresa.js"></script>
 </body>
  </html> 
<?php  
}
  ob_end_flush();
?>