add basic event objects
This commit is contained in:
20
backend/views/trainer/_form.php
Normal file
20
backend/views/trainer/_form.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Trainer */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
<div class="trainer-form">
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'active')->checkbox() ?>
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('trainer', 'Create') : Yii::t('trainer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
49
backend/views/trainer/_search.php
Normal file
49
backend/views/trainer/_search.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\TrainerSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Keresés</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="trainer-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<?= $form->field($model, 'name') ?>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<?= $form->field($model, 'phone') ?>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<?= $form->field($model, 'email') ?>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<?php echo $form->field($model, 'active')->dropDownList([
|
||||
'' => \Yii::t("trainer","All"),
|
||||
\common\models\Trainer::ACTIVE_OFF => \Yii::t("trainer","active_off"),
|
||||
\common\models\Trainer::ACTIVE_ON => \Yii::t("trainer","active_on"),
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('trainer', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
21
backend/views/trainer/create.php
Normal file
21
backend/views/trainer/create.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Trainer */
|
||||
|
||||
$this->title = Yii::t('trainer', 'Create Trainer');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('trainer', 'Trainers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="trainer-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
37
backend/views/trainer/index.php
Normal file
37
backend/views/trainer/index.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\TrainerSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('trainer', 'Trainers');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="trainer-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('trainer', 'Create Trainer'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'id',
|
||||
'name',
|
||||
'phone',
|
||||
'email:email',
|
||||
['attribute' => 'active' , 'value' => function ($model){ return \common\models\Trainer::prettyPrintActive($model->active) ;} ],
|
||||
'created_at:datetime',
|
||||
'updated_at:datetime',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
21
backend/views/trainer/update.php
Normal file
21
backend/views/trainer/update.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Trainer */
|
||||
|
||||
$this->title = Yii::t('trainer', 'Update Trainer:' ) . ' ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('trainer', 'Trainers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('trainer', 'Update');
|
||||
?>
|
||||
<div class="trainer-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
44
backend/views/trainer/view.php
Normal file
44
backend/views/trainer/view.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Trainer */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('trainer', 'Trainers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="trainer-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('trainer', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('trainer', 'Delete'), ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('trainer', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
'phone',
|
||||
'email:email',
|
||||
[
|
||||
'attribute' => 'active',
|
||||
'value' => \common\models\Trainer::prettyPrintActive($model->active)
|
||||
],
|
||||
'created_at:datetime',
|
||||
'updated_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user