add city, customer and card model + crud

This commit is contained in:
2015-09-27 21:35:31 +02:00
parent 8ee256314b
commit 7df9800fec
42 changed files with 6765 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Card;
/* @var $this yii\web\View */
/* @var $model common\models\Card */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="card-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'number')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status')->dropDownList(Card::statuses()) ?>
<?= $form->field($model, 'type')->dropDownList(Card::types()) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/card', 'Create') : Yii::t('common/card', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,60 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Card;
/* @var $this yii\web\View */
/* @var $model backend\models\CardSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
function mkOptions($options){
$all = ['' => Yii::t('common/product','All' ) ];
$o = $all + $options;
return $o;
}
$typeOptions = mkOptions(Card::types());
$statusOptions = mkOptions(Card::statuses());
?>
<div class="card-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'number') ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'status')->dropDownList($statusOptions) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'type')->dropDownList($typeOptions) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'searchCustomerName')->textInput() ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/card', 'Search'), ['class' => 'btn btn-primary']) ?>
</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\Card */
$this->title = Yii::t('common/card', 'Create Card');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/card', 'Cards'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="card-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,52 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\CardSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/card', 'Cards');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="card-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/card', 'Create Card'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'number',
'value' => 'number'
],
[
'attribute' => 'status',
'value' => 'statusHuman'
],
[
'attribute' => 'type',
'value' => 'typeHuman'
],
[
'attribute' => 'customerName',
'value' => 'customerName'
],
'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\Card */
$this->title = Yii::t('common/card', 'Update {modelClass}: ', [
'modelClass' => 'Card',
]) . ' ' . $model->id_card;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/card', 'Cards'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->number, 'url' => ['view', 'id' => $model->id_card]];
$this->params['breadcrumbs'][] = Yii::t('common/card', 'Update');
?>
<div class="card-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,32 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Card */
$this->title = Yii::t('common/card','Card: ').$model->number;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/card', 'Cards'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="card-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/card', 'Update'), ['update', 'id' => $model->id_card], ['class' => 'btn btn-primary']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'number',
['attribute' => 'status', 'value' => $model->statusHuman],
['attribute' => 'type', 'value' => $model->typeHuman],
'created_at:datetime',
'updated_at:datetime',
],
]) ?>
</div>

View File

@@ -0,0 +1,41 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\City */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="city-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'zip')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'city_code')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'latitude')->textInput() ?>
<?= $form->field($model, 'longitude')->textInput() ?>
<?= $form->field($model, 'cso_code')->textInput() ?>
<?= $form->field($model, 'rig_id')->textInput() ?>
<?= $form->field($model, 'range')->textInput() ?>
<?= $form->field($model, 'population')->textInput() ?>
<?= $form->field($model, 'homes')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/city', 'Create') : Yii::t('common/city', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,47 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\CitySearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="city-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_city') ?>
<?= $form->field($model, 'zip') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'city_code') ?>
<?= $form->field($model, 'latitude') ?>
<?php // echo $form->field($model, 'longitude') ?>
<?php // echo $form->field($model, 'cso_code') ?>
<?php // echo $form->field($model, 'rig_id') ?>
<?php // echo $form->field($model, 'range') ?>
<?php // echo $form->field($model, 'population') ?>
<?php // echo $form->field($model, 'homes') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/city', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/city', '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\City */
$this->title = Yii::t('common/city', 'Create City');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/city', 'Cities'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="city-create">
<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\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\CitySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/city', 'Cities');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="city-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/city', 'Create City'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id_city',
'zip',
'name',
'city_code',
'latitude',
// 'longitude',
// 'cso_code',
// 'rig_id',
// 'range',
// 'population',
// 'homes',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>

View File

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

View File

@@ -0,0 +1,45 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\City */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/city', 'Cities'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="city-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/city', 'Update'), ['update', 'id' => $model->id_city], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/city', 'Delete'), ['delete', 'id' => $model->id_city], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/city', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_city',
'zip',
'name',
'city_code',
'latitude',
'longitude',
'cso_code',
'rig_id',
'range',
'population',
'homes',
],
]) ?>
</div>

View File

@@ -0,0 +1,61 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="customer-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_customer_card')->textInput() ?>
<?= $form->field($model, 'id_user')->textInput() ?>
<?= $form->field($model, 'id_partner_card')->textInput() ?>
<?= $form->field($model, 'id_proposer')->textInput() ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'password')->passwordInput(['maxlength' => true]) ?>
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'sex')->textInput() ?>
<?= $form->field($model, 'date_stundent_card_expire')->textInput() ?>
<?= $form->field($model, 'birthdate')->textInput() ?>
<?= $form->field($model, 'image')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tax_number')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'country')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'zip')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/customer', 'Create') : Yii::t('common/customer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,128 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Customer;
use common\components\CityNameTypeahead;
use common\components\CityZipTypeahead;
use common\components\CardNumberTypeahead;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="customer-form">
<?php $form = ActiveForm::begin(); ?>
<div class='row'>
<div class='col-md-3'>
<?php echo $form->field($model, 'cardNumber')->widget(CardNumberTypeahead::className(),[]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'partnerCardNumber')->textInput() ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'password_plain')->passwordInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'password_repeat')->passwordInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'sex')->dropDownList(Customer::sexes()) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'birthdate')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'date_stundent_card_expire')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'description')->textarea(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'tax_number')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'country')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-2'>
<?= $form->field($model, 'zip')->widget(CityZipTypeahead::className(),[
'pluginEvents' =>[
"typeahead:select" => "function(a,b) {
$('#customercreate-city').typeahead( 'val', b.name );
}",]
])?>
</div>
<div class='col-md-4'>
<?php echo $form->field($model, 'city')->widget(CityNameTypeahead::className(),[
'pluginEvents' =>[
"typeahead:select" => "function(a,b) {
$('#customercreate-zip').typeahead( 'val', b.zip );
}",]
])?>
</div>
</div>
<?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/customer', 'Create') : Yii::t('common/customer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,132 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Customer;
use common\components\CityNameTypeahead;
use common\components\CityZipTypeahead;
use common\components\CardNumberTypeahead;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="customer-form">
<?php $form = ActiveForm::begin(); ?>
<div class='row'>
<div class='col-md-3'>
<?php //echo $form->field($model, 'cardNumber')->widget(CardNumberTypeahead::className(),[]) ?>
<label><?php echo $model->getAttributeLabel('id_customer_card')?></label>
<div>
<?php echo $model->customerCardNumber ?>
</div>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'partnerCardNumber')->textInput() ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'password_plain')->passwordInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'password_repeat')->passwordInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'sex')->dropDownList(Customer::sexes()) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'birthdate')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'date_stundent_card_expire')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'description')->textarea(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'tax_number')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'country')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-2'>
<?= $form->field($model, 'zip')->widget(CityZipTypeahead::className(),[
'pluginEvents' =>[
"typeahead:select" => "function(a,b) {
$('#customercreate-city').typeahead( 'val', b.name );
}",]
])?>
</div>
<div class='col-md-4'>
<?php echo $form->field($model, 'city')->widget(CityNameTypeahead::className(),[
'pluginEvents' =>[
"typeahead:select" => "function(a,b) {
$('#customercreate-zip').typeahead( 'val', b.zip );
}",]
])?>
</div>
</div>
<?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/customer', 'Create') : Yii::t('common/customer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\CustomerSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="customer-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class='row'>
<div class='col-md-4'>
<?= $form->field($model, 'cardNumber') ?>
</div>
<div class='col-md-4'>
<?php echo $form->field($model, 'name') ?>
</div>
<div class='col-md-4'>
<?php echo $form->field($model, 'email') ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/customer', 'Search'), ['class' => 'btn btn-primary']) ?>
</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\Customer */
$this->title = Yii::t('common/customer', 'Create Customer');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/customer', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customer-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_create', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,56 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\CustomerSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/customer', 'Customers');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customer-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/customer', 'Create Customer'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'customerCardNumber' ,
// 'value' => 'customerCardNumber'
],
// 'id_user',
// 'id_partner_card',
// 'id_proposer',
'name',
'email:email',
// 'password',
'phone',
// 'sex',
// 'date_stundent_card_expire',
// 'birthdate',
// 'image',
// 'description',
// 'tax_number',
// 'country',
// 'zip',
// 'city',
// 'address',
'created_at:datetime',
// 'updated_at',
['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\Customer */
$this->title = Yii::t('common/customer', 'Update {modelClass}: ', [
'modelClass' => 'Customer',
]) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/customer', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_customer]];
$this->params['breadcrumbs'][] = Yii::t('common/customer', 'Update');
?>
<div class="customer-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_update', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,56 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/customer', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customer-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/customer', 'Update'), ['update', 'id' => $model->id_customer], ['class' => 'btn btn-primary']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'attribute' => 'id_customer_card',
'value' => $model->customerCardNumber
],
[
'attribute' => 'id_user',
'value' => $model->username
],
'id_partner_card',
'id_proposer',
'name',
'email:email',
'password',
'phone',
[
'attribute' => 'sex',
'value' => $model->sexHuman
],
'date_stundent_card_expire',
'birthdate:date',
'image',
'description',
'tax_number',
'country',
'zip',
'city',
'address',
'created_at:datetime',
'updated_at:datetime',
],
]) ?>
</div>