/** * Send deadline reminder of a current meeting via email. */ public function actionSendDeadlineReminder($idRapat) { // is current user has the required privilege ? if (!Yii::app()->user->checkAccess('mail_deadlineReminder')) { throw new CHttpException(403, 'You are not authorized to perform this action.'); } $rapat = Rapat::model()->findByPk($idRapat); $agendaRapats = $this->getAgendaRapat($idRapat); $agendaRapats = $this->getTempAgendas($agendaRapats); $daftarAbsen = AbsenAnggota::model()->findAllByAttributes(array('id_rapat' => $idRapat)); $subject = '[Deadline Reminder] Rapat' . $rapat->waktu_tanggal; $content = 'Waktu : ' . $rapat->waktu_tanggal . ' </br>'; $content .= 'Tempat : ' . $rapat->tempat . ' </br>'; $content .= 'Jenis Rapat : ' . $rapat->jenisRapat->deskripsi . ' </br>'; $content .= 'Deadline Agenda : </br>'; foreach ($agendaRapats as $agenda) { if ($agenda->deadline) { $content .= '- ' . $agenda->topik . ' </br>'; $tamp = $agenda->deadline; while ($tamp != null) { $i = 0; $content .= '<br/>'; while ($i < 3) { $pos = strpos($tamp, '#'); $temp = substr($tamp, 0, $pos); $tamp = substr($tamp, $pos + 1, strlen($tamp) - $pos + 1); $content .= $temp; $content .= "<br/>"; $i++; } } $content .= "<br/>"; } } $members = Member::model()->findAll(); foreach ($members as $member) { while ($this->sendEmail($member->email) == false) { $this->sendEmail($member->email); } } /* $this->render('deadlineReminder', array( 'rapat' => $rapat, 'agendas' => $agendaRapats, 'daftarAbsen' => $daftarAbsen )); */ $this->redirect(array('site/index')); }
/** * Gets member attendance. */ private function getAbsenAnggota($id_rapat) { $daftarAbsen = AbsenAnggota::model()->findAllByAttributes(array('id_rapat' => $id_rapat)); return $daftarAbsen; }
public function actionMeetingEnded($idRapat) { // is current user has the required privilege ? if (!Yii::app()->user->checkAccess('site_endMeeting')) { throw new CHttpException(403, 'You are not authorized to perform this action.'); } $rapat = Rapat::model()->findByPk($idRapat); $agendaRapats = $this->getAgendaRapat($idRapat); $agendaRapats = $this->getTempAgendas($agendaRapats); $daftarAbsen = AbsenAnggota::model()->findAllByAttributes(array('id_rapat' => $idRapat)); $this->render('meetingEnded', array('rapat' => $rapat, 'agendas' => $agendaRapats, 'daftarAbsen' => $daftarAbsen)); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return AbsenAnggota the loaded model * @throws CHttpException */ public function loadModel($id) { $model = AbsenAnggota::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }