prefix . "ap_services"; $ServiceDetails = $wpdb->get_row($wpdb->prepare("SELECT * FROM `$ServiceTable` WHERE `id` =%s",$sid)); $ServiceDetails->category_id; } else { $ServiceDetails = NULL; } ?>
   " >
   " >
   Enter Numeric Value.
Eg: 5, 10, 15, 30, 60", "appointzilla"); ?>" >
   " >
   Enter Numeric Value
Eg: 5 , 10, 25, 50, 100, 150", "appointzilla"); ?>" >
   " >
   " >
   
alert("Sorry, your nonce did not verify.");'; return false; } $servicename = sanitize_text_field( $_POST['name'] ); $desc = sanitize_text_field( $_POST['desc'] ); $Duration = intval( $_POST['Duration'] ); $durationunit = sanitize_text_field( $_POST['durationunit'] ); if(isset($_POST['cost'])){ $cost = intval( $_POST['cost'] ); } else { $cost = 0; } $availability = sanitize_text_field( $_POST['availability'] ); $category = intval( $_POST['category'] ); $ServiceTable = $wpdb->prefix . "ap_services"; if($wpdb->query($wpdb->prepare("INSERT INTO `$ServiceTable` ( `name` , `desc` , `duration` , `unit` , `cost` , `availability`, `category_id` ) VALUES ('$servicename', '$desc', '$Duration', '$durationunit', '$cost', '$availability', %s);",$category))) { echo ""; } echo ""; } //update a service if(isset($_POST['updateservice'])) { if( !wp_verify_nonce($_POST['appointment_create_service_nonce_check'],'appointment_create_service_nonce_check') ){ echo ''; return false; } $sid = intval( $_GET['sid'] ); $ServiceName = sanitize_text_field( $_POST['name'] ); $desc = sanitize_text_field( $_POST['desc'] ); $Duration = intval( $_POST['Duration'] ); $durationunit = sanitize_text_field( $_POST['durationunit'] ); if(isset($_POST['cost'])){ $cost = intval( $_POST['cost'] ); } else { $cost = 0; } //$cost = intval( $_POST['cost'] ); $availability = sanitize_text_field( $_POST['availability'] ); $category = intval( $_POST['category'] ); $ServiceTable = $wpdb->prefix . "ap_services"; $wpdb->query($wpdb->prepare("UPDATE `$ServiceTable` SET `name` = '$ServiceName', `desc` = '$desc', `duration` = '$Duration', `unit` = '$durationunit', `cost` = '$cost', `availability` = '$availability', `category_id` = '$category' WHERE `id` = %s;",$sid)); echo ""; echo ""; } ?>