My other code is -
View -
<?php
/* @var $this AuctionsController */
/* @var $model Auctions */
?>
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id' => 'auctions-form',
'enableAjaxValidation' => false,
'htmlOptions' => array(
'class' => 'form-horizontal',
),
));
?>
<?php $this->renderPartial('//auctions/buttons/update_buttons', array('model' => $model)); ?>
<?php $this->setPageTitle('Auction - ' . $model->au_name); ?>
<div class="alpha span5">
<div class="control-group">
<?php echo $form->labelEx($model, 'au_name', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->textField($model, 'au_name'); ?>
<?php echo $form->error($model, 'au_name'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_venue', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->dropDownList($model, 'au_venue', GxHtml::listDataEx(Venues::model()->findAll(), 'v_id', 'v_name')); ?>
<?php echo $form->error($model, 'au_venue'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_date_auction', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->datepickerRow($model, 'au_date_auction', array('prepend' => '<i class="icon-calendar"></i>', 'labelOptions' => array('label' => false)));
?>
<?php echo $form->error($model, 'au_date_auction'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_date_close', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->datepickerRow($model, 'au_date_close', array('prepend' => '<i class="icon-calendar"></i>', 'labelOptions' => array('label' => false)));
?>
<?php echo $form->error($model, 'au_date_close'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_opening_times', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->textField($model, 'au_opening_times'); ?>
<?php echo $form->error($model, 'au_opening_times'); ?>
</div>
</div>
</div>
<div class="alpha span5">
<div class="control-group">
<?php echo $form->labelEx($model, 'au_information', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->textField($model, 'au_information'); ?>
<?php echo $form->error($model, 'au_information'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_status', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->toggleButtonRow($model, 'au_status', array('labelOptions' => array('label' => false))); ?>
<?php echo $form->error($model, 'au_status'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_website', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->toggleButtonRow($model, 'au_website', array('labelOptions' => array('label' => false))); ?>
<?php echo $form->error($model, 'au_website'); ?>
</div>
</div>
<div class="control-group">
<?php echo $form->labelEx($model, 'au_pdf_download_url', array('class' => 'control-label')); ?>
<div class="controls">
<?php echo $form->textField($model, 'au_pdf_download_url'); ?>
<?php echo $form->error($model, 'au_pdf_download_url'); ?>
</div>
</div>
<?php $this->endWidget(); ?>
</div>
<div class="alpha span12">
<?php $this->renderPartial('application.views.properties.showPropertiesInAuction', array('dataProvider' => $dataProvider)); ?>
</div>
and controller is -
public function actionUpdate($id) {
$model = $this->loadModel($id, 'Auctions');
if (isset($_POST['Auctions'])) {
$model->setAttributes($_POST['Auctions']);
if ($model->save()) {
}
if (isset($_POST['save'])) {
$this->redirect(array('update', 'id' => $model->au_id));
}
if (isset($_POST['saveclose'])) {
$this->redirect(array('index'));
}
}
$this->render('update', array(
'model' => $model,
));
}