Пример #1
0
function viewTableSpecialOfferHotels($data, $count)
{
    $paginations = new Paginations();
    $paginations->setLimit(10);
    $paginations->setPage($_REQUEST['page']);
    $paginations->setJSCallback("viewSpecialOfferHotelsFront");
    $paginations->setTotalPages($count);
    $paginations->makePagination();
    $mainCity = new MainCity();
    $hotels = new Hotels();
    $country = new country();
    $SubCity = new SubCity();
    $hotelimages = new HotelImages();
    $discount = new HotelRoomRates();
    ?>
        <div class="after-mid">
            <div class="accordian-cont">
                <ul id="ulHotelList" class="hotelList">
                    <?php 
    for ($x = 0; $x < count($data); $x++) {
        $hotels->extractor($data, $x);
        $discount->setHotelId($hotels->hotelId());
        $discount_data = $discount->getRatesFromHotelId();
        $discount->extractor($discount_data);
        $rateAvailable = $hotels->getLowestRate();
        if ($rateAvailable['RateAvailable'] == true) {
            $new_hotel = new Hotels();
            $new_hotel->setHotelId($hotels->hotelId());
            $new_hotel_data = $new_hotel->getHotelFromId();
            $new_hotel->extractor($new_hotel_data);
            $hotelimages->setImageHotelId($new_hotel->hotelId());
            $hotelimages->extractor($hotelimages->getImageFromHotelsIdOne());
            $mainCity_discount = new MainCity();
            $mainCity_discount->setMainCityId($new_hotel->hotelMainCityId());
            $mainCity_discount->extractor($mainCity_discount->getMainCityFromId());
            $filename = DOC_ROOT . 'uploads/hotels/thumbnails/' . $hotelimages->imageName();
            ?>
                                <li>
                                    <a href="<?php 
            echo HTTP_PATH;
            echo $new_hotel->hotelSeoUrl();
            ?>
.html">
                                        <?php 
            if (file_exists($filename) && $hotelimages->imageName() != "") {
                ?>
                                                <img src="<?php 
                echo HTTP_PATH . 'uploads/hotels/thumbnails/' . $hotelimages->imageName();
                ?>
" width="151" height="130" alt="new_hotel"/>
                                            <?php 
            } else {
                ?>
                                                <img src="images/no_image.jpg" alt="image" width="151" height="130"/>
                                            <?php 
            }
            ?>
                                        <div class="hotel-name-price">
                                            <h5 onclick="makeAlert(<?php 
            echo $new_hotel->hotelId();
            ?>
);"><?php 
            echo $new_hotel->hotelName();
            ?>
</h5>
                                            <input type="hidden" id="<?php 
            echo $new_hotel->hotelId();
            ?>
" name="<?php 
            echo $new_hotel->hotelId();
            ?>
" value="<?php 
            echo $new_hotel->hotelSeoUrl();
            ?>
"/>

                                        </div>
                                        <div>
                                            <span><?php 
            echo $mainCity_discount->mainCityName();
            ?>
</span>
                                        </div>
                                        <div class="price-box">
                                            <span>From</span>
                                            <span class="price">
                                                <?php 
            echo $_SESSION['defaultCurrency'] . ' ' . $rateAvailable['Rate'];
            ?>
                                            </span>

                                            <p></p>
                                        </div>
                                    </a>
                                </li>

                            <?php 
        }
        ?>
                            <div id="pagination"><?php 
        $paginations->drawPagination();
        ?>
</div>
                        <?php 
    }
    ?>
                </ul>
            </div>
        </div>
    <?php 
}
Пример #2
0
            $hotels->setHotelId($hotel_file_id);
            $hotels->extractor($hotels->getHotelFromId());
            $hotel_img = $hotels->hotelsImages();

            //$img_list = "";

            if ($hotel_img != '') {
                $hotel_img .= ',' . $upload->file_copy;
                $hotels->updateHotelsImages($hotel_img);
                //$img_list = $hotel_img;
            } else {
                $hotels->updateHotelsImages($upload->file_copy);
                //$img_list = $upload->file_copy;
            }

            $hotel_images = new HotelImages();
            $hotel_images->setImageHotelId($hotel_file_id);
            $hotel_images->setImageType('main');
            $hotel_images->setImageName($upload->file_copy);
            $hotel_images->setImageTitle('');
            $hotel_images->setImagePosition('');

            $hotel_images->newImage();
        } else {

            echo '<div id="status">failed</div>';
            echo '<div id="message">' . $upload->show_error_string() . '</div>';

        }
    }
?>
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getHotelImages()
 {
     return $this->hasMany(HotelImages::className(), ['hotel_id' => 'id']);
 }