I have created 4 radiobuttons in advanced search form using the below code.
<div class="row">
<?php #echo $form->label($model,'ReviewedDate'); ?>
<?php echo $form->radioButtonList($model, 'ReviewedDate',
array('1' => 'Reviewed', '' => 'Not Reviewed')
); ?>
</div>
<div class="row">
<?php echo $form->radioButtonList($model, 'Approved',
array('0' => 'Rejected', '1' => 'Approved')
); ?>
</div>
So now I have created some criteria in model for filtering the gridview to display the rows according to radiobutton value.
if($this->ReviewedDate != '')
{
$criteria->addCondition('ReviewedDate ' . ($this->ReviewedDate=='1' ? 'IS NOT NULL' : 'IS NULL'));
$criteria->addCondition('updateddate > createddate');
$criteria->compare('revieweddate','0000-00-00 00:00:00');
}
else
{
$criteria->addCondition('updateddate = createddate');
$criteria->addCondition('ReviewedDate IS NULL');
}
if (isset($this->Approved) && !empty($this->Approved)) {
$criteria->addCondition("approved='" . $this->Approved . "'");
$criteria->condition = ' (updateddate > createddate) AND (revieweddate IS NOT NULL) and approved = 1 ';
}
else {
$criteria->addCondition("approved='" . $this->Approved . "'");
$criteria->condition = ' (updateddate > createddate) AND (revieweddate IS NOT NULL) and approved = 0 ';
}
The above code works fine and displays the rows accordingly if either revieweddate criteria is commented or the approved criteria is commented. But, both the criteria does not work at the same time.
When I try to use both the criteria at the same time, one of the criteria works.
-
Now, I want to create individual radiobutton for each option (I need 4 radiobuttons approved, rejected, reviewed, not reviewed).
-
I want the radiobutton to work for each criteria without overlapping.
How can I do this