public static function coupons_html() { global $wpdb, $woocommerce; $coupons = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}followup_coupons ORDER BY `coupon_name` ASC"); $html = ' <div class="wrap woocommerce"> <div class="icon32"><img src="' . FUE_TEMPLATES_URL . '/images/send_mail.png' . '" /></div> <h2> ' . __('Follow-Up Emails » Email Coupons', 'follow_up_emails') . ' <a href="admin.php?page=followup-emails-coupons&action=new-coupon" class="add-new-h2">' . __('Add Coupon', 'wc_followup_emalis') . '</a> </h2> <form action="admin-post.php" method="post"> <table class="wp-list-table widefat fixed posts"> <thead> <tr> <th scope="col" id="name" class="manage-column column-name" style="">' . __('Name', 'follow_up_emails') . '</th> <th scope="col" id="type" class="manage-column column-type" style="">' . __('Type', 'follow_up_emails') . '</th> <th scope="col" id="amount" class="manage-column column-amount" style="">' . __('Amount', 'follow_up_emails') . '</th> <th scope="col" id="usage_count" class="manage-column column-usage_count" style="">' . __('Sent', 'follow_up_emails') . '</th> </tr> </thead> <tbody id="the_list">'; if (empty($coupons)) { $html .= ' <tr scope="row"> <th colspan="4">' . __('No coupons available', 'follow_up_emails') . '</th> </tr>'; } else { foreach ($coupons as $coupon) { $html .= ' <tr scope="row"> <td class="post-title column-title"> <strong><a class="row-title" href="admin.php?page=followup-emails-coupons&action=edit-coupon&id=' . $coupon->id . '">' . stripslashes($coupon->coupon_name) . '</a></strong> <div class="row-actions"> <span class="edit"><a href="admin.php?page=followup-emails-coupons&action=edit-coupon&id=' . $coupon->id . '">' . __('Edit', 'follow_up_emails') . '</a></span> | <span class="trash"><a onclick="return confirm(\'Really delete this entry?\');" href="admin.php?page=followup-emails-coupons&action=delete-coupon&id=' . $coupon->id . '">' . __('Delete', 'follow_up_emails') . '</a></span> </div> </td> <td>' . FUE_Coupons::get_discount_type($coupon->coupon_type) . '</td> <td>' . floatval($coupon->amount) . '</td> <td>' . $coupon->usage_count . '</td> </tr> '; } } $html .= ' </tbody> </table> </form> </div>'; return $html; }
</a></span> | <span class="trash"><a onclick="return confirm('<?php _e('Really delete this entry?', 'follow_up_emails'); ?> ');" href="admin-post.php?action=fue_delete_coupon&id=<?php echo $coupon->id; ?> "><?php _e('Delete', 'follow_up_emails'); ?> </a></span> </div> </td> <td><?php echo FUE_Coupons::get_discount_type($coupon->coupon_type); ?> </td> <td><?php echo floatval($coupon->amount); ?> </td> <td><?php echo $coupon->usage_count; ?> </td> </tr> <?php } } ?>