add_holidays

This commit is contained in:
SoHardKI
2019-07-16 11:58:05 +03:00
parent 3af5bcab71
commit e961c3f35f
15 changed files with 491 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<?php
use yii\helpers\Html;
use yii\jui\DatePicker;
use yii\widgets\ActiveForm; ?>
<div class="holiday-form">
<?php $form = ActiveForm::begin(); ?>
<?php
echo \kartik\select2\Select2::widget([
'model' => $model,
'attribute' => 'card_id',
'data' => \common\models\UserCard::getUserList(),
'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]);
?>
<?php
echo '<label> Выберите дату начала отпуска</label>';
echo '<br>';
echo DatePicker::widget([
'model' => $model,
'attribute' => 'dt_start',
'language' => 'ru',
'dateFormat' => 'dd-MM-yyyy',
]);
echo '<br>';
echo '<label> Выберите дату конца отпуска</label>';
echo '<br>';
echo DatePicker::widget([
'model' => $model,
'attribute' => 'dt_end',
'language' => 'ru',
'dateFormat' => 'dd-MM-yyyy',
]);
?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -0,0 +1,28 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<div class="holiday-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'card_id') ?>
<?= $form->field($model, 'dt_start') ?>
<?= $form->field($model, 'dt_end') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -0,0 +1,19 @@
<?php
use yii\helpers\Html;
use yii\web\View;
/* @var $this yii\web\View */
/* @var $model backend\modules\company\models\Balance */
$this->title = 'Добавить отпуск';
$this->params['breadcrumbs'][] = ['label' => 'Список отпусков', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="holiday-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@ -0,0 +1,66 @@
<?php
use yii\data\ActiveDataProvider;
use yii\helpers\Html;
use yii\jui\DatePicker;
use yii\web\View;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Список отпусков';
$this->params['breadcrumps'][] = $this->title;
?>
<div class="holiday-index">
<p>
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= \yii\grid\GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'label' => 'ФИО',
'value' => function($model)
{
return $model->users->fio;
},
'filter' => \kartik\select2\Select2::widget([
'model' => $searchModel,
'attribute' => 'card_id',
'data' => \common\models\UserCard::getUserList(),
'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]),
],
[
'attribute' => 'dt_start',
'filter' => DatePicker::widget([
'model' => $searchModel,
'attribute' => 'dt_start',
'language' => 'ru',
'dateFormat' => 'dd-MM-yyyy',
'options' => [
'autocomplete' => 'off',
],
]),
],
[
'attribute' => 'dt_end',
'filter' => DatePicker::widget([
'model' => $searchModel,
'attribute' => 'dt_end',
'language' => 'ru',
'dateFormat' => 'dd-MM-yyyy',
'options' => [
'autocomplete' => 'off',
],
]),
],
['class' => 'yii\grid\ActionColumn'],
],
]);?>
</div>

View File

@ -0,0 +1,14 @@
<?php
$this->title = 'Редактировать отпуск №' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Список отпусков', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Редактировать';
?>
<div class="holiday-update">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@ -0,0 +1,36 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
$this->title = 'Отпуск №' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Список отпусков', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="balance-view">
<p>
<?= Html::a('Список', ['index'], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'label' => 'ФИО',
'value' => function($model)
{
return $model->users->fio;
},
],
'dt_start',
'dt_end'
],
]) ?>