From cee219ed14729c6de8b9387840bf46dc851daa02 Mon Sep 17 00:00:00 2001 From: rocho Date: Tue, 29 Sep 2015 09:02:53 +0200 Subject: [PATCH] add reception changes --- frontend/components/FrontendMenuStructure.php | 19 +----- frontend/controllers/CustomerController.php | 15 ++++- frontend/models/ReceptionForm.php | 36 ++++++++++ frontend/views/customer/_form_reception.php | 66 +++++++++++++++++++ frontend/views/customer/main.php | 7 -- frontend/views/customer/reception.php | 11 ++++ frontend/views/layouts/main.php | 2 +- 7 files changed, 128 insertions(+), 28 deletions(-) create mode 100644 frontend/models/ReceptionForm.php create mode 100644 frontend/views/customer/_form_reception.php delete mode 100644 frontend/views/customer/main.php create mode 100644 frontend/views/customer/reception.php diff --git a/frontend/components/FrontendMenuStructure.php b/frontend/components/FrontendMenuStructure.php index e4bef95..058b36e 100644 --- a/frontend/components/FrontendMenuStructure.php +++ b/frontend/components/FrontendMenuStructure.php @@ -26,24 +26,7 @@ class FrontendMenuStructure{ protected function addUserMainMenu(){ - - $userMainMenu = null; - $items = []; - - - $items[] = ['label' => 'Vendégek', 'url' => ['/customer/main'] ]; - - if ( count($items) > 0 ){ - $userMainMenu = ['label' => 'Beállítások', 'url' => null, - 'items' => $items - ]; - } - - if ( isset($userMainMenu)){ - $this->menuItems[] = $userMainMenu; - } - - + $this->menuItems[] = ['label' => 'Recepcio', 'url' => ['/customer/reception'] ]; } diff --git a/frontend/controllers/CustomerController.php b/frontend/controllers/CustomerController.php index 8f156ee..e013318 100644 --- a/frontend/controllers/CustomerController.php +++ b/frontend/controllers/CustomerController.php @@ -4,10 +4,12 @@ namespace frontend\controllers; use Yii; use common\models\Customer; +use frontend\models\ReceptionForm; use frontend\models\CustomerSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\base\Object; /** * CustomerController implements the CRUD actions for Customer model. @@ -29,12 +31,21 @@ class CustomerController extends Controller ]; } - public function actionMain(){ + public function actionReception(){ + + $model = new ReceptionForm(); + + if ($model->load(Yii::$app->request->post()) && $model->validate()) { + +// return $this->redirect(['view', 'id' => $model->id_customer]); + } - return $this->render('main',[]); + return $this->render('reception',['model' => $model]); } + + /** * Lists all Customer models. * @return mixed diff --git a/frontend/models/ReceptionForm.php b/frontend/models/ReceptionForm.php new file mode 100644 index 0000000..47b14f9 --- /dev/null +++ b/frontend/models/ReceptionForm.php @@ -0,0 +1,36 @@ + 'Verification Code', + ]; + } + +} diff --git a/frontend/views/customer/_form_reception.php b/frontend/views/customer/_form_reception.php new file mode 100644 index 0000000..524904b --- /dev/null +++ b/frontend/views/customer/_form_reception.php @@ -0,0 +1,66 @@ + + + + +
+ + + +
+
+
+
+ 'btn btn-primary btn-reception'] )?> +
+
+ 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?> +
+
+
+
+ 'btn btn-primary btn-reception'] )?> +
+
+ 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?> +
+
+
+
+ 'btn btn-primary btn-reception'] )?> +
+
+
+
+ 'btn btn-primary btn-reception'] )?> +
+
+
+
+ 'btn btn-primary btn-reception'] )?> +
+
+
+
+ field($model, 'number')->textInput()?> +
+
+ + + + +
diff --git a/frontend/views/customer/main.php b/frontend/views/customer/main.php deleted file mode 100644 index 2516bcc..0000000 --- a/frontend/views/customer/main.php +++ /dev/null @@ -1,7 +0,0 @@ - - - -

Recepció

\ No newline at end of file diff --git a/frontend/views/customer/reception.php b/frontend/views/customer/reception.php new file mode 100644 index 0000000..972305a --- /dev/null +++ b/frontend/views/customer/reception.php @@ -0,0 +1,11 @@ + + + +

Recepció

+ +render('_form_reception', [ 'model' => $model ]); ?> \ No newline at end of file diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 7ca8b3d..ba9afeb 100644 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -57,7 +57,7 @@ AppAsset::register($this); } echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], - 'items' => $menuItems, + 'items' => $items, ]); NavBar::end(); ?>