"apartments","de" =>"wohnungen", "fr" => "appartements"); $apartment = $arrayLanguages[$ln]; return "http://www.akaza.net/$ln/$apartment/$prop.html"; } //END JUDD include ("obm22/funct.php"); include ("include.php"); if ($ln == ""){ $ln = "en"; } $id = 1; $refName = getRefName(); $strResArchive = "$refName~"; loadTranslationFile("default"); $MyHTTP_POST_GET_VARS = getHTTP_POST_GET_VARS($HTTP_POST_VARS,$HTTP_GET_VARS); $query1 = "select Left(c.Name,3) as cur,h.Name from currency c,hotel h where h.HotelID= $id and c.CurrencyID= h.CurrencyID"; $res1 = dataQuery($query1); $row1 = mysql_fetch_array($res1); $cur = $row1["cur"]; $hotelName = $row1[Name]; $currentDate = mktime(); $currentYear = date("Y",$currentDate); if (!isSet($typeSearch)){ $typeSearch = "withoutAvailability"; } if (!isSet($guests)){ $guests = 1; } if (!isSet($areaID)){ $areaID = 0; } if (!isSet($page)){ $page = 1; } if (!isSet($shortTerm)){ $shortTerm = "all"; } if (!isSet($searchNew)){ $searchNew = "yes"; $nextDay = $currentDate + 1*24*60*60; $nextWeek = $currentDate + 8*24*60*60; $daysI = date("j",$nextDay); $monthsI = date("n",$nextDay); $yearI = date("Y",$nextDay); $daysS = date("j",$nextWeek); $monthsS = date("n",$nextWeek); $yearS = date("Y",$nextWeek); $showOnlyAvailable = "no"; } if (($searchNew == "no") and ($strFacilities != "")){ $tmpKeysFac = split(",", $strFacilities); $facilities = array(); foreach ($tmpKeysFac as $k => $v){ $facilities[$v] = "on"; } } $arrFacID = array(); if ((isset($facilities)) and (count($facilities) != 0)){ foreach ($facilities as $k => $v){ $arrFacID[count($arrFacID)] = $k; } } $dateI = mktime(0,0,0,$monthsI,$daysI,$yearI); $dateS = mktime(0,0,0,$monthsS,$daysS,$yearS); $nights = round((date($dateS) - date($dateI)) /(24*60*60)); $perPage = 10; $rooms = 1; $pageName = $_SERVER[PHP_SELF]; $arrAreas = array(); $arrAreasSave = array(); $arrPropID = array(); $strPropID = ""; $queryAreas = "SELECT AreaID,Name from areas where HotelID='$id' order by OrderID,Name"; $resultAreas = dataQuery($queryAreas); $numResAreas = mysql_num_rows($resultAreas); //initializez arrPropRate, arrPropErrCode, arrPropErrValue $arrPropRate = array(); $arrPropErrCode = array(); $arrPropErrValue = array(); while ($rowAreas = mysql_fetch_array($resultAreas)){ $areaName = $rowAreas[Name]; if ($ln != "en"){ $queryAreaTrans = "select Name from translateareas where AreaID='$rowAreas[AreaID]' and Language='$ln'"; $rowAreasTrans = mysql_fetch_array(dataQuery($queryAreaTrans)); if (trim($rowAreasTrans) != ""){ $areaName = $rowAreasTrans[Name]; } } $arrAreasSave[$rowAreas[AreaID]] = $areaName; //selectez toate proprietatile cu areaID curenta si dupa ce obtin PropID //daca am areaID != 0 le bag in fata !!!!!! $tmpArrPropID = array(); $tmpStrPropID = ""; $countRommsFac = 0; $andShortTerm = ""; if ($shortTerm != "all"){ $andShortTerm = "and ShortTerm='$shortTerm'"; } $queryResults = "select RoomID from room where AreaID='$rowAreas[AreaID]' $andShortTerm and PropertyType='A' and HotelID='$id' order by OrderID,TypeRoom"; if ($typeSearch == "withAvailability"){ $queryResults = "select RoomID from room where AreaID='$rowAreas[AreaID]' $andShortTerm and PropertyType='A' and HotelID='$id' and Guests >= '$guests' order by OrderID,TypeRoom"; } $resResults = dataQuery($queryResults); while ($rowResults = mysql_fetch_array($resResults)){ $queryF2R = "SELECT FacilityID FROM facilitiestorooms where RoomID='$rowResults[RoomID]'"; $resF2R = dataQuery($queryF2R); $arrF2R = array(); while ($rowF2R = mysql_fetch_array($resF2R)){ $arrF2R[count($arrF2R)] = $rowF2R[FacilityID]; } $errCode = ""; $errValue = ""; $totalPrice = 0; if ($typeSearch == "withAvailability"){ $typeRoom = $rowResults[RoomID]; $str = minimStay($dateI,$dateS,$id,$typeRoom); if ($str == ""){//if min stay//=""minim stay is ok $srtMax = maximumStay($dateI,$dateS,$id,$typeRoom); if ($srtMax == ""){//maxStay is ok $strSDays = startingDays($dateI,$dateS,$id,$typeRoom); $strEDays = endingDays($dateI,$dateS,$id,$typeRoom); if (($strSDays == "") and ($strEDays == "")){ if (isHotelOpen($dateI,$dateS,$id,$typeRoom) == 1) { $errCode = "noRooms"; }elseif(($availRoom=isRoomAvail($dateI,$dateS,$id,$typeRoom,$rooms)) <> -1){///////////isRoomAvail():0 camere disponibile ////////////////// if ($availRoom <= 0){ $errCode = "noRooms"; }else{ $errCode = "notEnoughRooms"; } }else{///availability ok $dateT = $dateI; $flag = 0; $arrayRates = getRates();// get the rates foreach ($arrayRates as $v){ $totalPrice += $v[2]; $totalPriceS = $totalPrice; } //aici se seteaza flag $dDateI = date("Y-m-d",$dateI); $query = "select TypeRoom,Description,Photo,Deposit,Type,Cleaning,TypeC from room where RoomID='$typeRoom'"; $res1 = dataQuery($query); $row1 = mysql_fetch_array($res1); $discPrice = 0; $queryDisc = "Select d.* from discounts d, discountstorooms dr where d.Nights='$nights' and d.HotelID='$id' and d.Status='a' and d.DiscountID=dr.DiscountID and dr.RoomID='$typeRoom' and ('$dDateI' between d.Start and d.End)"; $rowDisc = mysql_fetch_array(dataQuery($queryDisc)); if ($rowDisc[Value] != 0){ $valDisc = ""; $discPrice = $rowDisc[Value]; if ($rowDisc[Type] == "p"){ $valDisc = "$rowDisc[Value] %"; $discPrice = ($totalPrice * $rowDisc[Value]) / 100; } } $totalPrice -= $discPrice; //aici booking fee $deposit = $row1[Deposit]; if ($row1[Type] == "p"){ $deposit = ($totalPrice * $row1[Deposit]) / 100; } $totalPrice += $deposit; $discPromo = 0; if ($promoCode != ""){ $queryPromo = "Select p.* from promotions p, promotionstorooms pr where p.Name='$promoCode' and p.HotelID='$id' and p.Status='a' and p.PromotionID=pr.PromotionID and pr.RoomID='$typeRoom'"; $rowPromo = mysql_fetch_array(dataQuery($queryPromo)); if ($rowPromo[Value] != 0){ $valPromo = ""; $discPromo = $rowPromo[Value]; if ($rowPromo[Type] == "p"){ $valPromo = "$rowPromo[Value] %"; $discPromo = ($totalPrice * $rowPromo[Value]) / 100; } } } $totalPrice -= $discPromo; //aici cleaning fee $cleaning = $row1[Cleaning]; if ($row1[TypeC] == "p"){ $cleaning = ($totalPrice * $row1[Cleaning]) / 100; } $totalPrice += $cleaning; if ($flag == 1){ $errCode = "onRequest"; } }///end else availability ok }else{ if ($strSDays != ""){ //echo getHtmlErrStay($strSDays); $errCode = "startDay"; $errValue = $strSDays; }else if ($strEDays != ""){ //echo getHtmlErrStay($strEDays); $errCode = "endDay"; $errValue = $strEDays; } } }else{//if max stay//<> ""maximum stay is not ok //echo getHtmlErrStay($srtMax); $errCode = "maxStay"; $errValue = $srtMax; } }else{//if min stay//<> ""minimum stay is not ok //echo getHtmlErrStay($str); $errCode = "minStay"; $errValue = $str; } } $arrPropRate[$typeRoom] = $totalPrice; $arrPropErrCode[$typeRoom] = $errCode; $arrPropErrValue[$typeRoom] = $errValue; //echo "

RoomID $typeRoom $totalPrice" . var_dump($arrPropErrValue) . "

"; if ((count(array_diff($arrFacID,$arrF2R)) == 0) and ($errCode == "")){ $countRommsFac ++; $tmpArrPropID[count($tmpArrPropID)] = $rowResults[RoomID]; } } //var_dump($arrPropRate); if (count($tmpArrPropID) != 0){ $tmpStrPropID = join(",",$tmpArrPropID); } if ($rowAreas[AreaID] == $areaID){ array_unshift($arrAreas,array("$rowAreas[AreaID]","$areaName","$rowCountProp[NrProp]")); //array_unshift($arrPropID, $tmpStrPropID); if ($tmpStrPropID != ""){ if ($strPropID == ""){ $strPropID = $tmpStrPropID; }else{ $strPropID = $tmpStrPropID . "," . $strPropID; } } }else{ $arrAreas[count($arrAreas)] = array("$rowAreas[AreaID]","$areaName","$rowCountProp[NrProp]"); //array_push($arrPropID, $tmpStrPropID); if ($tmpStrPropID != ""){ if ($strPropID == ""){ $strPropID = $tmpStrPropID; }else{ $strPropID = $strPropID . "," . $tmpStrPropID; } } } } if ($strPropID != ""){ $arrPropID = split(",",$strPropID); } ?> <?=$title?>

Information on neighbourhoods of Barcelona

   
   :
$v){ $i++; $checkArea = ""; if ($v[0] == $areaID){ $checkArea = "checked"; } ?>
 
:   :  
:   :  
   
$numberOfPages){ $page = $numberOfPages; } $nextPage = $page + 1; $previousPage = $page - 1; $start = ($page - 1) * $perPage; if ($page == $numberOfPages OR $numberOfUsers == 0) { $end = $page * $perPage - ($page * $perPage - $numberOfUsers) ; } else { $end = $page * $perPage; } ?>
: [ - ]


$v){ $typeRoom = $v; $countRommsFac ++; $propPhoto = ""; $query = "select TypeRoom,Guests,Description,Photo,AreaID,Map,Size,Bedrooms,Bethrooms,MonthlyFee from room where RoomID='$typeRoom'"; $res1 = dataQuery($query); $row1 = mysql_fetch_array($res1); $lnRoomType = $row1[TypeRoom]; //JUDD $prop_url = generateURL($ln, $lnRoomType); //End JUDD $lnDescription = $row1[Description]; if ($ln <> 'en'){ $sql = "select RoomType,Description from translaterooms where RoomID=$typeRoom and Language='$ln'"; $resrn = dataQuery($sql); $rowrn = mysql_fetch_array($resrn); if (trim($rowrn[RoomType]) <> "" and $rowrn[RoomType] <> "NULL"){ $lnRoomType = $rowrn[RoomType]; } if (trim($rowrn[Description]) <> "" and $rowrn[Description] <> "NULL"){ $lnDescription = $rowrn[Description]; } } /*$mapLink = "$mapText"; if ((trim($row1[Map]) != "") and (is_file("obm22/images/admin/maps/$typeRoom/$row1[Map]"))){ $sizeMap = GetImageSize("obm22/images/admin/maps/$typeRoom/$row1[Map]"); $mapW = $sizeMap[0]; $mapH = $sizeMap[1] + 50; $mapLink = "$mapText"; }*/ //$mapLink = "$mapText"; $mapLink = "
"; $photoLink = ""; $arrPhotos = array(); if (is_dir("obm22/images/admin/rooms/$typeRoom")){ $handle = opendir("obm22/images/admin/rooms/$typeRoom"); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $arrPhotos[count($arrPhotos)] = "$file"; } } closedir($handle); } sort ($arrPhotos); reset ($arrPhotos); if (count($arrPhotos) != 0){ foreach ($arrPhotos as $k => $v){ $sizeImg = GetImageSize("obm22/images/admin/rooms/$typeRoom/$v"); $photoW = $sizeImg[0]; $photoH = $sizeImg[1] + 120; $propPhoto = ""; break; } $photoLink = " [$morePhotoText  \"$viewImgT\"]"; } $errCode = $arrPropErrCode[$typeRoom]; $errValue = $arrPropErrValue[$typeRoom]; $totalPrice = $arrPropRate[$typeRoom]; ?>
    |    
 
:
:
:
:
:
:
 
 
1){ ?>


[...]
:  


: [ - ]




$msgFT1

EOT; return $html30days; } function getHtmlErrStay($str){ global $ln,$id,$typeRoom,$dateI,$dateS,$guests,$rooms,$roomTT,$lnRoomType,$lnDescription,$fac, $hotelpropT,$trynewcritButtonWidth,$trynewcritButtonText,$checkavailability,$wcabutton;; $propPhoto = ""; $photoLink = ""; $arrPhotos = array(); if (is_dir("obm22/images/admin/rooms/$typeRoom")){ $handle = opendir("obm22/images/admin/rooms/$typeRoom"); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $arrPhotos[count($arrPhotos)] = "$file"; } } closedir($handle); } sort ($arrPhotos); reset ($arrPhotos); if (count($arrPhotos) != 0){ foreach ($arrPhotos as $k => $v){ $sizeImg = GetImageSize("obm22/images/admin/rooms/$typeRoom/$v"); $photoW = $sizeImg[0]; $photoH = $sizeImg[1] + 120; $propPhoto = ""; break; } $photoLink = " click here for more photos  \"$viewImgT\""; } $htmlErrStay = ""; $htmlErrStay = <<
 $roomTT: $lnRoomType  $photoLink    
$propPhoto$lnDescription
$fac: EOT; $query1 = "SELECT f.Name from facilities f, facilitiestorooms fr where fr.RoomID='$typeRoom' and fr.FacilityID=f.FacilityID and f.HotelID='$id' order by f.Name"; $result1 = dataQuery($query1); $a = array(); while ($row1 = mysql_fetch_array($result1)){ $a[count($a)] = $row1[Name]; } $facilities = join(", ",$a); $htmlErrStay .=<<

$str

EOT; return $htmlErrStay; } function getHtmlNoRoomsForNoAdults(){ global $noRooms,$guests,$adultsT,$id,$ln,$trynewcritButtonWidth,$trynewcritButtonText; $htmlNoRoomsForNoAdults = ""; $htmlNoRoomsForNoAdults = <<
$noRooms $guests $adultsT  

EOT; return $htmlNoRoomsForNoAdults; } function getHtmlJustRooms($nr){ global $ln,$id,$typeRoom,$dateI,$dateS,$guests,$rooms,$roomTT,$lnRoomType, $lnDescription,$fac,$hotelpropT,$msgFT2,$trynewcritButtonWidth,$trynewcritButtonText; $propPhoto = ""; $photoLink = ""; $arrPhotos = array(); if (is_dir("obm22/images/admin/rooms/$typeRoom")){ $handle = opendir("obm22/images/admin/rooms/$typeRoom"); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $arrPhotos[count($arrPhotos)] = "$file"; } } closedir($handle); } sort ($arrPhotos); reset ($arrPhotos); if (count($arrPhotos) != 0){ foreach ($arrPhotos as $k => $v){ $sizeImg = GetImageSize("obm22/images/admin/rooms/$typeRoom/$v"); $photoW = $sizeImg[0]; $photoH = $sizeImg[1] + 120; $propPhoto = ""; break; } $photoLink = " click here for more photos  \"$viewImgT\""; } $htmlJustRooms = ""; $getmsgFT2 = getmsgFT2($nr); $htmlJustRooms =<<
 $roomTT: $lnRoomType  $photoLink
$propPhoto$lnDescription
$fac: EOT; $query1 = "SELECT f.Name from facilities f, facilitiestorooms fr where fr.RoomID='$typeRoom' and fr.FacilityID=f.FacilityID and f.HotelID='$id' order by f.Name"; $result1 = dataQuery($query1); $a = array(); while ($row1 = mysql_fetch_array($result1)){ $a[count($a)] = $row1[Name]; } $facilities = join(", ",$a); $htmlJustRooms .=<<

$getmsgFT2

EOT; return $htmlJustRooms; } function getHtmlNoRoomsDefined(){ global $noRoomsDefined; $htmlNoRooms = ""; $htmlNoRooms =<<
$noRoomsDefined

EOT; return $htmlNoRooms; } function getHtmlNoRooms(){ global $ln,$id,$typeRoom,$dateI,$dateS,$guests,$rooms,$roomTT,$lnRoomType, $lnDescription,$fac,$hotelpropT,$msgFT3,$trynewcritButtonWidth,$trynewcritButtonText; $propPhoto = ""; $photoLink = ""; $arrPhotos = array(); if (is_dir("obm22/images/admin/rooms/$typeRoom")){ $handle = opendir("obm22/images/admin/rooms/$typeRoom"); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $arrPhotos[count($arrPhotos)] = "$file"; } } closedir($handle); } sort ($arrPhotos); reset ($arrPhotos); if (count($arrPhotos) != 0){ foreach ($arrPhotos as $k => $v){ $sizeImg = GetImageSize("obm22/images/admin/rooms/$typeRoom/$v"); $photoW = $sizeImg[0]; $photoH = $sizeImg[1] + 120; $propPhoto = ""; break; } $photoLink = " click here for more photos  \"$viewImgT\""; } $htmlNoRooms = ""; $htmlNoRooms =<<
 $roomTT: $lnRoomType  $photoLink
$propPhoto$lnDescription
$fac: EOT; $query1 = "SELECT f.Name from facilities f, facilitiestorooms fr where fr.RoomID='$typeRoom' and fr.FacilityID=f.FacilityID and f.HotelID='$id' order by f.Name"; $result1 = dataQuery($query1); $a = array(); while ($row1 = mysql_fetch_array($result1)){ $a[count($a)] = $row1[Name]; } $facilities = join(", ",$a); $htmlNoRooms .=<<

$msgFT3

EOT; return $htmlNoRooms; } function getHtmlNoFacilities(){ global $noFacilities; $htmlNoFacilities = ""; $htmlNoFacilities =<<
$noFacilities

EOT; return $htmlNoFacilities; } function getPagesString(){ global $ln, $id, $areaID, $facilities, $page, $numberOfPages, $results, $perPage, $guests, $promoCode, $daysI, $monthsI, $yearI, $daysS, $monthsS, $yearS, $pageName, $showOnlyAvailable, $typeSearch; $searchNew = "no"; $strFacilities = ""; if (count($facilities) != 0){ $arrKeysFac = array_keys($facilities); $strFacilities = join(",",$arrKeysFac); } $ret = ""; $nextPage = $page + 1; $previousPage = $page - 1; if ($numberOfPages <= 10){ for ($i=1; $i <= $numberOfPages; $i++){ if ($i == $page){ $ret .= "[ $i ] "; }else{ $ret .= "[ $i ] "; } } }else{ if ($page <> 1){ $ret = " <    "; } if ($page + 10<= $numberOfPages){ for ($i=$page; $i < $page+10; $i++){ if ($i == $page){ $ret .= "[ $i ] "; }else{ $ret .= "[ $i ] "; } } $ret .= "   >>  "; }else{ $li = $numberOfPages - 10; for ($i=$li; $i <= $numberOfPages; $i++){ if ($i == $page){ $ret .= "[ $i ] "; }else{ $ret .= "[ $i ] "; } } } } return $ret; } ?>