hello guys,
im new here. can anyone help me with my problem. i want to use CTabView to put my forms. i have two forms which is ‘_formPersonel’ and ‘_formKelayakan’. the two form exactly in the different model.
in the ‘PersonelController.php’
public function actionCreate()
{
$model=new Personel;
$kelayakan = Kelayakan::model();
if(isset($_POST['Personel']))
{
$model->attributes=$_POST['Personel'];
$model->gambar=CUploadedFile::getInstance($model,'gambar');
if ($model->save()){
$model->gambar->saveAs(Yii::app()->basePath . '/../images/' . $model->gambar);
}
$this->redirect(array('view','id'=>$model->id));
}
in the ‘create.php’
<?php
$this->widget('CTabView',array(
'tabs'=>array(
'tab1'=>array(
'title'=>'Maklumat Peribadi',
'view'=>'_form',
'data'=>array('model'=>$model,
'kelayakan'=>$kelayakan
)
),
'tab2'=>array(
'title'=>'Maklumat Kelayakan',
'view'=>'_formKelayakan',
'data'=>array('model'=>$model,
'kelayakan'=>$kelayakan
)
),)));
?>
in the ‘_formKelayakan.php’
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'kelayakan-form',
'enableAjaxValidation'=>false,
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'personel_id'); ?>
<?php echo $form->textField($model,'personel_id'); ?>
<?php echo $form->error($model,'personel_id'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'nama'); ?>
<?php echo $form->textField($model,'nama'); ?>
<?php echo $form->error($model,'nama'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'institusi'); ?>
<?php echo $form->textField($model,'institusi',array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'institusi'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'subjek'); ?>
<?php echo $form->textField($model,'subjek',array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'subjek'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'tarikh_mula'); ?>
<?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker',array(
'model'=>$model, //Model object
'attribute'=>'tarikh_mula', //attribute name
'mode'=>'date', //use "time","date" or "datetime" (default)
'options'=>array("dateFormat"=>'yy/mm/dd'), // jquery plugin options
'language' => '',
));
?>
<?php echo $form->error($model,'tarikh_mula'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'tarikh_tamat'); ?>
<?php $this->widget('application.extensions.EHtmlDateSelect',
array(
'time'=>$model->tarikh_tamat,
'field_array'=>'ItemsDate',
'prefix'=>'',
'field_order'=>'DMY',
'start_year'=>2010,
'end_year'=>2015,
)
);
?>
<?php echo $form->error($model,'tarikh_tamat'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
i run this program and this is what i got.i really dont know how to fix this.
anyone help me. sory for my language.