<div class="form">
    <?php
        $form = $this->beginWidget('GxActiveForm', array('id' => 'questionarios-form',
    	                                                 'enableAjaxValidation' => false,
                                                         'focus'=>array($model,'QUF_TITULO')));
    ?>
    <?= FaHtml::getFormInfo($form, $model); ?>
    <div class="frm_col frm_col_1">

        <?php if(!empty($model->QUF_IDQUESTIONARIO)) { ?>
            <input type="hidden" name="QUF_IDQUESTIONARIO" value="<?= $model->QUF_IDQUESTIONARIO; ?>">
        <?php } ?>

        <div class="row">
            <?= $form->labelEx($model,'QUF_TITULO'); ?>
            <?= $form->textField($model, 'QUF_TITULO', array('maxlength' => 255)); ?>
            <?= $form->error($model,'QUF_TITULO'); ?>
        </div>
		<div class="row">
    		<?= $form->labelEx($model,'QUF_REFERENCIA'); ?>
    		<?= $form->textField($model, 'QUF_REFERENCIA', array('maxlength' => 45)); ?>
    		<?= $form->error($model,'QUF_REFERENCIA'); ?>
		</div>
    </div>
    <div class="frm_col frm_col_1">
        <input type="hidden" id="baseUrl" value="<?= Yii::app()->request->baseUrl; ?>">
        <a href="script:void(0);" class="add-etapa">
            <i class="fa fa-user-plus"></i> Adicionar Etapa
        </a>
        <div class="etapas">
            <?php
                if(!empty($model->QuestionariosFluxoEtapas)) {
                    foreach ($model->QuestionariosFluxoEtapas as $key => $related) {
                        $this->renderPartial('_questionario_etapa', array('model' => $related));
                    }
                }
            ?>
        </div>
    </div>
    <div class="clearfix"></div>
    <?php
        echo FaHtml::saveButton();
        $this->endWidget();
    ?>
</div>
<?php Yii::app()->getClientScript()->registerScriptFile(FaHtml::getJsUrl('questionarioFluxo.js')); ?>
<script type="text/javascript">
    $(document).ready(function(){
        new QuestionarioFluxo();
    });
</script>
