admin_tools_settings.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. $links = array();
  3. if(isset($_REQUEST['swpm_link_for'])){
  4. //Rego complete link feature
  5. $link_for = filter_input(INPUT_POST, 'swpm_link_for', FILTER_SANITIZE_STRING);
  6. $member_id = filter_input(INPUT_POST, 'member_id', FILTER_SANITIZE_NUMBER_INT);
  7. $send_email = isset($_REQUEST['swpm_reminder_email']) ? true : false;
  8. $links = SwpmUtils::get_registration_complete_prompt_link($link_for, $send_email, $member_id);
  9. }
  10. if(isset($_REQUEST['recreate-required-pages-submit'])){
  11. //Lets recreate the required pages
  12. SwpmMiscUtils::create_mandatory_wp_pages();
  13. echo '<div class="swpm-green-box">' . SwpmUtils::_('The required pages have been re-created.') . '</div>';
  14. }
  15. ?>
  16. <div id="poststuff">
  17. <div id="post-body">
  18. <div class="postbox">
  19. <h3 class="hndle"><label for="title"><?php echo SwpmUtils::_('Generate a Registration Completion link') ?></label></h3>
  20. <div class="inside">
  21. <p><strong><?php echo SwpmUtils::_('You can manually generate a registration completion link here and give it to your customer if they have missed the email that was automatically sent out to them after the payment.') ?></strong></p>
  22. <form action="" method="post">
  23. <table>
  24. <tr>
  25. <?php echo SwpmUtils::_('Generate Registration Completion Link') ?>
  26. <br /><input type="radio" value="one" name="swpm_link_for" /><?php SwpmUtils::e('For a Particular Member ID'); ?>
  27. <input type="text" name="member_id" size="5" value="" />
  28. <br /><strong><?php echo SwpmUtils::_('OR') ?></strong>
  29. <br /><input type="radio" checked="checked" value="all" name="swpm_link_for" /> <?php echo SwpmUtils::_('For All Incomplete Registrations') ?>
  30. </tr>
  31. <tr>
  32. <td>
  33. <div class="swpm-margin-top-10"></div>
  34. <?php echo SwpmUtils::_('Send Registration Reminder Email Too') ?> <input type="checkbox" value="checked" name="swpm_reminder_email">
  35. </td>
  36. </tr>
  37. <tr>
  38. <td>
  39. <div class="swpm-margin-top-10"></div>
  40. <input type="submit" name="submit" class="button-primary" value="<?php echo SwpmUtils::_('Submit') ?>" />
  41. </td>
  42. </tr>
  43. <tr>
  44. <td>
  45. <div class="swpm-margin-top-10"></div>
  46. <?php
  47. if (!empty($links)) {
  48. echo '<div class="swpm-green-box">' . SwpmUtils::_('Link(s) generated successfully. The following link(s) can be used to complete the registration.') . '</div>';
  49. } else {
  50. echo '<div class="swpm-grey-box">' . SwpmUtils::_('Registration completion links will appear below') . '</div>';
  51. }
  52. ?>
  53. <div class="swpm-margin-top-10"></div>
  54. <?php foreach ($links as $key => $link) { ?>
  55. <input type="text" size="120" readonly="readonly" name="link[<?php echo $key ?>]" value="<?php echo $link; ?>"/><br/>
  56. <?php } ?>
  57. <?php
  58. if (isset($_REQUEST['swpm_reminder_email'])) {
  59. echo '<div class="swpm-green-box">' . SwpmUtils::_('A prompt to complete registration email was also sent.') . '</div>';
  60. }
  61. ?>
  62. </td>
  63. </tr>
  64. </table>
  65. </form>
  66. </div>
  67. </div>
  68. <div class="postbox">
  69. <h3 class="hndle"><label for="title"><?php echo SwpmUtils::_('Re-create the Required Pages') ?></label></h3>
  70. <div class="inside">
  71. <p><strong><?php echo SwpmUtils::_('If you have accidentally deleted the required pages that this plugin creates at install time, you can use this option to re-create them.') ?></strong></p>
  72. <p><a href="https://simple-membership-plugin.com/recreating-required-pages-simple-membership-plugin/" target="_blank"><?php echo SwpmUtils::_('This documentation'); ?></a><?php echo SwpmUtils::_(' has full explanation.'); ?></p>
  73. <form action="" method="post" onsubmit="return confirm('Do you really want to re-create the pages?');">
  74. <table>
  75. <tr>
  76. <td>
  77. <div class="swpm-margin-top-10"></div>
  78. <input type="submit" name="recreate-required-pages-submit" class="button-primary" value="<?php echo SwpmUtils::_('Re-create the Required Pages') ?>" />
  79. </td>
  80. </tr>
  81. </table>
  82. </form>
  83. </div>
  84. </div>
  85. </div><!-- end of post-body -->
  86. </div><!-- end of poststuff -->