<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
use yii\widgets\ActiveForm;
use common\components\Encryption;
//echo Urloption::Urlencryption();
/* @var $this yii\web\View */
/* @var $searchModel app\models\ListOfHotelsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'List Of Hotels';
//$this->params['breadcrumbs'][] = $this->title;
?>

<div class="list-of-hotels-index">

    <h1><?php //= Html::encode($this->title) ?></h1>

    <p>
        <?php //= Html::a('Create List Of Hotels', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= $this->render('_search', ['model' => $searchModel]); ?>

    <!-- ====== Apartments Area ====== --> 
    <div class="apartments-area bg-gray-color">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="heading-content-one border">
                        <h2 class="title">Rooms &amp; Apartments</h2>
                        <h5 class="sub-title">Find Your Rooms, for your abaility</h5>
                    </div><!-- /.Apartments-heading-content -->
                </div><!-- /.col-md-12 -->
            </div><!-- /.row -->
            <div class="row">
                <?php Pjax::begin(); ?>  
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    //'filterModel' => $searchModel,
                    'columns' => [
                    //['class' => 'yii\grid\SerialColumn'],
                    [
                        //"label" => "Quotation Details",
                        "format" => "raw",
                        //"attribute" => "id",
                        //"filter" => Product::DList(),
                        "value" => function($model) {
                            //echo '<pre>';
                            //print_r($model);
                            $list = [];
                            $path = Yii::$app->request->baseUrl . '/frontend/web/staticImg/';
                            if($model->hotel_image != ''){
                                $model->hotel_image = $model->hotel_image;
                            }else{
                                $model->hotel_image = "defaultImage.png";
                            }
                           $list[]="<div class='col-md-4 col-sm-6 col-xs-6'>";
                                $list[]="<div class='apartments-content'>";
                                    $list[]="<div class='image-content'>";
                                       $list[]="<a href='site/index'><img src='".$path.$model->hotel_image."' alt='apartment' /></a>";
                                    $list[]="</div>";
                               
                                    $list[]= "<div class='text-content'>";
                                        $list[]="<div class='top-content'>";
                                           $list[]="<h3>";
                                            $list[]= html::a($model->hotel_name,['view','hlpgksource'=>Encryption::Encrypt($model->id)]);
                                           $list[]="</h3>";
                                           $list[]="<span><i class='fa fa-map-marker'></i>".$model->hotel_address."</span>";
                                        $list[]="</div>";
                                        $list[]="<div class='bottom-content clearfix'>";
                                            $list[]="<div class='meta-bed-room'>
                                               <i class='fa fa-bed'></i> 3 Bedrooms
                                            </div>";
                                            $list[] = "<div class='meta-bath-room'>                                
                                               <i class='fa fa-bath'></i>2 Bathroom
                                            </div>
                                            <span class='clearfix'></span>
                                            <div class='rent-price pull-left'>
                                                <i class='fa fa-inr'></i>".$model->per_day_price."
                                            </div>";
                                            $list[]="<div class='share-meta dropup pull-right'>";
                                                $list[] = "<ul>
                                                    <li class='dropup'>
                                                        <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'><i class='fa fa-share-alt'></i></a>
                                                        <ul class='dropdown-menu'>
                                                            <li>
                                                                <a href='#'><i class='fa fa-facebook'></i></a>
                                                            </li>
                                                            <li>
                                                                <a href=''><i class='fa fa-twitter'></i></a>
                                                            </li>
                                                            <li>
                                                                <a href='#'><i class='fa fa-instagram'></i></a>
                                                            </li>
                                                            <li>
                                                                <a href='#'><i class='fa fa-google-plus'></i></a>
                                                            </li>
                                                        </ul>
                                                    </li>
                                                    <li>
                                                       <a href='#'><i class='fa fa-star-o'></i></a>
                                                    </li>
                                                </ul>";
                                            $list[]="</div>";
                                        $list[]="</div>";
                                    $list[]="</div>";
                                $list[]="</div>";
                            $list[]="</div>";
                            return implode("", $list);
                        }
                    ],
                ],  
                ]); ?>
                <?php Pjax::end(); ?>
            </div><!-- /.row -->
            <a href="#" class="button nevy-button">All Apartments</a>
        </div><!-- /.container -->
    </div><!-- /.Apartments-area-->
</div>