<ol class="one-page-checkout" id="checkoutSteps">
    <li id="opc-billing" class="section allow active custom_login_input_box">
        <div class="step-title">
            <?php echo $text_your_details; ?>
        </div>
        <div id="checkout-step-billing" class="step a-item" style="">
                <h2 class="heading-2"><?php echo $text_your_details; ?></h2>
                <span class="required">*</span> <?php echo $entry_firstname; ?><br />
                <input type="text" name="firstname" value="<?php echo $firstname; ?>" class="large-field" />
                <br />
                <br />
                <span class="required">*</span> <?php echo $entry_lastname; ?><br />
                <input type="text" name="lastname" value="<?php echo $lastname; ?>" class="large-field" />
                <br />
                <br />
                <span class="required">*</span> <?php echo $entry_email; ?><br />
                <input type="text" name="email" value="<?php echo $email; ?>" class="large-field" />
                <br />
                <br />
                <span class="required">*</span> <?php echo $entry_telephone; ?><br />

				<input type="text" name="telephone" value="<?php echo $telephone; ?>" class="large-field telephone" /><br /><br><span class="field-info">(apenas números, sem pontos ou traços)</span>

                <br />
                <br />
                <?php echo $entry_fax; ?><br />

				<input type="text" name="fax" value="<?php echo $fax; ?>" class="large-field fax-phone" /><br /><br><span class="field-info">(apenas números, sem pontos ou traços)</span>

                <br />
                <br />

					Sexo:<br />
					<input type="radio" name="sexo" value="m"<?php echo ($sexo == 'm' || $sexo == '') ? ' checked' : ''; ?>>Masculino
					<input type="radio" name="sexo" value="f"<?php echo ($sexo == 'f') ? ' checked' : ''; ?>>Feminino
					<br /><br />Data de Nascimento:<br />
					<input type="text" name="data_nascimento" value="<?php echo $data_nascimento; ?>" class="large-field date" /><br /><br />
					Tipo:<br />
					<input type="radio" name="pessoa" id="fisica" value="F"<?php echo ($pessoa == 'F' || $pessoa == '') ? ' checked' : ''; ?>>
					Pessoa Física
					<input type="radio" id="juridica" name="pessoa" value="J"<?php echo ($pessoa == 'J') ? ' checked' : ''; ?>>
					Pessoa Jurídica
					<div class="pessoa_fisica">
					  <br /><span class="required">*</span> CPF:<br />
					  <input type="text" name="cpf" id="cpf" value="<?php echo $cpf; ?>" class="large-field cpf" /><br /><br><span class="field-info">(apenas números, sem pontos ou traços)</span><br /><br />
					  RG:<br />
					  <input type="text" MaxLength="10" name="rg" id="rg" value="<?php echo $rg; ?>" class="large-field" /><br /><br />
					</div>
					<div class="pessoa_juridica">
					  <br /><span class="required">*</span> CNPJ:<br />
					  <input type="text" name="cnpj" id="cnpj" value="<?php echo $cnpj; ?>" class="large-field cnpj" /><br /><br><span class="field-info">(apenas números, sem pontos ou traços)</span><br /><br />
					  <span class="required">*</span>Razão Social:<br />
					  <input type="text"  name="razao_social" id="razao_social" value="" class="large-field" /><br /><br />
					  Inscrição Estadual:<br />
					  <input type="text" MaxLength="20" name="inscricao_estadual" id="inscricao_estadual" value="<?php echo $inscricao_estadual; ?>" class="large-field alphanumeric" /><br /><br><span class="field-info">(apenas números e letras)</span>
					  <br />
					  <br />
					</div>


                <h2 class="heading-2"><?php echo $text_your_address; ?></h2>


				Local:<br />
				<input type="text" name="apelido" value="<?php echo $apelido; ?>" class="large-field" /><br /><br><span class="field-info">(Ex: Casa, Trabalho, etc)</span>
				<br />
				<br />

                <span class="required">*</span> <?php echo $entry_address_1; ?><br />
                <input type="text" name="address_1" value="<?php echo $address_1; ?>" class="large-field" />
                <br />
                <br />


				<span class="required">*</span> Número:<br />
				<input type="text" name="numero" value="<?php echo $numero; ?>" class="large-field numeric" /><br /><br><span class="field-info">(apenas números, sem pontos ou traços)</span>
				<br />
				<br />


                <?php echo $entry_address_2; ?><br />
                <input type="text" name="address_2" value="<?php echo $address_2; ?>" class="large-field" />
                <br />
                <br />


				Complemento:<br />
				<input type="text" name="complemento" value="<?php echo $complemento; ?>" class="large-field" /><br /><br><span class="field-info">&nbsp;(Ex: Ap. 105)</span>
				<br />
				<br />


                <span class="required">*</span> <?php echo $entry_city; ?><br />
                <input type="text" name="city" value="<?php echo $city; ?>" class="large-field" />
                <br />
                <br />
                <span id="payment-postcode-required" class="required">*</span> <?php echo $entry_postcode; ?><br />

				<input type="text" name="postcode" maxlength="8" value="<?php echo $postcode; ?>" class="large-field numeric" /><br /><br><span class="field-info">(apenas números, sem pontos ou traços)</span>

                <br />
                <br />
                <span class="required">*</span> <?php echo $entry_country; ?><br />
                <select name="country_id" class="large-field">
                    <option value=""><?php echo $text_select; ?></option>
                    <?php foreach ($countries as $country) { ?>
                    <?php if ($country['country_id'] == $country_id) { ?>
                    <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                    <?php } ?>
                    <?php } ?>
                </select>
                <br />
                <br />
                <span class="required">*</span> <?php echo $entry_zone; ?><br />
                <select name="zone_id" class="large-field">
                </select>
                <br />
                <br />
                <br />
            <?php if ($shipping_required) { ?>
            <div style="clear: both; padding-top: 15px; border-top: 1px solid #DDDDDD;">
                <?php if ($shipping_address) { ?>
                <input type="checkbox" name="shipping_address" value="1" id="shipping" checked="checked" />
                <?php } else { ?>
                <input type="checkbox" name="shipping_address" value="1" id="shipping" />
                <?php } ?>
                <label for="shipping"><?php echo $entry_shipping; ?></label>
                <br />
                <br />
                <br />
            </div>
            <?php } ?>
             <div class="buttons">
      <div>
          <button type="button" id="button-guest"  class="btn-default btn-medium btn-continue" >
            <span><?php echo $button_continue; ?></span>
            <i class="fas fa-arrow-right" aria-hidden="true"></i>
          </button>
      </div>
    </div>
        </div>
    </li>

</ol>
<script type="text/javascript">
window.waitEvent('scripts_document', function() {
$('#payment-address select[name=\'country_id\']').bind('change', function() {
if (this.value == '') return;
$.ajax({
url: 'index.php?route=checkout/checkout/country&country_id=' + this.value,
dataType: 'json',
beforeSend: function() {
$('#payment-address select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="assets/img/loading-black.svg" alt="" /></span>');
},
complete: function() {
$('.wait').remove();
},
success: function(json) {
if (json['postcode_required'] == '1') {
$('#payment-postcode-required').show();
} else {
$('#payment-postcode-required').hide();
}

html = '<option value=""><?php echo $text_select; ?></option>';

if (json['zone'] != '') {
for (i = 0; i < json['zone'].length; i++) {
html += '<option value="' + json['zone'][i]['zone_id'] + '"';

if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
html += ' selected="selected"';
}

html += '>' + json['zone'][i]['name'] + '</option>';
}
} else {
html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
}

$('#payment-address select[name=\'zone_id\']').html(html);
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});

$('#payment-address select[name=\'country_id\']').trigger('change');
});
</script>
