<?php
/**
 * @package     CMGiftCard
 * @subpackage  com_cmgiftcard
 * @copyright   Copyright (C) 2016-2024 CMExension
 * @license     GNU General Public License version 2 or later
 */

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;

$cards = isset($displayData['cards']) ? $displayData['cards'] : array();
?>
<?php if (count($cards)) : ?>
	<?php $total = 0; ?>
	<table style="width: 100%;" border="0" cellspacing="0" cellpadding="2">
		<tbody>
		<?php foreach ($cards as $card) : ?>
			<?php $total += $card->amount; ?>
			<tr>
				<td style="width: 70%;"><?php echo $card->design_title; ?></td>
				<td style="width: 30%; text-align: right;"><?php echo HTMLHelper::_('cmgiftcard.formatPrice', $card->amount); ?></td>
			</tr>
		<?php endforeach; ?>
			<tr>
				<td style="width: 70%;"><strong><?php echo Text::_('COM_CMGIFTCARD_TOTAL'); ?></strong></td>
				<td style="width: 30%; text-align: right;"><?php echo HTMLHelper::_('cmgiftcard.formatPrice', $total); ?></td>
			</tr>
		</tbody>
	</table>
<?php endif;