<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($result);

$general=$result->general;

?><!-- Booking Right -->
            <div class="nBookingRight relativeDiv">
                <!-- Booking Cart Mobile Trigger -->
                <div class="nbMobileTrigger"><i class="fa fa-shopping-cart"></i>Sepeti Gör ve İlerle </div>
                <!-- nBooking Cart -->
                <div class="nBookingCart">
                    <div class="bcaClose"><i class="fa fa-close"></i></div>
                    <div class="local-loading hidden" data-name="basketLoading">
                        <i class="fa fa-spinner fa-spin fa-5x fa-fw"></i>
<span class="sr-only">Loading...</span>

                    </div>

<div class='bcAccommodation'>
    <div class='bcaImage'><img src='<?=$general->photo?>'></div>
    <div class='bcaTitle'><?=$hotel_detail->hotel_name?></div>

<div class='bcaDesc'><?=$hotel_detail->cityName?>, <?=$hotel_detail->townName?>  </div>

<?php
$currency="TRY";
$total_amount=$konaklama_toplami=0;
foreach ($rooms as $rooms) {
$konaklama_toplami=$konaklama_toplami+$rooms->room_detail->sellingwithselectedcurrency;
$total_amount=$total_amount+$konaklama_toplami;
    ?>
<div class='bcaSubTitle'><?=$rooms->adult?> Yetişkin <?php if($rooms->child>0){?>, <?=$rooms->child?> Çocuk<?php }?>,  <?=$rooms->room_detail->room_type_name?>, <?=$rooms->room_detail->concept_name?></div>


<?php }?>


<div class='bcaDates'>                <div class='line'></div>
<div class='bcaDate'><?=genel::dateextralongtr($search_criterias->checkinDate)?> </div>
<div class='bcaDate fr pull-right'><?=genel::dateextralongtr($search_criterias->checkoutDate)?></div>
</div>

<div class='bcaPrice'>
    <div class='label'>Konaklama :</div> <div class='price'><?=number_format($konaklama_toplami,2,",","")?> <i class="fa fa-<?=strtolower($currency)?>"></i></div></div></div>


<?php 
$sigorta_varmi=0;
$insurance=$this->db->where('token',$token)->get('booking_products_cancellation_insurance')->row();
if(!is_null($insurance)){
$sigorta_varmi=1;

$converted_price=genel::currency_convert(array(),$insurance->sales_currency,$currency,$insurance->sales);
//print_r($converted_price);

$total_amount=$total_amount+$converted_price["amount"];
?>


<div id="CancelRightDetailID" class="cartContent "> <div class="bcExtra"> 
<div class="bceRemove basket_remove_incurance" data-insurance-id="<?=$insurance->product_id?>" ><i class="fa fa-close"></i> Çıkar</div>         <div class="bceLeft">             <span class="bceTitle">İptal Garanti</span><br>         </div>         <div class="bcePrice"><?=number_format($converted_price["amount"],2,",","")?> <i class="fa fa-<?=strtolower($currency)?>"></i></div>     </div></div>
<?php }?>



<?php $this->db->where('booking_products_transfers.token',$token);

$this->db->join('transfer_list','transfer_list.transfer_id=booking_products_transfers.transfer_id');

$transfer=$this->db->select('booking_products_transfers.*, transfer_list.from_type,
transfer_list.to_type,')->get("booking_products_transfers")->result();
//print_r($transfer);


//print_r($transfer);
foreach ($transfer as $transfer) {


if($transfer->from_type==5){
$from_str=genel::find_airport_name($transfer->from);
}else{
$from_str=genel::find_destination_name($transfer->from);    
}
if($transfer->to_type==5){
$to_str=genel::find_airport_name($transfer->to);
}else{
$to_str=genel::find_destination_name($transfer->to);    
}

$converted_price=genel::currency_convert(array(),$transfer->currency,$currency,$transfer->sales);
//print_r($converted_price);

$total_amount=$total_amount+$converted_price["amount"];


?>

<div id="DepartureTransferRightDetailID"><div class="bcExtra">    <div data-transfer-id="<?=$transfer->transfer_id?>" data-isreturn="<?=$transfer->isreturn?>" class="bceRemove remove-basket-transfer" ><i class="fa fa - close"></i> Çıkar</div>    <div class="bceLeft">        <span class="bceTitle"><?=$from_str?> - <?=$to_str?></span><br><?=genel::get_transfer_vehicle($transfer->vehicle_type)?>    </div>    <div class="bcePrice"><?=$converted_price["amount"]?> <i class="fa fa-<?=strtolower($currency)?>"></i></div></div></div>

<?php }?>


                    <div class="promCode">
                        <div class="promLabel">
                            Promosyon<br />
                            Kodunuz
                        </div>
                        <input type="text" class="promInput" id="PromotionTxt" placeholder="Kodunuz" />
                        <button onclick="PromotionCodeSearch();" class="promButton">Kodu Kullan</button>
                    </div>

                    <!-- Bc Prices -->
                    <div class="bcPrices">
                        <div class="bcPrice">
                            <div class="label">Toplam Tutar</div>
                            <div id="body_TotalPrice" class="price"><?=number_format($total_amount,2,",","")?> <i class="fa fa-<?=strtolower($currency)?>"></i></div>
                        </div>
<div class="bcCardTrigger taksitler" price="<?=$total_amount?>" hotel-id="<?=$hotel_detail->hotel_id?>" data-type="1">Tüm Kartlar için Taksit Tablosu</div>
                    </div>
                    <!-- Bc Prices -->


                    <!-- Bc Button -->
                    <div class="bcbHolder">

<?php if(isset($page_name)){?>
<?php if($page_name=="extra_services"){?>                        
<a href="/reservation/hotels/guest-info/<?=$token?>" data-name="prodSaveBtn" class="bcButton">Kişi Bilgileri İçin İlerle <i class="fa fa-arrow-circle-right"></i></a>
<?php }?>

<a href="javascript:Booking.InfoSave();" class="bcButton hideDiv hidden" data-name="requestBtn">Talep Oluştur <i class="fa fa-arrow-circle-right"></i></a>
<?php if($page_name=="guest_info"){?>     
<button class="bcButton update-passenger-button" >Ödeme Yapmak İçin İlerle <i class="fa fa-arrow-circle-right"></i></button>
<?php }?>
<?php }?>
                    </div>
                    <!-- Bc Button -->


                </div>
                <!-- nBooking Cart -->

            </div>