add changes to account state
This commit is contained in:
55
backend/views/account-state/_form.php
Normal file
55
backend/views/account-state/_form.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\AccountState */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="account-state-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'id_account')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'type')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'money')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_5_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_10_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_20_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_50_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_100_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_200_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_500_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_1000_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_2000_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_5000_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_10000_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'banknote_20000_ft')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'comment')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'prev_state')->textInput() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend/account-state', 'Create') : Yii::t('backend/account-state', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
13
backend/views/account-state/_item_view.php
Normal file
13
backend/views/account-state/_item_view.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use frontend\components\AccountStateBanknoteCountWidget;
|
||||
use yii\base\Widget;
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
echo AccountStateBanknoteCountWidget::widget([
|
||||
'model' => $model,
|
||||
]);
|
||||
?>
|
||||
|
||||
|
||||
68
backend/views/account-state/_search.php
Normal file
68
backend/views/account-state/_search.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\AccountState;
|
||||
use frontend\components\HtmlHelper;
|
||||
use kartik\widgets\DatePicker;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AccountStateSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$accountOptions = ['' => 'Mind'] + HtmlHelper::mkAccountOptions($accounts);
|
||||
$userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions($users,'id','username')
|
||||
?>
|
||||
|
||||
<div class="account-state-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-4'>
|
||||
<?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?= $form->field($model, 'type')->dropDownList(['' => 'Mind']+AccountState::types()) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('backend/account-state', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
21
backend/views/account-state/create.php
Normal file
21
backend/views/account-state/create.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\AccountState */
|
||||
|
||||
$this->title = Yii::t('backend/account-state', 'Create Account State');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/account-state', 'Account States'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="account-state-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
39
backend/views/account-state/index.php
Normal file
39
backend/views/account-state/index.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\ListView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\AccountStateSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('backend/account-state', 'Account States');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="account-state-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel,'accounts' => $accounts,'users' => $users,]); ?>
|
||||
|
||||
|
||||
<?php /*echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
|
||||
'typeName',
|
||||
'money',
|
||||
'created_at:datetime',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}'
|
||||
],
|
||||
],
|
||||
]); */?>
|
||||
|
||||
<?php echo ListView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'itemView' => '_item_view'
|
||||
])?>
|
||||
|
||||
</div>
|
||||
23
backend/views/account-state/update.php
Normal file
23
backend/views/account-state/update.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\AccountState */
|
||||
|
||||
$this->title = Yii::t('backend/account-state', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Account State',
|
||||
]) . ' ' . $model->id_account_state;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/account-state', 'Account States'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id_account_state, 'url' => ['view', 'id' => $model->id_account_state]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('backend/account-state', 'Update');
|
||||
?>
|
||||
<div class="account-state-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
56
backend/views/account-state/view.php
Normal file
56
backend/views/account-state/view.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\AccountState */
|
||||
|
||||
$this->title = $model->id_account_state;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/account-state', 'Account States'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="account-state-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('backend/account-state', 'Update'), ['update', 'id' => $model->id_account_state], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('backend/account-state', 'Delete'), ['delete', 'id' => $model->id_account_state], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('backend/account-state', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_account_state',
|
||||
'id_account',
|
||||
'type',
|
||||
'money',
|
||||
'banknote_5_ft',
|
||||
'banknote_10_ft',
|
||||
'banknote_20_ft',
|
||||
'banknote_50_ft',
|
||||
'banknote_100_ft',
|
||||
'banknote_200_ft',
|
||||
'banknote_500_ft',
|
||||
'banknote_1000_ft',
|
||||
'banknote_2000_ft',
|
||||
'banknote_5000_ft',
|
||||
'banknote_10000_ft',
|
||||
'banknote_20000_ft',
|
||||
'id_user',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'comment',
|
||||
'prev_state',
|
||||
'prev_money',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\grid\GridView;
|
||||
use yii\base\Widget;
|
||||
use yii\base\Object;
|
||||
use yii\data\ArrayDataProvider;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\User */
|
||||
@@ -18,6 +22,41 @@ use yii\widgets\ActiveForm;
|
||||
<?= $form->field($model, 'password_plain')->passwordInput() ?>
|
||||
<?= $form->field($model, 'password_repeat')->passwordInput() ?>
|
||||
|
||||
<?php
|
||||
|
||||
$selectedAccounts = $model->selected_accounts;
|
||||
|
||||
?>
|
||||
|
||||
<h3>Engedélyezett kasszák</h3>
|
||||
<?php echo GridView::widget([
|
||||
'dataProvider' => new ArrayDataProvider( [
|
||||
'allModels' => $accounts,
|
||||
'sort' => false,
|
||||
'pagination' => false,
|
||||
]),
|
||||
'columns' => [
|
||||
[
|
||||
'class' => 'yii\grid\CheckboxColumn',
|
||||
'name' => (new ReflectionClass( $model->classname() ))->getShortName() . '[selected_accounts]',
|
||||
'checkboxOptions' => function ($model, $key, $index, $column) use ($selectedAccounts){
|
||||
$result = [];
|
||||
$result['value'] = $model->id_account ;
|
||||
|
||||
if ( isset($selectedAccounts) ){
|
||||
if ( is_array($selectedAccounts) ){
|
||||
if ( array_search($model->id_account , $selectedAccounts ) !== false){
|
||||
$result['checked'] = 'checked' ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
],
|
||||
[ 'attribute' => 'name' ],
|
||||
],
|
||||
])?>
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Mentés') : Yii::t('app', 'Mentés'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
'accounts' => $accounts,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -18,6 +18,7 @@ $this->params['breadcrumbs'][] = Yii::t('app', 'Update');
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
'accounts' => $accounts
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user