<?php
//Activamos el almacenamiento en el buffer
ob_start(); 
session_start();

//definimos la variable $rutaBase
$rutaBase = "../";

//Verificar si el usuario ha iniciado sesion 
if (!isset($_SESSION['_AL_id_bingo'])) { 
  header('Location: '.$rutaBase.'login.php?Acceso_No_Permitido');
  exit;
}

require $rutaBase.'header.php';
?>
<!--==================================================================================================================-->
<style>
   label {
            color: white;
        }
        
        .dataTables_info {
            color: white; /* Cambiar el color a blanco */
        }
</style>
<section class="content">
  <div class="container-fluid">



    <!--==---------------------------------------------------------------------------------==-->
    <div class="card card-primary" id="card_header" style="margin-bottom: 2px;">
      <div class="card-header">
        <b>Compras de Cartones</b>
        <div id="contenedorbolas" style="display: flex; gap: 10px;">
        </div>
      </div>
    </div>

    <!--==---------------------------------------------------------------------------------==-->


    <!--========================================== Tabla ==========================================-->
    <div class="container-fluid" id="tabla">
      <div class="row">
        <div class="col-12">
          <div class="card" id="listadoregistros">

            <div class="card-body" id="contenedorDatatable" style="background:  #243443 ;">

  <div class="row">
     <div class="form-group col-md-2 col-xs-12">
        <label>Prox Partida a Jugar</label>
        <input type="text" name="proxpartida" id="proxpartida" class="form-control" placeholder="" maxlength="30" value="" readonly> 
      </div>

     <div class="form-group col-md-2 col-sm-6 col-xs-1">
        <label>Jugadores</label>
        <select aria-label="Default select example" name="jugadores" id="jugadores" class="form-control" required>
        </select>
      </div>
<div class="form-group col-md-2 col-sm-6 col-xs-1">
        <label>Elegir Carton</label>
        <select aria-label="Default select example" name="id_carton" id="id_carton" class="form-control" required>
        </select>
      </div>

        <div class="form-group col-md-1 col-xs-12 d-flex align-items-end">
        <button class="btn btn-primary btn-sm" onclick="enviarCompra()">Comprar</button>
    </div>
     


  </div>

   <table id="datatable" class="table table-bordered table-dark">
            <thead>
              <tr align="center">
                <th>Jugador</th>
                <th>N° Carton</th>
                <th>N° Partida</th>
                <th class="noExport">Opciones</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                                      
              </tr>                      
            </tbody>

            <tfoot>  
            </tfoot>
          </table>

              </div>
            </div>   
          </div>
        </div>
      </div>
    </div>
  </section>
<input type="hidden" name="id_user" id="id_user" value="<?php echo $_SESSION['_AL_id_bingo']; ?>" class="form-control" readonly>
  <!-- Fin Contenido PHP-->
  <?php
  require $rutaBase.'footer.php';
  ?>

  <script type="text/javascript" src="scripts/comprar_cartones.js<?php echo '?r='.date('Y-m-d H:i:s');?>"></script>

  <?php 
  ob_end_flush();
?>