Example #1
0
/* @var $form CActiveForm */
?>

<?php 
$box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Advanced Search', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:100%;')));
?>
<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->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')));
?>
 /**
  * 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 MonitorOrd the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = MonitorOrd::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }