shortcodes->ssa_upcoming_appointments() $upcoming_appointments = ssa()->appointment_model->query( $atts ); $settings = ssa()->settings->get(); $date_format = SSA_Utils::localize_default_date_strings($settings['global']['date_format']); $time_format = SSA_Utils::localize_default_date_strings($settings['global']['time_format']); ?>
staff_appointment_model->get_staff_details_for_appointment_id( $upcoming_appointment['id'] ); $resources = ssa()->resource_appointment_model->get_resource_details( $upcoming_appointment['id'] ); $show_staff_image = false; $show_staff_name = false; $show_appointment_type = false; $hide_team_member = false; $hide_resources = false; $show_all_resources = false; if (!empty($atts['block_settings']['memberInformation']) && is_array($atts['block_settings']['memberInformation'])) { foreach ($atts['block_settings']['memberInformation'] as $setting) { if ($setting['value'] === 'Display Team Members' && $setting['checked'] == "true") { $hide_team_member = true; } if ($setting['value'] === 'Display Member Images' && $setting['checked'] == "true") { $show_staff_image = true; } if ($setting['value'] === 'Display Member Names' && $setting['checked'] == "true") { $show_staff_name = true; } } } if (!empty($atts['block_settings']['memberInfo']) && is_array($atts['block_settings']['memberInfo'])) { if (in_array('Display Team Members', $atts['block_settings']['memberInfo'])) { $hide_team_member = true; } if (in_array('Display Member Images', $atts['block_settings']['memberInfo'])) { $show_staff_image = true; } if (in_array('Display Member Names', $atts['block_settings']['memberInfo'])) { $show_staff_name = true; } } if (!empty($atts['block_settings']['appointmentDisplay'])) { if (is_array($atts['block_settings']['appointmentDisplay'])) { foreach ($atts['block_settings']['appointmentDisplay'] as $options) { if ($options['value'] === 'Display Appointment Types' && $options['checked'] == "true") { $show_appointment_type = true; } } } else { $show_appointment_type = true; } } if (!empty($atts['block_settings']['resourceDisplay'])) { if (is_array($atts['block_settings']['resourceDisplay'])) { foreach ($atts['block_settings']['resourceDisplay'] as $options) { if ($options['value'] === 'Display Resources' && $options['checked'] == "true") { $hide_resources = true; } } } elseif ($atts['block_settings']['resourceDisplay'] === 'Display Resources'){ $hide_resources = true; } } if (!empty($atts['block_settings']['allResourcesTypeOption'])) { if (is_array($atts['block_settings']['allResourcesTypeOption'])) { foreach ($atts['block_settings']['allResourcesTypeOption'] as $options) { if ($options['value'] === 'All' && $options['checked'] == "true") { $show_all_resources = true; } } } elseif ($atts['block_settings']['allResourcesTypeOption'] === 'All') { $show_all_resources = true; } } ?>
1) { if (!$hide_team_member && $show_staff_image) { $count = 0; echo "
"; foreach ($staff_details as $staff_member) { $position_class = ($count === 0) ? 'secondary-image' : 'primary-image'; echo ''; $count++; if ($count >= 2) { break; } } echo "
"; } } elseif (is_array($staff_details) && count($staff_details) === 1) { if ($staff_details) { if (!$hide_team_member && $show_staff_image) { echo ''; } } } ?>
setTimezone($customer_timezone)->format($date_format); $localized_time = $upcoming_appointment_datetime->setTimezone($customer_timezone)->format($time_format. ' (T)'); $localized_date = SSA_Utils::translate_formatted_date($localized_date); echo '

' . esc_html__($localized_date, 'simply-schedule-appointments') . ' ' . esc_html__('at', 'simply-schedule-appointments') . ' ' . esc_html__($localized_time, 'simply-schedule-appointments') . '

'; $upcoming_appointment_type = new SSA_Appointment_Type_Object( $upcoming_appointment['appointment_type_id'] ); $upcoming_appointment_title = $upcoming_appointment_type->get_title(); if ($staff_details && $show_appointment_type && !$hide_team_member && $show_staff_name) { echo '

' . esc_html__($upcoming_appointment_title, 'simply-schedule-appointments') . ' ' . esc_html__('with', 'simply-schedule-appointments') . ' '; $staff_names = array_map('esc_html', array_column($staff_details, 'name')); echo '' . implode(', ', $staff_names) . ''; echo '

'; } elseif ($staff_details && !$hide_team_member && $show_staff_name) { echo '

' . esc_html__('With', 'simply-schedule-appointments') . ' '; $staff_names = array_map('esc_html', array_column($staff_details, 'name')); echo '' . implode(', ', $staff_names) . ''; echo '

'; } elseif ($show_appointment_type) { echo '

' . esc_html__($upcoming_appointment_title, 'simply-schedule-appointments') . '

'; } elseif ( filter_var( $atts['appointment_type_displayed'], FILTER_VALIDATE_BOOLEAN ) ) { echo '

' . esc_html__($upcoming_appointment_title, 'simply-schedule-appointments') . '

'; } ?>
    ' . esc_html__($resource['group_title'] . ': ' . $resource['resource_title'], 'simply-schedule-appointments') . ''; } } } } else { foreach ($resources as $resource) { echo '
  • ' . esc_html__($resource['group_title'] . ': ' . $resource['resource_title'], 'simply-schedule-appointments') . '
  • '; } } } ?>
appointment_model->get_public_edit_url($upcoming_appointment['id']) . '\', \'_blank\')">' . wp_kses_post( $atts['details_link_label'] ) . ''; } ?>