<?php
/* @var $this ScoreController */
/* @var $model Score */

$this->breadcrumbs=array(
	//'风云榜'=>array('index'),
	'风云榜',
);

$this->menu=array(
	array('label'=>'List Score', 'url'=>array('index')),
	array('label'=>'Create Score', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('score-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>风云榜</h1>

<p>
可以使用一些操作符(<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>)去搜索相关数据.
</p>
<?php echo CHtml::link('高级搜索','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,'exammanage'=>$exammanage,'grade'=>$grade,'classroom'=>$classroom,
)); ?>
</div><!-- search-form -->

<?php 
	$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'score-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
	//'student_fullname.fullname','classroom_title.title',
		/**/
		array(   
                'name'=>'id',   //$this->grid->dataProvider->getTotalItemCount() 总条数   
                'value'=>'$this->grid->dataProvider->getPagination()->getOffset()+($row+1)',//CDataColumn $this->grid
                'header'=>'排名',
                'htmlOptions'=>array(   
                        'width'=>'50px',   
                ),   
            ),
		array(
            'name' => 'classroom_title.title',
            'htmlOptions'=>array(
                'width'=>'60px',
                'style'=>'text-align:center',
             )),
		array(
            'name' => 'student_fullname.fullname',//'header'=>'模型',
			//'value' => '$data->student_fullname->fullname',
			//'filter'=>array('1'=>'可用','0'=>'禁用'),
            'htmlOptions'=>array(
                'width'=>'60px',
                'style'=>'text-align:center',
             )), 
		
		//'grade_id',
		//'exam_id',
		array(
            'name' => 'singlechoiceScore',
            'htmlOptions'=>array(
                'style'=>'text-align:center',
             )),
		array(
            'name' => 'multichoiceScore',
            'htmlOptions'=>array(
                'style'=>'text-align:center',
             )),			 
		array(
            'name' => 'judgeScore',
            'htmlOptions'=>array(
                'style'=>'text-align:center',
             )),

		//'fillinScore',
		//'faqScore',
		array(
            'name' => 'operateScore',
            'htmlOptions'=>array(
                'style'=>'text-align:center',
             )),
		array(
            'name' => 'totalScore',
            'htmlOptions'=>array(
                'style'=>'text-align:center',
             )),			 

		//'singlechoiceError',
		//'multichoiceError',
		//'judgeError',
		//'fillinAnswer',
		//'faqAnswer',
		//'operateAnswer',
		//'reexam'
		
		array(
            'name' => 'reexam',
			'value' => '$data->reexam?"重考":"正常"',
            'filter' => array('0'=>'正常','1'=>'重考'),
            'htmlOptions'=>array(
                'width'=>'60',
                'style'=>'text-align:center',
             )),
		/*隐藏操作列
		array(
			'class'=>'CButtonColumn',
		),
		*/
	),
)); ?>
