<?php
if (isset($tpl['bi_arr']) && !empty($tpl['bi_arr']))
{
	?>
	<table class="pj-table b10 float_left" cellpadding="0" cellspacing="0" style="width: 100%">
		<thead>
			<tr>
				<th><?php __('booking_i_name'); ?></th>
				<th class="w40 align_right"><?php __('booking_i_qty'); ?></th>
				<th class="w90 align_right"><?php __('booking_i_unit_price'); ?></th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody>
		<?php
		foreach ($tpl['bi_arr'] as $item)
		{
			?>
			<tr>
				<td><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=<?php echo $item['type'] === 'item' ? 'pjAdminItems' : 'pjAdminPackages'; ?>&amp;action=pjActionUpdate&amp;id=<?php echo $item['foreign_id']; ?>"><?php echo pjSanitize::html(@$item['name']); ?></a>
				</td>
				<td class="align_right"><?php echo (int) $item['qty']; ?></td>
				<td class="align_right"><?php echo pjUtil::formatCurrencySign(number_format($item['unit_price'], 2), $tpl['option_arr']['o_currency']); ?></td>
				<td class="w60">
					<?php
					if (!isset($_GET['hash']) || empty($_GET['hash']))
					{
						?><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminBookings" class="pj-table-icon-edit item-edit" data-id="<?php echo @$item['id']; ?>" data-hash="<?php echo @$_GET['hash']; ?>" data-key="<?php echo $item['foreign_id'].'~'.$item['type']; ?>"></a><?php
					}
					?>
					<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminBookings" class="pj-table-icon-delete item-delete" data-id="<?php echo @$item['id']; ?>" data-hash="<?php echo @$_GET['hash']; ?>" data-key="<?php echo $item['foreign_id'].'~'.$item['type']; ?>"></a>
				</td>
			</tr>
			<?php
		}
		?>
		</tbody>
	</table>
	<?php
} else {
	?><span class="left"><?php __('booking_i_empty'); ?></span><?php
}
?>