diff --git a/backend/controllers/RequestController.php b/backend/controllers/RequestController.php new file mode 100644 index 0000000..639bf34 --- /dev/null +++ b/backend/controllers/RequestController.php @@ -0,0 +1,95 @@ + [ + 'class' => Index::class, + 'columns' => [ + 'name' => [ + 'type' => Index::ACTION_COL, + 'columnConfig' => [ + 'buttonsTemplate' => '{edit}{delete}' + ] + ], + 'secondname' => [ + 'type' => Index::STRING_COL, + ], + 'organization' => [ + 'type' => Index::STRING_COL, + ], + ], + 'model' => Customer::class, + 'hasLanguage' => false, + 'enableMassDelete' => true, + 'modelPrimaryKey' => 'id', + 'create' => false, + ], + ]; + } + + public function actionUpdate($id) + { + $model = $this->findModel($id); + + return $this->render( + 'update', + [ + 'model' => $model, + ] + ); + } + + /** + * @param $id + * + * @return \common\models\Customer|mixed|null + * @throws \yii\web\NotFoundHttpException + */ + public function findModel($id) + { + $model = Customer::findOne($id); + if ($model) { + return $model; + } else { + throw new NotFoundHttpException(); + } + } + /** + * Create new model + * + * @return mixed + */ + public function newModel() + { + return new Customer(); + } + /** + * @param $id + * + * @return bool|mixed + * @throws \Throwable + * @throws \yii\db\StaleObjectException + * @throws \yii\web\NotFoundHttpException + */ + public function deleteModel($id) + { + $model = $this->findModel($id); + + if ($model->delete()) { + return true; + } else { + return false; + } + } + } \ No newline at end of file diff --git a/backend/views/layouts/main.php b/backend/views/layouts/main.php index edabbd4..e05c3ee 100755 --- a/backend/views/layouts/main.php +++ b/backend/views/layouts/main.php @@ -7,16 +7,11 @@ use artbox\core\assets\ArtboxCoreAsset; use artbox\core\models\User; - use artbox\core\models\UserData; - use artbox\core\widgets\FeedbackWidget; use artbox\core\widgets\FlashWidget; - use artbox\order\assets\OrderAsset; - use noam148\imagemanager\components\ImageManagerGetPath; use yii\bootstrap\Html; use yii\web\View; use yii\widgets\Breadcrumbs; use yiister\gentelella\widgets\Menu; - use backend\assets\AppAsset; ArtboxCoreAsset::register($this); // AppAsset::register($this); @@ -167,7 +162,9 @@
  • - +
  • diff --git a/backend/views/layouts/menu_items.php b/backend/views/layouts/menu_items.php index 439680a..2d4df2a 100755 --- a/backend/views/layouts/menu_items.php +++ b/backend/views/layouts/menu_items.php @@ -43,36 +43,35 @@ [ 'label' => \Yii::t('core', 'Categories'), 'url' => [ '/page-category/index' ], - ], - ], - ], - - - - - [ - 'label' => \Yii::t('core', 'SEO'), - 'url' => '#', - 'template' => '{label}{badge}', - 'items' => [ [ - 'label' => \Yii::t('core', 'Seo pages'), - 'url' => [ '/seo/alias/index' ], - 'icon' => 'file-text', - ], - [ - 'label' => \Yii::t('core', 'Robots'), - 'url' => [ '/seo/settings/robots' ], - 'icon' => 'android', - ], - [ - 'label' => \Yii::t('core', 'Sitemap'), - 'url' => [ '/seo/sitemap/index' ], - 'icon' => 'map-signs', + 'label' => \Yii::t('app', 'Speakers'), + 'url' => [ '/speaker/index' ], ], ], ], +// [ +// 'label' => \Yii::t('core', 'SEO'), +// 'url' => '#', +// 'template' => '{label}{badge}', +// 'items' => [ +// [ +// 'label' => \Yii::t('core', 'Seo pages'), +// 'url' => [ '/seo/alias/index' ], +// 'icon' => 'file-text', +// ], +// [ +// 'label' => \Yii::t('core', 'Robots'), +// 'url' => [ '/seo/settings/robots' ], +// 'icon' => 'android', +// ], +// [ +// 'label' => \Yii::t('core', 'Sitemap'), +// 'url' => [ '/seo/sitemap/index' ], +// 'icon' => 'map-signs', +// ], +// ], +// ], [ 'label' => \Yii::t('app', 'Blog'), 'url' => '#', @@ -95,7 +94,6 @@ ], ], ], - [ 'label' => \Yii::t('app', 'Настройки'), 'url' => [ '/settings' ], @@ -105,7 +103,6 @@ return \Yii::$app->controller->id === 'settings'; }, ], - [ 'label' => \Yii::t('app', 'Slides'), 'url' => [ '/slide/index' ], diff --git a/backend/views/request/update.php b/backend/views/request/update.php new file mode 100644 index 0000000..631a241 --- /dev/null +++ b/backend/views/request/update.php @@ -0,0 +1,104 @@ +title = ' asda sada'; + +?> + + +
    + + $this->title, + ] + ); + ?> + +
    + + field($model, 'secondname') + ->textInput() ?> + + field($model, 'name') + ->textInput() ?> + + field($model, 'dignity') + ->textInput() ?> + + field($model, 'gender') + ->dropDownList( + [ + 1 => 'Мужской', + 2 => 'Женский', + ] + ) ?> + + field($model, 'birth') + ->textInput() ?> + + field($model, 'citizenship') + ->textInput() ?> + + + field($model, 'passport') + ->textInput() ?> + + field($model, 'email') + ->textInput() ?> + + field($model, 'organization') + ->textInput() ?> + + field($model, 'conference') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> + + field($model, 'geee') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> + + field($model, 'gere') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> + + + +
    + + + +
    + $model->isNewRecord ? 'btn btn-success' : 'btn btn-success' ] + ) ?> +
    + + + + +
    + -- libgit2 0.21.4