<?php $render('header', ['loggedUser'=>$loggedUser, 'title'=>$titlePage]); ?>
<?=$render('sidebar', [
  'loggedUser'=>$loggedUser, 
  'pageActive'=>$pageActive,
  'permissions'=>$permissions
]);?>

<!-- Content System -->
<div class="content-wrapper">
  <div class="pages">
    <h3>Iniciar Interação</h3>
    <div class="users">

      <div class="areas">

        <div class="interation-area">

          <div class="form-row">
            <div class="form-group col-md-2">
              <label>
                Cliente
                <input type="radio" name="client_registered" id="client_registered">
              </label style="line-height: 22px;">
            </div>

            <div class="form-group col-md-2">
              <label>
                Prospecção
                <input type="radio" name="client_not_reregistered" id="client_not_reregistered">
              </label>
            </div>
          </div>

          <div class="form-row client_registered">

            <div class="form-group col-md-8">
              <label>Selecionar cliente</label>

              <select class="form-control" name="client">
                <option value="">Selecionar</option>
                <?php foreach ($clients as $client): ?>
                  <option value="<?= $client['id']; ?>"><?= $client['name']; ?></option>
                <?php endforeach; ?>
              </select>
            </div>

            <div class="form-group col-md-4">
              <label>Categoria</label>

              <select class="form-control" name="type_interaction" id="type_interaction">
                <option value="">Selecionar</option>
                <option value="3">Ambos</option>
                <option value="1">Genética</option>
                <option value="2">Insumos</option>
              </select>
            </div>

          </div>

          <div class="form-row client_not_reregistered">

            <div class="form-group col-md-8">
              <label>Selecionar cliente</label>

              <select class="form-control" name="client_prospection" id="client_prospection"></select>
            </div>

            <div class="form-group col-md-4">
              <label>Categoria</label>

              <select class="form-control" name="type_interaction" id="type_interaction">
                <option value="">Selecionar</option>
                <option value="3">Ambos</option>
                <option value="1">Genética</option>
                <option value="2">Insumos</option>
              </select>
            </div>

            <div class="form-group col-md-3">
              <label>Nome do cliente (*)</label>
              <input type="text" name="client_name" class="form-control">
            </div>

            <div class="form-group col-md-3">
              <label>E-mail</label>
              <input type="text" name="client_email" class="form-control">
            </div>

            <div class="form-group col-md-2">
              <label>Telefone</label>
              <input type="text" name="client_phone" class="form-control" id="client_phone" placeholder="(00) 00000-0000">
            </div>

          </div>

          <div class="form-group">
            <textarea class="form-control" name="text_interation" rows="15" placeholder="Digite aqui..."></textarea>
          </div>

          <div class="form-group">
            <input type="submit" value="Salvar" class="btn btn-success">

            <a href="<?= $base; ?>/crm" class="btn btn-info">Voltar</a>
          </div>
        </div>

        <div class="info-area">
          <div class="form-group">
            <label>
              Data
              <input type="text" readonly value="<?= $date; ?>" class="form-control">
            </label>
          </div>

          <div class="form-group">
            <label>
              Data Próxima Interação
              <input type="date" name="date_next" id="date_next" class="form-control">
            </label>
          </div>
        </div>
      </div>


      <!-- Conteudo de ultimas interações -->
      <div class="last-interations">

        <div class="content">
          <h4>Ultimas Interações</h4>

          <ul></ul>
        </div>
        
      </div>
            
    </div>

    <!-- Modal Confirmar salvamento sem data futura -->
    <div class="modal-confirme-cancel">
      <div class="modal-content">
        <h4>Deseja salvar sem a data de nova interação?</h4>
        <hr>
        <hr>
        <div class="modal-button">
          <a href="#" id="confirm_save" class="btn btn-success">Sim</a>
          <a href="#" id="cancel_save" class="btn btn-info">Não</a>
        </div>
      </div>
    </div>

    <!-- Modal salvar sem vincular pedido -->
    <!-- <div class="modal-new-expirate">
      <div class="modal-content">
        <h4>Deseja salvar sem vincular um pedido?</h4>
        <hr>
        <hr>
        <div class="modal-button">
          <a href="#" id="confirm_expirate" class="btn btn-success">Salvar</a>
          <a href="#" id="cancel_expirate" class="btn btn-info">Não</a>
        </div>
      </div>
    </div> -->

    <div class="message-add" id="show-msg-add"></div>
    <script src="<?= $base; ?>/assets/js/crm.js"></script>

  </div>  		
</div>
<!-- /.content-system -->

<?=$render('footer');?>