Exemple #1
0
	<?php 
echo $form->textFieldRow($model, 'ord_no', array('class' => 'span2', 'value' => '', 'placeholder' => '000 - 0000'));
?>
    
  <?php 
echo $form->textAreaRow($model, 'subj_matter', array('class' => 'span6', 'rows' => 5, 'value' => ''));
?>
 

	<?php 
echo $form->select2Row($model, 'author', array('asDropDownList' => true, 'data' => CHtml::listData(Officials::model()->findAll(array('condition' => 'now() >= start_date')), 'off_id', 'Fullname'), 'multiple' => 'multiple', 'options' => array('width' => '63%', 'placeholder' => '        ------------ Choose Author ------------', 'tokenSeparators' => array(',', ' '))));
?>

    <?php 
echo $form->select2Row($model, 'imp_agency', array('asDropDownList' => true, 'data' => CHtml::listData(Agency::model()->findAll(), 'agency_id', 'agency_name'), 'multiple' => 'multiple', 'options' => array('width' => '63%', 'placeholder' => '        ------------ Choose Agency ------------', 'tokenSeparators' => array(',', ' '))));
?>
  <?php 
echo $form->textFieldRow($model, 'amend', array('class' => 'span2', 'value' => ''));
?>
  <?php 
echo $form->datepickerRow($model, 'firstreading', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd')));
?>
	<?php 
echo $form->datepickerRow($model, 'secondreading', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd')));
?>
  <?php 
echo $form->datepickerRow($model, 'thirdreading', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd')));
?>
  <?php 
echo $form->datepickerRow($model, 'date_passed', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd')));
} else {
    $pdf->SetFont('helvetica', 'B', 17);
    $pdf->Ln(25);
    $pdf->Write(0, 'Ordinance No. ' . $model->ord_no, '', 0, 'C', true, 0, false, false, 0);
    $pdf->Ln(15);
    $pdf->SetFont('helvetica', 'B', 14);
    $pdf->Write(0, $model->subj_matter, '', 0, 'C', true, 0, false, false, 0);
    $pdf->SetFont('helvetica', '', 10);
    $pdf->Ln(10);
    // -----------------------------------------------------------------------------
    $timezone = new DateTimeZone('Asia/Manila');
    $agenda = !empty($model->meeting_ordi_id) ? $model->getAgendaDate($model->meeting_ordi_id) : '0000-00-00';
    $origin = !empty($model->meeting_ordi_id) ? $model->getOrigin($model->meeting_ordi_id) : 'Unknown Origin';
    $referral = !empty($model->meeting_ordi_id) ? $model->getReferralDate($model->meeting_ordi_id) : '0000-00-00';
    $date_report = !empty($model->meeting_ordi_id) ? $model->getReportDate($model->meeting_ordi_id) : '0000-00-00';
    $agency = Agency::model()->FindByPK($model->imp_agency)->agency_name;
    $first = $model->firstreading;
    $second = $model->secondreading;
    $third = $model->thirdreading;
    $datepassed = $model->date_passed;
    $agenda1 = new DateTime($agenda, $timezone);
    $refer1 = new DateTime($referral, $timezone);
    $daterport = new DateTime($date_report, $timezone);
    $firstread = new DateTime($first, $timezone);
    $secondread = new DateTime($second, $timezone);
    $thirdread = new DateTime($third, $timezone);
    $datepassed1 = new DateTime($datepassed, $timezone);
    $tbl = '<table style="padding:10; font-size:16px; width:100%; border-bottom-style: 1px solid black;">';
    if ($agenda == '0000-00-00') {
        $tbl .= '<tr nobr="true">
                 <td style="border-top-style: 1px solid black; font-size:16px; font-weight:bold;">A) Date Agenda</td>
Exemple #3
0
 public function getAgencyView()
 {
     $x = explode(',', $this->imp_agency);
     $names = '';
     foreach ($x as $value) {
         $criteria = new CDbCriteria();
         $criteria->condition = 'agency_id=:postID';
         $criteria->params = array(':postID' => $value);
         $auth = Agency::model()->find($criteria);
         $names = '(' . $auth->agency_name . ')' . $names;
     }
     return $names;
 }
Exemple #4
0
<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
CHtml::$afterRequiredLabel = '';
?>
    <?php 
echo $form->dropDownListRow($model, 'monitor_id', CHtml::listData(MonitorOrd::model()->findAll(), 'monitor_id', 'monitor_id'), array('empty' => '--- Choose ID. ---'));
?>
	<?php 
echo $form->dropDownListRow($model, 'ord_no', CHtml::listData(Ordinance::model()->findAll(), 'ord_no', 'ord_no'), array('empty' => '----- Choose Ordinance -----'));
?>
	<?php 
echo $form->textFieldRow($model, 'subj_matter', array('class' => 'span4'));
?>
 
	<?php 
echo $form->select2Row($model, 'agency_id', array('asDropDownList' => true, 'data' => CHtml::listData(Agency::model()->findAll(), 'agency_id', 'agency_name'), 'multiple' => 'multiple', 'data-placeholder' => '           ------------ Select Agency ------------', 'options' => array('maximumSelectionSize' => 1, 'class' => 'span4')));
?>

	<?php 
echo $form->datepickerRow($model, 'date_furnished', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd')));
?>

	<?php 
echo $form->dropDownListRow($model, 'status', array(0 => 'Implemented', 1 => 'Partially Implemented', 2 => 'Not Implemented'), array('empty' => '----- Choose Status -----'));
?>
                                                                 

	<?php 
echo $form->textFieldRow($model, 'action_taken', array('class' => 'span4'));
?>
 
 /**
  * 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 Agency the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Agency::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
    foreach ($details as $values) {
        $pdf->SetFont('helvetica', '', 8);
        $tbl .= '<tr nobr="true">';
        $tbl .= '<td style="text-align:center; width:10%;">' . $values['ord_no'] . '</td>';
        $tbl .= '<td style="text-align:center; width:35%;">' . $values->subj_matter . '</td>';
        $x = explode(',', $values['author']);
        $auth_name = '';
        foreach ($x as $y) {
            $auth = Officials::model()->findByPK($y);
            $auth_name = $auth->Fullname . '<br/>' . $auth_name;
        }
        $tbl .= '<td style="text-align:center; width:20%;">' . $auth_name . '</td>';
        $x = explode(',', $values['imp_agency']);
        $agname = '';
        foreach ($x as $y) {
            $ag = Agency::model()->findByPK($y);
            $agname = $ag->agency_name . '<br/>' . $agname;
        }
        $tbl .= '<td style="text-align:center; width:20%;">' . $agname . '</td>';
        $tbl .= '<td style="text-align:center; width:15%;">' . $values->date_passed . '</td>';
        $tbl .= '</tr>';
    }
    $tbl .= '</table>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
} else {
    $pdf->Write(0, 'No Ordinance for the Year ' . date('Y', strtotime($start_year)) . 'to' . date('Y', strtotime($end_year)), '', 0, 'C', true, 0, false, false, 0);
}
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document