PageRenderTime 54ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/DEV/DISPLAY/modules/form_unsubscribe_OFFER2.php

https://github.com/chrisbst35/LI_LEMONDE
PHP | 138 lines | 79 code | 44 blank | 15 comment | 27 complexity | c0c38b37ed31e45711b5b100d17e381d MD5 | raw file
  1. <?php if($_global['dev'] == 1 && isset($_GET['cmt']) && $_GET['cmt'] == 'on') { ?>
  2. <!-- begin : <?php echo __FILE__; ?> -->
  3. <?php } ?>
  4. <?php
  5. include ("../LIB/alerte.email.gdm.php");
  6. //include ("../LIB/alerte.email.varcheck.php");
  7. //include ("../LIB/alerte.email.gdm.php");
  8. //var_dump($_REQUEST);
  9. $url_homepage = constant("URL_SITE");
  10. $gdmid = $_REQUEST['REQUEST_ID'];
  11. $email = $_REQUEST['EMAIL'];
  12. $gdm_abonnement = $_REQUEST['ABONNEMENT'];
  13. /* Desinscription alerte email */
  14. $gdm = new gdm;
  15. $gdm_get["REQUEST_ID"] = $gdmid;
  16. //SARA A. 15/06/09 mantis 7286: to retrive the REQUEST_ID only
  17. list($gdmid) = explode("?" , $gdmid);
  18. $gdm_get["EMAIL"] = $email;
  19. $gdm_rt = $gdm->request("LI".strtoupper($_global['site']), strtoupper($_global['lang']), $gdm_abonnement, "GET", $gdm_get);
  20. // print_r($gdm_rt) ;
  21. // ABONNEMENT
  22. for ($i = 0; $i < count($gdm_rt); $i ++)
  23. {
  24. if (strpos($gdm_rt[$i], "ABONNEMENT=") === 0)
  25. {
  26. break;
  27. }
  28. }
  29. $gdm_abonnement = substr($gdm_rt[$i], strpos($gdm_rt[$i], "=") + 1, strlen($gdm_rt[$i]));
  30. //echo("[".$gdm_abonnement."]");
  31. // 35 -> TEXTE_LIBRE
  32. for ($i = 0; $i < count($gdm_rt); $i ++)
  33. {
  34. if (strpos($gdm_rt[$i], "TEXTE_LIBRE=") === 0)
  35. {
  36. break;
  37. }
  38. }
  39. $search_summary = substr($gdm_rt[$i], strpos($gdm_rt[$i], "=") + 1, strlen($gdm_rt[$i]));
  40. ?>
  41. <?php if(isset($_GET['cmt']) && $_GET['cmt'] == 'on') { ?><!-- debut contenu --><?php } ?>
  42. <div id="desinscription">
  43. <div id="desinscriptioncontent">
  44. <?php if(isset($_GET['cmt']) && $_GET['cmt'] == 'on') { ?><!-- desinscription : PAGE 1 --><?php } ?>
  45. <?php
  46. //DPE - 17/10/2006 - TEXTE_LIBRE reactivated as the variable was commented out
  47. //and the search type was not sent to the mail processing service.
  48. $gdm_array["TEXTE_LIBRE"] = $search_summary;
  49. $gdm_array["REQUEST_ID"] = $gdmid;
  50. $gdm_array["EMAIL"] = $email;
  51. $gdm_array["UNDEFINED_COL1"] = $_POST['reason'];
  52. $gdm_array["CHAMP_LIBRE"] = $_POST['reason_other'];
  53. $gdm_array["UNDEFINED_COL2"] = $_POST['success'];
  54. $gdm_array["UNDEFINED_COL3"] = $_POST['success_other'];
  55. $array_service = $_REQUEST['service'];
  56. if (count($array_service) > 0)
  57. {
  58. $gdm_array["UNDEFINED_COL4"] = implode(",", $_REQUEST['service']);
  59. }
  60. //print_r($gdm_array);
  61. //var_dump($_REQUEST);
  62. $gdm = new gdm();
  63. $final_str = "";
  64. $redirect_marmelade = "";
  65. //SARA A. 15/06/09 mantis 7286: to retrive the REQUEST_ID only without the symbol "?"
  66. $gdm_array["REQUEST_ID"] = $gdmid;
  67. $gdm_rt = $gdm->request("LI".strtoupper($_global['site']), strtoupper($_global['lang']), $gdm_abonnement, "DELETE", $gdm_array);
  68. $gdm_answer = ($gdm_rt[0] == "OK" ? "1" : "0");
  69. $final_str .= "<b>désinscription alerte email normale:</b><br />";
  70. $final_str .= "gdm->request(LI".strtoupper($_global['site']).",". strtoupper($_global['lang']).", ".$gdm_abonnement.", DELETE, [gdm_array]);<br />";
  71. $final_str .= "action: unsubscribe---->".$gdm_answer."<hr>";
  72. $redirect_marmelade .= "&UNSUBSCRIBE=1";
  73. if ($gdm_answer == "1")
  74. {
  75. ?>
  76. <p> Nous vous confirmons la désinscription de lemail <b><?= $email; ?></b> aux emailings des offres des agences de Logic Immo.</p>
  77. <a class="spir_link_grey_arrow" href="<?= $url_homepage; ?>" title="Retour &agrave;la page d'accueil">Retour &agrave; la page d'accueil</a>
  78. <?php
  79. }
  80. else
  81. { //echo "<br /> ERROR CODE:".$gdm_rt[0];
  82. //echo "<br /> ERROR TEXT:".$gdm_rt[1];
  83. ?>
  84. <p>Le serveur est momentan&eacute;ment indisponible.<br />
  85. Veuillez nous excuser.</p>
  86. <?php
  87. }
  88. ?>
  89. <?php if(isset($_GET['cmt']) && $_GET['cmt'] == 'on') { ?><!-- fin code --><?php } ?>
  90. </div>
  91. </div>
  92. <?php if($_global['dev'] == 1 && isset($_GET['cmt']) && $_GET['cmt'] == 'on') { ?>
  93. <!-- //end : <?php echo __FILE__; ?> -->
  94. <?php } ?>