| 1 |
<?php |
| 2 |
/** |
| 3 |
* Database Result |
| 4 |
* |
| 5 |
* @package Wow Plugin |
| 6 |
* @copyright Copyright (c) 2018, Dmytro Lobov |
| 7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 8 |
* @since 1.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 |
global $wpdb; |
| 13 |
$data = $wpdb->prefix . 'wow_' . $this->plugin_pref; |
| 14 |
$info = ( isset( $_REQUEST['info'] ) ) ? sanitize_text_field( $_REQUEST['info'] ) : ''; |
| 15 |
if ( $info == 'saved' ) { |
| 16 |
echo '<div class="updated" id="message"><p><strong>' . __( 'Record Added', 'wpcoder' ) . '</strong>.</p></div>'; |
| 17 |
} |
| 18 |
elseif ( $info == 'update' ) { |
| 19 |
echo '<div class="updated" id="message"><p><strong>' . __( 'Record Updated', 'wpcoder' ) . '</strong>.</p></div>'; |
| 20 |
} |
| 21 |
elseif ( $info == 'delete' ) { |
| 22 |
$delid = absint( $_GET['did'] ); |
| 23 |
$page = ( isset( $_REQUEST['page'] ) ) ? sanitize_text_field( $_REQUEST['page'] ) : ''; |
| 24 |
$page_tool = explode('-', $page); |
| 25 |
$wpdb->query( 'delete from ' . $data . ' where id=' . $delid ); |
| 26 |
echo '<div class="updated" id="message"><p><strong>' . __( 'Record Deleted', 'wpcoder' ) . '</strong>.</p></div>'; |
| 27 |
} |
| 28 |
$resultat = $wpdb->get_results( 'SELECT * FROM ' . $data . ' order by id asc' ); |