Esempio n. 1
0
 public function all_hotels_options()
 {
     $hotels = array();
     $loop = new WP_Query(array('post_type' => 'hotel', 'posts_per_page' => '-1'));
     if ($loop->have_posts()) {
         while ($loop->have_posts()) {
             $loop->the_post();
             $hotels[$loop->post->ID] = $loop->post->post_title;
         }
     }
     return Form_Helper::options_for_select($hotels, '', 'Select a Hotel');
 }
<?php

$html = '';
if (is_array($data) && !empty($data)) {
    $sort = array('ASC' => 'Ascending', 'DESC' => 'Descending');
    $html .= '<form data-ajax-form data-action="filter_hotel_list" data-target="filter_hotels">';
    $html .= '<ul class="inline">';
    $html .= '<li><select name="hotel_sort" data-fireable-input>' . Form_Helper::options_for_select($sort, null, null) . '</select></li>';
    $html .= '<li><select name="hotel_type" data-fireable-input>' . Form_Helper::options_for_select($data['hotel_types'], null, 'Hotel Type') . '</select></li>';
    $html .= '</ul>';
    $html .= '</form>';
}
echo $html;
      <div class="panel-header"><legend>Basic Hotel Details</legend></div>
      <div class="panel-content">
        <ul>
          <li class="half">
            <label>Hotel Name:</label>
            <input type="text" name="hotel[hotel_name]" value="<?php 
echo $hotel->hotel_name;
?>
" placeholder="Hotel Name" />
          </li>

          <li class="half right">
            <label>Hotel Type:</label>
            <select name="hotel[hotel_type]">
              <?php 
echo Form_Helper::options_for_select($types, $hotel->hotel_type);
?>
            </select>
          </li>

          <li class="full">
            <label>Hotel Email:</label>
            <input type="text" name="hotel[hotel_email_address]" value="<?php 
echo $hotel->hotel_email_address;
?>
" placeholder="Hotel Email" />
          </li>

          <li class="third">
            <label>Hotel Phone Number:</label>
            <input type="text" name="hotel[hotel_phone_number]" value="<?php