Beispiel #1
0
 /**
  * Admin UI controller
  */
 public static function settings_main()
 {
     global $wpdb;
     $action = isset($_GET['action']) ? $_GET['action'] : 'list';
     if ($action == 'list') {
         echo FUE_Coupons::coupons_html();
     } elseif ($action == 'new-coupon') {
         echo FUE_Coupons::coupon_form_html();
     } elseif ($action == 'edit-coupon') {
         echo FUE_Coupons::coupon_form_html();
     } elseif ($action == 'delete-coupon') {
         $id = $_GET['id'];
         // delete
         $wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->prefix}followup_coupons` WHERE `id` = %d", $id));
         wp_redirect('admin.php?page=followup-emails-coupons&coupon_deleted=true');
         exit;
     }
 }
 public function settings_main()
 {
     echo FUE_Coupons::coupons_html();
 }