0byt3m1n1
Path:
/
home
/
kassiope
/
www
/
cron
/
[
Home
]
File: anniversaire.php
<?php include("../configuration.inc.php"); //############################################################ // GESTION ANNIVERSAIRES //############################################################ if($active_anniv) { $rec = mysql_query_override("select * from gaia_utilisateurs where naissance like '%-" . date('m-d') . "' and priv = 'util'"); while ($data = mysql_fetch_array_override($rec)) { $code = MDP(); $remise = $remise_anniv; $seuil = $seuil_anniv; $duree = $duree_anniv; $date_debut = date('d/m/Y'); $date_fin = date('d/m/Y', mktime(1, 0, 0, date('m'), date('d') + $duree, date('Y'))); $d_debut = date('Y-m-d'); $d_fin = date('Y-m-d', mktime(1, 0, 0, date('m'), date('d') + $duree, date('Y'))); mysql_query_override("insert into gaia_bons_reduction (nom, remise, seuil, date_debut, date_fin) values ('" . $code . "', '" . $remise . "', '" . $seuil . "', '" . $d_debut . "', '" . $d_fin . "')"); $subject = 'Joyeux anniversaire !'; $msg = 'Bonjour ' . ucfirst(mb_strtolower(stripslashes($data['prenom']))) . ', <br /><br /> Toute l\'équipe ' . $site . ' vous souhaite un <b style="color:' . $color1 . '">joyeux anniversaire !</b> <br /><br /> Et pour marquer cet événement, nous sommes heureux de vous offrir : <br /><br /> Un bon d\'achat de <b style="color:' . $color1 . '">' . $remise . ' euros</b> valable sur tout le site<b style="color:' . $color1 . '">*</b>. <br /><br /> Pour en bénéficier, il vous suffit de saisir le code : <b style="color:' . $color1 . '">' . $code . '</b> au moment de valider votre achat. <br /><br /> Attention, ne tardez pas, ce code personnel est valable <b style="color:' . $color1 . '">' . $duree . ' jours</b>. <br /><br /> Merci pour votre confiance et à très bientôt sur ' . $wwwroot . ' <br /><br /> L\'équipe ' . $site . ' <br /><br /> <b style="color:' . $color1 . '">*</b> Offre valable dès ' . $seuil . ' euros d\'achat et utilisable 1 seule fois.'; mail_confirm($data['email'], $subject, $msg, 'anniversaire'); mail_confirm('jsabat@wagaia.com', $subject . ' ' . $data['email'], $msg, 'anniversaire'); } } //############################################################ //############################################################ //############################################################ // RELANCE CLIENT //############################################################ /* $datemoins3mois = date('Y-m-d',mktime(1,0,0,date('m')-3,date('d'),date('Y'))); $rec = mysql_query("select u.pays as thepays, * from gaia_utilisateurs u, gaia_commandes c where c.id_utilisateur = u.id_utilisateur and o_timestamp like '".$datemoins3mois."%' and u.priv <> 'reve'"); while($data = mysql_fetch_array($rec)) { $code = MDP(); $remise = 10; $seuil = 50; $date_debut = date('d/m/Y'); $date_fin = date('d/m/Y',mktime(1,0,0,date('m'),date('d')+5,date('Y'))); $d_debut = date('Y-m-d'); $d_fin = date('Y-m-d',mktime(1,0,0,date('m'),date('d')+5,date('Y'))); //mysql_query("insert into gaia_bons_reduction (nom, remise, seuil, date_debut, date_fin) values ('".$code."', '".$remise."', '".$seuil."', '".$d_debut."', '".$d_fin."')"); if(in_array($data['thepays'],$tab_pays_fr)) { $subject = 'Bon de réduction !'; $msg = 'Bonjour '.ucfirst(mb_strtolower(stripslashes($data['prenom']))).', <br /><br /> C\'est le moment d\'en profiter ! <br /><br /> bénéficiez de <b style="color:#ff0506">'.$remise.' euros</b> de réduction sur votre prochaine commande<b style="color:#ff0506">*</b>. <br /><br /> Pour en bénéficier, il vous suffit de saisir le code : <b style="color:#ff0506">'.$code.'</b> au moment de valider votre achat. <br /><br /> Merci pour votre confiance et à très bientôt sur Hyraw.com <br /><br /> L\'équipe d\'Hyraw <br /><br /> <b style="color:#ff0506">*</b> Offre valable jusqu\'au '.$date_fin.' et pour un montant de commande minimum de '.$seuil.' euros et utilisable 1 seule fois.'; } else { $subject = 'Voucher !'; $msg = 'Hello '.ucfirst(mb_strtolower(stripslashes($data['prenom']))).', <br /><br /> This is the time to enjoy ! <br /><br /> Get <b style="color:#ff0506">'.$remise.' euros</b> discount on your next order<b style="color:#ff0506">*</b>. <br /><br /> To qualify, you simply enter the code : <b style="color:#ff0506">'.$code.'</b> when you confirm your purchase. <br /><br /> Thank you for your confidence. <br /><br /> The Hyraw Team <br /><br /> <b style="color:#ff0506">*</b> Offer valid until '.$date_fin.', amounting to minimum order of '.$seuil.' euros, used only once.'; } mail_confirm('jsabat@wagaia.com',$subject,$msg,'relance'); } */ //############################################################ //############################################################ //############################################################ // RELANCE CLIENT //############################################################ /* $datemoins5jours = date('Y-m-d',mktime(1,0,0,date('m'),date('d')-5,date('Y'))); $rec = mysql_query("select u.pays as thepays, u.*, c.* from gaia_utilisateurs u, gaia_commandes c where c.id_utilisateur = u.id_utilisateur and o_timestamp like '".$datemoins5jours."%' and u.priv <> 'reve'"); while($data = mysql_fetch_array($rec)) { $allarticles = ''; $recarticles = mysql_query("select a.nom_produit, pc.produit_id, c.* from gaia_commandes_articles a, gaia_produits_categories pc, gaia_categories c where pc.produit_id = a.produit_id and c.id = pc.categorie_id and commande_id = '".$data['id']."'"); if(in_array($data['thepays'],$tab_pays_fr)) { $allarticles = ''; while($datarticles = mysql_fetch_array($recarticles)) { $allarticles .= '<br />- <b>'.stripslashes($datarticles['nom_produit']).'</b> <a href="http://www.hyraw.com/fr/avis-'.$datarticles['produit_id'].'-'.$datarticles['id'].'-p-'.propre($datarticles['nom_fr']).'-'.propre($datarticles['nom_produit']).'.html#avis" style="color:#ff0506">Donnez votre avis</a>'; } $subject = 'Donnez votre avis !'; $msg = 'Bonjour '.ucfirst(mb_strtolower(stripslashes($data['prenom']))).', <br /><br /> Vous avez passé une commande sur notre e-shop et nous vous en remercions. <br /><br /> Afin d\'être au plus près de vos attentes et vos envies, nous vous proposons de nous soumettre votre avis sur les articles suivants : <br /> '.$allarticles.' <br /><br /> Merci pour votre confiance et à très bientôt sur Hyraw.com <br /><br /> L\'équipe d\'Hyraw'; } else { $allarticles = ''; while($datarticles = mysql_fetch_array($recarticles)) { $allarticles .= '<br />- <b>'.stripslashes($datarticles['nom_produit']).'</b> <a href="http://www.hyraw.com/en/avis-'.$datarticles['produit_id'].'-'.$datarticles['id'].'-p-'.propre($datarticles['nom_en']).'-'.propre($datarticles['nom_produit']).'.html#avis" style="color:#ff0506">Give your opinion</a>'; } $subject = 'Give your opinion !'; $msg = 'Hello '.ucfirst(mb_strtolower(stripslashes($data['prenom']))).', <br /><br /> You have placed an order on our e-shop and we thank you. <br /><br /> To be closer to your needs and your desires , we invite you to submit your opinion on the following items :<br /> '.$allarticles.' <br /><br /> Thank you for your confidence. <br /><br /> The Hyraw Team'; } mail_confirm('jsabat@wagaia.com',$subject,$msg,'avis'); } */ //############################################################ //############################################################ ?>