PageRenderTime 28ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/public_html/tematica_localitate_vechi.php

https://bitbucket.org/ocaziituristice/ocaziituristice.ro
PHP | 323 lines | 286 code | 28 blank | 9 comment | 107 complexity | 30b974f6242bf2c37ff384252bb13cd9 MD5 | raw file
  1. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/peste_tot.php");
  2. include_once($_SERVER['DOCUMENT_ROOT'].'/config/functii_pt_afisare.php');
  3. include_once($_SERVER['DOCUMENT_ROOT'].'/config/includes/class/class_sejururi/class_sejur_normal.php');
  4. if(!$_REQUEST['from']) $from=1; else $from=$_REQUEST['from'];
  5. if(!$nr_pe_pagina=$_COOKIE['nr_pe_pagina']) $nr_pe_pagina=10;
  6. $tara=desfa_link($_REQUEST['tari']);
  7. $id_tara=get_id_tara($tara);
  8. $link_tara=$_REQUEST['tari'];
  9. $den_tara=ucwords($tara);
  10. $titlu_pag=$den_tara;
  11. $cont_link='';
  12. $indice='oferte-'.$_REQUEST['tip'].'/';
  13. $tip=desfa_link($_REQUEST['tip']);
  14. $id_tip=get_id_tip_sejur($tip);
  15. if($_REQUEST['zone']) {
  16. $zona=desfa_link($_REQUEST['zone']);
  17. $den_zona=ucwords($zona);
  18. $id_zona=get_id_zona($zona, $id_tara);
  19. $link_zona=$_REQUEST['zone'];
  20. $cont_link=$cont_link.'&zone='.$link_zona;
  21. $titlu_pag=ucwords($tip).' '.ucwords($zona).', '.$den_tara;
  22. $titlu_h2=ucwords($tip).' '.ucwords($zona);
  23. $titlu_h3=ucwords($tip).' '.ucwords($zona);
  24. $cuvant_cheie=$titlu_pag;
  25. } else $id_zona='';
  26. if($_REQUEST['oras']) {
  27. $oras=desfa_link($_REQUEST['oras']);
  28. if(($oras=='lara' || $oras=='kundu') && $tara=='turcia') {
  29. header("HTTP/1.0 301 Moved Permanently");
  30. header("Location: ".$sitepath.'oferte-'.$_REQUEST['tip'].'/turcia/antalya/lara_d_kundu/');
  31. exit();
  32. }
  33. $id_localitate=get_id_localitate($oras, $id_zona);
  34. $sel="select denumire, descriere_seo, titlu_seo, cuvinte_cheie_seo, luni_plecari, data_plecare from localitati where id_localitate = '".$id_localitate."' ";
  35. $que=mysql_query($sel) or die(mysql_error());
  36. $row=mysql_fetch_array($que);
  37. @mysql_fetch_array($que);
  38. $luni_plecari=explode(',', $row['luni_plecari']);
  39. $dates_plecare = $row['data_plecare'];
  40. $link_oras=$_REQUEST['oras'];
  41. $cont_link=$cont_link.'&oras='.$link_oras;
  42. $den_loc=$row['denumire'];
  43. $titlu_pag=ucwords($tip).' '.$den_loc.', '.$den_tara;
  44. $titlu_h2=ucwords($tip).' '.$row['denumire'];
  45. $titlu_h3=ucwords($tip).' '.$row['denumire'];
  46. $cuvant_cheie=$titlu_pag;
  47. } else $id_localitate='';
  48. if((!$id_tip && !$id_zona && !$id_tara && !$id_localitate) || !$id_zona || !$id_tara || !$id_localitate) {
  49. header("HTTP/1.0 404 Not Found");
  50. //header("Location: ".$sitepath.'404.php');
  51. $handle = curl_init($sitepath.'404.php');
  52. curl_exec($handle);
  53. exit();
  54. } elseif(!$id_tip) {
  55. header("HTTP/1.0 301 Moved Permanently");
  56. header("Location: ".$sitepath.'sejur-'.$_REQUEST['tari'].'/'.$_REQUEST['zone'].'/'.$_REQUEST['oras']."/");
  57. exit();
  58. }
  59. $selSEO="SELECT * FROM seo WHERE id_tip = '".$id_tip."' AND id_oras = '".$id_localitate."' ";
  60. $queSEO=mysql_query($selSEO) or die(mysql_error());
  61. $rowSEO=mysql_fetch_array($queSEO);
  62. @mysql_free_result($queSEO);
  63. if($rowSEO['h1']) $titlu_pag=$rowSEO['h1'];
  64. if($rowSEO['h2']) $titlu_h2=$rowSEO['h2'];
  65. if($rowSEO['h3']) $titlu_h3=$rowSEO['h3'];
  66. if($rowSEO['cuvant_cheie']) $cuvant_cheie=$rowSEO['cuvant_cheie'];
  67. $tip_fii=get_id_tip_sejur_fii($id_tip);
  68. $iduri="'".$id_tip."'";
  69. if($tip_fii['id_tipuri']) $iduri=$iduri.','.$tip_fii['id_tipuri'];
  70. $link_p=$sitepath.'oferte-'.$_REQUEST['tip'].'/'.$link_tara.'/'.$link_zona.'/'.$link_oras.'/';
  71. $link=$link_p;
  72. $err=0; if(!$_REQUEST['data-plecare']) $link='?optiuni=da'; else $link='?data-plecare='.$_REQUEST['data-plecare'];
  73. //optiuni____
  74. if($_GET['early-booking']=='da') {
  75. $early='da';
  76. $link=$link.'&early-booking=da';
  77. } else $early='';
  78. if(isset($_COOKIE['grad_ocupare'])) {
  79. $grdocup = explode("*", $_COOKIE['grad_ocupare']);
  80. $details_transport = get_details_transport($grdocup[8]);
  81. }
  82. if(($_REQUEST['transport'] && $_REQUEST['transport']<>'toate') or $grdocup[8]!='') {
  83. if($details_transport['denumire']!='') $_REQUEST['transport'] = fa_link($details_transport['denumire']);
  84. $trans=desfa_link(str_replace('_','-',$_REQUEST['transport']));
  85. $transport=$_REQUEST['transport'];
  86. $id_transport=get_id_transport($trans);
  87. if($id_transport<1) $err++;
  88. $link=$link."&transport=".$_REQUEST['transport'];
  89. } else {
  90. $trans='toate';
  91. $transport=$trans;
  92. $id_transport='';
  93. }
  94. if($_REQUEST['plecare-avion'] && $_REQUEST['plecare-avion']<>'toate') {
  95. $plecare_avion=$_REQUEST['plecare-avion'];
  96. $plecare=desfa_link($plecare_avion);
  97. $id_loc_plecare_av=get_id_localitate($plecare, '');
  98. if($id_loc_plecare_av<1) $err++;
  99. $link=$link."&plecare-avion=".$_REQUEST['plecare-avion'];
  100. } else {
  101. $plecare_avion='toate';
  102. $id_loc_plecare_av='';
  103. }
  104. if($_REQUEST['plecare-autocar'] && $_REQUEST['plecare-autocar']<>'toate') {
  105. $plecare_autocar=$_REQUEST['plecare-autocar'];
  106. $plecare=desfa_link($plecare_autocar);
  107. $id_loc_plecare_aut=get_id_localitate($plecare, '');
  108. if($id_loc_plecare_aut<1) $err++;
  109. $link=$link."&plecare-autocar=".$_REQUEST['plecare-autocar'];
  110. } else {
  111. $plecare_autocar='toate';
  112. $id_loc_plecare_aut='';
  113. }
  114. if($_REQUEST['stele'] && $_REQUEST['stele']<>'toate') {
  115. $stele=explode(',',$_REQUEST['stele']);
  116. $nr_stele=$_REQUEST['stele'];
  117. if(!$nr_stele) $err++;
  118. $link=$link."&stele=".$_REQUEST['stele'];
  119. } else {
  120. $stele='toate';
  121. $nr_stele='';
  122. }
  123. if($_REQUEST['masa'] && $_REQUEST['masa']<>'toate') {
  124. $masa=explode(',',$_REQUEST['masa']);
  125. foreach($masa as $key_masa=>$value_masa) {
  126. $Lmasa[$key_masa]=$value_masa;
  127. }
  128. $Rmasa=$_REQUEST['masa'];
  129. $nmasa=desfa_link($_REQUEST['masa']);
  130. if(ereg('[^a-z0-9-]', $_REQUEST['masa'])) $err++;
  131. $link=$link."&masa=".$_REQUEST['masa'];
  132. } else {
  133. $masa='toate';
  134. $nmasa='';
  135. $Lmasa=$masa;
  136. }
  137. if($_REQUEST['distanta'] && $_REQUEST['distanta']<>'toate') {
  138. $distanta=$_REQUEST['distanta'];
  139. $ds=explode('-',trim($distanta));
  140. if(ereg('[^a-z0-9-]', $_REQUEST['distanta'])) $err++;
  141. $link=$link."&distanta=".$distanta;
  142. } else {
  143. $distanta='toate';
  144. $ds=array();
  145. }
  146. if($_REQUEST['concept'] && $_REQUEST['concept']<>'toate') {
  147. $concept=explode(',',$_REQUEST['concept']);
  148. foreach($concept as $key_concept=>$value_concept) {
  149. $Lconcept[$key_concept]=$value_concept;
  150. }
  151. $Rconcept=$_REQUEST['concept'];
  152. $nconcept=desfa_link($_REQUEST['concept']);
  153. if(ereg('[^a-z0-9-]', $_REQUEST['concept'])) $err++;
  154. $link=$link."&concept=".$_REQUEST['concept'];
  155. } else {
  156. $concept='toate';
  157. $nconcept='';
  158. $Lconcept=$concept;
  159. }
  160. if($_REQUEST['facilitati'] && $_REQUEST['facilitati']<>'toate') {
  161. $facilitati = explode(',',$_REQUEST['facilitati']);
  162. foreach($facilitati as $key_facilitati => $value_facilitati) {
  163. $Lfacilitati[$key_facilitati] = $value_facilitati;
  164. }
  165. $Rfacilitati = $_REQUEST['facilitati'];
  166. $nfacilitati = desfa_link($_REQUEST['facilitati']);
  167. if(ereg('[^a-z0-9-]', $_REQUEST['facilitati'])) $err++;
  168. $link = $link."&facilitati=".$_REQUEST['facilitati'];
  169. } else {
  170. $facilitati = 'toate';
  171. $nfacilitati = '';
  172. $Lfacilitati = $facilitati;
  173. }
  174. if($_REQUEST['data-plecare']) {
  175. $din_luna=$_REQUEST['data-plecare'];
  176. $timeout = time() + 60 * 60 * 24 * 5;
  177. setcookie('lona_plecare', $din_luna, $timeout);
  178. }
  179. if(isset($_COOKIE['grad_ocupare'])) {
  180. $checkin = $grdocup[0];
  181. $link = $link."&checkin=".$checkin;
  182. } else if($_REQUEST['checkin']) {
  183. $checkin = $_REQUEST['checkin'];
  184. $link = $link."&checkin=".$checkin;
  185. }
  186. $luna=array('01'=>'Ianuarie', '02'=>'Februarie', '03'=>'Martie', '04'=>'Aprilie', '05'=>'Mai', '06'=>'Iunie', '07'=>'Iulie', '08'=>'August', '09'=>'Septembrie', '10'=>'Octombrie', '11'=>'Noiembrie', '12'=>'Decembrie'); ?>
  187. <?php
  188. if($rowSEO['title_seo']=="") {
  189. $metas_title = 'Oferte '.ucwords($tip).' '.$den_loc.' - '.$den_zona.' '.$den_tara;
  190. } else {
  191. $metas_title = $rowSEO['title_seo'];
  192. }
  193. if($rowSEO['description']=="") {
  194. $metas_description = 'Cazare '.ucwords($tip).' '.$den_loc.', oferte '.ucwords($tip).' '.$den_loc.', cazare '.$den_zona.', hoteluri '.$den_loc.', hoteluri '.$den_zona.' , oferte '.$den_zona.', cazari';
  195. } else {
  196. $metas_description = $rowSEO['description'];
  197. }
  198. if($rowSEO['keywords']=="") {
  199. $metas_keywords = ucwords($tip).' '.$den_loc.', oferte sejururi '.$den_loc.', cazare '.$den_loc;
  200. } else {
  201. $metas_keywords = $rowSEO['keywords'];
  202. }
  203. $link_of_pag=w3c_and($link);
  204. if($_REQUEST['ordonare']) $link=$link."&ordonare=".$_REQUEST['ordonare'];
  205. if($link=='?optiuni=da') $link='';
  206. $oferte=new AFISARE_SEJUR_NORMAL();
  207. $oferte->setAfisare($from, $nr_pe_pagina);
  208. $oferte->config_paginare('nou');
  209. if($early=='da') $oferte->setEarly('da');
  210. if($link_tara) $oferte->setTari($link_tara);
  211. if($link_zona) $oferte->setZone($link_zona);
  212. if($link_oras) $oferte->setOrase($link_oras);
  213. if($id_tip) $oferte->setTipOferta($_REQUEST['tip']);
  214. if($_REQUEST['ordonare']) {
  215. $tipO=explode('-',$_REQUEST['ordonare']);
  216. if($tipO[0]=='tip_pret') $oferte->setOrdonarePret($tipO[1]);
  217. elseif($tipO[0]=='tip_numH') $oferte->setOrdonareNumeH($tipO[1]); }
  218. $watermark_cautare='Cauta hoteluri din '.$den_tara;
  219. if($_REQUEST['nume_hotel'] && $_REQUEST['nume_hotel']<>$watermark_cautare) $oferte->setCautaHotel($_REQUEST['nume_hotel']);
  220. if($_REQUEST['transport'] && $_REQUEST['transport']<>'toate') $oferte->setTransport($_REQUEST['transport']);
  221. if($_REQUEST['stele'] && $_REQUEST['stele']<>'toate') $oferte->setStele($_REQUEST['stele']);
  222. if($_REQUEST['concept'] && $_REQUEST['concept']<>'toate') $oferte->setConcept($_REQUEST['concept']);
  223. if($_REQUEST['masa'] && $_REQUEST['masa']<>'toate') $oferte->setMasa($_REQUEST['masa']);
  224. if($din_luna) $oferte->setLunaPlecare($din_luna);
  225. if($checkin) $oferte->setCheckIn($checkin);
  226. if($id_loc_plecare_av) $oferte->setPlecareAvion($id_loc_plecare_av);
  227. if($id_loc_plecare_aut) $oferte->setPlecareAutocar($id_loc_plecare_aut);
  228. if(sizeof($ds)==3) $oferte->setDistanta($ds);
  229. $oferte->initializeaza_pagini($link_p, 'pag-###/', $link);
  230. $nr_hoteluri=$oferte->numar_oferte();
  231. $meta_pages = $oferte->meta_pages(NULL, NULL, $_REQUEST['oras']);
  232. $meta_prev = $meta_pages['meta_prev'];
  233. $meta_next = $meta_pages['meta_next'];
  234. $meta_canonical = '<link rel="canonical" href="'.$meta_pages['link_canonical'].'" />';
  235. $afisare_info = '<strong>'.ucwords($tip).' '.$den_loc.'</strong>';
  236. if($checkin) $afisare_info .= ' cu plecare in ziua <strong>'.date("d.m.Y",strtotime($checkin)).'</strong> (&plusmn; 4 zile)';
  237. if($nr_stele) {
  238. $afisare_info .= ' de <strong>'.$nr_stele;
  239. if($nr_stele>1) $afisare_info .= ' stele'; else $afisare_info .= ' stea';
  240. $afisare_info .= '</strong>';
  241. }
  242. if($id_transport) {
  243. if($id_transport==1) $afisare_info .= ' <strong>'.$trans.'</strong>'; else $afisare_info .= ' cu transport <strong>'.$trans.'</strong>';
  244. }
  245. if($nmasa) $afisare_info .= ' si masa <strong>'.$nmasa.'</strong> inclusa';
  246. if($plecare_avion<>'toate') $afisare_info .= ', plecare din '.ucwords($plecare_avion);
  247. if($plecare_autocar<>'toate') $afisare_info .= ', plecare din '.ucwords($plecare_autocar);
  248. if($nfacilitati) $afisare_info .= ', cu <strong>'.$nfacilitati.'</strong>';
  249. if($nconcept) $afisare_info .= ', pentru <strong>'.$nconcept.'</strong>';
  250. if($_REQUEST['optiuni']) {
  251. $metas_title = strip_tags($afisare_info);
  252. }
  253. ?>
  254. <!DOCTYPE html>
  255. <html lang="ro">
  256. <head>
  257. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/header_charset.php"); ?>
  258. <?php /*?><?php if($rowSEO['title_seo']) {
  259. $keyword_nice[1]=$rowSEO['title_seo'];
  260. $keyword_nice[0]=$rowSEO['description'];
  261. $keyword_nice[2]=$rowSEO['keywords'];
  262. } else {
  263. $keyword_nice[1]="Oferte ".ucwords($tip)." ".$den_zona." localitatea ".$den_loc.' - '.$den_tara.', cazare '.$den_loc;
  264. $keyword_nice[0]='Cazare '.ucwords($tip).' '.$den_loc.', oferte '.ucwords($tip).' '.$den_loc.', cazare '.$den_zona.', hoteluri '.$den_loc.', hoteluri '.$den_zona.' , oferte '.$den_zona.', cazari';
  265. $keyword_nice[2]='Destinatii '.ucwords($tip).' '.$den_tara.' '.$den_zona.', oferte '.ucwords($tip).' '.$den_loc.', cazare '.ucwords($tip).' '.$den_loc.', sejururile , sejururi'; } ?><?php */?>
  266. <title><?php echo $metas_title; ?></title>
  267. <meta name="description" content="<?php echo $metas_description; ?>" />
  268. <meta name="keywords" content="<?php echo $metas_keywords; ?>" />
  269. <?php $tara_c=desfa_link($_GET['tari']);
  270. /*if($_SERVER['REQUEST_URI']=="/oferte-".fa_link_vechi($tip_c)."/".fa_link_vechi($tara_c)."/".fa_link_vechi($zona_c)."/".fa_link_vechi($oras_c)."/") { ?><link rel="canonical" href="<?php echo $sitepath."oferte-".fa_link($tip_c)."/".fa_link($tara_c)."/".fa_link($zona_c)."/".fa_link($oras_c)."/"; ?>" /> <?php }
  271. if($_REQUEST['from'] || ($id_transport || $nr_stele || $nmasa || $din_luna || ($distanta && $distanta<>'toate') || $_REQUEST['ordonare'])) {*/ ?><?php /*?><link rel="canonical" href="<?php echo $link_p; ?>" /><?php */?><?php /*}*/ ?>
  272. <?php echo $meta_canonical." ".$meta_prev." ".$meta_next."\n"; ?>
  273. <?php include($_SERVER['DOCUMENT_ROOT'].'/includes/addins_head.php'); ?>
  274. </head>
  275. <body onload="load_submenu()">
  276. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/header/new_header.php"); ?>
  277. <div id="middle">
  278. <div id="middleInner">
  279. <div class="breadcrumb">
  280. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/navigator_new.php"); ?>
  281. </div>
  282. <div class="NEW-column-full">
  283. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/sejururi/localitate_new1.php"); ?>
  284. </div>
  285. <?php //include_once($_SERVER['DOCUMENT_ROOT']."/includes/newsletter_abonare.php"); ?>
  286. <?php //include_once($_SERVER['DOCUMENT_ROOT']."/includes/dreapta/circuite_tari.php"); ?>
  287. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/oferte_vizualizate.php"); ?>
  288. </div>
  289. </div>
  290. <div id="footer">
  291. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/footer.php"); ?>
  292. </div>
  293. <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/addins_bodybottom.php"); ?>
  294. </body>
  295. </html>