add reception changes

This commit is contained in:
rocho 2015-09-29 09:02:53 +02:00
parent 2bcaee18de
commit cee219ed14
7 changed files with 128 additions and 28 deletions

View File

@ -26,24 +26,7 @@ class FrontendMenuStructure{
protected function addUserMainMenu(){ protected function addUserMainMenu(){
$this->menuItems[] = ['label' => 'Recepcio', 'url' => ['/customer/reception'] ];
$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;
}
} }

View File

@ -4,10 +4,12 @@ namespace frontend\controllers;
use Yii; use Yii;
use common\models\Customer; use common\models\Customer;
use frontend\models\ReceptionForm;
use frontend\models\CustomerSearch; use frontend\models\CustomerSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
use yii\base\Object;
/** /**
* CustomerController implements the CRUD actions for Customer model. * 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();
return $this->render('main',[]); if ($model->load(Yii::$app->request->post()) && $model->validate()) {
// return $this->redirect(['view', 'id' => $model->id_customer]);
} }
return $this->render('reception',['model' => $model]);
}
/** /**
* Lists all Customer models. * Lists all Customer models.
* @return mixed * @return mixed

View File

@ -0,0 +1,36 @@
<?php
namespace frontend\models;
use Yii;
use yii\base\Model;
/**
* ContactForm is the model behind the contact form.
*/
class ReceptionForm extends Model
{
public $number;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['number'], 'required'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'verifyCode' => 'Verification Code',
];
}
}

View File

@ -0,0 +1,66 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
/* @var $form yii\widgets\ActiveForm */
?>
<style >
.reception-form .btn.btn-reception{
width:100%;
margin-top: 6px;
margin-bottom: 6px;
}
</style>
<div class="reception-form">
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class='col-md-3'>
<div class='row'>
<div class='col-md-8'>
<?php echo Html::a(Yii::t( 'frontend/customer', 'Adatlap') , null, ['class' => 'btn btn-primary btn-reception'] )?>
</div>
<div class='col-md-4'>
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?>
</div>
</div>
<div class='row'>
<div class='col-md-8'>
<?php echo Html::a(Yii::t( 'frontend/customer', 'Befizetések') ,null,['class' => 'btn btn-primary btn-reception'] )?>
</div>
<div class='col-md-4'>
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?>
</div>
</div>
<div class='row'>
<div class='col-md-12'>
<?php echo Html::a(Yii::t( 'frontend/customer', 'Jelentkezések') , null,['class' => 'btn btn-primary btn-reception'] )?>
</div>
</div>
<div class='row'>
<div class='col-md-12'>
<?php echo Html::a(Yii::t( 'frontend/customer', 'Egyenleg') , null,['class' => 'btn btn-primary btn-reception'] )?>
</div>
</div>
<div class='row'>
<div class='col-md-12'>
<?php echo Html::a(Yii::t( 'frontend/customer', 'Termékeladás') , null,['class' => 'btn btn-primary btn-reception'] )?>
</div>
</div>
</div>
<div class='col-md-2'>
<?php echo $form->field($model, 'number')->textInput()?>
</div>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -1,7 +0,0 @@
<?php
?>
<h1>Recepció</h1>

View File

@ -0,0 +1,11 @@
<?php
?>
<h1>Recepció</h1>
<?php
?>
<?php echo $this->render('_form_reception', [ 'model' => $model ]); ?>

View File

@ -57,7 +57,7 @@ AppAsset::register($this);
} }
echo Nav::widget([ echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'], 'options' => ['class' => 'navbar-nav navbar-right'],
'items' => $menuItems, 'items' => $items,
]); ]);
NavBar::end(); NavBar::end();
?> ?>