function gdlr_hotel_room_info($post_option = array(), $list = array(), $wrapper = true) { global $hotel_option; if ($list != array('price') && $list != array('price-break-down') && !empty($post_option['facilities-and-services'])) { $room_info = json_decode($post_option['facilities-and-services'], true); return gdlr_hotel_room_info_new($room_info, $list, $wrapper); } if (empty($list)) { $list = array('bed', 'max-people', 'view', 'room-size', 'wifi', 'breakfast-included', 'room-service', 'airport-pickup-service'); } $ret = ''; foreach ($list as $slug) { switch ($slug) { case 'price': case 'price-break-down': if (!empty($post_option['room-base-price'])) { $ret .= '<div class="gdlr-room-price">'; if ($slug == 'price' || empty($hotel_option['booking-price-display']) || $hotel_option['booking-price-display'] == 'start-from') { $ret .= '<span class="gdlr-head">' . __('Start From', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . gdlr_hotel_money_format($post_option['room-base-price']) . ' / ' . __('Night', 'gdlr-hotel') . '</span>'; } else { $price_breakdown = get_price_breakdown_popup($post_option); $ret .= '<span class="gdlr-tail">' . gdlr_hotel_money_format($price_breakdown['total']) . '</span>'; } if ($slug == 'price-break-down') { if (empty($price_breakdown)) { $price_breakdown = get_price_breakdown_popup($post_option); } $ret .= '<div class="gdlr-price-break-down" >' . __('* view price breakdown', 'gdlr-hotel'); $ret .= $price_breakdown['price-breakdown']; $ret .= '</div>'; } $ret .= '</div>'; } break; case 'bed': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Bed', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'max-people': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Max', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . ' ' . __('People', 'gdlr-hotel') . '</span>'; $ret .= '</div>'; } break; case 'view': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('View', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'room-size': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Room Size', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'wifi': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Wifi', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'breakfast-included': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Breakfast Included', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'room-service': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Room Service', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'airport-pickup-service': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Airport Pickup Service', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; } } if ($wrapper && !empty($ret)) { $ret = '<div class="gdlr-hotel-room-info">' . $ret . '<div class="clear"></div></div>'; } return $ret; }
function gdlr_hotel_room_info($post_option = array(), $list = array(), $wrapper = true) { if (empty($list)) { $list = array('bed', 'max-people', 'view', 'room-size', 'wifi', 'breakfast-included', 'room-service', 'airport-pickup-service'); } $ret = ''; foreach ($list as $slug) { switch ($slug) { case 'price': case 'price-break-down': if (!empty($post_option['room-base-price'])) { $ret .= '<div class="gdlr-room-price">'; $ret .= '<span class="gdlr-head">' . __('Start From', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . gdlr_hotel_money_format($post_option['room-base-price']) . ' / ' . __('Night', 'gdlr-hotel') . '</span>'; if ($slug == 'price-break-down') { $ret .= '<div class="gdlr-price-break-down" >' . __('* view price breakdown', 'gdlr-hotel'); $ret .= get_price_breakdown_popup($post_option); $ret .= '</div>'; } $ret .= '</div>'; } break; case 'bed': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Bed', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'max-people': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Max', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . ' ' . __('People', 'gdlr-hotel') . '</span>'; $ret .= '</div>'; } break; case 'view': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('View', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'room-size': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Room Size', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'wifi': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Wifi', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'breakfast-included': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Breakfast Included', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'room-service': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Room Service', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; case 'airport-pickup-service': if (!empty($post_option[$slug])) { $ret .= '<div class="gdlr-room-info">'; $ret .= '<i class="fa fa-check-square-o icon-check" ></i>'; $ret .= '<span class="gdlr-head">' . __('Airport Pickup Service', 'gdlr-hotel') . '</span>'; $ret .= '<span class="gdlr-tail">' . $post_option[$slug] . '</span>'; $ret .= '</div>'; } break; } } if ($wrapper && !empty($ret)) { $ret = '<div class="gdlr-hotel-room-info">' . $ret . '<div class="clear"></div></div>'; } return $ret; }