<!-- <div class="row">
   <div class="col-sm-12">
      <h4 class="mt10">Keywords</h4>
      <?php
         $count=1;
         foreach ($keywords as $key => $keyword) {
            if($count<=5){
            echo '<div class="checkbox che_mian">
                      <label>
                          <input name="keywords[]" value="'.$key.'" type="checkbox">'.$keyword.'</span>
                      </label>
                  </div>';
            }
            $count++;
         }
         ?>
      <p><a href="javascript:void(0)" role="button" data-toggle="modal" data-target="#keywordsModal">More</a> </p>
   </div>
</div> -->
<div class="row">
   <div class="col-sm-12">
      <?php
         if(!empty($_GET['search_keyword'])){
            echo '<h4 class="mt0">Category</h4>';
            $category = array();
            foreach($hotels as $hotel){
               if(!in_array($hotel->categoryCode, $category)){
                   echo '<div class="checkbox che_mian">
                              <label>
                                  <input value="'.$hotel->categoryCode.'" type="checkbox" filter-type="category" class="filter_chkbox">'.$hotel->category_description.'</span>
                              </label>
                          </div>';
                }
                $category[] = $hotel->categoryCode;
             }
         }
         ?>
      <!-- <p><a href="javascript:void(0)" role="button" data-toggle="modal" data-target="#accomodationModal">More</a> </p> -->
   </div>
</div>
<div class="row">
   <div class="col-sm-12">
      <?php
         if(!empty($_GET['search_keyword'])){
            echo '<h4 class="mt10">Accomodations</h4>';
            $accomodation_type = array();
            foreach($hotels as $hotel){
               if(!in_array($hotel->accommodationTypeCode, $accomodation_type)){
                   echo '<div class="checkbox che_mian">
                              <label>
                                  <input value="'.$hotel->accommodationTypeCode.'" type="checkbox" filter-type="accomodation" class="filter_chkbox">'.$hotel->accommodation_type.'</span>
                              </label>
                          </div>';
                }
                $accomodation_type[] = $hotel->accommodationTypeCode;
             }
         }
         ?>
      <!-- <p><a href="javascript:void(0)" role="button" data-toggle="modal" data-target="#accomodationModal">More</a> </p> -->
   </div>
</div>
<div class="row">
   <div class="col-sm-12">
      <?php
         if(!empty($_GET['search_keyword'])){
            echo '<h4 class="mt10">Hotel Features</h4>';
            $available_facility = array();
            $hotel_ids = '';
            foreach($hotels as $hotel){
                $hotel_ids .= $hotel->hotel_id.',';
            }

             $facilities =$wpdb->get_results("
                 SELECT 
                    `$facilities_tbl`.`code`,
                    `$facilities_tbl`.`name` 
                  FROM 
                  `$facilities_tbl`,`$hotels_facilities_tbl` 
                  WHERE 
                  `$hotels_facilities_tbl`.`facilityCode` = `$facilities_tbl`.`code` AND
                  `$hotels_facilities_tbl`.`facilityGroupCode` = `$facilities_tbl`.`facilityGroupCode` AND 
                  `$facilities_tbl`.`facilityGroupCode` = 70 AND
                  `$hotels_facilities_tbl`.`hotel_id` IN (".rtrim($hotel_ids,',').")"
             );
             foreach($facilities as $facility){
                if(!in_array($facility->code, $available_facility)){
                   echo '<div class="checkbox che_mian">
                              <label>
                                  <input value="'.$facility->code.'" type="checkbox" filter-type="facility" class="filter_chkbox">'.$facility->name.'</span>
                              </label>
                          </div>';
                }
                $available_facility[] = $facility->code;
             }
         }
         ?>
      <!-- <p><a href="javascript:void(0)" role="button" data-toggle="modal" data-target="#HotelFeaturesModal">More</a> </p> -->
   </div>
</div>
<div class="row">
   <div class="col-sm-12">
      <?php
         if(!empty($_GET['search_keyword'])){
            echo '<h4 class="mt10">City</h4>';
            $available_city = array();
            foreach($hotels as $hotel){
               if(!in_array($hotel->city, $available_city)){
                   echo '<div class="checkbox che_mian">
                              <label>
                                  <input value="'.$hotel->city.'" type="checkbox" filter-type="city" class="filter_chkbox">'.$hotel->city.'</span>
                              </label>
                          </div>';
                }
                $available_city[] = $hotel->city;
             }
         }
         ?>
      <!-- <p><a href="javascript:void(0)" role="button" data-toggle="modal" data-target="#CityModal">More</a> </p> -->
   </div>
</div>

<!-- Modals Start -->
<?php /*
<!-- Accomodation Modal -->
<div class="modal fade" id="accomodationModal">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            </button>
            <h5 class="filhead">Filters for Accomodation</h5>
            <div class="filabcd">
               <ul>
                  <?php
                     foreach (range('A', 'Z') as $alphabets) {
                       echo '<li><a href="#id'.strtolower($alphabets).'">'.$alphabets.'</a></li>';
                     }
                     ?>
               </ul>
            </div>
            <div class="filhtc" filter-type="accomodation">
               <?php
                if(!empty($_GET['search_keyword'])){
                  $accomodation_type = array();
                  $old_char ='';
                  foreach($hotels as $hotel){
                     if(!in_array($hotel->accommodationTypeCode, $accomodation_type)){
                         $new_char = substr(strtolower($hotel->accommodation_type),0,1);
                              if($old_char != $new_char){
                                echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                                    
                              }
                              echo '<div class="checkbox che_mian filchk">
                                         <label>
                                             <input value="'.$hotel->accommodationTypeCode.'" type="checkbox" class="popup_filter_chkbox">'.$hotel->accommodation_type.'</span>
                                         </label>
                                     </div>'; 
                              $old_char = $new_char;
                      }
                      $accomodation_type[] = $hotel->accommodationTypeCode;
                   }
                }
                else{
                         $accommodations = $wpdb->get_results("
          		             SELECT * FROM `$accommodation_tbl` ORDER BY `name`
          		           ");
                            $old_char ='';
          		          foreach($accommodations as $accommodation){
                              $new_char = substr(strtolower($accommodation->name),0,1);
                              if($old_char != $new_char){
                                echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                                    
                              }
                                echo '<div class="checkbox che_mian filchk">
                                           <label>
                                               <input value="'.$accommodation->code.'" type="checkbox" class="popup_filter_chkbox">'.$accommodation->name.'</span>
                                           </label>
                                       </div>'; 
                                $old_char = $new_char;
                        }
                }
                  
                  ?>
            </div>
            <div class="pull-right mt20">
               <button type = "button" class = "btn btn-info" data-dismiss="modal">Cancel</button>
               <button type = "button" class = "btn btn-info apply_btn">Apply</button>
            </div>
         </div>
      </div>
   </div>
</div>

<!-- Hotel Features Modal -->
<div class="modal fade" id="HotelFeaturesModal">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            </button>
            <h5 class="filhead">Filters for Hotel Features</h5>
            <div class="filabcd">
               <ul>
                  <?php
                     foreach (range('A', 'Z') as $alphabets) {
                       echo '<li><a href="#id'.strtolower($alphabets).'">'.$alphabets.'</a></li>';
                     }
                     ?>
               </ul>
            </div>
            <div class="filhtc" filter-type="facility">
               <?php
                if(!empty($_GET['search_keyword'])){
                  $available_facility = array();
                  $hotel_ids = '';
                  foreach($hotels as $hotel){
                      $hotel_ids .= $hotel->hotel_id.',';
                  }

                   $facilities =$wpdb->get_results("
                       SELECT 
                          `$facilities_tbl`.`code`,
                          `$facilities_tbl`.`name` 
                        FROM 
                        `$facilities_tbl`,`$hotels_facilities_tbl` 
                        WHERE 
                        `$hotels_facilities_tbl`.`facilityCode` = `$facilities_tbl`.`code` AND
                        `$hotels_facilities_tbl`.`facilityGroupCode` = `$facilities_tbl`.`facilityGroupCode` AND 
                        `$facilities_tbl`.`facilityGroupCode` = 70 AND
                        `$hotels_facilities_tbl`.`hotel_id` IN (".rtrim($hotel_ids,',').")"
                   );
                   $old_char ='';
                   foreach($facilities as $facility){
                      if(!in_array($facility->code, $available_facility)){
                        $new_char = substr(strtolower($facility->name),0,1);
                        if($old_char != $new_char){
                          echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                              
                        }
                         echo '<div class="checkbox che_mian">
                                    <label>
                                        <input value="'.$facility->code.'" type="checkbox" class="popup_filter_chkbox">'.$facility->name.'</span>
                                    </label>
                                </div>';
                        $old_char = $new_char;
                      }
                      $available_facility[] = $facility->code;
                   }
               }
               else{

                  $facilities =$wpdb->get_results("
    		             SELECT `code`,`name` FROM `$facilities_tbl` WHERE `facilitygroupcode`=70 ORDER BY `name`
    		          ");
    		          $old_char ='';
    		          foreach($facilities as $facility){             
                        $new_char = substr(strtolower($facility->name),0,1);
                        if($old_char != $new_char){
                          echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                              
                        }
                          echo '<div class="checkbox che_mian filchk">
                                     <label>
                                         <input name="facilities[]" value="'.$facility->code.'" type="checkbox" class="popup_filter_chkbox">'.$facility->name.'</span>
                                     </label>
                                 </div>'; 
                          $old_char = $new_char;
                      }
              }
                  ?>
            </div>
            <div class="pull-right mt20">
               <button type = "button" class = "btn btn-info" data-dismiss="modal">Cancel</button>
               <button type = "button" class = "btn btn-info apply_btn">Apply</button>
            </div>
         </div>
      </div>
   </div>
</div>

<!-- Destinations Modal -->
<div class="modal fade" id="DestinationsModal">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            </button>
            <h5 class="filhead">Filters for Destinations</h5>
            <div class="filabcd">
               <ul>
                  <?php
                     foreach (range('A', 'Z') as $alphabets) {
                       echo '<li><a href="#id'.strtolower($alphabets).'">'.$alphabets.'</a></li>';
                     }
                     ?>
               </ul>
            </div>
            <div class="filhtc" filter-type="destination">
               <?php
                  if(!empty($_GET['search_keyword'])){
                      $available_destinations = array();
                      $old_char ='';
                      foreach($hotels as $hotel){
                         if(!in_array($hotel->destinationCode, $available_destinations)){
                            $new_char = substr(strtolower($hotel->destination_name),0,1);
                            if($old_char != $new_char){
                              echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                                  
                            }
                             echo '<div class="checkbox che_mian">
                                        <label>
                                            <input value="'.$hotel->destinationCode.'" type="checkbox" class="popup_filter_chkbox">'.$hotel->destination_name.'</span>
                                        </label>
                                    </div>';
                             $old_char = $new_char;
                          }
                          $available_destinations[] = $hotel->destinationCode;
                       }
                   }
                   else{
                      $destinations =$wpdb->get_results("
        		             SELECT `code`,`name` FROM `$destinations_tbl` ORDER BY `name`
        		          ");
        		          $old_char ='';
        		          foreach($destinations as $destination){             
                            $new_char = substr(strtolower($destination->name),0,1);
                            if($old_char != $new_char){
                              echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                                  
                            }
                              echo '<div class="checkbox che_mian filchk">
                                         <label>
                                             <input value="'.$destination->code.'" type="checkbox" class="popup_filter_chkbox">'.$destination->name.'</span>
                                         </label>
                                     </div>'; 
                              $old_char = $new_char;
                          }
                   }
                  
                  ?>
            </div>
            <div class="pull-right mt20">
               <button type = "button" class = "btn btn-info" data-dismiss="modal">Cancel</button>
               <button type = "button" class = "btn btn-info apply_btn">Apply</button>
            </div>
         </div>
      </div>
   </div>
</div>

<!-- Cities Modal -->
<div class="modal fade" id="CityModal">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            </button>
            <h5 class="filhead">Filters for City</h5>
            <div class="filabcd">
               <ul>
                  <?php
                     foreach (range('A', 'Z') as $alphabets) {
                       echo '<li><a href="#id'.strtolower($alphabets).'">'.$alphabets.'</a></li>';
                     }
                     ?>
               </ul>
            </div>
            <div class="filhtc" filter-type="city">
               <?php
                  if(!empty($_GET['search_keyword'])){
                      $available_city = array();
                      $old_char ='';
                      foreach($hotels as $hotel){
                         if(!in_array($hotel->city, $available_city)){
                            $new_char = substr(strtolower($hotel->city),0,1);
                            if($old_char != $new_char){
                              echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                                  
                            }
                             echo '<div class="checkbox che_mian">
                                        <label>
                                            <input value="'.$hotel->city.'" type="checkbox" class="popup_filter_chkbox">'.$hotel->city.'</span>
                                        </label>
                                    </div>';
                             $old_char = $new_char;
                          }
                          $available_city[] = $hotel->city;
                       }
                   }
                   else{
                      $cities =$wpdb->get_results("
                         SELECT DISTINCT `city` FROM `$hotels_tbl` ORDER BY `city`"
                      );
                      $old_char ='';
                      foreach($cities as $city){
                        $new_char = substr(strtolower($city->city),0,1);
                        if($old_char != $new_char){
                          echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                              
                        }
                          echo '<div class="checkbox che_mian filchk">
                                     <label>
                                         <input value="'.$city->city.'" type="checkbox" class="popup_filter_chkbox">'.$city->city.'</span>
                                     </label>
                                 </div>'; 
                          $old_char = $new_char;
                      }
                  }
                  ?>
            </div>
            <div class="pull-right mt20">
               <button type = "button" class = "btn btn-info" data-dismiss="modal">Cancel</button>
               <button type = "button" class = "btn btn-info apply_btn">Apply</button>
            </div>
         </div>
      </div>
   </div>
</div>

<!-- Country Modal -->
<div class="modal fade" id="CountryModal">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            </button>
            <h5 class="filhead">Filters for Country</h5>
            <div class="filabcd">
               <ul>
                  <?php
                     foreach (range('A', 'Z') as $alphabets) {
                       echo '<li><a href="#id'.strtolower($alphabets).'">'.$alphabets.'</a></li>';
                     }
                     ?>
               </ul>
            </div>
            <div class="filhtc" filter-type="country">
               <?php
                  if(!empty($_GET['search_keyword'])){
                      $available_country = array();
                      $old_char ='';
                      foreach($hotels as $hotel){
                         if(!in_array($hotel->countryCode, $available_country)){
                            $new_char = substr(strtolower($hotel->name),0,1);
                            if($old_char != $new_char){
                              echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                                  
                            }
                             echo '<div class="checkbox che_mian">
                                        <label>
                                            <input value="'.$hotel->countryCode.'" type="checkbox" filter-type="country" class="filter_chkbox">'.$hotel->country_name.'</span>
                                        </label>
                                    </div>';
                            $old_char = $new_char;
                          }
                          $available_country[] = $hotel->countryCode;
                       }
                   }
                   else{
                      $countries =$wpdb->get_results("
                         SELECT `code`,`name` FROM `$countries_tbl` ORDER BY `name`"
                      );
                      $old_char ='';
                      foreach($countries as $country){
                        $new_char = substr(strtolower($country->name),0,1);
                        if($old_char != $new_char){
                          echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';
                              
                        }
                          echo '<div class="checkbox che_mian filchk">
                                     <label>
                                         <input name="facilities[]" value="'.$country->code.'" type="checkbox">'.$country->name.'</span>
                                     </label>
                                 </div>'; 
                          $old_char = $new_char;
                      }
                  }
                  
                  ?>
            </div>
            <div class="pull-right mt20">
               <button type = "button" class = "btn btn-info" data-dismiss="modal">Cancel</button>
               <button type = "button" class = "btn btn-info apply_btn">Apply</button>
            </div>
         </div>
      </div>
   </div>
</div>

<!-- keywords Modal -->
<!-- <div class="modal fade" id="keywordsModal">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            </button>
            <h5 class="filhead">Filters for Keywords</h5>
            <div class="filabcd">
               <ul>
                  <?php
                     foreach (range('A', 'Z') as $alphabets) {
                       echo '<li><a href="#id'.strtolower($alphabets).'">'.$alphabets.'</a></li>';
                     }
                     ?>
               </ul>
            </div>
            <div class="filhtc">
               <?php
                  foreach ($keywords as $key => $keyword) {
                    $new_char = substr(strtolower($keyword),0,1);
                    if($old_char != $new_char){
                      echo '<div id="id'.$new_char.'" class="filheadbx">'.$new_char.'</div>';  
                    }
                      echo '<div class="checkbox che_mian filchk">
                                 <label>
                                     <input name="keywords[]" value="'.$key.'" type="checkbox">'.$keyword.'</span>
                                 </label>
                             </div>'; 
                      $old_char = $new_char;
                  }
                  
                  ?>
            </div>
            <div class="pull-right mt20">
               <button type = "button" class = "btn btn-info">Cancel</button>
               <button type = "button" class = "btn btn-info">Apply</button>
            </div>
         </div>
      </div>
   </div>
</div> -->
*/?>
<!-- Modals End -->

