<?php echo $header; ?>
<div id="content">
<div class="breadcrumb">
  <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
  <?php } ?>
</div>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box">
  <div class="heading">
    <h1><img src="view/template/module/modulo-futura/logo-futura.png" width="20" height="20" style="margin-right:8px;"/><?php echo $heading_title; ?></h1>
   <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
  </div>
  <div class="content">
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="form">

          <tr>
            <td><?php echo $entry_type; ?></td>
            <td><select name="fields_register_brazil_tipo_de_pessoa" id="pessoa">

      				<?php if ($fields_register_brazil_tipo_de_pessoa == 'F') { ?>
                      <option value="F" selected="selected">Fisica</option>
                      <option value="J">Juridica</option>
      				        <option value="A">Fisica e Juridica</option>
      				<?php } ?>
              <?php if ($fields_register_brazil_tipo_de_pessoa == 'J') { ?>
                      <option value="F">Fisica</option>
                      <option value="J" selected="selected">Juridica</option>
      				        <option value="A">Fisica e Juridica</option>
      				<?php } ?>
      				<?php if ($fields_register_brazil_tipo_de_pessoa == 'A'){?>
                      <option value="F">Fisica</option>
                      <option value="J">Juridica</option>
      				        <option value="A" selected="selected">Fisica e Juridica</option>
              <?php } ?>
                    </select></td>
			</tr>
      
      <tr>
        <td><?php echo $entry_enable_endereco_padrao; ?></td>
        <td><select name="fields_register_brazil_enable_endereco_padrao">
            <?php if ($fields_register_brazil_enable_endereco_padrao) { ?>
            <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
            <option value="0"><?php echo $text_disabled; ?></option>
            <?php } else { ?>
            <option value="1"><?php echo $text_enabled; ?></option>
            <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
            <?php } ?>
          </select></td>
      </tr>
      <tr>
        <td><?php echo $entry_enable_endereco_revisao; ?></td>
        <td><select name="fields_register_brazil_enable_endereco_revisao">
            <?php if ($fields_register_brazil_enable_endereco_revisao) { ?>
            <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
            <option value="0"><?php echo $text_disabled; ?></option>
            <?php } else { ?>
            <option value="1"><?php echo $text_enabled; ?></option>
            <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
            <?php } ?>
          </select></td>
      </tr>              

          <tr>
            <td><?php echo $entry_status_cnpjcpf; ?></td>
			      <td><select name="fields_register_brazil_status_cnpgcpf">
                <?php if ($fields_register_brazil_status_cnpgcpf) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>

          <tr>
            <td><?php echo $entry_disable_fax; ?></td>
			      <td><select name="fields_register_brazil_status_fax">
                <?php if ($fields_register_brazil_status_fax) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>

          <tr>
            <td><?php echo $entry_disable_sobrenome; ?></td>
			      <td><select name="fields_register_brazil_status_sobrenome">
                <?php if ($fields_register_brazil_status_sobrenome) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>

          <tr>
            <td><?php echo $entry_disable_data; ?></td>
			      <td><select name="fields_register_brazil_status_data">
                <?php if ($fields_register_brazil_status_data) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>

          <tr>
            <td><?php echo $entry_disable_sexo; ?></td>
			      <td><select name="fields_register_brazil_status_sexo">
                <?php if ($fields_register_brazil_status_sexo) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>

          <tr>
            <td><?php echo $entry_disable_regime; ?></td>
			      <td><select name="fields_register_brazil_status_regime">
                <?php if ($fields_register_brazil_status_regime) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>

          <tr>
            <td><?php echo $entry_disable_interests; ?></td>
			      <td>
              <select class="select-interests-controller" name="fields_register_brazil_status_interests">
                <?php if ($fields_register_brazil_status_interests) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select>
            </td>
          </tr>

          <script>
          $(document).ready(function() {
            $('.select-interests-controller').on('change', function() {
              if ($(this).val() == 1) {
                $('.select-interests-controlled').val('0').closest('tr').css('display', 'table-row');
              } else {
                $('.select-interests-controlled').val('0').closest('tr').css('display', 'none');
              }
            });
          });
          </script>

          <tr <?php echo ($fields_register_brazil_status_interests) ? '' : 'style="display: none"' ?>>
            <td><?php echo $entry_interests_for_old_users; ?></td>
			      <td>
              <select class="select-interests-controlled" name="fields_register_brazil_status_interests_for_old_users">
                <?php if ($fields_register_brazil_status_interests_for_old_users) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select>
            </td>
          </tr>

          <tr <?php echo ($fields_register_brazil_status_interests) ? '' : 'style="display: none"' ?>>
            <td><?php echo $entry_disable_interests_subcategory; ?></td>
			      <td>
              <select  class="select-interests-controlled" name="fields_register_brazil_status_interests_subcategory">
                <?php if ($fields_register_brazil_status_interests_subcategory) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select>
            </td>
          </tr>
	  </table>
    </form>
  </div>
</div>

<?php echo $footer; ?>
