$versions{'main_settings-ext_lib.pl'} = '06.6.00.0000';

# Contains all sub routines (functions) for the main and core settings
# that the storefront (customer facing) functions use.

#######################################################################
#
# AgoraCart and all associated files, except where noted, are
# Copyright 2001 to Present jointly by K-Factor Technologies, Inc.
# and by C E Mayo (aka Mister Ed) at AgoraCart.com & K-Factor.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This copyright notice may not be removed or altered in any way.
#
#######################################################################

# Begin - loaded when lib read into manager.cgi. Sets up menu options.
{
    local ($modname) = 'main_settings';
    if ( $mc_change_main_settings_ok eq '' ) {
        $mc_change_main_settings_ok = 'yes';
    }
    if ( $mc_change_main_settings_ok =~ /yes/i ) {
        register_extension( $modname, 'AgoraCart Store Settings', $versions{$modname} );
        register_menu( 'main_settings_screen', 'show_main_settings_screen',
            $modname, "Display Cart Settings" );
        register_menu( 'ChangeMainSettings', 'action_input_main_settings',
            $modname, "Write Cart Settings" );
    }

    # if store accesses logging is enabled in main settings, add to menu
    if ( $mgr_shall_i_log_accesses =~ /yes/i ) {
        register_menu( 'visitor_access_display', 'visitor_access_display',
            $modname, 'Display Visitor Metrics and Logs' );
    }

    # setup the commando menu option, if desired
    if ( $commando_ok =~ /yes/i ) {
        register_menu( 'action_commando', "action_commando",
            $modname, 'Display Commando Screen' );
        add_settings_choice( 'Commando',
            ' Commando Shell ','action_commando' );
    }
}

#######################################################################

sub action_input_main_settings {

    local ( $admin_email, $order_email, $cookieDomain, $cookiePath,$cookieSecureDomain, $cookieSecurePath );
    local (
        $temp_affiliate_call, $temp_affiliate_image_call,
        $temp_money_symbol, $sc_temp_affiliate_call2
    );
    local ($smtp_user, $smtp_pass);
    local ( $temp1, $temp2, $order_email5, $order_email6, $sc_replyto_email_temp );
    local (@values, $robotlist_string ) = q{};
    my ($myset, $myset4, $myset3, $convert_time ) = q{};
    my $robot_count = 0;
    my $secs_per_hour = 3600;
    ( $mgr_noarchive_checked, $mgr_noimageindex_checked, $mgr_nofollow_checked, $mgr_noindex_checked ) = q{};

    $cookieDomain = $in{'sc_store_url'};
    $cookiePath   = $in{'sc_store_url'};
    $cookieDomain =~ s/http.*:\/\///ig;
    $cookieDomain =~ s/\/.*//g;
    $cookieDomain =~ s/\/agora.cgi//g;
    $cookiePath =~ s/http.*:\/\/$cookieDomain//g;
    $cookiePath =~ s/agora.cgi//g;
    chop $cookiePath;    # no trailing slash

    if ( $in{'sc_ssl_location_url2'} eq '' ) {
        $in{'sc_ssl_location_url2'} = "$in{'sc_store_url'}";
    }

    # for secure cookies & paths
    $cookieSecureDomain = $in{'sc_ssl_location_url2'};
    $cookieSecurePath   = $in{'sc_ssl_location_url2'};
    $cookieSecureDomain =~ s/https.*:\/\///ig;
    $cookieSecureDomain =~ s/http.*:\/\///ig; # incase non-SSL used
    $cookieSecureDomain =~ s/\/.*//g;
    $cookieSecureDomain =~ s/\/agora.cgi//g;
    $cookieSecurePath =~ s/http.*:\/\/$cookieSecureDomain//g;
    $cookieSecurePath =~ s/agora.cgi//g;
    chop $cookieSecurePath;    # no trailing slash

    @values = param('metarobots');
    foreach $robot (@values) {
        if ( $robot_count == 0 ) {
            $robotlist_string = "$robot";
        }
        else {
            $robotlist_string .= ", $robot";
        }
        $robot_count++;

        if ( $robot eq 'noarchive' ) {
            $mgr_noarchive_checked = 'checked';
            $myset4 .= "\$mgr_noarchive_checked = '$mgr_noarchive_checked';\n";
        }
        elsif ( $robot eq 'noimageindex' ) {
            $mgr_noimageindex_checked = 'checked';
            $myset4 .= "\$mgr_noimageindex_checked = '$mgr_noimageindex_checked';\n";
        }
        elsif ( $robot eq 'nofollow' ) {
            $mgr_nofollow_checked = 'checked';
            $myset4 .= "\$mgr_nofollow_checked = '$mgr_nofollow_checked';\n";
        }
        elsif ( $robot eq 'noindex' ) {
            $mgr_noindex_checked = 'checked';
            $myset4 .= "\$mgr_noindex_checked = '$mgr_noindex_checked';\n";
        }
    }

    # <!-- Make it harder for IP theft and/or competitors doing pricing analysis from SE/Google caches-->
    $myset .= qq~\$sc_robot_meta_tags = qq|<!-- Default -->\n<meta name="robots" content="$robotlist_string">|;\n~;


    $order_email = my_escape( $in{'email_address_for_orders'} );
    $admin_email  = my_escape( $in{'admin_email'} );
    $sc_replyto_email_temp = my_escape( $in{'sc_replyto_email'} );
    $order_email5 = my_escape( $in{'second_email_address_for_orders'} );
    if ( $in{'second_email_orders_yes_no'} =~ /yes/i ) {
        $order_email6 = ',' . $order_email5;
        $order_email  = $order_email . $order_email6;
    }

    if ( $in{'sc_set_0077_umask'} =~ /yes/i ) {
        $myset .= "\$sc_set_0077_umask = 'yes';\n";
        $myset .= "\$original_umask = umask 0077;\n";
    }
    else {
        $myset .= "\$sc_set_0077_umask = 'no';\n";
        $myset .= "\$original_umask = umask;\n";
    }

    $myset .= "\$sc_number_days_keep_old_carts = \"$in{'sc_number_days_keep_old_carts'}\";\n";
    $myset .= "\$sc_database_lib = \"$in{'database_lib'}\";\n";
    $myset .= "\$sc_prod_db_pad_length = \"$in{'sc_prod_db_pad_length'}\";\n";
    $temp1 = my_stripout( $in{'sc_minimum_order_amount'} );
    $temp2 = my_stripout( $in{'sc_minimum_order_text'} );
    $myset .= qq|\$sc_minimum_order_amount = "$temp1";\n|;
    $myset .= qq|\$sc_minimum_order_text = "$temp2";\n|;
    $myset .= qq|\$sc_prevent_zero_total_orders = "$in{'sc_prevent_zero_total_orders'}";\n|;
    $myset .= qq|\$sc_need_short_cart_id = "$in{'sc_need_short_cart_id'}";\n|;
    $myset .= qq|\$sc_use_international_latin_characters = "$in{'sc_use_international_latin_characters'}";\n|;

    $myset .= qq|\$sc_use_database_subcats = "$in{'sc_use_database_subcats'}";\n|;
    $myset .= qq|\$sc_subcat_index_field = "$in{'sc_subcat_index_field'}";\n|;
    $myset .= qq|\$sc_count_database_cats = "$in{'sc_count_database_cats'}";\n|;
    $myset .= qq|\$sc_http_affiliate_call = qq!$in{'sc_http_affiliate_call'}!;\n|;
    $sc_temp_affiliate_call2 = my_escape( $in{'sc_temp_affiliate_call'} );
    $myset .= qq|\$sc_temp_affiliate_call = "$sc_temp_affiliate_call2";\n|;
    if ( $in{'sc_temp_affiliate_call'} ) {
        $temp_affiliate_image_call =
            q{<img src="} . $in{'sc_http_affiliate_call'} . qq{://$sc_temp_affiliate_call" border=0>};
        $myset .=  "\$sc_affiliate_image_call = qq|\$temp_affiliate_image_call|;\n";
    }
    $myset .= qq|\$sc_send_order_to_email = "$in{'email_orders_yes_no'}";\n|;
    $myset .= qq|\$sc_second_send_order_to_email = "$in{'second_email_orders_yes_no'}";\n|;

    my $first_order_email = my_escape( $in{'email_address_for_orders'} );
    $myset .= qq|\$sc_order_email = "$order_email";\n|;
    $myset .= qq|\$sc_first_order_email = "$first_order_email";\n|;
    $myset .= qq|\$sc_second_order_email = "$order_email5";\n|;

    if ( $in{'sc_email_content_type'} ) {
        $myset .= qq|\$sc_email_content_type = "$in{'sc_email_content_type'}";\n|;
    }
    else {
        $myset .= qq|\$sc_email_content_type = "text/plain";\n|;
    }

    $myset .= qq|\$sc_admin_email = "$admin_email";\n|;

    if ( $sc_replyto_email_temp ) {
        $myset .= qq|\$sc_replyto_email = "$sc_replyto_email_temp";\n|;
    }
    else {
        $myset .= qq|\$sc_replyto_email = "$admin_email";\n|;
    }
    $myset .= qq|\$sc_use_html_customer_emails = "$in{'sc_use_html_customer_emails'}";\n|;
    $myset .= qq|\$sc_use_dynamic_email_subjects = "$in{'sc_use_dynamic_email_subjects'}";\n|;
    $myset .= qq|\$sc_agc_use_smtp_email = "$in{'sc_agc_use_smtp_email'}";\n|;
    $myset .= qq|\$sc_email_smtp_send_option = "$in{'sc_email_smtp_send_option'}";\n|;
    $myset .= qq|\$sc_smtp_mail_server = "$in{'sc_smtp_mail_server'}";\n|;
    $smtp_user = my_escape( $in{'sc_smtp_user'} );
    $smtp_pass = my_escape( $in{'sc_smtp_pass'} );
    $myset .= qq|\$sc_smtp_user = "$smtp_user";\n|;
    $myset .= qq|\$sc_smtp_pass = "$smtp_pass";\n|;
    $myset .= qq|\$sc_smtp_port = "$in{'sc_smtp_port'}";\n|;
    $myset .= qq|\$sc_email_smtp_sendmail_duplicate = "$in{'sc_email_smtp_sendmail_duplicate'}";\n|;

    $myset .= qq|\$sc_lang_path = "$in{'sc_lang_path'}";\n|;
    $myset .= qq|\$sc_store_url = "$in{'sc_store_url'}";\n|;
    $sc_store_base_URL = $in{'sc_store_url'};
    $sc_store_base_URL =~ s/agora\.cgi//i;
    $myset .= qq|\$sc_store_base_URL = "$sc_store_base_URL";\n|;
    $sc_ssl_location_url2 = $in{'sc_ssl_location_url2'};
    $sc_SSL_base_URL = $sc_ssl_location_url2;
    $sc_SSL_base_URL =~ s/agora\.cgi//i;
    $myset .= qq|\$sc_SSL_base_URL = "$sc_SSL_base_URL";\n|;
    $myset .= qq|\$sc_ssl_location_url2 = "$in{'sc_ssl_location_url2'}";\n|;
    $myset .= qq|\$sc_stepone_order_script_url = "$in{'sc_ssl_location_url2'}";\n|;
    $myset .= qq|\$sc_domain_name_for_cookie = "$cookieDomain";\n|;
    $myset .= qq|\$sc_path_for_cookie = "$cookiePath";\n|;
    $myset .= qq|\$sc_secure_domain_name_for_cookie = "$cookieSecureDomain";\n|;
    $myset .= qq|\$sc_secure_path_for_cookie  = "$cookieSecurePath";\n|;
    $myset .= qq|\$sc_self_serve_images = "$in{'sc_self_serve_images'}";\n|;
    if ( $in{'sc_self_serve_images'} =~ /yes/i ) {
        $URL_of_images_directory = "picserve.cgi?picserve=";
        $myset .= "\$URL_of_images_directory = qq|\$URL_of_images_directory|;\n";
    }
    else {
        $myset .= qq|\$URL_of_images_directory = "$in{'URL_of_images_directory'}";\n|;
    }

    $in{'sc_store_image_geometry'} =~ s/ //g;
    $in{'sc_store_thumb_geometry'} =~ s/ //g;

    $myset .= qq|\$sc_store_image_geometry = "$in{'sc_store_image_geometry'}";\n|;
    $myset .= qq|\$sc_store_thumb_geometry = "$in{'sc_store_thumb_geometry'}";\n|;

    $myset .= qq|\$sc_path_of_images_directory = "$in{'URL_of_images_directory'}";\n|;
    $myset .= qq|\$sc_shall_i_log_accesses = "$in{'sc_shall_i_log_accesses'}";\n|;
    $myset .= qq|\$sc_search_box_toggle = "$in{'sc_search_box_toggle'}";\n|;

    $myset .= qq|\$sc_order_check_db = "$in{'sc_order_check_db'}";\n|;
    $myset .= qq|\$mc_session_time_setting = "$in{'mc_session_time_setting'}";\n|;
    $myset .= qq|\$sc_enable_category_metatag_db = "$in{'sc_enable_category_metatag_db'}";\n|;
    $myset .= qq|\$sc_category_metatag_field = "$in{'sc_category_metatag_field'}";\n|;
    $myset .= qq|\$sc_schema_site_name = "$in{'sc_schema_site_name'}";\n|;
    $myset .= qq|\$sc_generic_productpage_meta_description = "$in{'sc_generic_productpage_meta_description'}";\n|;

    $myset .= "\$sc_should_i_display_cart_after_purchase = \"$in{'sc_should_i_display_cart_after_purchase'}\";\n";
    $myset .= "\$sc_should_i_display_cart_after_purchase_real = \"$in{'sc_should_i_display_cart_after_purchase'}\";\n";
    $myset .= "\$sc_use_cart_contents_images = \"$in{'sc_use_cart_contents_images'}\";\n";

    # security: options must match options file for database item
    $myset .= qq|\$sc_negative_priced_options = "$in{'sc_negative_priced_options'}";\n|;
    $myset .= qq|\$sc_use_verified_opt_values = "$in{'sc_use_verified_opt_values'}";\n|;
    $myset .= qq|\$sc_disable_variable_options = "$in{'sc_disable_variable_options'}";\n|;
    $myset .= qq|\$sc_turn_off_option_price_display = "$in{'sc_turn_off_option_price_display'}";\n|;
    $myset .= qq|\$sc_enable_multi_load_option_files = "$in{'sc_enable_multi_load_option_files'}";\n|;
    $myset .= qq|\$sc_scramble_cc_info = "$in{'scramble_cc_info'}";\n|;
    $myset .= qq|\$sc_debug_mode = 'no';\n|;
    $mc_images_dir = "$in{'mc_images_dir'}";
    $myset4 .= qq|\$mc_images_dir = "$in{'mc_images_dir'}";\n|;
    $myset4 .= qq|\$mc_chmod_uploaded_images = "$in{'mc_chmod_uploaded_images'}";\n|;
    $myset .= qq|\$sc_displayDynamicCategories = "$in{'sc_displayDynamicCategories'}";\n|;

    #DOCTYPE
    $myset .= "\$sc_doctype =  qq|$in{'sc_doctype'}|;\n";
    $myset .= "\$sc_mgr_upgrade_tier =  qq|$in{'sc_mgr_upgrade_tier'}|;\n";

    $myset4 .= qq|\$mgr_shall_i_log_accesses = "$in{'sc_shall_i_log_accesses'}";\n|;
    $myset4 .= qq|\$mc_main_settings_initial_setup_ok = 'yes';\n|;
    $myset4 .= qq|\$mc_show_htaccess_error_at_welcome = "$in{'mc_show_htaccess_error_at_welcome'}";\n|;
    $myset4 .= qq|\$mc_mgr_template = 'standard'; # or dashboard66 (future expansion)\n|;

    $in{'mc_number_hours_between_core_updates'} =~ /(\d+)/;
    $my_uphour_update = $1;
    $convert_time = $secs_per_hour * $my_uphour_update;
    $myset4 .= qq|\$mc_version_time_difference = "$convert_time";\n|;
    $myset4 .= qq|\$mc_number_hours_between_core_updates = $my_uphour_update;\n|;

    $myset4 .= "1;";
    $myset3 .= qq|\$sc_shall_i_log_accesses = "$in{'sc_shall_i_log_accesses'}";\n|;
    $myset3 .= "1;";

    update_store_settings( 'MAIN', $myset );   # main settings
    save_userlog_settings($myset3);     # userlog settings
    update_mainmisc_settings( "$mgr_miscmain", $myset4 );
    require_supporting_libraries( __FILE__, __LINE__, "$mgr_user_settings_path" );
    write_html_css_js_includes();
    category_list_builder_for_store();
    show_main_settings_screen();
}

#######################################################################

sub show_main_settings_screen {

    my $page_output = &$manager_page_header( 'Main/Core Store Settings', '', '', '', '' );

    my $err_code = q{};
    local ( $mgr_edge_tier_checked, $mgr_release_tier_checked ) = '';
    my $today = time();

    if ( -e "$mc_version_lastchecked_path" ) {
        require_supporting_libraries( __FILE__, __LINE__,  "$mc_version_lastchecked_path" );
    }

    my $current_versions = $mgr_current_versions_string;
    my $compareTimes = $today - $mgr_version_lastchecked_time;

    # only check once every period of time set by $mc_version_time_difference, set in manager.cgi (can be overridden)
    if ( $compareTimes > $mc_version_time_difference )  {
        $current_versions = simple_secure_URL_file_getter($mgr_versions_URL);
        $mgr_version_lastchecked_time = $today;
        $mgr_current_versions_string = $current_versions;
        update_version_status_file_routine();
    }

    my ($curent_cur_version,$edge_cur_version,$agoracgi_version,$lang_version,$viewers_version) = split(/\|/, "$current_versions");

    opendir( LANGSETS, "$sc_lang_dir" );
    @myfiles = readdir(LANGSETS);
    closedir(LANGSETS);
    foreach $zfile (@myfiles) {
        if ( !( $zfile =~ /\./ ) ) {
            $languagesetlinks .= qq~<option value="$zfile">$zfile</option>\n~;
        }
    }

    make_lists_of_various_options();

    if ( $sc_mgr_upgrade_tier eq '' ) {
        $mgr_current_tier_checked = ' checked';
    }
    elsif ( $sc_mgr_upgrade_tier eq 'Edge' ) {
        $mgr_edge_tier_checked = ' checked';
    }
    else {
        $mgr_current_tier_checked = ' checked';
    }

    my $mgr_tier_radio_list = <<ENDOFTEXT;
<div class="radio$mgr_current_tier_status">
  <label>
    <input type="radio" name="sc_mgr_upgrade_tier" id="tierRadios2" value="Current"$mgr_current_tier_checked$mgr_current_tier_status>
    <b>Current</b> <i>( Route 66 Version: $curent_cur_version )</i>
  </label>
</div>
<div class="radio$mgr_edge_tier_status">
  <label>
    <input type="radio" name="sc_mgr_upgrade_tier" id="tierRadios3" value="Edge"$mgr_edge_tier_checked$mgr_edge_tier_status>
    <b>Edge</b> <i>( Route 66 Version: $edge_cur_version )</i>
  </label>
</div>
ENDOFTEXT

    #set some defaults
    if ( $sc_path_of_images_directory eq '' ) {
        $sc_path_of_images_directory = $URL_of_images_directory;
    }

    if ( $sc_debug_mode eq '' ) {
        $sc_debug_mode = 'no';
    }
    if ( $sc_set_0077_umask eq '' ) {
        $sc_set_0077_umask = 'no';
    }
    if ( $sc_set_0077_umask =~ /yes/i ) {
        $sc_other_0077     = 'no';
    }
    else {
        $sc_set_0077_umask = 'no';
        $sc_other_0077     = 'yes';
    }
    if ( $sc_scramble_cc_info eq '' ) {
        $sc_scramble_cc_info = 'no';
    }

    if ( $sc_doctype eq '' ) {
        $sc_doctype =  q~<!DOCTYPE html>~;
    }

    # check for GD in non-fatal way
    eval("use GD;");
    $err_code = q{};
    $err_code = $@;
    if ($err_code) {  # GD module error of some kind
        $mc_GD_module_status = qq|
        <div class="row col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 bg-danger">
                <h4 class="text-danger mgr-center">The GD Perl Module is not installed</h4>
                <p class="text-danger">images uploaded on product add and edit screens will not be resized unless GD is installed on your server or hosting account. Store will still operate without this feature.</p>
            </div>
        </div>
|;
    }
    else {
        $mc_GD_module_status = qq|
        <div class="row col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 bg-success">
                <h4 class="text-primary mgr-center">The GD Perl Module is installed</h4>
                <p class="text-primary">No errors found - images uploading and resizing from the product add and edit screens should work properly.</p>
            </div>
        </div>
|;
    }

    if ( $sc_use_international_latin_characters eq '' ) {
        $sc_use_international_latin_characters = 'no';
    }
    if ( $sc_enable_multi_load_option_files eq '' ) {
        $sc_enable_multi_load_option_files = 'no';
    }
    if ( $sc_use_html_customer_emails eq '' ) {
        $sc_use_html_customer_emails = 'no';
    }
    if ( $sc_search_box_toggle eq '' ) {
        $sc_search_box_toggle = 'ExactlyEntered';
    }

    if ( $sc_lang_path eq '' ) { $sc_lang_path = 'eng_us'; }

    if ( $sc_use_cart_contents_images eq '' ) {
        $sc_use_cart_contents_images = 'no';
    }

    if ( $mc_number_hours_between_core_updates eq '' ) {
        $mc_number_hours_between_core_updates = 48;
    }


    $page_output .= <<ENDOFTEXT;
<h1 class='mgr-page-title'>Main / Core Store Settings</h1>
<p><br></p>

<p class="well">This area contains the core settings for your store which are grouped using the tabs below. Click on the tabs to view each settings group. You may change the settings within as many tabs/groups as needed, then press the <b><i>submit</i></b> button at the very bottom of the page after you are finished making any desired changes. Click on the <i class="fa fa-info-circle"></i> icon next to any setting for more information on the setting.</p>
<p><br></p>

ENDOFTEXT

    if ( $in{'system_edit_success'} ) {
        $page_output .= qq|
<div class="row col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 bg-success">
    <h4 class="text-primary mgr-center">Main/Core settings have been successfully updated</h4>
    <p class="mgr-center">Check/Edit each of your Gateway Settings <a href=manager.cgi?mgr_seshun=$in{'mgr_seshun'}&select_gateway_settings_screen=yes>here</a></p>
    </div>
</div>
<p><br><br><br><br><br></p>
|;
    }

    $page_output .= <<ENDOFTEXT;

<ul class="nav nav-tabs" id="tabs" role="tablist">
    <li role="presentation"><a href="#tabs-1" aria-controls="tabs-1" role="tab" data-toggle="tab">Update Tiers</a></li>
    <li role="presentation"><a href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Database</a></li>
    <li role="presentation"><a href="#tabs-3" aria-controls="tabs-3" role="tab" data-toggle="tab">Checkout</a></li>
    <li role="presentation"><a href="#tabs-4" aria-controls="tabs-4" role="tab" data-toggle="tab">Images</a></li>
    <li role="presentation" class="active"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Store URL</a></li>
    <li role="presentation"><a href="#tabs-8" aria-controls="tabs-8" role="tab" data-toggle="tab">Email</a></li>
    <li role="presentation"><a href="#tabs-9" aria-controls="tabs-9" role="tab" data-toggle="tab">Security</a></li>
    <li role="presentation"><a href="#tabs-10" aria-controls="tabs-10" role="tab" data-toggle="tab">Meta Tags</a></li>
    <li role="presentation"><a href="#tabs-11" aria-controls="tabs-11" role="tab" data-toggle="tab">Misc</a></li>
</ul>

<form class="form-horizontal" action="manager.cgi" method="post">
<input type="hidden" name="mgr_seshun" value="$in{'mgr_seshun'}">

<div class="tab-content">

<div class="tab-pane" id="tabs-1">
    <p><br></p>
    <h2 class="mgr-page-title"><b>Update Preferences</b></h2>
    <p><br></p>

    <p><b>Select the number of hours between AgoraCart version checks: &nbsp; <a data-toggle="collapse" href="#timeUpgradeSelection" aria-expanded="false" aria-controls="timeUpgradeSelection"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="mc_number_hours_between_core_updates">
    <option>$mc_number_hours_between_core_updates</option>
    <option value="12">12 Hours (1/2 day)</option>
    <option value="24">24 Hours (1 day)</option>
    <option value="48">48 Hours (2 days)</option>
    <option value="72">72 Hours (3 days)</option>
    <option value="168">168 Hours (7 days)</option>
    <option value="336">336 Hours (14 days)</option>
    </select>
    </p>
    <div class="collapse" id="timeUpgradeSelection">
      <div class="well">
        <p>This is the number of hours between the last Agoracart version check (for upgrade purposes) and the next one that is to be performed</p>
        <p>Default: 48 hours.</p>
      </div>
    </div>

    <p><hr></p>

    <p><b>Select the <b>core</b> upgrade tier you wish to participate in: &nbsp; <a data-toggle="collapse" href="#tierUpgradeSelection" aria-expanded="false" aria-controls="tierUpgradeSelection"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span>
    $mgr_tier_radio_list
    </p>
    <div class="collapse" id="tierUpgradeSelection">
      <div class="well">
        <p><b>Current:</b> This version has more public exposure, testing, and verification than the Edge tier. The features are subject to further modification. Public documentation may or may not be complete. Updates are less frequent than the Edge tier.</p>
        <p><b>Edge:</b> This version has basic testing completed. The features are subject to further modification. This version usually lacks official public documentation. Development &amp; testing versions can be found at this tier.</p>
        <p><b>Note:</b> Upgrades are not done autmatically and required store admin intervention. To perform any updates, please use the upgrade manager listed in the store settings area/screen.</p>
      </div>
    </div>

    <p><hr></p>

    <p><br></p>
    <h2 class="mgr-page-title"><b>Version Numbers Guide</b></h2>
    <p><br></p>

    <p>An AgoraCart version number consists of four incremented integer values. Periods (.) separate each value. Each value in an AgoraCart version number represents specific information.  For Example, the <b>Route 66</b> version, <b>06.6.00.0000</b> is broken out in the table below:</p>
    <table class="table table-condensed table-bordered">
        <tr>
            <td class="text-center"><h2>06.</h2></td>
            <td class="text-center"><h2>6.</h2></td>
            <td class="text-center"><h2>00.</h2></td>
            <td class="text-center"><h2>0000</h2></td>
        </tr>
        <tr>
            <td class="success text-center"><b>Major Version</b></td>
            <td class="warning text-center"><b>Minor-Major Version</b></td>
            <td class="danger text-center"><b>Minor Version</b></td>
            <td class="info text-center"><b>Build Version</b></td>
        </tr>
    </table>
    <p><br></p>

    <p><b>Version Numbers Key:</b></p>

    <table class="table table-condensed table-bordered">
        <tr>
            <td class="success text-center col-xs-6 col-sm-6 col-md-3"><b>Major Version</b></td>
            <td class="col-xs-6 col-sm-6 col-md-9"><p>The 'Major Version' represents significant changes to the software as a whole.</p>
                <ul>
                    <li>Subsequent publications of the version/release will increment the major value. (for example, 06.6.99.9999 becomes 07.0.00.0000 after an update)</li>
                    <li>Route 66 (version 06.6.xx.xxxx) of AgoraCart will be developed along side the new database version (starting as version 07.0.xx.xxxx) for as long as it is found useful to a significant number of users.</li>
                </ul></td>
        </tr>
        <tr>
            <td class="warning text-center col-xs-6 col-sm-6 col-md-3"><b>Minor-Major Version</b></td>
            <td class="col-xs-6 col-sm-6 col-md-9"><p>The 'Minor-Major Version' represents large sets of bug fixes, typo corrections, and additions/changes to features that we released in a major value version.</p>
                <ul>
                    <li>Initial builds of a Major version release of AgoraCart use a minor-major version value of 0 (for example, 07.0.00.0000).</li>
                    <li>Subsequent publications of the version/release will increment the minor-major value. (for example, 07.0.99.9990 becomes 07.1.00.0000 after an update)</li>
                    <li>Version 06.6 (aka Route 66) of AgoraCart will never increment the minor-major value above the number 6.</li>
                </ul></td>
        </tr>
        <tr>
            <td class="danger text-center col-xs-6 col-sm-6 col-md-3"><b>Minor Version</b></td>
            <td class="col-xs-6 col-sm-6 col-md-9"><p>The 'Minor Version' represents large sets of bug fixes, typo corrections, and additions/changes to features that we released in a minor-major value version.</p>
                <ul>
                    <li>Initial builds of a Minor-Major version release of AgoraCart use a minor version value of 00 (for example, 07.1.00.0000).</li>
                    <li>Subsequent publications of the version/release will increment the minor value. (for example, 06.6.00.9980 version becomes 06.6.01.0000 after an update)</li>
                    <li>When the build version value exceeds the number 9980, the minor version value will be incremented to the next value.</li>
                    <li>At AgoraCart's election, the minor version value may be incremented if the sum effect is substantial for of all the changes implemented cumulatively for all build versions under the most current minor version value.</li>
                </ul>
            </td>
        </tr>
        <tr>
            <td class="info text-center col-xs-6 col-sm-6 col-md-3"><b>Build Version</b></td>
            <td class="col-xs-6 col-sm-6 col-md-9"><p>The 'Build Version' represents small sets of bug fixes, typo corrections, and additions/changes that stabilize the features that we released in a minor value version.</p>
                <ul>
                    <li>Initial builds of any increment of a Major/Minor-Major/Minor version release of AgoraCart use a build version value of 0000 (for example, 06.6.11.0000).</li>
                    <li>Subsequent publications of the version/release will increment the build version value. (for example, 06.6.11.0000 becomes 06.6.11.0001 after an update)</li>
                </ul>
            </td>
        </tr>
    </table>

    <p><br></p>
</div>

    <!-- End of tab 1 -->

<div class="tab-pane" id="tabs-2">
    <p><br></p>
    <h2 class="mgr-page-title"><b>Database Section</b></h2>
    <p><br></p>

    <p><b>Select your Database library and set the product database key pad length:</b><span style="padding-left: 25px;"></span></p>
    <p>Library:<span style="padding-left: 10px;"></span><select name=database_lib>
    $mylist_of_database_libs
    </select><span style="padding-left: 50px;"></span>Key Pad Length:<span style="padding-left: 10px;"></span><input name="sc_prod_db_pad_length" type="number" maxlength="2" value="$sc_prod_db_pad_length"></p>

    <p><hr></p>

    <p><b>Do you wish to use Product Sub Categories?</b><span style="padding-left: 25px;"></span><select name=sc_use_database_subcats>
    <option>$sc_use_database_subcats</option>
    <option>No</option>
    <option>Yes</option>
    </select></p>

    <p><br></p>

    <p><b>Select Product UserField you wish to Enter Sub Category Names in: &nbsp; <a data-toggle="collapse" href="#subcatProductUserField" aria-expanded="false" aria-controls="subcatProductUserField"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_subcat_index_field>
    <option>$sc_subcat_index_field
    <option value="">None
    <option>user2
    <option>user3
    <option>user4
    <option>user5
    $user10_thingy
    $user20_thingy
    </select></p>
    <div class="collapse" id="subcatProductUserField">
      <div class="well">
        <p>When entering a product into multiple sub categories, separate sub category names with double colons (::) in the edit/add product manager screens. For example, if you have sub-category names of "New Books" and "Used Books", they would be entered as: "New Books::Used Books" in the UserField of choice.</p>
        <p>Spaces are allowed in the sub-category names.</p>
        <p>Characters such as \$ % # - . , ; : _ * @  ^ ? / \\ { } [ ] ~ + | should not be not be used in sub-category names.</p>
      </div>
    </div>

    <p><hr></p>

    <p><b>Do you wish to use Count total products in Categories and Sub Categories? &nbsp; <a data-toggle="collapse" href="#countCategoryItems" aria-expanded="false" aria-controls="countCategoryItems"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_count_database_cats>
    <option>$sc_count_database_cats</option>
    <option>No</option>
    <option>Yes</option>
    </select></p>
    <div class="collapse" id="countCategoryItems">
      <div class="well">
        <p>This will display the item counts in each category or sub category next to the title/name of the category, if using standard layouts and/or standard AgoraScript category display code.</p>
        <p>Troubleshooting Note: if using dynamic category builders and you get multiples in product counts on a page equal to the number of products in each category, remove the extra dynamic category lists in the headers, footers and page layouts or turn this feature off.</p>
      </div>
    </div>

    <p><br></p>
	</div>


        <!-- End of tab 2 -->


    <div class="tab-pane" id="tabs-3">

    <p><br></p>
    <h2 class="mgr-page-title"><b>Store Checkout Controls Section</b></h2>
    <p><br></p>

    <p><b>After adding and item to cart, route customer to: &nbsp; <a data-toggle="collapse" href="#viewCartAfterAdd" aria-expanded="false" aria-controls="viewCartAfterAdd"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_should_i_display_cart_after_purchase">
    <option>$sc_should_i_display_cart_after_purchase</option>
    <option>viewCart</option>
    <option>productPage</option>
    <option>checkOut</option>
    </select></p>
    <div class="collapse" id="viewCartAfterAdd">
         <div class="well">
             <p>Default: <b>viewCart</b> will display the cart contents page ( "&dc=1" is in the store URL ).</p>
             <p><b>productPage</b> keeps the customer on the database generated product page where they originally pressed the "Add to Cart" button, with a thank you message generated towards the top of the page (if messages are included/defined in store header or product page templates).</p>
             <p><b>checkOut</b> will take the customer to the checkout process upon adding an item to the cart. This saves a step for those using AgoraCart for single donations, a non-verified product database, or usually only a single item at checkout.</p>
             <p>TIP: Select <b>viewCart</b> or <b>checkOut</b> if running an HTML-based store and you DO NOT want to the customer to go to a database generated product page.</p>
         </div>
    </div>
    <p><hr></p>

    <p><b>Override Cart Contents Images: &nbsp; <a data-toggle="collapse" href="#viewCartContentsImages" aria-expanded="false" aria-controls="viewCartContentsImages"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_use_cart_contents_images">
    <option>$sc_use_cart_contents_images</option>
    <option>no</option>
    <option>yes</option>
    </select></p>
    <div class="collapse" id="viewCartContentsImages">
         <div class="well">
             <p>Default: <b>no</b> will display the cart contents images from the database for the item.</p>
             <p>If you are using a donation mode (set in template), or wanted to add items that are not database verified (disabled in security settings), setting this to <b>yes</b> you can force the cart contents display to use the image provided in the Add-to_cart button that is submitted to AgoraCart.</p>
             <p>TIP: If you do not need images displayed in the cart contents table, you can select <b>BLANK</b> for the image in all the emails and cart displays managed in the Cart Contents - Displays/Emails manager found in the Templates &amp; Content section.</p>
         </div>
    </div>
    <p><hr></p>

    <p><b>Minimum order: &nbsp; <a data-toggle="collapse" href="#minimumOrder" aria-expanded="false" aria-controls="minimumOrder"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><input name="sc_minimum_order_amount" type="text" maxlength="12" value="$sc_minimum_order_amount" required></p>
    <div class="collapse" id="minimumOrder">
         <div class="well">
             <p>If you wish to set a minimum order amount that customers must reach to complete an order, enter it here.  Otherwise, enter 0.  Do not add currency symbols as they will be stripped out in most cases.  Indicate currency in the next box.</p>
         </div>
     </div>
     <p><br></p>

     <p><b>Minimum order currency type: &nbsp; <a data-toggle="collapse" href="#minimumOrderCurrency" aria-expanded="false" aria-controls="minimumOrderCurrency"><i class="fa fa-info-circle"></i></a></b><input name="sc_minimum_order_text" class="form-control" type="text" maxlength="25" value="$sc_minimum_order_text" required></p>
     <div class="collapse" id="minimumOrderCurrency">
          <div class="well">
              <p>Enter the currency type for the minimum order. Spell it out. Example: Euro, Dollars, Pounds, US Dollars, etc.</p>
          </div>
      </div>
      <p><hr></p>

      <p><b>Do you wish to display the prices of options? &nbsp; <a data-toggle="collapse" href="#displayOptionPrices" aria-expanded="false" aria-controls="displayOptionPrices"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><select name=sc_turn_off_option_price_display>
      <option>$sc_turn_off_option_price_display</option>
      <option>on</option>
      <option>off</option>
      </select></p>
      <div class="collapse" id="displayOptionPrices">
           <div class="well">
               <p>This allows you to turn off the display of prices for each option ordered on each product in the view cart contents screen as well as on the cart contents displayed at checkout.  Default is ON, even if nothing is selected in this setting.</p>
           </div>
       </div>
       <p><hr></p>

       <p><b>Do you wish to prevent Zero total orders? &nbsp; <a data-toggle="collapse" href="#preventZeroOrders" aria-expanded="false" aria-controls="preventZeroOrders"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><select name=sc_prevent_zero_total_orders>
       <option>$sc_prevent_zero_total_orders</option>
       <option>No</option>
       <option>Yes</option>
       </select></p>
       <div class="collapse" id="preventZeroOrders">
            <div class="well">
                <p>YES will prevent zero orders.  NO will allow you to take zero orders.</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Do you need shorter Cart ID numbers? &nbsp; <a data-toggle="collapse" href="#useShorterCartID" aria-expanded="false" aria-controls="useShorterCartID"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><select name=sc_need_short_cart_id>
        <option>$sc_need_short_cart_id</option>
        <option>No</option>
        <option>Yes</option>
        </select></p>
        <div class="collapse" id="useShorterCartID">
             <div class="well">
                 <p>NO is default, and ensures harder to guess order ID credentials (for increased security).  If your payment gateway requires shorter number for the "order ID" passed to them, then set this to YES.</p>
             </div>
         </div>
         <p><hr></p>

         <p><b>Allow International/Extended Latin Characters? &nbsp; <a data-toggle="collapse" href="#allowMoreLatin" aria-expanded="false" aria-controls="allowMoreLatin"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><select name=sc_use_international_latin_characters>
         <option>$sc_use_international_latin_characters</option>
         <option>No</option>
         <option>Yes</option>
         </select></p>
         <div class="collapse" id="allowMoreLatin">
              <div class="well">
                  <p>Default is NO. YES will allow international latin (extended ASCII) characters, useful when selling to countries in Europe. NO will only allow standard ASCII (UK / US English) characters.</p>
                  <p>Additional characters allowed would be:<br>
                  &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &OElig; &Otilde; &Ouml; &Oslash; &Scaron; &Ugrave; &Uacute; &Ucirc; &Uuml; &Yacute; &Yuml; &THORN; &szlig; &agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil; &egrave; &eacute; &ecirc; &euml; &igrave; &iacute; &icirc; &iuml; &eth; &ntilde; &ograve; &oacute; &oelig; &ocirc; &otilde; &ouml; &oslash; &scaron; &ugrave; &uacute; &ucirc; &uuml; &yacute; &yuml; &thorn;</p>
              </div>
          </div>

          <p><br></p>
	</div>


        <!-- End of tab 3 -->



	<div class="tab-pane" id="tabs-4">
        <p><br></p>
        <h2 class="mgr-page-title"><b>Image Serving Section</b></h2>
        <p><br></p>

        $mc_GD_module_status
        <div class="col-sm-12"><p><br></p></div>

        <p><b>Please enter URL of your Store's images directory: &nbsp; <a data-toggle="collapse" href="#storeImageURL" aria-expanded="false" aria-controls="storeImageURL"><i class="fa fa-info-circle"></i></a></b><input name="URL_of_images_directory" type="text" class="form-control" value="$sc_path_of_images_directory" required></p>
        <div class="collapse" id="storeImageURL">
             <div class="well">
                 <p>DO NOT include a trailing slash!!!</p>
                 <p>A relative path URL is the default, is faster than full URLs for image locations, and looks like <b>view66/images</b> in the field below.</p>
                 <p>A relative path for the location of your product images starts from the location of the <i>agora.cgi</i> file in your store's directory. For example, if your store is located in a directory called <i>store66</i> and your images are in a directory named <i>images</i> inside of a directory named <i>view</i> within your store directory, then you you would enter <i>view/images</i> in the field above.</p>
                 <p>A relative location with using SSL (aka TLS) and non-SSL pages under the same domain name can use the [[URLofImages]] token in both secure <i>https</i> and insecure <i>http</i> pages (as seen in the browser's location bar).</p>
                 <p>Complex Relative Path Example: If your images are stored outside your store directory but on the same website, such as an graphics directory in your "root" directory for your website: <b>www.domain-name.com/graphics</b><br>and your store was located in your cgi-bin like so:  <b>www.domain-name.com/cgi-bin/store</b><br>then you would need to go up two levels in your directory tree and then back down one.  Each level upwards is indicated by a set of: ../ , so the image location for serving your images would look like this: <b>../../graphics</b> ( with no trailing slash ).</p>
                 <p>For faster image serving, enter the relative disk path from the location of the agora.cgi file for your store's images directory (without the trailing slash) and set the next option to "No" for self-serve of the images.</p>
                 <p>You can use full URLs for the image location. It is slower but is good for those times when shared SSL (TLS) running under a different domain name is used for checkout ( i.e.: https://secure.serverg.com/~username/store66/agora.cgi ) or the images are on a different server or account.  Try to use a secure https URL ( SSL / TLS )</p>
                 <p>An example of the images URL inside your store directory might look like: <b>https://$ENV{'SERVER_NAME'}/store66/view66/images</b></p>
             </div>
         </div>
         <p><hr></p>

         <p><b>Do you want to self-serve the images? &nbsp; <a data-toggle="collapse" href="#selfServeImages" aria-expanded="false" aria-controls="selfServeImages"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_self_serve_images>
         <option>$sc_self_serve_images</option>
         <option>No</option>
         <option>Yes</option>
         </select></p>
         <div class="collapse" id="selfServeImages">
              <div class="well">
                  <p>Default is NO.</p>
                  <p>Say NO unless you have some good reason to use this images serving feature.&nbsp; One reason would be that your server will not serve images from your cgi-bin directory (or where the store is currently installed at) and for some reason you cannot move them outside of the store directory areas.</p>
                  <p>Speed Tip: Your store will run faster with this set to NO. YOu can also set the image to use a "relative path" in the setting above.</p>
              </div>
         </div>
         <p><hr></p>

         <p><b>Are images uploading under wrong permissions? &nbsp; <a data-toggle="collapse" href="#imagesUploadingWrong" aria-expanded="false" aria-controls="imagesUploadingWrong"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=mc_chmod_uploaded_images>
         <option>$mc_chmod_uploaded_images</option>
         <option>no</option>
         <option>yes</option>
         </select></p>
         <div class="collapse" id="imagesUploadingWrong">
           <div class="well">
               <p>Default is NO.</p>
               <p>Troubleshooting Tip: If your images are saving but you cannot view them ( and you are not operating the store from with in a cgi-bin type directory of your hosting account ), try setting this to "YES".  This will change the permissions on the images to permissions of 0644 as images are uploaded from the product add/edit managers.</p>
           </div>
        </div>
        <p><hr></p>

        <p><b>Manager Image Path: &nbsp; <a data-toggle="collapse" href="#mgrImagePath" aria-expanded="false" aria-controls="mgrImagePath"><i class="fa fa-info-circle"></i></a></b><input name="mc_images_dir" type="text" class="form-control" maxlength="30" value="$mc_images_dir" required></p>
        <div class="collapse" id="mgrImagePath">
            <div class="well">
                <p>Default: ./view66/images</p>
                <p>Used for image uploads during product addition and editing.</p>
                <p>Because the store can have a relative directory or full http/https URL path for images, and manager needs a disk path, we set this variable here to point to be the disk path to the images directory.</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Uploaded Image Resizing &nbsp; <a data-toggle="collapse" href="#imageResizes" aria-expanded="false" aria-controls="imageResizes"><i class="fa fa-info-circle"></i></a></b><br>Main Product Image: ( default: 150x150 ) &nbsp; <input name="sc_store_image_geometry" type="text" size=10
        maxlength="9" value="$sc_store_image_geometry">  &nbsp;&nbsp;&nbsp; Thumbnails: ( default: 65x65 ) &nbsp; <input name="sc_store_thumb_geometry" type="text" size=10
        maxlength="9" value="$sc_store_thumb_geometry"></p>
        <div class="collapse" id="imageResizes">
        <div class="well">
             <p>Only works when the <i>GD Perl module</i> is installed on your server. If not installed on your server, you can install the <i>GD Perl module</i> for images locally if you have cPanel based web hosting. If the local cPanel installation of the <i>GD Perl module</i> fails, you can try to contact your tech support or system administrator and have it installed locally or server wide.</p>
             <p>When uploading images via the first image box in the "Add Product" or "Edit Products" screens, images are resized down proportionately to the max of either width or height listed below for each image type.</p>
             <p>If nothing is entered, the default max for main product images are 150 x 150, and 65 x 65 for thumbnails.</p>
             <p>Do not enter spaces between the numbers and "by" sign ( aka X ) so that they look like: 150x150 or 65x65</p>
             </div>
        </div>

        <p><br></p>
	</div>


    <!-- End of tab 4 -->


	<div class="tab-pane active" id="tabs-5">

        <p><br></p>
        <h2 class="mgr-page-title"><b>Store URL Section</b></h2>
        <p><br></p>


        <p><b>Please select the default store's language: &nbsp; <a data-toggle="collapse" href="#defaultLanguage" aria-expanded="false" aria-controls="defaultLanguage"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><select name=sc_lang_path>
        <option>$sc_lang_path</option>
        <option></option>
        $languagesetlinks
        </select></p>
        <div class="collapse" id="defaultLanguage">
             <div class="well">
                 <p>Default is English (US): eng_us</p>
                 <p>This is the language that the customer/storefront facing messages are displayed in.  Does not affect the manager's language.</p>
             </div>
        </div>
        <p><hr></p>

        <p><b>Please enter the full URL of your store: &nbsp; <a data-toggle="collapse" href="#storeURL" aria-expanded="false" aria-controls="storeURL"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><input name="sc_store_url" type="url" class="form-control"
        maxlength="128" value="$sc_store_url" required></p>
        <div class="collapse" id="storeURL">
            <div class="well">
                <p>You can run the store in secure ( SSL / TLS ) or in a non-SSL (standard) mode. <b>Secure mode is recommended as of January 2017.</b></p>
                <p>Examples:<br><b>https://www.$ENV{'SERVER_NAME'}/store66/agora.cgi</b> <i style="color: #FF0000">(preferred &amp; secure)</i><br> https://$ENV{'SERVER_NAME'}/store66/agora.cgi <i style="color: #FF0000">(preferred &amp; secure)</i><br>http://www.$ENV{'SERVER_NAME'}/store66/agora.cgi<br>
                http://$ENV{'SERVER_NAME'}/store66/agora.cgi</p>
                <p>Secure URLs usually start with "https://" and is highly recommended if you have a TLS (aka SSL) certificate for your domain name. Many hosting companies now give free certificates under your domain name that are very basic (unverified entity & basic secure encryption) and renew after 3-6 months, usually automatically as log as your domain name is valid and hosted on their servers.</p>
                <p>The standard or normal mode has a URL that starts with "http://" - notice the missing letter "s" in the URL. </p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Please enter the full Secure URL of your store: &nbsp; <a data-toggle="collapse" href="#storeSecureURL" aria-expanded="false" aria-controls="storeSecureURL"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 25px;"></span><input name="sc_ssl_location_url2" type="url" class="form-control"
        maxlength="128" value="$sc_ssl_location_url2"></p>
        <div class="collapse" id="storeSecureURL">
            <div class="well">
                 <p>Supports Shared SSL/TLS: a secure certificate that is not on your own domain name and is provided by your hosting company for all sites to use.  Make sure this URL matches what your hosting provider issued to you.<br>Example: <b>https://secure.servercompany.com/~usernamehere/store66/agora.cgi</b></p>
                 <p>Supports Free & Dedicated SSL/TLS: This is a secure certificate under your domain name, usually bought by you or in many cases provided for free by many hosting companies. If unsure, check with your hosting company to confirm if you have a secure certificate for your domain name (TLS aka SSL).<br>Example: <b>https://www.$ENV{'SERVER_NAME'}/store66/agora.cgi</b> or https://$ENV{'SERVER_NAME'}/store66/agora.cgi</p>
                 <p>If not using secure URLs ( SSL / TLS ), leave blank and the normal store URL will be inserted and used.</p>
            </div>
        </div>

        <p><br></p>
    </div>


    <!-- End of tab 5 -->


	<div class="tab-pane" id="tabs-8">
        <p><br></p>
        <h2 class="mgr-page-title"><b>Confirmation Emails Section</b></h2>
        <p><br></p>


        <p><b>Do you want orders emailed? &nbsp; <a data-toggle="collapse" href="#sendOrderEmails" aria-expanded="false" aria-controls="sendOrderEmails"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="email_orders_yes_no">
        <option>$sc_send_order_to_email</option>
        <option>yes</option>
        <option>no</option>
        </select></p>
        <div class="collapse" id="sendOrderEmails">
            <div class="well">
                  <p>This is the email address you wish to have the order processing version of the order email sent.</p>
                  <p>We recommend that this email address be different than the email address used as the admin email address which is the "send from" address ( listed further below ).</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Primary Email Address to send orders to:</b><span style="padding-left: 25px;"></span><input name="email_address_for_orders" type="email" class="form-control" maxlength="80" value="$sc_first_order_email"></p>
        <p><hr></p>

        <p><b>Send order processing version emails to a second email address? </b><span style="padding-left: 25px;"></span><select name="second_email_orders_yes_no">
        <option>$sc_second_send_order_to_email</option>
        <option>yes</option>
        <option>no</option>
        </select></p>
        <p><hr></p>

        <p><b>Secondary Email Address to send orders to:</b><span style="padding-left: 25px;"></span><input name="second_email_address_for_orders" type="email" class="form-control" maxlength="80" value="$sc_second_order_email"></p>
        <p><hr></p>

        <p><b>Email Address for store administrator &nbsp; <a data-toggle="collapse" href="#adminEmails" aria-expanded="false" aria-controls="adminEmails"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="admin_email" type="email" class="form-control" maxlength="80" value="$sc_admin_email"></p>
        <div class="collapse" id="adminEmails">
            <div class="well">
                  <p>This is the "send from" email address and it MUST be on same server and/or hosting account as the AgoraCart store resides ( same domain name on same hosting account or mail server ). If such a valid email account does not exist, using your hosting control panel create an email account on a domain that your server would recognize as a valid email sender for your store</p>
                  <p>This email address can be checked by anti-spam mechanisms on the receiving end so it is very important to have the domain names match what your mail server can confirm to third-parties ( i.e.: the customer's email services ).</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Reply-to Email Address for outbound store emails: &nbsp; <a data-toggle="collapse" href="#replyToEmails" aria-expanded="false" aria-controls="replyToEmails"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_replyto_email" type="email" class="form-control" maxlength="80" value="$sc_replyto_email"></p>
        <div class="collapse" id="replyToEmails">
            <div class="well">
                  <p>The email adddress you wish any customer replies sent to. This is listed on the customer's version of the order confirmation email.</p>
                  <p><b>If left blank</b>, the admin email address ( the "send from" ) listed above will be used.</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Use HTML formatted order emails? &nbsp; <a data-toggle="collapse" href="#htmlEmails" aria-expanded="false" aria-controls="htmlEmails"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_use_html_customer_emails">
        <option>$sc_use_html_customer_emails</option>
        <option>yes</option>
        <option>no</option>
        </select></p>
        <div class="collapse" id="htmlEmails">
            <div class="well">
                  <p>Default is NO.  Must select an HTML based template in your payment gateway settings, in each gateway you wish to use.</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Use dynamic email subjects? &nbsp; <a data-toggle="collapse" href="#dynamicEmailSubj" aria-expanded="false" aria-controls="dynamicEmailSubj"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_use_dynamic_email_subjects">
        <option>$sc_use_dynamic_email_subjects</option>
        <option>yes</option>
        <option>no</option>
        </select></p>
        <div class="collapse" id="dynamicEmailSubj">
            <div class="well">
                  <p>Default is NO.</p>
                  <p><b>Advanced Feature.</b></p>
                  <p>Some add-ons require this to be set to YES. Test and check emails prior to going live with this feature to ensure it does what you expect.</p>
            </div>
        </div>
        <p><hr></p>

        <p><b>Use SMTP Account to Send Emails? &nbsp; <a data-toggle="collapse" href="#useSMTP" aria-expanded="false" aria-controls="useSMTP"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_agc_use_smtp_email">
        <option>$sc_agc_use_smtp_email</option>
        <option>no</option>
        <option>yes</option>
        </select></p>
        <div class="collapse" id="useSMTP">
            <div class="well">
                  <p>Default is NO. AgoraCart will use your hosting server's sendmail functions.</p>
                  <p><b>Optional Feature.</b></p>
                  <p>If your sendmail is causing order confirmations to customers to not be delivered or delivered in their spam bins, using SMTP can help.</p>
                  <p>Best practice is to use an email address that is on the same server as the SMTP account, for example this server you are on. Most web hosting companies provide email and SMTP services in your hosting account. If so this is a better option than the default sendmail processes AgoraCart uses.</p>
            </div>
        </div>
        <p><br></p>

        <p><b>SMTP Send Option: &nbsp; <a data-toggle="collapse" href="#smtpSendOption" aria-expanded="false" aria-controls="smtpSendOption"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_email_smtp_send_option">
        <option>$sc_email_smtp_send_option</option>
        <option>simple</option>
        <option>ssl</option>
        </select></p>
        <div class="collapse" id="smtpSendOption">
            <div class="well">
                  <p>Default is SIMPLE.  This is the most basic type of outbound email and SMTP account login.</p>
                  <p>SSL: this option allows you to try to use SSL/TLS encryption when talking to the SMTP server &amp; account.</p>
                  <p>If SSL doesn't work, try SIMPLE.  If test emails are not delivered properly, you will need to disable SMTP and use regular sendmail.</p>
                  <p>Note: Gmail has not been tested with these SMTP options. But according to the docs, if you wish to test it, you will need to enable acceptance of "insecure" emails. This means insecure as not using OAuth2 and but not other security problems necessarily.</p>
            </div>
        </div>
        <p><br></p>

        <p><b>Send sendmail Duplicate as a Backup: &nbsp; <a data-toggle="collapse" href="#smtpBackupOption" aria-expanded="false" aria-controls="smtpBackupOption"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_email_smtp_sendmail_duplicate">
        <option>$sc_email_smtp_sendmail_duplicate</option>
        <option>no</option>
        <option>yes</option>
        </select></p>
        <div class="collapse" id="smtpBackupOption">
            <div class="well">
                  <p>Default is NO.</p>
                  <p>YES: this option allows you to send a duplicate order confirmation email to your customer (and yourself as well) using your server's standard sendmail option, after the preferred SMTP option is used. This is useful if your SMTP server/service is getting mixed results when sending emails to outside email destinations. This is meant as a backup method only -- Customers (and you) might become quickly annoyed with duplicate emails for every order, so use with care so you do not get your order confirmation emails marked as spam.</p>
            </div>
        </div>
        <p><br></p>

        <p><b>SMTP Host: &nbsp; <a data-toggle="collapse" href="#smtpHost" aria-expanded="false" aria-controls="smtpHost"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_smtp_mail_server" type="text" class="form-control" maxlength="120" value="$sc_smtp_mail_server"></p>
        <div class="collapse" id="smtpHost">
            <div class="well">
                  <p>Enter the full name of your SMTP / Mail Host.</p>
                  <p><b>Exmaples:</b> mail.yourdomain.com or smtp.someservice.net</p>
            </div>
        </div>
        <p><br></p>

        <p><b>SMTP Username: &nbsp; <a data-toggle="collapse" href="#smtpUsername" aria-expanded="false" aria-controls="smtpUsername"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_smtp_user" type="text" class="form-control" maxlength="120" value="$sc_smtp_user"></p>
        <div class="collapse" id="smtpUsername">
            <div class="well">
                  <p>Enter the user name for your SMTP account.</p>
                  <p><b>Exmaples:</b> username or email\@mydomain.com</p>
            </div>
        </div>
        <p><br></p>

        <p><b>SMTP Password: &nbsp; <a data-toggle="collapse" href="#smtpPass" aria-expanded="false" aria-controls="smtpPass"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_smtp_pass" type="text" class="form-control" maxlength="30" value="$sc_smtp_pass"></p>
        <div class="collapse" id="smtpPass">
            <div class="well">
                  <p>Enter the password for your SMTP account.</p>
            </div>
        </div>
        <p><br></p>

        <p><b>SMTP Server Port: &nbsp; <a data-toggle="collapse" href="#smtpPort" aria-expanded="false" aria-controls="smtpPort"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_smtp_port" type="number" class="form-control" maxlength="8" value="$sc_smtp_port"></p>
        <div class="collapse" id="smtpPort">
            <div class="well">
                  <p>Enter the port to access the SMTP account/server.</p>
                  <p>Most common ports for cPanel based servers: 25, 26, 465</p>
            </div>
        </div>


        <p><br></p>
	</div>


    <!-- End of tab 8 -->


	<div class="tab-pane" id="tabs-9">

        <p><br></p>
        <h2 class="mgr-page-title"><b>Security Section</b></h2>
        <p><br></p>


        <p><b>Manager Session Inactivity Period (in minutes): &nbsp; <a data-toggle="collapse" href="#mgrSessionExpire" aria-expanded="false" aria-controls="mgrSessionExpire"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="mc_session_time_setting">
        <option>$mc_session_time_setting</option>
        <option value="10">10</option>
        <option value="15">15</option>
        <option value="20">20</option>
        <option value="25">25</option>
        <option value="30">30</option>
        <option value="35">35</option>
        <option value="40">40</option>
        <option value="45">45</option>
        <option value="50">50</option>
        <option value="55">55</option>
        <option value="60">60 -> 1 hour</option>
        <option value="75">75 -> 1.25 hours</option>
        <option value="90">90 -> 1.5 hours</option>
        <option value="105">105 -> 1.75 hours</option>
        <option value="120">120 -> 2 hours</option>
        </select></p>
        <div class="collapse" id="mgrSessionExpire">
             <div class="well">
                 <p>Default is 30 minutes until your are automatically logged out on the next action/submission.</p>
                 <p>This helps to protect your store management areas from being hijacked using browser data (or inactive screens) or from being intercepted for later use.</p>
                 <p>You may select longer if you are having issues with being logged out before your work is done, but 30 minutes is suggested for PCI compliance. Security wise, the shorter the time, the better.</p>
             </div>
         </div>
         <p><hr></p>

         <p><b>Verify products ordered data with database data? &nbsp; <a data-toggle="collapse" href="#verifyOrderData" aria-expanded="false" aria-controls="verifyOrderData"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_order_check_db">
         <option>$sc_order_check_db</option>
         <option>yes</option>
         <option>no</option>
         </select></p>
         <div class="collapse" id="verifyOrderData">
              <div class="well">
                  <p>Default is YES.</p>
                  <p>Say "no" if running an HTML-based store without a database or adding to the cart from non-agora.cgi parsed pages.</p>
                  <p>NOTE: links to cart and database still need to come from the same domain name as AgoraCart runs from.</p>
              </div>
          </div>
          <p><hr></p>

          <p><b>Use Verified Product Option Values? &nbsp; <a data-toggle="collapse" href="#verifyOptionData" aria-expanded="false" aria-controls="verifyOptionData"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_use_verified_opt_values>
          <option selected>$sc_use_verified_opt_values</option>
          <option>yes</option>
          <option>no</option>
          </select></p>
          <div class="collapse" id="verifyOptionData">
               <div class="well">
                   <p>Default is YES, for security reasons.</p>
                   <p>This will check options (pricing and names) on products ordered against the values found in the actual options file that is listed with the product in the database. If you use dynamic options (those files built via dynamically with multiple files), then set this to NO.</p>
                   <p>NOTE: this feature currently does not verify the more advanced "variable" options.</p>
               </div>
           </div>
           <p><hr></p>

           <p><b>Prevent Negative Priced Options? &nbsp; <a data-toggle="collapse" href="#preventNegOptions" aria-expanded="false" aria-controls="preventNegOptions"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_negative_priced_options>
           <option selected>$sc_negative_priced_options</option>
           <option>yes</option>
           <option>no</option>
           </select></p>
           <div class="collapse" id="preventNegOptions">
                <div class="well">
                    <p>Default is YES, for security reasons.</p>
                    <p>This will disallow negative priced options.</p>
                    <p>If having problems with variable option discounts, set to NO</p>
                </div>
            </div>
            <p><hr></p>

            <p><b>Turnoff Variable Options? &nbsp; <a data-toggle="collapse" href="#disableVarOptions" aria-expanded="false" aria-controls="disableVarOptions"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_disable_variable_options>
            <option selected>$sc_disable_variable_options</option>
            <option>yes</option>
            <option>no</option>
            </select></p>
            <div class="collapse" id="disableVarOptions">
                 <div class="well">
                     <p>Default is NO, which enables the use of variable options.</p>
                     <p>These are different than standard options listed above that are used by most users.</p>
                     <p><b>Advanced Feature.</b> These are different than standard options listed above that are used by most users.   Variable options allow for discount or volume pricing, per an individual product, as well as other advanced option capabilites, but requires AgoraScript/Perl coding and manual edits/customization of the individual product option files.</p>
                     <p>If you are not using Variable Options, then set to YES. This will increase the speed and security of your store if disabled (set to yes).</p>
                 </div>
             </div>
             <p><hr></p>

             <p><b>Allow Nested Option Files? &nbsp; <a data-toggle="collapse" href="#allowNestedOptions" aria-expanded="false" aria-controls="allowNestedOptions"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_enable_multi_load_option_files>
             <option selected>$sc_enable_multi_load_option_files</option>
             <option>yes</option>
             <option>no</option>
             </select></p>
             <div class="collapse" id="allowNestedOptions">
                  <div class="well">
                      <p>Default is NO, which disables the use of variable options.</p>
                      <p>These are different than standard options listed above that are used by most users.</p>
                      <p><b>Advanced Feature.</b> If you have numerous option files that share common elements, setting this to YES will allow you to load the option file in more than one product, make changes to less files, and load the option file more than once per product using <b>%%Load_Option_file option-file-name.html%%</b> within the already called option files.</p>
                      <p>The error indicator will look like: <b>(reload of option graphicSelect.html attempted!)</b> where the option file would be expected to be displayed. This error means that you are trying to load the option files inside of one another.</p>
                      <p>If you are unsure how this works, leave at NO as it is not recommended unless absolutely necessary for more complex options.</p>
                  </div>
              </div>
              <p><hr></p>

              <p><b>Use 0077 umask? &nbsp; <a data-toggle="collapse" href="#useUmask" aria-expanded="false" aria-controls="useUmask"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_set_0077_umask>
              <option selected>$sc_set_0077_umask</option>
              <option>$sc_other_0077</option>
              </select></p>
              <div class="collapse" id="useUmask">
                   <div class="well">
                       <p>Default is NO.</p>
                       <p>NOTE: Most installs of the cart can skip this setting and leave it at NO.</p>
                       <p>If you setup your cart via a control panel (such as cPanel), then leave at the default of NO, as your system admin may have already set your file access "rights" correctly.</p>
                       <p><b>Advanced Feature.</b> If you are having problems with files not deleting or being read (cart files, cart cookies, order files, etc), then set to YES.</p>
                   </div>
               </div>
               <p><hr></p>

               <p><b>Scramble CC Info? (legacy) &nbsp; <a data-toggle="collapse" href="#scrambleCCinfo" aria-expanded="false" aria-controls="scrambleCCinfo"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=scramble_cc_info>
               <option selected>$sc_scramble_cc_info</option>
               <option>yes</option>
               <option>no</option>
               </select></p>
               <div class="collapse" id="scrambleCCinfo">
                    <div class="well">
                        <p>Default is YES.</p>
                        <p>NOTE: This is legacy feature as CC (credit card) info is no longer collected in the Offline gateway, but adds protection for any PO and check information collected.</p>
                        <p>This option scrambles the CC info that is stored on disk temporarily in the VERIFY files in Offline and other gateways that take CC info on your server.</p>
                        <p><b>Advanced Feature.</b> Set to YES unless you have
                        trouble with blank CC numbers in confirmation emails <b>and</b> you are
                        sure that the VERIFY files are safe from prying eyes.</p>
                    </div>
                </div>

        <p><br></p>
	</div>


    <!-- End of tab 9 -->


	<div class="tab-pane" id="tabs-10">

        <p><br></p>
        <h2 class="mgr-page-title"><b>Robot &amp; Product Page Meta Tags Section</b></h2>
        <p><br></p>

        <p>You may edit the sitewide HTML Doctype, Robots tags, and enable a product metatag database for product categories and sub-categories that also allows you to select productPage layouts for the selected category.</p>

        <p><b>How the 'Product Page' description metatags work:</b></p>
        <p>The default description metatags for individual products pages ( by Product ID ) use the first two sentences of your product description for this tag. Product category display using <b>&product=namehere</b> or userfields for sub-categories  take the first sentence of the first product displayed on each result page to create the metatag. Description metatags built this way are truncated/maxed at 155 characters for SEO purposes.</p>

        <p>You may edit the description metatags/database for product categories and sub-categories. You can select existing top-level categories or add new entries for sub-categories (based on a sub-category userfield set in the main settings manager under the database tab) using the <a href=manager.cgi?mgr_seshun=$in{'mgr_seshun'}&edit_catdescription=yes><b>Category: Product Page Template &amp; SEO MetaTags</b></a>.</p>
        <p><hr></p>

        <p><b>Robot Metatags (followed only by friendly search engines such as Google & Bing) &nbsp; <a data-toggle="collapse" href="#robotMetaTags" aria-expanded="false" aria-controls="robotMetaTags"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span>
        <div class="checkbox">
            <label>
                <input type="checkbox" name="metarobots" value="noarchive" aria-label="noarchive" $mgr_noarchive_checked> noarchive <i>(recommended)</i>
            </label>
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox" name="metarobots" value="noimageindex" aria-label="noimageindex" $mgr_noimageindex_checked> noimageindex <i>(recommended)</i>
            </label>
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox" name="metarobots" value="nofollow" aria-label="nofollow" $mgr_nofollow_checked> nofollow
            </label>
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox" name="metarobots" value="noindex" aria-label="noindex" $mgr_noindex_checked> noindex
            </label>
        </div>
        </p>
        <div class="collapse" id="robotMetaTags">
             <div class="well">
                 <p>Default: noarchive, noimageindex<br>Note: <i>We suggest that you use these robot tags to make it harder for competitors and others to mine your images and pricing strategies directly from Google search results without ever visiting your site.</i></p>
                 <p><b>noarchive:</b> Do not show a "Cached" link in search results. Recommended for most sites.</p>
                 <p><b>noimageindex:</b> Do not index images on this page. Recommended for most sites.</p>
                 <p><b>nofollow:</b> Do not follow the links on this page.</p>
                 <p><b>noindex:</b> Do not show this page in search results and do not show a "Cached" link in search results. For sites or pages whose complete details you do not want shown within search results, such as a privacy page, legal details, personal pages, etc.<br>
                 Note: <i>we have observed Google results showing results for the site but no site information/details when this is used sitewide.</i></p>
             </div>
         </div>
         <p><hr></p>


        <p><b>Do you wish to enable the custom category description metatag database? &nbsp; <a data-toggle="collapse" href="#catCustomMetaTags" aria-expanded="false" aria-controls="catCustomMetaTags"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_enable_category_metatag_db">
        <option>$sc_enable_category_metatag_db</option>
        <option>yes</option>
        <option>no</option>
        </select></p>
        <div class="collapse" id="catCustomMetaTags">
             <div class="well">
                 <p>NOTE: default will use sentences from the product database for first product displayed, up to the first 155 characters. But enabling this setting will allow you to use a database and create your own category metatag descriptions, up to 155 characters for each category you wish to customize.</p>
                 <p>If enabled, you may create your custom category metatags with the <a href=manager.cgi?mgr_seshun=$in{'mgr_seshun'}&edit_catdescription=yes><b>Category: Product Page Template &amp; SEO MetaTags</b></a> manager</p>
             </div>
         </div>
         <p><hr></p>

         <p><b>Product Category or Custom Header? &nbsp; <a data-toggle="collapse" href="#prodOrCustHeaders" aria-expanded="false" aria-controls="prodOrCustHeaders"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_category_metatag_field">
         <option value="$sc_category_metatag_field">$sc_category_metatag_field</option>
         <option value=""></option>
         <option value="product">product ( product category )</option>
         <option value="hdr">hdr ( custom header indicator )</option>
         </select></p>
         <div class="collapse" id="prodOrCustHeaders">
              <div class="well">
                  <p>Default is: product</p>
                  <p>Select the the use of product categories or custom headers to indicate the "key" or name used for the category page description meta tag.</p>
                  <p>Links using custom headers will not redirect to user friendly URLs, if enabled in the SEO manager.</p>
                  <p>NOTE: if using the custom headers option, spaces must be replaced with dash characters ( - ) in your custom links / URLs.</p>
                  <p>LEGACY NOTE: Prior to the Route 66 version, spaces were replaced with the underscore character ( _ ).</p>
              </div>
          </div>
          <p><hr></p>

          <p><b>Default Metatag Description: &nbsp; <a data-toggle="collapse" href="#defaultMetaDescription" aria-expanded="false" aria-controls="defaultMetaDescription"><i class="fa fa-info-circle"></i></a></b><input name="sc_generic_productpage_meta_description" type="text" class="form-control" value="$sc_generic_productpage_meta_description"></p>
          <div class="collapse" id="defaultMetaDescription">
               <div class="well">
                   <p>Used to fill in a page's metatag description when the metatag for a category or page is missing, such as the when the custom category metatag database is turned off or a product does not have enough information to build a descriptive tag.</p>
                   <p>Do not enter single or double quotes, nor any other meta-characters ( <i>non-alphanumeric characters and those that you would use the "shift key" plus a key to type</i> such as \$,\#,\%,&amp;,\@,*,',",-,<,>,?,/, etc )</p>
               </div>
           </div>
           <p><hr></p>

          <p><b>Schema.org Metatag Site Name: &nbsp; <a data-toggle="collapse" href="#schemaSiteName" aria-expanded="false" aria-controls="schemaSiteName"><i class="fa fa-info-circle"></i></a></b><input name="sc_schema_site_name" type="text" class="form-control" value="$sc_schema_site_name"></p>
          <div class="collapse" id="schemaSiteName">
               <div class="well">
                   <p>This is name of your site but only used in the schema.org product metatag template (a widget).</p>
                   <p>Do not enter single or double quotes, nor any other meta-characters ( <i>non-alphanumeric characters and those that you would use the "shift key" plus a key to type</i> such as \$,\#,\%,&amp;,\@,*,',",-,<,>,?,/, etc )</p>
               </div>
           </div>
           <p><hr></p>

          <p><b>HTML DocType: &nbsp; <a data-toggle="collapse" href="#HTMLdocType" aria-expanded="false" aria-controls="HTMLdocType"><i class="fa fa-info-circle"></i></a></b><textarea name="sc_doctype" class="form-control" rows="2">$sc_doctype</textarea></p>
          <div class="collapse" id="HTMLdocType">
               <div class="well">
                   <p>This is the HTML doc type to be included on all your pages.</p>
                   <p>The default should be for HTML 5: <b>&lt;!DOCTYPE html&gt;</b></p>
                   <p>LEGACY NOTE: previous versions used HTML 4 and should be updated to HTML5, especially if your document tags looks like the one below:<br>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;</p>
               </div>
           </div>


        <p><br></p>
	</div>


    <!-- End of tab 10 -->


    <div class="tab-pane" id="tabs-11">

<p><br></p>
<h2 class="mgr-page-title"><b>Misc Core Settings Section</b></h2>
<p><br></p>


<p><b>How many days to keep cart sessions &amp; server-side cookies? &nbsp; <a data-toggle="collapse" href="#serversideExpireTime" aria-expanded="false" aria-controls="serversideExpireTime"><i class="fa  fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_number_days_keep_old_carts" type="text" value="$sc_number_days_keep_old_carts" size="6" maxlength="9"></p>
    <div class="collapse" id="serversideExpireTime">
        <div class="well">
            <p>This is for how long do you wish to keep previous cart contents (possibly abandoned or waiting for IPN notifications) and related server-side cookies for non-finalized orders?</p>
            <p>The server-side cookies and cart contents are the records of what was added to the cart, as well as other info such as the cart ID, in case a payment is delayed and/or the customer wishes to come back later and resume shopping.</p>
            <p>These files are automagically deleted once the order is completed or the time set for expiration of these customer cart files is reached.</p>
            <p>Default is is 1 day. If using a payment gateway that reports back pending payments at a later date/time ( such as authorizations only, ACH payments, eChecks, and/or PayPal IPN ), set this to a suggested time of 5 days.</p>
            <p>Fractional days acceptable as well, such as .25 ( 6 hours ), .5 ( 12hours ), 1.75 ( 1 day and 18 hours ), etc.</p>
            <p>WARNING: do not exceed 7 days if your site is very busy or you do not login every 1-2 days as it could slow down performance and leave too many files in your directories.</p>
        </div>
    </div>
    <p><hr></p>

    <p><b>Search Box Function: &nbsp; <a data-toggle="collapse" href="#seachBoxFunc" aria-expanded="false" aria-controls="seachBoxFunc"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_search_box_toggle">
    <option>$sc_search_box_toggle</option>
    <option value="SeparateWords">Search for each/all words</option>
    <option value="ExactlyEntered">Search for words as a phrase</option>
    </select></p>
    <div class="collapse" id="seachBoxFunc">
        <div class="well">
            <p>Default is "ExactlyEntered" which is searching the words entered into the search box as a single string or in other words, exactly as entered as a phrase.</p>
            <p>The "SeparateWords" option allows each individual word entered to be searched for and all words entered must be present in any searchable product of your database to trigger a successful result.</p>
        </div>
    </div>
    <p><hr></p>

    <p><b>Do you wish to log unique accesses to your store? &nbsp; <a data-toggle="collapse" href="#logUniqAccesses" aria-expanded="false" aria-controls="logUniqAccessesc"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_shall_i_log_accesses">
    <option>$sc_shall_i_log_accesses</option>
    <option>yes</option>
    <option>no</option>
    </select></p>
    <div class="collapse" id="logUniqAccesses">
        <div class="well">
            <p>Default is YES</p>
            <p>This is very basic access logging and is not sophisticated site metrics, which may or may not be useful as it is a a legacy item but does capture some relevant information as to how your site is being accessed.</p>
            <p>Setting to "no" will disable both logging and access to the manager menu item as well.</p>
            <p><b>Speed Enhancement:</b> Your store will run slightly faster with this set to NO.</p>
        </div>
    </div>
    <p><hr></p>

    <p><b>Show .htaccess errors in store manager screens? &nbsp; <a data-toggle="collapse" href="#showHtaccessErrors" aria-expanded="false" aria-controls="showHtaccessErrors"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="mc_show_htaccess_error_at_welcome">
    <option>$mc_show_htaccess_error_at_welcome</option>
    <option>yes</option>
    <option>no</option>
    </select></p>
    <div class="collapse" id="showHtaccessErrors">
        <div class="well">
            <p>Default is YES</p>
            <p>If .htaccess directory protection is not set on the store manager sub-directory, a security advisory will show on most screens.</p>
            <p>Set to NO if you do not want to see the security advisories; common use cases are because you cannot or do not want to set .htaccess directory protection on your store manager sub-directory.</p>
            <p>Protection can be set using the .htaccess manager which only appears if it is not setup. However most hosting companies provide a directory protection feature which is more complex and allows you to add more than one user and password to th list, so we recommend you use such services over using the very basic one AgoraCart provides.</p>
        </div>
    </div>
    <p><hr></p>

    <p><b>Affiliate Program Image Call URL: &nbsp; <a data-toggle="collapse" href="#affilProgramCall" aria-expanded="false" aria-controls="affilProgramCall"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_http_affiliate_call>
    <option>$sc_http_affiliate_call</option>
    <option>http</option>
    <option>https</option>
    </select><br><br>Affiliate Tag URL:<span style="padding-left: 25px;"></span><input name="sc_temp_affiliate_call" type="text" class="form-control" maxlength="225" value="$sc_temp_affiliate_call"></p>
    <div class="collapse" id="affilProgramCall">
        <div class="well">
            <p>Enter your image call info in the form of: locationURLtoImage?ordertotal=AMOUNT&unique=UNIQUE&otherneededinfo and edit as needed.</p>
            <p>Do not enter: &lt;IMG SRC="https:// nor the "BORDER=0&gt; portions of the image call as those are added automatically.</p>
            <p>For the total, AMOUNT will be substituted by the cart with the subtotal before taxes and shipping.  If you need a different amount or total, such as from the profit tracker add-on, you will need to edit the order library file for your gateway(s) directly.</p>
            <p>For the UNIQUE portion, the invoice number will be used by the cart automatically.</p>
            <p>Finally, add whatever else is needed by your affiliate program for the image call.</p>
        </div>
    </div>

    <p><br></p>
	</div>

<!-- End of tab 11 -->

</div>
<p><br><br></p>
</div>
<input type="hidden" name="system_edit_success" value="yes">
<input name="ChangeMainSettings" type="hidden" value="Submit">
<button class="btn btn-primary btn-lg mgr-center" style="display: block;">Submit Settings Updates</button>
<p><br><br><br></p>

</form>

ENDOFTEXT
    $page_output .= &$manager_page_footer;
    print $page_output;
}

#######################################################################

sub update_mainmisc_settings {
    local ( $item, $stuff ) = @_;
    $mainmisc_file_settings{$item} = $stuff;
    local ( $item, $zitem );

    get_file_lock("$mgr_miscmain.lockfile");
    open( MAINFILE, ">$mgr_miscmain" )
      || my_die("Can't Open $mgr_miscmain");
    foreach $zitem ( sort( keys %mainmisc_file_settings ) ) {
        $item = $zitem;
        print( MAINFILE $mainmisc_file_settings{$zitem} );
    }
    close(MAINFILE);
    release_file_lock("$mgr_miscmain.lockfile");
}

#######################################################################

sub save_userlog_settings {
    local ($item)  = @_;
    get_file_lock("$sc_userlog_settings.lockfile");
    open( LOGSETTINGS, ">$sc_userlog_settings" )
      || my_die("Can't Open $sc_userlog_settings");
    print( LOGSETTINGS $item );
    close(LOGSETTINGS);
    release_file_lock("$sc_userlog_settings.lockfile");
}

#######################################################################

1;
