| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Tools |
| 4 |
* |
| 5 |
* @package Notifier |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
$dates = Notifier_Tools::get_logs_date_lists(); |
| 13 |
?> |
| 14 |
<div class="wrap notifier"> |
| 15 |
<div class="notifier-wrapper"> |
| 16 |
<!--Woocommerce export customer --> |
| 17 |
<?php if (class_exists('WooCommerce') && in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { ?> |
| 18 |
<form method="POST" id="notifier_tools_form" class="notifier-tools-form" action="" enctype="multipart/form-data"> |
| 19 |
<div class="notifier-tool-wrap"> |
| 20 |
<div class="notifier-tool-details"> |
| 21 |
<h3 class="notifier-tool-name">Export WooCommerce Customers</h3> |
| 22 |
<p class="notifier-tool-description">Export all your WooCommerce customers in CSV format to import them in WANotifier.</p> |
| 23 |
</div> |
| 24 |
<div class="notifier-tool-action"> |
| 25 |
<input name="export_customer" type="submit" class="button button-large" value="Export"> |
| 26 |
<?php wp_nonce_field( NOTIFIER_NAME . '-tools-export-customers' ); ?> |
| 27 |
</div> |
| 28 |
</div> |
| 29 |
</form> |
| 30 |
<?php } else { ?> |
| 31 |
<div class="notice notice-error is-dismissible"> |
| 32 |
<p>WooCommerce plugin is not installed or is not active. Please install or activate WooCommerce to export customers.</p> |
| 33 |
</div> |
| 34 |
<?php } ?> |
| 35 |
<!--End of Woocommerce export customer --> |
| 36 |
|
| 37 |
<!--Fetch activity log and show from date--> |
| 38 |
<?php if ('yes' === get_option('notifier_enable_activity_log')){ ?> |
| 39 |
<div class="notifier-tool-activity-wrap"> |
| 40 |
<div class="notifier-tool-inner-wrap"> |
| 41 |
<div class="notifier-tool-details"> |
| 42 |
<h3 class="notifier-tool-name">Activity Logs</h3> |
| 43 |
<p class="notifier-tool-description">View activity logs for your triggers to debug errors / troubleshoot triggers.</p> |
| 44 |
</div> |
| 45 |
<div class="notifier-tool-action"> |
| 46 |
<select name="notifier_activity_date" id="notifier_activity_date"> |
| 47 |
<option value="">Select date</option> |
| 48 |
<?php foreach ($dates as $date){ ?> |
| 49 |
<option value="<?php echo esc_attr($date); ?>"><?php echo esc_html($date); ?></option> |
| 50 |
<?php } ?> |
| 51 |
</select> |
| 52 |
</div> |
| 53 |
</div> |
| 54 |
<div class="activity-log-preview-wrap"><?php if (empty($dates)){ echo "No logs found...";} ?></div> |
| 55 |
</div> |
| 56 |
<?php } ?> |
| 57 |
<!--End of Fetch activity log and show from date --> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
|