Пример #1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new TempAgenda();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['TempAgenda'])) {
         $model->attributes = $_POST['TempAgenda'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
Пример #2
0
 public function actionEndMeeting($idRapat)
 {
     $rapat = Rapat::model()->findByPk($idRapat);
     $agendaRapats = $this->getAgendaRapat($idRapat);
     $agendaRapats = $this->getAgendas($agendaRapats);
     foreach ($agendaRapats as $agendaRapat) {
         $tempAgenda = TempAgenda::model()->findByAttributes(array('id_agenda' => $agendaRapat->id));
         if (!$tempAgenda) {
             $realTemp = RealTemp::model()->findByPk($agendaRapat->id);
             $tempAgenda = new TempAgenda();
             $tempAgenda->id_agenda = $agendaRapat->id;
             $tempAgenda->tanggal = $rapat->waktu_tanggal;
             $tempAgenda->topik = $agendaRapat->topik;
             $tempAgenda->catatan = $realTemp->catatan;
             $tempAgenda->keputusan = $realTemp->keputusan;
             $tempAgenda->deadline = $realTemp->deadline;
             $tempAgenda->save();
         }
     }
     $this->redirect(array('site/meetingEnded', 'idRapat' => $rapat->id));
 }