<?php
$datetoday               = date("m/d/Y");
$datetomorrow            = date("m/d/Y", time() + 86400);
//search local top destinations
$cityinventorylocal      = mysqli_query($conn, "SELECT ai.element_name, ai.ota_id, ai.ota_priority, ai.element_id, hlp.hotel_price, ai.image_topdestination FROM approved_inventory AS ai JOIN (SELECT DISTINCT hotel_city, MIN(hotel_low_price) AS hotel_price FROM hotels GROUP BY hotel_city) AS hlp 
ON ai.city_id = hlp.hotel_city
WHERE ai.microsite_inventory_code = '$codeinventario' AND ai.element_type = '2' AND ai.active = '1' AND ai.publish = '1' AND ai.topdestination_type = '1' AND ai.deleted = '0' ");
$cityinventorylocaltotal = mysqli_num_rows($cityinventorylocal);

//search worldwide top destinations
$cityinventoryworld      = mysqli_query($conn, "SELECT ai.element_name, ai.ota_id, ai.ota_priority, ai.element_id, hlp.hotel_price, ai.image_topdestination FROM approved_inventory AS ai JOIN (SELECT DISTINCT hotel_city, MIN(hotel_low_price) AS hotel_price FROM hotels GROUP BY hotel_city) AS hlp 
ON ai.city_id = hlp.hotel_city
WHERE ai.microsite_inventory_code = '$codeinventario' AND ai.element_type = '2' AND ai.active = '1' AND ai.publish = '1' AND ai.topdestination_type = '2' AND ai.deleted = '0' ");
$cityinventoryworldtotal = mysqli_num_rows($cityinventoryworld);
?>