/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new AbsenAnggota(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['AbsenAnggota'])) { $model->attributes = $_POST['AbsenAnggota']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
/** * record meeting member's attendance */ public function flagAttendance($idRapat, $role) { $absen = AbsenAnggota::model()->findByAttributes(array('id_rapat' => $idRapat, 'id_account' => Yii::app()->user->id)); if (!$absen) { $absen = new AbsenAnggota(); $absen->id_rapat = $idRapat; $absen->id_account = Yii::app()->user->id; if ($role == 'chairperson') { $absen->inisial_jabatan = 'CHP'; } else { if ($role == 'notulen') { $absen->inisial_jabatan = 'NTL'; } else { $absen->inisial_jabatan = 'MBR'; } } $absen->status = 'hadir'; $absen->save(); } }