<?php
/**
 * Event search filter block.
 *
 * @package EventimUSEventListings
 */

defined( 'ABSPATH' ) || exit;
?>
<div class="dashboard-module">
	<div class="module-header">
		<h1><?php esc_html_e( 'Search', 'eventim-us-event-listings' ); ?></h1>
	</div>
	<div class="module-content">
		<div class="settings-form">
			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Shortcode', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="input-with-button">
						<input id="event-search-shortcode-input" class="shortcode-info-input regular-text" type="text"
							value="[<?php echo esc_attr( $evuselConfig::SHORTCODE_EVENT_SEARCH . " fields='" . implode( ',', $parameters ) . "'" ); ?>]">
						<button type="button" class="see-menu-item dispevli-menu-item-active copy-shortcode"
							onclick="copyShortcode(this)">
							<?php esc_html_e( 'Copy', 'eventim-us-event-listings' ); ?>
						</button>
					</div>
				</div>
			</div>

			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Shortcode for displaying search results', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="input-with-button">
						<input class="shortcode-info-input regular-text" type="text"
							value="[<?php echo esc_attr( $evuselConfig::SHORTCODE_EVENT_SEARCH_RESULTS ); ?>]">
						<button type="button" class="see-menu-item dispevli-menu-item-active copy-shortcode"
							onclick="copyShortcode(this)">
							<?php esc_html_e( 'Copy', 'eventim-us-event-listings' ); ?>
						</button>
					</div>
				</div>
			</div>

			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'PHP code for displaying search results', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="input-with-button">
						<div class="code-display text-ellipsis">
							<?php echo esc_html( '<?php echo do_shortcode(\'[' . $evuselConfig::SHORTCODE_EVENT_SEARCH_RESULTS . ']\'); ?>' ); ?>
						</div>
						<button type="button" class="see-menu-item dispevli-menu-item-active copy-shortcode"
							onclick="copyCodeText(this)">
							<?php esc_html_e( 'Copy', 'eventim-us-event-listings' ); ?>
						</button>
					</div>
				</div>
			</div>

			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Parameters', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="radio-options connected-radio-options">
						<div class="radio-option">
							<input <?php echo in_array( 'genre', $parameters ) ? 'checked' : ''; ?> value="genre"
								name="evusel_settings[shortcodes][event_search][search_parameters][]"
								type="checkbox">
							<label><?php esc_html_e( 'Genre', 'eventim-us-event-listings' ); ?></label>
						</div>
						<div class="radio-option">
							<input <?php echo in_array( 'event_title', $parameters ) ? 'checked' : ''; ?>
								value="event_title"
								name="evusel_settings[shortcodes][event_search][search_parameters][]"
								type="checkbox">
							<label><?php esc_html_e( 'Event Title', 'eventim-us-event-listings' ); ?></label>
						</div>
						<div class="radio-option">
							<input <?php echo in_array( 'location', $parameters ) ? 'checked' : ''; ?> value="location"
								name="evusel_settings[shortcodes][event_search][search_parameters][]"
								type="checkbox">
							<label><?php esc_html_e( 'Location', 'eventim-us-event-listings' ); ?></label>
						</div>
						<div class="radio-option">
							<input <?php echo in_array( 'supporting_talent', $parameters ) ? 'checked' : ''; ?>
								value="supporting_talent"
								name="evusel_settings[shortcodes][event_search][search_parameters][]"
								type="checkbox">
							<label><?php esc_html_e( 'Supporting Talent', 'eventim-us-event-listings' ); ?></label>
						</div>
						<div class="radio-option">
							<input <?php echo in_array( 'headliners', $parameters ) ? 'checked' : ''; ?>
								value="headliners"
								name="evusel_settings[shortcodes][event_search][search_parameters][]"
								type="checkbox">
							<label><?php esc_html_e( 'Headliners', 'eventim-us-event-listings' ); ?></label>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>