/DEV/DISPLAY/modules/annonce_content.php
PHP | 438 lines | 345 code | 71 blank | 22 comment | 55 complexity | c4e3d8c0a9b1599e6dd560c17a441466 MD5 | raw file
- <?php
- if (!isset($_GET['page']))
- $page = 0;
- else
- $page = $_GET['page'];
- //default town
- $loc = ucwords2(strtolower($ad["default_town"]));
- $gallery = ($_global['gallery'] != 0) ? "&gallery=1" : "";
- $ficheVisite = 'fiche_visite.php?id=' . $ad["id"] . "&univers=" . $_global['univers'];
- if ($_global['gallery'] != 0) {
- $ficheVisite .= '&gallery=' . $_global['gallery'];
- }
- $ficheVisite = add_parameters($ficheVisite);
- $share_param = array();
- $share_param[] = $ad["id"];
- $share_param[] = $ag["id"];
- $share_param[] = $ad["logicode"];
- $share_param = "['" . implode("', '", $share_param) . "']";
- $str_seo = "";
- switch ($_global["univers"]) {
- case 1 :$str_seo = "Achat ";
- break;
- case 2 :$str_seo = "Location ";
- break;
- case 8 :$str_seo = "Colocation ";
- break;
- }
- $str_seo .= $ad['property_type'] . " " . $ad['default_town_2'] . " " . $ad['lzip'];
- if (!isset($urlWebsite))
- $urlWebsite = $ag['site']; // Patch if not from detail.php
- if ($_global['dev'] == 1 && isset($_GET['cmt']) && $_GET['cmt'] == 'on') {
- ?>
- <!-- begin : <?php echo __FILE__; ?> -->
- <?php } ?>
- <?php
- // debug
- if ($_global["debug"] == 1) {
- echo 'Description de l\'annonce :<br />';
- print_r($ad);
- echo '<hr />';
- echo 'Description de l\'agence :<br />';
- print_r($ag);
- echo '<hr />';
- }
- // Déclaration de la variable $pagerefxiti qui serat transmit
- // à la fonction call_frm_contact_agence() // intertitiel contenant l'iframe
- $pagerefxiti = "page-detail";
- $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 : "");
- $url_logic = str_replace("http://", "", to_url($_global["uri"]));
- $uri_logic = to_url($_global["uri"]);
- $url_fcb = "http://www.facebook.com/sharer.php?";
- $url_twt = "http://twitter.com/share?";
- switch ($_global['univers']) {
- case 1:
- default:
- $xitiId_ContactAgency = 226;
- $xitiContactAnchorLeft = 235;
- $xitiContactAnchorRight = 233;
- $xitiIdShowTel = 222;
- break;
- case 2:
- $xitiId_ContactAgency = 227;
- $xitiContactAnchorLeft = 236;
- $xitiContactAnchorRight = 234;
- $xitiIdShowTel = 224;
- break;
- case 8:
- $xitiId_ContactAgency = 227;
- $xitiIdShowTel = 224;
- break;
- }
- // TODO : XITI
- //$aInfosPublisherClickTel = getXitiPublisherInfos($_global['univers'], $ad, $ag, 'CLIC_TEL', 'FA');
- //$sXitiPublisherClickTel = getXitiPublisherString(array($aInfosPublisherClickTel));
- // blocs contact agence par mail et tel
- $idx = ''; // servait pour les PR, pas ici
- $id1 = 'container_contact_agc_tel_mail1' . $ad["id"] . $idx;
- $id2 = 'container_contact_agc_tel_mail' . $ad["id"] . $idx;
- $telphone_agc = trim($ag["tel"]) != "" ? $ag["tel"] . " <font style=\"font-size: 8px;\">(3)</font>" : "";
- $contact_agc = $ag['id'] . '&id_annonce=' . $ad['id'] . '&pageref=' . $_global['self'];
- $from_to_js = array("'" => "\'", '"' => "\'", ''' => "\'", '’' => "\'", '"' => "\'", " & " => " et ");
- $default_text = strtr($ad["default_text"], $from_to_js);
- $default_text = utf8_encode(html_entity_decode($default_text));
- $default_text = str_replace('&', '', $default_text); //Supprimer les derniers & qui subsistent
- $default_sector = strtr($ad["default_sector"], $from_to_js);
- $default_sector = utf8_encode(html_entity_decode($default_sector));
- $default_sector = str_replace('&', '', $default_sector); //Supprimer les derniers & qui subsistent
- $gdm_string = array();
- $gdm_string[] = $ag["id"];
- $gdm_string[] = $ag["id_presto"];
- $gdm_string[] = $ad["id"];
- $gdm_string[] = xiti_string($ad["reference"]);
- $gdm_string[] = $ad["property_type"];
- $gdm_string[] = $ad["nb_rooms"];
- $gdm_string[] = $ad["area"];
- $gdm_string[] = base64_encode($default_text);
- $gdm_string[] = base64_encode($default_sector);
- $gdm_string[] = $ad["lzip"];
- $gdm_string[] = $ad["price"];
- $gdm_string[] = ($ad["photos_count"] > 0 ? $ad["photos_id"][0] : "");
- $gdm_string[] = base64_encode($ag["email"] != "" ? $ag["email"] : "contact@logic-immo.com");
- $gdm_string[] = $ag["spoken_language"];
- $gdm_string[] = $ad["num_mandat"];
- $gdm_string[] = $ad["type_transaction"];
- $gdm_string[] = $ad["id_bien"];
- $gdm_string[] = $ad["id_bien_programme"];
- //DISTRICT
- $gdm_string[] = $ad["district_id_1"];
- $gdm_string[] = $ad["district_id_2"];
- $gdm_string[] = $ad["district_id_3"];
- $gdm_string[] = addslashes(html_entity_decode($ad["district_name_1"], ENT_QUOTES));
- $gdm_string[] = addslashes(html_entity_decode($ad["district_name_2"], ENT_QUOTES));
- $gdm_string[] = addslashes(html_entity_decode($ad["district_name_3"], ENT_QUOTES));
- //
- $gdm_string = urlencode("['" . implode("', '", $gdm_string) . "']");
- // blocs contact agence par mail et tel (fin)
- // Construction des indicateurs globaux Xiti
- $sXitiIndicGlobaux = getXitiIndicGlobaux('Affichage_telephone_Fiche_Annonce_LeMonde', $_global['univers'], $ad, $ag);
- //$aInfosPublisherClickTel = getXitiPublisherInfos($_global['univers'], $ad, $ag, 'CLIC_TEL', 'FA');
- //$sXitiPublisherClickTel = getXitiPublisherString(array($aInfosPublisherClickTel));
- //echo $sXitiIndicGlobaux;
- ?>
- <div id="detail">
- <!-- debut bloc haut annonce : features + prix -->
- <div class="top-bloc-annce">
- <div id="detail-title">
- <?php
- if ($ad["default_town_2"] == "") {
- ?>
- <h2><span id="title-type"><?= $ad["property_type"]; ?> <?= $ad["lzip"] ?></span></h2>
- <?php
- } else {
- ?>
- <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>
- <?php
- }
- ?>
- </div>
- <div class="div_price">
- <!-- prix -->
- <?= ($ad["real_price"] >= AD_PRICE_LIMIT ? LABEL_COMMON_NC : $ad["price"] . " " . LABEL_COMMON_PRICE_UNIT); ?>
- <!-- mention -->
- <?= ($_global["univers"] == 1 && $ag["franchising_agency"] != "LAFORET" && $ad["property_type_id"] != 4 && $ad["property_type_id"] != 6 ? "<font style=\"font-size: 9px;\"> (1)</font>" : ""); ?>
- <?= ($_global["univers"] == 2 ? "<font style=\"font-size: 9px;\"> (1)</font>" : ""); ?>
-
- <?php
- if (isset($ad['district_to_use']) && $ad['district_to_use'] != '') {
- ?>
- <h3 class="districts">
- <a onclick="<?= getXitiClick(($_global['univers'] == 2 ? 240 : 238)) ?>" id="districts_tips" class="tooltip" href="#poi_anchor" title=" Découvrez le quartier de ce bien <img class='tip-top' src='/images/detail/tip-top.png' /><?= $ad['district_to_use']; ?>" >
- <?= $ad['district_to_use']; ?>
- </a>
- </h3>
- <?php } ?>
- </div>
- <div class="calage"></div>
- </div>
- <!-- fin bloc haut annonce : features + prix -->
- <!-- debut contenu annonce -->
- <div id="detail-content">
- <!-- debut photo defaut + vignette -->
- <div id="photo-annonce">
- <div id="photo-annonce-default">
- <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; ?>" />
- </div>
- <?php if ($ad["photos_count"] > 0) { ?>
- <div id="photo-annonce-vignette">
- <div id="photos-carrousel-content" class="carousel">
- <div id="nav_photo" class="inner">
- <?= ($ad["photos_count"] > 4) ? '<div class="pictos-prev"></div>' : '' ?>
- <?php
- for ($i = 0; $i < $ad["photos_count"]; $i++) {
- ?>
- <div class="photo" rel="lightbox[galerie]">
- <a href="<?= $ad["photos_multibox"][$i]; ?>" id="mb<?= ($i + 1); ?>" class="img_small" rel="shadowbox[photos]" >
- <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"/>
- </a>
- </div>
- <?php
- }
- // Visites virtuelles
- if (count($ad["mmf"]) > 0) {
- foreach ($ad["mmf"] as $key => $items) {
- foreach ($items as $item) {
- switch ($key) {
- // video
- case 1 :
- //$options = "rel=\"width:320,height:262\" ";
- $options = "rel=\"shadowbox[photos];player=iframe;width=950;\" ";
- $item = URL_VIDEOS_AD . URL_FLUX_MOBIVILLAGE . $item;
- break;
- // visite virtuelle
- case 4 :
- if (strpos($item, 'youtube.fr') !== false || strpos($item, 'youtube.com') !== false) {
- //cas ou on a des url youtube avec des parametres
- //ex d'url : http://www.youtube.com/watch?v=NG1dHgAXgJY
- //pour que la shadowbox fonctionne il faut transphormer l'url en http://www.youtube.com/v/NG1dHgAXgJY
- $options = "rel=\"shadowbox[photos];player=swf;width=500;height=400;\"";
- $item = str_replace('watch?v=', '/v/', $item);
- } elseif (strpos($item, 'batch.ac3-distribution.com') !== false) {
- //cas pour les vidéos youtube qui vienne de batch.ac3-distribution.com
- //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
- $options = "rel=\"shadowbox[photos];player=swf;width=530;height=400;\"";
- preg_match('#embed=(.+)#', $item, $a_array);
- $s_id_video = $a_array[1];
- $item = "http://www.youtube.com/v/" . $s_id_video;
- } else { //cas normal on inclus l'url dans une iframe
- $options = "rel=\"shadowbox[photos];player=iframe;width=950;\"";
- }
- break;
- }
- ?>
- <div class="photo">
- <a href="<?= $item; ?>" id="mb<?= ($i + 1); ?>" class="mb mmf" <?= $options; ?> title="<?= constant("LABEL_COMMON_MMF_LABEL_" . $key); ?>" >
- <img width="64" height="53" id="img_an_<?= $i; ?>" src="<?= get_urlmmf("/common/default_mmf_" . $key . ".gif"); ?>" name="<?= get_urlmmf("/detailV2/noPhoto.jpg"); ?>" />
- </a>
- </div>
- <?php
- $i++;
- }
- }
- }
- ?>
- <?php if ($ad["photos_count"] > 4) { ?><div class="pictos-next"></div><?php } ?>
- </div>
- </div>
- </div>
- <?php } ?>
- </div>
- <!-- fin photo defaut + vignette -->
- <!-- debut bloc description + contact -->
- <div class="right-annce-content">
- <!-- titre annonce -->
- <div id="detail-features">
- <span class="detail-features-localite"><?= $ad["default_sector"] ?></span>
- <br />
- <span class="detail-features-type"><?= $ad["features"]; ?></span>
- </div>
- <!-- debut description annonce -->
- <div id="description">
- <div id="description-annonce">
- <p>
- <?php
- if ($ad['type_transaction'] == '5') {
- print $ad['seo'];
- }
- ?>
- <?= $ad["default_text"]; ?>
- </p>
- <?php if ($ad['agency_rent_fees'] && $ad['agency_rent_fees'] > 0 && $_global["univers"] == 2) { ?>
- <br/>
- <p>Honoraires TTC en sus : <?= $ad['agency_rent_fees'] ?>€</p>
- <?php
- }
- echo $str_seo;
- ?>
- </div>
- <!-- debut contacter agence-->
- <div class="cadre-contact-agc">
- <div class="agency-info">
- <div class="annce_contact">
- <a class="spir_btn spir_btn-blue" onclick="<?= getXitiClick($xitiContactAnchorLeft); ?>" href="#bloc-info-agence" rel="nofollow" title="Contacter par email">
- Contacter par mail
- </a>
- <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">
- Voir le numéro
- </a>
- <span id="btn_tel2" class="btn_tel2 spir_btn spir_btn-blue" ><?= $telphone_agc; ?></span>
- <div class="calage"></div>
- </div>
- </div>
- </div>
- <!-- fin contacter agence-->
- </div>
- <!-- fin description annonce -->
- </div>
- <!-- fin bloc description + contact -->
- <div class="calage"></div>
- <!-- debut fiche technique -->
- <?php
- include("modules/annonce_fiche_technique.php");
- ?>
- <!-- fin fiche technique -->
- <div class="calage"></div>
- <!-- debut DPE -->
- <?php if ($ad["dpe_energy"]) { ?>
- <div class="bloc-dpe">
-
- <div class="description-date">
- <?= ($ad["created_on"] != '' ? '<div>Mis en ligne : ' . $ad["created_on"] . '</div>' : '') ?>
- <?= ($ad["modified_on"] != '' ? '<div>Mis à jour : ' . $ad["modified_on"] . '</div>' : '') ?>
- <?= ($ad['reference'] != '') ? '<div>Référence : ' . $ad['reference'] . '</div>' : '' ?>
- </div>
-
- <p class="detail-tech-title">CONSOMMATION ÉNERGÉTIQUE : <?= ($ad['dpe_energy_val'] >= 0 ? $ad['dpe_energy_val'] : '') ?></p>
-
- <div id="detail-dpe">
- <div>
- <img src="<?php echo get_urlmmf('detailV2/dpe/dpe_' . strtoupper($ad["dpe_energy"])); ?>_b.gif" alt="<?= LABEL_DETAIL_DPE; ?>">
- </div>
- </div>
-
-
-
- <div class="calage"></div>
- <a class="toggler" id="toggler" href="javascript:toggle_dpe(1)">
- Cliquer ici pour découvrir le DPE :
- </a>
- <div id="dpe-pyramid" style="display: none; margin: 0 0 10px 0;">
- <img src="<?= get_urlmmf('dpe/dpe_' . strtoupper($ad["dpe_energy"]) . '_b.gif'); ?>" />
- </div>
-
-
-
- </div>
- <?php } ?>
- <!-- fin DPE -->
- <div class="calage"></div>
-
-
- </div>
- </div>
- <script type="text/javascript">
- if($('districts_tips')) {
- //create the tooltips
- var tipz = new agTips ('.tooltip',{
- className: 'tip',
- fixed: false,
- hideDelay: 50,
- showDelay: 50
- });
- }
- /* nouvelle galery avec les precedent / suivant infinie */
- window.addEvents({
- 'domready': function() {
-
- var wrapperSize = 0;
- var photoWidth;
- $$('#nav_photo div.photo').each(function(element){
- var size = element.getSize();
- wrapperSize += size.x;
- photoWidth = size.x;
- });
- if($('nav_photo') != null) {
- new SlideItMoo({
- overallContainer: 'photos-carrousel-content',
- elementScrolled: 'photos-carrousel-content',
- thumbsContainer: 'nav_photo',
- itemsVisible:4,
- elemsSlide:0,
- duration:300,
- itemsSelector: '.photo',
- itemWidth: 72,
- showControls:1,
- navs:{
- fwd:'.pictos-next',
- bk:'.pictos-prev'
- }});
- }
-
- Shadowbox.init({
- players: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'],
- handleOversize: "drag",
- modal: false,
- onFinish: set_marginTop,
- onChange: set_displayNone,
- onOpen: tag_xiti
- });
-
- }
- });
-
- </script>