<?php echo $header; ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <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>
  <h1><?php echo $heading_title; ?></h1>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <h2><?php echo $text_your_details; ?></h2>
    <div class="content">
      <table class="form">
        <tr>
          <td><span class="required">*</span> <?php echo $entry_firstname; ?></td>
          <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
            <?php if ($error_firstname) { ?>
            <span class="error"><?php echo $error_firstname; ?></span>
            <?php } ?></td>
        </tr>

        <?php if ($this->config->get('fields_register_brazil_status_sobrenome')){ ?>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
            <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />
              <?php if ($error_lastname) { ?>
              <span class="error"><?php echo $error_lastname; ?></span>
              <?php } ?></td>
          </tr>
        <?php } ?>

        <tr>
          <td><span class="required">*</span> <?php echo $entry_email; ?></td>
          <td><input type="text" name="email" value="<?php echo $email; ?>" />
            <?php if ($error_email) { ?>
            <span class="error"><?php echo $error_email; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
          <td>
				<input type="text" name="telephone" value="<?php echo $telephone; ?>" class="phone" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span>

            <?php if ($error_telephone) { ?>
            <span class="error"><?php echo $error_telephone; ?></span>
            <?php } ?></td>
        </tr>

        <?php if ($this->config->get('fields_register_brazil_status_fax')){ ?>
          <tr>
            <td><?php echo $entry_fax; ?></td>
            <td><input type="text" name="fax" value="<?php echo $fax; ?>" class="phone" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span></td>
          </tr>
        <?php } ?>

				<?php if ($this->config->get('fields_register_brazil_status')){ ?>
				<tr>
				  <td>Celular:</td>
				  <td><input type="text" name="celular" id="celular" value="<?php echo $celular ?>" /> <span class="field-info"><br>(apenas números, sem pontos ou traços)</span>	 </td>
				</tr>

        <?php if ($this->config->get('fields_register_brazil_status_sexo')){ ?>
  				<tr>
  				  <td>Sexo:</td>
  				  <td>
  				    <?php if ($sexo == 'm'){ ?>
  					<input type="radio" name="sexo" checked value="m">Masculino
  					<input type="radio" name="sexo" value="f">Feminino
  					<?php }else if($sexo == 'f'){ ?>
  					<input type="radio" name="sexo" value="m">Masculino
  					<input type="radio" name="sexo" checked value="f">Feminino
  					<?php }else{ ?>
  					<input type="radio" name="sexo" checked value="m">Masculino
  					<input type="radio" name="sexo" value="f">Feminino
  					<?php } ?>
  				  </td>
  				</tr>
        <?php } ?>

        <?php if ($this->config->get('fields_register_brazil_status_data')){ ?>
				<tr>
				  <td>Data de Nascimento:</td>
				  <?php
				  $dataparts = explode("-",$data_nascimento);
				  if (sizeof($dataparts) != '3'){
					  $data = $data_nascimento;
				  }else{
					  $data = $dataparts[2]."/".$dataparts[1]."/".$dataparts[0];
				  }
				  $data = ($data != '00/00/0000') ? $data : '';
				  ?>
				  <td><input type="text" name="data_nascimento" value="<?php echo $data; ?>" class="date" />
				  <?php if ($error_data_nascimento) { ?>
				  <span class="error"><?php echo $error_data_nascimento; ?></span>
				  <?php } ?>
				  </td>
				</tr>
        <?php } ?>

				<!-- Lista o tipo de pessoas referente ao modulo - por Henrique R. Pohl-->
				<?php if ($fields_register_brazil_tipo_de_pessoa == 'F') { ?>
					<tr class="pessoa_fisica">
				  <td><span class="required">*</span> CPF:</td>
				  <td>
				    <input type="hidden" name="pessoa" id="fisica" checked value="fisica">
				    <input type="text" name="cpf" id="cpf" value="<?php echo $cpf; ?>" class="cpf" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span>
					<?php if ($error_cpf) { ?>
					<span class="error"><?php echo $error_cpf; ?></span>
					<?php } ?>
				  </td>
				</tr>
				<tr class="pessoa_fisica">
				  <td>RG:</td>
				  <td><input type="text" name="rg" id="rg" value="<?php echo $rg; ?>" class="numeric" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span></td>
				</tr>
				<?php } ?>

				<?php if ($fields_register_brazil_tipo_de_pessoa == 'J') { ?>
				<input type="hidden" id="juridica" name="pessoa" value="juridica">
				<tr class="pessoa_juridica">
				  <td><span class="required">*</span> CNPJ:</td>
				  <td>
				    <input type="text" name="cnpj" id="cnpj" value="<?php echo $cnpj; ?>" class="cnpj" readonly="true" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span>
					<?php if($error_cnpj){ ?>
					<span class="error"><?php echo $error_cnpj; ?></span>
					<?php } ?>
				  </td>
          <?php if ($this->config->get('fields_register_brazil_status_regime')) { ?>
  				  <tr class="pessoa_juridica">
    				  <td>Perfil:</td>
    				  <td>
    				    <?php if($perfil == '0'){ ?>
    					<input type="radio" name="perfil" id="nenhum" checked value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA" value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal" value="3">Lucro Real
    					<?php }else if($perfil == '1'){ ?>
    					<input type="radio" name="perfil" id="nenhum"  value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA" checked value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal" value="3">Lucro Real
    					<?php }else if($perfil == '2'){ ?>
    					<input type="radio" name="perfil" id="nenhum"  value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA"  value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" checked value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal"  value="3">Lucro Real
    					<?php }else if($perfil == '3'){ ?>
    					<input type="radio" name="perfil" id="nenhum"  value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA"  value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional"  value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal" checked value="3">Lucro Real
    					<?php }else{ ?>
    					<input type="radio" name="perfil" id="nenhum" checked value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA" value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal"  value="3">Lucro Real
    					<?php } ?>
    				  </td>
  				  </tr>
            <?php }else{ ?>
              <tr class="pessoa_juridica" >
                <td style="display: none;"><input type="radio" name="perfil" id="simplesnacional" checked value="2" >Simples Nacional</td>
              </tr>
            <?php } ?>
				</tr>
				<tr class="pessoa_juridica">
				  <td><span class="required">*</span>Razão Social:</td>
				  <td><input type="text" name="razao_social" id="razao_social" value="<?php echo $razao_social; ?>" readonly="true">
					<?php if ($error_razao_social) { ?>
					<span class="error"><?php echo $error_razao_social; ?></span>
					<?php } ?>
				  </td>
				</tr>
				<tr class="pessoa_juridica">
				  <td>Inscrição Estadual:</td>
				  <td><input type="text" name="inscricao_estadual" MaxLength="20" readonly="true" id="inscricao_estadual" value="<?php echo $inscricao_estadual; ?>" class="alphanumeric"  maxlength="20"/><span class="field-info"><br>(apenas números e letras)</span></td>
				</tr>
				<?php } ?>
				<?php if ($fields_register_brazil_tipo_de_pessoa == 'A') { ?>
				<tr>
				  <td>Tipo:</td>
				  <td>
			    <?php if($pessoa == 'juridica'){ ?>
					<input type="radio" id="juridica" name="pessoa" checked value="juridica">Pessoa Jurídica
					<?php }else{ ?>
					<input type="radio" name="pessoa" id="fisica" checked value="fisica">Pessoa Física
					<?php }?>
				  </td>
				</tr>
				<tr class="pessoa_fisica">
				  <td><span class="required">*</span> CPF:</td>
				  <td>
				    <input type="text" name="cpf" id="cpf" value="<?php echo $cpf; ?>" class="cpf" readonly="true" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span>
					<?php if ($error_cpf) { ?>
					<span class="error"><?php echo $error_cpf; ?></span>
					<?php } ?>
				  </td>
				</tr>
				<tr class="pessoa_fisica">
				  <td>RG:</td>
				  <td><input type="text" name="rg" id="rg" value="<?php echo $rg; ?>" class="numeric" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span></td>
				</tr>
				<tr class="pessoa_juridica">
				  <td><span class="required">*</span> CNPJ:</td>
				  <td>
				    <input type="text" name="cnpj" id="cnpj" value="<?php echo $cnpj; ?>" class="cnpj" readonly="true" /><span class="field-info"><br>(apenas números, sem pontos ou traços)</span>
					<?php if($error_cnpj){ ?>
					<span class="error"><?php echo $error_cnpj; ?></span>
					<?php } ?>
				  </td>
          <?php if ($this->config->get('fields_register_brazil_status_regime')) { ?>
  				  <tr class="pessoa_juridica">
    				  <td>Perfil:</td>
    				  <td>
    				    <?php if($perfil == '0'){ ?>
    					<input type="radio" name="perfil" id="nenhum" checked value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA" value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal" value="3">Lucro Real
    					<?php }else if($perfil == '1'){ ?>
    					<input type="radio" name="perfil" id="nenhum"  value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA" checked value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal" value="3">Lucro Real
    					<?php }else if($perfil == '2'){ ?>
    					<input type="radio" name="perfil" id="nenhum"  value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA"  value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" checked value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal"  value="3">Lucro Real
    					<?php }else if($perfil == '3'){ ?>
    					<input type="radio" name="perfil" id="nenhum"  value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA"  value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional"  value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal" checked value="3">Lucro Real
    					<?php }else{ ?>
    					<input type="radio" name="perfil" id="nenhum" checked value="0">Nenhum
    					<input type="radio" name="perfil" id="lucropresumidoRPA" value="1">Lucro Presumido/RPA
    					<input type="radio" name="perfil" id="simplesnacional" value="2">Simples Nacional
    					<input type="radio" name="perfil" id="lucroreal"  value="3">Lucro Real
    					<?php } ?>
    				  </td>
  				  </tr>
            <?php }else{ ?>
              <tr class="pessoa_juridica">
                <td style="display: none;"><input type="radio" name="perfil" id="simplesnacional" checked value="2" >Simples Nacional</td>
              </tr>
            <?php } ?>
				</tr>
				<tr class="pessoa_juridica">
				  <td><span class="required">*</span>Razão Social:</td>
				  <td><input type="text" name="razao_social" id="razao_social" value="<?php echo $razao_social; ?>" readonly="true">
				  <?php if ($error_razao_social) { ?>
				  <span class="error"><?php echo $error_razao_social; ?></span>
				  <?php } ?>
				  </td>
				</tr>
				<tr class="pessoa_juridica">
				  <td>Inscrição Estadual:</td>
				  <td><input type="text" name="inscricao_estadual" MaxLength="20" readonly="true" id="inscricao_estadual" value="<?php echo $inscricao_estadual; ?>" class="alphanumeric"  maxlength="20"/><span class="field-info"><br>(apenas números e letras)</span></td>
				</tr>
				<?php } ?>
				<?php } ?>

      </table>
    </div>
    <div class="buttons">
      <div class="left"><a href="<?php echo $back; ?>" class="button"><?php echo $button_back; ?></a></div>
      <div class="right">
        <input type="submit" value="<?php echo $button_continue; ?>" class="button" />
      </div>
    </div>
  </form>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?>
