Example #1
0
                 <td class="numeric<?php 
            echo $class;
            ?>
"<?php 
            echo $help;
            ?>
><?php 
            echo \Pasteque\esc_html($qty);
            ?>
</td>
                 <td><?php 
            echo \Pasteque\esc_html(\i18nCurr($prdSellPrice * $qty));
            ?>
</td>
                 <td><?php 
            echo \Pasteque\esc_html(\i18nCurr($prdBuyPrice * $qty));
            ?>
</td>
                 <td><?php 
            echo \Pasteque\esc_html($security);
            ?>
</td>
                 <td><?php 
            echo \Pasteque\esc_html($max);
            ?>
</td>
		</tr>
<?php 
        }
        ?>
	</tbody>
<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>
		</tr>
<?php 
}
?>
    $i++;
}
if ($i == 0) {
    $content[1][] = \i18n("No payment", PLUGIN_NAME);
    $content[1][] = "";
}
echo \Pasteque\row(\Pasteque\standardTable($content));
unset($content);
$content[0][] = \i18n("Taxes", PLUGIN_NAME);
$content[0][] = \i18n("Base", PLUGIN_NAME);
$content[0][] = \i18n("Amount", PLUGIN_NAME);
$i = 1;
foreach ($zticket->taxes as $tax) {
    $content[$i][] = \Pasteque\TaxesService::getTax($tax["id"])->label;
    $content[$i][] = \i18nCurr($tax['base']);
    $content[$i][] = \i18nCurr($tax['amount']);
    $i++;
}
if ($i == 1) {
    $content[1][] = \i18n("No payment", PLUGIN_NAME);
    $content[1][] = "";
    $content[1][] = "";
}
echo \Pasteque\row(\Pasteque\standardTable($content));
unset($content);
$content[0][] = \i18n("Sales by category", PLUGIN_NAME);
$content[0][] = \i18n("Amount", PLUGIN_NAME);
$i = 1;
foreach ($zticket->catSales as $cat) {
    $content[$i][] = \i18n(\Pasteque\CategoriesService::get($cat["id"]->label, PLUGIN_NAME));
    $content[$i][] = $cat["amount"];
function vatI18nCurr($input)
{
    $amounts = explode("/", $input);
    return \i18nCurr($amounts[0]) . " / " . \i18nCurr($amounts[1]);
}
function displayModule($module, $activatedModules, $pp_id, $sandbox)
{
    $activated = false;
    foreach ($activatedModules as $actMod) {
        if ($actMod == $module['module']) {
            $activated = true;
            break;
        }
    }
    if (!$activated) {
        echo "<td>" . \i18n($module['module'], PLUGIN_NAME) . " (" . \i18nCurr($module['price']) . ")</td>\n";
        $host = $sandbox ? "www.sandbox.paypal.com" : "www.paypal.com";
        echo "<td>";
        echo "<form target=\"paypal\" action=\"https://" . $host . "/cgi-bin/webscr\" method=\"post\" >\n";
        echo "<input type=\"hidden\" name=\"cmd\" value=\"_cart\" />\n";
        echo "<input type=\"hidden\" name=\"business\" value=\"" . \Pasteque\esc_attr($pp_id) . "\" />\n";
        echo "<input type=\"hidden\" name=\"custom\" value=\"" . \Pasteque\esc_attr(\Pasteque\get_user_id()) . "\" />\n";
        echo "<input type=\"hidden\" name=\"lc\" value=\"FR\" />\n";
        echo "<input type=\"hidden\" name=\"item_name\" value=\"" . \Pasteque\esc_attr(\i18n($module['module'], PLUGIN_NAME)) . "\" />\n";
        echo "<input type=\"hidden\" name=\"item_number\" value=\"" . \Pasteque\esc_attr($module['module']) . "\" />\n";
        echo "<input type=\"hidden\" name=\"amount\" value=\"" . $module['price'] . "\" />\n";
        echo "<input type=\"hidden\" name=\"currency_code\" value=\"EUR\" />\n";
        echo "<input type=\"hidden\" name=\"button_subtype\" value=\"products\" />\n";
        echo "<input type=\"hidden\" name=\"no_note\" value=\"0\" />\n";
        echo "<input type=\"hidden\" name=\"cn\" value=\"Ajouter des instructions particulières pour le vendeur :\" />\n";
        echo "<input type=\"hidden\" name=\"no_shipping\" value=\"2\" />\n";
        echo "<input type=\"hidden\" name=\"tax_rate\" value=\"20.000\" />\n";
        echo "<input type=\"hidden\" name=\"add\" value=\"1\" />\n";
        echo "<input type=\"hidden\" name=\"bn\" value=\"PP-ShopCartBF:btn_cart_LG.gif:NonHosted\" />\n";
        echo "<input type=\"image\" src=\"https://" . $host . "/fr_FR/FR/i/btn/btn_cart_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !\" />\n";
        echo "<img alt=\"\" border=\"0\" src=\"https://" . $host . "/fr_FR/i/scr/pixel.gif\" width=\"1\" height=\"1\" />\n";
        echo "</form></td>\n";
    } else {
        echo "<td>" . \i18n($module['module'], PLUGIN_NAME) . "</td>\n";
        echo "<td>" . \i18n("activated", PLUGIN_NAME) . "</td>\n";
    }
}