<?php
$credits = empty($credits) ? array() : unserialize($credits);
$creditset = empty($forum->creditset) ? array() : unserialize($forum->creditset);
?>
<table class="tab">
	<thead>
		<tr>
    		<th>积分代号</th>
    		<th>积分名称</th>
    		<th>发主题(+)</th>
    		<th>删主题(-)</th>
    		<th>回复(+)</th>
    		<th>删回复(-)</th>
    		<th>加精华(+)</th>
    		<th>取消精华(-)</th>
    		<th>上传附件(+)</th>
    		<th>下载附件(-)</th>
		</tr>
	</thead>
	<tbody>
		<?php if (!empty($credits)):?>
    		<?php foreach ($credits as $key => $credit):?>
    		<tr>
    			<td><?php echo $key;?></td>
    			<td><?php echo $credit['title'];?></td>
    			<td><?php echo CHtml::textField('forum[creditset][post]['.$key.']', $creditset['post'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][deletepost]['.$key.']', $creditset['deletepost'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][rp]['.$key.']', $creditset['rp'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][deleterp]['.$key.']', $creditset['deleterp'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][digest]['.$key.']', $creditset['digest'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][undigest]['.$key.']', $creditset['undigest'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][upload]['.$key.']', $creditset['upload'][$key], array('size'=>4));?></td>
    			<td><?php echo CHtml::textField('forum[creditset][download]['.$key.']', $creditset['download'][$key], array('size'=>4));?></td>
    		</tr>
    		<?php endforeach;?>
		<?php endif;?>
	</tbody>
</table>