"> <input type="submit" name="Submit" value="Submit"> </td> </tr> </form> </table> <?php } } // sort routines if ($sort == 1 && !$first_entrance) { // first lets take care of the DB update. $run_once = 0; if ($_POST) { foreach ($_POST as $key_a => $value_a) { olc_db_connect(); $query = SQL_UPDATE . TABLE_PRODUCTS_XSELL . " SET sort_order = '" . $value_a . "' WHERE xsell_id= '{$key_a}' "; if ($value_a != 'Update') { if (!olc_db_query($query)) { exit('Could not SQL_UPDATE DB'); } else { if ($run_once == 0) { echo '<b class=\'main\'>Cross-sells updated <a href="' . olc_href_link(FILENAME_XSELL_PRODUCTS, '', NONSSL) . '">Back to cross-sell admin</a></b><br/>' . NEW_LINE; $run_once++; } } } } } // end of foreach. //////////////////////////////////////////////////////////////////////////////////
} $sql_start_content_size = sizeof($sql_start_content); $max_key_len = 0; $sql_start_content_len = array(); for ($i = 0; $i < $sql_start_content_size; $i++) { $key_len = strlen($sql_start_content[$i]); $sql_start_content_len[] = $key_len; $max_key_len = max($max_key_len, $key_len); } $log = EMPTY_STRING; $sql_command = EMPTY_STRING; $collect_sql_statement = false; $not_collect_sql_statement = true; if (IS_LOCAL_HOST) { olc_db_close(); $link = olc_db_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, 'olc_test'); } $quote = '"'; $ellipses = $quote . '...'; $filename_1 = $filename . '.log'; @unlink($filename_1); $fl = @fopen($filename_1, 'w'); $last_table_name = EMPTY_STRING; $have_log = false; while ($line = fgets($fp)) { if ($not_collect_sql_statement) { if (strlen($line) > 3) { $char1 = substr(ltrim($line), 0, 1); if (strpos(COMMENTS, $char1) === false) { $line_sub = substr($line, 0, $key_len); for ($i = 0; $i < $sql_start_content_size; $i++) {
Released under the GNU General Public License --------------------------------------------------------------------------------------- */ define('PHP', '.php'); define('INC_PHP', '.inc.php'); include 'includes/configure.php'; include 'inc/olc_get_template.inc.php'; $current_template = olc_get_template(true); // include needed functions require_once DIR_FS_INC . 'olc_db_connect.inc.php'; require_once DIR_FS_INC . 'olc_db_fetch_array.inc.php'; require_once DIR_FS_INC . 'olc_db_query.inc.php'; require_once DIR_FS_INC . 'olc_smarty_init.inc.php'; define('MULTI_DB_SERVER', false); // make a connection to the database... now olc_db_connect() or die('Kann keine Verbindung zur Datenbank erhalten!'); // set the application parameters $configuration_query = olc_db_query("select configuration_key, configuration_value from " . TABLE_PREFIX . "configuration where configuration_key='CURRENT_TEMPLATE'"); $configuration = olc_db_fetch_array($configuration_query); define($configuration['configuration_key'], $configuration['configuration_value']); define('IS_ADMIN_FUNCTION', strpos($_SERVER['REQUEST_URI'], 'admin/') > 0); //define('FULL_CURRENT_TEMPLATE',$configuration_query); define("USE_AJAX", false); //Do not use AJAX define("NOT_USE_AJAX", true); define("IS_AJAX_PROCESSING", false); define("NOT_IS_AJAX_PROCESSING", true); // Include Template Engine require_once DIR_WS_CLASSES . 'smarty/Smarty.class.php'; olc_smarty_init($smarty, $cacheid); $smarty->assign('tpl_path', $smarty->template_dir . '/' . CURRENT_TEMPLATE . '/');
} else { $is_error = true; } } // Check the input variables and decide what to do: if ($is_error) { if (!$image || !$show_original) { //Show an error image: create_error_image(); } } elseif ($use_extended_version) { include 'includes/configure.php'; // Get configuration include DIR_FS_INC . 'olc_db_connect.inc.php'; // make a connection to the database... now olc_db_connect() or die('product_thumb -- Kann keine Verbindung zur Datenbank erhalten!'); include DIR_FS_INC . 'olc_db_query.inc.php'; include DIR_FS_INC . 'olc_db_fetch_array.inc.php'; include DIR_FS_INC . 'olc_db_close.inc.php'; $const = 'PRODUCT_IMAGE_' . $image_origin . '_'; $configuration_query = olc_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_PREFIX . 'configuration' . " WHERE configuration_key LIKE '" . $const . "%'"); while ($configuration = olc_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } $bevel = $const . 'BEVEL'; $drop_shadow = $const . 'DROP_SHADDOW'; $ellipse = $const . 'ELLIPSE'; $frame = $const . 'FRAME'; $greyscale = $const . 'GREYSCALE'; $height = $const . 'HEIGHT'; $merge = $const . 'MERGE';
// define the project version define('PROJECT_VERSION', 'osCommerce 2.2-MS2'); define('IPN_PAYMENT_MODULE_NAME', 'PayPal_Shopping_Cart_IPN'); // set php_self in the local scope if (!isset($PHP_SELF)) { $PHP_SELF = $_SERVER['PHP_SELF']; } // include the list of project filenames require DIR_WS_INCLUDES . 'filenames.php'; // include the list of project database tables require DIR_WS_INCLUDES . 'database_tables.php'; require PAYPAL_IPN_DIR . 'database_tables.inc.php'; // include the database functions require DIR_WS_FUNCTIONS . 'database.php'; // make a connection to the database... now olc_db_connect() or die('Unable to connect to database server!'); // set the application parameters $configuration_query = olc_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = olc_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } // define general functions used application-wide require DIR_WS_FUNCTIONS . 'general.php'; require DIR_WS_FUNCTIONS . 'html_output.php'; // some code to solve compatibility issues require DIR_WS_FUNCTIONS . 'compatibility.php'; // define how the session functions will be used require DIR_WS_FUNCTIONS . 'sessions.php'; // include currencies class and create an instance require DIR_WS_CLASSES . 'currencies.php'; $currencies = new currencies();
$selection .= ", " . $field_name_prkz; } break; case entry_city: $add_state_info = true; default: $error_fatal = true; } $main_content = EMPTY_STRING; if ($error_fatal) { $main_content = "Unzulässige Validierungs-Aktion '" . $action . APOS; } else { require_once DIR_FS_INC . 'olc_db_query.inc.php'; require_once DIR_FS_INC . 'olc_db_connect.inc.php'; // make a connection to the database if (!olc_db_connect()) { //If DB-error just forget about validation echo EMPTY_STRING; exit; } //require_once(DIR_FS_INC.'olc_db_close.inc.php'); require_once DIR_FS_INC . 'olc_db_fetch_array.inc.php'; require_once DIR_FS_INC . 'olc_db_num_rows.inc.php'; $prefix_only = true; require_once DIR_WS_INCLUDES . 'database_tables.php'; $sql_select = "SELECT DISTINCT "; if ($action == $entry_state_text) { require_once DIR_FS_INC . 'olc_parse_input_field_data.inc.php'; $zone_id = 'zone_id'; $zone_name = 'zone_name'; $db_data_query = olc_db_query($sql_select . $zone_id . COMMA . $zone_name . SQL_FROM . TABLE_PREFIX_COMMON . 'zones' . " where zone_country_id = '" . $current_value . "' order by " . $zone_name);
function olc_connect_and_get_config($configuration_groups, $admin_path_prefix) { global $connected; if (!$connected) { global $prefix_only; // include the list of project database tables require $admin_path_prefix . DIR_WS_INCLUDES . 'database_tables.php'; require_once DIR_FS_INC . 'olc_db_connect.inc.php'; require_once DIR_FS_INC . 'olc_db_error.inc.php'; require_once DIR_FS_INC . 'olc_db_fetch_array.inc.php'; require_once DIR_FS_INC . 'olc_db_input.inc.php'; require_once DIR_FS_INC . 'olc_db_insert_id.inc.php'; require_once DIR_FS_INC . 'olc_db_data_seek.inc.php'; require_once DIR_FS_INC . 'olc_db_num_rows.inc.php'; require_once DIR_FS_INC . 'olc_db_query.inc.php'; require_once DIR_FS_INC . 'olc_db_close.inc.php'; require_once DIR_FS_INC . 'olc_db_prepare_input.inc.php'; require_once DIR_FS_INC . 'olc_db_perform.inc.php'; require_once DIR_FS_INC . 'olc_db_free_result.inc.php'; require_once DIR_FS_INC . 'olc_db_close.inc.php'; require_once DIR_FS_INC . 'olc_db_output.inc.php'; require_once DIR_FS_INC . 'olc_db_input.inc.php'; require_once DIR_FS_INC . 'olc_db_prepare_input.inc.php'; require_once DIR_FS_INC . 'olc_not_null.inc.php'; include_once DIR_FS_INC . 'olc_error_handler.inc.php'; // make a connection to the database //Multiple DB-servers are not supported (yet!), only multiple DBs on the same server //define('MULTI_DB_SERVER',defined('DB_SERVER_1')); define('MULTI_DB_SERVER', false); $db_connect_error = 'Kann keine Verbindung zur Datenbank "%s" herstellen!/Can not connect to database "%s"!'; if (MULTI_DB_SERVER) { include_once DIR_FS_INC . 'olc_db_get_db_link.inc.php'; ${$link_1} = olc_db_connect(DB_SERVER_1, DB_SERVER_USERNAME_1, DB_SERVER_PASSWORD_1, DB_DATABASE_1, 'db_link_1') or die(sprintf($db_connect_error, DB_DATABASE_1, DB_DATABASE_1)); } olc_db_connect() or die(sprintf($db_connect_error, DB_DATABASE, DB_DATABASE)); } global $current_template_text, $current_template_db; // set the application parameters $where = EMPTY_STRING; for ($i = 0, $n = sizeof($configuration_groups); $i < $n; $i++) { if ($i > 0) { $where .= SQL_OR; } $where .= 'configuration_group_id=' . $configuration_groups[$i]; } if ($n > 0) { $where = SQL_WHERE . $where; } $configuration_text = 'configuration'; $configuration_u_text = $configuration_text . UNDERSCORE; $configuration_value_text = $configuration_u_text . 'value'; $configuration_key_text = $configuration_u_text . 'key'; $select = SELECT . $configuration_key_text . COMMA_BLANK; $table = TABLE_PREFIX_INDIVIDUAL . $configuration_text; $from = SQL_FROM . $table; $configuration_query = olc_db_query($select . $configuration_value_text . $from . $where); while ($configuration = olc_db_fetch_array($configuration_query)) { $s = $configuration[$configuration_key_text]; $s1 = $configuration[$configuration_value_text]; if ($s != $current_template_text) { define($s, $s1); } else { $current_template_db = $s1; } } $key = 'olc_CONVERSION_DONE'; if (!defined($key)) { //Adjust "use"- and "set"-function-names form "olc_..." to "olc_"... $use_function_text = 'use_function'; $set_function_text = 'set_function'; $olc_text = 'olc_'; $olc_text = 'olc_'; $configuration_query = olc_db_query($select . $configuration_value_text . COMMA_BLANK . $use_function_text . COMMA_BLANK . $set_function_text . $from . $where); while ($configuration = olc_db_fetch_array($configuration_query)) { $s = $configuration[$use_function_text]; $s1 = $configuration[$set_function_text]; $sql_array = array(); if ($s) { $sql_array[$use_function_text] = str_replace($olc_text, $olc_text, $s); } if ($s1) { $sql_array[$set_function_text] = str_replace($olc_text, $olc_text, $s1); } if (sizeof($sql_array) > 0) { olc_db_perform($table, $sql_array, UPDATE, $configuration_key_text . EQUAL . APOS . $configuration[$configuration_key_text] . APOS); } } $sql_array = array($configuration_key_text => $key, $configuration_value_text => true); olc_db_perform($table, $sql_array); } define('DO_GROUP_CHECK', GROUP_CHECK == TRUE_STRING_S); define('DO_IMAGE_ON_THE_FLY', PRODUCT_IMAGE_ON_THE_FLY == TRUE_STRING_S); define('CURRENT_SCRIPT', basename($_SERVER['PHP_SELF'])); define('USE_CACHE', false); //Force Smarty cache off (this is a heap of crap!) }