<form action="" method="post" class="pj-form form">
	<input type="hidden" name="item_edit" value="1" />
	<input type="hidden" name="csrf_token" value="<?php echo pjAppController::getCsrfToken(); ?>" />
	<input type="hidden" name="booking_id" value="<?php echo $tpl['arr']['booking_id']; ?>" />
	<input type="hidden" name="booking_item_id" value="<?php echo $tpl['arr']['id']; ?>" />
	<div class="p b10">
		<label class="title"><?php __('booking_i_name'); ?></label>
		<select name="foreign_id" class="pj-form-field w300 stock-product">
			<option value=""><?php __('booking_i_select'); ?></option>
			<optgroup label="<?php __('booking_i_equipment', false, true); ?>">
			<?php
			foreach ($tpl['item_arr'] as $item)
			{
				?><option value="<?php echo $item['type']; ?>_<?php echo $item['id']; ?>"<?php echo $item['id'] != $tpl['arr']['foreign_id'] || $item['type'] != $tpl['arr']['type'] ? NULL : ' selected="selected"'; ?> data-qty="<?php echo (int) $item['cnt']; ?>"><?php echo pjSanitize::html($item['title']); ?></option><?php
			}
			?>
			</optgroup>
			<optgroup label="<?php __('booking_i_packages', false, true); ?>">
			<?php
			foreach ($tpl['package_arr'] as $item)
			{
				?><option value="<?php echo $item['type']; ?>_<?php echo $item['id']; ?>"<?php echo $item['id'] != $tpl['arr']['foreign_id'] || $item['type'] != $tpl['arr']['type'] ? NULL : ' selected="selected"'; ?> data-qty="<?php echo (int) $item['cnt']; ?>"><?php echo pjSanitize::html($item['title']); ?></option><?php
			}
			?>
			</optgroup>
		</select>
	</div>
	
	<div class="item_details" style="display: block">
		<p>
			<label class="title"><?php __('booking_i_qty'); ?></label>
			<input type="text" name="qty" class="pj-form-field w80" data-max="<?php echo (int) $tpl['arr']['max_qty']; ?>" value="<?php echo (int) $tpl['arr']['qty']; ?>" readonly="readonly" />
		</p>
	</div>
</form>