예제 #1
0
파일: _search.php 프로젝트: RubenRose/aviz
<div class="wide form">

    <?php 
$form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get', 'htmlOptions' => array('class' => 'form-horizontal')));
?>

<table>
    <tbody>
    <tr>
        <td> <?php 
echo $form->label($model, 'subdiv');
?>
            <?php 
echo $form->dropDownList($model, 'subdiv', CHtml::listData(Subdiv::model()->findAll(), 'id', 'name'), array('prompt' => 'Alegeți', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('tDb/Dynamicresp'), 'update' => '#' . CHtml::activeId($model, 'responsabil'))));
?>
</td>
        <td>
            <?php 
echo $form->label($model, 'responsabil');
?>
            <?php 
echo $form->DropDownList($model, 'responsabil', CHtml::listData(Responsabil::model()->findAllByAttributes(array('subdiv' => $model->subdiv)), 'id', 'fullname'), array('prompt' => 'Alegeți'));
?>
        </td>
    </tr>

    <tr>
        <td> <?php 
echo $form->label($model, 'date_reg');
?>
            <?php 
예제 #2
0
 /**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Subdiv::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }