Beispiel #1
0
    <div class="col-md-12">

        <?php 
$form = ActiveForm::begin(['id' => 'transaction-new', 'action' => $model->isNewRecord ? '/transaction/new' : '/transaction/edit/' . $model->id]);
?>

        <div class="col-md-3">

            <?php 
echo $form->field($model, 'amount')->textInput(['placeholder' => 'Пример: (2+7)*2'])->label('Величина (' . $firstValuta . ')*', ['id' => 'amountLabel']);
?>

            <?php 
echo $form->field($model, 'type_id', ['options' => ['class' => 'form-group']])->label(false)->radioList(TransactionHelper::getValues(), ['item' => function ($index, $label, $name, $checked, $value) {
    $check = $checked ? ' checked="checked"' : '';
    $classes = isset($value) ? TransactionHelper::getClassesForType($value) : '';
    return "<label class=\"form__param type-id {$classes}\">\n                                    <input type=\"radio\" name=\"{$name}\" value=\"{$value}\"{$check}>\n                                    {$label}\n                                </label>";
}]);
?>

            <?php 
echo $form->field($model, 'date')->label($model->getAttributeLabel('date') . '*')->widget(DatePicker::className(), ['type' => DatePicker::TYPE_INPUT, 'pluginOptions' => ['autoclose' => true, 'format' => 'dd-mm-yyyy']]);
?>

            <div class="row additionally-date">
                <?php 
echo Html::a('Вчера', 'javascript:void(0);', ['class' => 'additionally-date-link', 'data-value' => Yii::$app->getFormatter()->asDate('yesterday', "php:d-m-Y")]);
?>
                <?php 
echo Html::a('Сегодня', 'javascript:void(0);', ['class' => 'additionally-date-link', 'data-value' => Yii::$app->getFormatter()->asDate('now', "php:d-m-Y")]);
?>
Beispiel #2
0
?>

<div class="row">

    <div class="col-md-12 transaction">
        <div class="col-md-2">
            <?php 
echo $this->render('_filter', ['activeIncome' => isset($activeIncome) ? $activeIncome : false, 'activeExpense' => isset($activeExpense) ? $activeExpense : false], true);
?>
            <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 
}
?>