<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
	<!DOCTYPE html>
	<html lang="pt">
	<head>
<?php $this->load->view('includes/header',isset($data) ? $data : NULL);?>		
<link href="/assets/jqueryui/jquery-ui.css" rel="stylesheet" />
<style>
.ui-datepicker{font-size:13px !important;}
</style>
	</head>
	<body>
<?php $this->load->view('includes/top',isset($data) ? $data : NULL);?>	

<div class="xs-spacer30 sm-spacer30">
</div>





<div class="about">
<div class="page-title" style="background-image: url(/assets/hotels/<?=$otel_detay->vitrin_resmi?>);">
<div class="container">
<div class="xs-spacer120 sm-spacer150">
</div>

<div class="row">
<div class="col-md-12 xs-tacenter sm-tacenter">
<h1 style="background-color: #e31d1a;display: inline-block;padding: 15px 60px;color: #fff;font-weight: bold;">
<?=$otel_detay->hotel_name?>
</h1>
<div class="xs-spacer120 sm-spacer150">
</div>
</div>
</div>


</div>
</div>

<div class="container">
<div class="xs-spacer30 sm-spacer30">
</div>
<div class="panel panel-success">
<div class="panel-heading" style="background-color: #e31d1a;color: #fff;font-weight: bold;">
<?=Genel::dil_ceviri("booking_page_reservation")?>
</div>
<div class="panel-body">

<form id="oteldetayfiyathesapla" method="GET" action="/reservation/search">	
	<input type="hidden" name="hotel_code" value="<?=$otel_detay->Id?>">
<div class="row">
<div class="col-md-10">
<div class="row">
<div class="col-md-5">
<div class="row">
<div class="col-md-6"><div class="form-group"><input value="30-08-2018" class="form-control" id="from" placeholder="<?=Genel::dil_ceviri("booking_page_checkin_date")?>" name="checkin" type="text"></div></div>
<div class="col-md-6"><div class="form-group"><input value="03-09-2018" class="form-control" id="to" placeholder="<?=Genel::dil_ceviri("booking_page_checkout_date")?>" name="checkout" type="text"></div></div>
</div>
</div>

<div class="col-md-7">


<div class="row">
<div class="col-md-4"><div class="form-group">
<select class="form-control" name="adult">
<option value="1">1 <?=Genel::dil_ceviri("booking_page_adult")?></option>
<option value="2" selected="">2 <?=Genel::dil_ceviri("booking_page_adult")?></option>
<option value="3">3 <?=Genel::dil_ceviri("booking_page_adult")?></option>
<option value="4">4 <?=Genel::dil_ceviri("booking_page_adult")?></option>
<option value="5">5 <?=Genel::dil_ceviri("booking_page_adult")?></option>
</select></div></div>

<div class="col-md-4"><div class="form-group"><select class="form-control" name="child1age">
<option value="0"><?=Genel::dil_ceviri("booking_page_no_child")?></option>
<?php for ($i=1; $i <13 ; $i++) { ?>
<option value="<?=$i?>"><?=$i?> <?=Genel::dil_ceviri("booking_page_years_old")?></option>
<?php }?>

</select></div></div>

<div class="col-md-4"><div class="form-group"><select class="form-control" name="child2age">
<option value="0"><?=Genel::dil_ceviri("booking_page_no_child")?></option>
<?php for ($i=1; $i <13 ; $i++) { ?>
<option value="<?=$i?>"><?=$i?> <?=Genel::dil_ceviri("booking_page_years_old")?></option>
<?php }?>

</select></div></div>


</div>


</div>
</div>	
</div>

<div class="col-md-2">
	
<button type="submit" class="btn btn-primary"><?=Genel::dil_ceviri("booking_page_search_book")?></button>	
</div>

</div>	

</form>

<div id="search-result"></div>



</div>

</div>




<?php foreach ($otel_bilgi as $otel_bilgi) {?>
<div class="row">
<div class="col-md-12 sm-tacenter">
<h1 class="slice">
<span  style="background-color: #e31d1a;display: inline-block;padding: 15px 60px;color: #fff;font-weight: bold;">
<?=$otel_bilgi->baslik?>
</span>
</h1>
</div>
</div>
<div class="sm-spacer30">
</div>
<div class="row">
<div class="col-md-12">
<div>
<p style="text-align:justify; margin:10px 0; padding:0">
<span style="font-size:16px">
<span style="color:#202020">
<span style="font-family:Helvetica">
<span style="line-height:150%">
<font size="4">
<font face="trebuchet ms, lucida grande, lucida sans unicode, lucida sans, tahoma, sans-serif">
<?=$otel_bilgi->icerik?>
</font>
</font>
</span>
</span>
</span>
</span>
</p>
<div>&nbsp;</div>
</div>
</div>
</div>
<div class="sm-spacer30">
</div>

<?php }?>


















<hr>

<div class="row">

<div class="col-md-12 sm-tacenter">
<h1 class="slice">
<span  style="background-color: #e31d1a;display: inline-block;padding: 15px 60px;color: #fff;font-weight: bold;"><?=Genel::dil_ceviri("hoel_detail_page_photo_gallery")?></span>
</h1>
</div>

<?php foreach ($otel_galeri as $otel_galeri) { ?>
	<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">

		<div class="backImg" style="background-image: url(/assets/hotels/<?=$otel_galeri->foto?>);
background-size: cover;
background-repeat: no-repeat;
background-position: 50%;
position: relative;"><div class="xs-spacer150 sm-spacer150 md-spacer150 lg-spacer150">&nbsp;</div>

<div class="xs-spacer150 sm-spacer150 md-spacer150 lg-spacer150">&nbsp;</div>
</div>




<div class="xs-spacer30 sm-spacer30">&nbsp;</div>

</div>



<?php }?>





</div>

















</div>



</div>
	<?php $this->load->view('includes/footer',isset($data) ? $data : NULL);?>	

 <script src="/assets/jqueryui/jquery-ui.js"></script>

<script type="text/javascript">
        function pad(str, max) {
    str = str.toString();
    return str.length < max ? pad("0" + str, max) : str;
}

	
  // Tarih seÃ§ici ayarlarÄ±
    if (typeof $.datepicker === 'object') {
        $.datepicker.regional['tr'] = {
            closeText: 'kapat',
            prevText: '&#x3c;geri',
            nextText: 'ileri&#x3e;',
            currentText: 'bugün',
            monthNames: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran','Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
            monthNamesShort: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz','Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
            dayNames: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
            dayNamesShort: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
            dayNamesMin: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
            dateFormat: 'dd.mm.yy', firstDay: 1,
            isRTL: false
        };
        $.datepicker.setDefaults($.datepicker.regional['tr']);
        if ($(window).width() > 768) {
            $("#from").datepicker({
                defaultDate: "+1d",
                minDate: "+0d",
                numberOfMonths: 2,

                dateFormat: 'dd-mm-yy',
                onClose: function (selectedDate) {
                    if (selectedDate.length > 0) {
                        var dayafter = selectedDate.split("-");
                        dayafter[0] = parseInt(dayafter[0]) + 1;
                        if ($('#to').val().length < 1) {
                            $('#to').val(pad(dayafter[0], 2) + "-" + dayafter[1] + "-" + dayafter[2]);
                        }
                        $("#to").datepicker("option", "minDate", pad(dayafter[0], 2) + "-" + dayafter[1] + "-" + dayafter[2]);
                        $('#to').datepicker("show");
                    }
                }
            });
            $("#to").datepicker({
                defaultDate: "+1w",
                minDate: "+1d",
                numberOfMonths: 2,
                dateFormat: 'dd-mm-yy',
                onClose: function (selectedDate) {
                    if (selectedDate.length > 0) {
                     //   $("#from").datepicker("option", "maxDate", selectedDate);
                    }
                }
            });
        } else {
            $("#from").datepicker({
                defaultDate: "+1d",
                minDate: "+0d",
                numberOfMonths: 1,
                dateFormat: 'dd-mm-yy',
                onClose: function (selectedDate) {
                    if (selectedDate.length > 0) {
                        var dayafter = selectedDate.split("-");
                        dayafter[0] = parseInt(dayafter[0]) + 1;
                        if ($('#to').val().length < 1) {
                            $('#to').val(pad(dayafter[0], 2) + "-" + dayafter[1] + "-" + dayafter[2]);
                        }
                        $("#to").datepicker("option", "minDate", pad(dayafter[0], 2) + "-" + dayafter[1] + "-" + dayafter[2]);
                        $('#to').datepicker("show");
                    }
                }
            });
            $("#to").datepicker({
                defaultDate: "+1w",
                minDate: "+1d",
                numberOfMonths: 1,
                dateFormat: 'dd-mm-yy',
                onClose: function (selectedDate) {
                    if (selectedDate.length > 0) {
                 //       $("#from").datepicker("option", "maxDate", selectedDate);
                    }
                }
            });
        }
    }
    $('.dpicker').click(function () {
        $(this).parent().children('input[type=text]').datepicker("show");
    })


  var loading_text="<div style='text-align:center; background-color: rgb(0, 0, 0); opacity: 0.6; cursor: wait;color: rgb(255, 255, 255);font-size: 12px; min-height:200px'><div style='padding-top:50px;font-size:25px'><i style='font-size:40px' class='fa fa-spin fa-spinner'></i><br><?=Genel::dil_ceviri("booking_page_please_wait")?></div></div>";

  $(document).ready(function(){


$('#oteldetayfiyathesapla').on('submit',(function() {
  //  alert("sdf");
    var formUrl = $('#oteldetayfiyathesapla').attr("action");
    var formData = $('#oteldetayfiyathesapla').serialize();
    if(!$('#oteldetayfiyathesapla #from').val()) {
        alert("GiriÅŸ Tarihini SeÃ§in");
        return false;
    }
    
    if(!$('#oteldetayfiyathesapla #to').val()) {
        alert("Ã‡Ä±kÄ±ÅŸ Tarihini SeÃ§in");
        return false;
    }    
    

$("#search-result").html(loading_text)
    $.ajax({
        type:'GET',
        url: formUrl,
        data:formData,
        success: function(data) 
        {
          //  alert(data);
$("#search-result").html(data);
          /*var data = $.parseJSON(data);
                alert(data.message);
            var result = "";
         */

           

        },
        error: function (data) {
            alert("Bir hata oluÃ…Å¸tu,\n LÃƒÂ¼tfen diÃ„Å¸er iletiÃ…Å¸im kanallarÃ„Â±nÃ„Â± deneyiniz");
            $('#submit_call').val("GÃƒâ€“NDER");
        }
    });
    return false;
}));

})
</script>

	</body>
	</html>