<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
$p_id         = $args['p_id'] ?? '';
$current_step = $args['current_step'] ?? '';
$redirect_url = $args['redirect_url'] ?? '';

$service_type_option = gigneo_option( '_gigneo_ts_service_type', 'both' );
$service_type_meta   = gigneo_post_meta( $p_id, '_gigneo_pm_type' );

if ( 'remote' === $service_type_option || 'remote' === $service_type_meta ) {
	return;
}

$delivery_type = gigneo_post_meta( $p_id, '_gigneo_pm_delivery_type' );
$delivery_type = ! empty( $delivery_type ) ? $delivery_type : 'both';
?>
<div class="gn-edit-service-section">
	<div class="gn-head">
		<div class="gn-heading-area">
			<h3 class="gn-title"><?php echo esc_html__( 'Onsite delivery', 'gigneo' ); ?></h3>
			<p class="gn-description"><?php echo esc_html__( 'Specifies if the service is delivered at client side or your side.', 'gigneo' ); ?></p>
		</div>
	</div>
	<div class="gn-body">
		<div class="gn-form-fields">
			<div class="gn-form-field gn-onsite-delivery-type">
				<div class="gn-radio">
					<input type="radio" name="delivery_type" class="gn-required-field"
							id="delivery_type_visit_me"<?php echo esc_attr( 'visit_me' === $delivery_type ? ' checked="checked"' : '' ); ?>
							value="visit_me">
					<label for="delivery_type_visit_me">
						<i class="hi hi-map-pin"></i>
						<span><?php echo esc_html__( 'Client visits me', 'gigneo' ); ?></span>
						<em><?php echo esc_html__( 'Client visits my location', 'gigneo' ); ?></em>
					</label>
				</div>
				<div class="gn-radio">
					<input type="radio" name="delivery_type" class="gn-required-field"
							id="delivery_type_on_location"<?php echo esc_attr( 'on_location' === $delivery_type ? ' checked="checked"' : '' ); ?>
							value="on_location">
					<label for="delivery_type_on_location">
						<i class="hi hi-arrow-right"></i>
						<span><?php echo esc_html__( "At client's place", 'gigneo' ); ?></span>
						<em><?php echo esc_html__( 'I will travel to client’s location', 'gigneo' ); ?></em>
					</label>
				</div>
				<div class="gn-radio">
					<input type="radio" name="delivery_type" class="gn-required-field"
							id="delivery_type_both"<?php echo esc_attr( 'both' === $delivery_type ? ' checked="checked"' : '' ); ?>
							value="both">
					<label for="delivery_type_both">
						<i class="hi hi-arrows-right-left"></i>
						<span><?php echo esc_html__( 'Both options', 'gigneo' ); ?></span>
						<em><?php echo esc_html__( 'Available for both type', 'gigneo' ); ?></em>
					</label>
				</div>
			</div>
		</div>
	</div>
</div>

