<form class="form-edit-proposta">
<div class="container">
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">UUID Proposta</label>
      <input type="text" class="form-control" id="exampleFormControlInput1" value="<?php e($proposta->uuid_proposta) ?>" name="uuid_proposta" readonly>
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Versão Proposta</label>
      <input type="text" class="form-control" id="exampleFormControlInput1" value="<?php e(str_pad($versao, 3, "0", STR_PAD_LEFT)) ?>" name="versao_proposta" readonly>
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Incorporadora</label>
      <input type="text" class="form-control" id="exampleFormControlInput1" value="<?php e($incorporadora->incorporadora) ?>" name="incorporadora" readonly>
      <input type="hidden" class="form-control" value="<?php e($incorporadora->id_incorporadora) ?>">
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Plano</label>
      <input type="text" class="form-control" id="exampleFormControlInput1" value="<?php e($plano->plano) ?>" name="plano">
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Meses</label>
      <input type="text" class="form-control" id="exampleFormControlInput1" value="<?php e($plano->meses) ?>" name="validade_proposta">
    </div>    
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Tipo Comissão</label>
      <select class="form-control" name="tipo_comissao">
            <option value="1" <?php $plano->tipo_comissao == '1' ? 'selected' : '' ?>>Merito</option>
            <option value="2" <?php $plano->tipo_comissao == '2' ? 'selected' : '' ?>>Venda</option>
      </select>
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Comissão</label>
      <input type="text" class="form-control" id="exampleFormControlInput1" value="<?php e($plano->comissao) ?>" name="comissao">
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Condições</label>
        <!-- Select2 bugou -->
        <select class="form-control js-example-basic-multiple" name="condicoes[]" multiple="multiple">
            <?php foreach($select_condicoes as $key => $sel){ ?>
            <optgroup label="<?php e($key); ?>">
                <?php foreach($sel as $chave => $opt){ ?>
                    <option value="<?php e($chave); ?>" <?php foreach($cond_serv->condicoes as $cond){ e($chave == $cond ? 'selected' : ''); }?>><?php e($opt); ?></option>
                <?php } ?>
            </optgroup>
            <?php } ?>
        </select>
    </div>
    <div class="mb-3">
      <label for="exampleFormControlInput1" class="form-label">Serviços</label>
        <!-- Select2 bugou -->
        <select class="form-control js-example-basic-multiple" name="servicos[]" multiple="multiple">
            <?php foreach($select_servico as $key => $sel){ ?>
            <optgroup label="<?php e($key); ?>">
                <?php foreach($sel as $chave => $opt){ ?>
                    <option value="<?php e($chave); ?>" <?php foreach($cond_serv->servicos as $serv){ e($chave == $serv ? 'selected' : ''); }?>><?php e($opt); ?></option>
                <?php } ?>
            </optgroup>
            <?php } ?>
        </select>
    </div>
    <div class="mb-3">
        <button class="btn btn-success" type="submit">Salvar</button>
        <a class="btn btn-secondary">Cancelar</a>
    </div>
</div>
</form>