<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($sonuclar);
$oda_sira=0;

?>
<br><br>
<style>
.table-fiyat { 
  width: 100%; 
  border-collapse: collapse; 
}

@media 
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px)  {

.table-fiyat  td img{display:none;}
 
.table-fiyat table,.table-fiyat thead,.table-fiyat tbody,.table-fiyat th,.table-fiyat td,.table-fiyat tr { 
        display: block; 
    }
    
    /* Hide table headers (but not display: none;, for accessibility) */
 .table-fiyat   thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
 .table-fiyat   tr { border: 1px solid #ccc; }
    
  .table-fiyat  td { 
        /* Behave  like a "row" */
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50% !important; 
    }
    
 .table-fiyat   td:before { 
        /* Now like a table header */
        position: absolute;
        /* Top/left values mimic padding */
        top: 6px;
        left: 6px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
    }
    
    /*
    Label the data
    */
 .table-fiyat   td:nth-of-type(1):before { content: "Oda Türü: "; }
.table-fiyat    td:nth-of-type(2):before { content: "Giriş Tarihi:"; }
    
.table-fiyat    td:nth-of-type(3):before { content: "Geceleme:"; }
    
.table-fiyat    td:nth-of-type(4):before { content: "Ücret:"; }
    
.table-fiyat    td:nth-of-type(5):before { content: "Rezervasyon:"; }
    

      
  }

</style>
<?php 
//print_r($sonuclar);

if($sonuclar["errorCode"]=="WS000"){
?>


<div class="table-responsive">
<table class="table table-bordered table-fiyat">
<tr class="danger hidden-xs">
<th>Oda Türü</th>
<th>Giriş Tarihi</th>
<th>Geceleme</th>
<th><?=Genel::dil_ceviri("booking_page_total_price")?></th>
<th><?=Genel::dil_ceviri("booking_page_reservation")?></th>
</tr>
<?php
//print_r($sonuclar);
foreach ($sonuclar["results"] as $totallist) {
    foreach ($totallist['PriceList'] AS $oteller){?>
<?php 

if($oteller["total_sales"]>0){
$oda_sira=$oda_sira+1;	
	?>

<tr>
<td  data-label="Bilgi"><button class="btn btn-danger btn-sm " data-toggle="tooltip" title="<?=lang($oteller["room_type"])?>" data-html="true"><i class="fa fa-info-circle"></i></button> <?=lang($oteller["room_type"])?></td>	
<td data-label="Giriş Tarihi"><?=date("d-m-Y",strtotime($oteller["checkin_date"]))?></td>
<td data-label="Geceleme"><?=$oteller["night"]?> Gece</td>
<td data-label="Toplam Ücret"><?=number_format($oteller["total_sales"],2,",","")?> <i class="fa fa-<?=strtolower($oteller["currency"])?>"></i></td>
<td data-label="İşlem">

<?php
if($oteller["total_sales"]>0 ){?>
<a href="/reservation/guest-info/<?=$grup_id?>/<?=$oteller["token"]?>?package_token[<?=$oteller["roomToken"]?>]=<?=$oteller["package_token"]?>" class="btn btn-sm btn-danger btn-block blinker"><?=Genel::dil_ceviri("booking_page_book")?></a>
<?php }else{?>
<button type="button" class="btn btn-sm btn-warning btn-block blinker"><?=Genel::dil_ceviri("booking_page_unavailable")?></button>
<?php }?>
</td>
</tr>
<?php }?>
    <?php }?>
<?php }?>


</table>

<br><br>
</div>

<?php }else{?>
<div class="alert alert-warning">
  <strong>Hata!</strong> <?=$sonuclar["description"]?></div>

<?php 
exit();
}?>

<?php if($oda_sira==0){?>

<div class="alert alert-warning">
  <strong><?=Genel::dil_ceviri("booking_page_error")?>!</strong> <?=Genel::dil_ceviri("booking_page_no_available_room")?>
</div>
<?php }?>






<script>
	$(function () {
  $('[data-toggle="tooltip"]').tooltip()
})
</script>