

<h1><?php echo $model->subject;?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'subject',
		'bookid',
		'uid',
		'username',
        array(
            'name' => 'createdate',
            'value' => date("Y-m-d H:i:s",$model->createdate),
        ),
		array(
            'name' => 'expire',
            'value' => date("Y-m-d H:i:s",$model->expire),
        ),
		array(
            'name' => 'issuper',
            'value' => ApplyBm::$isSuper[$model->issuper],
        ),
		'maxchoices',
		'voterids',
		'award',
		'description',
	),
));
?>

<br/>
以下是选项列表
<?php
$criteria = new CDbCriteria();
$criteria->compare('voteid', $model->id);
$criteria->order = 'id DESC';

$pagination = new CPagination();
$pagination->setPageSize(50);
$dataProvider = new CActiveDataProvider('BookVoteOption');
$dataProvider->setCriteria($criteria);
$dataProvider->setPagination($pagination);

$this->widget('zii.widgets.grid.CGridView', array(
    'itemsCssClass' => 'widefat post',
    'summaryText'=>'显示{start}-{end}条 总共{count}条',
    'dataProvider'=>$dataProvider,
    'columns' => array(
        'option',
        'votes',
        'voterids',
    ),
));
?>
