<td style="display:table-cell; text-align:justify; width:80px; height: 12px"> <font style="font-family: sans-serif; font-weight: bold" size="11">Age:</font> </td> <td style="display:table-cell; text-align:justify; width:70px; height: 12px"> <font style="font-family: sans-serif; font-weight: normal" size="11"> <?php if (!empty($age)) { echo "{$age} Yrs"; } ?> </font> </td> </tr> <?php $department = empty($person->department) ? null : Departments::model()->findByPk($person->department); ?> <tr> <td style="display:table-cell; text-align:justify; width:100px; height: 12px"> <font style="font-family: sans-serif; font-weight: bold" size="11">Department:</font> </td> <td style="display:table-cell; text-align:justify; width:250px; height: 12px"> <font style="font-family: sans-serif; font-weight: normal" size="11"> <?php if (!empty($department)) { echo $department->department; } ?> </font> </td> <td style="display:table-cell; text-align:justify; width:80px; height: 12px">
public function getDepartments() { $model = Departments::model()->findAll(); $result = CHtml::listData($model, 'id', 'department'); return array_values($result); }
<?php echo CHtml::error($model, 'membershipno'); ?> </div> </div> --> <div class="form-group"> <?php echo CHtml::activeLabelEx($model, 'department', array('class' => $label_class)); ?> <div class="<?php echo $input_class; ?> " style="padding-top: 4px;"> <?php $depts = Departments::model()->findAll(array('order' => 'department ASC')); $depts = CHtml::listData($depts, 'id', 'department'); ?> <?php echo CHtml::activeDropDownList($model, 'department', $depts, array('prompt' => $model->getAttributeLabel('department'), 'class' => 'form-control')); ?> <?php echo CHtml::error($model, 'department'); ?> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($model, 'payrollno', array('class' => $label_class)); ?>