Agan2 dan mastah2 semua…
Saya mau tanya nih.
Kenapa ya jappendo saya yang kedetek cuma 1 row aja dan inputannya jadi luas=1 dan status=1?
please help me…
dah mentok nih.
ini sintag di controller …
if(isset($_POST[‘status’]))
{
session_start();
$model5->status=(int)$_POST['status'];
$model5->luas=(int)$_POST['luas'];
$idp = $_SESSION['id_periode'];
$model5->id_periode = $idp;
if($model5->save()){
echo 'Selamat Anda Berhasil';
}
}
Ini sintag di enumerations…
<table class="appendo-gii" id="<?php echo $id ?>">
<caption>
Status Tanah
</caption>
<thead>
<tr>
<th>Status Tanah</th>
<th>Luas</th>
</tr>
</thead>
<tbody>
<?php if ($model5->id_periode == null): ?>
<tr>
<td>
<?php echo CHtml::dropDownList('status[]',"1",
array(
"1"=>"Tanah Milik Bersertifikat",
"2"=>"Tanah Milik Belum Bersertifikat",
),array('style'=>'width:100px')
);
?>
</td>
<td><?php echo CHtml::textField('luas[]','',array('style'=>'width:310px')); ?></td>
</tr>
<?php else: ?>
<?php for($i = 0; $i < sizeof($model5->id_periode); ++$i): ?>
<tr>
<td>
<?php echo CHtml::dropDownList('status[]',$model5->status[$i],
array(
"1"=>"Tanah Milik Bersertifikat",
"2"=>"Tanah Milik Belum Bersertifikat",
),array('style'=>'width:100px')
);
?>
</td>
<td><?php echo CHtml::textField('luas[]',$model5->luas[$i],array('style'=>'width:310px')); ?></td>
</tr>
<?php endfor; ?>
<tr>
<td>
<?php echo CHtml::dropDownList('status[]',"1",
array(
"1"=>"Tanah Milik Bersertifikat",
"2"=>"Tanah Milik Belum Bersertifikat",
),array('style'=>'width:100px')
);
?>
</td>
<td><?php echo CHtml::textField('luas[]','',array('style'=>'width:310px')); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
ini sintag di form…
<div class="form">
<?php $form=$this->beginWidget(‘CActiveForm’, array(
'id'=>'statustanah-form',
'enableAjaxValidation'=>false,
)); ?>
<br><br>
<h3 align="center"><b>A. Bidang Pemerintahan</b></h3><br>
<h4><b>II. PERTANAHAN</b></h4>
<h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Status Tanah</h5>
<?php echo $form->errorSummary($model5); ?>
<div class="row">
<?php $this->widget('ext.appendo.JAppendo',array(
'id' => 'repeateStatus',
'model' => $model5,
'viewName' => 'enumerations',
'labelDel' => 'Remove Row'
//'cssFile' => 'css/jquery.appendo2.css'
)); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model5->isNewRecord ? 'Create' : 'Save' ); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->