<?php



require_once ("../../config/Cado.php");
require_once ("cCancha.php");
$oCancha = new cCancha();

require_once("../piso/cPiso.php");
$oPiso = new cPiso(); 

$pis_id = $_POST['pis_id'];

//echo $salon_id.'-';

$dts1 = $oPiso->MostrarUno($pis_id);
$dt = mysqli_fetch_array($dts1);
$punven_nom = $dt['tb_puntoventa_nom']; 
$pis_nom = $dt['tb_piso_nom']; 



$datos=$oCancha->filtrar($pis_id);
$num_rows= mysqli_num_rows($datos);


?>

<section class="content">
	<div class="container-fluid">
	<div class="row">
	    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
		    <div class="card">
				<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="padding:5px;">
	
          <table id="tabla_cancha" class="table table-bordered table-striped">
           <thead>
		<tr style="background-color: white; ">  
		<td style="font-weight:bold; " colspan="2">CANCHAS  DE  <span class="text-red" ><?php echo $punven_nom.' - '.$pis_nom ; ?></span> </td>  
        <td height="30"  align="right" ><a class="btn_agregar btn btn-danger" href="javascript:void(0);" onClick="cancha_form('insertar','','<?php echo  $pis_id ?>')">Nueva Cancha</a></td>
		</tr>
      
    </thead>
	 
		</table>
		
		
			<div class="col-lg-12 col-sm-12 col-12">
			<div class="row">
          <?php
if($num_rows>0){

   
    while($fila = mysqli_fetch_array($datos)){
    ?>
       
	   
	   
	   <div class="col-lg-3 col-sm-3 col-6">
	   
		  <div class="card card-widget widget-user">

				<div class="widget-user-header text-white" style="background: url('../../imagenes/img_cancha.jpg') center center;">
				<h3 class="widget-user-username text-left"><?php echo $fila['tb_cancha_nom']?></h3>
				<h5 class="widget-user-desc text-left d-none"><?php echo $fila['tb_cancha_id']?></h5>
				</div>
				
				
				
								
				<div class="card-footer">
				<div class="row">

				<div class="col-sm-6 border-right">
				<div class="description-block">
					<span title="Editar" class="btn btn-lg btn-primary btn-flat " onClick="cancha_form('editar','<?php echo $fila['tb_cancha_id']?>','<?php echo $fila['tb_salon_id']?>')"  > <i class="fas fa-edit"></i></span>
				</div>
				</div>


				<div class="col-sm-6">
				<div class="description-block">	
					<span title="Eliminar" class="btn btn-lg btn-danger btn-flat " onClick="eliminar_cancha('<?php echo $fila['tb_cancha_id']?>','<?php echo $fila['tb_salon_id']?>')" ><i class="fas fa-trash"></i></span>
				</div>
				</div>

				</div>
				</div>
				

			</div>
	   
		</div>  
	   
	   
	  
          
              
           

    <?php
        }
        mysqli_free_result($datos);
		}
    ?>
	</div>
	</div>
	
   
   
   
	  
	  
    </div>
  </div>
</div>
</div>
</div>
</section>

