<?php 
	session_start();
	include_once("conn/global_variables.php");
	include_once($dot_com_absolute_path."/conn/conn.php");
	include_once($dot_com_absolute_path."/include/functions.php");
    ///////// TO BE DELETED XXXXXX  ///////// 
	/////Header("Location: $dot_com_website_path/bed-breakfast-rental.html");
	////Exit();
	
    /**********ARRAY FOR LONG TERM RENTAL STARTS*********/
    $a_longterm=explode("/",$_SERVER['REQUEST_URI']);
    $email_advertisement_ref_longterm=$a_longterm[$goaholidayhomes_url_no+1];
    $cal_id_longterm= $a_longterm[$goaholidayhomes_url_no];
    /**********ARRAY FOR LONG TERM RENTAL STARTS ENDS***********/
    
    if(isset($cal_id_longterm))
    {
    $select_query_if_error="SELECT advertisement_id FROM advertisement where advertisement_catagory='For_Rent' AND bed_breakfast='1' AND image1!='' AND (status=0 OR status=2) AND long_term_rental!='0'";
    }else{
    $select_query_if_error="SELECT advertisement_id FROM advertisement where advertisement_catagory='For_Rent' AND long_term_rental='0' AND bed_breakfast='1' AND image1!='' AND (status=0 OR status=2)";
    }
	$result_if_error=$db->get_results($select_query_if_error);
	if(count($result_if_error)==0 )
	{
		Header("Location: $dot_com_website_path/house-for-rent-in-goa.php");
		Exit();
	}
	include_once("include/search_result_pager.php");
	include_once("include/paging.php");
	$title="1 & 2 bedroom accommodation in Goa, three bedrooms Apartments in Goa, 3 BHK villa in Goa";
	$keywords="bedroom, accommodation in Goa, three bedrooms Apartments, Goa, villa in Goa";
	$description="Search Goa and vacation holiday rentals, Accommodation in Goa :: One bedroom and two bedrooms Apartments in Goa";
	$feature_still_has_to_come="YES";
	$page_specific_banner_name="ALL";
	$show_google_top_ad="NO";
	$show_google_right_ad="NO";
	$bookmark_this_site="Houses For Rent in Goa";
	$highly_recommend="NO";
	$breadcrum_links="<a id='bread' href='$dot_com_website_path/house-for-rent-in-goa.php'> Holiday rentals in Goa / </a> ";
	//$menu=4;
	title_keywords_listing_metatags($index='YES',$title,$keywords,$description);
	if(isset($_REQUEST['pg']))
    {
    $pg=$_REQUEST['pg'];
    }
	if(isset($_REQUEST['stg']))
    {
    $stg=$_REQUEST['stg'];
    }
	$display=25;
	$p = new Pager;
	$m= new paging($display);
	$limit = $display;
	$start = $m->findStart($limit);
	$page_title= $cal_id."  "."Bed and Breakfast Holiday Rental in Goa";
    if(isset($cal_id_longterm))
    {
    $menu=5;
    }else{
    $menu=4;
    }
?>
<style type="text/css">
.blue{ color:#1B459A; font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bolder;}
</style>
<script language="JavaScript" src="<?php echo $dot_com_website_path; ?>/script/currency.js" type="text/javascript"></script>
</head>
<body  topmargin="0" leftmargin="0" bgcolor="white" marginheight="0" marginwidth="0" style=" background-color:<?php echo $_SESSION['session_color_code']; ?>;">
	<!-- Header-->
	<!-- Body -->
	    <div style="display:none"><h1><?php echo $page_title;?></h1></div>
		<div class="wdth100 overflow-hide" style="background-color:<?php echo $_SESSION['session_color_code']; ?>;padding-top:110px;">
			<!-- Left Side sub header-->
			<div class="overflow-hide page_title" >
				<div class="maincontheaderbox" style=" background-color:#ffffff;">
					<div class="secttlbarwrap">
						<div>
							<div style="background-color:<?php echo $_SESSION['session_color_code']; ?>;height:4px;width:100%;">
								<img alt="" height="1" width="1">
							</div>
						</div>
						<div class="secttlbar" style="background-color:<?php echo $_SESSION['session_color_code']; ?>;">
					  		<?php echo $page_title;?>
						</div>
						<div>
							<div style="background-color:<?php echo $_SESSION['session_color_code']; ?>;height:4px;width:100%;">
								<img alt="" height="1" width="1">
							</div>
						</div>
				</div>
			</div>
			<!-- Left side Sub Header Ends Here-->
			<!-- Left Side Main Body-->
			<div class="maincontbox" style="height:100%;">
				<div id="main_content">
					<?php 		   
					$for_paging_title="Houses For Rent In Goa Found";
					$condition="";
					if($location!='select' && $location!='')
					{
						$condition.="your_location_in_goa='$_REQUEST[location]' AND ";
					}
					if($city!='select' && $city!='')
					{
						$condition.="city='$_REQUEST[city]' AND ";
					}
					if(isset($_REQUEST['keyword'])!='' && $_REQUEST['keyword']!='--- Keyword ---')
					{
						$condition.="( upper(advertisement_title) LIKE upper('%$_REQUEST[keyword]%') OR upper(short_description) LIKE upper('%$_REQUEST[keyword]%') OR  upper(long_description) LIKE upper('%$_REQUEST[keyword]%') ) AND ";
					}
                    if(isset($cal_id_longterm))
                    {
                    $select_query="SELECT user_master_id,advertisement_id,property_type,advertisement_title,property_status,city,your_location_in_goa,selected_date,you_are,your_country,your_primary_phone,display_primary_phone_no,display_telephone_on_web,property_cost,send_user_email,short_description,long_description,download_broucher,show_map,show_video,image1 FROM advertisement WHERE $condition advertisement_catagory='For_Rent' AND long_term_rental!='0' AND bed_breakfast='1' AND image1!='' AND (status=0 OR status=2)  ORDER BY updated_date desc";
                    }
                    else
                    {
                    $select_query="SELECT user_master_id,advertisement_id,property_type,advertisement_title,property_status,city,your_location_in_goa,selected_date,you_are,your_country,your_primary_phone,display_primary_phone_no,display_telephone_on_web,property_cost,send_user_email,short_description,long_description,download_broucher,show_map,show_video,image1 FROM advertisement WHERE $condition advertisement_catagory='For_Rent' AND long_term_rental='0' AND bed_breakfast='1' AND image1!='' AND  (status=0 OR status=2)  ORDER BY updated_date desc"; ///AND long_term_rental='0'
                    }
					$select_query= $select_query." limit ".$start." , ".$limit;
					$result=$db->get_results($select_query);
					$count=count($result);
					// for the total number of record in the db
					$select_query1="SELECT advertisement_id FROM advertisement where $condition  advertisement_catagory='For_Rent' AND bed_breakfast='1' AND image1!=''   AND (status=0 OR status=2)"; ////AND long_term_rental='0'
					$result1=$db->get_results($select_query1);
					$count1=count($result1);
					// paging starts
					/*$pages = $p->findPages($count1, $limit);
					if($count>0)
					{
						if(!isset($pg))
							$pg=1;
						if(!isset($stg))
							$stg=1;
						echo $m->getPaging($count1,$pg,$stg);															
					}*/
					//paging ends
					if($count!=0)
					{
						$i=0;
						foreach($result as $results)
						{
					   /*if($i%2!=0)
					      $color=$_SESSION['session_matching_color_code'];
						else*/
						  $color="#FFFFFF";
						  	$web_address="select web_address,display_web_address_on_web from user_master_dex where user_master_id=$results->user_master_id";
					   	  	$web=$db->get_row($web_address);
							$select_calender_module="SELECT calendar_module,min_price,no_of_bedrooms,no_of_bathrooms FROM advertisement  WHERE advertisement_id='$results->advertisement_id' AND (status=0 OR status=2)";
							$calender_result=$db->get_row($select_calender_module);
                            $select_advertisement_details="SELECT min_price FROM advertisement WHERE advertisement_id='$results->advertisement_id'";
					   		$result_advertisement_details=$db->get_row($select_advertisement_details);
							$select_extra_details_query="SELECT sleeps,slogan FROM advertisement_extra_details WHERE advertisement_id='$results->advertisement_id'";
    						$extra_details_result=$db->get_row($select_extra_details_query);
							?>
							<table border="0" cellpadding="0" cellspacing="0">
								<tr bgcolor="<?php echo $color; ?>">
									<td valign="top">
										<div class="result_top_div"> 
											<div class="result_second_div">
                                            <h3 class="result_p_tag advert_title" ><a  class="link" href="<?php echo $dot_com_website_path;?>/<?php echo $goa_rent; ?>/<?php  echo post_url_value1("AD0".$results->advertisement_id,$results->advertisement_title).".html";?>" title="<?php  echo $results->property_type ; ?> in <?php  echo $results->city ; ?>, <?php  echo $results->your_location_in_goa ; ?>" alt="<?php  echo $results->property_type ; ?> in <?php  echo $results->city ; ?>, <?php  echo $results->your_location_in_goa ; ?>"><?php  echo stripslashes($results->advertisement_title) ; ?></a></h3><span class="result_p_tag advert_ref"><strong>[ Min Price/Night: <?php if($calender_result->min_price!='0'){ echo " <span class='red_text'>".'&#8377;'."</span>".number_format($calender_result->min_price / $_SESSION['ss_currency_value']);  } else { echo "ASK "; }  ?> ]</strong></span>
											<p class="result_p_tag">
												<strong class="blue"><?php echo $extra_details_result->slogan; ?></strong>
                                            </p>
                                            <p class="result_p_tag"><?php  echo $results->property_type ; ?> in <?php  echo $results->city ; ?>, <?php  echo $results->your_location_in_goa ; ?>, India</p>
											<p class="result_p_tag">
                                            <?php if(trim($results->your_primary_phone)!="" && $results->display_primary_phone_no=='YES' ) echo "<img src='$dot_com_website_path/images/phone_icon.gif' border='0' align='bottom' height='15'/>&nbsp;"."<strong>".$results->your_primary_phone."</strong>"."&nbsp;|&nbsp;"; ?><?php echo $calender_result->no_of_bedrooms; ?> Bedrooms | <?php echo $calender_result->no_of_bathrooms; ?> Bathrooms | Sleeps <?php echo $extra_details_result->sleeps; ?> 
											</p>
											
											</div>
											<div class="result_third_div">
												<div class="result_third_div_inside">
												<?php  
												if($_SESSION['ss_switch_image_on_off'] =='ON')
												{
													?>
                                                    <a href="<?php echo $dot_com_website_path;?>/<?php echo $goa_rent; ?>/<?php  echo post_url_value1("AD0".$results->advertisement_id,$results->advertisement_title).".html";?>">
													<?php  
													if($results->image1)
													{
														?>
														<img src="<?php echo $dot_com_website_path;?>/goa-property-images/<?php echo $results->image1 ;?>" alt="<?php echo stripslashes($results->advertisement_title) ; ?> in <?php echo $results->city ; ?>, <?php echo $results->your_location_in_goa ; ?>" title="<?php echo stripslashes($results->advertisement_title) ; ?> in <?php echo $results->city ; ?>, <?php echo $results->your_location_in_goa ; ?>" class="image_border" width="150" height="110" border="0" />
														<?php
													}
													else
													{
														?>
														<img src="<?php  echo $dot_com_website_path; ?>/images/coming_soon.jpg" class="image_border" width="150" height="110" border="0" />
														<?php  
													}
													?>
													</a>
													<?php 
												}
												?>
											</div>
											</div> 
											<div class="result_fourth_div">
												<p class="result_p_tag_desc">
												
												<?php  
												if($results->send_user_email=='YES')
												{
													?>
                                                    <img src='<?php echo $dot_com_website_path;?>/images/email_icon.jpg' border='0' align="bottom" height='15'/>&nbsp; <a class="link" href="<?php echo $dot_com_website_path;?>/<?php echo $goa_rent; ?>/<?php  echo post_url_value1("AD0".$results->advertisement_id, stripslashes(htmlentities($results->advertisement_title))).".html";?>#7">Email <?php  echo $results->you_are ; ?> <?php  if($results->your_country!='select') echo " In ".$results->your_country ; ?></a>
													<?php  
												}
												else
												{
													if($results->property_status=='Sold' || $results->property_status=='Sold Via Goa Holiday Homes')
													{
														echo "<img src='$dot_com_website_path/images/email_icon.jpg' border='0' align='bottom' height='15'/>&nbsp; <span class='red_text'>$results->property_status</span>";
													}
													else
													{
														?>
														<img src='<?php echo $dot_com_website_path;?>/images/email_icon.jpg' border='0' align="bottom" height='15'/>&nbsp;  <?php  echo $results->you_are ; ?> <?php  if($results->your_country!='select') echo " In ".$results->your_country ; ?>
														<?php 	
													}
												}
												if($web->web_address!="" && $web->display_web_address_on_web=="YES")
												{ 
													$web_address=str_replace("http://","",$web->web_address) ;
													$web_address="http://".$web_address;
													?>
													&nbsp;&nbsp;<img src='<?php echo $dot_com_website_path;?>/images/icons/website.png' border='0' align="bottom" height='15'/>&nbsp;<a class="link" href="<?php echo $dot_com_website_path; ?>/link.php?adid=<?php echo $results->advertisement_id ?>" target="_blank">Website</a>
													<?php 
												}
                                                if($calender_result->calendar_module=='YES')
											    {
												?>
												    &nbsp;<a class="link" href="<?php echo $dot_com_website_path;?>/calendar/rent/<?php  echo $results->advertisement_id;?>"><img src='<?php echo $dot_com_website_path;?>/images/availability.png' border='0' align="bottom" height='20'/> Availability </a>
												<?php 
											    }
                                                ?>
												 <?php  
	            								if($results->show_map=='YES')
	            								{
	            								?>
                                                <a class="link" href="<?php echo $dot_com_website_path;?>/<?php echo $goa_rent; ?>/<?php  echo post_url_value1("AD0".$results->advertisement_id, stripslashes(htmlentities($results->advertisement_title))).".html";?>#6"> <img src='<?php echo $dot_com_website_path;?>/images/locate_on_map.png' border='0' align="bottom" height='20'/> Map</a>
	            								<?php  
	            								}
	            								?>
	                                           <?php  
												//echo $results->property_status ;
												///if($results->property_status =="Under Construction Available On" || $results->property_status =="Given on Rent Available On" || $results->property_status =="Will Be Available On")
												//{
												//echo " ".$results->selected_date;
												//}
												if($results->show_video=='YES')
												{
												?>
												&nbsp;&nbsp;<a class="link" href="<?php  echo $dot_com_website_path;?>/video.php?clip=1<?php  echo $results->advertisement_id; ?>"><img src='<?php echo $dot_com_website_path;?>/images/video_clip.png' border='0' align="bottom" height='20'/> Video</a>
												<?php  
												}
											?>
												<br>
												<?php  echo str_stop(stripslashes($results->short_description),400) ; ?>
												<?php 
												if($results->long_description)
												{
													?>
                                                    <a  class="link" href="<?php echo $dot_com_website_path;?>/<?php echo $goa_rent; ?>/<?php  echo post_url_value1("AD0".$results->advertisement_id,$results->advertisement_title).".html";?>" title="More information on <?php  echo $results->property_type ; ?> in <?php  echo $results->city ; ?>, <?php  echo $results->your_location_in_goa ; ?>" alt="More information on <?php  echo $results->property_type ; ?> in <?php  echo $results->city ; ?>, <?php  echo $results->your_location_in_goa ; ?>"> &#171;&#171;  View <?php  echo $results->property_type ; ?> Details &#187;&#187;</a>
													<?php 
												}
												?>
											</p>
											</div>
										</div>
									</td>
								</tr>
								<tr>
									<td height="8">&nbsp;</td>
								</tr>
							</table>
							<?php 	
							$i++;
						}
						// paging starts
						/*$pages = $p->findPages($count1, $limit);
						if($count>0)
						{
							if(!isset($pg))
							$pg=1;
							if(!isset($stg))
							$stg=1;
							echo $m->getPaging($count1,$pg,$stg);															
						}*/
						//paging ends
					}
					else
					{
						?>
						<div style="width:100%;height:50px;padding-top:30px;margin:0px;border:1px dotted gray;text-align:center;"><strong>No Records found</strong></div>
						<?php 
					}
					?>	
				</div> 
				<?php  #<!-- ++++++++++++++++++++++++++++++++ RIGHT STARTS+++++++++++++++++++++++++++++++++ --># ?>
				<?php if(isset($cal_id_longterm)){include($dot_com_absolute_path."/include/right_property_rental.php");} else { include($dot_com_absolute_path."/include/right_house_for_rent.php");} ?>
				<?php  #<!-- ++++++++++++++++++++++++++++++++ RIGHT ENDS +++++++++++++++++++++++++++++++++ --># ?>
				<?php  
				$search_engine_keyword='For_Rent';

				include($dot_com_absolute_path."/include/footer_advertiser.php"); 
				?>
			</div>
			<!-- Left Side Main Body Ends Here-->
		</div>
		<!-- Side Menu Starts Here -->
		<div class="overflow-hide">
			<!--Side Menu -->
			<?php include($php_file_absolute_path."/side.php"); ?>
			<!-- Side Menu Ends Here-->
		</div>
		<!-- Side Menu Ends Here-->
	</div>
	<!-- Footer-->
	<?php include($php_file_absolute_path."/footer.php"); ?>
	<?php include($php_file_absolute_path."/header.php"); ?>

</body>
</html>