add Raktár model + crud

This commit is contained in:
2015-09-20 14:55:05 +02:00
parent a3e4f42c6a
commit 47341b6396
12 changed files with 544 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Warehouse */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="warehouse-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status')->checkbox( ['value' => 10, 'label' => Yii::t('common/warehouse', "Active") ]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/warehouse', 'Create') : Yii::t('common/warehouse', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,35 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\Warehouse */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="warehouse-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_warehouse') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'status') ?>
<?= $form->field($model, 'created_at') ?>
<?= $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/warehouse', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/warehouse', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Warehouse */
$this->title = Yii::t('common/warehouse', 'Create Warehouse');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/warehouse', 'Warehouses'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="warehouse-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,40 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\Warehouse */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/warehouse', 'Warehouses');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="warehouse-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/warehouse', 'Create Warehouse'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'name',
[
'attribute' => 'status',
'value' => 'statusHuman',
],
'created_at:datetime',
'updated_at:datetime',
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update}'
],
],
]); ?>
</div>

View File

@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Warehouse */
$this->title = Yii::t('common/warehouse', 'Update {modelClass}: ', [
'modelClass' => 'Warehouse',
]) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/warehouse', 'Warehouses'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_warehouse]];
$this->params['breadcrumbs'][] = Yii::t('common/warehouse', 'Update');
?>
<div class="warehouse-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\Warehouse */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/warehouse', 'Warehouses'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="warehouse-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/warehouse', 'Update'), ['update', 'id' => $model->id_warehouse], ['class' => 'btn btn-primary']) ?>
<?php
/* echo Html::a(Yii::t('common/warehouse', 'Delete'), ['delete', 'id' => $model->id_warehouse], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/warehouse', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) */
?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'name',
[
'attribute' => 'status',
'label' => Yii::t('common/warehouse', "Active"),
'value' => $model->statusHuman
],
'created_at',
'updated_at',
],
]) ?>
</div>