Execute("delete from " . TABLE_ADMIN_ACTIVITY_LOG); $db->Execute("optimize table " . TABLE_ADMIN_ACTIVITY_LOG); $messageStack->add_session(SUCCESS_CLEAN_ADMIN_ACTIVITY_LOG, 'success'); unset($_SESSION['reset_admin_activity_log']); zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; // update all products in catalog case ('update_all_products_attributes_sort_order'): $all_products_attributes= $db->Execute("select p.products_id, pa.products_attributes_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa " . " where p.products_id= pa.products_id" ); while (!$all_products_attributes->EOF) { $count++; $product_id_updated .= ' - ' . $all_products_attributes->fields['products_id'] . ':' . $all_products_attributes->fields['products_attributes_id']; zen_update_attributes_products_option_values_sort_order($all_products_attributes->fields['products_id']); $all_products_attributes->MoveNext(); } $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT_ALL, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('update_all_products_price_sorter'): // reset products_price_sorter for searches etc. $sql = "select products_id from " . TABLE_PRODUCTS; $update_prices = $db->Execute($sql); while (!$update_prices->EOF) { zen_update_products_price_sorter($update_prices->fields['products_id']); $update_prices->MoveNext(); } $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_PRODUCTS_PRICE_SORTER, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('update_all_products_viewed'): // reset products_viewed to 0 $sql = "update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed= '0'"; $update_viewed = $db->Execute($sql); $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_PRODUCTS_VIEWED, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('update_all_products_ordered'): // reset products_ordered to 0 $sql = "update " . TABLE_PRODUCTS . " set products_ordered= '0'"; $update_viewed = $db->Execute($sql); $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_PRODUCTS_ORDERED, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('update_counter'): // reset products_viewed to 0 $sql = "update " . TABLE_COUNTER . " set counter= '" . (int)$_POST['new_counter'] . "'"; $update_counter = $db->Execute($sql); $messageStack->add_session(SUCCESS_UPDATE_COUNTER . (int)$_POST['new_counter'], 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('optimize_db'): // clean out unused space in database $sql = "SHOW TABLE STATUS FROM " . DB_DATABASE; $tables = $db->Execute($sql); while(!$tables->EOF) { $db->Execute("OPTIMIZE TABLE " . $tables->fields['Name']); $i++; $tables->MoveNext(); } $messageStack->add_session(SUCCESS_DB_OPTIMIZE . ' ' . $i, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('update_all_master_categories_id'): // reset products master categories ID $sql = "select products_id from " . TABLE_PRODUCTS; $check_products = $db->Execute($sql); while (!$check_products->EOF) { $sql = "select products_id, categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id='" . $check_products->fields['products_id'] . "'"; $check_category = $db->Execute($sql); $sql = "update " . TABLE_PRODUCTS . " set master_categories_id='" . $check_category->fields['categories_id'] . "' where products_id='" . $check_products->fields['products_id'] . "'"; $update_viewed = $db->Execute($sql); $check_products->MoveNext(); } $messageStack->add_session(SUCCESS_UPDATE_ALL_MASTER_CATEGORIES_ID, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break; case ('update_orders_id'): $old_orders_id = zen_db_prepare_input((int)$_POST['old_orders_id']); $new_orders_id = zen_db_prepare_input((int)$_POST['new_orders_id']); $db->Execute("update " . TABLE_ORDERS . " set orders_id='" . $new_orders_id . "' where orders_id='" . $old_orders_id . "'"); $db->Execute("update " . TABLE_ORDERS_PRODUCTS . " set orders_id='" . $new_orders_id . "' where orders_id='" . $old_orders_id . "'"); $db->Execute("update " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set orders_id='" . $new_orders_id . "' where orders_id='" . $old_orders_id . "'"); $db->Execute("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set orders_id='" . $new_orders_id . "' where orders_id='" . $old_orders_id . "'"); $db->Execute("update " . TABLE_ORDERS_STATUS_HISTORY . " set orders_id='" . $new_orders_id . "' where orders_id='" . $old_orders_id . "'"); $db->Execute("update " . TABLE_ORDERS_TOTAL . " set orders_id='" . $new_orders_id . "' where orders_id='" . $old_orders_id . "'"); break; case ('locate_configuration'): if ($_POST['configuration_key'] == '') { $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution'); zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); } $found = 'false'; $language_files_group = $_POST['language_files']; // build filenames to search switch ($language_files_group) { case (0): // none $filename_listing = ''; break; case (1): // all english.php files $check_directory = array(); $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $template_dir . '/' . $_SESSION['language'] . '/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/extra_definitions/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/extra_definitions/' . $template_dir . '/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/payment/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/shipping/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/order_total/'; $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/product_types/'; $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/'; $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/newsletters/'; break; case (2): // all catalog /language/*.php $check_directory = array(); $check_directory[] = DIR_FS_CATALOG_LANGUAGES; break; case (3): // all catalog /language/english/*.php $check_directory = array(); $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/'; break; case (4): // all admin /language/*.php $check_directory = array(); $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES; break; case (5): // all admin /language/english/*.php // set directories and files names $check_directory = array(); $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/'; break; } // eof: switch // Check for new databases and filename in extra_datafiles directory for ($i = 0, $n = sizeof($check_directory); $i < $n; $i++) { //echo 'I SEE ' . $check_directory[$i] . '
'; $dir_check = $check_directory[$i]; $file_extension = '.php'; if ($dir = @dir($dir_check)) { while ($file = $dir->read()) { if (!is_dir($dir_check . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { $directory_array[] = $dir_check . $file; } } } if (sizeof($directory_array)) { sort($directory_array); } $dir->close(); } } // show path and filename echo '' . "\n"; echo ''; echo '
 
' . '     ' . 'Searching ' . sizeof($directory_array) . ' files ...' . '
' . "\n\n"; echo ' '; // check all files located $file_cnt = 0; for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) { // build file content of matching lines $file_cnt++; $file = $directory_array[$i]; $show_file = ''; if (file_exists($file)) { $show_file .= "\n" . ''; $show_file .= '
' . "\n"; $show_file .= '
'; $show_file .= '' . $file . ''; $show_file .= '
'; // put file into an array to be scanned $lines = file($file); $found_line = 'false'; // loop through the array, show line and line numbers foreach ($lines as $line_num => $line) { $cnt_lines++; if (strstr(strtoupper($line), strtoupper($configuration_key_lookup))) { $found_line= 'true'; $found = 'true'; $show_file .= "
Line #{$line_num} : " . htmlspecialchars($line) . "
\n"; } else { if ($cnt_lines >= 5) { // $show_file .= ' .'; $cnt_lines=0; } } } } $show_file .= '
' . "\n"; // if there was a match, show lines if ($found_line == 'true') { echo $show_file . '
 
'; } // show file } $show_products_type_layout = 'false'; $show_configuration_info = 'false'; // if no matches in either databases or selected language directory give an error if ($found == 'false') { $messageStack->add(ERROR_CONFIGURATION_KEY_NOT_FOUND . ' ' . $_POST['configuration_key'], 'caution'); } else { echo '
' . zen_draw_separator('pixel_black.gif', '100%', '2') . '
 
' . "\n"; } break; //////////////////////////////////////////////// case ('locate_configuration_key'): if ($_POST['configuration_key'] == '') { $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution'); zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); } $found = 'false'; $language_files_group = $_POST['language_files']; $check_configure = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key='" . $_POST['configuration_key'] . "'"); if ($check_configure->RecordCount() < 1) { $check_configure = $db->Execute("select * from " . TABLE_PRODUCT_TYPE_LAYOUT . " where configuration_key='" . $_POST['configuration_key'] . "'"); if ($check_configure->RecordCount() < 1) { } else { $show_products_type_layout = 'true'; $show_configuration_info = 'true'; $found = 'true'; } } else { $show_products_type_layout = 'false'; $show_configuration_info = 'true'; $found = 'true'; } // if no matches in either databases or selected language directory give an error if ($found == 'false') { $messageStack->add(ERROR_CONFIGURATION_KEY_NOT_FOUND . ' ' . $_POST['configuration_key'], 'caution'); } else { echo '
' . zen_draw_separator('pixel_black.gif', '100%', '2') . '
 
' . "\n"; } break; /////////////////////////////////////////// } // eof: action ?> > <?php echo TITLE; ?>
Execute("select * from " . TABLE_PRODUCT_TYPES . " where type_id='" . $check_configure->fields['product_type_id'] . "'"); } else { $check_configure_group = $db->Execute("select * from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id='" . $check_configure->fields['configuration_group_id'] . "'"); } ?>
fields['configuration_key']; ?>
fields['configuration_title']; ?>
fields['configuration_description']; ?>
fields['configuration_value']; ?>
fields['configuration_group_id'] == '6') { $id_note = TEXT_INFO_CONFIGURATION_HIDDEN; } else { $id_note = ''; } echo 'ID#' . $check_configure_group->fields['configuration_group_id'] . ' ' . $check_configure_group->fields['configuration_group_title'] . $id_note; ?>
fields['configuration_id'] != 0 and $check_configure->fields['configuration_group_id'] != 6)) { echo '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ''; } else { $page= ''; if (strstr($check_configure->fields['configuration_key'], 'MODULE_SHIPPING')) $page .= 'shipping'; if (strstr($check_configure->fields['configuration_key'], 'MODULE_PAYMENT')) $page .= 'payment'; if (strstr($check_configure->fields['configuration_key'], 'MODULE_ORDER_TOTAL')) $page .= 'ordertotal'; if ($show_products_type_layout == 'true') { echo '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ''; } else { if ($page != '') { echo '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ''; } else { echo TEXT_INFO_NO_EDIT_AVAILABLE . '
'; } } } ?>
' . zen_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>

align="left" valign="top"> ' . zen_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>

' . zen_image_button('button_update.gif', IMAGE_UPDATE) . ''; ?>

' . zen_image_button('button_update.gif', IMAGE_UPDATE) . ''; ?>


' . zen_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>

' . zen_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>

' . zen_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>



' . TEXT_CONFIGURATION_KEY . '' . '
' . zen_draw_input_field('configuration_key'); ?>
 

' . TEXT_CONFIGURATION_KEY_FILES . '' . '
' . zen_draw_input_field('configuration_key'); ?>
'0', 'text' => TEXT_LANGUAGE_LOOKUP_NONE), array('id' => '1', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_LANGUAGE), array('id' => '2', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_CATALOG), array('id' => '3', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_CATALOG_TEMPLATE), array('id' => '4', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ADMIN), array('id' => '5', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ADMIN_LANGUAGE) ); // array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL) echo '' . TEXT_LANGUAGE_LOOKUPS . '' . '
' . zen_draw_pull_down_menu('language_files', $language_lookup, '0'); ?>


' . zen_image_button('button_confirm.gif', IMAGE_UPDATE) . ''; ?>
' . zen_draw_separator('pixel_black.gif', '100%', '2'); ?>