<?php
//ini_set('display_errors',1);
require_once ("../../config/Cado.php");
require_once ("../piso/cPiso.php");
$oPiso = new cPiso();
//$oSalon = cSalon::ningunDato();
$dts = $oPiso->selectConLocal('');
$num_rows= mysqli_num_rows($dts);
?>
<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;">
	
	<div class="table-responsive">
		
          <table id="tabla_salon" class="table table-bordered table-striped">
           <thead>
		<tr >  
		<td style="font-weight:bold; " colspan="3">PISOS PUNTO VENTA</td>  
        <td height="30"  align="right" ><a class="btn_agregar btn btn-danger" href="javascript:void(0)" onClick="piso_form('insertar')">Nuevo Piso</a></td>
		</tr>
        
		<tr>
        <th>EMPRESA | PUNTO VENTA</th>
        <th>PISO</th>
        <th>ALMACEN</th>
        <th></th>
        </tr>
    </thead>
          <?php
if($num_rows>=1){
?>  
    <tbody>
    <?php
   
    while($fila = mysqli_fetch_array($dts)){
    ?>
        <tr>
            <td><?php echo $fila['tb_empresa_nomcom'].' | '.$fila['tb_puntoventa_nom']; ?></td>
            <td><?php echo $fila['tb_piso_nom']; ?></td>
            <td><?php echo $fila['tb_almacen_nom']?></td>
                   
			<td align="center" >					
			<span title="Ver canchas" class="btn btn-warning btn-sm" 
			onClick="cancha_tabla('<?php echo $fila['tb_piso_id']?>','1','<?php echo $fila['tb_puntoventa_nom'].' | '.$fila['tb_piso_nom']; ?>')"  ><i class="fas fa-futbol"></i></span>
			
           
<span class="btn btn-sm btn-primary" onClick="piso_form('editar','<?php echo $fila['tb_piso_id']?>')" ><i class="fas fa-edit"></i></span>
<span class="btn btn-sm btn-danger" onClick="eliminar_piso('<?php echo $fila['tb_piso_id']?>')" ><i class="fas fa-trash"></i></span>
		   </td>
                 
            </tr>
    <?php
        }
        mysqli_free_result($dts);
    ?>
    </tbody>
    <?php
}
?>
      </table>
    </div>
    </div>
    </div>
  </div>
</div>
</div>
</section>