function getLowestRate(){ $cols="MIN(LEAST(COALESCE(NULLIF(sgl_ro_sell_foriegn,0), 2147483647),COALESCE(NULLIF(dbl_ro_sell_foriegn,0), 2147483647),COALESCE(NULLIF(tpl_ro_sell_foriegn,0), 2147483647) ,COALESCE(NULLIF(sgl_bb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(dbl_bb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(tpl_bb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(sgl_hb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(dbl_hb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(tpl_hb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(sgl_fb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(dbl_fb_sell_foriegn,0), 2147483647),COALESCE(NULLIF(tpl_fb_sell_foriegn,0), 2147483647))) MinRate"; $this->MDatabase->selectJOIN("room_rates INNER JOIN hotels ON hotels.hotel_id= room_rates.hotel_id", $cols, "room_rates.hotel_id='".$this->hotelId()."' AND hotel_active_status='".Libs::getKey("hotel_status_admin", "Active")."' AND COALESCE(NULLIF(sgl_ro_sell_foriegn,0), NULLIF(dbl_ro_sell_foriegn,0),NULLIF(tpl_ro_sell_foriegn,0), NULLIF(sgl_bb_sell_foriegn,0),NULLIF(dbl_bb_sell_foriegn,0), NULLIF(tpl_bb_sell_foriegn,0),NULLIF(sgl_hb_sell_foriegn,0), NULLIF(dbl_hb_sell_foriegn,0),NULLIF(tpl_hb_sell_foriegn,0), NULLIF(sgl_fb_sell_foriegn,0),NULLIF(dbl_fb_sell_foriegn,0), NULLIF(tpl_fb_sell_foriegn,0)) IS NOT NULL", ""); $res = $this->MDatabase->result; $amount = $res[0]["MinRate"]; $response= array("RateAvailable" => ($amount <>''? true : false), "Rate" => ($amount <>''? $amount : 0)); return $response; }
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> | <?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(); }