<?php 
//activamos almacenamiento en el buffer
//ob_start();
//session_start();
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{
  if ($_SESSION['ventas']==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">Ventas\Clientes -->
                      <h1 class="page-header">Ventas\Clientes</h1>
                    </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>Numero</th>
                      <th>Telefono</th>
                      <th>Email</th>
                    </thead>
                    <tbody>
                    </tbody>
                    <tfoot>
                      <th>Opciones</th>
                      <th>Nombre</th>
                      <th>Documento</th>
                      <th>Numero</th>
                      <th>Telefono</th>
                      <th>Email</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="idpersona" id="idpersona">
                    <input class="form-control" type="hidden" name="validado" id="validado">
                    <input class="form-control" type="hidden" name="tipo_persona" id="tipo_persona" value="Cliente">
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Tipo Documento</label>
                      <select class="form-control select-picker" name="tipo_documento" id="tipo_documento" required>
                        <option value="RIF">RIF</option>
                        <option value="CEDULA">CEDULA</option>
                      </select>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                      <label for="">Nombre</label>
                      <input class="form-control" type="text" name="nombre" id="nombre" maxlength="200" placeholder="Nombre del cliente" required>
                    </div>
                    
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Razon Social/Cedula</label>
                      <input class="form-control" type="text" name="num_documento" id="num_documento" maxlength="20" placeholder="Razon Social/Cedula">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Licencia de Licor</label>
                      <input class="form-control" type="text" name="licencia_licor" id="licencia_licor" maxlength="30" placeholder="licencia de licor">
                    </div>
                    <div class="form-group col-lg-6 col-md-6 col-xs-12">
                      <label for="">Direccion</label>
                      <input class="form-control" type="text" name="direccion" id="direccion" maxlength="600" placeholder="Direccion">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Telefono</label>
                      <input class="form-control" type="text" name="telefono" id="telefono" maxlength="20" placeholder="Número de Telefono">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Email</label>
                      <input class="form-control" type="email" name="email" id="email" maxlength="50" placeholder="Email">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                        <label for="">Lista Precio</label>
                        <select name="idlistaprecio" id="idlistaprecio" class="form-control selectpicker" data-Live-search="true" ></select>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Zona</label>
                      <select class="form-control select-picker" name="idzona" id="idzona" required>
                        
                      </select>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                        <label for="">Contribuyente Expecial</label>
                        <br>
                        <input type="checkbox" name="contribuyente" id="contribuyente" value="no">
                        
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                        <label for="">Reseña en Dollar</label>
                        <br>
                        <input type="checkbox" name="resenaendollar" id="resenaendollar" value="si">
                    </div>
                    <div class="form-group col-lg-9 col-md-9 col-xs-12">
                       
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                      <h5 class="page-header">Despacho</h5>
                    </div>
                   
                    <!-- Despacho -->
                    <!-- <section id="new"> -->
                      <!-- <h5 class="page-header">Despacho</h5> -->
                      <div class="form-group col-lg-2 col-md-2 col-xs-12">
                          <label for="">Tipo Documento</label>
                          <select class="form-control select-picker" name="tipo_documentod" id="tipo_documentod" required>
                            <option value="RIF">RIF</option>
                            <option value="CEDULA">CEDULA</option>
                          </select>
                      </div>
                      <div class="form-group col-lg-4 col-md-4 col-xs-12">
                          <label for="">Nombre</label>
                          <input class="form-control" type="text" name="nombred" id="nombred" maxlength="200" placeholder="Nombre del cliente" required>
                      </div>
                        
                      <div class="form-group col-lg-3 col-md-3 col-xs-12">
                          <label for="">Razon Social/Cedula</label>
                          <input class="form-control" type="text" name="num_documentod" id="num_documentod" maxlength="20" placeholder="Razon Social/Cedula">
                      </div>
                      <div class="form-group col-lg-3 col-md-3 col-xs-12">
                          <label for="">Licencia de Licor</label>
                          <input class="form-control" type="text" name="licencia_licord" id="licencia_licord" maxlength="30" placeholder="licencia de licor">
                      </div>
                      <div class="form-group col-lg-6 col-md-6 col-xs-12">
                          <label for="">Direccion</label>
                          <input class="form-control" type="text" name="direcciond" id="direcciond" maxlength="600" placeholder="Direccion">
                      </div>
                      <div class="form-group col-lg-3 col-md-3 col-xs-12">
                          <label for="">Telefono</label>
                          <input class="form-control" type="text" name="telefonod" id="telefonod" maxlength="20" placeholder="Número de Telefono">
                      </div>
                      <div class="form-group col-lg-3 col-md-3 col-xs-12">
                          <label for="">Email</label>
                          <input class="form-control" type="email" name="emaild" id="emaild" maxlength="50" placeholder="Email">
                      </div>  
   
                    <!-- </section> -->
                    <!-- Fin de despacho  -->
                  </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>
    <?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/cliente.js"></script>
      </body>
  </html> 
<?php  
}
  ob_end_flush();
?>
