<?php
defined('ABSPATH') or die('No direct access permitted');

$license = MB()->getClass('license'); 
$license_activated = $license->is_activated();

$admin = MB()->getClass('admin'); 
$page_title = __("License","maxbuttons-pro"); 
 
$admin->get_header(array("title" => $page_title) );
?>
			
			<form id="license_form" class='license_form'>
			
					<div id="activation_progress" style="display: none;">
						<div class='content'>
						<img src="<?php echo MB()->get_plugin_url(true) ?>images/loading.gif" />
						<h4><?php _e('Your license key is being activated, please wait...', 'maxbuttons-pro') ?></h4>
						</div>
					</div>
					
					<div id="activation_success" class="alert alert-success" style="display: none;">
						<h4><?php _e('Your license key has been activated. Enjoy using MaxButtons Pro.', 'maxbuttons-pro') ?></h4>
					</div>
					
					<div id="activation_error" class="alert alert-error" style="display: none;">
						<p><?php printf(__('There was an error activating your license key. Please try again or %scontact us%s so we can investigate the issue.', 'maxbuttons-pro'), '<a href="http://maxbuttons.com/contact/" target="_blank">', '</a>') ?></p>
						<h4>&nbsp;</h4>
					</div>
					
					<div id="activation_need_fields" class="alert alert-error" style="display: none;"> 
						<h4><?php _e("Please fill out all fields","maxbuttons-pro"); ?></h4>
					</div>
					
					<?php if (! $license_activated): ?>
					<h4><?php _e('MaxButtons Pro has not been activated. Activation is required to receive plugin updates and support.', 'maxbuttons-pro') ?></h4>
					<?php endif; ?> 
					
					<?php if($license_activated): ?> 
						<h4><?php _e('Your license is active. Enjoy using MaxButtons Pro.', 'maxbuttons-pro') ?></h4>
					<?php endif; ?>
		 
		 			
					
					<p class='license-field'><span><?php _e("Your License key", "maxbuttons-pro"); ?></span><input type="text" id="license_key" name="license_key" value="<?php echo $license->get_key(); ?>" class="license-key" <?php if ($license_activated) echo "disabled" ?> /></p>
									
 
					<p id='activate_license_field' class='license-field' <?php if ($license_activated) echo "hidden" ?>><span>&nbsp;</span> <input type="button" id="activate_button" name="activate_button" class="button-primary" value="<?php _e("Activate license", "maxbuttons-pro") ?>" /> </p>
 
					<p id='update_license_field' class="license-field" <?php if (! $license_activated) echo "hidden" ?>><span>&nbsp;</span> <input type="button" id="update_license" name="update_button" class="button-primary" value="<?php _e("Update license","maxbuttons-pro"); ?>"> 
					</p>
					
					<p class="license-note"><?php printf(__('Your license key can be found in your %sMaxButtons account%s.', 'maxbuttons-pro'), '<a href="https://www.maxbuttons.com/my-account/" target="_blank">', '</a>') ?></p>

					<?php wp_nonce_field("activate-license","activate-license") ?>
 
			</form>

 

</div> <!-- main --> 
<div class="offers ad-wrap">
	<?php do_action("mb-display-ads"); ?> 
</div>

<?php $admin->get_footer(); ?> 


