<?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">SalesWare\Personal Administrativo
                    </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>Zona</th>
                      <th>Telefono</th>
                      <th>Email</th>
                      <th>Estado</th>
                    </thead>
                    <tbody>
                    </tbody>
                    <tfoot>
                      <th>Opciones</th>
                      <th>Nombre</th>
                      <th>Documento</th>
                      <th>Zona</th>
                      <th>Telefono</th>
                      <th>Email</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="placa" id="placa" value="N/A">
                    <input class="form-control" type="hidden" name="idpersonasales" id="idpersonasales">
                    <input class="form-control" type="hidden" name="validado" id="validado">
                    <input class="form-control" type="hidden" name="tipo_persona" id="tipo_persona">
                    <input class="form-control" type="hidden" name="vehiculo" id="vehiculo" value='N/A'>
                    <input class="form-control" type="hidden" name="comisioncobranza1" id="comisioncobranza1" value='0'>
                    <input class="form-control" type="hidden" name="comisioncobranza2" id="comisioncobranza2" value='0'>
                    <input class="form-control" type="hidden" name="comisioncobranza3" id="comisioncobranza3" value='0'>
                    <input class="form-control" type="hidden" name="idzona" id="idzona" value='1'>
                   
                    <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 del cliente" required>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 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">CÉDULA</option>
                      </select>
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Razón Social/Cédula</label>
                      <input class="form-control" type="text" name="num_documento" id="num_documento" maxlength="20" placeholder="Razón Social/Cédula">
                    </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="direccion" id="direccion" maxlength="400" placeholder="Dirección">
                    </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="telefono" id="telefono" maxlength="20" placeholder="Número de Teléfono">
                    </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="">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="">Cargo</label>
                        <select class="form-control select-picker" name="idcargo" id="idcargo" required>
                          <option value="0">Seleccione un Cargo</option>
                          <option value="1">Administrador</option>
                          <option value="3">Sub-Gerente</option>
                          <option value="2">Gerente</option>
                      </select>
                      
                    </div>
                    <br/>
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                    </div>
                    <br/>
                    <!-- Modulo de Comisiones -->
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                      <div class="box">
                          <div class="box-header with-border">
                            <h3 class="box-title">Comisiones</h3>

                            <div class="box-tools pull-right">
                              <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip"
                                      title="Collapse">
                                <i class="fa fa-minus"></i></button>
                              <button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
                                <i class="fa fa-times"></i></button>
                            </div>
                          </div>
                           <div class="box-body">
                            <div class="form-group col-lg-2 col-md-2 col-xs-12">
                              <label for="">% de venta</label>
                              <input class="form-control" type="text" name="comisionventa1" id="comisionventa1" maxlength="50" placeholder="% Comisión de venta">
                            </div>
                            <!-- <div class="form-group col-lg-6 col-md-6 col-xs-12">
                              <label for="">De Cobranza</label>
                              <div class="box">
                                <div class="box-header">
                                  <h3 class="box-title">Porcentaje por días de cobranza</h3>
                                </div>
                                
                                <div class="box-body no-padding">
                                  <table class="table table-condensed">
                                    <tr>
                                      <th style="width: 10px">#</th>
                                      <th style="width: 50px">Meta</th>
                                      
                                      <th style="width: 40px">% Porcentaje</th>
                                    </tr>
                                    <tr>
                                      <td>1.</td>
                                      <td>1 a 21 Días</td>
                                      
                                      <td>
                                        <input class="form-control" id="comisioncobranza1" name="comisioncobranza1" type="text" maxlength="10" placeholder="Porcentaje">
                                      </td>
                                    </tr>
                                    <tr>
                                      <td>2.</td>
                                      <td>22 a 30 Días</td>
                                      
                                      <td><input class="form-control" id="comisioncobranza2" name="comisioncobranza2" type="text" maxlength="10" placeholder="Porcentaje"></td>
                                    </tr>
                                    <tr>
                                      <td>3.</td>
                                      <td>31 a * Días</td>
                                      
                                      <td><input class="form-control" id="comisioncobranza3" name="comisioncobranza3" type="text" maxlength="10" placeholder="Porcentaje"></td>
                                    </tr>
                                    
                                  </table>
                                </div>
                                
                              </div>

                             
                            </div> -->
                            <div class="form-group col-lg-4 col-md-4 col-xs-12">
                              
                          </div> 
                          <!-- /.box-body -->
                          <div class="box-footer">
                            
                          </div>
                          <!-- /.box-footer-->
                      </div>
                    </div>

                    <div class="form-group col-lg-12 col-md-12 col-xs-12">  
                      
                    </div> 
                    <!--  Fin de modulo de comisiones -->
                  </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/personasales.js"></script>
      </body>
  </html> 
<?php  
}
  ob_end_flush();
?>
