Exemplo n.º 1
0
                    }']]);
?>

            <?php 
echo $form->field($model, 'fromAmount')->textInput()->label('Величина (' . $firstValuta . ')*', ['id' => 'fromAmountLabel']);
?>

            <?php 
echo $form->field($model, 'commission')->textInput()->label('Комиссия (' . $firstValuta . ')', ['id' => 'commissionLabel']);
?>

        </div>
        <div class="well">

            <?php 
echo $form->field($model, 'toAccountId')->widget(Select2::classname(), ['data' => AccountsHelper::getListAccounts(), 'options' => ['placeholder' => 'Выберите счет ...'], 'pluginEvents' => ["select2:select" => 'function(e, object) {
                        var label = $("#select2-transferform-toaccountid-container").text();
                        var valuta = label.split("(");
                        valuta = valuta[valuta.length - 1].split(")")[0];
                        $("#toAmountLabel").text("Величина (" + valuta + ")*");
                    }']]);
?>

            <?php 
echo $form->field($model, 'toAmount')->textInput()->label('Величина (' . $firstValuta . ')*', ['id' => 'toAmountLabel']);
?>

        </div>
    </div>
</div>
Exemplo n.º 2
0
<?php

use common\widgets\Alert;
use frontend\helper\AccountsHelper;
use kartik\tabs\TabsX;
use yii\helpers\Url;
/** @var $this yii\web\View */
/** @var $model \frontend\models\Transaction */
/** @var $modelTransfer \frontend\models\forms\TransferForm */
/** @var $tabTransfer boolean */
$this->title = 'Новая операция';
$this->params['breadcrumbs'][] = ['label' => 'Операции', 'url' => ['/transaction']];
$this->params['breadcrumbs'][] = $this->title;
$model->accounts = AccountsHelper::getFirstAccountId();
$tabTransfer = isset($tabTransfer) ? $tabTransfer : false;
?>

<?php 
echo Alert::widget();
?>

<?php 
$items = [['label' => 'Новая операция', 'content' => !$tabTransfer ? $this->render('_forms/_edit', ['model' => $model]) : null, 'url' => $tabTransfer ? Url::to(['/transaction/new']) : null, 'active' => !$tabTransfer], ['label' => '<i class="glyphicon glyphicon-transfer"></i> Перевод', 'content' => $tabTransfer ? $this->render('_forms/_transfer', ['model' => $modelTransfer]) : null, 'url' => !$tabTransfer ? Url::to(['/transaction/transfer']) : null, 'active' => $tabTransfer]];
?>

    <?php 
echo TabsX::widget(['items' => $items, 'position' => TabsX::POS_ABOVE, 'containerOptions' => ['class' => 'view-account-detail'], 'encodeLabels' => false]);