<%- include('partials/_header'); %>



<nav style="Background-color:rgb(14, 14, 14); width: 100%; height: 7%;" class="navbar navbar-expand-lg">
  <div class ="row" style="width: 100%;">
    <div style= "width:70%; align-content: center; justify-content: center;"> 
      <br>     
      <form class="row g-3" action="/buscojugador" method="get">    
                  <div class="col-auto">
                    <label style="font-size:15px; font-weight:bold; color: rgb(255, 255, 255);">Buscar Jugadores</label>&nbsp;&nbsp;          
                  </div>
            
                  <div class="col-auto">
                      <input  style="border-radius:5px; width:250px; height:30px;" name="jugadorbuscado" type="text" class="form-control" placeholder="Jugador">
                  </div>
            
                  <div class="col-auto">
                    <button style="width:70px; height:30px; padding:0;" type="submit" class="btn btn-danger">
                        Buscar
                    </button>
                  </div>
            </form>
    </div>
     
      
      <div style= "width:30%; justify-content: right;"> 
        <br> 
        <div class="col-auto">
           <img src="/resources/img/usuariob.png" width="30" height="30">  
        </div>
        <div class="col-auto">
            <h1 style="font-size: 12px; color:white"><strong><%= "name" %></strong></h1>&nbsp;&nbsp;&nbsp;&nbsp;
        <div class="col-auto">
      </div>
  </div>
</nav>    




<hiv class="div_contenedor">
  <div class="div_centrado_jugadores">

            <table class="table">
         
          <thead>
            <tr style="font-size:12px;  font-weight: bold;">
              
              <th>Bonus</th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th></th>             
              <th></th>
            </tr>
          </thead>


          <tbody>

            <% if (data) { %>
                <% for (var i=0; i < data.jugadores.length; i++) { %>
                <tr style="font-size:12px;">
                    <td><%= data.jugadores[i].Nombre +", " + data.jugadores[i].Apellido %></td>
                    <% miimagen="/resources/img/" + data.jugadores[i].Imagen %>                    
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td><%= data.jugadores[i].Descripcion_Puestos %></td>  
                    <td><img style="width:30px; height: 40px;" src="<%= miimagen %>"></td>   
                    <td></td>
                    <td>
                     <a style="text-decoration: none; color:black" href="/verbonusjugador/<%= data.jugadores[i].Id_Jugadores %>"><img style="width:20px; height: 20px;" src=resources/img/contrato.png>Bonus</a>
                   </td>
                                       
                    
                    </tr>
                <% } %>
            <% } %>

        </tbody>

         </table>



   
</div>
</div>

<script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script>

<% if(typeof alert != "undefined") { %>
    <script>
        Swal.fire({
         title: '<%= alertTitle %>',
         text:'<%= alertMessage %>',
         icon: '<%= alertIcon %>',
         showConfirmButton: <%= showConfirmButton %> ,
         timer: <%= 1500 %>             
        }).then(()=>{
            window.location='<%= ruta %>' 
        })            
    </script>
<% } %>







<%- include('partials/_footer'); %>