diff --git a/backend/config/main.php b/backend/config/main.php
index 9325812..6a5dcb7 100755
--- a/backend/config/main.php
+++ b/backend/config/main.php
@@ -46,7 +46,10 @@ return [
],
'gridview' => [
'class' => 'kartik\grid\Module',
- ]
+ ],
+ 'reports' => [
+ 'class' => 'backend\modules\reports\Reports',
+ ],
],
'components' => [
'request' => [
diff --git a/backend/modules/reports/Reports.php b/backend/modules/reports/Reports.php
new file mode 100644
index 0000000..52d1ca8
--- /dev/null
+++ b/backend/modules/reports/Reports.php
@@ -0,0 +1,24 @@
+render('index');
+ }
+}
diff --git a/backend/modules/reports/controllers/ReportsController.php b/backend/modules/reports/controllers/ReportsController.php
new file mode 100644
index 0000000..9506afd
--- /dev/null
+++ b/backend/modules/reports/controllers/ReportsController.php
@@ -0,0 +1,140 @@
+ [
+ 'class' => VerbFilter::className(),
+ 'actions' => [
+ 'delete' => ['POST'],
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * Lists all Reports models.
+ * @return mixed
+ */
+ public function actionIndex()
+ {
+ $searchModel = new ReportsSearch();
+ $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
+
+ return $this->render('index', [
+ 'searchModel' => $searchModel,
+ 'dataProvider' => $dataProvider,
+ ]);
+ }
+
+ public function actionGroup()
+ {
+ $searchModel = new UserCardSearch();
+ $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
+ $dataProvider->query->innerJoin('reports', 'user_card.id = reports.user_card_id');
+
+ return $this->render('group', [
+ 'searchModel' => $searchModel,
+ 'dataProvider' => $dataProvider,
+ ]);
+ }
+
+ /**
+ * Displays a single Reports model.
+ * @param integer $id
+ * @return mixed
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ public function actionView($id)
+ {
+ return $this->render('view', [
+ 'model' => $this->findModel($id),
+ ]);
+ }
+
+ /**
+ * Creates a new Reports model.
+ * If creation is successful, the browser will be redirected to the 'view' page.
+ * @return mixed
+ */
+ public function actionCreate()
+ {
+ $model = new Reports();
+
+ if ($model->load(Yii::$app->request->post()) && $model->save()) {
+ return $this->redirect(['view', 'id' => $model->id]);
+ }
+
+ return $this->render('create', [
+ 'model' => $model,
+ ]);
+ }
+
+ /**
+ * Updates an existing Reports model.
+ * If update is successful, the browser will be redirected to the 'view' page.
+ * @param integer $id
+ * @return mixed
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ public function actionUpdate($id)
+ {
+ $model = $this->findModel($id);
+
+ if ($model->load(Yii::$app->request->post()) && $model->save()) {
+ return $this->redirect(['view', 'id' => $model->id]);
+ }
+
+ return $this->render('update', [
+ 'model' => $model,
+ ]);
+ }
+
+ /**
+ * Deletes an existing Reports model.
+ * If deletion is successful, the browser will be redirected to the 'index' page.
+ * @param integer $id
+ * @return mixed
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ public function actionDelete($id)
+ {
+ $this->findModel($id)->delete();
+
+ return $this->redirect(['index']);
+ }
+
+ /**
+ * Finds the Reports model based on its primary key value.
+ * If the model is not found, a 404 HTTP exception will be thrown.
+ * @param integer $id
+ * @return Reports the loaded model
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ protected function findModel($id)
+ {
+ if (($model = Reports::findOne($id)) !== null) {
+ return $model;
+ }
+
+ throw new NotFoundHttpException('The requested page does not exist.');
+ }
+}
diff --git a/backend/modules/reports/models/ReportsSearch.php b/backend/modules/reports/models/ReportsSearch.php
new file mode 100644
index 0000000..5d80f0d
--- /dev/null
+++ b/backend/modules/reports/models/ReportsSearch.php
@@ -0,0 +1,75 @@
+leftJoin('user_card', 'reports.user_card_id = user_card.id');
+
+ // add conditions that should always apply here
+
+ $dataProvider = new ActiveDataProvider([
+ 'query' => $query,
+ ]);
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere([
+ 'id' => $this->id,
+ 'created_at' => $this->created_at,
+ 'user_card_id' => $this->user_card_id,
+ ]);
+
+ $query->andFilterWhere(['like', 'today', $this->today])
+ ->andFilterWhere(['like', 'difficulties', $this->difficulties])
+ ->andFilterWhere(['like', 'tomorrow', $this->tomorrow])
+ ->andFilterWhere(['like', 'user_card.fio', $this->fio]);
+
+ return $dataProvider;
+ }
+}
diff --git a/backend/modules/reports/views/default/index.php b/backend/modules/reports/views/default/index.php
new file mode 100644
index 0000000..1b8dd38
--- /dev/null
+++ b/backend/modules/reports/views/default/index.php
@@ -0,0 +1,12 @@
+
+
= $this->context->action->uniqueId ?>
+
+ This is the view content for action "= $this->context->action->id ?>".
+ The action belongs to the controller "= get_class($this->context) ?>"
+ in the "= $this->context->module->id ?>" module.
+
+
+ You may customize this page by editing the following file:
+ = __FILE__ ?>
+
+
diff --git a/backend/modules/reports/views/reports/_expand-row-details.php b/backend/modules/reports/views/reports/_expand-row-details.php
new file mode 100644
index 0000000..b521a67
--- /dev/null
+++ b/backend/modules/reports/views/reports/_expand-row-details.php
@@ -0,0 +1,19 @@
+ $dataProvider,
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+
+ 'created_at',
+ 'today',
+ 'difficulties',
+ 'tomorrow',
+
+ ['class' => 'yii\grid\ActionColumn'],
+ ]
+]);
\ No newline at end of file
diff --git a/backend/modules/reports/views/reports/_form.php b/backend/modules/reports/views/reports/_form.php
new file mode 100644
index 0000000..46e3974
--- /dev/null
+++ b/backend/modules/reports/views/reports/_form.php
@@ -0,0 +1,43 @@
+
+
+
diff --git a/backend/modules/reports/views/reports/_search.php b/backend/modules/reports/views/reports/_search.php
new file mode 100644
index 0000000..c24983d
--- /dev/null
+++ b/backend/modules/reports/views/reports/_search.php
@@ -0,0 +1,37 @@
+
+
+
+
+ ['index'],
+ 'method' => 'get',
+ ]); ?>
+
+ = $form->field($model, 'id') ?>
+
+ = $form->field($model, 'created_at') ?>
+
+ = $form->field($model, 'today') ?>
+
+ = $form->field($model, 'difficulties') ?>
+
+ = $form->field($model, 'tomorrow') ?>
+
+ field($model, 'user_card_id') ?>
+
+
+ = Html::submitButton('Поиск', ['class' => 'btn btn-primary']) ?>
+ = Html::resetButton('Сброс', ['class' => 'btn btn-default']) ?>
+
+
+
+
+
diff --git a/backend/modules/reports/views/reports/create.php b/backend/modules/reports/views/reports/create.php
new file mode 100644
index 0000000..4e8dd88
--- /dev/null
+++ b/backend/modules/reports/views/reports/create.php
@@ -0,0 +1,18 @@
+title = 'Добавить отчет';
+$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+ = $this->render('_form', [
+ 'model' => $model,
+ ]) ?>
+
+
diff --git a/backend/modules/reports/views/reports/group.php b/backend/modules/reports/views/reports/group.php
new file mode 100644
index 0000000..7ca5723
--- /dev/null
+++ b/backend/modules/reports/views/reports/group.php
@@ -0,0 +1,52 @@
+title = 'Доступы';
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+ = Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
+ = Html::a('Общий вид', ['index'], ['class' => 'btn btn-success']) ?>
+
+
+ $dataProvider,
+ 'filterModel' => $searchModel,
+ 'pjax' => true,
+ 'striped' => true,
+ 'hover' => true,
+ 'toggleDataContainer' => ['class' => 'btn-group mr-2'],
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+ [
+ 'class' => 'kartik\grid\ExpandRowColumn',
+ 'width' => '50px',
+ 'value' => function ($model, $key, $index, $column) {
+ return GridView::ROW_COLLAPSED;
+ },
+ 'detail' => function ($model, $key, $index, $column) {
+ $searchReports = new ReportsSearch();
+ $providerReports = $searchReports->search(Yii::$app->request->queryParams);
+ $providerReports->query->andWhere(['user_card.id_user' => $model->id_user]);
+
+ return Yii::$app->controller->renderPartial('_expand-row-details', ['dataProvider' => $providerReports]);
+ },
+ 'headerOptions' => ['class' => 'kartik-sheet-style'],
+ 'expandOneOnly' => true
+ ],
+ 'fio',
+ 'email'
+ ],
+ ]);
+ ?>
+
diff --git a/backend/modules/reports/views/reports/index.php b/backend/modules/reports/views/reports/index.php
new file mode 100644
index 0000000..e83b4d2
--- /dev/null
+++ b/backend/modules/reports/views/reports/index.php
@@ -0,0 +1,42 @@
+title = 'Отчеты';
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+ render('_search', ['model' => $searchModel]); ?>
+
+
+ = Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
+ = Html::a('Сгрупированный по пользователям вид', ['group'], ['class' => 'btn btn-success']) ?>
+
+
+ = GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+
+ 'created_at',
+ 'today',
+ 'difficulties',
+ 'tomorrow',
+ [
+ 'format' => 'raw',
+ 'attribute' => 'ФИО',
+ 'filter' => Html::activeTextInput($searchModel, 'fio', ['class' => 'form-control']),
+ 'value' => function ($data) { return \common\models\Reports::getFio($data); },
+ ],
+
+ ['class' => 'yii\grid\ActionColumn'],
+ ],
+ ]); ?>
+
diff --git a/backend/modules/reports/views/reports/update.php b/backend/modules/reports/views/reports/update.php
new file mode 100644
index 0000000..d9dd599
--- /dev/null
+++ b/backend/modules/reports/views/reports/update.php
@@ -0,0 +1,19 @@
+title = 'Редактировать отчет';
+$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
+$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
+$this->params['breadcrumbs'][] = 'Редактировать';
+?>
+
+
+ = $this->render('_form', [
+ 'model' => $model,
+ ]) ?>
+
+
diff --git a/backend/modules/reports/views/reports/view.php b/backend/modules/reports/views/reports/view.php
new file mode 100644
index 0000000..8ea2ce2
--- /dev/null
+++ b/backend/modules/reports/views/reports/view.php
@@ -0,0 +1,44 @@
+title = 'Отчет';
+$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+\yii\web\YiiAsset::register($this);
+?>
+
+
+ = Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+ = Html::a('Удалить', ['delete', 'id' => $model->id], [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => 'Вы уверенны, что хотите удалить этот элемент?',
+ 'method' => 'post',
+ ],
+ ]) ?>
+ = Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+
+
+ = DetailView::widget([
+ 'model' => $model,
+ 'attributes' => [
+// 'id',
+ 'created_at',
+ 'today',
+ 'difficulties',
+ 'tomorrow',
+// 'user_card_id',
+ [
+ 'format' => 'raw',
+ 'attribute' => 'ФИО',
+ 'value' => function ($data) { return \common\models\Reports::getFio($data); },
+ ],
+ ],
+ ]) ?>
+
+
diff --git a/backend/views/layouts/left.php b/backend/views/layouts/left.php
index 9a4d4f9..d14669e 100755
--- a/backend/views/layouts/left.php
+++ b/backend/views/layouts/left.php
@@ -48,6 +48,7 @@
['label' => 'Доступы', 'icon' => 'key', 'url' => ['/accesses/accesses'], 'active' => \Yii::$app->controller->id == 'accesses'],
['label' => 'Заметки', 'icon' => 'sticky-note', 'url' => ['/notes/notes'], 'active' => \Yii::$app->controller->id == 'notes'],
['label' => 'Календарь ДР', 'icon' => 'calendar', 'url' => ['/calendar/calendar'], 'active' => \Yii::$app->controller->id == 'calendar'],
+ ['label' => 'Отчеты', 'icon' => 'list-alt', 'url' => ['/reports/reports'], 'active' => \Yii::$app->controller->id == 'reports'],
/*['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii']],
['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug']],
diff --git a/backend/web/css/site.css b/backend/web/css/site.css
index b319bb6..db97cf9 100755
--- a/backend/web/css/site.css
+++ b/backend/web/css/site.css
@@ -35,4 +35,8 @@
.field-usercard-fields-0-value .itemImg {
width: 100% !important;
+}
+
+.report-date {
+ width: 155px;
}
\ No newline at end of file
diff --git a/common/models/Reports.php b/common/models/Reports.php
new file mode 100644
index 0000000..f5d2bb5
--- /dev/null
+++ b/common/models/Reports.php
@@ -0,0 +1,72 @@
+ 255],
+ [['user_card_id'], 'exist', 'skipOnError' => true, 'targetClass' => UserCard::className(), 'targetAttribute' => ['user_card_id' => 'id']],
+ ];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'created_at' => 'Дата заполнения отчета',
+ 'today' => 'Что было сделано сегодня?',
+ 'difficulties' => 'Какие сложности возникли?',
+ 'tomorrow' => 'Что планируется сделать завтра?',
+ 'user_card_id' => 'Пользователь',
+ 'status' => 'Статус'
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getUserCard()
+ {
+ return $this->hasOne(UserCard::className(), ['id' => 'user_card_id']);
+ }
+
+ public static function getFio($data)
+ {
+ $user_card = UserCard::findOne(['id' => $data->user_card_id]);
+ return $user_card->fio;
+ }
+}
diff --git a/console/migrations/m200204_125649_create_reports_table.php b/console/migrations/m200204_125649_create_reports_table.php
new file mode 100644
index 0000000..9df03e3
--- /dev/null
+++ b/console/migrations/m200204_125649_create_reports_table.php
@@ -0,0 +1,51 @@
+createTable('{{%reports}}', [
+ 'id' => $this->primaryKey(),
+ 'created_at' => $this->date()->notNull(),
+ 'today' => $this->string()->notNull(),
+ 'difficulties' => $this->string(),
+ 'tomorrow' => $this->string(),
+ 'status' => $this->integer()
+ ]);
+
+ $this->addColumn('{{%reports}}', 'user_card_id', $this->integer()->notNull());
+
+ // creates index for column `user_card_id`
+ $this->createIndex(
+ '{{%idx-reports-user_card_id}}',
+ '{{%reports}}',
+ 'user_card_id'
+ );
+
+ // add foreign key for table `{{%user_card}}`
+ $this->addForeignKey(
+ '{{%fk-reports-user_card_id}}',
+ '{{%reports}}',
+ 'user_card_id',
+ '{{%user_card}}',
+ 'id',
+ 'CASCADE'
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $this->dropTable('{{%reports}}');
+ }
+}
diff --git a/frontend/config/main.php b/frontend/config/main.php
index 9fbadf2..7d0a06b 100755
--- a/frontend/config/main.php
+++ b/frontend/config/main.php
@@ -20,6 +20,9 @@ return [
'card' => [
'class' => 'frontend\modules\card\Card',
],
+ 'reports' => [
+ 'class' => 'frontend\modules\reports\Reports',
+ ],
],
'components' => [
diff --git a/frontend/modules/access/models/Access.php b/frontend/modules/access/models/Access.php
index 3ffeb0d..27d27ce 100644
--- a/frontend/modules/access/models/Access.php
+++ b/frontend/modules/access/models/Access.php
@@ -3,8 +3,6 @@
namespace frontend\modules\access\models;
-
-use common\classes\Debug;
use common\models\UserCardAccesses;
use frontend\modules\card\models\UserCard;
use Yii;
diff --git a/frontend/modules/reports/Reports.php b/frontend/modules/reports/Reports.php
new file mode 100644
index 0000000..8a393a4
--- /dev/null
+++ b/frontend/modules/reports/Reports.php
@@ -0,0 +1,24 @@
+render('index');
+ }
+}
diff --git a/frontend/modules/reports/controllers/ReportsController.php b/frontend/modules/reports/controllers/ReportsController.php
new file mode 100644
index 0000000..f6fe4e7
--- /dev/null
+++ b/frontend/modules/reports/controllers/ReportsController.php
@@ -0,0 +1,134 @@
+ [
+ 'class' => VerbFilter::className(),
+ 'actions' => [
+ 'delete' => ['POST'],
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * Lists all Reports models.
+ * @return mixed
+ */
+ public function actionIndex()
+ {
+ $searchModel = new ReportsSearch();
+ $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
+ $dataProvider->query
+ ->where(['user_card.id_user' => Yii::$app->user->identity->id])
+ ->innerJoin('user_card', 'reports.user_card_id = user_card.id');
+
+ return $this->render('index', [
+ 'searchModel' => $searchModel,
+ 'dataProvider' => $dataProvider,
+ ]);
+ }
+
+ /**
+ * Displays a single Reports model.
+ * @param integer $id
+ * @return mixed
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ public function actionView($id)
+ {
+ return $this->render('view', [
+ 'model' => $this->findModel($id),
+ ]);
+ }
+
+ /**
+ * Creates a new Reports model.
+ * If creation is successful, the browser will be redirected to the 'view' page.
+ * @return mixed
+ */
+ public function actionCreate()
+ {
+ $model = new \frontend\modules\reports\models\Reports();
+
+ if ($model->load(Yii::$app->request->post())) {
+ $model->save();
+ return $this->redirect(['view', 'id' => $model->id]);
+ }
+
+ return $this->render('create', [
+ 'model' => $model,
+ ]);
+ }
+
+ /**
+ * Updates an existing Reports model.
+ * If update is successful, the browser will be redirected to the 'view' page.
+ * @param integer $id
+ * @return mixed
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ public function actionUpdate($id)
+ {
+ $model = $this->findModel($id);
+
+ if ($model->load(Yii::$app->request->post()) && $model->save()) {
+ return $this->redirect(['view', 'id' => $model->id]);
+ }
+
+ return $this->render('update', [
+ 'model' => $model,
+ ]);
+ }
+
+ /**
+ * Deletes an existing Reports model.
+ * If deletion is successful, the browser will be redirected to the 'index' page.
+ * @param integer $id
+ * @return mixed
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ public function actionDelete($id)
+ {
+ $this->findModel($id)->delete();
+
+ return $this->redirect(['index']);
+ }
+
+ /**
+ * Finds the Reports model based on its primary key value.
+ * If the model is not found, a 404 HTTP exception will be thrown.
+ * @param integer $id
+ * @return Reports the loaded model
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ protected function findModel($id)
+ {
+ if (($model = Reports::findOne($id)) !== null) {
+ return $model;
+ }
+
+ throw new NotFoundHttpException('The requested page does not exist.');
+ }
+}
diff --git a/frontend/modules/reports/models/Reports.php b/frontend/modules/reports/models/Reports.php
new file mode 100644
index 0000000..3bd72a2
--- /dev/null
+++ b/frontend/modules/reports/models/Reports.php
@@ -0,0 +1,32 @@
+ Yii::$app->user->identity->id]);
+// $this->user_card_id = $user_card->id;
+// return parent::beforeSave($insert);
+// }
+
+ public function beforeValidate()
+ {
+ if (empty($this->user_card_id)) {
+ $user_card = UserCard::findOne(['id_user' => Yii::$app->user->identity->id]);
+ $this->user_card_id = $user_card->id;
+ }
+ return parent::beforeValidate();
+ }
+}
\ No newline at end of file
diff --git a/frontend/modules/reports/models/ReportsSearch.php b/frontend/modules/reports/models/ReportsSearch.php
new file mode 100644
index 0000000..f413e49
--- /dev/null
+++ b/frontend/modules/reports/models/ReportsSearch.php
@@ -0,0 +1,73 @@
+ $query,
+ ]);
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere([
+ 'id' => $this->id,
+ 'created_at' => $this->created_at,
+ 'user_card_id' => $this->user_card_id,
+ 'status' => $this->status,
+ ]);
+
+ $query->andFilterWhere(['like', 'today', $this->today])
+ ->andFilterWhere(['like', 'difficulties', $this->difficulties])
+ ->andFilterWhere(['like', 'tomorrow', $this->tomorrow]);
+
+ return $dataProvider;
+ }
+}
diff --git a/frontend/modules/reports/views/default/index.php b/frontend/modules/reports/views/default/index.php
new file mode 100644
index 0000000..1b8dd38
--- /dev/null
+++ b/frontend/modules/reports/views/default/index.php
@@ -0,0 +1,12 @@
+
+
= $this->context->action->uniqueId ?>
+
+ This is the view content for action "= $this->context->action->id ?>".
+ The action belongs to the controller "= get_class($this->context) ?>"
+ in the "= $this->context->module->id ?>" module.
+
+
+ You may customize this page by editing the following file:
+ = __FILE__ ?>
+
+
diff --git a/frontend/modules/reports/views/reports/_form.php b/frontend/modules/reports/views/reports/_form.php
new file mode 100644
index 0000000..1251dcd
--- /dev/null
+++ b/frontend/modules/reports/views/reports/_form.php
@@ -0,0 +1,38 @@
+
+
+
diff --git a/frontend/modules/reports/views/reports/_search.php b/frontend/modules/reports/views/reports/_search.php
new file mode 100644
index 0000000..b69583a
--- /dev/null
+++ b/frontend/modules/reports/views/reports/_search.php
@@ -0,0 +1,39 @@
+
+
+
+
+ ['index'],
+ 'method' => 'get',
+ ]); ?>
+
+ = $form->field($model, 'id') ?>
+
+ = $form->field($model, 'created_at') ?>
+
+ = $form->field($model, 'today') ?>
+
+ = $form->field($model, 'difficulties') ?>
+
+ = $form->field($model, 'tomorrow') ?>
+
+ field($model, 'user_card_id') ?>
+
+ field($model, 'status') ?>
+
+
+ = Html::submitButton('Поиск', ['class' => 'btn btn-primary']) ?>
+ = Html::resetButton('Сброс', ['class' => 'btn btn-default']) ?>
+
+
+
+
+
diff --git a/frontend/modules/reports/views/reports/create.php b/frontend/modules/reports/views/reports/create.php
new file mode 100644
index 0000000..2f98be9
--- /dev/null
+++ b/frontend/modules/reports/views/reports/create.php
@@ -0,0 +1,18 @@
+title = 'Добавить отчет';
+$this->params['breadcrumbs'][] = ['label' => 'Reports', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+ = $this->render('_form', [
+ 'model' => $model,
+ ]) ?>
+
+
diff --git a/frontend/modules/reports/views/reports/index.php b/frontend/modules/reports/views/reports/index.php
new file mode 100644
index 0000000..41dc787
--- /dev/null
+++ b/frontend/modules/reports/views/reports/index.php
@@ -0,0 +1,38 @@
+title = 'Отчеты';
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+ render('_search', ['model' => $searchModel]); ?>
+
+
+ = Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
+
+
+ = GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+
+// 'id',
+ 'created_at',
+ 'today',
+ 'difficulties',
+ 'tomorrow',
+// 'user_card_id',
+ //'status',
+
+ ['class' => 'yii\grid\ActionColumn'],
+ ],
+ ]); ?>
+
diff --git a/frontend/modules/reports/views/reports/update.php b/frontend/modules/reports/views/reports/update.php
new file mode 100644
index 0000000..d9dd599
--- /dev/null
+++ b/frontend/modules/reports/views/reports/update.php
@@ -0,0 +1,19 @@
+title = 'Редактировать отчет';
+$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
+$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
+$this->params['breadcrumbs'][] = 'Редактировать';
+?>
+
+
+ = $this->render('_form', [
+ 'model' => $model,
+ ]) ?>
+
+
diff --git a/frontend/modules/reports/views/reports/view.php b/frontend/modules/reports/views/reports/view.php
new file mode 100644
index 0000000..5fcc103
--- /dev/null
+++ b/frontend/modules/reports/views/reports/view.php
@@ -0,0 +1,41 @@
+title = $model->id;
+$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+\yii\web\YiiAsset::register($this);
+?>
+
+
+
+ = Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+ = Html::a('Удалить', ['delete', 'id' => $model->id], [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => 'Вы уверенны, что хотите удалить этот отчет?',
+ 'method' => 'post',
+ ],
+ ]) ?>
+ = Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+
+
+ = DetailView::widget([
+ 'model' => $model,
+ 'attributes' => [
+// 'id',
+ 'created_at',
+ 'today',
+ 'difficulties',
+ 'tomorrow',
+// 'user_card_id',
+// 'status',
+ ],
+ ]) ?>
+
+
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php
index b5e0846..37b7d7d 100755
--- a/frontend/views/layouts/main.php
+++ b/frontend/views/layouts/main.php
@@ -45,6 +45,7 @@ AppAsset::register($this);
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
$menuItems[] = ['label' => 'Доступы', 'url' => ['/access/access/index']];
+ $menuItems[] = ['label' => 'Отчеты', 'url' => ['/reports/reports/index']];
$menuItems[] = ''
. Html::beginForm(['/site/logout'], 'post')
. Html::submitButton(
diff --git a/frontend/web/css/site.css b/frontend/web/css/site.css
index a3b38da..0729653 100755
--- a/frontend/web/css/site.css
+++ b/frontend/web/css/site.css
@@ -121,4 +121,8 @@ a.desc:after {
.custom-input {
width: 50%;
+}
+
+.report-date {
+ width: 155px;
}
\ No newline at end of file