<?php
$this->PageTitle = false;
$this->renderPartial('_menu', array('model' => $model, 'active' => 'situacao', 'resposta' => $resposta));
?>
<h1>Interessados &raquo; Editar &raquo; <?php echo $model->INT_EMPRESA; ?></h1>

<div class="form">
<?php
if ($model->isNewRecord) {
	if (!isset($_POST['Interessados'])) {
		$model->INT_TIPOPESSOA = 'J';
		$model->INT_IDVENDEDOR = User::getId();
	}
}
$TIPOPESSOA = (string) $model->INT_TIPOPESSOA;

Yii::app()->clientScript->registerScript('submit', '
        $(document).ready( function() {
           $("#submit_button").click(function() {
                $(this).attr("disabled",true).parents("form").submit();
            });
        })
    ');

$form = $this->beginWidget('GxActiveForm', array(
		'id'                   => 'interessados-form',
		'enableAjaxValidation' => false,
		'focus'                => array($model, 'INT_IDVENDEDOR'),
	));

$this->widget('application.extensions.EChosen.EChosen', array(
		'target'    => '.echosen',
		'useJQuery' => true, ));
?>
<p class="note">
<?php echo Yii::t('app', 'Campos com');
?> <span class="required">*</span> <?php echo Yii::t('app', 's&atilde;o obrigat&oacute;rios');
?>.
    </p>

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

<?php
if ($model->isNewRecord) {
	echo $form->hiddenField($model, 'INT_IDUSUARIO', array('type' => "hidden", 'value' => User::getId()));
}
?>
<div class="row">
<?php echo $form->labelEx($model, 'INT_TIPO');?>
        <?php echo $form->dropDownList($model, 'INT_TIPO', $model->tipos);?>
        <?php echo $form->error($model, 'INT_TIPO');?>
</div><!-- row -->

    <div class="row">
        <?php echo $form->labelEx($model, 'INT_JUSTIFICATIVA', ['class' => 'required']);?>
        <?php echo $form->textArea($model, 'INT_JUSTIFICATIVA');?>
        <?php echo $form->error($model, 'INT_JUSTIFICATIVA');?>
</div><!-- row -->

<?php
echo FaHtml::saveButton();
$this->endWidget();
?>
</div><!-- form -->
<script type="text/javascript">
    $(document).ready(function(){
        $("label[for=Interessados_INT_JUSTIFICATIVA]").append('<span class="required"> *</span>');
    });
</script>