public function actionPrintAgendaMaker($id) { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Printed Agenda ID: ' . $id; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); $model = Agenda::model()->findByPK($id); $communication = Communication::model()->findAll(array('condition' => 'date_agenda = :date_agenda', 'params' => array(':date_agenda' => $model->session_date))); $resoMeeting = CommMeetingReso::model()->findAll(array('condition' => 'comm_report = :comm_report', 'params' => array(':comm_report' => $model->session_date))); $ordMeeting = CommMeetingOrdi::model()->findAll(array('condition' => 'comm_report = :comm_report', 'params' => array(':comm_report' => $model->session_date))); $this->renderPartial('printAgendaMaker', array('model' => $model, 'communication' => $communication, 'resoMeeting' => $resoMeeting, 'ordMeeting' => $ordMeeting)); }
<?php /* @var $this ResolutionController */ /* @var $dataProvider CActiveDataProvider */ $this->breadcrumbs = array('Resolutions'); $this->menu = array(array('label' => 'Create Resolution', 'url' => array('create')), array('label' => 'Manage Resolution', 'url' => array('admin'))); $this->menu = array(array('label' => 'Monthly Committee Reports', 'url' => array('reportsOthers/commReportMonthly')), array('label' => 'Yearly Committee Reports', 'url' => array('reportsOthers/commReportYearly')), array('label' => 'Monitor Ordinances', 'url' => array('monitorOrd/index')), array('label' => 'Track Communications', 'url' => array('reportsOthers/viewTracking'))); Yii::app()->clientScript->registerScript('search', "\r\n\r\n\$('.search-form form').submit(function(){\r\n\t\$('#track-communication-for-resolution-grid').yiiGridView('update', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n\r\n\$('.search-form form').submit(function(){\r\n\t\$('#track-communication-for-ordinance-grid').yiiGridView('update', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n"); $box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Track Communications for Resolution', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:126%; text-align:center;'))); ?> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'track-communication-for-resolution-grid', 'dataProvider' => $forResolution->forResolution(), 'filter' => Communication::model(), 'htmlOptions' => array('style' => 'padding:15px', 'style' => 'width:100%;'), 'template' => "{items}{pager}", 'columns' => array(array('name' => 'ctrl_no', 'value' => '$data->ctrl_no', 'htmlOptions' => array('style' => 'width:10%;')), array('header' => 'Agenda Date', 'value' => '$data->date_agenda'), array('header' => 'Origin', 'filter' => CHtml::listData(Origin::model()->findAll(), 'orig_id', 'orig_name'), 'value' => '$data->orig->orig_name'), array('name' => 'subject_matter', 'value' => '$data->subject_matter', 'htmlOptions' => array('style' => 'width:20%;')), array('header' => 'Date Referred', 'value' => ' $data->getReferral($data->ctrl_no)'), array('header' => 'Date Meeting/s', 'value' => '$data->getCommMeetings($data->ctrl_no)'), array('header' => 'Action Taken', 'value' => '$data->getActionTaken($data->ctrl_no)'), array('header' => 'Date Reported', 'value' => '$data->getCommReport($data->ctrl_no)'), array('header' => 'Ordinance/Resolution No.', 'value' => '$data->getTitle($data->ctrl_no)')))); ?> <?php $this->endWidget(); ?> <?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Track Communications for Ordinance', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:126%; text-align:center;'))); ?> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'track-communication-for-ordinance-grid', 'dataProvider' => $forOrdinance->forOrdinance(), 'filter' => $forOrdinance, 'htmlOptions' => array('style' => 'padding:15px', 'style' => 'width:100%;'), 'template' => "{items}{pager}", 'columns' => array('ctrl_no', array('header' => 'Agenda Date', 'value' => '$data->date_agenda'), array('header' => 'Origin', 'value' => '$data->orig->orig_name'), array('name' => 'subject_matter', 'value' => '$data->subject_matter'), array('header' => 'Date Referred', 'value' => ' $data->getReferral($data->ctrl_no)'), array('header' => 'Date Meeting/s', 'value' => '$data->getCommMeetings($data->ctrl_no)'), array('header' => 'Action Taken', 'value' => '$data->getActionTaken($data->ctrl_no)'), array('header' => 'Date Reported', 'value' => '$data->getCommReport($data->ctrl_no)'), array('header' => 'Ordinance/Resolution No.', 'value' => '$data->getTitle($data->ctrl_no)')))); ?>
$box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Advanced Search', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:853px;'))); ?> <br> <div class="span8"> <div class="wide form"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get')); CHtml::$afterRequiredLabel = ''; ?> <?php echo $form->textFieldRow($model, 'ref_id'); ?> <?php echo $form->dropDownListRow($model, 'ctrl_no', CHtml::listData(Communication::model()->findAll(array('condition' => 'date_agenda >= ' . date('Y-m-d'))), 'ctrl_no', 'ctrl_no'), array('class' => 'span4', 'prompt' => '------ Select Control Number ------')); ?> <?php echo $form->datepickerRow($model, 'date_referred', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd'))); ?> <?php echo $form->dropDownListRow($model, 'lead_committee', CHtml::listData(Committee::model()->findAll(), 'comm_id', 'comm_name'), array('class' => 'span4', 'prompt' => '------ Select Lead Committee ------')); ?> <?php echo $form->select2Row($model, 'joint_committee', array('asDropDownList' => true, 'data' => CHtml::listData(Committee::model()->findAll(), 'comm_id', 'comm_name'), 'multiple' => 'multiple', 'options' => array('width' => '50%', 'placeholder' => ' ------------ Choose Joint Committee ------------', 'tokenSeparators' => array(',', ' ')))); ?> <div class="form-actions">
<div id="header"> <div id="logo"><img src="images/banner.png" style="width: 100vw;"/></div> </div><!-- header --> <div class="container" id="page" > <?php $countNotif = count(ForumQuestion::model()->findAll(array('condition' => 'confirmation=0'))); $notif = $this->widget('bootstrap.widgets.TbBadge', array('type' => $countNotif == 0 ? 'info' : 'important', 'label' => $countNotif), true); $receiving = count(Communication::model()->findAll(array('condition' => 'type_comm = 2 and now() >= date_agenda '))); $notifRC = $this->widget('bootstrap.widgets.TbBadge', array('type' => $receiving == 0 ? 'info' : 'important', 'label' => $receiving), true); $referralCount = count(Communication::model()->findAll(array('condition' => 'archive=0 and comm_stat=0 and type_comm<>2'))); $referralduedateCount = count(Referral::model()->findAll(array('condition' => 'referral_stat = 0 and now() > duedate'))); $meetingResoCount = count(Referral::model()->countCommMeetingReso()); $meetingOrdiCount = count(Referral::model()->countCommMeetingOrdi()); $rfTotal = 0; $rfTotal = $referralCount + $meetingOrdiCount + $meetingResoCount + $referralduedateCount; $notifRFTotal = $this->widget('bootstrap.widgets.TbBadge', array('type' => $rfTotal == 0 ? 'info' : 'important', 'label' => $rfTotal), true); $notifRFrefduedate = $this->widget('bootstrap.widgets.TbBadge', array('type' => $referralduedateCount == 0 ? 'info' : 'important', 'label' => $referralduedateCount), true); $notifRFref = $this->widget('bootstrap.widgets.TbBadge', array('type' => $referralCount == 0 ? 'info' : 'important', 'label' => $referralCount), true); $notifRFreso = $this->widget('bootstrap.widgets.TbBadge', array('type' => $meetingResoCount == 0 ? 'info' : 'important', 'label' => $meetingResoCount), true); $notifRFordi = $this->widget('bootstrap.widgets.TbBadge', array('type' => $meetingOrdiCount == 0 ? 'info' : 'important', 'label' => $meetingOrdiCount), true); $resoCount = count(Status::model()->countResolution()); $ordiCount = count(CommMeetingOrdi::model()->findAll(array('condition' => 'archive=0 and comm_meeting_stat=1 and ord_remark=0 and action_taken=1'))); $tTotal = 0; $tTotal = $resoCount + $ordiCount; $notifTtotal = $this->widget('bootstrap.widgets.TbBadge', array('type' => $tTotal == 0 ? 'info' : 'important', 'label' => $tTotal), true);
public function getCommDetails() { return Communication::model()->findByPK($this->ref->ctrlNo->ctrl_no); }
/** * 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 Communication the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Communication::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
$pdf->SetFont('helvetica', 'B', 20); $timezone = new DateTimeZone('Asia/Manila'); // ----------------------------------------------------------------------------- $tbl = '<table cellspacing="0" cellpadding="7" border="1" width="100%"> <thead> <tr style="font-weight:bold; font-size:13px; background-color:skyblue;"> <td style="text-align:center; width:10%;">Control No.</td> <td style="text-align:center; width:10%;">Date Referred</td> <td style="text-align:center; width:35%;">Subject Matter</td> <td style="text-align:center; width:25%;">Lead Committee</td> <td style="text-align:center; width:10%;">Duedate</td> <td style="text-align:center; width:10%;">Remarks</td> </tr> </thead>'; foreach ($model as $values) { $sbj = Communication::model()->FindByPK($values->ctrl_no)->subject_matter; $comm = Committee::model()->FindByPK($values->lead_committee)->comm_name; $dateref = new DateTime($values->date_referred, $timezone); $dateref1 = new DateTime($values->duedate, $timezone); $pdf->SetFont('helvetica', '', 10); $tbl .= '<tr nobr="true">'; $tbl .= '<td style="text-align:center; width:10%;">' . $values->ctrl_no . '</td>'; $tbl .= '<td style="text-align:center; width:10%;">' . $dateref->format('M j , Y') . '</td>'; $tbl .= '<td style="text-align:center; width:35%;">' . $sbj . '</td>'; $tbl .= '<td style="text-align:center; width:25%;">' . $comm . '</td>'; $tbl .= '<td style="text-align:center; width:10%;">' . $dateref1->format('M j , Y') . '</td>'; $tbl .= '<td style="text-align:center; width:10%;"></td>'; $tbl .= '</tr>'; } $tbl .= '</table>'; $pdf->writeHTML($tbl, true, false, false, false, '');
public function getAgendaDate($ctrl) { if ($ctrl) { $criteria = new CDbCriteria(); $ref = CommMeetingOrdi::model()->find($criteria)->ref_id; $ctrl = Referral::model()->findByPK($ref)->ctrl_no; return Communication::model()->findByPK($ctrl)->date_agenda; } else { return 'No Agenda'; } }
public function forCommMeetingOrdi() { // @todo Please modify the following code to remove attributes that should not be searched. $cat = Category::model()->findByAttributes(array('cat_name' => 'Provincial Ordinance'))->cat_id; $result = CHtml::listData(Communication::model()->findAll(array('condition' => 'cat_id = ' . $cat . ' and comm_stat=1')), 'ctrl_no', 'ctrl_no'); $criteria = new CDbCriteria(); $criteria->condition = 'archive=0 and referral_stat=0'; $criteria->addInCondition("ctrl_no", $result); $criteria->compare('ref_id', $this->ref_id); $criteria->compare('ctrl_no', $this->ctrl_no, true); $criteria->compare('date_referred', $this->date_referred, true); $criteria->compare('duedate', $this->duedate, true); $criteria->compare('lead_committee', $this->lead_committee); $criteria->compare('joint_committee', $this->joint_committee, true); $criteria->compare('ind_letter', $this->ind_letter, true); $criteria->compare('referral_stat', $this->referral_stat, true); $criteria->compare('input_by', $this->input_by); $criteria->compare('archive', $this->archive, true); return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => 10))); }
public function getReportDate($ctrl) { if ($ctrl) { $x = Referral::model()->findByAttributes(array('ctrl_no' => $ctrl)); if ($x) { return CommMeetingReso::model()->find(array('condition' => 'ref_id = ' . $x->ref_id . ' and comm_report IS NOT NULL'))->comm_report; } else { return Communication::model()->findByPK($ctrl)->date_agenda; } } else { return '0000-00-00'; } }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate($id) { $model = new Referral(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Referral'])) { $model->attributes = $_POST['Referral']; $model->lead_committee = implode(',', $model->lead_committee); $model->archive = 0; $picture_name = ''; // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $picture_file = CUploadedFile::getInstance($model, 'ind_letter'); $model->ind_letter = $picture_file; // has the user uploaded a new file? if ($picture_file) { $picture_name = $picture_file->name; if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4))) { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4)); mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no . '/' . $picture_file->getName()); } else { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no . '/' . $picture_file->getName()); } } if (!empty($model->joint_committee)) { $b = implode(',', $model->joint_committee); $model->joint_committee = $b; } $model->referral_stat = 0; $model->input_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; if ($model->save()) { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Added Another Referral'; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no)); $stat->comm_stat = 1; $stat->save(); $activity->save(); Communication::model()->updateByPk($model->ctrl_no, array('comm_stat' => 1)); $this->redirect(array('view', 'id' => $model->ref_id)); } } $this->render('create', array('model' => $model, 'id' => $id)); }
public function getCommReport($d) { $x = Referral::model()->findByAttributes(array('ctrl_no' => $d)); if (!empty($x->ref_id)) { if ($this->cat->cat_name == 'Provincial Ordinance') { $ord = CommMeetingOrdi::model()->findAll(array('condition' => 'ref_id=' . $x->ref_id, 'order' => 'date_meeting desc', 'limit' => 1)); $y = ''; foreach ($ord as $key) { $y = $key->comm_report; } if ($y == '') { echo 'None'; } else { echo $y; } } else { $reso = CommMeetingReso::model()->findAll(array('condition' => 'ref_id=' . $x->ref_id, 'order' => 'date_meeting desc', 'limit' => 1)); $y = ''; foreach ($reso as $key) { $y = $key->comm_report; } if ($y == '') { echo 'None'; } else { echo $y; } } } else { $comm = Communication::model()->find(array('condition' => 'type_comm=0 and ctrl_no=:d', 'params' => array(':d' => $d))); if (!empty($comm->date_agenda)) { echo $comm->date_agenda; } else { echo 'None'; } } }
public function countResolution() { // @todo Please modify the following code to remove attributes that should not be searched. $cat = Category::model()->findByAttributes(array('cat_name' => 'Provincial Ordinance'))->cat_id; $result = CHtml::listData(Communication::model()->findAll(array('condition' => 'cat_id <> ' . $cat . ' and comm_stat=1')), 'ctrl_no', 'ctrl_no'); $criteria = new CDbCriteria(); $criteria->condition = 'comm_meeting_stat = 1 and remarks =0'; $criteria->addInCondition("ctrl_no", $result); return Status::model()->findAll($criteria); }