<?php
$id_locatie = $_GET['id'];
echo'<a name="sus"></a>';
// echo''.$time.'<br />';
// echo $fus_orar;
$sql = mysql_query("SELECT * FROM `locatie_cazare` WHERE status != 'BLOCAT' and id = ".$id_locatie."");
$rows = mysql_num_rows($sql);
if ($id_locatie == '' or $rows == '0'){
echo "<script>location.replace('index.php')</script>";
	}
	
while($locatie = mysql_fetch_row($sql)){


// if($locatie['88'] != 'PLATIT'){
	// echo'<img id="fotopopup" src="http://www.ro-cazare.info/img/profil-inactiv-ro-cazare-860x860.jpg">';
	// echo '<META HTTP-EQUIV=Refresh CONTENT="8; URL=http://www.ro-cazare.info/proforma.html">';
	// }	
	
//$adauga_vizualizare = mysql_query ("UPDATE `locatie_cazare` SET `nr_vizualizari`=".++$locatie['97']." WHERE id = '".$id_locatie."'") or die(mysql_error());

$adauga_vizualizare = mysql_query ("UPDATE `locatie_cazare` SET `nr_vizualizari`=".++$locatie['97'].", ultima_vizita = ".$ymdhis." WHERE id = ".$id_locatie."") or die(mysql_error());

if ($locatie['10'] == null){
		if ($locatie['9'] == null){$loc1 = $locatie['8'];}else{$loc1 = $locatie['9'];}	
			}else{$loc1 = $locatie['10'];}
$loc = str_ireplace($ptr_url, ' ', $loc1);				
$url_loc = str_ireplace($ptr_url, '-', $loc1);	
$url_denumire = str_ireplace($ptr_url, '-', $locatie['6']);	

if ($locatie['21'] == '1') 
	{ $valoare21 = 'Accepta animale de companie / ';}
if ($locatie['22'] == '1') 
	{ $valoare22 = 'Acces pentru persoane cu dizabilitati / ';}
if ($locatie['23'] == '1') 
	{ $valoare23 = 'Bar / ';}
if ($locatie['24'] == '1') 
	{ $valoare24 = 'Baza de tratament / ';}
if ($locatie['25'] == '1') 
	{ $valoare25 = 'Bucatarie utilata pentru turisti / ';}
if ($locatie['26'] == '1') 
	{ $valoare26 = 'Camera pentru bagaje / ';}
if ($locatie['27'] == '1') 
	{ $valoare27 = 'Casino / ';}
if ($locatie['28'] == '1') 
	{ $valoare28 = 'Club / Discoteca / ';}
if ($locatie['29'] == '1') 
	{ $valoare29 = 'Crama / ';}
if ($locatie['30'] == '1') 
	{ $valoare30 = 'Curte interioara / ';}
if ($locatie['31'] == '1') 
	{ $valoare31 = 'Fax / ';}
if ($locatie['32'] == '1') 
	{ $valoare32 = 'Foisor / ';}
if ($locatie['33'] == '1') 
	{ $valoare33 = 'Frigider / ';}
if ($locatie['34'] == '1') 
	{ $valoare34 = 'Gratar / ';}
if ($locatie['35'] == '1') 
	{ $valoare35 = 'Inchiriere ATV / ';}
if ($locatie['36'] == '1') 
	{ $valoare36 = 'Inchiriere biciclete / ';}
if ($locatie['37'] == '1') 
	{ $valoare37 = 'Internet / ';}
if ($locatie['38'] == '1') 
	{ $valoare38 = 'Lift / ';}
if ($locatie['39'] == '1') 
	{ $valoare39 = 'Lobby bar / ';}
if ($locatie['40'] == '1') 
	{ $valoare40 = 'Loc de joaca ptr copii / ';}
if ($locatie['41'] == '1') 
	{ $valoare41 = 'Magazine in locatie / ';}
if ($locatie['42'] == '1') 
	{ $valoare42 = 'Masaj / ';}
if ($locatie['43'] == '1') 
	{ $valoare43 = 'Parcare / ';}
if ($locatie['44'] == '1') 
	{ $valoare44 = 'Piscina / ';}
if ($locatie['45'] == '1') 
	{ $valoare45 = 'Plaja privata / ';}
if ($locatie['46'] == '1') 
	{ $valoare46 = 'Program non-stop / ';}
if ($locatie['47'] == '1') 
	{ $valoare47 = 'Restaurant / ';}
if ($locatie['48'] == '1') 
	{ $valoare48 = 'Room service / ';}
if ($locatie['49'] == '1') 
	{ $valoare49 = 'Sala conferinta / ';}
if ($locatie['50'] == '1') 
	{ $valoare50 = 'Sala fitness / ';}
if ($locatie['51'] == '1') 
	{ $valoare51 = 'Salon frumusete / ';}
if ($locatie['52'] == '1') 
	{ $valoare52 = 'Sauna / ';}
if ($locatie['53'] == '1') 
	{ $valoare53 = 'Schimb valutar / ';}
if ($locatie['54'] == '1') 
	{ $valoare54 = 'Seif / ';}
if ($locatie['55'] == '1') 
	{ $valoare55 = 'Solar / ';}
if ($locatie['56'] == '1') 
	{ $valoare56 = 'Spalatorie / ';}
if ($locatie['57'] == '1') 
	{ $valoare57 = 'Telefon / ';}
if ($locatie['58'] == '1') 
	{ $valoare58 = 'Terasa / ';}
if ($locatie['59'] == '1') 
	{ $valoare59 = 'Teren sport';}
if ($locatie['60'] == '1') 
	{ $valoare60 = 'Transfer aeroport / ';}
if ($locatie['61'] == '1') 
	{ $valoare61 = 'TV in living / ';}
if ($locatie['62'] == '1') 
	{ $valoare62 = 'Aer conditionat / ';}
if ($locatie['63'] == '1') 
	{ $valoare63 = 'Baie proprie / ';}
if ($locatie['64'] == '1') 
	{ $valoare64 = 'Balcon / ';}
if ($locatie['65'] == '1') 
	{ $valoare65 = 'Bucatarie proprie / ';}
if ($locatie['66'] == '1') 
	{ $valoare66 = 'DVD player / ';}
if ($locatie['67'] == '1') 
	{ $valoare67 = 'Fax / ';}
if ($locatie['68'] == '1') 
	{ $valoare68 = 'Frigider / ';}
if ($locatie['69'] == '1') 
	{ $valoare69 = 'Incalzire centrala / ';}
if ($locatie['70'] == '1') 
	{ $valoare70 = 'Internet / ';}
if ($locatie['71'] == '1') 
	{ $valoare71 = 'Minibar / ';}
if ($locatie['72'] == '1') 
	{ $valoare72 = 'Telefon / ';}
if ($locatie['73'] == '1') 
	{ $valoare73 = 'TV color / ';}
if ($locatie['74'] == '1') 
	{ $valoare74 = 'Visa / ';}
if ($locatie['75'] == '1') 
	{ $valoare75 = 'Mastercard / ';}
if ($locatie['76'] == '1') 
	{ $valoare76 = 'Diners international / ';}
if ($locatie['77'] == '1') 
	{ $valoare77 = 'American expres / ';}
if ($locatie['74'] != '1' and $locatie['75'] != '1' and $locatie['76'] != '1' and $locatie['77'] != '1') 
	{ $valoare77 = 'Nu ne-au fost comunicate';}	
//$locatie['78'] se regaseste la zona geografica
if ($locatie['79'] == '1') 
	{ $valoare78 = 'Afaceri / ';}
if ($locatie['80'] == '1') 
	{ $valoare79 = 'Vacanta / ';}
if ($locatie['81'] == '1') 
	{ $valoare80 = 'Spa / ';}
if ($locatie['82'] == '1') 
	{ $valoare81 = 'Agroturism / ';}
if ($locatie['83'] == '1') 
	{ $valoare82 = 'Tranzit / ';}
if ($locatie['84'] == '1') 
	{ $valoare83 = 'Odihna si relaxare / ';}

echo'
<table style="width:780px; margin-left: auto; margin-right: auto; border: 0px solid;">
	<tr>
		<td>';
echo'
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="3">
<form style="float: left;" action="http://'.$title.'/rezerva-cazare/index.php" method="post">
	<input id="submit" type="submit" name="zona" value="'.$locatie['78'].'">
</form>	
<form style="float: left;" action="http://'.$title.'/rezerva-cazare/index.php" method="post">
	<input id="submit" type="submit" name="judet" value="'.$locatie['7'].'">
</form>	
<form style="float: left;" action="http://'.$title.'/rezerva-cazare/index.php" method="post">
	<input type="hidden" name="id_locatie" value="'.$locatie['0'].'">
	<input id="submit" type="submit" name="localitate" value="'.ucwords(strtolower($loc)).'">
</form>	
<form style="float: left;" action="http://'.$title.'/rezerva-cazare/index.php" method="post">
	<input id="submit" type="submit" name="tip_locatie" value="'.$locatie['4'].'">
</form>	
<form style="float: left;" action="http://'.$title.'/rezerva-cazare/index.php" method="post">
	<input id="submit" type="submit" name="clasificare" value="'.$locatie['5'].'">
</form>	
		</td>
	</tr>
	<tr>
		<td width="80%">
<div id="titlu">'.ucwords(strtolower($locatie['6'])).'</div><br />		

		</td>
		<td width="10%">';
///////////// start media ////////////
$sql = mysql_query("SELECT * FROM `comentarii` WHERE status = 'ACTIV' and media != '' and id_locatie = '".$locatie['0']."'");
	$nr_commentarii = mysql_num_rows($sql);	
$sql_media = mysql_query("SELECT sum(media) FROM `comentarii` WHERE status = 'ACTIV' and id_locatie = '".$locatie['0']."'");
$nr_recenzii = mysql_num_rows($sql_media);
	while($media = mysql_fetch_row($sql_media)){
if($nr_commentarii != '0'){	
$arata_nota = $media['0']/$nr_commentarii;
echo '<a href="http://'.$title.'/rezerva-cazare/cazare-'.strtolower($locatie['4']).'-'.strtolower($locatie['7']).'-'.strtolower($url_loc).'-'.strtolower($url_denumire).'-'.$locatie['0'].'.html#pareri" alt="Apasa si vezi aprecierile acestei locatii de cazare" title="Apasa si vezi aprecierile acestei locatii de cazare">
		<div id="media">
			Nota<br />
			'.round(($arata_nota),2).'			
		</div></a>';
			}else{
echo '<a href="http://'.$title.'/rezerva-cazare/cazare-'.strtolower($locatie['4']).'-'.strtolower($locatie['7']).'-'.strtolower($url_loc).'-'.strtolower($url_denumire).'-'.$locatie['0'].'.html#pareri" alt="Apasa si vezi aprecierile acestei locatii de cazare" title="Apasa si vezi aprecierile acestei locatii de cazare">
		<div id="media">
			Fara nota
		</div></a>';			
			}
}
///////////// end media ////////////	
echo'	</td>
		<td width="10%">
		<img id="qrcode" src="http://www.wikitools.ro/indexmute.php?action=qrgr" alt="" border=0>
		</td>
	</tr>
</table>';


///////////// start galerie foto /////////////
$sql_foto = mysql_query("SELECT * FROM `foto_locatie` where id_locatie = ".$locatie['0']." order by id desc limit 0,40 ");
$rows1 = mysql_num_rows($sql_foto);	
if ($rows1 == '0'){
	echo'<center>
	<a href="http://www.ro-cazare.info/contact.html" target="_blank">
			<img style="width: 500; height:375px; padding: 4px; margin: 4px; border: #c1c1c1 solid thin; border-radius: 0.4em; box-shadow: 1px 1px 4px #000000;" src="http://www.ro-cazare.info/upload/promovare-turistica-gratuit-ro-cazare-860x860.jpg" />
		</center>
	</a>';
}else{
	while($foto_mare = mysql_fetch_row($sql_foto)){

if ($_POST['foto_mare']){$foto_show = $_POST['foto_mare'];}else{$foto_show = $foto_mare['4'];}

//$img = "http://www.ro-cazare.info/upload/".$foto_show."";
//$size = getimagesize($img);
//if ($size['0'] =='' or $size['0'] >= '700'){$img_width = 'width:700px';}
//if ($size['1'] =='' or $size['1'] >= '525'){$img_height = 'height:525px';}
echo'<a name="foto-poze"></a>';	
echo'<center>
		<img style="width:700px; padding: 4px; margin: 4px; border: #c1c1c1 solid thin; border-radius: 0.4em; box-shadow: 1px 1px 4px #000000;" src="http://www.ro-cazare.info/upload/'.$foto_show.'" />
	</center>';

echo'<center><div id="centru">
		<div class="fb-like" data-href="http://'.$title.'/rezerva-cazare/cazare-'.strtolower($locatie['4']).'-'.strtolower($locatie['7']).'-'.strtolower($url_loc).'-'.strtolower($url_denumire).'-'.$locatie['0'].'.html" data-send="true" data-layout="button_count" data-width="100" data-show-faces="true" data-font="arial">
		</div>
		<div class="g-plusone">
			<g:plusone href="http://'.$title.'/rezerva-cazare/cazare-'.strtolower($locatie['4']).'-'.strtolower($locatie['7']).'-'.strtolower($url_loc).'-'.strtolower($url_denumire).'-'.$locatie['0'].'.html"></g:plusone>
		</div>
		<script type="text/javascript">
		  (function() {
			var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
			po.src = \'https://apis.google.com/js/plusone.js\';
			var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
			})();
		</script>
	</div></center>';
	while($foto_mica = mysql_fetch_row($sql_foto)){
echo'
<form style="float: left;" action="http://'.$title.'/rezerva-cazare/cazare-'.strtolower($locatie['4']).'-'.strtolower($locatie['7']).'-'.strtolower($url_loc).'-'.strtolower($url_denumire).'-'.$locatie['0'].'.html#foto-poze" method="post">
	<input type="hidden" name="foto_mare" value="'.$foto_mica['4'].'">
	<input id="fotomicagalerie" type="image" name="submit" src="http://www.ro-cazare.info/upload/foto_mica/'.$foto_mica['5'].'">
</form>
';
}
	}	
	}
///////////// end galerie foto /////////////
echo'	</td>
	</tr>
	<tr>
		<td>';
echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Descriere '.ucwords(strtolower($locatie['6'])).'
	</legend>';
echo'<div id="continut">'.stripslashes ( nl2br ($locatie['12'])).'</div>';	
echo'</fieldset>';

echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Facilitati cazare '.ucwords(strtolower($locatie['6'])).'
	</legend>';
echo'<div id="continut">
		'.$valoare21.''.$valoare22.''.$valoare23.''.$valoare24.''.$valoare25.''.$valoare26.''.$valoare27.''.$valoare28.''.$valoare29.''.$valoare30.''.$valoare31.''.$valoare32.''.$valoare33.''.$valoare34.''.$valoare35.''.$valoare36.''.$valoare37.''.$valoare38.''.$valoare39.''.$valoare40.''.$valoare41.''.$valoare42.''.$valoare43.''.$valoare44.''.$valoare45.''.$valoare46.''.$valoare47.''.$valoare48.''.$valoare49.''.$valoare50.''.$valoare51.''.$valoare52.''.$valoare53.''.$valoare54.''.$valoare55.''.$valoare56.''.$valoare57.''.$valoare58.''.$valoare59.''.$valoare60.''.$valoare61.'</div>';
echo'<div id="continut">Card bancar acceptat: <u>'.$valoare74.''.$valoare75.''.$valoare76.''.$valoare77.'</u></div>';
echo'<div id="continut">Tip turism: <u>'.$valoare78.''.$valoare79.''.$valoare80.''.$valoare81.''.$valoare82.''.$valoare83.'</u></div>';
echo'</fieldset>';

echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Receptie '.ucwords(strtolower($locatie['6'])).'
	</legend>';
echo'<div id="continut">Numar camere: <b>'.$locatie['20'].'</b></div>';
echo'<div id="continut">Receptia functioneaza intre orele: <b>'.$locatie['95'].'</b> si <b>'.$locatie['96'].'</b></div>';
echo'<div id="continut">Check in: <b>'.$locatie['86'].'</b></div>';
echo'<div id="continut">Check out: <b>'.$locatie['87'].'</b></div>';	
echo'</fieldset>';

echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Facilitati camere '.ucwords(strtolower($locatie['6'])).'
	</legend>';
echo'<div id="continut">
		'.$valoare62.''.$valoare63.''.$valoare64.''.$valoare65.''.$valoare66.''.$valoare67.''.$valoare68.''.$valoare69.''.$valoare70.''.$valoare71.''.$valoare72.''.$valoare73.'
	</div>';	
echo'</fieldset>';

$sql_tarife = mysql_query("SELECT * FROM tarife_cazare where id_locatie = ".$locatie['0']." ");
$inreg = mysql_num_rows($sql_tarife);
echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Tarife '.ucwords(strtolower($locatie['6'])).'
	</legend>';
if ($inreg == '0'){
echo'<div id="continut">
	Nu ne-au fost comunicate.
</div>';
}else{	
while ($tarife=mysql_fetch_row($sql_tarife)) {

echo'<div id="continut">
	In perioada: <b>'.$tarife['5'].'</b> / <b>'.$tarife['6'].'</b> pretul este: <b>'.$tarife['7'].'</b> lei /camera/noapte
</div>';
	}
}
echo'</fieldset>';

echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Politica renuntare la rezervare '.ucwords(strtolower($locatie['6'])).'
	</legend>';
if ($locatie['85'] == ''){$politica = 'Nu ne-au fost comunicate';}else{$politica = $locatie['85'];}	
echo'<div id="continut">
		'.ucfirst(strtolower($politica)).'
	</div>';	
echo'</fieldset>';
//// start solicita oferta ////
// echo'<a href="http://www.ro-cazare.info/solicita-oferta-agentie-turism.html">
// <center>
// <fieldset id="fieldsetdreapta">
	 // <legend id="legenddreapta" align="left">Solicita OFERTA</legend>
	 // <center><h3>Esti turist ?<br />Solicita ACUM cea mai buna <u>oferta</u> de cazare</h3></center>
// <img style="width: 156px;" src="../ro-cazare.info/img/solicita-oferta-cazare-174x174_2.png">	 
// </fieldset>
// </center>
// </a>';
//// end solicita oferta
echo'	<fieldset id="fieldsetcontinut1">
			<legend id="legendcontinut" align="left">
				Localizare '.ucwords(strtolower($locatie['6'])).'
			</legend>
				<div id="descriere">Zona: <b>'.ucwords(strtolower($locatie['78'])).'</b></div>
				<div id="descriere">Judet: <b>'.ucwords(strtolower($locatie['7'])).'</b></div>
				<div id="descriere">Oras: <b>'.ucwords(strtolower($locatie['8'])).'</b></div>
				<div id="descriere">Comuna: <b>'.ucwords(strtolower($locatie['9'])).'</b></div>
				<div id="descriere">Sat: <b>'.ucwords(strtolower($locatie['10'])).'</b></div>
				<div id="descriere">Adresa: <b>'.ucwords(strtolower($locatie['11'])).'</b></div>			
		</fieldset>';

	echo'<fieldset id="fieldsetcontinut1">
			<legend id="legendcontinut" align="left">
				Contact '.ucwords(strtolower($locatie['6'])).'
			</legend>
				<div id="descriere">Persoana contact: 
					<b>'.ucwords(strtolower($locatie['13'])).'</b>
				</div>
				<div id="descriere">Functia: <b>'.ucwords(strtolower($locatie['14'])).'</b></div>
				<div id="descriere">Telefon: <b>'.$locatie['15'].'</b></div>
				<div id="descriere">Telefon: <b>'.$locatie['16'].'</b></div>
				<div id="descriere">Fax: <b>'.$locatie['17'].'</b></div>
				<div id="descriere">Website: <a href="http://'.$locatie['18'].'" target="_blank"><b>Apasa aici</b></a></div>		
		</fieldset>';

echo'<a name="pareri"></a>';
echo'<fieldset id="fieldsetcontinut">
	<legend id="legendcontinut" align="left">
		Pareri, opinii si aprecieri '.ucwords(strtolower($locatie['6'])).'
	</legend>';
///////////// start comentarii /////////////
$sql = mysql_query("SELECT * FROM `comentarii` WHERE status = 'ACTIV' and id_locatie = '".$locatie['0']."' and media != '' ORDER BY id asc limit 0,10");
$nr_commentarii = mysql_num_rows($sql);	

echo'<table width="100%" align="center">
		<tr>
			<td colspan="2" align="center" valign="middle">
				<div id="facilitatititlu">Pareri, impresii, opinii '.ucwords(strtolower($locatie['6'])).'</div>
			</td>
		</tr>';
if($nr_commentarii != '0'){
	while($comment = mysql_fetch_row($sql)){
$cod_unic = $comment['20'];
echo'
	<tr>
		<td id="tdcomentarii1" width="200px" align="center" valign="middle">
			<div id="nota">'.ucwords(strtolower($comment['4'])).'</div>
			<div id="nota">'.round(($comment['16']),2).'</div>
		</td>
		<td id="tdcomentarii2" align="center" valign="middle">
			<table width="100%">
				<tr>
					<td>Amabilitate: '.$comment['6'].'</td>
					<td>Personal: '.$comment['7'].'</td>
					<td>Receptie: '.$comment['8'].'</td>
					<td>Confort: '.$comment['9'].'</td>
					<td>Facilitati: '.$comment['10'].'</td>
				</tr>
				<tr>
					<td>Servicii: '.$comment['11'].'</td>
					<td>Curatenie: '.$comment['12'].'</td>
					<td>Locatie: '.$comment['13'].'</td>
					<td>Imprejurimi: '.$comment['14'].'</td>
					<td>Calitate: '.$comment['15'].'</td>
				</tr>
				<tr>
					<td colspan="5" align="center"></td>
				</tr>
				<tr>';
					if ($comment['17'] == ''){
						echo'<td colspan="5" align="center"><b>Fara comentariu</b></td>';
					}else{	
						echo'<td colspan="5" id="tdcomentarii3">
								'.$comment['17'].'';
$sql_rasp = mysql_query("SELECT * FROM `comentarii` where status = 'ACTIV' and cod_unic = '".$cod_unic."' and media = '' order by id asc");
	while($comment_rasp = mysql_fetch_row($sql_rasp)){
echo'<div id="tdcomentarii4">'.htmlentities ($comment_rasp['17']).'</div>';	
		}								
			echo'			</td>';
					}
			echo'</tr>
			</table>
		</td>
	</tr>';
	}
	}else{
echo'<tr>  
		<td id="tdrotunjit" bgcolor="#5CFE89">
	<a href="http://'.$title.'/rezerva-cazare/cazare-'.strtolower($locatie['4']).'-'.strtolower($locatie['7']).'-'.strtolower($url_loc).'-'.strtolower($url_denumire).'-'.$locatie['0'].'.html#sus">Nu sunt aprecieri pentru acesta locatie de cazare. <b>APASA AICI</b> si fi primul care <B>Evalueaza Locatia</b>.</a>		
		</td>
	</tr>';
	}
echo'</table>';
///////////// end comentarii /////////////	
echo'</fieldset>';
echo'	</td>
	</tr>
</table>';
echo'<br /><br />
<table width="100%" cellspacing="4px" valign="bottom">
	<tr>
		<td align="center">
	<p>Ultima actualizare: '.$locatie['102'].'</p>	
	<p>Aceasta pagina a fost vizitata de <b>'.$locatie['97'].'</b> ori</p>	
	<p>Multumim si va dorim navigare placuta in site-ul nostru.</p>	
		</td>
	</tr>
</table>';	
}
?>