/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate($id_rapat, $id_agenda) { $model = new AgendaRapat(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $model->id_rapat = $id_rapat; $model->id_agenda = $id_agenda; $model->save(); /*if (isset($_POST['AgendaRapat'])) { $model->attributes = $_POST['AgendaRapat']; if ($model->save()) $this->redirect(array('view', 'id' => $model->id)); } $this->render('create', array( 'model' => $model, ));*/ }
/** * Saves all agendas selected for a meeting to Agenda_Rapat. */ protected function saveAllAgendas($id_rapat, $agendas) { foreach ($agendas as $id_agenda) { $agenda_rapat = new AgendaRapat(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $agenda_rapat->id_rapat = $id_rapat; //echo 'id rapat : '.$id_rapat; $agenda_rapat->id_agenda = $id_agenda; //echo ' id agenda : '.$id_agenda.'<br/>'; //$agenda = Agenda::model()->findByPk($id_agenda); //$agenda = AgendaController::class()->giveStatus($id_agenda, 'open'); //$agenda->status = 'open'; $agenda_rapat->save(); //$agenda->save(); } }