<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array( 'id'=>'meac-office-form', // Please note: When you enable ajax validation, make sure the corresponding // controller action is handling ajax validation correctly. // There is a call to performAjaxValidation() commented in generated controller code. // See class documentation of CActiveForm for details on this. 'enableAjaxValidation'=>false, )); ?> <p class="help-block">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <?php echo $form->textFieldControlGroup($model,'description',array('span'=>5,'maxlength'=>255)); ?> <?php echo $form->textFieldControlGroup($model,'abbrev',array('span'=>5,'maxlength'=>20)); ?> <?php echo $form->dropDownListControlGroup($model,'parent_id',TbHtml::listData(MeacOffice::model()->findAll(),'id','description'),array('prompt'=>'--select--','span'=>5)); ?> <?php echo $form->checkBoxControlGroup($model,'active',array('span'=>5)); ?> <div class="form-actions"> <?php echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array( 'color'=>TbHtml::BUTTON_COLOR_SUCCESS, 'size'=>TbHtml::BUTTON_SIZE_DEFAULT, )); ?> </div> <?php $this->endWidget(); ?> </div><!-- form -->
/** * 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 MeacOffice the loaded model * @throws CHttpException */ public function loadModel($id) { $model = MeacOffice::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
'type' => 'text', 'url' => $this->createUrl('user/ajaxUpdate'), 'placement'=>'right', ) ), 'sex', 'email', 'phone', array( 'name'=>'meac_office_id', 'value'=>'!is_null($data->meacOffice)?$data->meacOffice->description:""', 'filter'=>TbHtml::listData(MeacOffice::model()->findAll(),"id","description") ), array( 'name'=>'mda_id', 'value'=>'!is_null($data->mda)?$data->mda->description:""', 'filter'=>TbHtml::listData(Mda::model()->findAll(),"id","description") ), array( 'name'=>'is_mda', 'value'=>'$data->is_mda?"Yes":"No"' ), array( 'class' => 'editable.EditableColumn', 'name' => 'active', 'value'=>'$data->active?"Yes":"No"', 'editable' => array(
<?php echo $form->textFieldControlGroup($model,'last_name',array('span'=>5,'maxlength'=>100)); ?> <?php echo $form->radioButtonListControlGroup($model,'sex',array('M'=>'Male','F'=>'Female')); ?> <?php echo $form->textFieldControlGroup($model,'email',array('span'=>5,'maxlength'=>100)); ?> <?php echo $form->textFieldControlGroup($model,'phone'); ?> <table style="background-color:#F6F6F6;"> <tr> <td> <?php echo $form->checkBoxControlGroup($model, 'is_mda'); ?> <span class="hint"><i>Tick to select an MDA for the user account</i></span> </td> <td id="meac_office_field" style="<?php echo !$model->is_mda ? 'display:block':'display:none'?>"><?php echo $form->dropDownListControlGroup($model, 'meac_office_id', TbHtml::listData(MeacOffice::model()->findAll(),'id','description'),array('prompt'=>'--select--')); ?></td> <td id="mda_field" style="<?php echo $model->is_mda ? 'display:block':'display:none'?>"><?php echo $form->dropDownListControlGroup($model, 'mda_id', TbHtml::listData(Mda::model()->findAll(),'id','description'),array('prompt'=>'--select--')); ?></td> </tr> </table> <?php echo $form->checkBoxControlGroup($model,'active',array('span'=>5)); ?> <div class="form-actions"> <?php echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array( 'color'=>TbHtml::BUTTON_COLOR_PRIMARY, 'size'=>TbHtml::BUTTON_SIZE_DEFAULT, )); ?> </div>