<?php
/**
 * Panel de tintas / colores para programación de impresión (tiro y retiro).
 *
 * @package Logistica
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$tintas_color_options = array(
	'cyan'     => __( 'Cyan', 'logistica' ),
	'magenta'  => __( 'Magenta', 'logistica' ),
	'amarillo' => __( 'Amarillo', 'logistica' ),
	'negro'    => __( 'Negro', 'logistica' ),
	'otro'     => __( 'Otro', 'logistica' ),
);
?>
<div class="logistica-planeacion__form-span-2 logistica-planeacion__labor-section logistica-planeacion__tintas-panel" data-planeacion-labor-section="tintas_colores">
	<div class="logistica-planeacion__tintas-metrics">
		<label class="logistica-planeacion__tintas-count">
			<span><?php esc_html_e( 'Tintas', 'logistica' ); ?></span>
			<span class="logistica-planeacion__tintas-x">
				<input type="text" inputmode="numeric" data-planeacion-tintas-field="count_tiro" placeholder="0" aria-label="<?php esc_attr_e( 'Tintas tiro', 'logistica' ); ?>">
				<span class="logistica-planeacion__tintas-x-sep" aria-hidden="true">×</span>
				<input type="text" inputmode="numeric" data-planeacion-tintas-field="count_retiro" placeholder="0" aria-label="<?php esc_attr_e( 'Tintas retiro', 'logistica' ); ?>">
			</span>
		</label>
		<label>
			<span><?php esc_html_e( 'Tiros x Color', 'logistica' ); ?></span>
			<input type="text" data-planeacion-tintas-field="tiros_x_color">
		</label>
		<label>
			<span><?php esc_html_e( 'Pasadas', 'logistica' ); ?></span>
			<input type="number" min="0" step="1" data-planeacion-tintas-field="pasadas" value="0">
		</label>
		<label>
			<span><?php esc_html_e( 'Total tiraje', 'logistica' ); ?></span>
			<input type="text" data-planeacion-tintas-field="total_tiraje" placeholder="<?php esc_attr_e( 'Ej. 867 TIR', 'logistica' ); ?>">
		</label>
		<label>
			<span><?php esc_html_e( 'No. planchas', 'logistica' ); ?></span>
			<input type="number" min="0" step="0.01" data-planeacion-tintas-field="num_planchas" value="0">
		</label>
	</div>

	<?php foreach ( array( 'tiro' => __( 'Tiro', 'logistica' ), 'retiro' => __( 'Retiro', 'logistica' ) ) as $side_key => $side_label ) : ?>
		<div class="logistica-planeacion__tintas-side" data-planeacion-tintas-side="<?php echo esc_attr( $side_key ); ?>">
			<div class="logistica-planeacion__tintas-side-head">
				<label class="logistica-planeacion__tintas-side-toggle">
					<input type="checkbox" data-planeacion-tintas-side-active="<?php echo esc_attr( $side_key ); ?>">
					<span><?php echo esc_html( $side_label ); ?></span>
				</label>
				<div class="logistica-planeacion__tintas-colors">
					<?php foreach ( $tintas_color_options as $color_key => $color_label ) : ?>
						<label class="logistica-planeacion__tintas-color">
							<input type="checkbox" data-planeacion-tintas-color="<?php echo esc_attr( $side_key . ':' . $color_key ); ?>" disabled>
							<span class="logistica-planeacion__tintas-color-box" aria-hidden="true"></span>
							<span class="logistica-planeacion__tintas-color-label"><?php echo esc_html( $color_label ); ?></span>
						</label>
					<?php endforeach; ?>
				</div>
			</div>
			<div class="logistica-planeacion__tintas-pantones">
				<span class="logistica-planeacion__tintas-pantones-label"><?php esc_html_e( 'Pantones', 'logistica' ); ?></span>
				<div class="logistica-planeacion__tintas-pantones-grid">
					<?php for ( $i = 1; $i <= 5; $i++ ) : ?>
						<input type="text" data-planeacion-tintas-pantone="<?php echo esc_attr( $side_key . ':' . $i ); ?>" placeholder="<?php echo esc_attr( (string) $i ); ?>" disabled>
					<?php endfor; ?>
				</div>
				<label class="logistica-planeacion__tintas-mezcla">
					<span><?php esc_html_e( 'Mezcla', 'logistica' ); ?></span>
					<input type="text" data-planeacion-tintas-mezcla="<?php echo esc_attr( $side_key ); ?>" disabled>
				</label>
			</div>
		</div>
	<?php endforeach; ?>
</div>
