<?php
/**
 * Admin view: the Door panel of the settings screen.
 *
 * Included by admin/views/settings.php inside that tab's own form, so the
 * closures and the $s array defined there are in scope here.
 *
 * @package BitForgeNet_Guest_Tickets
 */

defined( 'ABSPATH' ) || exit;

// This file is a template: it is included from a method -- never at file
// scope -- so everything declared here belongs to that method's variable
// scope and not to the global one. PHPCS reads each file on its own and has
// no way to see where the include happens, so it reads these as globals.
// Stated once, for the whole file, per this plugin's suppression rule.
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
?>
	<div class="bfnet-panel">
		<div class="bfnet-panel__head"><h2><?php esc_html_e( 'Door', 'bitforgenet-guest-tickets' ); ?></h2></div>
		<div class="bfnet-panel__body">
			<div class="bfnet-field">
				<label for="s-gates"><?php esc_html_e( 'Gates', 'bitforgenet-guest-tickets' ); ?></label>
				<textarea id="s-gates" name="bfnet_settings[gate_names]" rows="3"><?php echo esc_textarea( $s['gate_names'] ); ?></textarea>
				<p class="description"><?php esc_html_e( 'One per line. Agents pick their gate before scanning.', 'bitforgenet-guest-tickets' ); ?></p>
			</div>
			<div class="bfnet-row">
				<div class="bfnet-field">
					<label for="s-before"><?php esc_html_e( 'Open the door (minutes before start)', 'bitforgenet-guest-tickets' ); ?></label>
					<input type="number" id="s-before" name="bfnet_settings[checkin_window_before]" min="0" max="2880" value="<?php echo (int) $s['checkin_window_before']; ?>">
				</div>
				<div class="bfnet-field">
					<label for="s-after"><?php esc_html_e( 'Close the door (minutes after end)', 'bitforgenet-guest-tickets' ); ?></label>
					<input type="number" id="s-after" name="bfnet_settings[checkin_window_after]" min="0" max="2880" value="<?php echo (int) $s['checkin_window_after']; ?>">
				</div>
			</div>
			<?php
			$bfnet_check( 'allow_multi_scan', __( 'Allow a ticket to be scanned more than once', 'bitforgenet-guest-tickets' ), __( 'Leave off: this is what stops one ticket letting five people in.', 'bitforgenet-guest-tickets' ), $s );
			$bfnet_check( 'scan_sound', __( 'Play a sound on each scan', 'bitforgenet-guest-tickets' ), '', $s );
			?>
		</div>
	</div>
