PluginProbe ʕ •ᴥ•ʔ
Interactive Image Map Builder / 1.8
Interactive Image Map Builder v1.8
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1
interactive-image-map-builder / home.php
interactive-image-map-builder Last commit date
assets 2 years ago settings 2 years ago functions.php 2 years ago header.php 2 years ago home.php 2 years ago index.php 2 years ago license.php 2 years ago output-common-css.css 2 years ago output-css.php 2 years ago readme.txt 2 years ago shortcode.php 2 years ago template-menu.php 2 years ago
home.php
63 lines
1 <?php
2 if (! defined('ABSPATH')) {
3 exit;
4 }
5 if (! current_user_can('manage_options')) {
6 wp_die(__('You do not have sufficient permissions to access this page.'));
7 }
8
9 if (! empty($_POST['delete']) && isset($_POST['id']) && is_numeric($_POST['id'])) {
10 $nonce = $_REQUEST['_wpnonce'];
11 if (! wp_verify_nonce($nonce, 'tss_nonce_field_delete')) {
12 die('You do not have sufficient permissions to access this page.');
13 } else {
14 $id = (int) sanitize_text_field($_POST['id']);
15 $wpdb->query($wpdb->prepare("DELETE FROM {$style_table} WHERE id = %d", $id));
16 }
17 }
18 if (!empty($_POST['duplicate']) && isset($_POST['id']) && is_numeric($_POST['id'])) {
19 $nonce = $_REQUEST['_wpnonce'];
20 if (!wp_verify_nonce($nonce, 'isimb_6310_nonce_field_duplicate')) {
21 die('You do not have sufficient permissions to access this page.');
22 } else {
23 $id = (int) $_POST['id'];
24 $selectedData = $wpdb->get_row($wpdb->prepare("SELECT * FROM $style_table WHERE id = %d ", $id), ARRAY_A);
25 $dupList = array(
26 $selectedData['name'],
27 $selectedData['style_name'],
28 $selectedData['css'],
29 $selectedData['itemids']);
30 $wpdb->query($wpdb->prepare("INSERT INTO {$style_table} (name, style_name, css,itemids) VALUES ( %s, %s, %s, %s )", $dupList));
31 }
32 }
33
34 ?>
35
36 <h3>Image builder</h3>
37 <button class="isimb-6310-btn-success isimb-6310-add-new-button"><a href="<?php echo admin_url("admin.php?page=isimb-6310-image-map-builder&action=preview") ?>">Add New</a></button>
38
39 <table class="isimb-6310-table">
40 <tr style="background-color: #f5f5f5">
41 <td style="width: 130px">Service Name</td>
42 <td>Shortcode</td>
43 <td style="width: 130px">Manage</td>
44 </tr>
45 <?php
46 $data = $wpdb->get_results('SELECT * FROM '.$style_table.' ORDER BY id DESC', ARRAY_A);
47 foreach ($data as $value) {
48 echo '<tr class="isimb-6310-row-select">';
49 echo '<td>'.isimb_6310_replace(esc_attr($value['name'])).'</td>';
50 echo '<td><span>Shortcode <input type="text" class="isimb-6310-6330-shortcode" onclick="this.setSelectionRange(0, this.value.length)" value="[isimb_6310_builder id=&quot;'.esc_attr($value['id']).'&quot;]"></span>';
51 echo '<td>
52 <a href="'.admin_url("admin.php?page=isimb-6310-image-map-builder&action=preview&styleid=".esc_attr($value['id'])).'" title="Edit" class="isimb-6310-btn-success isimb-6310-margin-right-10 isimb-6310-first"><i class="fas fa-edit" aria-hidden="true"></i></a>
53 <form method="post">
54 '.wp_nonce_field('tss_nonce_field_delete').'
55 <input type="hidden" name="id" value="'.esc_attr($value['id']).'">
56 <button class="isimb-6310-btn-danger isimb-6310-third" title="Delete" type="submit" value="delete" name="delete" onclick="return confirm(\'Do you want to delete?\');"><i class="far fa-times-circle" aria-hidden="true"></i></button>
57 </form>
58
59 </td>';
60 echo ' </tr>';
61 }
62 ?>
63 </table>