Advertisement
Guest User

Untitled

a guest
Mar 14th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.05 KB | None | 0 0
  1. <?php
  2. require("../Global-Cms.php");
  3.  
  4. $pagename="commande";
  5.  
  6. require('../php/body-html.php');
  7. require('../php/header-menu.php');
  8.  
  9. $do = Secu($_GET['do']);
  10. $etape = $_GET['etape'];
  11. $offre = $_GET['offre'];
  12. $commande_id = $_GET['commande_id'];
  13. $id_boutique = $_GET['id_boutique'];
  14. ?>
  15. <style>
  16. #page-title {
  17. color: #fff;
  18. font-size: 16px;
  19. margin-top: 72px;
  20. padding: 35px 0 45px;
  21. background-image: url(<?php echo $url; ?>/Structure/images/Steam.jpg);
  22. }
  23. </style>
  24. <body style="margin-top: -4%;">
  25. <div id="page-title" class="image-bg">
  26. <div class="container text-center">
  27. <div class="title-content">
  28. <?PHP if($etape == "") { ?>
  29. <h1>Etape 0/3</h1>
  30. <?PHP } elseif($etape == "1") { ?>
  31. <h1>Etape 1/3</h1>
  32. <?PHP } else { ?>
  33. <h1>Etape 3/3</h1>
  34. <?PHP } ?>
  35. <?php
  36. if($do == "check") {
  37. $email = Secu($_POST['bean_email']);
  38. $email_check = preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $email);
  39. $commande_id = Secu($_POST['bean_commande_id']);
  40. $id_boutique = Secu($_POST['id_boutique']);
  41. $offre = Secu($_POST['bean_offre']);
  42.  
  43. if(strlen($email) < 6) {
  44. $message['email'] = "<div class='erreur'>Ton adresse e-mail est invalide.</div>";
  45. $failure = true;
  46. } elseif(strlen($email) < 1) {
  47. $message['email'] = "<div class='erreur'>Merci d'entrer une adresse e-mail</div>";
  48. $failure = true;
  49. } elseif($email_check !== 1) {
  50. $message['email'] = "<div class='erreur'>Ton adresse e-mail est invalide.</div>";
  51. $failure = true;
  52. }
  53.  
  54.  
  55.  
  56. else {
  57.  
  58. $_SESSION['email'] = $email;
  59. $_SESSION['offre'] = $offre;
  60. $_SESSION['commande_id'] = $commande_id;
  61. $_SESSION['id_boutique'] = $id_boutique;
  62. $_SESSION['page'] = 1;
  63. Redirect("".$url."/commande-1?page=".$_SESSION['page']."&etape=1&id_boutique=".$_SESSION['id_boutique']."");
  64. exit();
  65. }
  66. }
  67.  
  68. ?>
  69. </div>
  70. </div>
  71. </div>
  72.  
  73.  
  74. <div id="workstation" class="padding">
  75. <div class="container">
  76. <div class="row text-center section-title">
  77.  
  78. </div>
  79.  
  80.  
  81. <div class="row">
  82. <div id="sidebar" class="col-md-4">
  83. <div class="widget-area">
  84. <div class="widget widget_search">
  85.  
  86. </div>
  87.  
  88. <div class="widget">
  89. <h3 class="widget_title">Information commande</h3>
  90. <div class="latest-posts">
  91. <div class="media">
  92.  
  93. <div class="media-body">
  94. <h4 class="entry-title"><a href="#">L'offre qui a été choisis:</a></h4>
  95. <span><i style="color:#39b54a;" class="fa fa-shopping-cart"></i> Offre actuel: <a href="#"><?PHP if(!empty($_SESSION['offre'])) { echo $_SESSION['offre']; } else { echo "".$offre.""; } ?></a></span>
  96. </div>
  97. </div>
  98. <div class="media">
  99.  
  100. <div class="media-body">
  101. <h4 class="entry-title"><a href="#">ID de la commande actuel:</a></h4>
  102. <span><i style="color:#39b54a;" class="fa fa-ticket"></i> Commande numéro: <a href="#"><?PHP if(!empty($_SESSION['commande_id'])) { echo utf8_decode($_SESSION['commande_id']); } else { echo "".$commande_id.""; } ?></a></span>
  103. </div>
  104. </div>
  105. <bR>
  106. <div class="media">
  107.  
  108. </div>
  109.  
  110. </div>
  111. </div>
  112.  
  113.  
  114.  
  115.  
  116. </div>
  117. </div> <!--/Sidebar-->
  118.  
  119. <?PHP if($etape == 0) { if($_SESSION['etape'] == 1) { Redirect("".$url."/commande?etape=1"); } ?>
  120.  
  121. <div id="content" class="site-content col-md-8">
  122. <div class="post">
  123. <br>
  124.  
  125. <div class="entry-summary">
  126. <?PHP if(isset($message)) { ?>
  127. <div class="alert alert-danger">
  128. <?PHP if(isset($message['email'])) { echo "".$message['email'].""; } ?>
  129. <?PHP if(isset($message['offre'])) { echo "".$message['offre']." ".Redirect("".$url."").""; } ?>
  130. <?PHP if(isset($message['commande_id'])) { echo "".$message['commande_id']." ".Redirect("".$url."").""; } ?>
  131. </div>
  132. <?PHP } ?>
  133.  
  134.  
  135. <div class="alert alert-info">
  136. Les <strong>clés Steam</strong> seront envoyées par email. Celle-ci doit donc être <strong>correcte</strong> !
  137. </div>
  138.  
  139. <form method="post" action="?page=1&do=check" action="#">
  140. <div class="form-group">
  141. <label for="form-login-username">Indiquer votre e-mail</label>
  142. <input type="text" name="bean_email" maxLength="100" placeholder="exemple@exemple.com" class="form-control">
  143. <input type="hidden" name="bean_commande_id" maxLength="10" value="<?php echo $commande_id; ?>" hidden="hidden" readonly="readonly" class="form-control">
  144. <input type="hidden" name="bean_offre" maxLength="20" value="<?php echo $offre; ?>" hidden="hidden" readonly="readonly" class="form-control">
  145. <input type="hidden" name="id_boutique" maxLength="1" value="<?php echo $id_boutique; ?>" hidden="hidden" readonly="readonly" class="form-control">
  146. </div>
  147.  
  148.  
  149. <div class="form-group">
  150.  
  151.  
  152. <button type="submit" name="check" class="btn btn-success btn-animated">Continuer</button>
  153. </div>
  154.  
  155. <hr>
  156.  
  157.  
  158. </form>
  159.  
  160. </div>
  161.  
  162. </div><!--/post-->
  163.  
  164.  
  165.  
  166. </div><!--/content-->
  167. <?PHP } elseif($etape == 1) { ?>
  168.  
  169.  
  170.  
  171. <div id="content" class="site-content col-md-8">
  172. <div class="post">
  173. <br>
  174.  
  175. <div class="entry-summary">
  176. <?PHP if(isset($message)) { ?>
  177. <div class="alert alert-danger">
  178. <?PHP if(isset($message['email'])) { echo "".$message['email'].""; } ?>
  179. <?PHP if(isset($message['offre'])) { echo "".$message['offre']." ".Redirect("".$url."").""; } ?>
  180. <?PHP if(isset($message['commande_id'])) { echo "".$message['commande_id']." ".Redirect("".$url."").""; } ?>
  181. </div>
  182. <?PHP } ?>
  183.  
  184. <div class="alert alert-info">
  185. <strong><i class="fa fa-info-circle"></i> Note </strong> ton code sur un bloc-note avant de le valider (si vous appelez, hésitez pas à ré-écouter).
  186. </div>
  187. <div class="alert alert-warning">
  188. <strong><i class="fa fa-exclamation-triangle"></i> Attention: </strong><?php echo $sitename; ?> ne pourra pas être responsable de vos erreurs de code. »
  189. </div>
  190. <?php
  191.  
  192.  
  193. $select_from = $bdd->prepare("SELECT * FROM cms_boutique WHERE id = :id");
  194. $select_from->execute(array(':id' => $_SESSION['id_boutique']));
  195. $boutique_offre = $select_from -> fetch();
  196. {
  197.  
  198. $limit = "3";
  199. $select_from = $bdd->prepare("SELECT * FROM cms_cle_steam WHERE offre_id = :offre_id LIMIT $limit");
  200. $select_from->execute(array(':offre_id' => $_SESSION['id_boutique']));
  201. while($cle_check = $bdd->fetch())
  202. {
  203.  
  204.  
  205.  
  206. $code = isset($_POST['code']) ? preg_replace('/[^a-zA-Z0-9]+/', '', $_POST['code']) : '';
  207. if( empty($code) ) {
  208. echo '';
  209. }
  210. else {
  211. $dedipass = file_get_contents('http://api.dedipass.com/v1/pay/?public_key='.$boutique_offre['key_dedipass'].'&private_key='.$boutique_offre['private_key'].'&code=' . $code);
  212. $dedipass = json_decode($dedipass);
  213. if($dedipass->status == 'success') {
  214. // Le transaction est validée et payée.
  215.  
  216.  
  217.  
  218.  
  219.  
  220. $to = "".$mail_sauvegarde.", ".$_SESSION["email"]."";
  221. $subject = "Livraison commande ".$sitename."";
  222. $message = "
  223.  
  224.  
  225.  
  226.  
  227. <style type=\"text/css\">
  228. img {
  229. max-width: 100%;
  230. }
  231. body {
  232. -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
  233. }
  234. body {
  235. background-color: #f6f6f6;
  236. }
  237. @media only screen and (max-width: 640px) {
  238. body {
  239. padding: 0 !important;
  240. }
  241. h1 {
  242. font-weight: 800 !important; margin: 20px 0 5px !important;
  243. }
  244. h2 {
  245. font-weight: 800 !important; margin: 20px 0 5px !important;
  246. }
  247. h3 {
  248. font-weight: 800 !important; margin: 20px 0 5px !important;
  249. }
  250. h4 {
  251. font-weight: 800 !important; margin: 20px 0 5px !important;
  252. }
  253. h1 {
  254. font-size: 22px !important;
  255. }
  256. h2 {
  257. font-size: 18px !important;
  258. }
  259. h3 {
  260. font-size: 16px !important;
  261. }
  262. .container {
  263. padding: 0 !important; width: 100% !important;
  264. }
  265. .content {
  266. padding: 0 !important;
  267. }
  268. .content-wrap {
  269. padding: 10px !important;
  270. }
  271. .invoice {
  272. width: 100% !important;
  273. }
  274. }
  275. </style>
  276. </head>
  277.  
  278. <body itemscope itemtype=\"http://schema.org/EmailMessage\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;\" bgcolor=\"#f6f6f6\">
  279.  
  280. <table class=\"body-wrap\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;\" bgcolor=\"#f6f6f6\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;\" valign=\"top\"></td>
  281. <td class=\"container\" width=\"600\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;\" valign=\"top\">
  282. <div class=\"content\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;\">
  283. <table class=\"main\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;\" bgcolor=\"#fff\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"alert alert-warning\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; color: #fff; font-weight: 500; text-align: center; border-radius: 3px 3px 0 0; background-color: #2f353f; margin: 0; padding: 20px;\" align=\"center\" bgcolor=\"#2f353f\" valign=\"top\">
  284. Commande ".$sitename." numéro: <b>".$_SESSION["commande_id"]."</b>
  285. </td>
  286. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-wrap\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;\" valign=\"top\">
  287. <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">
  288. Nous t&#39;en remercions de ton achat sur <strong style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\">".$sitename."</strong> . !
  289. </td>
  290. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">
  291. Ci dessous, les information d'achat.
  292. </td>
  293. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">
  294. <a href=\"#\" class=\"btn-primary\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #3bafda; margin: 0; border-color: #3bafda; border-style: solid; border-width: 10px 20px;\">Ta Clé: <b>".$cle_check['cle']."</b></a>
  295. </td>
  296. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">
  297.  
  298. <div>Ton Pack: <b>".$_SESSION["offre"]."</b></div>
  299. <div>&nbsp;</div>
  300. <div>Information DEDIPASS:</div>
  301. <div>&nbsp;</div>
  302. <div>Code utilisé: <b>".$code."</b></div>
  303. </td>
  304. </tr></table></td>
  305. </tr></table><div class=\"footer\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;\">
  306. <table width=\"100%\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"aligncenter content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;\" align=\"center\" valign=\"top\">Copyright 2017, <a href=\"#\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;\">".$sitename."</a> Tous droit réversé.</td>
  307. </tr></table></div></div>
  308. </td>
  309. <td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;\" valign=\"top\"></td>
  310. </tr></table></body>
  311. </html>
  312.  
  313.  
  314.  
  315.  
  316. ";
  317.  
  318. // Always set content-type when sending HTML email
  319. $headers = "MIME-Version: 1.0" . "\r\n";
  320. $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  321.  
  322. // More headers
  323. $headers .= 'From: <'.$mail_newsletter.'>' . "\r\n";
  324. $headers .= 'Cc: '.$_SESSION["email"].'' . "\r\n";
  325. mail($to,$subject,$message,$headers);
  326.  
  327.  
  328. $to2 = "".$mail_sauvegarde.", ".$_SESSION["email"]."";
  329. $subject2 = "Livraison commande ".$sitename."";
  330.  
  331. $message2 = "
  332.  
  333.  
  334. <style type=\"text/css\">
  335. img {
  336. max-width: 100%;
  337. }
  338. body {
  339. -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
  340. }
  341. body {
  342. background-color: #f6f6f6;
  343. }
  344. @media only screen and (max-width: 640px) {
  345. body {
  346. padding: 0 !important;
  347. }
  348. h1 {
  349. font-weight: 800 !important; margin: 20px 0 5px !important;
  350. }
  351. h2 {
  352. font-weight: 800 !important; margin: 20px 0 5px !important;
  353. }
  354. h3 {
  355. font-weight: 800 !important; margin: 20px 0 5px !important;
  356. }
  357. h4 {
  358. font-weight: 800 !important; margin: 20px 0 5px !important;
  359. }
  360. h1 {
  361. font-size: 22px !important;
  362. }
  363. h2 {
  364. font-size: 18px !important;
  365. }
  366. h3 {
  367. font-size: 16px !important;
  368. }
  369. .container {
  370. padding: 0 !important; width: 100% !important;
  371. }
  372. .content {
  373. padding: 0 !important;
  374. }
  375. .content-wrap {
  376. padding: 10px !important;
  377. }
  378. .invoice {
  379. width: 100% !important;
  380. }
  381. }
  382. </style>
  383. </head>
  384.  
  385. <body itemscope itemtype=\"http://schema.org/EmailMessage\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;\" bgcolor=\"#f6f6f6\">
  386.  
  387. <table class=\"body-wrap\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;\" bgcolor=\"#f6f6f6\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;\" valign=\"top\"></td>
  388. <td class=\"container\" width=\"600\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;\" valign=\"top\">
  389. <div class=\"content\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;\">
  390. <table class=\"main\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;\" bgcolor=\"#fff\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-wrap aligncenter\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: center; margin: 0; padding: 20px;\" align=\"center\" valign=\"top\">
  391. <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">
  392. <h2 class=\"aligncenter\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; box-sizing: border-box; font-size: 24px; color: #000; line-height: 1.2em; font-weight: 400; text-align: center; margin: 40px 0 0;\" align=\"center\">Facture d'achat ".$sitename."</h2>
  393. </td>
  394. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block aligncenter\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: center; margin: 0; padding: 0 0 20px;\" align=\"center\" valign=\"top\">
  395. <table class=\"invoice\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; text-align: left; width: 80%; margin: 40px auto;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 5px 0;\" valign=\"top\">".$sitename."<br style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\" />Commande #".$_SESSION["commande_id"]."<br style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\" />".FullDate('full')."</td>
  396. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 5px 0;\" valign=\"top\">
  397. <table class=\"invoice-items\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; border-top-width: 1px; border-top-color: #eee; border-top-style: solid; margin: 0; padding: 5px 0;\" valign=\"top\">Prix dedipass</td>
  398. <td class=\"alignright\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: right; border-top-width: 1px; border-top-color: #eee; border-top-style: solid; margin: 0; padding: 5px 0;\" align=\"right\" valign=\"top\">".$boutique_offre['prix']."&#8364;</td>
  399. </tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; border-top-width: 1px; border-top-color: #eee; border-top-style: solid; margin: 0; padding: 5px 0;\" valign=\"top\">TVA</td>
  400. <td class=\"alignright\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: right; border-top-width: 1px; border-top-color: #eee; border-top-style: solid; margin: 0; padding: 5px 0;\" align=\"right\" valign=\"top\"> 0.50&#8364;</td>
  401. </tr>
  402. </tr><tr class=\"total\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"alignright\" width=\"80%\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: right; border-top-width: 2px; border-top-color: #333; border-top-style: solid; border-bottom-color: #333; border-bottom-width: 2px; border-bottom-style: solid; font-weight: 700; margin: 0; padding: 5px 0;\" align=\"right\" valign=\"top\">Total</td>
  403. <td class=\"alignright\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: right; border-top-width: 2px; border-top-color: #333; border-top-style: solid; border-bottom-color: #333; border-bottom-width: 2px; border-bottom-style: solid; font-weight: 700; margin: 0; padding: 5px 0;\" align=\"right\" valign=\"top\">2,49&#8364;</td>
  404. </tr></table></td>
  405. </tr></table></td>
  406. </tr></td>
  407. </tr></table></td>
  408. </tr></table><div class=\"footer\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;\">
  409. <table width=\"100%\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"aligncenter content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;\" align=\"center\" valign=\"top\">Copyright 2017, <a href=\"mailto:\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;\"><b>".$sitename."</b></a> tous droit réservée</td>
  410. </tr></table></div></div>
  411. </td>
  412. <td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;\" valign=\"top\"></td>
  413. </tr></table></body>
  414. </html>
  415.  
  416. ";
  417. // Always set content-type when sending HTML email
  418. $headers2 = "MIME-Version: 1.0" . "\r\n";
  419. $headers2 .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  420.  
  421. // More headers
  422. $headers2 .= 'From: <'.$mail_newsletter.'>' . "\r\n";
  423. $headers2.= 'Cc: '.$_SESSION["email"].'' . "\r\n";
  424. mail($to2,$subject2,$message2,$headers2);
  425.  
  426.  
  427.  
  428. if(isset($_SESSION['refer'])){
  429.  
  430. $select_from1 = $bdd->prepare("SELECT * FROM referuser WHERE ip = :ip");
  431. $select_from1->execute(array(':ip' => SHA1($_SERVER['REMOTE_ADDR'])));
  432.  
  433. $calcul_ip = $select_from1 -> rowCount();
  434. if ($calcul_ip != 1)
  435. {
  436. $select_from2 = $bdd->prepare("SELECT * FROM refers WHERE user = :user LIMIT 0,3");
  437. $select_from2->execute(array(':user' => $_SESSION['refer']));
  438.  
  439. $calcul_utilisateur = $select_from2 -> rowCount();
  440. if ($calcul_utilisateur != 1)
  441. {
  442.  
  443. $insert_into = $bdd->prepare('INSERT INTO refers (user, referals) VALUES(:user, :referals)');
  444. $insert_into->bindValue(':user', $_SESSION['refer']);
  445. $insert_into->bindValue(':referals', 1);
  446. $insert_into->execute();
  447.  
  448. } else {
  449.  
  450. $update_into = $bdd->prepare('UPDATE refers SET `referals`=`referals`+1 WHERE (user) VALUES (:user)');
  451. $update_into->bindValue(':user', $_SESSION['refer']);
  452. $update_into->execute();
  453. }
  454.  
  455. $insert_into = $bdd->prepare('INSERT INTO referuser (referrer, referred, ip) VALUES (:referrer, :referred, :ip)');
  456. $insert_into->bindValue(':referrer', $_SESSION['refer']);
  457. $insert_into->bindValue(':referred', $_SESSION['email']);
  458. $insert_into->bindValue(':ip', SHA1($_SERVER['REMOTE_ADDR']));
  459. $insert_into->execute();
  460.  
  461. $insert_into1 = $bdd->prepare('INSERT INTO cms_commande (id_commande, offre, ip_utilisateur, code_dedipass, email, date, cle_livrer) VALUES (:id_commande, :offre, :ip_utilisateur, :code_dedipass, :email, :date, :cle_livrer)');
  462. $insert_into1->bindValue(':id_commande', $_SESSION["commande_id"]);
  463. $insert_into1->bindValue(':offre', $_SESSION["offre"]);
  464. $insert_into1->bindValue(':ip_utilisateur', $_SERVER["REMOTE_ADDR"]);
  465. $insert_into1->bindValue(':code_dedipass', $code);
  466. $insert_into1->bindValue(':email', $_SESSION["email"]);
  467. $insert_into1->bindValue(':date', FullDate('full'));
  468. $insert_into1->bindValue(':cle_livrer', $cle_check['cle']);
  469. $insert_into1->execute();
  470.  
  471. $insert_into2 = $bdd->prepare('INSERT INTO cms_satisfait (user_ip,email) VALUES (:user_ip, :email)');
  472. $insert_into2->bindValue(':user_ip', $_SERVER["REMOTE_ADDR"]);
  473. $insert_into2->bindValue(':email', $_SESSION["email"]);
  474. $insert_into2->execute();
  475.  
  476. $update_into = 'UPDATE users SET solde = solde + 1 WHERE ( username = :username )';
  477. $actualise = $bdd->prepare( $update_into );
  478. $actualise->execute(array(':username' => $_SESSION['refer']));
  479.  
  480. $update_into = 'UPDATE cms_cle_stock SET nombremax = nombremax - 3 WHERE ( id = :id )';
  481. $actualise = $bdd->prepare( $update_into );
  482. $actualise->execute(array(':id' => $_SESSION['id_boutique']));
  483.  
  484. $delete_from = $bdd->exec("DELETE FROM cms_cle_steam WHERE cle = '".$cle_check['cle']."' ");
  485.  
  486. Redirect("".$url."/livraison?livraison=ok&email=".$_SESSION['email']."");
  487. exit();
  488.  
  489.  
  490. }
  491. session_unset($_SESSION['refer']);
  492.  
  493. }
  494.  
  495. $insert_into1 = $bdd->prepare('INSERT INTO cms_commande (id_commande, offre, ip_utilisateur, code_dedipass, email, date, cle_livrer) VALUES (:id_commande, :offre, :ip_utilisateur, :code_dedipass, :email, :date, :cle_livrer)');
  496. $insert_into1->bindValue(':id_commande', $_SESSION["commande_id"], PDO::PARAM_INT);
  497. $insert_into1->bindValue(':offre', $_SESSION["offre"]);
  498. $insert_into1->bindValue(':ip_utilisateur', $_SERVER["REMOTE_ADDR"]);
  499. $insert_into1->bindValue(':code_dedipass', $code);
  500. $insert_into1->bindValue(':email', $_SESSION["email"]);
  501. $insert_into1->bindValue(':date', FullDate('full'));
  502. $insert_into1->bindValue(':cle_livrer', $cle_check['cle']);
  503. $insert_into1->execute();
  504.  
  505. $insert_into2 = $bdd->prepare('INSERT INTO cms_satisfait (user_ip,email) VALUES (:user_ip, :email)');
  506. $insert_into2->bindValue(':user_ip', $_SERVER["REMOTE_ADDR"]);
  507. $insert_into2->bindValue(':email', $_SESSION["email"]);
  508. $insert_into2->execute();
  509.  
  510. $update_into = 'UPDATE cms_cle_stock SET nombremax = nombremax - 3 WHERE ( id = :id )';
  511. $actualise = $bdd->prepare( $update_into );
  512. $actualise->execute(array(':id' => $_SESSION['id_boutique']));
  513.  
  514. $delete_from = $bdd->exec("DELETE FROM cms_cle_steam WHERE cle = '".$cle_check['cle']."'");
  515.  
  516. Redirect("".$url."/livraison?livraison=ok&email=".$_SESSION['email']."");
  517. session_destroy();
  518.  
  519. } else {
  520. // Le code est invalide
  521. echo 'Le code '.$code.' est invalide';
  522. }
  523. }
  524.  
  525. } }
  526.  
  527.  
  528. ?>
  529.  
  530. <script src="//api.dedipass.com/v1/pay.js"></script>
  531. <?php
  532. $select_from = $bdd->prepare("SELECT * FROM cms_boutique WHERE id = :id LIMIT 0,1");
  533. $select_from->execute(array(':id' => $_SESSION['id_boutique']));
  534. $script_achat = $select_from -> fetch(); {
  535. ?>
  536. <div data-dedipass="<?php echo $script_achat['key_dedipass']; ?>" data-dedipass-custom=""></div>
  537. <?php } ?>
  538.  
  539.  
  540. </div>
  541.  
  542. </div><!--/post-->
  543.  
  544. <div class="form-group">
  545. <a href="<?php echo $url; ?>/commande-1?etape=back" class="btn btn-danger btn-animated">Annulée ma commande</a>
  546. </div>
  547.  
  548. </div><!--/content-->
  549. <?PHP } elseif($etape == "bac") { session_destroy(); Redirect("".$url.""); } ?>
  550.  
  551.  
  552. <?php
  553. if($etape == "back") {
  554. session_destroy(); Redirect("".$url."");
  555. }
  556.  
  557. ?>
  558.  
  559.  
  560.  
  561. </div>
  562.  
  563. </div>
  564. </div>
  565.  
  566. <div id="promotion" class="padding">
  567. <div class="container text-center">
  568. <div class="container">
  569. <div class="row">
  570. <div class="text-center section-title">
  571. <h2 style="background-color: white;color: #39b54a;width: 30.5%;left: 0;right: 0;margin-left: 35%;border-radius: 5px;"> PARTENAIRES</h2>
  572.  
  573. </div>
  574. </div>
  575.  
  576.  
  577. <div class="clients text-center">
  578. <ul class="list-inline">
  579. <li><a href="#"><img style="background-color: white;color: #39b54a;border-radius: 5px;" class="img-responsive" src="<?php echo $url; ?>/Structure/images/client1.png" alt=""></a></li>
  580. <li><a href="#"><img style="background-color: white;color: #39b54a;border-radius: 5px;" class="img-responsive" src="<?php echo $url; ?>/Structure/images/client2.png" alt=""></a></li>
  581. <li><a href="#"><img style="background-color: white;color: #39b54a;border-radius: 5px;" class="img-responsive" src="<?php echo $url; ?>/Structure/images/client3.png" alt=""></a></li>
  582. <li><a href="#"><img style="background-color: white;color: #39b54a;border-radius: 5px;" class="img-responsive" src="<?php echo $url; ?>/Structure/images/client4.png" alt=""></a></li>
  583. </ul>
  584. </div>
  585. </div>
  586. </div>
  587. </div><!--/Promotion-->
  588.  
  589. <script type="text/javascript">
  590. L10N.put("identity.register.overlay.loading.text", 'Chargement...');
  591. document.observe("dom:loaded", function() {
  592. QuickRegister.initAgeGate(true);
  593. });
  594. </script>
  595. <script type="text/javascript">
  596.  
  597. document.observe("dom:loaded", function() {
  598.  
  599. Event.observe($("back-link"), "click", function() {
  600.  
  601. Overlay.show(null,'Chargement...');
  602.  
  603. });
  604.  
  605. Event.observe($("proceed-button"), "click", function() {
  606.  
  607. Overlay.show(null,'Chargement...');
  608.  
  609. $("quickregister-form").submit();
  610.  
  611. });
  612.  
  613. $("email-address").focus();
  614.  
  615. });
  616.  
  617. </script>
  618. <?php
  619. require('../php/footer.php');
  620. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement