Ejemplo n.º 1
0
/**
 * @return a HTML string that can be used in an e-mail, listing all prices
 */
function get_html_premium_prices()
{
    $prices = array();
    foreach (get_site_config('premium_currencies') as $currency) {
        $prices[] = "  " . get_currency_abbr($currency) . ": " . number_format_autoprecision(get_premium_price($currency, 'monthly')) . " " . get_currency_abbr($currency) . "/month, or " . number_format_autoprecision(get_premium_price($currency, 'yearly')) . " " . get_currency_abbr($currency) . "/year" . (get_site_config('premium_' . $currency . '_discount') ? " (" . (int) (get_site_config('premium_' . $currency . '_discount') * 100) . "% off)" : "");
    }
    return implode("<br>\n", $prices);
}
Ejemplo n.º 2
0
    echo htmlspecialchars(get_currency_name($currency));
    ?>
</span></th>
  <td class="prices">
    <?php 
    if (get_site_config('premium_' . $currency . '_discount')) {
        ?>
    <div class="discounted"><?php 
        echo t(":cost1 per month, or :cost2 per year", array(':cost1' => currency_format($currency, get_site_config('premium_' . $currency . '_monthly')), ':cost2' => currency_format($currency, get_site_config('premium_' . $currency . '_yearly'))));
        ?>
</div>
    <?php 
    }
    ?>
    <?php 
    echo t(":cost1 per month, or :cost2 per year", array(':cost1' => currency_format($currency, get_premium_price($currency, 'monthly')), ':cost2' => currency_format($currency, get_premium_price($currency, 'yearly'))));
    ?>
  </td>
  <td class="buttons">
    <form action="<?php 
    echo htmlspecialchars(url_for('purchase'));
    ?>
" method="post">
      <input type="hidden" name="currency" value="<?php 
    echo htmlspecialchars($currency);
    ?>
">
      <input type="submit" value="<?php 
    echo ht("Purchase");
    ?>
">
Ejemplo n.º 3
0
    <?php 
echo ht("OR");
?>
  </td>
</tr>
<tr>
  <th><?php 
echo t("Purchase years (:cost/year)", array(':cost' => currency_format($currency, get_premium_price($currency, 'yearly'))));
?>
</td>
  <td>
    <select name="years" id="yearly">
      <option value="0" selected></option>
      <?php 
for ($i = 1; $i <= 5; $i++) {
    echo "<option value=\"{$i}\">" . htmlspecialchars(plural("year", $i)) . " " . currency_format($currency, wrap_number(get_premium_price($currency, 'yearly') * $i, 8), 8) . "</option>\n";
}
?>
    </select>
  </td>
</tr>
<tr>
  <td colspan="2" class="buttons">
    <input type="hidden" name="currency" value="<?php 
echo htmlspecialchars($currency);
?>
">
    <button type="submit" class="purchase_button"><span class="currency_name_<?php 
echo htmlspecialchars($currency);
?>
">Purchase</span></button>