<?php
/**
 * GFB Top Filter Admin Calendar View
 *
 * @package GFB.
 */

if (!defined('ABSPATH')) {
	exit; // Exit if accessed directly.
}
?>
<div class="main-reports--div">
	<div class="calander-content">
		<div class="calander-top-heading">
			<h2><?php echo esc_html__('Calendar', 'appointment-and-booking-for-gravity-forms'); ?></h2>
		</div>
		<div class="calander-top-loaction">
			<?php
			$all_locations = APBGF_Location::all_location();
			$first_location_id = ( is_object( $all_locations ) && isset( $all_locations->ID ) ) ? absint( $all_locations->ID ) : '';
			?>
				<!-- Just a hidden input with the first location -->
				<input type="hidden" class="apbgf_location" value="<?php echo esc_attr($first_location_id); ?>">

			<?php
			$all_service = APBGF_Service::all_service();
			if (is_array($all_service) && count($all_service) > 0) {
				?>
				<select class="apbgf_service">
					<option value="all"><?php echo esc_html($apbgf_settings['apbgf_label_service']); ?></option>
					<?php
					foreach ($all_service as $value) {
						echo '<option value="' . esc_attr($value->ID) . '">' . esc_attr($value->post_title) . '</option>';
					}
					?>
				</select>
				<?php
			}
			?>

			<?php
			$all_staff = APBGF_Staff::all_staff();
			if (is_array($all_staff) && count($all_staff) > 0) {
				?>
				<select class="apbgf_staff">
					<option value="all"><?php echo esc_html($apbgf_settings['apbgf_label_staff']); ?></option>
					<?php
					foreach ($all_staff as $value) {
						$user_id = get_post_meta($value->ID, 'wp_user', true);
						$user = get_userdata($user_id);
						if ($user) {
							echo '<option value="' . esc_attr($value->ID) . '">' . esc_attr($value->post_title) . '</option>';
						}
					}
					?>
				</select>
				<?php
			}
			?>
		</div>
	</div>
	<div class="calander-slots-color">
		<ul>
			<li class="pending">Pending</li>
			<li class="confirmed">Confirmed</li>
			<li class="visited">Visited</li>
			<li class="cancelled">Cancelled</li>
		</ul>
	</div>

</div>