<div class="wide form">
    <?php
        $form = $this->beginWidget('GxActiveForm', array(
            'action' => Yii::app()->createUrl('interessados/vincular'),
            'method' => 'get',
        ));

    ?>
        <?php
            $this->widget('application.extensions.EChosen.EChosen', array(
                'target' => '.echosen',
                'useJQuery' => true
            ));

            $tiposPessoa = Util::getTiposPessoaList();
            if ($model->INT_TIPO == "C") {
                $tiposPessoa = array("C");
            }
            $tiposPessoa = CJSON::encode($tiposPessoa);
        ?>

        <div class="row">
            <?php echo $form->label($modelClientes, 'CLI_NOME'); ?>
            <?php
                $this->widget('ext.Utils.widgets.CrmAutoComplete', array(
                    'model' => $modelClientes,
                    'attribute' => 'CLI_NOME',
                    'url' => 'autocomplete/clientes',
                    'params' => array(
                        'field: "CLI_NOME"',
                        'situacao: ["' . implode("\", \"", $situacao) . '"]',
                        'tipo_pessoa: ' . $tiposPessoa
                    ),
                ));
            ?>
        </div>

        <div class="row buttons">
            <input type="hidden" name="busca" value="1" />
            <input type="hidden" name="id" value="<?php echo $model->INT_CODIGO; ?>" />
            <input type="hidden" name="vincular-cliente" value="true" />
            <?php echo FaHtml::searchButton(); ?>
        </div>

    <?php $this->endWidget(); ?>
</div><!-- search-form -->
