get_results( "select * from $wpdb->prefix" . "apt_staff" ); $apt_shortcode_service_details = $wpdb->get_results( "SELECT * from $wpdb->prefix" . "apt_services" ); $appointment_category_details = $wpdb->get_results( "SELECT * from $wpdb->prefix" . "apt_category" ); $appearence_table = $wpdb->prefix . "apt_appearence"; $settings_table = $wpdb->prefix . "apt_settings"; ?> first_name . " " . $admin_info->last_name; $first_name = $admin_info->first_name; $last_name = $admin_info->last_name; if ( ! empty( $first_name ) && ! empty( $last_name ) ) { $admin_user_login = $admin_info->first_name . " " . $admin_info->last_name; } else { $admin_user_login = $admin_info->user_login; } $site_url = get_site_url(); $blog_name = get_bloginfo(); $email_settings = get_option( "Appoint_notification" ); /* BOOK APPOINTMENT & SEND EMAIL */ if ( isset( $_REQUEST['appoint_staff_id'] ) ) { $ap_customer_name = sanitize_text_field( $_REQUEST['ap_payment_customer'] ); $ap_staff_id = sanitize_text_field( isset( $_REQUEST['appoint_staff_id'] ) ? $_REQUEST['appoint_staff_id'] : '0' ); $ap_service_name = sanitize_text_field( $_REQUEST['ap_payment_service'] ); $ap_client_contact_detail = sanitize_text_field( $_REQUEST['ap_client_contact_detail'] ); $temp_date = sanitize_text_field( $_REQUEST['ap_payment_date'] ); $ap_booking_date = date( "Y-m-d", strtotime( $temp_date ) ); $ap_start_time = sanitize_text_field( $_REQUEST['ap_booking_start_time'] ); $temp_time = sanitize_text_field( $_REQUEST['ap_booking_end_time'] ); $endTime = strtotime( '+' . $temp_time, strtotime( $ap_start_time ) ); $ap_booking_end_time = date( 'H:i', $endTime ); $client_email_address = sanitize_text_field( $_REQUEST['client_email_address'] ); $appoint_unique_id = sanitize_text_field( $_REQUEST['appoint_unique_id'] ); $ap_payment_staff_email = sanitize_text_field( $_REQUEST['ap_payment_staff_email'] ); $table_name = $wpdb->prefix . "apt_appointments"; $Insert_Appointments = "INSERT INTO `$table_name` (`id` ,client_name,`staff_member` ,`service_type` ,`contact` ,`booking_date` ,`start_time` ,`end_time` ,`status` ,`client_email`, `appt_unique_id` , `staff_email`, `appt_booked_by` , `repeat_appointment`) VALUES ('NULL', '$ap_customer_name', '$ap_staff_id', '$ap_service_name', '$ap_client_contact_detail', '$ap_booking_date', '$ap_start_time', '$ap_booking_end_time', 'pending', '$client_email_address', '$appoint_unique_id', '$ap_payment_staff_email','by_user','Non');"; $wpdb->query( $Insert_Appointments ); $temp_staff_member_name = $wpdb->get_col( "SELECT staff_member_name from $wpdb->prefix" . "apt_services WHERE id='$ap_staff_id'" ); $ap_staff_name = isset( $temp_staff_member_name[0] ) ? $temp_staff_member_name[0] : ''; $notification_enable = $email_settings['enable']; $notification_emailtype = $email_settings['emailtype']; $time_format = get_option( 'time_format' ); $temp_ap_start_time = strtotime( $ap_start_time ); $appt_start_time = date( $time_format, $temp_ap_start_time ); $temp_ap_end_time = strtotime( $ap_booking_end_time ); $appt_end_time = date( $time_format, $temp_ap_end_time ); $appointment_time = $appt_start_time . "-" . $appt_end_time; $date_format = get_option( 'date_format' ); $appt_date = date( $date_format, strtotime( $ap_booking_date ) ); if ( $notification_enable == "yes" ) { //PHP MAIL if ( $notification_emailtype == "phpmail" ) { $notification_admin_email_php = $email_settings['phpemail']; if ( $notification_admin_email_php !== "" ) { //ADMIN PENDING $notification_admin_pending = $email_settings['send_notification_admin_pending']; if ( $notification_admin_pending == "yes" ) { $temp_notification_subject_admin_pending = $email_settings['subject_admin_pending']; $notification_subject_admin_pending = strtr( $temp_notification_subject_admin_pending, array( '[SERVICE_NAME]' => $ap_service_name, '[APPOINTMENT_DATE]' => $appt_date, '[APPOINTMENT_TIME]' => $appointment_time, '[CLIENT_NAME]' => $ap_customer_name, '[CLIENT_EMAIL]' => $client_email_address, '[APPOINTMENT_STATUS]' => 'pending', '[ADMIN_NAME]' => $admin_user_login, '[BLOG_NAME]' => $blog_name, '[SITE_URL]' => $site_url ) ); $temp_notification_body_admin_pending = $email_settings['admin_body_pending']; $notification_body_admin_pending = strtr( $temp_notification_body_admin_pending, array( '[SERVICE_NAME]' => $ap_service_name, '[APPOINTMENT_DATE]' => $appt_date, '[APPOINTMENT_TIME]' => $appointment_time, '[CLIENT_NAME]' => $ap_customer_name, '[CLIENT_EMAIL]' => $client_email_address, '[APPOINTMENT_STATUS]' => 'pending', '[ADMIN_NAME]' => $admin_user_login, '[BLOG_NAME]' => $blog_name, '[SITE_URL]' => $site_url ) ); if ( $notification_subject_admin_pending !== "" && $notification_body_admin_pending !== "" ) { $to_admin_email_pending = $notification_admin_email_php; $subject_admin_pending = $notification_subject_admin_pending; $body_admin_pending = $notification_body_admin_pending; $from_admin_email = $notification_admin_email_php; $header = "From: $admin_user_login <$from_admin_email>" . "\r\n"; $mail_check_client_pending = mail( $to_admin_email_pending, $subject_admin_pending, $body_admin_pending, $header ); } } /* CLIENT PENDING */ $notification_client_pending = $email_settings['send_notification_client_pending']; if ( $notification_client_pending == "yes" ) { $temp_notification_subject_client_pending = $email_settings['subject_notification_client_pending']; $notification_subject_client_pending = strtr( $temp_notification_subject_client_pending, array( '[SERVICE_NAME]' => $ap_service_name, '[APPOINTMENT_DATE]' => $appt_date, '[APPOINTMENT_TIME]' => $appointment_time, '[CLIENT_NAME]' => $ap_customer_name, '[CLIENT_EMAIL]' => $client_email_address, '[APPOINTMENT_STATUS]' => 'pending', '[ADMIN_NAME]' => $admin_user_login, '[BLOG_NAME]' => $blog_name, '[SITE_URL]' => $site_url ) ); $temp_notification_body_client_pending = $email_settings['body_notification_client_pending']; $notification_body_client_pending = strtr( $temp_notification_body_client_pending, array( '[SERVICE_NAME]' => $ap_service_name, '[APPOINTMENT_DATE]' => $appt_date, '[APPOINTMENT_TIME]' => $appointment_time, '[CLIENT_NAME]' => $ap_customer_name, '[CLIENT_EMAIL]' => $client_email_address, '[APPOINTMENT_STATUS]' => 'pending', '[ADMIN_NAME]' => $admin_user_login, '[BLOG_NAME]' => $blog_name, '[SITE_URL]' => $site_url ) ); if ( $notification_subject_client_pending !== "" && $notification_body_client_pending !== "" ) { $to_client_email_pending = $client_email_address; $subject_client_pending = $notification_subject_client_pending; $body_client_pending = $notification_body_client_pending; $from_admin_email = $notification_admin_email_php; $header = "From: $admin_user_login <$from_admin_email>" . "\r\n"; $mail_check_client_pending = mail( $to_client_email_pending, $subject_client_pending, $body_client_pending, $header ); } } } } } } ?>
prefix . "apt_holidays"; $business_holidays1 = $wpdb->get_results( "SELECT * from $holiday_table" ); $weeks_repeat1 = $wpdb->get_var( "SELECT COUNT(*) from $holiday_table where repeat_value ='weekly' " ); $num = $wpdb->num_rows; ?>