コード例 #1
0
		</tr>
	</tbody>
</table>

<table cellpadding="0" cellspacing="0">
	<thead>
		<th colspan="2"><?php 
\pi18n("Payments", PLUGIN_NAME);
?>
</th>
	</thead>
	<tbody>
<?php 
$currSrv = new \Pasteque\CurrenciesService();
foreach ($zticket->payments as $payment) {
    $currency = $currSrv->get($payment->currencyId);
    if ($currency->isMain) {
        $amount = \i18nCurr($payment->amount);
    } else {
        $amount = $currency->format($payment->currencyAmount) . " (" . \i18nCurr($payment->amount) . ")";
    }
    ?>
		<tr>
			<td><?php 
    \pi18n($payment->type);
    ?>
</td>
			<td class="numeric"><?php 
    echo $amount;
    ?>
</td>
コード例 #2
0
} else {
    if (isset($_POST['label'])) {
        $isMain = isset($_POST['isMain']) && $_POST['isMain'];
        $isActive = isset($_POST['isActive']) && $_POST['isActive'];
        $curr = new \Pasteque\Currency($_POST['label'], $_POST['symbol'], $_POST['decimalSeparator'], $_POST['thousandsSeparator'], $_POST['format'], $_POST['rate'], $isMain, $isActive);
        $id = $currSrv->create($curr);
        if ($id !== FALSE) {
            $message = \i18n("Currency saved. <a href=\"%s\">Go to the currency page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'currency_edit', array('id' => $id)));
        } else {
            $error = \i18n("Unable to save changes");
        }
    }
}
$currency = NULL;
if (isset($_GET['id'])) {
    $currency = $currSrv->get($_GET['id']);
} else {
    $currency = new \Pasteque\Currency();
}
?>
<h1><?php 
\pi18n("Edit a currency", PLUGIN_NAME);
?>
</h1>

<?php 
\Pasteque\tpl_msg_box($message, $error);
?>

<form class="edit" action="<?php 
echo \Pasteque\get_current_url();