<?php
$responseNumber = isset($_GET['response']) ? $_GET['response'] : false;
if ( !empty($_GET['token'] ) && $responseNumber == 1 ){
		$ElCheck = new \Indeed\Uap\ElCheck();
		$responseNumber = $ElCheck->responseFromGet();
}
if ( $responseNumber !== false ){
		$ElCheck = new \Indeed\Uap\ElCheck();
		$responseMessage = $ElCheck->responseCodeToMessage( $responseNumber, 'uap-danger-box', 'uap-success-box', 'uap' );
}
$license = get_option('uap_license_set');
?>
<div class="uap-wrapper">
<div class="uap-page-title">Afiliados - <span class="second-text"><?php esc_html_e('Help', 'uap');?></span></div>

<div class="uap-stuffbox">
	<h3 class="uap-h3">
		<?php esc_html_e('Afiliados', 'uap');?>
	</h3>

	<form method="post" >
		<div class="inside">
			<?php if ($disabled):?>
				<div class="uap-form-line uap-no-border uap-color-red"><strong><?php esc_html_e("cURL is disabled. You need to enable if for further activation request.", 'uap');?></strong></div>
			<?php endif;?>
			<div class="uap-form-line uap-no-border uap-help-seetings-sectionone">
				<label class="uap-labels"><?php esc_html_e('Codigo:', 'uap');?></label>
			</div>
			<div class="uap-form-line uap-no-border uap-help-seetings-sectiontwo">
				<input name="uap_envato_code" type="password" value="<?php echo $data['uap_envato_code'];?>"/>
			</div>
			<div class="uap-stuffbox-submit-wrap uap-license-button uap-help-seetings-sectionthree">
				<?php if ( $license ):?>
                	<div class="uap-revoke-license uap-js-revoke-license"><?php esc_html_e( 'Revogar', 'uap' );?></div>
                <?php else: ?>
                	<input type="submit" value="<?php esc_html_e('Activate License', 'uap');?>" name="uap_save_licensing_code" <?php echo $disabled;?> class="button button-primary button-large" />
                <?php endif;?>
			</div>

			<div class="uap-clear"></div>
			<div class="uap-license-status">
        	<?php
						if ( $responseNumber !== false ){
								echo $responseMessage;
						} else if ( !empty( $_GET['revoke'] ) ){
								?>
								<div class="uap-success-box"><?php esc_html_e( 'You have just revoke your license for Ultimate Affiliate Pro plugin.', 'uap' );?></div>
								<?php
						} else if ( $license ){ ?>
									<div class="uap-success-box"><?php esc_html_e( 'Tudo OK.', 'uap' );?></div>
          <?php } ?>
      </div>


<div class="uap-js-help-section-nonce" data-value="<?php echo wp_create_nonce('uap_license_nonce');?>"<</div>
<div class="uap-js-help-section-revoke-url" data-value="<?php echo admin_url('admin.php?page=ultimate_affiliates_pro&tab=help&revoke=true');?>"<</div>
