| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Locations Management. |
| 4 |
* |
| 5 |
* This is the template that table, search layout |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
?> |
| 13 |
<!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 14 |
|
| 15 |
<div class="wrap wdk-wrap"> |
| 16 |
<h1 class="wp-heading-inline"><?php echo __('Locations','wpdirectorykit'); ?> <a href="<?php echo get_admin_url() . "admin.php?page=wdk_location&function=edit"; ?>" class="button button-primary" id="add_location_button"><?php echo __('Add location','wpdirectorykit'); ?></a></h1> |
| 17 |
<br /> |
| 18 |
<?php |
| 19 |
$success_message = NULL; |
| 20 |
if(isset($_GET['custom_message'])) |
| 21 |
$success_message = esc_html(urldecode($_GET['custom_message'])); |
| 22 |
|
| 23 |
$form->messages('class="alert alert-danger"', $success_message); |
| 24 |
?> |
| 25 |
<br /> |
| 26 |
<form method="GET" action="<?php echo wmvc_current_edit_url(); ?>" novalidate="novalidate"> |
| 27 |
<table class="wp-list-table widefat fixed striped table-view-list pages"> |
| 28 |
<thead> |
| 29 |
<tr> |
| 30 |
<td id="cb" class="manage-column column-cb check-column"><label class="screen-reader-text" for="cb-select-all-1"><?php echo __('Select All', 'wpdirectorykit'); ?></label><input id="cb-select-all-1" type="checkbox"></td> |
| 31 |
<th><?php echo __('Title','wpdirectorykit'); ?></th> |
| 32 |
<th><?php echo __('Order','wpdirectorykit'); ?></th> |
| 33 |
<th><?php echo __('Level','wpdirectorykit'); ?></th> |
| 34 |
<th><?php echo __('Date','wpdirectorykit'); ?></th> |
| 35 |
<th class="actions_column"><?php echo __('Actions','wpdirectorykit'); ?></th> |
| 36 |
</tr> |
| 37 |
</thead> |
| 38 |
|
| 39 |
<?php if(count($locations) == 0): ?> |
| 40 |
<tr class="no-items"><td class="colspanchange" colspan="6"><?php echo __('No Locations found.','wpdirectorykit'); ?></td></tr> |
| 41 |
<?php endif; ?> |
| 42 |
|
| 43 |
<?php foreach ( $locations as $location ):?> |
| 44 |
<tr> |
| 45 |
<th scope="row" class="check-column"> |
| 46 |
<input id="cb-select-<?php echo wmvc_show_data('idlocation', $location, '-'); ?>" type="checkbox" name="post[]" value="<?php echo wmvc_show_data('idlocation', $location, '-'); ?>"> |
| 47 |
<div class="locked-indicator"> |
| 48 |
<span class="locked-indicator-icon" aria-hidden="true"></span> |
| 49 |
<span class="screen-reader-text"><?php echo __('Is Locked', 'wpdirectorykit'); ?></span> |
| 50 |
</div> |
| 51 |
</th> |
| 52 |
<td> |
| 53 |
<?php echo str_pad('', wmvc_show_data('level', $location, 0)*12, ' ').'|-'; ?><a href="<?php echo get_admin_url() . "admin.php?page=wdk_location&function=edit&id=".wmvc_show_data('idlocation', $location, '-'); ?>"><?php echo wmvc_show_data('location_title', $location, '-').' #'.wmvc_show_data('idlocation', $location, '-'); ?></a> |
| 54 |
</td> |
| 55 |
<td> |
| 56 |
<?php echo wmvc_show_data('order_index', $location, '-'); ?> |
| 57 |
</td> |
| 58 |
<td> |
| 59 |
<?php echo wmvc_show_data('level', $location, '-'); ?> |
| 60 |
</td> |
| 61 |
<td> |
| 62 |
<?php echo wdk_get_date(wmvc_show_data('date', $location), false); ?> |
| 63 |
</td> |
| 64 |
|
| 65 |
<td class="actions_column"> |
| 66 |
<a href="<?php echo get_admin_url() . "admin.php?page=wdk_location&function=edit&id=".wmvc_show_data('idlocation', $location, '-'); ?>" title="<?php echo esc_attr__('Edit','wpdirectorykit');?>"><span class="dashicons dashicons-edit"></span></a> |
| 67 |
<a class="question_sure" href="<?php echo get_admin_url() . "admin.php?page=wdk_location&function=delete&id=".wmvc_show_data('idlocation', $location, '-'); ?>&_wpnonce=<?php echo wp_create_nonce( 'wdk-location-delete_'.wmvc_show_data('idlocation', $location, '-'));?>" title="<?php echo esc_attr__('Remove','wpdirectorykit');?>"><span class="dashicons dashicons-no"></span></a> |
| 68 |
</td> |
| 69 |
</tr> |
| 70 |
<?php endforeach; ?> |
| 71 |
|
| 72 |
<tfoot> |
| 73 |
<tr> |
| 74 |
<td class="manage-column column-cb check-column"><label class="screen-reader-text" for="cb-select-all-2"><?php echo __('Select All', 'wpdirectorykit'); ?></label><input id="cb-select-all-2" type="checkbox"></td> |
| 75 |
<th><?php echo __('Title','wpdirectorykit'); ?></th> |
| 76 |
<th><?php echo __('Order','wpdirectorykit'); ?></th> |
| 77 |
<th><?php echo __('Level','wpdirectorykit'); ?></th> |
| 78 |
<th><?php echo __('Date','wpdirectorykit'); ?></th> |
| 79 |
<th class="actions_column"><?php echo __('Actions','wpdirectorykit'); ?></th> |
| 80 |
</tr> |
| 81 |
</tfoot> |
| 82 |
</table> |
| 83 |
<div class="tablenav bottom"> |
| 84 |
<div class="alignleft actions bulkactions"> |
| 85 |
<?php wp_nonce_field( 'wdk-location-bulk', '_wpnonce'); ?> |
| 86 |
<label for="bulk-action-selector-bottom" class="screen-reader-text"><?php echo __('Select bulk action', 'wpdirectorykit'); ?></label> |
| 87 |
<select name="action" id="bulk-action-selector-bottom"> |
| 88 |
<option value="-1"><?php echo __('Bulk actions', 'wpdirectorykit'); ?></option> |
| 89 |
<option value="delete" class="hide-if-no-js"><?php echo __('Delete', 'wpdirectorykit'); ?></option> |
| 90 |
</select> |
| 91 |
<input type="hidden" name="page" value="wdk_location" /> |
| 92 |
<input type="submit" id="table_action" class="button action" name="table_action" value="<?php echo esc_attr__('Apply', 'wpdirectorykit'); ?>"> |
| 93 |
</div> |
| 94 |
<br class="clear"> |
| 95 |
</div> |
| 96 |
</form> |
| 97 |
</div> |
| 98 |
|
| 99 |
<script> |
| 100 |
// Generate table |
| 101 |
jQuery(document).ready(function($) { |
| 102 |
$('.question_sure').on('click', function(){ |
| 103 |
return confirm("<?php echo esc_js(__('Are you sure? Selected item will be completely removed!','wpdirectorykit')); ?>"); |
| 104 |
}); |
| 105 |
}); |
| 106 |
</script> |
| 107 |
|
| 108 |
<?php $this->view('general/footer', $data); ?> |
| 109 |
|