예제 #1
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 $id the ID of the model to be loaded
  * @return PayrollAllowanceGroups the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = PayrollAllowanceGroups::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
예제 #2
0
?>
<div class="row">
    <div class="col-md-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<p class="note">Fields with <span class="required">*</span> are required.</p>
			</div>

			<div class="panel-body">
				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'group_id', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">                                                                                                                                           
						<?php 
echo CHtml::activeDropDownList($model, 'group_id', CHtml::listData(PayrollAllowanceGroups::model()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'class' => 'validate[required] form-control select'));
?>
						<?php 
echo CHtml::error($model, 'group_id');
?>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'name', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">                                                                                                                                           
						<?php 
echo CHtml::activeTextField($model, 'name', array('class' => 'validate[required] form-control'));
?>