<link href="<?php echo Yii::app()->baseUrl; ?>/css/bootstrap.css" rel="stylesheet">
<div class="main_content">
    <div class="innercontent_outerbox">
        <h1>Earn Points - Certification </h1>
        <h4> <?php echo CHtml::link("Earn Points by Product", Yii::app()->createUrl('site/earnpoints')); ?> </a> | 
            <?php echo CHtml::link("Earn Points by Certification", Yii::app()->createUrl('site/earncertificationpoints')); ?> </h4>
        <div class="row">
            <div class="span8">
                <?php
                $form = $this->beginWidget('CActiveForm', array(
                    'id' => 'reward-form',
                    'enableAjaxValidation' => false,
                    'htmlOptions' => array('enctype' => 'multipart/form-data'),
                ));
                ?>
                <?php //echo $form->errorSummary($model,'Please fill all mandatory fields'); ?>
                <?php
                foreach (Yii::app()->user->getFlashes() as $key => $message) {
                    echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
                }
                ?>
                <table width="100%" border="0" cellspacing="0" cellpadding="10">
                    <tr>
                        <td width="35%">
                            <?php echo $form->dropDownList($model, 'product_id', Certification::getCertifications(), array('prompt' => 'Select certification')); ?>
                            <?php echo $form->error($model, 'product_id'); ?>
                        </td>
                        <td width="34%">
                            <?php echo $form->textField($model, 'serial_number_of_product', array('size' => 20, 'maxlength' => 255, 'placeholder' => 'Register No:')); ?>
                            <?php echo $form->error($model, 'serial_number_of_product'); ?>
                        </td>
                        <td width="31%">&nbsp;</td>
                    </tr>
                    <tr>
                        <td><?php echo $form->labelEx($model, 'end_customer_name'); ?></td>
                        <td><?php echo $form->textField($model, 'end_customer_name', array('size' => 20, 'maxlength' => 255, 'placeholder' => 'Customer name:')); ?>
                            <?php echo $form->error($model, 'end_customer_name'); ?></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><?php echo $form->labelEx($model, 'date_of_purchase', array('label' => 'Date of exam')); ?></td>
                        <td><?php
                            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                                'model' => $model,
                                'attribute' => "date_of_purchase", // the name of the field
                                'options' => array(
                                    'dateFormat' => 'yy-mm-dd',
                                    'showAnim' => 'fold',
                                    'showButtonPanel' => false,
                                    'yearRange' => '1900',
                                    'debug' => true,
                                ),
                                'htmlOptions' => array(
                                    'style' => 'height:20px;'
                                ),
                            ));
                            ?>
                            <?php echo $form->error($model, 'date_of_purchase'); ?></td>
                        <td>&nbsp;</td>
                    </tr>

                    <tr>
                        <td><?php echo $form->labelEx($model, 'invoice', array('label' => 'Documents')); ?></td>
                        <td><?php echo $form->fileField($model, 'invoice'); ?>
                            <?php echo $form->error($model, 'invoice', array('label' => 'Documents')); ?>
                            <span style="color:#999;">Upload documents</span></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td><?php echo $form->checkBox($model, 'agreement', array('value' => null, 'checkValue' => '1')); ?>
                            <?php echo $form->labelEx($model, 'agreement'); ?>
                            <?php echo $form->error($model, 'agreement'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo CHtml::submitButton('Submit'); ?></td>
                    </tr>
                </table>
                <?php $this->endWidget(); ?>
            </div>
        </div>
    </div>