<?php
/* @var $this NewsletterController */
/* @var $model Newsletter */
/* @var $form CActiveForm */
?>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'certification_points-form',
    'enableAjaxValidation' => false,
        ));
?>

<div id="form_wrapper">
    <div id="communicationsbox" style="height:525px; background-color:#f7eee1;">
        <fieldset id="current">
            <legend><strong>Points</strong> <br>
            </legend>
            <?php
            $this->widget('zii.widgets.grid.CGridView', array(
                'id' => 'certification-points-table',
                //'itemsCssClass' => 'rt cf comanies-table',
                //'template' => Yii::app()->request->getIsAjaxRequest() ? '{items}{pager}' : '',
                'template' => '{items}{pager}',
                'dataProvider' => $model->search(),
                //'selectableRows' => 1,
                //'rowHtmlOptionsExpression' => 'array("id"=>$data->id)',
                'pager' => array(
                    'header' => '',
                    'firstPageLabel' => '&lt;&lt;',
                    'prevPageLabel' => 'Prev',
                    'nextPageLabel' => 'Next',
                    'lastPageLabel' => '&gt;&gt;',
                ),
                'columns' => array(
                    array(
                        'header' => 'Certification',
                        'value' => '$data->certification_name',
                        'htmlOptions' => array('style' => 'width: 50%;'),
                    ),
                    array(
                        'header' => 'Points',
                        'value' => '$data->rewardPoints',
                        'htmlOptions' => array('style' => 'width: 50%;'),
                    ),
                ),
            ));
            ?>
            <table width="800" cellspacing="0" cellpadding="4">
                <tbody>
                    <tr>
                        <td width="146"><?php echo $form->labelEx($model, 'certification_name',array('label'=>'Select Certification')); ?></td>
                        <td width="632"><?php echo $form->dropDownList($model, 'certification_name', Certification::getCertifications(),array('prompt'=>'select')); ?> 
                            <?php echo $form->error($model, 'certification_name'); ?></td>
                    </tr>
                    <tr>
                        <td valign="top"><?php echo $form->labelEx($model, 'rewardPoints',array('label'=>'Update reward points')); ?></td>
                        <td><?php echo $form->textField($model, 'rewardPoints'); ?> 
                            <?php echo $form->error($model, 'rewardPoints'); ?></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><?php echo CHtml::submitButton('Update'); ?> </td>
                    </tr>
                </tbody>
            </table>
        </fieldset>
    </div>
</div>
<?php $this->endWidget(); ?>