%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/test/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/test/p-partager.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/init.php"); verif_get($_POST['id']); if($_GET['section'] == 1) { $sect = $section->aff_section($_POST['id']); if($sect == null) { header("Location: 404.html"); exit(0); } if(verifie_email($_POST['email']) == "ok") { if($sect != null) { $db = new BaseOps; $header = get_temp("templates/newsletter/header.php", $url_site,$lang->getlang()); $footer = get_temp("templates/newsletter/footer_actu.php", $url_site,$lang->getlang()); $query = "SELECT s.*,sl.titre,sl.permalien,sl.texte,cl.name,c.code_iso FROM `section` s LEFT JOIN `section_lang` sl ON s.id=sl.section lEFT JOIN `country` c ON s.pays = c.id LEFT JOIN `country_lang` cl ON c.id = cl.country WHERE s.id = ".$_POST['id']." AND sl.lang = ".$lang->getlangid()." AND cl.lang = ".$lang->getlangid(); $infos = $db->select_array($query); $content .= get_section("templates/newsletter/section_mail.php", $infos, $url_site, $lang->getlang()); $subject="=?UTF-8?B?".base64_encode(stripslashes(html_entity_decode($infos['titre'], ENT_QUOTES, 'UTF-8')))."?="; $headers= "From: \"".lang("titresite")."\" <".$email_noreply.">\n"; $headers.='Content-type: text/html; charset=utf-8'; mail($_POST['email'], $subject, $header.$content.$footer, $headers); $pageactu = $lang->getlang()."/".$infos['id']."-".$infos['permalien']."/"; header("Location:".$url_site.$pageactu."?envoi=1"); exit(0); } else { //echo verifie_email($_POST['email']); header("Location:".$url_site); exit(0); } } else { //echo verifie_email($_POST['email']); header("Location:".$url_site); exit(0); } } else if($_GET['page'] == 1) { $page = new Page; $pg = $page->infos_page($_POST['id'],$lang->getlangid()); if($pg == null) { header("Location: 404.html"); exit(0); } if(verifie_email($_POST['email']) == "ok") { if($pg != null) { $sec = $section->aff_section($section->page_sec($_POST['id'])); $pagesec = $lang->getlang()."/".$sec['id']."-".$sec['permalien']."/"; $pagepg = $pagesec.$pg['id']."-".$pg['permalien'].".html"; $header = get_temp("templates/newsletter/header_page.php", $url_site); $footer = get_temp("templates/newsletter/footer_page.php", $url_site); $content = '<h2><a href="'.$url_site.$pagepg.'">'.$pg['titre'].'</a></h2>'; if($pg['lieu']!="" && $pg['date_debut']!="" && $pg['date_fin']!="" && $pg['public']!=""){ $content .= '<div id="pageinfos" class="bg_profil_'.$sec['profil'].'">'; if($pg['lieu']!=""){ $content.='<div class="lieu"><img src="'.$url_site.'images/boussole.png" alt="boussole"> '.$pg['lieu'].'</div>'; } if($pg['date_fin']!="0000-00-00" && $pg['date_fin']!=""){ $content.='<div class="lieu"><img src="'.$url_site.'images/clock.png" alt="date"> '.lang("From").' <strong>'.dateLang($pg['date_debut'],$lang->getlangid()).'</strong> '.lang("to").' <strong>'.dateLang($pg['date_fin'],$lang->getlangid()).'</strong></div>'; } else{ if($pg['date_debut']!="0000-00-00" && $pg['date_debut']!=""){ $content.='<div class="lieu"><img src="'.$url_site.'images/clock.png" alt="date"> <strong>'.dateLang($pg['date_debut'],$lang->getlangid()).'</strong></div>'; } } if($pg['public']!=""){ $content.='<div class="lieu"><img src="'.$url_site.'images/public.png" alt="public"> '.$pg['public'].'</div>'; } $content .= '</div>'; } $result = $page->liste_blocs($_POST['id']); if($result != null) { foreach ($result as $bloc) { $content .= get_bloc("templates/newsletter/bloc".$bloc['type'].".php", $bloc, $url_site, $lang->getlang()); } } $subject="=?UTF-8?B?".base64_encode(stripslashes(html_entity_decode($sec['titre']." : ".$pg['titre'], ENT_QUOTES, 'UTF-8')))."?="; $headers= "From: \"".lang("titresite")."\" <".$email_noreply.">\n"; $headers.='Content-type: text/html; charset=utf-8'; mail($_POST['email'], $subject, $header.$content.$footer, $headers); //echo $content; header("Location:".$url_site.$pagepg."?envoi=1"); exit(0); } else { //echo verifie_email($_POST['email']); header("Location:".$url_site); exit(0); } } else { //echo verifie_email($_POST['email']); header("Location:".$url_site); exit(0); } } else { header("Location:".$url_site); exit(0); } ?>