All Category

prefix . 'afaq_6310_category'; wp_enqueue_media(); if (!empty($_POST['delete']) && isset($_POST['id']) && is_numeric($_POST['id'])) { $nonce = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce, 'afaq-6310-nonce-field-delete')) { die('You do not have sufficient permissions to access this page.'); } else { $id = (int) sanitize_text_field($_POST['id']); $wpdb->query($wpdb->prepare("DELETE FROM {$category_table} WHERE id = %d", $id)); } } else if (!empty($_POST['save']) && $_POST['save'] == 'Save') { $nonce = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce, 'afaq-6310-nonce-add')) { die('You do not have sufficient permissions to access this page.'); } else { $myData = array(); $myData[] = sanitize_text_field($_POST['name']); $myData[] = 'afaq-6310-' . time(); $myData[] = sanitize_text_field($_POST['description']); $myData[] = sanitize_text_field($_POST['icons_name']); $myData[] = sanitize_text_field($_POST['serial']); $sql = $wpdb->prepare("INSERT INTO {$category_table} set name = %s, class_code = %s, description = %s, icons = %s, serial = %d", $myData); $wpdb->query($sql); } } else if (!empty($_POST['update']) && $_POST['update'] == 'Update') { $nonce = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce, 'afaq-6310-nonce-update')) { die('You do not have sufficient permissions to access this page.'); } else { $id = (int) sanitize_text_field($_POST['eid']); $myData = array(); $myData[] = sanitize_text_field($_POST['name']); $myData[] = sanitize_text_field($_POST['description']); $myData[] = sanitize_text_field($_POST['icons_name']); $myData[] = sanitize_text_field($_POST['serial']); $myData[] = $id; $wpdb->query($wpdb->prepare("UPDATE {$category_table} set name = %s, description = %s, icons = %s, serial = %d where id = %d", $myData)); } } else if (!empty($_POST['edit']) && $_POST['edit'] == 'Edit') { $nonce = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce, 'afaq-6310-nonce-field-edit')) { die('You do not have sufficient permissions to access this page.'); } else { $id = (int) sanitize_text_field($_POST['id']); $faq = $wpdb->get_row($wpdb->prepare("SELECT * FROM $category_table WHERE id = %d ", $id), ARRAY_A); ?> get_results('SELECT * FROM ' . $category_table . ' ORDER BY serial ASC', ARRAY_A); if($data) { foreach ($data as $value) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } } ?>
Name Description Icon Serial Edit Delete
' . esc_attr(afaq_6310_scRemove($value['name'])) . '' . esc_attr(afaq_6310_scRemove($value['description'])) . '' . (esc_attr($value['icons']) ? "" : '---') . '' . esc_attr($value['serial']) . '
' . wp_nonce_field("afaq-6310-nonce-field-edit") . '
' . wp_nonce_field("afaq-6310-nonce-field-delete") . '