diff --git a/common/models/Option.php b/common/models/Option.php new file mode 100644 index 0000000..ab31dd0 --- /dev/null +++ b/common/models/Option.php @@ -0,0 +1,88 @@ + 200] + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'model' => Yii::t('app', 'Model'), + 'option_id' => Yii::t('app', 'Option ID'), + 'model_id' => Yii::t('app', 'Model ID'), + 'name' => Yii::t('app', 'Name'), + 'template' => Yii::t('app', 'Template'), + 'option_pid' => Yii::t('app', 'Option Pid'), + 'date_add' => Yii::t('app', 'Date Add'), + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getParent() + { + return $this->hasOne(Option::className(), ['option_id' => 'option_pid']); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getChildren() + { + return $this->hasMany(Option::className(), ['option_pid' => 'option_id']); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getOptionLangs() + { + return $this->hasMany(OptionLang::className(), ['option_id' => 'option_id']); + } + + public function getValue() + { + return $this->hasOne(OptionLang::className(), ['option_id' => 'option_id'])->where(['option_lang.language_id' => 0]); + } +} diff --git a/common/models/OptionLang.php b/common/models/OptionLang.php new file mode 100644 index 0000000..1f3b390 --- /dev/null +++ b/common/models/OptionLang.php @@ -0,0 +1,67 @@ + Yii::t('app', 'Option Lang ID'), + 'option_id' => Yii::t('app', 'Option ID'), + 'language_id' => Yii::t('app', 'Language ID'), + 'value' => Yii::t('app', 'Value'), + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguage() + { + return $this->hasOne(Language::className(), ['language_id' => 'language_id']); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getOption() + { + return $this->hasOne(Option::className(), ['option_id' => 'option_id']); + } +} diff --git a/common/models/OptionLangSearch.php b/common/models/OptionLangSearch.php new file mode 100644 index 0000000..f610016 --- /dev/null +++ b/common/models/OptionLangSearch.php @@ -0,0 +1,68 @@ + $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; + } + + $query->andFilterWhere([ + 'option_lang_id' => $this->option_lang_id, + 'option_id' => $this->option_id, + 'language_id' => $this->language_id, + ]); + + $query->andFilterWhere(['like', 'value', $this->value]); + + return $dataProvider; + } +} diff --git a/common/models/OptionSearch.php b/common/models/OptionSearch.php new file mode 100644 index 0000000..14c7bff --- /dev/null +++ b/common/models/OptionSearch.php @@ -0,0 +1,71 @@ + $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; + } + + $query->andFilterWhere([ + 'option_id' => $this->option_id, + 'model_id' => $this->model_id, + 'option_pid' => $this->option_pid, + 'date_add' => $this->date_add, + ]); + + $query->andFilterWhere(['like', 'model', $this->model]) + ->andFilterWhere(['like', 'name', $this->name]) + ->andFilterWhere(['like', 'template', $this->template]); + + return $dataProvider; + } +} diff --git a/console/migrations/m160125_151635_delete_lang_field.php b/console/migrations/m160125_151635_delete_lang_field.php new file mode 100644 index 0000000..0b3a7a2 --- /dev/null +++ b/console/migrations/m160125_151635_delete_lang_field.php @@ -0,0 +1,27 @@ +dropColumn('option', 'translate'); + } + + public function down() + { + $this->addColumn('option', 'translate', $this->smallInteger()); + } + +// public function safeUp() +// { +// $this->dropColumn('option', 'translate'); +// } +// +// public function safeDown() +// { +// $this->addColumn('option', 'translate', $this->smallInteger()); +// } +} diff --git a/frontend/assets/AdminAsset.php b/frontend/assets/AdminAsset.php index 2173f44..551582f 100755 --- a/frontend/assets/AdminAsset.php +++ b/frontend/assets/AdminAsset.php @@ -20,7 +20,7 @@ class AdminAsset extends AssetBundle public $css = [ 'css/style.css', '/admin/css/flags32.css', - 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', + //'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', ]; public $js = [ 'js/script.js', diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index d141d22..b96f39d 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -20,7 +20,7 @@ class AppAsset extends AssetBundle public $css = [ 'css/style.css', '/admin/css/flags32.css', - 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', + //'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', ]; public $js = [ 'js/script.js', diff --git a/frontend/controllers/OptionLangController.php b/frontend/controllers/OptionLangController.php new file mode 100644 index 0000000..1cd5634 --- /dev/null +++ b/frontend/controllers/OptionLangController.php @@ -0,0 +1,124 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => ['post'], + ], + ], + ]; + } + + /** + * Lists all OptionLang models. + * @return mixed + */ + public function actionIndex() + { + $searchModel = new OptionLangSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single OptionLang model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new OptionLang model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new OptionLang(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->option_lang_id]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing OptionLang model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->option_lang_id]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing OptionLang model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the OptionLang model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return OptionLang the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = OptionLang::findOne($id)) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } +} diff --git a/frontend/controllers/PerformerController.php b/frontend/controllers/PerformerController.php new file mode 100644 index 0000000..cd352d1 --- /dev/null +++ b/frontend/controllers/PerformerController.php @@ -0,0 +1,80 @@ + [ + 'class' => 'yii\web\ErrorAction', + ], + 'captcha' => [ + 'class' => 'yii\captcha\CaptchaAction', + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, + ], + ]; + } + + /** + * Displays homepage. + * + * @return mixed + */ + public function actionSearch() + { + return $this->render('search'); + } + + public function actionCommon(/*$performer_id*/) + { + return $this->render('common'); + } + + public function actionPortfolio(/*$performer_id*/) + { + return $this->render('portfolio'); + } + + public function actionBlogList(/*$performer_id*/) + { + return $this->render('blog-list'); + } + + public function actionBlogView(/*$performer_id, $article_id*/) + { + return $this->render('blog-view'); + } + +} diff --git a/frontend/controllers/ProfileController.php b/frontend/controllers/ProfileController.php new file mode 100644 index 0000000..a85f779 --- /dev/null +++ b/frontend/controllers/ProfileController.php @@ -0,0 +1,58 @@ + [ + 'class' => 'yii\web\ErrorAction', + ], + 'captcha' => [ + 'class' => 'yii\captcha\CaptchaAction', + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, + ], + ]; + } + + /** + * Displays homepage. + * + * @return mixed + */ + public function actionSearch() + { + return $this->render('search'); + } + +} diff --git a/frontend/controllers/TenderController.php b/frontend/controllers/TenderController.php new file mode 100644 index 0000000..54f958d --- /dev/null +++ b/frontend/controllers/TenderController.php @@ -0,0 +1,66 @@ + [ + 'class' => 'yii\web\ErrorAction', + ], + 'captcha' => [ + 'class' => 'yii\captcha\CaptchaAction', + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, + ], + ]; + } + /** + * Displays homepage. + * + * @return mixed + */ + public function actionIndex() + { + return $this->render('index'); + } + + public function actionView(/*$tender_id*/) + { + return $this->render('view'); + } + + public function actionSearch() + { + return $this->render('search'); + } + +} diff --git a/frontend/controllers/VacancyController.php b/frontend/controllers/VacancyController.php new file mode 100644 index 0000000..221ef17 --- /dev/null +++ b/frontend/controllers/VacancyController.php @@ -0,0 +1,57 @@ + [ + 'class' => 'yii\web\ErrorAction', + ], + 'captcha' => [ + 'class' => 'yii\captcha\CaptchaAction', + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, + ], + ]; + } + /** + * Displays homepage. + * + * @return mixed + */ + public function actionSearch() + { + return $this->render('search'); + } + +} diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index f15a65c..e139fb8 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -17,7 +17,7 @@ AppAsset::register($this); - + @@ -62,67 +62,60 @@ AppAsset::register($this);