Update:
it appears that the search is the one causing the problems, particularly date_received(date from and date until fields), author_id(drop down) and contributor(list box).
What am I doing wrong?
The Form
<div class="row">
<?php echo $form->label($model,'date_from'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'date_from',
// additional javascript options for the date picker plugin
'options'=>array(
'showAnim'=>'fold',
'showButtonPanel'=>true,
'autoSize'=>true,
'dateFormat'=>'yy-mm-dd',
),
));; ?>
</div>
<div class="row">
<?php echo $form->label($model,'date_until'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'date_until',
// additional javascript options for the date picker plugin
'options'=>array(
'showAnim'=>'fold',
'showButtonPanel'=>true,
'autoSize'=>true,
'dateFormat'=>'yy-mm-dd',
),
)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'author_id'); ?>
<?php echo $form->dropDownList($model,'author_id',User::getAuthors()); ?>
</div>
<div class="row">
<?php echo $form->label($model,'contributor'); ?>
<?php echo $form->listBox($model,'contributor',Flowbook::getContributors(), array('multiple' => 'multiple')); ?>
</div>
the compare code for model->search()
public function search()
{
$criteria=new CDbCriteria;
$arTitle = explode(' ', $this->title);
$count = count($arTitle);
for ($i=0; $i < $count; $i++)
$criteria->addSearchCondition('title', $arTitle[$i], true, 'OR');
if (isset($this->category))
if ($this->category > 0)
$criteria->compare('category',$this->category);
if (isset($this->date_from))
$criteria->compare('date_received','>=:'.strtotime($this->date_from));
if (isset($this->date_until))
$criteria->compare('date_received','<=:'.strtotime($this->date_until));
$arDescription = explode(' ', $this->description);
$count = count($arDescription);
for ($i=0; $i < $count; $i++)
$criteria->addSearchCondition('description', $arDescription[$i], true, 'OR');
$arKeyword = explode(' ', $this->keyword);
$count = count($arKeyword);
for ($i=0; $i < $count; $i++)
$criteria->addSearchCondition('keyword', $arKeyword[$i], true, 'OR');
if (isset($this->author_id))
if ($this->author_id > 0)
$criteria->compare('author_id',$this->author_id);
$arContributor = $this->contributor;
$criteria->addInCondition('contributor', $arContributor);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}