| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Include data param for Wow Plugin |
| 5 |
* |
| 6 |
* @package Wow_Plugin |
| 7 |
* @copyright Copyright (c) 2018, Dmytro Lobov |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 1.0 |
| 10 |
*/ |
| 11 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 |
|
| 13 |
$act = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : ''; |
| 14 |
if ($act == "update") { |
| 15 |
$recid = absint( $_REQUEST["id"] ); |
| 16 |
$result = $wpdb->get_row("SELECT * FROM $data WHERE id=$recid"); |
| 17 |
if ($result){ |
| 18 |
$id = $result->id; |
| 19 |
$title = $result->title; |
| 20 |
$param = unserialize( $result->param ); |
| 21 |
$tool_id = $id; |
| 22 |
$count_ii = (!empty($param['menu_2']['item_type'])) ? count($param['menu_2']['item_type']) : '0'; |
| 23 |
$hidval = 2; |
| 24 |
$btn = __( 'Update', $this->text_domain ); |
| 25 |
} |
| 26 |
} |
| 27 |
else if ($act == "duplicate") { |
| 28 |
$recid = $_REQUEST["id"]; |
| 29 |
$result = $wpdb->get_row("SELECT * FROM $data WHERE id=$recid"); |
| 30 |
if ($result){ |
| 31 |
$id = ""; |
| 32 |
$title = ""; |
| 33 |
$param = unserialize($result->param); |
| 34 |
$last = $wpdb->get_row("SHOW TABLE STATUS LIKE '$data'"); |
| 35 |
$tool_id = $last->Auto_increment; |
| 36 |
$hidval = 1; |
| 37 |
$btn = __( 'Save', $this->text_domain ); |
| 38 |
} |
| 39 |
} |
| 40 |
else { |
| 41 |
$id = ""; |
| 42 |
$title = ""; |
| 43 |
$last = $wpdb->get_row("SHOW TABLE STATUS LIKE '$data'"); |
| 44 |
$tool_id = $last->Auto_increment; |
| 45 |
$param = ''; |
| 46 |
$hidval = 1; |
| 47 |
$btn = __( 'Save', $this->text_domain ); |
| 48 |
} |
| 49 |
|
| 50 |
?> |