Beispiel #1
0
                                     ?>
                                 </li>
                                 <li><?php if($offer['date_validity']=='on'){echo 'Only for';}else{echo 'For';} ?> bookings between <?php echo $offer['from_date']; ?> & <?php echo $offer['to_date']; ?></li>
                                 <li>Offer available for
                                     <ul>
                                         <li>Beds:
                                             <?php
                                                 $beds=Libs::get('bed_type');
                                                 foreach(array_filter(explode(':',$offer['bed_type'])) as $bed){
                                                     echo $beds[$bed] . "/ ";
                                                 }
                                             ?>
                                         </li>
                                         <li>Meals:
                                             <?php
                                                 $meals=Libs::get('meal_type');
                                                 foreach(array_filter(explode(':',$offer['meal_type'])) as $meal){
                                                     echo $meals[$meal] . "/ ";
                                                 }
                                             ?>
                                         </li>
                                     </ul>
                                 </li>
                             </ul>
                         </div>
                         <div class="clearfix"></div>
                     </div>
                 <?php } ?>
         </div>
     </div>
 </div><!-- booking-side-wrapper -->
Beispiel #2
0
function loadHotelsWithOffers()
{
    $from_date = date('Y-m-d');
    $hotel_id = $_REQUEST['hotel_id'];
    $offers = new Offers();
    $offerArr = $offers->loadOffersForHotel($from_date, $hotel_id);
    $offerContent = "";
    $offerAvailable = false;
    if (count($offerArr) > 0) {
        $offerAvailable = true;
        $offerContent = "\n            <div>\n                <div class='group-set' style='width: 100%;'>\n                    <div class='front-offers'>";
        foreach ($offerArr as $offer) {
            $offerContent = $offerContent . "\n                                <div class='offers'>\n                                    <h4>";
            $room = new HotelRoomType();
            $room->setRoomTypeId($offer['room_type']);
            $room->extractor($room->getHotelRoomTypeFromId());
            $offerContent = $offerContent . "Room: " . $room->roomTypeName() . " | " . $offer['title'];
            $room = null;
            $offerContent = $offerContent . "</h4>\n                                    <div  class='desc clearfix'>" . $offer['des'] . "</div>\n                                    <div class='offer-image clearfix'>";
            if ($offer['image'] != '' && file_exists(DOC_ROOT . 'uploads/special_offers/' . $offer['image'])) {
                $offerContent = $offerContent . "<img style='max-width: 100%; max-height: 100%;' src='" . HTTP_PATH . "uploads/special_offers/" . $offer['image'] . "' />";
            }
            $offerContent = $offerContent . "</div>\n                                    <div class='clearfix detail'>\n                                        <ul class='offerFe'>\n                                            <li>Offer type : ";
            if ($offer['dis_type'] == 0) {
                $offerContent = $offerContent . "Fixed Price";
            } elseif ($offer['dis_type'] == 1) {
                $offerContent = $offerContent . "Percentage Discount";
            } elseif ($offer['dis_type'] == 2) {
                $offerContent = $offerContent . "Free Nights";
            } elseif ($offer['dis_type'] == 3) {
                $offerContent = $offerContent . "Custom";
            }
            $offerContent = $offerContent . "</li>\n                                            <li>";
            if ($offer['date_validity'] == 'on') {
                $offerContent = $offerContent . "Only for ";
            } else {
                $offerContent = $offerContent . "For ";
            }
            $offerContent = $offerContent . "bookings between " . $offer['from_date'] . " & " . $offer['to_date'] . "</li>\n                                            <li>Offer available for\n                                                <ul>\n                                                    <li>Beds:";
            $beds = Libs::get('bed_type');
            foreach (array_filter(explode(':', $offer['bed_type'])) as $bed) {
                $offerContent = $offerContent . $beds[$bed] . "/ ";
                if ($offerContent != "") {
                    $offerContent = $offerContent . $beds[$bed] . "/ ";
                } else {
                    $offerContent = $offerContent . $beds[$bed];
                }
            }
            $offerContent = $offerContent . "</li>\n                                                    <li>Meals:";
            $meals = Libs::get('meal_type');
            foreach (array_filter(explode(':', $offer['meal_type'])) as $meal) {
                $offerContent = $offerContent . $meals[$meal] . "/ ";
            }
            $offerContent = $offerContent . "</li>\n                                                </ul>\n                                            </li>\n                                        </ul>\n                                    </div>\n                                    <div class='clearfix'></div>\n                                </div>";
        }
        $offerContent = $offerContent . "</div>\n                    </div>\n                </div>";
    } else {
        $offerAvailable = false;
    }
    $offerArray = array("offerAvailable" => $offerAvailable, "offerContent" => $offerContent);
    echo json_encode($offerArray);
}
Beispiel #3
0
function viewTableSearch($data, $count, $search_str)
{
    $hotel = new Hotels();
    $paginations = new Paginations();
    $paginations->setLimit(10);
    $paginations->setPage($_REQUEST['page']);
    $paginations->setJSCallback("viewSearchedHotels");
    $paginations->setTotalPages($count);
    $paginations->makePaginationSearched($search_str);
    ?>
    <div class="mws-panel-header">
        <span class="mws-i-24 i-table-1">View Hotel</span>
    </div>
<div class="mws-panel-body">
    <table cellpadding="0" cellspacing="0" border="0" class="mws-datatable-fn mws-table">
        <thead>
        <tr>
            <th>Hotel Name</th>
            <th>Hotel Hits</th>
            <th>Active Status</th>
            <th>Featured Status</th>
            <th>Action</th>
        </tr>
        </thead>
        <tbody>
        <?php 
    if (count($data) > 0) {
        ?>

            <?php 
        for ($i = 0; $i < count($data); $i++) {
            $hotel->extractor($data, $i);
            $hotel_status = Libs::get("hotel_status_normal");
            ?>
                <tr id="row_<?php 
            echo $hotel->hotelId();
            ?>
">
                    <td><?php 
            echo $hotel->hotelName();
            ?>
</td>
                    <td><?php 
            echo $hotel->hotelHits();
            ?>
</td>
                    <td>

                        <select id="hotels_status_<?php 
            echo $hotel->hotelId();
            ?>
" onchange="hotelActiveStatus(<?php 
            echo $hotel->hotelId();
            ?>
)">
                            <?php 
            foreach ($hotel_status as $key => $val) {
                ?>
                                    <option <?php 
                if ($hotel->hotelActiveStatus() == $key) {
                    echo 'selected="selected"';
                }
                ?>
 value="<?php 
                echo $key;
                ?>
"><?php 
                echo $val;
                ?>
</option>
                                <?php 
            }
            ?>
                        </select>

                    </td>
                    <td>

                        <select onchange="hotelsFeaturedStatus(<?php 
            echo $hotel->hotelId();
            ?>
,<?php 
            echo $hotel->hotelsFeaturedStatus();
            ?>
)">
                            <option <?php 
            if ($hotel->hotelsFeaturedStatus() == 1) {
                echo 'selected="selected"';
            }
            ?>
 style="color:#469400;" value="1">Featured
                            </option>
                            <option <?php 
            if ($hotel->hotelsFeaturedStatus() == 0) {
                echo 'selected="selected"';
            }
            ?>
 style="color:#900;" value="0">Not Featured
                            </option>
                        </select>

                    </td>
                    <td>
                        <a onclick="login_as_hotels('<?php 
            echo $hotel->hotelId();
            ?>
');" style="cursor:pointer;">login as hotels</a> &nbsp; | &nbsp;
                        <?php 
            if ($hotel->hotelActiveStatus() == Libs::getKey("hotel_status_normal", "Deactivation Pending")) {
                ?>
                            <a onclick="deleteHotel('<?php 
                echo $hotel->hotelId();
                ?>
');" style="cursor:pointer; color: red;">Deactivate</a>
                        <?php 
            } else {
                ?>
                            <a onclick="deleteHotel('<?php 
                echo $hotel->hotelId();
                ?>
');" style="cursor:pointer;">Deactivate</a>
                        <?php 
            }
            ?>
                    </td>
                </tr>
            <?php 
        }
        ?>

        <?php 
    }
    ?>
        </tbody>
    </table>

    <?php 
    $paginations->drawPagination();
}
function getAvailableMeals()
{
    $bed_type = $_REQUEST['bed_type'];
    $meal_array = Libs::get("meal_type");
    $meals = array();
    $zeroRateDetected = false;
    $rate = 0;
    $room_rate = 0;
    $roomTypeId = $_REQUEST['roomTypeId'];
    $from_date = $_REQUEST['from_date'];
    $to_date = $_REQUEST['to_date'];
    foreach ($meal_array as $keyMeal => $meal) {
        $hotelRoomRates = new HotelRoomRates();
        $hotelRoomRates->setHotelRoomTypeId($roomTypeId);
        //$hotelRoomRates->setDateIn($from_date);
        //$hotelRoomRates->setDateOut($to_date);
        //$room_rate = $hotelRoomRates->getRateInRoomTypeForDates($bed_type, $keyMeal);
        foreach (Common::createDateRangeArray($from_date, date("Y-m-d", strtotime("-1 days", strtotime($to_date)))) as $key => $value) {
            $rate = $hotelRoomRates->getRateInRoomTypeForDate($bed_type, $keyMeal, $value);
            if ($rate > 0) {
                $room_rate = $room_rate + $rate;
                //$zeroRateDetected = false;
            } else {
                $zeroRateDetected = true;
            }
        }
        if ($zeroRateDetected == false && $room_rate != 0) {
            $meals[] = array("key" => $keyMeal, "value" => $meal);
            //$meals[$keyMeal] =  $meal;
        }
        $zeroRateDetected = false;
    }
    $retun_arr = array("meals" => $meals);
    echo json_encode($retun_arr);
}