TLT
Thắng Lợi Trần

Hotel Room Details - Copy this Html, Bootstrap Component to your project

<div class="container py 5"> <h1>Chi tiết Phòng Khách sạn</h1> <section id="hotelSearchResult"> <?php foreach ($hotels as $hotel): ?> <div class="col mb 4"> <div class="hotel body"> <h3 class="hotel title">Khách sạn: <?= $hotel['name'] ?></h3> <div class="hotel rating mb 2"> <span>Đánh giá: </span> <?php for ($i = 0; $i < 5; $i++): ?> <i class="fa text warning fa star<?= $i < $hotel['rating'] ? '' : ' o' ?>"></i> <?php endfor; ?> </div> <div class="hotel min price"> <span class="text danger fw bold">Giá chỉ từ: $<?= $hotel['minPrice'] ?? 0 ?></span> </div> <div class=""> <?php foreach ($hotel['roomDetails'] as $index => $roomDetails): ?> <div class=""> <h2 class="" id=""> <button class=""> Loại Phòng: <?php echo $roomDetails['name']; ?> (Gói ăn: <?php echo $roomDetails['mealPlanName']; ?> <?php if (!empty($roomDetails['promoName'])) echo ", Khuyến mãi: " . $roomDetails['promoName'] ?>) </button> </h2> <div id="" class=""> <div class=""> <! Thông tin chung của phòng > <div class="room info mb 3"> <div><strong>Giá Net:</strong> <span class="text danger fw bold">$<?php echo $roomDetails['netPrice']; ?></div> </span> <div><strong>Giá Tổng:</strong> <span class="text danger fw bold">$<?php echo $roomDetails['grossPrice']; ?></div> </span> <div><strong>Khuyến mãi:</strong> <?php echo empty($roomDetails['promoName']) ? 'Không có' : $roomDetails['promoName']; ?> </div> <div> <strong>Tình trạng:</strong> <?php $roomAvailable = $roomDetails['availFlag'] ? 'Còn phòng' : 'Hết phòng'; ?> <span class="fw bold text <?= $roomAvailable === 'Còn phòng' ? 'success' : 'secondary' ?>"><?= $roomAvailable ?></span> </div> </div> <! Chi tiết các phòng thuộc loại này > <div class="room prices d none"> <h5>Chi tiết phòng</h5> <table class="table table bordered"> <thead> <tr> <th>Số Phòng</th> <th>Số Người Lớn</th> <th>Số Trẻ Em</th> <th>Giá Phòng (Net)</th> <th>Chính sách hủy</th> </tr> </thead> <tbody> <?php foreach ($roomDetails['rooms']['room'] as $room): ?> <tr> <td><?php echo $room['roomNo']; ?></td> <td><?php echo $room['noOfAdults']; ?></td> <td><?php echo $room['noOfChild'] ?? 0; ?></td> <td>$<?php echo $room['netPrice']; ?></td> <td> <?php $cancellationPolicy = $roomDetails['cancellationPolicies']['policy'][0]; echo "Miễn phí hủy trước " . $cancellationPolicy['fromDate'] . ", 100% phí sau"; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <! Giá từng đêm cho phòng đầu tiên > <div class="d none"> <?php if (!empty($roomDetails['rooms']['room'])): ?> <?php foreach ($roomDetails['rooms']['room'] as $room): ?> <div class="nightly rates"> <h5>Giá từng đêm cho Phòng <?php echo $room['roomNo']; ?></h5> <table class="table table bordered"> <thead> <tr> <th>Đêm</th> <th>Giá Net</th> <th>Giá Tổng</th> </tr> </thead> <tbody> <?php if (!empty($room['rateDetails']['nightlyRates']['nightlyRate'])): ?> <?php foreach ($room['rateDetails']['nightlyRates']['nightlyRate'] as $rate): ?> <tr> <td><?php echo $rate['srNo']; ?></td> <td>$<?php echo $rate['netPrice']; ?></td> <td>$<?php echo $rate['grossPrice']; ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="3">Không có dữ liệu giá từng đêm</td> </tr> <?php endif; ?> </tbody> </table> </div> <?php endforeach; ?> <div class="d flex justify content end"> <form action="" method="POST"> <input type="hidden" name="hotelCode" value="<?= $hotel['code'] ?>"> <input type="hidden" name="roomDetailsCode" value="<?= $roomDetails['code'] ?>"> <input type="hidden" name="roomDetailsName" value="<?= $roomDetails['name'] ?>"> <input type="hidden" name="roomDetailsMealPlan" value="<?= $roomDetails['mealPlan'] ?>"> <input type="hidden" name="roomDetailsCancellationPolicyType" value="<?= $roomDetails['cancellationPolicyType'] ?>"> <input type="hidden" name="roomDetailsPackageRate" value="<?= $roomDetails['packageRate'] ?>"> <input type="hidden" name=""> <button type="submit" class="btn btn primary">Chọn phòng này</button> </form> </div> <?php endif; ?> </div> </div> </div> </div> <?php endforeach; ?> </div> </div> </div> <?php endforeach; ?> </section> </div>

Prompt
Component Preview

About

Hotel Room Details - Explore room types, pricing, availability, and cancellation policies in detail, professionally built with HTML and Bootstrap. Get instant access!

Share

Last updated 1 month ago