hi all,
i got trouble for insert the selected start date and end date into database by using this method that i found.
this is the start date:
<div class="row">
<?php echo $form->labelEx($modelBooking,'StartDate'); ?>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $modelBooking,
'attribute' => 'StartDate',
'htmlOptions' => array(
'size' => '10', // textField size
'maxlength' => '10', // textField maxlength
),
));
?>
</div>
this is the end date:
<div class="row">
<?php echo $form->labelEx($modelBooking,'EndDate'); ?>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $modelBooking,
'attribute' => 'EndDate',
'htmlOptions' => array(
'size' => '10', // textField size
'maxlength' => '10', // textField maxlength
),
));
?>
</div>
in my controller:
public function actionProcessBooking() {
$modelBooking = new Bookingdetail();
$this->performAjaxValidation($modelBooking);
$command = Yii::app()->db->createCommand();
$command->insert('bookingdetail', array(
'StartDate' => $_POST['BookingDetai']['StartDate'],
'EndDate' => $_POST['Bookingdetail']['EndDate']
));
Hope anyone can help.I appreciate with anyone help.Thank and sorry for i just newly to yii.