prefix . "services`"; $ser=$wpdb->get_row("select * From $table_name where service_name = 'Haircut'"); $slots = $ser->service_durationvalue; $slots = "+".$slots." minute"; $t1 = substr_replace($sttm, ':00', 5); $edtm = date('H:iA', strtotime($slots, strtotime($t1))); $eddt = $stdt; $desc=$_POST['desc']; global $wpdb; $table_name = $wpdb->prefix . "booked_appointments"; $insert_booking = "INSERT INTO $table_name ( `bk_ap_id` , `bk_ap_name` , `bk_ap_email` , `bk_ap_service` , `bk_ap_cellno` , `bk_ap_sttime` , `bk_ap_edtime` , `bk_ap_stdate` , `bk_ap_eddate` , `bk_ap_desc` ) VALUES ( NULL , '$name', '$email', '$service', '$cellno', '$sttm', '$edtm', '$stdt', '$eddt', '$desc' );"; if($sttm) { $wpdb->query($insert_booking); include('gmail/user-booking-pending-notification.php'); include('gmail/admin-new-booking-notification.php'); echo ""; } else { echo ""; } } include('booking-form.php'); global $wpdb; $table_name = $wpdb->prefix . "calendar_event"; $x = $wpdb->get_results("select * from $table_name"); foreach( $x as $xx) { $xtitle[] = $xx->ev_title; $xst[] = $xx->ev_start_time; $xet[] = $xx->ev_end_time; } ?>