Exemplo n.º 1
0
?>
        </div>
</div>
<div class="form-group">
        <label class="col-lg-2 control-label">Company Email:</label>
        <div class="col-lg-5">
                <?php 
echo CHtml::textField('settings[' . Constants::KEY_COMPANY_EMAIL . ']', $settings[Constants::KEY_COMPANY_EMAIL], array('class' => 'form-control', 'type' => 'email'));
?>
        </div>
</div>
<div class="form-group">
        <label class="col-lg-2 control-label">Default Currency:  </label>
        <div class="col-lg-5">
                <?php 
echo CHtml::dropDownList('settings[' . Constants::KEY_CURRENCY . ']', $settings[Constants::KEY_CURRENCY], SettingsCurrency::model()->getListData('id', 'id', false), array('class' => 'form-control'));
?>
        </div>
</div>
<div class="form-group">
        <label class="col-lg-2 control-label">Pagination:  </label>
        <div class="col-lg-5">
                <?php 
echo CHtml::dropDownList('settings[' . Constants::KEY_PAGINATION . ']', $settings[Constants::KEY_PAGINATION], Common::generateIntergersList(10, 100, 10), array('class' => 'form-control'));
?>
        </div>
</div>
<div class="form-group">
        <label class="col-lg-2 control-label">Default Timezone:  </label>
        <div class="col-lg-5">
                <?php 
Exemplo n.º 2
0
 /**
  * Formats an amount to money format e.g $300.00 etc
  * @param double $amount
  * @param integer $decimals defaults to 0
  * @param boolean $symbol If set to TRUE formats using the currency symbol.
  * @return string The formatted amount
  */
 public static function formatMoney($amount, $decimals = 2, $symbol = true)
 {
     $currency = Yii::app()->settings->get(Constants::CATEGORY_GENERAL, Constants::KEY_CURRENCY, 'USD');
     return SettingsCurrency::model()->formatMoney($currency, $amount, $decimals, $symbol);
 }