$months = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December'); $box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Choose Committee, Month and Year', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:100%;'))); ?> <br> <div class="span8"> <div class="well form-inline"> <?php echo CHtml::beginForm(); ?> <div style="alignment-baseline:5px; "> <label>Committee : </label> <?php $this->widget('bootstrap.widgets.TbSelect2', array('name' => 'comm_name', 'data' => CHtml::listData(Committee::model()->findAll(), 'comm_id', 'comm_name'), 'asDropDownList' => true, 'htmlOptions' => array('style' => 'width:60%;'))); ?> <?php echo CHtml::htmlButton('<i class="icon-search icon-white"></i> Search', array('class' => 'btn btn-success', 'type' => 'submit', 'name' => 'searchButton')); ?> <?php $this->widget('bootstrap.widgets.TbButton', array('type' => 'primary', 'url' => Yii::app()->controller->createUrl("reportsOthers/printCommReportMonthly", array("model" => $comm_name . ',' . $year . "," . $month)), 'label' => 'Print Result', 'visible' => isset($_POST['searchButton']) ? true : false, 'htmlOptions' => array('id' => 'printButton'))); ?> <br/> <br/> <label>Month : </label> <?php $this->widget('bootstrap.widgets.TbSelect2', array('name' => 'month', 'data' => $months, 'asDropDownList' => true, 'htmlOptions' => array('style' => 'width:20%;'))); ?> <label>Year : </label>
$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, ''); } else {
?> <?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"> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Search')); ?> </div> </div> <?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
public function actionCommReportYearly() { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Searched Yearly Committe Report per Committe'; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); $comm_name = ''; $ref_id = ''; $year = date('Y'); if (isset($_POST['searchButton'])) { $comm_name = $_POST['comm_name']; $year = $_POST['year']; $x = Committee::model()->findByPK($comm_name); $referrals = CHtml::listData(Referral::model()->findAll(array('condition' => 'lead_committee = :lcomm', 'params' => array(':lcomm' => $x->comm_id))), 'ref_id', 'ref_id'); $criteria = new CDbCriteria(); $criteria->condition = "action_taken <> 0 and comm_report like :comm_rep"; $criteria->params = array(':comm_rep' => $year . '%'); $criteria->addInCondition("ref_id", $referrals); $criteria->order = 'comm_report asc'; $dataProviderReso = new CActiveDataProvider('CommMeetingReso', array('criteria' => $criteria, 'pagination' => array('pageSize' => 20))); $dataProviderOrd = new CActiveDataProvider('CommMeetingOrdi', array('criteria' => $criteria, 'pagination' => array('pageSize' => 20))); date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Searched Yearly Committe Report of ' . $x->comm_name; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); } else { $dataProviderReso = new CActiveDataProvider('CommMeetingReso', array('criteria' => array('condition' => 'action_taken <> 0 or comm_report = null'), 'pagination' => array('pageSize' => 20))); $dataProviderOrd = new CActiveDataProvider('CommMeetingOrdi', array('criteria' => array('condition' => 'action_taken <> 0 or comm_report = null'), 'pagination' => array('pageSize' => 20))); } $this->render('commReportYearly', array('comm_name' => $comm_name, 'year' => $year, 'dataProviderReso' => $dataProviderReso, 'dataProviderOrd' => $dataProviderOrd)); }
?> <?php echo $form->textAreaRow($model, 'subject_matter', array('class' => 'span6', 'rows' => 5)); ?> <?php echo $form->datepickerRow($model, 'date_referred', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd'))); ?> <?php echo $form->select2Row($model, 'lead_committee', array('asDropDownList' => true, 'data' => CHtml::listData(Committee::model()->findAll(array('order' => 'comm_name asc')), 'comm_id', 'comm_name'), 'multiple' => 'multiple', 'data-placeholder' => ' ------------ Select Lead Committee ------------', 'options' => array('maximumSelectionSize' => 1, 'width' => '63%'))); ?> <?php echo $form->select2Row($model, 'joint_committee', array('asDropDownList' => true, 'data' => CHtml::listData(Committee::model()->findAll(array('order' => 'comm_name asc')), 'comm_id', 'comm_name'), 'multiple' => 'multiple', 'data-placeholder' => ' ------------ Select Joint Committee ------------', 'options' => array('width' => '63%'))); ?> <?php echo $form->datepickerRow($model, 'duedate', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd'))); ?> <?php echo $form->fileFieldRow($model, 'ind_letter'); ?> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Submit' : 'Save', 'htmlOptions' => array('confirm' => 'Do you want to continue?'))); $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'type' => 'warning', 'label' => 'Reset', 'htmlOptions' => array('style' => 'margin-left:1%;'))); ?> </div>
public function getJointsView() { if (!empty($this->joint_committee)) { $x = explode(',', $this->joint_committee); $names = ''; foreach ($x as $value) { $criteria = new CDbCriteria(); $criteria->condition = 'comm_id=:postID'; $criteria->params = array(':postID' => $value); $IA = Committee::model()->find($criteria); $names = $names . '(' . $IA['comm_name'] . ')'; } return $names; } else { return 'No Joint Committee'; } }
/** * 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 Committee the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Committee::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<td style="font-style:italic; width:85%;">JOINT COMMITTEE REPORT OF THE ' . strtoupper($val->ref->leadCommittee->comm_name) . strtoupper($comm) . '</td> </tr> <br/>'; } } foreach ($ordMeeting as $vals) { if (empty($vals->ref->joint_committee)) { $tbl .= '<tr style="font-size:11px; text-align:left;"> <td style="width:15%;"></td> <td style="font-style:italic; width:85%;">COMMITTEE REPORT OF THE ' . strtoupper($vals->ref->leadCommittee->comm_name) . '</td> </tr>'; } else { $x = explode(',', $vals->ref->joint_committee); $comm = ''; foreach ($x as $values) { $comm = ' AND ' . Committee::model()->findByPK($values)->comm_name . $comm; } $tbl .= '<tr style="font-size:11px; text-align:left;"> <td style="width:15%;"></td> <td style="font-style:italic; width:85%;">JOINT COMMITTEE REPORT OF THE ' . strtoupper($vals->ref->leadCommittee->comm_name) . strtoupper($comm) . '</td> </tr>'; } } $tbl .= '<tr style="font-size:13px; text-align:left;"> <td style="font-weight:bold; width:15%;">XI</td> <td style="font-weight:bold; width:85%;">CALENDAR OF BUSINESS</td> </tr> <br/> <tr style="font-size:11px; text-align:left;"> <td style="font-weight:bold; width:15%;"></td> <td style="font-weight:bold; width:85%;">A. UNFINISHED BUSINESS</td>