<?php 
//activamos almacenamiento en el buffer
//ob_start();
//session_start();
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{
  //if ($_SESSION['cxp']==1) {
  if ($_SESSION['cxpagar']==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">
                  
                    <div class="box-tools pull-right">
                      <h1 class="box-title">Cuentas X Pagar\Pagos
                    </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>Rif./Cedula</th>
                      <th>Saldo</th>
                      <th>Estado</th>
                    </thead>
                    <tbody>
                    </tbody>
                    <tfoot>
                    <th></th>
                      <th></th>
                      <th></th>
                      <th></th>
                      <th></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="idpagoproveedor" id="idpagoproveedor">
                    <input class="form-control" type="hidden" name="agenteretencion" id="agenteretencion">
                    <input class="form-control" type="hidden" name="idbancocuentap" id="idbancocuentap"> 
                    <input class="form-control" type="hidden" name="idpersona" id="idpersona">
                    <input class="form-control" type="hidden" name="idusuario" id="idusuario" value=<?php echo $_SESSION['idusuario'] ?>>
                    <input class="form-control" type="hidden" name="validado" id="validado">
                    <input class="form-control" type="hidden" name="idempresa_venta" id="idempresa_venta" value="<?php echo $_SESSION['idempresa_venta_empresa'] ?>" >
                    <input class="form-control" type="hidden"name="diferencia" id="diferencia" value="0.00">
                    <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" readonly="readonly">
                      
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Forma de Pago</label>
                        <select name="idformapago" id="idformapago" class="form-control selectpicker" data-Live-search="true" ></select>
                    </div>
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                        <label for="">Tipo de Pago</label>
                        <select name="idtipopagos" id="idtipopagos" class="form-control selectpicker" data-Live-search="true" ></select>
                    </div>
                    <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Cuenta de Banco</label>
                        <select name="idbancocuenta" id="idbancocuenta" 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="">Referencia de Pago</label>
                      <input class="form-control" type="text" name="referencia" id="referencia" maxlength="20" placeholder="Referencia de Pago">
                    </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>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Monto del Pago Dollar</label>
                      <input class="form-control" type="text" name="montopago" id="montopago"  value="0,00" placeholder="0,00">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Monto del Pago Bolivares</label>
                      <input class="form-control" type="text" name="montopagob" id="montopagob"  value="0,00" placeholder="0,00">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Tasa de Cambio</label>
                      <input class="form-control" type="text" name="tasacambioventa" id="tasacambioventa"  value="0,00" >
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Diferencia</label>
                      <input class="form-control" type="text" name="montopagod" id="montopagod"  value="0,00" placeholder="0,00">
                    </div>
                   
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                      <table id="detalles" class="table table-striped table-bordered table-condensed table-hover">
                        
                      </table>
                    </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>
        <!-- /.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/pagoproveedorordencompra.js"></script>
      </body>
  </html> 
<?php  
}
  ob_end_flush();
?>
