function olc_redirect($url, $force_location_redirect = false)
{
    //if (USE_AJAX && $is_ajax_link)
    if (USE_AJAX && !$force_location_redirect) {
        global $box_assignments, $box_relations, $box_constants, $currencies, $lng;
        global $seo_categories, $seo_search, $seo_replace, $smarty, $breadcrumb;
        /*
        if (IS_ADMIN_FUNCTION)
        {
        $url = str_replace('admin/',EMPTY_STRING,$url);
        }
        */
        $is_ajax_link = strpos($url, AJAX_REQUEST_FUNC_START) !== false;
        if (ENABLE_SSL && getenv("HTTPS") != NULL) {
            // We are loading an SSL page
            $server = HTTPS_SERVER;
            $l = strlen(HTTP_SERVER);
            if (substr($url, 0, $l) == HTTP_SERVER) {
                // NONSSL url
                $url = HTTPS_SERVER . substr($url, $l);
                // Change it to SSL
            }
        } else {
            $server = HTTP_SERVER;
        }
        //Destroy old GET- and POST-parameters
        while (list($key, $val) = each($_GET)) {
            unset($_GET[$key]);
        }
        while (list($key, $val) = each($_POST)) {
            unset($_POST[$key]);
        }
        //Remove AJAX link-Javascript-code
        //$url = str_replace(AJAX_REQUEST_FUNC_START, EMPTY_STRING, $url);
        //$url = str_replace(AJAX_REQUEST_FUNC_END, EMPTY_STRING, $url);
        $url = str_replace($server, EMPTY_STRING, $url);
        $url = str_replace(DIR_WS_CATALOG, EMPTY_STRING, $url);
        if (USE_SEO && (!DO_SEO_EXTENDED || strpos($url, SEO_PAGENAME_START) !== false)) {
            $_SERVER['REQUEST_URI'] = $url;
            $url = 'seo.php';
        } else {
            $pos = strpos($url, QUESTION);
            if ($pos) {
                $strlen_url = strlen($url);
                $parameter = substr($url, $pos + 1);
                $url = substr($url, 0, $pos);
                if ($pos < $strlen_url) {
                    if (USE_SEO && !DO_SEO_EXTENDED) {
                        $sep = SLASH;
                    } else {
                        $sep = HTML_AMP;
                    }
                    $parameter = split($sep, $parameter);
                    while (list($key, $val) = each($parameter)) {
                        $sep = split(EQUAL, $val);
                        $_GET[$sep[0]] = $sep[1];
                    }
                }
            }
            $PHP_SELF = $url;
        }
        define('IS_AJAX_PROCESSING_FORCED', true);
        include $url;
        olc_exit();
    } else {
        //echo "redirect='".$url.APOS.HTML_BR;
        header('Location: ' . $url);
        olc_exit();
    }
    //W. Kaiser - AJAX
}
        }
    } else {
        $show_error = true;
        $main_content = 'Es wird Zugriff auf die Datei "<font color="blue">' . str_replace(ADMIN_PATH_PREFIX, EMPTY_STRING, OLCOMMERCE_SQL) . '</font>" benötigt, dieser ist jedoch nicht möglich!';
    }
} else {
    $show_error = true;
    $main_content = str_replace(HASH, 'Das Programm kann nur vom <font color="blue">Haupt-Administrator</font> ausgeführt werden!', $error0);
}
if ($main_content) {
    if ($show_error) {
        $main_content = str_replace(HASH, $main_content, $error0);
    }
    $main_content = HTML_BR . HTML_BR . $main_content;
    require PROGRAM_FRAME;
    olc_exit();
}
function parse_sql_file($file_name, $is_olc_file, &$tables, &$text_array, &$insert_array, &$text_array_search, &$keys_array, &$table_charset, $default_charset, &$struct_count, &$data_count)
{
    if (defined('TABLE_PREFIX_COMMON')) {
        $error0 = 'Fehler beim Öffnen der Datei "#"!';
        $fp = @fopen($file_name, 'r');
        if ($fp) {
            $not_is_olc_file = !$is_olc_file;
            $check_charset = true;
            $not_is_olc_file && $not_is_version_5;
            $charset_len = strlen(DEFAULT_CHARSET);
            $not_found_charset = true;
            $file_offset = 0;
            $not_insert_into_found = true;
            while ($line = fgets($fp)) {
function UpdateTables()
{
    global $version_nr, $version_datum;
    SendHTMLHeader;
    $alter_table = 'ALTER TABLE ';
    $alter_table_orders = $alter_table . TABLE_ORDERS . ' ADD ';
    $sql[1] = $alter_table . TABLE_PRODUCTS . ' ADD products_ean VARCHAR(128) AFTER products_id';
    $sql[2] = $alter_table_orders . 'payment_class VARCHAR(32) NOT NULL';
    $sql[3] = $alter_table_orders . 'shipping_method VARCHAR(32) NOT NULL';
    $sql[4] = $alter_table_orders . 'shipping_class VARCHAR(32) NOT NULL';
    $sql[5] = $alter_table_orders . 'billing_country_iso_code_2 CHAR(2) NOT NULL AFTER billing_country';
    $sql[6] = $alter_table_orders . 'delivery_country_iso_code_2 CHAR(2) NOT NULL AFTER delivery_country';
    $sql[7] = $alter_table_orders . 'billing_firstname VARCHAR(32) NOT NULL AFTER billing_name';
    $sql[8] = $alter_table_orders . 'billing_lastname VARCHAR(32) NOT NULL AFTER billing_firstname';
    $sql[9] = $alter_table_orders . 'delivery_firstname VARCHAR(32) NOT NULL AFTER delivery_name';
    $sql[10] = $alter_table_orders . 'delivery_lastname VARCHAR(32) NOT NULL AFTER delivery_firstname';
    $sql[11] = $alter_table . TABLE_ORDERS . ' CHANGE payment_method payment_method VARCHAR(255) NOT NULL';
    $sql[12] = $alter_table . TABLE_ORDERS . ' CHANGE shipping_method shipping_method VARCHAR(255) NOT NULL';
    $sql[13] = 'CREATE TABLE ' . TABLE_PREFIX_INDIVIDUAL . 'cao_log ( id int(11) NOT NULL auto_increment, date datetime NOT NULL default "0000-00-00 00:00:00",' . 'user varchar(64) NOT NULL default "", pw varchar(64) NOT NULL default "", method varchar(64) NOT NULL default "",' . 'action varchar(64) NOT NULL default "", post_data mediumtext, get_data mediumtext, PRIMARY KEY  (id))';
    $link = 'db_link';
    global ${$link}, $logger;
    $header_title = 'CAO-Faktura - OL-Commerce Shopanbindung';
    $header_subtitle = 'Version ' . $version_nr . ' Stand : ' . $version_datum;
    $main_content = '';
    for ($i = 1; $i <= 13; $i++) {
        $main_content .= '<b>SQL:</b> ' . $sql[$i] . '<br>';
        if (olc_db_query($sql[$i], ${$link})) {
            $main_content .= '<b>Ergebnis : OK</b>';
        } else {
            $error = olc_db_error();
            $pos = strpos($error, 'Duplicate column name');
            if ($pos === False) {
                $pos = strpos($error, 'already exists');
                if ($pos === False) {
                    $main_content .= '<b>Ergebnis : </b><font color="red"><b>' . $error . '</b></font>';
                } else {
                    $main_content .= '<b>Ergebnis : OK, Tabelle existierte bereits !</b>';
                }
            } else {
                $main_content .= '<b>Ergebnis : OK, Spalte existierte bereits !</b>';
            }
        }
        $main_content .= '<br><br>';
    }
    if (INTEGRATE_INTO_OLC) {
        chdir('admin');
        $header_icon_image = HEADING_MODULES_ICON;
        $show_column_right = true;
        require PROGRAM_FRAME;
        olc_exit();
    } else {
        $main_content = '<html><head></head><body>
<h3>' . $header_title . '</h3>
<h4>' . $header_subtitle . '</h4>
' . $main_content . '
</body>
</html>
';
    }
}