<?php
/* @var $this PersonController */
/* @var $model Person */
/* @var $form CActiveForm */
?>

<div class="col-xs-12">

    <?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'person-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
    'htmlOptions'=>array('enctype' => 'multipart/form-data')
)); ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>

                    <?php echo $form->textFieldControlGroup($model,'name_ar',array('maxlength'=>500)); ?>
        
                    <?php echo $form->textFieldControlGroup($model,'name_en',array('maxlength'=>500)); ?>
        
                    <?php echo $form->textFieldControlGroup($model,'job_title_ar',array('maxlength'=>500)); ?>
        
                    <?php echo $form->textFieldControlGroup($model,'job_title_en',array('maxlength'=>500)); ?>
                    <?php echo $form->textAreaControlGroup($model,'description_ar',array('rows'=>6, 'cols'=>50)); ?>
                    <?php echo $form->textAreaControlGroup($model,'description_en',array('rows'=>6, 'cols'=>50)); ?>
        
                    <?php 
                    echo $form->labelEx($model,'image'); 
                    echo $form->fileField($model,'image');
                     ?>
                     <?php if($rolename=='person') { ?>
                     <?php //echo $form->textFieldControlGroup($model,'type',array('maxlength'=>500)); ?>
                     <?php echo $form->dropDownListControlGroup($model,'type', array(
                                                                                     
                                                                                     "2"=>"اعضاء مجلس الادارة",
                                                                                     "3"=>"اعضاء هيئة الرقابة الشرعية", )
                                                                                    ,array('empty' =>'')); 
                        ?>
                     <?php }elseif($rolename=='hr_person'){
                         echo $form->dropDownListControlGroup($model,'type', array(
                                                                                     "1"=>"أعضاء الادارة التنفيذية",
                                                                                     "0"=>"موظف الشهر",
                                                                                      )
                                                                                    ,array('empty' =>'')); 
                     }else{
                         echo $form->dropDownListControlGroup($model,'type', array(
                                                                                     "1"=>"أعضاء الادارة التنفيذية",
                                                                                     "2"=>"اعضاء مجلس الادارة",
                                                                                     "3"=>"اعضاء هيئة الرقابة الشرعية",
                                                                                     "0"=>"موظف الشهر",
                                                                                      )
                                                                                    ,array('empty' =>'')); 
                     } ?>
    
    <?php
                            echo TbHtml::formActions(array(
                                    TbHtml::submitButton($model->isNewRecord ? Yii::t('admin', 'Create') : Yii::t('admin', 'Save'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY)),
                                    TbHtml::resetButton(Yii::t('admin', 'Reset')),
                                ));
                            ?>    
    <?php $this->endWidget(); ?>

</div>