summaryrefslogtreecommitdiff
path: root/protected/controllers/MyAngebotController.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/controllers/MyAngebotController.php')
-rw-r--r--protected/controllers/MyAngebotController.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/protected/controllers/MyAngebotController.php b/protected/controllers/MyAngebotController.php
index a1b6064..02d9929 100644
--- a/protected/controllers/MyAngebotController.php
+++ b/protected/controllers/MyAngebotController.php
@@ -2,6 +2,11 @@
class MyAngebotController extends Controller
{
+ /**
+ * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
+ * using two-column layout. See 'protected/views/layouts/column2.php'.
+ */
+ public $layout='//layouts/column2';
/**
* @return array action filters
@@ -45,13 +50,25 @@ class MyAngebotController extends Controller
if(isset($_POST['AngebotVerein']))
{
$model->attributes=$_POST['AngebotVerein'];
+ $model->verein_id = Yii::app()->user->vereinId;
if($model->save())
$this->redirect(array('index'));
}
+ $angebot = Angebot::model()->findAll();
+ $angebote = array();
+ foreach ($angebot as $a) {
+ $an = array();
+ $an["label"] = $a->name;
+ $an["value"] = $a->id;
+ $an["einheiten"] = $a->kategorie->einheiten;
+ array_push($angebote, $an);
+ }
+
$this->render('create',array(
'model'=>$model,
- 'angebote'=>Angebot::model()->findAll(),
+ 'angebote'=>$angebote,
+ 'einheiten'=>''
));
}
public function actionIndex()