public function loadCT($id) { $model=CashboxType::model()->findByPk($id); if($model===null) throw new CHttpException(404,'The requested page does not exist.'); return $model; }
<p class="note">Felder mit einem <span class="required">*</span> müssen ausgefüllt werden.</p> <p class="note">positiver Betrag erhöht den Kassenbestand vom Guide</p> <?php if($model->hasErrors()) { echo '<div class="callout callout-danger">'.$form->errorSummary($model).'</div>'; } ?> <div class="row"> <div class="col-md-3"> <?php echo $form->labelEx($model,'id_type'); ?> <?php echo $form->dropDownList($model,'id_type', CHtml::listData(CashboxType::model()->findAll("id in (3,4)"),'id', 'name'),array('id'=>'cashtype','onChange'=>'clickType(this.value)','class'=>'form-control')); ?> <?php echo $form->error($model,'id_type'); ?> </div> <div class="col-md-4" id="guide_div"> <?php echo $form->labelEx($model,'sched_user_id'); ?> <?php echo $form->dropDownList($model,'sched_user_id', $model->getUserOptions(),array('id'=>'guide','empty'=>'--','class'=>'form-control')); ?> <?php echo $form->error($model,'sched_user_id'); ?> </div> <div class="col-md-5"> </div> </div> <div class="row"> <div class="col-md-8"> <?php echo $form->labelEx($model,'delta_cash'); ?> <?php echo $form->textField($model,'delta_cash',array('empty'=>'--','class'=>'form-control')); ?>