PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/DEV/DISPLAY/modules/annonce_content.php

https://github.com/chrisbst35/LI_LEMONDE
PHP | 438 lines | 345 code | 71 blank | 22 comment | 55 complexity | c4e3d8c0a9b1599e6dd560c17a441466 MD5 | raw file
  1. <?php
  2. if (!isset($_GET['page']))
  3. $page = 0;
  4. else
  5. $page = $_GET['page'];
  6. //default town
  7. $loc = ucwords2(strtolower($ad["default_town"]));
  8. $gallery = ($_global['gallery'] != 0) ? "&gallery=1" : "";
  9. $ficheVisite = 'fiche_visite.php?id=' . $ad["id"] . "&univers=" . $_global['univers'];
  10. if ($_global['gallery'] != 0) {
  11. $ficheVisite .= '&gallery=' . $_global['gallery'];
  12. }
  13. $ficheVisite = add_parameters($ficheVisite);
  14. $share_param = array();
  15. $share_param[] = $ad["id"];
  16. $share_param[] = $ag["id"];
  17. $share_param[] = $ad["logicode"];
  18. $share_param = "['" . implode("', '", $share_param) . "']";
  19. $str_seo = "";
  20. switch ($_global["univers"]) {
  21. case 1 :$str_seo = "Achat ";
  22. break;
  23. case 2 :$str_seo = "Location ";
  24. break;
  25. case 8 :$str_seo = "Colocation ";
  26. break;
  27. }
  28. $str_seo .= $ad['property_type'] . " " . $ad['default_town_2'] . " " . $ad['lzip'];
  29. if (!isset($urlWebsite))
  30. $urlWebsite = $ag['site']; // Patch if not from detail.php
  31. if ($_global['dev'] == 1 && isset($_GET['cmt']) && $_GET['cmt'] == 'on') {
  32. ?>
  33. <!-- begin : <?php echo __FILE__; ?> -->
  34. <?php } ?>
  35. <?php
  36. // debug
  37. if ($_global["debug"] == 1) {
  38. echo 'Description de l\'annonce :<br />';
  39. print_r($ad);
  40. echo '<hr />';
  41. echo 'Description de l\'agence :<br />';
  42. print_r($ag);
  43. echo '<hr />';
  44. }
  45. // Déclaration de la variable $pagerefxiti qui serat transmit
  46. // à la fonction call_frm_contact_agence() // intertitiel contenant l'iframe
  47. $pagerefxiti = "page-detail";
  48. $title_ft = "J'ai trouvé sur Logic-Immo.com : " . $ad["property_type"] . " - " . ($ad["default_town"] == "" ? $ad["lzip"] : $ad["default_town"] . " (" . $ad["lzip"] . ")") . ($ad["nb_rooms"] > 0 ? " - " . $ad["nb_rooms"] . " " . LABEL_COMMON_ROOMS_UNIT : "") . ($ad["area"] > 0 ? " - " . $ad["area"] . " " . LABEL_COMMON_AREA_UNIT . " " . LABEL_RESULTS_ABOUT : "");
  49. $url_logic = str_replace("http://", "", to_url($_global["uri"]));
  50. $uri_logic = to_url($_global["uri"]);
  51. $url_fcb = "http://www.facebook.com/sharer.php?";
  52. $url_twt = "http://twitter.com/share?";
  53. switch ($_global['univers']) {
  54. case 1:
  55. default:
  56. $xitiId_ContactAgency = 226;
  57. $xitiContactAnchorLeft = 235;
  58. $xitiContactAnchorRight = 233;
  59. $xitiIdShowTel = 222;
  60. break;
  61. case 2:
  62. $xitiId_ContactAgency = 227;
  63. $xitiContactAnchorLeft = 236;
  64. $xitiContactAnchorRight = 234;
  65. $xitiIdShowTel = 224;
  66. break;
  67. case 8:
  68. $xitiId_ContactAgency = 227;
  69. $xitiIdShowTel = 224;
  70. break;
  71. }
  72. // TODO : XITI
  73. //$aInfosPublisherClickTel = getXitiPublisherInfos($_global['univers'], $ad, $ag, 'CLIC_TEL', 'FA');
  74. //$sXitiPublisherClickTel = getXitiPublisherString(array($aInfosPublisherClickTel));
  75. // blocs contact agence par mail et tel
  76. $idx = ''; // servait pour les PR, pas ici
  77. $id1 = 'container_contact_agc_tel_mail1' . $ad["id"] . $idx;
  78. $id2 = 'container_contact_agc_tel_mail' . $ad["id"] . $idx;
  79. $telphone_agc = trim($ag["tel"]) != "" ? $ag["tel"] . " <font style=\"font-size: 8px;\">(3)</font>" : "";
  80. $contact_agc = $ag['id'] . '&id_annonce=' . $ad['id'] . '&pageref=' . $_global['self'];
  81. $from_to_js = array("'" => "\'", '"' => "\'", '&#039;' => "\'", '&rsquo;' => "\'", '&quot;' => "\'", " & " => " et ");
  82. $default_text = strtr($ad["default_text"], $from_to_js);
  83. $default_text = utf8_encode(html_entity_decode($default_text));
  84. $default_text = str_replace('&', '', $default_text); //Supprimer les derniers & qui subsistent
  85. $default_sector = strtr($ad["default_sector"], $from_to_js);
  86. $default_sector = utf8_encode(html_entity_decode($default_sector));
  87. $default_sector = str_replace('&', '', $default_sector); //Supprimer les derniers & qui subsistent
  88. $gdm_string = array();
  89. $gdm_string[] = $ag["id"];
  90. $gdm_string[] = $ag["id_presto"];
  91. $gdm_string[] = $ad["id"];
  92. $gdm_string[] = xiti_string($ad["reference"]);
  93. $gdm_string[] = $ad["property_type"];
  94. $gdm_string[] = $ad["nb_rooms"];
  95. $gdm_string[] = $ad["area"];
  96. $gdm_string[] = base64_encode($default_text);
  97. $gdm_string[] = base64_encode($default_sector);
  98. $gdm_string[] = $ad["lzip"];
  99. $gdm_string[] = $ad["price"];
  100. $gdm_string[] = ($ad["photos_count"] > 0 ? $ad["photos_id"][0] : "");
  101. $gdm_string[] = base64_encode($ag["email"] != "" ? $ag["email"] : "contact@logic-immo.com");
  102. $gdm_string[] = $ag["spoken_language"];
  103. $gdm_string[] = $ad["num_mandat"];
  104. $gdm_string[] = $ad["type_transaction"];
  105. $gdm_string[] = $ad["id_bien"];
  106. $gdm_string[] = $ad["id_bien_programme"];
  107. //DISTRICT
  108. $gdm_string[] = $ad["district_id_1"];
  109. $gdm_string[] = $ad["district_id_2"];
  110. $gdm_string[] = $ad["district_id_3"];
  111. $gdm_string[] = addslashes(html_entity_decode($ad["district_name_1"], ENT_QUOTES));
  112. $gdm_string[] = addslashes(html_entity_decode($ad["district_name_2"], ENT_QUOTES));
  113. $gdm_string[] = addslashes(html_entity_decode($ad["district_name_3"], ENT_QUOTES));
  114. //
  115. $gdm_string = urlencode("['" . implode("', '", $gdm_string) . "']");
  116. // blocs contact agence par mail et tel (fin)
  117. // Construction des indicateurs globaux Xiti
  118. $sXitiIndicGlobaux = getXitiIndicGlobaux('Affichage_telephone_Fiche_Annonce_LeMonde', $_global['univers'], $ad, $ag);
  119. //$aInfosPublisherClickTel = getXitiPublisherInfos($_global['univers'], $ad, $ag, 'CLIC_TEL', 'FA');
  120. //$sXitiPublisherClickTel = getXitiPublisherString(array($aInfosPublisherClickTel));
  121. //echo $sXitiIndicGlobaux;
  122. ?>
  123. <div id="detail">
  124. <!-- debut bloc haut annonce : features + prix -->
  125. <div class="top-bloc-annce">
  126. <div id="detail-title">
  127. <?php
  128. if ($ad["default_town_2"] == "") {
  129. ?>
  130. <h2><span id="title-type"><?= $ad["property_type"]; ?> <?= $ad["lzip"] ?></span></h2>
  131. <?php
  132. } else {
  133. ?>
  134. <h2><span id="title-type"><?= $ad["property_type"]; ?> </span><br /><span id="title-locality"><?= $ad["default_town_2"]; ?><? if (!empty($ad["lzip"])) { ?> (<?= $ad["lzip"] ?>)<? } ?></span></h2>
  135. <?php
  136. }
  137. ?>
  138. </div>
  139. <div class="div_price">
  140. <!-- prix -->
  141. <?= ($ad["real_price"] >= AD_PRICE_LIMIT ? LABEL_COMMON_NC : $ad["price"] . " " . LABEL_COMMON_PRICE_UNIT); ?>
  142. <!-- mention -->
  143. <?= ($_global["univers"] == 1 && $ag["franchising_agency"] != "LAFORET" && $ad["property_type_id"] != 4 && $ad["property_type_id"] != 6 ? "<font style=\"font-size: 9px;\">&nbsp;(1)</font>" : ""); ?>
  144. <?= ($_global["univers"] == 2 ? "<font style=\"font-size: 9px;\">&nbsp;(1)</font>" : ""); ?>
  145. <?php
  146. if (isset($ad['district_to_use']) && $ad['district_to_use'] != '') {
  147. ?>
  148. <h3 class="districts">
  149. <a onclick="<?= getXitiClick(($_global['univers'] == 2 ? 240 : 238)) ?>" id="districts_tips" class="tooltip" href="#poi_anchor" title="&nbsp;Découvrez le quartier de ce bien <img class='tip-top' src='/images/detail/tip-top.png' /><?= $ad['district_to_use']; ?>" >
  150. <?= $ad['district_to_use']; ?>
  151. </a>
  152. </h3>
  153. <?php } ?>
  154. </div>
  155. <div class="calage"></div>
  156. </div>
  157. <!-- fin bloc haut annonce : features + prix -->
  158. <!-- debut contenu annonce -->
  159. <div id="detail-content">
  160. <!-- debut photo defaut + vignette -->
  161. <div id="photo-annonce">
  162. <div id="photo-annonce-default">
  163. <img onLoad="resizePhoto();" align="center" id="default_ad_img" class="<?= ($ad["photos"][0] != '') ? 'default_ad_img' : '' ?>" src="<?= ($ad["photos"][0] != '') ? $ad["photos"][0] : get_urlmmf("/detailV2/noPhoto" . ($ad['type_transaction'] == 5 ? "Neuf" : "") . ".jpg") ?>" alt="<?= $str_seo; ?>" />
  164. </div>
  165. <?php if ($ad["photos_count"] > 0) { ?>
  166. <div id="photo-annonce-vignette">
  167. <div id="photos-carrousel-content" class="carousel">
  168. <div id="nav_photo" class="inner">
  169. <?= ($ad["photos_count"] > 4) ? '<div class="pictos-prev"></div>' : '' ?>
  170. <?php
  171. for ($i = 0; $i < $ad["photos_count"]; $i++) {
  172. ?>
  173. <div class="photo" rel="lightbox[galerie]">
  174. <a href="<?= $ad["photos_multibox"][$i]; ?>" id="mb<?= ($i + 1); ?>" class="img_small" rel="shadowbox[photos]" >
  175. <img width="64" height="53" id="img_an_<?= $i; ?>" src="<?= $ad["thumbs"][$i]; ?>" name="<?= $ad["photos"][$i]; ?>" alt="<?= ($ad["default_town_2"] == "" ? ucfirst(strtolower($ad["property_type"])) . " " . $ad["lzip"] : ucfirst(strtolower($ad["property_type"])) . " " . ucwords2(strtolower($ad["default_town_2"]))); ?>" title="Agrandir"/>
  176. </a>
  177. </div>
  178. <?php
  179. }
  180. // Visites virtuelles
  181. if (count($ad["mmf"]) > 0) {
  182. foreach ($ad["mmf"] as $key => $items) {
  183. foreach ($items as $item) {
  184. switch ($key) {
  185. // video
  186. case 1 :
  187. //$options = "rel=\"width:320,height:262\" ";
  188. $options = "rel=\"shadowbox[photos];player=iframe;width=950;\" ";
  189. $item = URL_VIDEOS_AD . URL_FLUX_MOBIVILLAGE . $item;
  190. break;
  191. // visite virtuelle
  192. case 4 :
  193. if (strpos($item, 'youtube.fr') !== false || strpos($item, 'youtube.com') !== false) {
  194. //cas ou on a des url youtube avec des parametres
  195. //ex d'url : http://www.youtube.com/watch?v=NG1dHgAXgJY
  196. //pour que la shadowbox fonctionne il faut transphormer l'url en http://www.youtube.com/v/NG1dHgAXgJY
  197. $options = "rel=\"shadowbox[photos];player=swf;width=500;height=400;\"";
  198. $item = str_replace('watch?v=', '/v/', $item);
  199. } elseif (strpos($item, 'batch.ac3-distribution.com') !== false) {
  200. //cas pour les vidéos youtube qui vienne de batch.ac3-distribution.com
  201. //exemple d'url http://batch.ac3-distribution.com/catalog/admin/url_youtube.php?embed=NG1dHgAXgJY comme pour le cas precédent il faut reconstruir l'url de type http://www.youtube.com/v/NG1dHgAXgJY
  202. $options = "rel=\"shadowbox[photos];player=swf;width=530;height=400;\"";
  203. preg_match('#embed=(.+)#', $item, $a_array);
  204. $s_id_video = $a_array[1];
  205. $item = "http://www.youtube.com/v/" . $s_id_video;
  206. } else { //cas normal on inclus l'url dans une iframe
  207. $options = "rel=\"shadowbox[photos];player=iframe;width=950;\"";
  208. }
  209. break;
  210. }
  211. ?>
  212. <div class="photo">
  213. <a href="<?= $item; ?>" id="mb<?= ($i + 1); ?>" class="mb mmf" <?= $options; ?> title="<?= constant("LABEL_COMMON_MMF_LABEL_" . $key); ?>" >
  214. <img width="64" height="53" id="img_an_<?= $i; ?>" src="<?= get_urlmmf("/common/default_mmf_" . $key . ".gif"); ?>" name="<?= get_urlmmf("/detailV2/noPhoto.jpg"); ?>" />
  215. </a>
  216. </div>
  217. <?php
  218. $i++;
  219. }
  220. }
  221. }
  222. ?>
  223. <?php if ($ad["photos_count"] > 4) { ?><div class="pictos-next"></div><?php } ?>
  224. </div>
  225. </div>
  226. </div>
  227. <?php } ?>
  228. </div>
  229. <!-- fin photo defaut + vignette -->
  230. <!-- debut bloc description + contact -->
  231. <div class="right-annce-content">
  232. <!-- titre annonce -->
  233. <div id="detail-features">
  234. <span class="detail-features-localite"><?= $ad["default_sector"] ?></span>
  235. <br />
  236. <span class="detail-features-type"><?= $ad["features"]; ?></span>
  237. </div>
  238. <!-- debut description annonce -->
  239. <div id="description">
  240. <div id="description-annonce">
  241. <p>
  242. <?php
  243. if ($ad['type_transaction'] == '5') {
  244. print $ad['seo'];
  245. }
  246. ?>
  247. <?= $ad["default_text"]; ?>
  248. </p>
  249. <?php if ($ad['agency_rent_fees'] && $ad['agency_rent_fees'] > 0 && $_global["univers"] == 2) { ?>
  250. <br/>
  251. <p>Honoraires TTC en sus : <?= $ad['agency_rent_fees'] ?>&euro;</p>
  252. <?php
  253. }
  254. echo $str_seo;
  255. ?>
  256. </div>
  257. <!-- debut contacter agence-->
  258. <div class="cadre-contact-agc">
  259. <div class="agency-info">
  260. <div class="annce_contact">
  261. <a class="spir_btn spir_btn-blue" onclick="<?= getXitiClick($xitiContactAnchorLeft); ?>" href="#bloc-info-agence" rel="nofollow" title="Contacter par email">
  262. Contacter par mail
  263. </a>
  264. <a id="btn_tel" class="spir_btn spir_btn-blue" onclick="manage_div('btn_tel', 'btn_tel2', '<?= $ad['id_bien'] ?>', '<?= $ag['id_presto'] ?>', '<?= $sXitiIndicGlobaux ?>');" rel="nofollow" title="Cliquer pour voir le numéro de téléphone de l’agence">
  265. Voir le numéro
  266. </a>
  267. <span id="btn_tel2" class="btn_tel2 spir_btn spir_btn-blue" ><?= $telphone_agc; ?></span>
  268. <div class="calage"></div>
  269. </div>
  270. </div>
  271. </div>
  272. <!-- fin contacter agence-->
  273. </div>
  274. <!-- fin description annonce -->
  275. </div>
  276. <!-- fin bloc description + contact -->
  277. <div class="calage"></div>
  278. <!-- debut fiche technique -->
  279. <?php
  280. include("modules/annonce_fiche_technique.php");
  281. ?>
  282. <!-- fin fiche technique -->
  283. <div class="calage"></div>
  284. <!-- debut DPE -->
  285. <?php if ($ad["dpe_energy"]) { ?>
  286. <div class="bloc-dpe">
  287. <div class="description-date">
  288. <?= ($ad["created_on"] != '' ? '<div>Mis en ligne : ' . $ad["created_on"] . '</div>' : '') ?>
  289. <?= ($ad["modified_on"] != '' ? '<div>Mis à jour : ' . $ad["modified_on"] . '</div>' : '') ?>
  290. <?= ($ad['reference'] != '') ? '<div>R&eacute;f&eacute;rence : ' . $ad['reference'] . '</div>' : '' ?>
  291. </div>
  292. <p class="detail-tech-title">CONSOMMATION ÉNERGÉTIQUE : <?= ($ad['dpe_energy_val'] >= 0 ? $ad['dpe_energy_val'] : '') ?></p>
  293. <div id="detail-dpe">
  294. <div>
  295. <img src="<?php echo get_urlmmf('detailV2/dpe/dpe_' . strtoupper($ad["dpe_energy"])); ?>_b.gif" alt="<?= LABEL_DETAIL_DPE; ?>">
  296. </div>
  297. </div>
  298. <div class="calage"></div>
  299. <a class="toggler" id="toggler" href="javascript:toggle_dpe(1)">
  300. Cliquer ici pour découvrir le DPE :
  301. </a>
  302. <div id="dpe-pyramid" style="display: none; margin: 0 0 10px 0;">
  303. <img src="<?= get_urlmmf('dpe/dpe_' . strtoupper($ad["dpe_energy"]) . '_b.gif'); ?>" />
  304. </div>
  305. </div>
  306. <?php } ?>
  307. <!-- fin DPE -->
  308. <div class="calage"></div>
  309. </div>
  310. </div>
  311. <script type="text/javascript">
  312. if($('districts_tips')) {
  313. //create the tooltips
  314. var tipz = new agTips ('.tooltip',{
  315. className: 'tip',
  316. fixed: false,
  317. hideDelay: 50,
  318. showDelay: 50
  319. });
  320. }
  321. /* nouvelle galery avec les precedent / suivant infinie */
  322. window.addEvents({
  323. 'domready': function() {
  324. var wrapperSize = 0;
  325. var photoWidth;
  326. $$('#nav_photo div.photo').each(function(element){
  327. var size = element.getSize();
  328. wrapperSize += size.x;
  329. photoWidth = size.x;
  330. });
  331. if($('nav_photo') != null) {
  332. new SlideItMoo({
  333. overallContainer: 'photos-carrousel-content',
  334. elementScrolled: 'photos-carrousel-content',
  335. thumbsContainer: 'nav_photo',
  336. itemsVisible:4,
  337. elemsSlide:0,
  338. duration:300,
  339. itemsSelector: '.photo',
  340. itemWidth: 72,
  341. showControls:1,
  342. navs:{
  343. fwd:'.pictos-next',
  344. bk:'.pictos-prev'
  345. }});
  346. }
  347. Shadowbox.init({
  348. players: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'],
  349. handleOversize: "drag",
  350. modal: false,
  351. onFinish: set_marginTop,
  352. onChange: set_displayNone,
  353. onOpen: tag_xiti
  354. });
  355. }
  356. });
  357. </script>