add collection

This commit is contained in:
2015-11-03 09:50:54 +01:00
parent b6b5193120
commit 33bf52df60
22 changed files with 1073 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Collection */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="collection-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_account')->textInput() ?>
<?= $form->field($model, 'money')->textInput() ?>
<?= $form->field($model, 'start')->textInput() ?>
<?= $form->field($model, 'end')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend/collection', 'Create') : Yii::t('frontend/collection', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,55 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DateTimePicker;
use frontend\components\HtmlHelper;
/* @var $this yii\web\View */
/* @var $model frontend\models\CollectionSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$accountOptions = ['' =>Yii::t('frontend/collection','All')]+ HtmlHelper::mkAccountOptions($model->accounts);
?>
<div class="collection-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class='row'>
<div class='col-md-4'>
<?= $form->field($model, 'id_account')->dropDownList( $accountOptions ) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
]) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/collection', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,30 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Collection */
$this->title = Yii::t('frontend/collection', 'Create Collection');
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="collection-create">
<h1><?= Html::encode($this->title) ?></h1>
<dl class='dl-horizontal'>
<dt>Utolsó zárás</dt>
<dd>asdf</dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
</dl>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,39 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\CollectionSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('frontend/collection', 'Collections');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="collection-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('frontend/collection', 'Create Collection'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'id_collection',
'id_user',
'id_account',
'money',
'start:datetime',
'end:datetime',
'created_at:datetime',
['class' => 'yii\grid\ActionColumn',
'template' => '{view}'
],
],
]); ?>
</div>

View File

@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Collection */
$this->title = Yii::t('frontend/collection', 'Update {modelClass}: ', [
'modelClass' => 'Collection',
]) . ' ' . $model->id_collection;
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_collection, 'url' => ['view', 'id' => $model->id_collection]];
$this->params['breadcrumbs'][] = Yii::t('frontend/collection', 'Update');
?>
<div class="collection-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Collection */
$this->title = $model->id_collection;
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="collection-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('frontend/collection', 'Update'), ['update', 'id' => $model->id_collection], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/collection', 'Delete'), ['delete', 'id' => $model->id_collection], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('frontend/collection', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_collection',
'id_user',
'created_by',
'id_account',
'money',
'start',
'end',
'type',
'created_at',
'updated_at',
],
]) ?>
</div>