<?php
/* @var $this RewardController */
/* @var $model Reward */

$this->breadcrumbs=array(
	'Rewards'=>array('index'),
	'Manage',
);

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

?>
<div id="headlines" style="width: 99%; padding-left:2%;">
<img class="right5" width="12" height="7" src="images/admin/bg.png">
Manage Rewards
</div>
<div id="communicationsbox" style="height:525px; background-color:#f7eee1;">
<div id="form_wrapper">
<div id="row">
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'reward-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'header'=>'Sl.No.',
			'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
			'htmlOptions'=>array('width'=>'5px'),
		),
		'user.fullname',
		'product.product_name',
		'serial_number_of_product',
		'point',
		'date_of_entry',
		/*
		'date_of_purchase',
		'invoice',
		'isActive',
		*/
		array(
            'name'=>'isActive',
            'header'=>'Status',
            'filter'=>array(''=>'All','Y'=>'Active','N'=>'Awaiting Approval'),
            'value'=>'CHtml::link(($data->isActive=="Y")?CHtml::image("images/admin/active.png",""):CHtml::image("images/admin/inactive.png",""),"#",array("class"=>"doChangeStatus","id"=>$data->id,"title"=>"Change status"))',
			'type'=>'raw'
        ),
		array(
			'class'=>'CButtonColumn',
			'header'=>'Actions',
			'template'=>'{delete}'
		),
	),
)); ?>
</div>
</div>
</div>
