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,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>