add frontend basics
This commit is contained in:
61
frontend/views/customer/_form.php
Normal file
61
frontend/views/customer/_form.php
Normal 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('frontend/customer', 'Create') : Yii::t('frontend/customer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
67
frontend/views/customer/_search.php
Normal file
67
frontend/views/customer/_search.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\models\CustomerSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="customer-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_customer') ?>
|
||||
|
||||
<?= $form->field($model, 'id_customer_card') ?>
|
||||
|
||||
<?= $form->field($model, 'id_user') ?>
|
||||
|
||||
<?= $form->field($model, 'id_partner_card') ?>
|
||||
|
||||
<?= $form->field($model, 'id_proposer') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'name') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'email') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'password') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'phone') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'sex') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'date_stundent_card_expire') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'birthdate') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'image') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'description') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'tax_number') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'country') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'zip') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'city') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'address') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('frontend/customer', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('frontend/customer', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
21
frontend/views/customer/create.php
Normal file
21
frontend/views/customer/create.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Customer */
|
||||
|
||||
$this->title = Yii::t('frontend/customer', 'Create Customer');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/customer', 'Customers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="customer-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
54
frontend/views/customer/index.php
Normal file
54
frontend/views/customer/index.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\models\CustomerSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('frontend/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('frontend/customer', 'Create Customer'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id_customer',
|
||||
'id_customer_card',
|
||||
'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',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
7
frontend/views/customer/main.php
Normal file
7
frontend/views/customer/main.php
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<h1>Recepció</h1>
|
||||
23
frontend/views/customer/update.php
Normal file
23
frontend/views/customer/update.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Customer */
|
||||
|
||||
$this->title = Yii::t('frontend/customer', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Customer',
|
||||
]) . ' ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/customer', 'Customers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_customer]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('frontend/customer', 'Update');
|
||||
?>
|
||||
<div class="customer-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
55
frontend/views/customer/view.php
Normal file
55
frontend/views/customer/view.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?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('frontend/customer', 'Customers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="customer-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/customer', 'Update'), ['update', 'id' => $model->id_customer], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('frontend/customer', 'Delete'), ['delete', 'id' => $model->id_customer], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('frontend/customer', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_customer',
|
||||
'id_customer_card',
|
||||
'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',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user