?>
 ) no-repeat"> 
        <br />

    </div>
    -->

    <h2>
    <?php 
_e('Manage Cart Product Feeds', 'cart-product-strings');
$url = site_url() . '/wp-admin/admin.php?page=cart-product-feed-admin';
echo '<input style="margin-top:12px;" type="button" class="add-new-h2" onclick="document.location=\'' . $url . '\';" value="' . __('Generate New Feed', 'cart-product-strings') . '" />';
?>
    </h2>
    <?php 
CPF_print_info();
?>

    <?php 
$message = NULL;
// check for delete ID
if (isset($_GET['action'])) {
    $action = $_GET['action'];
    if ($action == "delete") {
        if (isset($_GET['id'])) {
            $delete_id = $_GET['id'];
            $message = cart_product_feed_delete_feed($delete_id);
        }
    }
}
if ($message) {
/**
 * Create news feed page
 */
function cart_product_feed_admin_page_action()
{
    echo "<div class='wrap'>";
    //echo 	"<div class='cpf-header'>";
    echo '<h2>Create Product Feed';
    $url = site_url() . '/wp-admin/admin.php?page=cart-product-feed-manage-page';
    echo '<input style="margin-top:12px;" type="button" class="add-new-h2" onclick="document.location=\'' . $url . '\';" value="' . __('Manage Feeds', 'cart-product-strings') . '" />
    </h2>';
    //echo    '</div>';
    //prints logo/links header info: also version number/check
    CPF_print_info();
    $action = '';
    $source_feed_id = -1;
    $message2 = NULL;
    $icon_image2 = plugins_url('/', __FILE__) . "/images/BuyLicenseButton.png";
    //check action
    if (isset($_POST['action'])) {
        $action = $_POST['action'];
    }
    if (isset($_GET['action'])) {
        $action = $_GET['action'];
    }
    switch ($action) {
        case 'update_license':
            //I think this is AJAX only now -K
            //No... it is still used (2014/08/25) -K
            if (isset($_POST['license_key'])) {
                $licence_key = $_POST['license_key'];
                if ($licence_key != '') {
                    update_option('cp_licensekey', $licence_key);
                }
            }
            break;
        case 'reset_attributes':
            //I don't think this is used -K
            global $wpdb, $woocommerce;
            $attr_table = $wpdb->prefix . 'woocommerce_attribute_taxonomies';
            $sql = "SELECT attribute_name FROM " . $attr_table . " WHERE 1";
            $attributes = $wpdb->get_results($sql);
            foreach ($attributes as $attr) {
                delete_option($attr->attribute_name);
            }
            break;
        case 'edit':
            $action = '';
            $source_feed_id = $_GET['id'];
            break;
    }
    if (isset($action) && strlen($action) > 0) {
        echo "<script> window.location.assign( '" . admin_url() . "admin.php?page=cart-product-feed-admin' );</script>";
    }
    if (isset($_GET['debug'])) {
        $debug = $_GET['debug'];
        if ($debug == 'phpinfo') {
            phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
            return;
        }
        if ($debug == 'reg') {
            echo "<pre>\r\n";
            new PLicense(true);
            echo "</pre>\r\n";
        }
    }
    # Get Variables from storage ( retrieve from wherever it's stored - DB, file, etc... )
    $reg = new PLicense();
    //Main content
    echo '
	<script type="text/javascript">
	jQuery( document ).ready( function( $ ) {
		ajaxhost = "' . plugins_url('/', __FILE__) . '";
		jQuery( "#selectFeedType" ).val( "&nbsp;" );
		doFetchLocalCategories();
		feed_id = ' . $source_feed_id . ';
	} );
	</script>';
    //WordPress Header ( May contain a message )
    global $message;
    if (strlen($message) > 0 && strlen($reg->error_message) > 0) {
        $message .= '<br>';
    }
    //insert break after local message (if present)
    $message .= $reg->error_message;
    if (strlen($message) > 0) {
        //echo '<div id="setting-error-settings_updated" class="error settings-error">'
        echo '<div id="setting-error-settings_updated" class="updated settings-error">
			  <p>' . $message . '</p>
			  </div>';
    }
    if ($source_feed_id == -1) {
        //Page Header
        echo PFeedPageDialogs::pageHeader();
        //Page Body
        echo PFeedPageDialogs::pageBody();
    } else {
        require_once dirname(__FILE__) . '/core/classes/dialogeditfeed.php';
        echo PEditFeedDialog::pageBody($source_feed_id);
    }
    if (!$reg->valid) {
        //echo PLicenseKeyDialog::large_registration_dialog( '' );
    }
}