<?php $this->widget('admin.widgets.TableCover');?>
<h3>原创书籍举报列表</h3>
<?php $this->renderPartial('_search');?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$dataProvider,
    'itemsCssClass' => 'widefat post',
    'id' => 'oreport',
    'summaryText'=>'显示{start}-{end}条 总共{count}条',
    'columns' => array(
            'id',
            'bid',
            'bookname',
            'chaptername',
            'uid',
            'username',
            'createdate',
            'aid',
            'author',
            'type',
            'remark',
            'url',
            array(
                'name' => 'status',
                'value' => '$data->viewStatus($data->status)',
            ),
            array(
                'class'=>'CButtonColumn',
                'header' => '操作',
                'template' => '{cancel} {complete}',
                'buttons' => array(
                    'cancel' => array(
                        'label' => '取消',
                        'url' => 'Yii::app()->createUrl("/admin/oreport/cancel", array("id"=>$data->id))',
                        'visible' => '$data->status == 0',
                        'click' => 'function() {
	if(!confirm("确定要取消?")) return false;
	$.fn.yiiGridView.update("oreport", {
		type:"POST",
		url:$(this).attr("href"),
		success:function() {
			$.fn.yiiGridView.update("oreport");
		}
	});
	return false;
}
'
                    ),
                    'complete' => array(
                        'label' => '处理',
                        'url' => 'Yii::app()->createUrl("/admin/oreport/complete", array("id"=>$data->id))',
                        'visible' => '$data->status == 0',
                        'click' => 'function() {
	if(!confirm("确定要处理?")) return false;
	$.fn.yiiGridView.update("oreport", {
		type:"POST",
		url:$(this).attr("href"),
		success:function() {
			$.fn.yiiGridView.update("oreport");
		}
	});
	return false;
}
'
                    )
                )
            ),
    ),
));