323 lines
9.8 KiB
PHP
323 lines
9.8 KiB
PHP
|
<?php
|
|||
|
/*-----------------------------------------------------*/
|
|||
|
include_once("_inc/config.php");
|
|||
|
/*-----------------------------------------------------*/
|
|||
|
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// ACTIONS
|
|||
|
|
|||
|
if(isset($_POST['action'])){
|
|||
|
|
|||
|
header("Content-type: application/json");
|
|||
|
echo '{"results":{';
|
|||
|
|
|||
|
switch($_POST['action']){
|
|||
|
|
|||
|
case "inscription" :
|
|||
|
|
|||
|
if(!isset($_SESSION["gar_front_code_client"])){
|
|||
|
header('Location: index.php');
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
$query = "UPDATE `".$GLOBALS['sql_prefixe']."pharmacies`
|
|||
|
SET `mage` = '1' ,
|
|||
|
`date_mage` = CURDATE()
|
|||
|
|
|||
|
|
|||
|
WHERE `code_client` = '".$_SESSION["gar_front_code_client"]."' ;";
|
|||
|
|
|||
|
$result = mysql_query($query);
|
|||
|
|
|||
|
if(!$result){
|
|||
|
echo '"error":"Inscription impossible..."';
|
|||
|
echo "}}";
|
|||
|
exit();
|
|||
|
}
|
|||
|
|
|||
|
//echo '"complete":"1"';
|
|||
|
|
|||
|
|
|||
|
//envoyer mail
|
|||
|
|
|||
|
//cdm@garancia-beauty.com
|
|||
|
|
|||
|
|
|||
|
$mail_sender = "info@garancia-beauty.com";
|
|||
|
$mail_to = "cdm@garancia-beauty.com";
|
|||
|
$objet = "Garancia - inscription au conseil des mages";
|
|||
|
|
|||
|
$pharmacie = getPharmacieByCode($_SESSION["gar_front_code_client"]);
|
|||
|
$delegue = getDelegueBySecteur($pharmacie -> secteur);
|
|||
|
if($delegue){
|
|||
|
$mail_to .= ";" . $delegue -> email;
|
|||
|
}
|
|||
|
|
|||
|
$message = "La pharmacie \"".$pharmacie -> name."\" (CIP : ".$pharmacie -> CIP.") s'est inscrite au conseil des mages.";
|
|||
|
|
|||
|
|
|||
|
$html = file_get_contents("emails/blank.html");
|
|||
|
$html = replaceMailVar($html,"message",$message);
|
|||
|
//$html = replaceMailVar($html,"code_client",$code_client);
|
|||
|
//$html = replaceMailVar($html,"CIP",$row -> CIP);
|
|||
|
//$html = replaceMailVar($html,"password",$password);
|
|||
|
//$html = replaceMailVar($html,"pharmacie_name",$row -> name);
|
|||
|
|
|||
|
$html = html_entity_decode(stripslashes($html));
|
|||
|
$html = preg_replace('/'/', "'", $html);
|
|||
|
|
|||
|
|
|||
|
$headers = "";
|
|||
|
$headers .= "From: Garancia <$mail_sender>"."\n";
|
|||
|
$headers .= "Reply-To: $mail_sender"."\n";
|
|||
|
$headers .= "MIME-Version: 1.0"."\n";
|
|||
|
$headers .= "Return-Path: <$mail_sender>"."\n";
|
|||
|
$headers .= "Content-Type:text/html; charset=\"utf-8\" "."\n";
|
|||
|
$headers .= "Content-Transfer-Encoding: 8bit"."\n";
|
|||
|
|
|||
|
//$headers .= "Bcc:chasleries@gmail.com,".$mail_to."\n";
|
|||
|
//$headers .= "Bcc:".$bcc."\n";
|
|||
|
//$headers .= "Cc:email2@example.com"."\n";
|
|||
|
|
|||
|
$sendMail = @mail($mail_to, $objet, $html , $headers);
|
|||
|
|
|||
|
echo '"complete":"1","password":"'.$password.'","CIP":"'.$row -> CIP.'"';
|
|||
|
|
|||
|
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
echo "}}";
|
|||
|
exit();
|
|||
|
|
|||
|
}
|
|||
|
//////////////////////////////////////////////////////////
|
|||
|
|
|||
|
$_RUBRIQUE = "le-conseil-des-mages";
|
|||
|
|
|||
|
/*-----------------------------------------------------*/
|
|||
|
include_once("_inc/assets/metas.php");
|
|||
|
include_once("_inc/assets/top.php");
|
|||
|
/*-----------------------------------------------------*/
|
|||
|
?>
|
|||
|
|
|||
|
|
|||
|
<div class="page">
|
|||
|
|
|||
|
<div id="arianne">
|
|||
|
<a href="home.php">Accueil</a> |
|
|||
|
<a href="le-conseil-des-mages.php">Informez-vous</a> |
|
|||
|
<span class="current">Le Conseil des Mages</span>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="page_menu">
|
|||
|
<!-- <a href="le-conseil-des-mages.php" class="current"><span>Le Conseil des Mages</span></a>
|
|||
|
<a href="le-cercle-des-ambassadeurs.php"><span>Le Cercle des Ambassadeurs</span></a> -->
|
|||
|
<a href="actualites.php"><span>Actualités</span></a>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="clear"></div>
|
|||
|
|
|||
|
<div class="page_contents">
|
|||
|
<h1><span>[</span> CONSEIL DES MAGES <span>]</span></h1>
|
|||
|
|
|||
|
<?php
|
|||
|
if($GLOBALS["gar_front_user"] -> mage == 1){
|
|||
|
?>
|
|||
|
|
|||
|
<div class="no_mage">
|
|||
|
<p>
|
|||
|
<b>> VOTRE OFFICINE FAIT PARTIE DU CONSEIL DES MAGES</b><br />
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
|
|||
|
<?php }else{ ?>
|
|||
|
|
|||
|
<div class="no_mage">
|
|||
|
<p>
|
|||
|
<b>> VOTRE OFFICINE NE FAIT PAS ENCORE PARTIE DU CONSEIL DES MAGES</b><br />
|
|||
|
Je souhaite que mon officine intègre le Conseil des Mages
|
|||
|
</p>
|
|||
|
|
|||
|
<a href="#subscribe" class="btnRightArrow">je remplis le formulaire en ligne</a>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="mage_form">
|
|||
|
<div class="title">
|
|||
|
Je souhaite que mon officine intègre le Conseil des Mages et m’engage à :
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="line">
|
|||
|
<input type="checkbox" name="optin1" value="1" /><label>Référencer toute la gamme GARANCIA* (17 références + nouveautés à venir)</label>
|
|||
|
</div>
|
|||
|
<div class="line">
|
|||
|
<input type="checkbox" name="optin2" value="1" /><label>Exposer toute l’année un présentoir de comptoir ou le meuble GARANCIA </label>
|
|||
|
</div>
|
|||
|
<div class="line">
|
|||
|
<input type="checkbox" name="optin3" value="1" /><label>Exposer la gamme en linéaire à hauteur des yeux sur 6 niveaux de 40 cm ou 3 niveaux de 80 cm minimum</label>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="legend">
|
|||
|
* Détenir un minimum de 72 unités en stock est nécessaire pour exprimer la gamme en linéaire
|
|||
|
</div>
|
|||
|
|
|||
|
<div style="text-align:center;">
|
|||
|
<div><a href="#subscribe" class="btnRightArrow">Valider mon adhésion</a></div>
|
|||
|
<div class="error"></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="mage_confirm">
|
|||
|
<div>
|
|||
|
<img src="_img/felicitations2.png" alt="félicitations" />
|
|||
|
</div>
|
|||
|
<p>
|
|||
|
Votre officine fait maintenant partie du Conseil des Mages,<br />
|
|||
|
Vous avez désormais le privilège de devenir Ambassadeur.
|
|||
|
</p>
|
|||
|
<a href="le-cercle-des-ambassadeurs.php" class="btnLeftArrow">devenir ambassadeur</a>
|
|||
|
<a href="le-conseil-des-mages.php" class="btnRightArrow">Retour à L’ACCUEIL</a>
|
|||
|
</div>
|
|||
|
|
|||
|
<script type="text/javascript">
|
|||
|
function showForm(){
|
|||
|
$(".no_mage").slideUp(300);
|
|||
|
$(".mage_home").slideUp(300);
|
|||
|
$(".mage_form").slideDown(300);
|
|||
|
updateElements();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
$(".no_mage .btnRightArrow").click(function(e) {
|
|||
|
showForm();
|
|||
|
return false;
|
|||
|
});
|
|||
|
|
|||
|
|
|||
|
$(".mage_form .btnRightArrow").click(function(e) {
|
|||
|
if( $(".mage_form input:checked").length == 3) {
|
|||
|
$(".mage_form .error").html("");
|
|||
|
TweenLite.to($(".mage_form"),0.2,{opacity:0.2});
|
|||
|
var datas = {};
|
|||
|
datas.action = "inscription";
|
|||
|
$.ajax({
|
|||
|
url: "<?php echo $pfile; ?>",
|
|||
|
dataType: 'json',
|
|||
|
data: datas,
|
|||
|
type: 'POST',
|
|||
|
success: onDatasInscription,
|
|||
|
error: onDatasError
|
|||
|
});
|
|||
|
}else{
|
|||
|
$(".mage_form .error").html("Pour validez votre adhésion, vous devez cocher les 3 engagements");
|
|||
|
}
|
|||
|
|
|||
|
return false;
|
|||
|
});
|
|||
|
|
|||
|
function onDatasInscription($datas)
|
|||
|
{
|
|||
|
if($datas.results.complete == 1){
|
|||
|
//ok
|
|||
|
$(".mage_form").slideUp(300);
|
|||
|
$(".mage_confirm").slideDown(300);
|
|||
|
updateElements();
|
|||
|
}else if($datas.results.error){
|
|||
|
$(".mage_form .error").html($datas.results.error);
|
|||
|
TweenLite.to($(".mage_form"),0.2,{opacity:1});
|
|||
|
}else{
|
|||
|
$(".mage_form .error").html("Erreur inconnue...");
|
|||
|
TweenLite.to($(".mage_form"),0.2,{opacity:1});
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function onDatasError(jqXHR, textStatus, errorThrown)
|
|||
|
{
|
|||
|
alert("error : " + textStatus);
|
|||
|
}
|
|||
|
|
|||
|
<?php if(isset($_GET['showForm'])){ ?>
|
|||
|
showForm();
|
|||
|
<?php } ?>
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
<?php } ?>
|
|||
|
|
|||
|
<div class="mage_home">
|
|||
|
<div class="avantages">
|
|||
|
<div class="title"><?php echo getContent(5) -> content; ?></div>
|
|||
|
<div class="ctn">
|
|||
|
|
|||
|
<?php
|
|||
|
echo getContent(1) -> content;
|
|||
|
?>
|
|||
|
|
|||
|
<!--
|
|||
|
<ul>
|
|||
|
<li>De <a href="files/infobulles/test.jpg" class="infobulle">Magnifiques Vitrines Prestiges</a> tout au long de l’année</li>
|
|||
|
<li>
|
|||
|
La personnalisation, mise en place et maintenance de<br />
|
|||
|
<a href="#">nos Linéaires</a>, aux couleurs de Garancia
|
|||
|
</li>
|
|||
|
<li>Une dotation supplémentaire de 150 Échantillons</li>
|
|||
|
<li>Des Pochettes Cadeaux ou des Sacs Garancia</li>
|
|||
|
<li>Des Soins Miniatures à offrir à vos clientes</li>
|
|||
|
<li>Le privilège d’avoir un Ambassadeur chouchouté par Garancia</li>
|
|||
|
<li>
|
|||
|
Des cadeaux pour votre équipe officinale avec l’accès à<br />
|
|||
|
l’Ecole des Sorciers : parcours de formation en ligne.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
-->
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="engagements">
|
|||
|
<div class="title"><?php echo getContent(6) -> content; ?></div>
|
|||
|
<div class="ctn">
|
|||
|
<?php
|
|||
|
echo getContent(2) -> content;
|
|||
|
?>
|
|||
|
<!--
|
|||
|
<ul>
|
|||
|
<li>Référencer tous les produits de la gamme</li>
|
|||
|
<li>Exposer un présentoir comptoir à l’année ou<br />
|
|||
|
le meuble Garancia</li>
|
|||
|
<li>Exposer la gamme en linéaire à hauteur des yeux<br />
|
|||
|
(sur 6 niveaux de 40 cm ou 3 niveaux de 80 cm minimum)</li>
|
|||
|
</ul>
|
|||
|
-->
|
|||
|
</div>
|
|||
|
<img src="_img/mage_home_avantages.jpg" alt="" />
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="clear"></div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<script type="text/javascript">
|
|||
|
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
<?php
|
|||
|
|
|||
|
/*-----------------------------------------------------*/
|
|||
|
include_once("_inc/assets/footer.php");
|
|||
|
/*-----------------------------------------------------*/
|
|||
|
?>
|