Exemplo n.º 1
0
 public function actionCurrency()
 {
     $depdrop_parents = Yii::$app->request->post('depdrop_parents');
     if (!empty($depdrop_parents) && isset($depdrop_parents[0])) {
         $billing_id = $depdrop_parents[0];
         $out = Currency::getCurrenciesByBilling($billing_id);
         echo Json::encode(['output' => $out, 'selected' => '']);
         Yii::$app->end();
     }
     echo Json::encode(['output' => null, 'selected' => '']);
 }
Exemplo n.º 2
0
            <div class="row">
                <ul class="total-transactions">
                <?php 
foreach ($totalAmounts as $typeId => $totalAmount) {
    ?>
                        <li class="<?php 
    echo TransactionHelper::getClassesForType($typeId);
    ?>
">
                            <span class="label-type-transaction"><?php 
    echo TransactionHelper::getValue($typeId);
    ?>
</span>
                            <ul><?php 
    foreach ($totalAmount as $currencyId => $total) {
        echo Html::tag('li', number_format($total, 2, '.', ' ') . ' ' . Currency::findOne(['id' => $currencyId])->title);
    }
    ?>
                            </ul>
                        </li><?php 
}
?>
                </ul>
            </div>
        </div>
        <div class="col-md-10">
            <div class="col-md-4">
                <?php 
echo ButtonDropdown::widget(['label' => 'Новый расход', 'tagName' => 'a', 'options' => ['class' => 'btn-sm btn-success', 'href' => Yii::$app->urlManager->createUrl(['transaction/new'])], 'split' => true, 'dropdown' => ['items' => [['label' => 'Новый расход', 'url' => Yii::$app->urlManager->createUrl(['transaction/new'])], ['label' => 'Новый доход', 'url' => Yii::$app->urlManager->createUrl(['transaction/new-income'])], ['label' => 'Новый перевод', 'url' => Yii::$app->urlManager->createUrl(['transaction/transfer'])]]]]);
?>
            </div>