function pg_eptxml()
{
    if (isset($_POST['lw_eptxml'])) {
        if (substr($_POST['lw_eptxml'], -1, 1) == ',') {
            $_POST['lw_eptxml'] = str_replace(',', '', $_POST['lw_eptxml']);
        }
        update_option('wccmkelizn32aunique', $_POST['lw_eptxml']);
        echo '<div class="updated"><p><strong>' . __('License Code Saved.') . '</strong></p></div>';
    }
    ?>

<div class="wrap"></div>

<style type="text/css">
#lw_eptxml {
width:55%;
}
.no {
background:red;
padding:25.5%;
color:#fff;
width:55%;
}
.yes{
background:green;
padding:25.9%;
color:#fff;
width:55%;
}
</style>

<h2><?php 
    _e('WooCommerce Checkout Manager Pro License', 'woocommerce-checkout-manager-pro');
    ?>
</h2> 

<span style="color:#7ad03a">
<?php 
    if (!function_exists('curl_version')) {
        echo __('Please contact your hosting company to enable cURL.', 'woocommerce-checkout-manager-pro');
    }
    ?>
</span>


<form action="admin.php?page=License_check_slug" method="post">
<table style="margin-top:40px;" class="wp-list-table widefat tags ui-sortable">
<thead>
	<tr>
		<th><?php 
    _e('Licensing Validator', 'woocommerce-checkout-manager-pro');
    ?>
</th>
	    <th>
        <span style="font-size: 11px;color:red;">
        <?php 
    if (!woocmmatl() && get_option('errfafvetcgrt6434cwooccminfo15907833') == 'connection_error') {
        _e('Unable to connect! Please contact your hosting company to add trottyzone.com to the whitelist.', 'woocommerce-checkout-manager-pro');
    } elseif (woocmmatl() && get_option('errfafvetcgrt6434cwooccminfo15907833') == 'clear') {
    } elseif (!woocmmatl() && get_option('errfafvetcgrt6434cwooccminfo15907833') == 'change_site') {
        _e('Current site running the plguin is not registered. Click Change Site button to register this site.', 'woocommerce-checkout-manager-pro');
    } elseif (!woocmmatl() && get_option('errfafvetcgrt6434cwooccminfo15907833') == 'not_exsit') {
        _e('License Code does not exist! Please check the code.', 'woocommerce-checkout-manager-pro');
    }
    ?>
        </span>
        </th>
	</tr>
</thead>

<tbody>
	<tr>
		<td><?php 
    _e('Status', 'woocommerce-checkout-manager-pro');
    ?>
</td>
		<td>

<?php 
    if (woocmmatl()) {
        ?>
<span class="yes"><?php 
        _e('Valid', 'woocommerce-checkout-manager-pro');
        ?>
</span>
<?php 
    }
    ?>

<?php 
    if (!woocmmatl()) {
        ?>
<span class="no"><?php 
        _e('Invalid', 'woocommerce-checkout-manager-pro');
        ?>
</span>
<?php 
    }
    ?>

		</td>
	</tr>
</tbody>


<tbody>
	<tr>
		<td><?php 
    _e('License Code', 'woocommerce-checkout-manager-pro');
    ?>
</td>
		<td><input id="lw_eptxml" name="lw_eptxml" size="70" type="text" value="<?php 
    echo get_option('wccmkelizn32aunique');
    ?>
" /></td>
	</tr>

	<tr>
		<td><a href="http://www.trottyzone.com/edit-account/"><input type="button" class="button-secondary" value="<?php 
    _e('Change Site ?', 'woocommerce-checkout-manager-pro');
    ?>
" /></a></td>
		<td><input type="submit" class="button-primary" value="<?php 
    _e('Validate', 'woocommerce-checkout-manager-pro');
    ?>
" /></td>
</tr>
</tbody>

</table>
</form>
<?php 
}
{
    wp_enqueue_style('wooccm-admin-icon', plugins_url('woocommerce-checkout-manager-pro/add-on/css/admin_icon.css'));
}
function wccs_admin_menu()
{
    add_menu_page(__('WooCCM', 'woocommerce-checkout-manager-pro'), __('WooCCM', 'woocommerce-checkout-manager-pro'), 'manage_options', __FILE__, 'wccs__options_page', '', 58);
}
function wccm_admin_menu()
{
    add_submenu_page(__FILE__, 'License', 'License', 'manage_options', 'License_check_slug', 'pg_eptxml');
}
function wccs_register_setting()
{
    register_setting('wccs_options', 'wccs_settings', 'wccs_options_validate');
}
if (woocmmatl()) {
    function wccs__options_page()
    {
        if (!current_user_can('manage_options')) {
            wp_die(__('You do not have sufficient permissions to access this page.', 'woocommerce-checkout-manager-pro'));
        }
        $upload_dir = wp_upload_dir();
        $hidden_field_name = 'mccs_submit_hidden';
        $hidden_wccs_reset = "my_new_field_reset";
        $options = get_option('wccs_settings');
        if (isset($_POST[$hidden_wccs_reset]) && $_POST[$hidden_wccs_reset] == 'Y') {
            delete_option('wccs_settings');
            $defaults = array('buttons' => array(array('label' => 'My New Label', 'cow' => 'myfield1')), 'check' => array('rq_company1' => true), 'checkness' => array('position2' => true, 'wooccm_notification_email' => '' . get_option('admin_email') . '', 'wccs_rqo_12' => true, 'payment_method_t' => true, 'shipping_method_t' => true, 'payment_method_d' => __('Payment Method', 'woocommerce-checkout-manager-pro'), 'shipping_method_d' => __('Shipping Method', 'woocommerce-checkout-manager-pro'), 'time_stamp_title' => __('Order Time', 'woocommerce-checkout-manager-pro'), 'rq_company' => true));
            add_option('wccs_settings', $defaults);
            echo '<script type="text/javascript">window.location.href="' . $_SERVER['PHP_SELF'] . '?page=' . plugin_basename(__FILE__) . '";</script><noscript><meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?page=' . plugin_basename(__FILE__) . '" /></noscript>';
            exit;