Regular Expressions 101

Save & Share

  • Regex Version: ver. 1
  • Update Regex
    ctrl+⇧+s
  • Save new Regex
    ctrl+s
  • Add to Community Library

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
gm

Test String

Code Generator

Generated Code

import java.util.regex.Matcher; import java.util.regex.Pattern; public class Example { public static void main(String[] args) { final String regex = "<\\?[\\s\\S]*?(?:\\z|\\?\\>|[\\\"\\'].*?[\\\"\\'][\\s\\S]*?\\?>)"; final String string = "<?php\n\n" + "global $groupcnt;\n\n" + "require('includes/application_top.php');\n" + "require('includes/functions/categories_description.php');\n" + "require(DIR_WS_CLASSES . 'file_select.php');\n" + "require(DIR_WS_CLASSES . 'currencies.php');\n" + "$currencies = new currencies();\n\n" + "// RCI code start\n" + "echo $cre_RCI->get('global', 'top', false);\n" + "echo $cre_RCI->get('categories', 'top', false); \n" + "// RCI code eof \n" + " \n" + "//intilize varibles\n" + "$groupcnt = 0; \n" + "$categories_id = '';\n" + "$Push = '';\n" + "$categories_image = '';\n" + "$category_template_id = '';\n" + "$categories_previous_image = '';\n" + "$extra_field = '';\n" + "$parent_name = '';\n\n" + "// array used by the DirSelect class\n" + "$ImageLocations['base_dir'] = DIR_FS_CATALOG_IMAGES;\n" + "$ImageLocations['base_url'] = DIR_WS_CATALOG_IMAGES; \n\n" + "// POST GET compatibility\n" + "if (isset($_GET['cID'])) {\n" + " $cID = $_GET['cID'] ;\n" + "} else if (isset($_POST['cID'])) {\n" + " $cID = $_POST['cID'] ;\n" + "} else {\n" + " $cID = '' ;\n" + "}\n" + "if (isset($_GET['pID'])) {\n" + " $pID = $_GET['pID'] ;\n" + "} else if (isset($_POST['pID'])) {\n" + " $pID = $_POST['pID'] ;\n" + "} else {\n" + " $pID = '' ;\n" + "}\n" + "if (isset($_GET['cPath'])) {\n" + " $cPath = $_GET['cPath'] ;\n" + "} else if (isset($_POST['cPath'])) {\n" + " $cPath = $_POST['cPath'] ;\n" + "} else {\n" + " $cPath = '' ;\n" + "}\n" + "if (isset($_GET['action'])) {\n" + " $action = $_GET['action'] ;\n" + "} else if (isset($_POST['action'])) {\n" + " $action = $_POST['action'] ;\n" + " } else {\n" + " $action = '' ;\n" + "}\n" + "if (tep_not_null($action)) {\n" + " switch ($action) {\n" + " case 'sort':\n" + " if (isset($_POST['c_sort_order']) && is_array($_POST['c_sort_order'])) {\n" + " foreach ($_POST['c_sort_order'] as $key => $value) {\n" + " tep_db_query(\"UPDATE \" . TABLE_CATEGORIES . \" SET sort_order = '\" . $value . \"' WHERE categories_id = '\" . $key . \"'\");\n" + " }\n" + " }\n" + " if (isset($_POST['sort_order']) && is_array($_POST['sort_order'])) {\n" + " foreach ($_POST['sort_order'] as $key => $value) {\n" + " tep_db_query(\"UPDATE \" . TABLE_PRODUCTS . \" SET sort_order = '\" . $value . \"' WHERE products_id = '\" . $key . \"'\");\n" + " }\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, tep_get_all_get_params(array('action'))));\n" + " break;\n" + " \n" + " case 'setflag':\n" + " if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {\n" + " if (isset($pID)) {\n" + " tep_set_product_status($pID, $_GET['flag']);\n" + " }\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pID));\n" + " break;\n" + " \n" + " case 'insert_category':\n" + " case 'update_category':\n" + " if (isset($_POST[IMAGE_BACK]) || !isset($_POST['sort_order'])) {\n" + " $action = 'edit_category';\n" + " } else {\n" + " if (isset($_POST['categories_id'])) $categories_id = tep_db_prepare_input($_POST['categories_id']);\n" + " if ($categories_id == '') {\n" + " $categories_id = tep_db_prepare_input($_GET['cID']);\n" + " }\n" + " $sort_order = tep_db_prepare_input($_POST['sort_order']);\n" + " $categories_image = tep_db_prepare_input($_POST['categories_image']);\n" + " $sql_data_array = array('sort_order' => $sort_order);\n" + " $customergroupid = \"\";\n" + " if (isset($_POST['products_group_access'])) {\n" + " foreach ($_POST['products_group_access'] as $value) {\n" + " $customergroupid .= $value . ',';\n" + " }\n" + " }\n" + " $customergroupid = substr($customergroupid,0,(strlen($customergroupid)-1));\n" + " $sql_data_array['products_group_access'] = $customergroupid;\n" + " $customergroupid_nav_access = \"\";\n" + " if (isset($_POST['products_nav_access'])) {\n" + " foreach ($_POST['products_nav_access'] as $value) {\n" + " $customergroupid_nav_access .= $value . ',';\n" + " }\n" + " }\n" + " $customergroupid_nav_access = substr($customergroupid_nav_access,0,(strlen($customergroupid_nav_access)-1));\n" + " $sql_data_array['products_nav_access'] = $customergroupid_nav_access;\n" + " \n" + " if ($action == 'insert_category') {\n" + " $insert_sql_data = array('parent_id' => $current_category_id,\n" + " 'date_added' => 'now()');\n" + " $sql_data_array = array_merge($sql_data_array, $insert_sql_data);\n" + " tep_db_perform(TABLE_CATEGORIES, $sql_data_array);\n" + " $categories_id = tep_db_insert_id();\n" + " } elseif ($action == 'update_category') {\n" + " $update_sql_data = array('last_modified' => 'now()');\n" + " $sql_data_array = array_merge($sql_data_array, $update_sql_data);\n" + " tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', \"categories_id = '\" . (int)$categories_id . \"'\");\n" + " if (isset($_POST['Push'])) {\n" + " if($_POST['Push'] == 2) {\n" + " readChild($categories_id,$customergroupid,\"C\");\n" + " }\n" + " if ($_POST['Push'] == 3) {\n" + " readChild($categories_id,$customergroupid,\"CP\");\n" + " }\n" + " }\n" + " }\n" + " $languages = tep_get_languages();\n" + " for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n" + " $language_id = $languages[$i]['id'];\n" + " $sql_data_array = array('categories_name' => tep_db_prepare_input(tep_db_encoder($_POST['categories_name'][$language_id])),\n" + " 'categories_heading_title' => tep_db_prepare_input(tep_db_encoder($_POST['categories_heading_title'][$language_id])),\n" + " 'categories_description' => tep_db_prepare_input(tep_db_encoder($_POST['categories_description'][$language_id])),\n" + " 'categories_head_title_tag' => tep_db_prepare_input(tep_db_encoder($_POST['categories_head_title_tag'][$language_id])),\n" + " 'categories_head_desc_tag' => tep_db_prepare_input(tep_db_encoder($_POST['categories_head_desc_tag'][$language_id])),\n" + " 'categories_head_keywords_tag' => tep_db_prepare_input(tep_db_encoder($_POST['categories_head_keywords_tag'][$language_id]))\n" + " );\n" + " \n" + " if ($action == 'insert_category') {\n" + " $insert_sql_data = array('categories_id' => $categories_id,\n" + " 'language_id' => $languages[$i]['id']);\n" + " $sql_data_array = array_merge($sql_data_array, $insert_sql_data);\n" + " tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);\n" + " } elseif ($action == 'update_category') {\n" + " tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', \"categories_id = '\" . (int)$categories_id . \"' and language_id = '\" . (int)$languages[$i]['id'] . \"'\");\n" + " }\n" + " }\n" + " if ( ( (isset($_POST['unlink_cat_image'])) && ($_POST['unlink_cat_image'] == 'yes') ) ||\n" + " ( (isset($_POST['delete_cat_image'])) && ($_POST['delete_cat_image'] == 'yes')) ) {\n" + " tep_db_query(\"update \" . TABLE_CATEGORIES . \" set categories_image = '' where categories_id = '\" . (int)$categories_id . \"'\");\n" + " } else {\n" + " if (isset($_POST['categories_image_name'])) {\n" + " tep_db_query(\"update \" . TABLE_CATEGORIES . \" set categories_image = '\" . tep_db_input($_POST['categories_image_name']) . \"' where categories_id = '\" . (int)$categories_id . \"'\");\n" + " }\n" + " }\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));\n" + " }\n" + " break;\n" + " \n" + " case 'delete_category_confirm':\n" + " if (isset($_POST['categories_id'])) {\n" + " $categories_id = tep_db_prepare_input($_POST['categories_id']);\n" + " $categories = tep_get_category_tree($categories_id, '', '0', '', true);\n" + " $products = array();\n" + " $products_delete = array();\n" + " for ($i=0, $n=sizeof($categories); $i<$n; $i++) {\n" + " $product_ids_query = tep_db_query(\"select products_id from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where categories_id = '\" . (int)$categories[$i]['id'] . \"'\");\n" + " while ($product_ids = tep_db_fetch_array($product_ids_query)) {\n" + " $products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];\n" + " }\n" + " }\n" + " reset($products);\n" + " while (list($key, $value) = each($products)) {\n" + " $category_ids = '';\n" + " for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {\n" + " $category_ids .= \"'\" . (int)$value['categories'][$i] . \"', \";\n" + " }\n" + " $category_ids = substr($category_ids, 0, -2);\n" + " $check_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$key . \"' and categories_id not in (\" . $category_ids . \")\");\n" + " $check = tep_db_fetch_array($check_query);\n" + " if ($check['total'] < '1') {\n" + " $products_delete[$key] = $key;\n" + " }\n" + " }\n" + " tep_set_time_limit(0);\n" + " for ($i=0, $n=sizeof($categories); $i<$n; $i++) {\n" + " tep_remove_category($categories[$i]['id']);\n" + " }\n" + " reset($products_delete);\n" + " while (list($key) = each($products_delete)) {\n" + " tep_remove_product($key);\n" + " }\n" + " }\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));\n" + " break;\n" + " \n" + " case 'delete_product_confirm':\n" + " if (isset($_POST['products_id']) && isset($_POST['product_categories']) && is_array($_POST['product_categories'])) {\n" + " $product_id = tep_db_prepare_input($_POST['products_id']);\n" + " $product_categories = $_POST['product_categories'];\n" + " // sub products\n" + " $sub_products_query = tep_db_query(\"select products_id from \" . TABLE_PRODUCTS . \" where products_parent_id = '\" . tep_db_input($product_id) . \"'\");\n" + " while ($sub_products = tep_db_fetch_array($sub_products_query)) {\n" + " for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {\n" + " tep_db_query(\"delete from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . tep_db_input($sub_products['products_id']) . \"' and categories_id = '\" . (int)$product_categories[$i] . \"'\");\n" + " }\n" + " $product_categories_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$sub_products['products_id'] . \"'\");\n" + " $product_categories1 = tep_db_fetch_array($product_categories_query);\n" + " if ($product_categories1['total'] == '0') {\n" + " tep_db_query(\"delete from \" . TABLE_PRODUCTS_DESCRIPTION . \" where products_id = '\" . tep_db_input($sub_products['products_id']) . \"'\");\n" + " tep_db_query(\"delete from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . tep_db_input($sub_products['products_id']) . \"'\");\n" + " tep_db_query(\"delete from \" . TABLE_PRODUCTS_XSELL . \" where products_id = '\" . tep_db_input($sub_products['products_id']) . \"'\");\n" + " tep_db_query(\"delete from \" . TABLE_SPECIALS . \" where products_id = '\" . tep_db_input($sub_products['products_id']) . \"'\");\n" + " tep_db_query(\"delete from \" . TABLE_PRODUCTS . \" where products_id = '\" . tep_db_input($sub_products['products_id']) . \"'\");\n" + " }\n" + " }\n" + " // sub products eof\n" + " for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {\n" + " tep_db_query(\"delete from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$product_id . \"' and categories_id = '\" . (int)$product_categories[$i] . \"'\");\n" + " }\n" + " $product_categories_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$product_id . \"'\");\n" + " $product_categories = tep_db_fetch_array($product_categories_query);\n" + " if ($product_categories['total'] == '0') {\n" + " tep_remove_product($product_id);\n" + " }\n" + " }\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));\n" + " break;\n" + " \n" + " case 'move_category_confirm':\n" + " if (isset($_POST['categories_id']) && ($_POST['categories_id'] != $_POST['move_to_category_id'])) {\n" + " $categories_id = tep_db_prepare_input($_POST['categories_id']);\n" + " $new_parent_id = tep_db_prepare_input($_POST['move_to_category_id']);\n" + " $path = explode('_', tep_get_generated_category_path_ids($new_parent_id));\n" + " if (in_array($categories_id, $path)) {\n" + " $messageStack->add_session('search', ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));\n" + " } else {\n" + " tep_db_query(\"update \" . TABLE_CATEGORIES . \" set parent_id = '\" . (int)$new_parent_id . \"', last_modified = now() where categories_id = '\" . (int)$categories_id . \"'\");\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&cID=' . $categories_id));\n" + " }\n" + " }\n" + " break;\n" + " \n" + " case 'move_product_confirm':\n" + " $products_id = tep_db_prepare_input($_POST['products_id']);\n" + " $new_parent_id = tep_db_prepare_input($_POST['move_to_category_id']);\n" + " $duplicate_check_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$products_id . \"' and categories_id = '\" . (int)$new_parent_id . \"'\");\n" + " $duplicate_check = tep_db_fetch_array($duplicate_check_query);\n" + " if ($duplicate_check['total'] < 1) tep_db_query(\"update \" . TABLE_PRODUCTS_TO_CATEGORIES . \" set categories_id = '\" . (int)$new_parent_id . \"' where products_id = '\" . (int)$products_id . \"' and categories_id = '\" . (int)$current_category_id . \"'\");\n" + " // sub products\n" + " $sub_products_query = tep_db_query(\"select products_id from \" . TABLE_PRODUCTS . \" where products_parent_id = '\" . (int)$products_id . \"'\");\n" + " while ($sub_products = tep_db_fetch_array($sub_products_query)) {\n" + " $duplicate_check_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . $sub_products['products_id'] . \"' and categories_id = '\" . $new_parent_id . \"'\");\n" + " $duplicate_check = tep_db_fetch_array($duplicate_check_query);\n" + " if ($duplicate_check['total'] < 1) tep_db_query(\"update \" . TABLE_PRODUCTS_TO_CATEGORIES . \" set categories_id = '\" . (int)$new_parent_id . \"' where products_id = '\" . (int)$sub_products['products_id'] . \"' and categories_id = '\" . (int)$current_category_id . \"'\");\n" + " }\n" + " // sub products eof\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&pID=' . $products_id));\n" + " break;\n" + " \n" + " case 'create_copy_product_attributes':\n" + " $copy_to_products_id = (int)$_POST['copy_to_products_id'];\n" + " tep_copy_products_attributes($pID,$copy_to_products_id);\n" + " break;\n" + " \n" + " case 'create_copy_product_attributes_categories':\n" + " $categories_products_copying_query= tep_db_query(\"select products_id from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where categories_id='\" . $cID . \"'\");\n" + " while ( $categories_products_copying=tep_db_fetch_array($categories_products_copying_query) ) {\n" + " // process all products in category\n" + " tep_copy_products_attributes($make_copy_from_products_id,$categories_products_copying['products_id']);\n" + " }\n" + " break;\n" + " \n" + " case 'update_product':\n" + " $languages = tep_get_languages();\n" + " $products_id = (int)$_GET['pID'];\n" + " // get the current product data so we can compare it later to see what has changed\n" + " $products_old_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS . \" WHERE products_id = \" . $products_id);\n" + " $products_old = tep_db_fetch_array($products_old_query);\n" + " $isSubProduct = false;\n" + " if ($products_old['products_parent_id'] > 0) $isSubProduct = true;\n" + " $products_description_old_query = tep_db_query(\"SELECT language_id, products_name, products_blurb, products_description, products_url, products_viewed, \n" + " products_head_title_tag, products_head_desc_tag, products_head_keywords_tag\n" + " FROM \" . TABLE_PRODUCTS_DESCRIPTION . \"\n" + " WHERE products_id = \" . $products_id);\n" + " $products_description_old = array();\n" + " while ($description_old = tep_db_fetch_array($products_description_old_query)) {\n" + " $products_description_old[$description_old['language_id']] = array('products_name' => $description_old['products_name'],\n" + " 'products_blurb' => $description_old['products_blurb'], \n" + " 'products_description' => $description_old['products_description'],\n" + " 'products_url' => $description_old['products_url'],\n" + " 'products_viewed' => $description_old['products_viewed'], \n" + " 'products_head_title_tag' => $description_old['products_head_title_tag'],\n" + " 'products_head_desc_tag' => $description_old['products_head_desc_tag'],\n" + " 'products_head_keywords_tag' => $description_old['products_head_keywords_tag']\n" + " );\n" + " }\n" + " unset($products_old_query);\n" + " unset($products_description_old_query);\n" + " unset($description_old);\n" + " \n" + " $sql_data_array = array(); //declare the array and add to it anything changed\n" + " $products_date_available = tep_db_prepare_input($_POST['products_date_available']);\n" + " if ($products_date_available != $products_old['products_date_available']) $sql_data_array['products_date_available'] = $products_date_available;\n" + " $products_quantity = tep_db_prepare_input($_POST['products_quantity']);\n" + " if ($products_quantity != $products_old['products_quantity']) $sql_data_array['products_quantity'] = $products_quantity;\n" + " $products_model = tep_db_prepare_input(tep_db_encoder($_POST['products_model']));\n" + " if ($products_model != $products_old['products_model']) $sql_data_array['products_model'] = $products_model;\n" + " $products_price = tep_db_prepare_input($_POST['products_price']);\n" + " if ($products_price != $products_old['products_price']) $sql_data_array['products_price'] = $products_price;\n" + " $products_weight = isset($_POST['products_weight']) ? tep_db_prepare_input($_POST['products_weight']) : 0;\n" + " if ($products_weight != $products_old['products_weight']) $sql_data_array['products_weight'] = $products_weight;\n" + " $products_status = isset($_POST['products_status']) ? tep_db_prepare_input($_POST['products_status']) : 0;\n" + " if ($products_status != $products_old['products_status']) $sql_data_array['products_status'] = $products_status;\n" + " $products_tax_class_id = isset($_POST['products_tax_class_id']) ? tep_db_prepare_input($_POST['products_tax_class_id']) : 0;\n" + " if ($products_tax_class_id != $products_old['products_tax_class_id']) $sql_data_array['products_tax_class_id'] = $products_tax_class_id;\n" + " $manufacturers_id = isset($_POST['manufacturers_id']) ? tep_db_prepare_input($_POST['manufacturers_id']) : 0;\n" + " if ($manufacturers_id != $products_old['manufacturers_id']) $sql_data_array['manufacturers_id'] = $manufacturers_id;\n" + " $sort_order = isset($_POST['sort_order']) ? tep_db_prepare_input($_POST['sort_order']) : 0;\n" + " if ($sort_order != $products_old['sort_order']) $sql_data_array['sort_order'] = $sort_order;\n" + " // multi-vendor shipping\n" + " $vendors_id = isset($_POST['vendors_id']) ? tep_db_prepare_input($_POST['vendors_id']) : 0;\n" + " if ($vendors_id != $products_old['vendors_id']) $sql_data_array['vendors_id'] = $vendors_id;\n" + " $vendors_prod_id = isset($_POST['vendors_prod_id']) ? tep_db_prepare_input($_POST['vendors_prod_id']) : 0;\n" + " if ($vendors_prod_id != $products_old['vendors_prod_id']) $sql_data_array['vendors_prod_id'] = $vendors_prod_id;\n" + " $vendors_prod_comments = isset($_POST['vendors_prod_comments']) ? tep_db_prepare_input($_POST['vendors_prod_comments']) : '';\n" + " if ($vendors_prod_comments != $products_old['vendors_prod_comments']) $sql_data_array['vendors_prod_comments'] = $vendors_prod_comments;\n" + " $vendors_product_price = isset($_POST['vendors_product_price']) ? tep_db_prepare_input($_POST['vendors_product_price']) : '';\n" + " if ($vendors_product_price != $products_old['vendors_product_price']) $sql_data_array['vendors_product_price'] = $vendors_product_price;\n" + " // multi-vendor shipping //eof\n" + " $images = array(array('table' => 'products_image', 'delete' => 'delete_image', 'unlink' => 'unlink_image'),\n" + " array('table' => 'products_image_med', 'delete' => 'delete_image_med', 'unlink' => 'unlink_image_med'),\n" + " array('table' => 'products_image_lrg', 'delete' => 'delete_image_lrg', 'unlink' => 'unlink_image_lrg'),\n" + " array('field' => 'products_image', 'path' => 'file_dir_exist_dest_small', 'file' => 'file_exist_dest_small'),\n" + " array('field' => 'products_image_med', 'path' => 'file_dir_exist_dest_med', 'file' => 'file_exist_dest_med'),\n" + " array('field' => 'products_image_lrg', 'path' => 'file_dir_exist_dest_lrg', 'file' => 'file_exist_dest_lrg'),\n" + " array('table' => 'products_image_sm_1', 'delete' => 'delete_image_sm_1', 'unlink' => 'unlink_image_sm_1'),\n" + " array('table' => 'products_image_xl_1', 'delete' => 'delete_image_xl_1', 'unlink' => 'unlink_image_xl_1'),\n" + " array('table' => 'products_image_sm_2', 'delete' => 'delete_image_sm_2', 'unlink' => 'unlink_image_sm_2'),\n" + " array('table' => 'products_image_xl_2', 'delete' => 'delete_image_xl_2', 'unlink' => 'unlink_image_xl_2'),\n" + " array('table' => 'products_image_sm_3', 'delete' => 'delete_image_sm_3', 'unlink' => 'unlink_image_sm_3'),\n" + " array('table' => 'products_image_xl_3', 'delete' => 'delete_image_xl_3', 'unlink' => 'unlink_image_xl_3'),\n" + " array('table' => 'products_image_sm_4', 'delete' => 'delete_image_sm_4', 'unlink' => 'unlink_image_sm_4'),\n" + " array('table' => 'products_image_xl_4', 'delete' => 'delete_image_xl_4', 'unlink' => 'unlink_image_xl_4'),\n" + " array('table' => 'products_image_sm_5', 'delete' => 'delete_image_sm_5', 'unlink' => 'unlink_image_sm_5'),\n" + " array('table' => 'products_image_xl_5', 'delete' => 'delete_image_xl_5', 'unlink' => 'unlink_image_xl_5'),\n" + " array('table' => 'products_image_sm_6', 'delete' => 'delete_image_sm_6', 'unlink' => 'unlink_image_sm_6'),\n" + " array('table' => 'products_image_xl_6', 'delete' => 'delete_image_xl_6', 'unlink' => 'unlink_image_xl_6')\n" + " );\n" + " foreach ($images as $image) {\n" + " if (isset($_POST[$image['delete']]) && $_POST[$image['delete']] == 'yes' && $products_old[$image['table']] != '') {\n" + " unlink(DIR_FS_CATALOG_IMAGES . $products_old[$image['table']]);\n" + " $sql_data_array[$image['table']] = '';\n" + " } elseif (isset($_POST[$image['unlink']]) && $_POST[$image['unlink']] == 'yes' && $products_old[$image['table']] != '') { \n" + " $sql_data_array[$image['table']] = '';\n" + " } elseif (isset($_FILES[$image['table']]) && tep_not_null($_FILES[$image['table']]['name'])) {\n" + " if (strtolower($_FILES[$image['table']]['name']) != 'none') {\n" + " $uploadFile = DIR_FS_CATALOG_IMAGES . urldecode($_POST[$image['dir']]) . $_FILES[$image['table']]['name'];\n" + " @move_uploaded_file($_FILES[$image['table']]['tmp_name'], $uploadFile);\n" + " if ($_FILES[$image['table']]['name'] != $products_old[$image['table']]) $sql_data_array[$image['table']] = tep_db_prepare_input(urldecode($_POST[$image['dir']]) . $_FILES[$image['table']]['name']);\n" + " } elseif ($products_old[$image['table']] != '') {\n" + " $sql_data_array[$image['table']] = '';\n" + " }\n" + " } elseif(isset($_POST[$image['file']]) && tep_not_null($_POST[$image['file']])) {\n" + " $sql_data_array[$image['field']] = tep_db_prepare_input(rawurldecode($_POST[$image['path']]) . rawurldecode($_POST[$image['file']]));\n" + " } elseif (isset($_POST[$image['table']]) && tep_not_null($_POST[$image['table']])) {\n" + " if (strtolower($_POST[$image['table']]) != 'none') {\n" + " if ($_POST[$image['table']] != $products_old[$image['table']]) $sql_data_array[$image['table']] = tep_db_prepare_input($_POST[$image['table']]);\n" + " } elseif ($products_old[$image['table']] != '') {\n" + " $sql_data_array[$image['table']] = '';\n" + " }\n" + " }\n" + " }\n" + " \n" + " $customergroupid = \"\";\n" + " if (isset($_POST['products_group_access'])) {\n" + " foreach ($_POST['products_group_access'] as $value) {\n" + " $customergroupid .= $value . ',';\n" + " } \n" + " $customergroupid = substr($customergroupid,0,(strlen($customergroupid)-1));\n" + " }\n" + " if ($products_old['products_group_access'] != $customergroupid) $sql_data_array['products_group_access'] = $customergroupid;\n" + " $customergroupid = \"\";\n" + " if (isset($_POST['products_nav_access'])) {\n" + " foreach ($_POST['products_nav_access'] as $value) {\n" + " $customergroupid .= $value . ',';\n" + " }\n" + " $customergroupid = substr($customergroupid,0,(strlen($customergroupid)-1));\n" + " }\n" + " if ($products_old['products_nav_access'] != $customergroupid) $sql_data_array['products_nav_access'] = $customergroupid;\n" + " \n" + " $pricing_array = tep_get_pricing();\n\n" + " for ($i = 1; $i <= 11; ++$i) {\n" + " if ($products_old['products_price'.$i] != $pricing_array[$i]['price']) $sql_data_array['products_price'.$i] = $pricing_array[$i]['price'];\n" + " if ($products_old['products_price'.$i.'_qty'] != $pricing_array[$i]['qty']) $sql_data_array['products_price'.$i.'_qty'] = $pricing_array[$i]['qty'];\n" + " }\n" + " \n" + " if (isset($_POST['products_history']) && $_POST['products_history'] > 0) {\n" + " if ($_POST['products_history_qty'] == 'days') {\n" + " if ($products_old['products_qty_days'] != (int)$_POST['products_history']) $sql_data_array['products_qty_days'] = (int)$_POST['products_history'];\n" + " if ($products_old['products_qty_years'] != 0) $sql_data_array['products_qty_years'] = 0;\n" + " } else {\n" + " if ($products_old['products_qty_days'] != 0) $sql_data_array['products_qty_days'] = 0;\n" + " if ($products_old['products_qty_years'] != (int)$_POST['products_history'])$sql_data_array['products_qty_years'] = (int)$_POST['products_history'];\n" + " }\n" + " }\n" + " \n" + " // check to see if there is anything to actually update in the products table\n" + " if (count($sql_data_array) > 0 ) {\n" + " $sql_data_array['products_last_modified'] = 'now()';\n" + " tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', 'products_id = ' . (int)$products_id);\n" + " }\n" + " \n" + " tep_update_group_pricing($products_id);\n" + " \n" + " // at this point, the processing is different if it is a parent product or a sub product\n" + " // sub products do not have extra fields, do not have sub sub products, and the name handling is different\n" + " // parent products do allow for extra fileds, can have sub products, and the name is simply what is supplied\n" + " if ($isSubProduct) {\n" + " // process the sub products description table data\n" + " for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n" + " $language_id = $languages[$i]['id'];\n" + " $products_name_input = tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id]));\n" + " $parent_name_query = tep_db_query(\"SELECT products_name\n" + " FROM \" . TABLE_PRODUCTS_DESCRIPTION . \"\n" + " WHERE products_id = \" . (int)$products_old['products_parent_id'] . \" and language_id = \" . (int)$language_id);\n" + " $parent_name = tep_db_fetch_array($parent_name_query);\n" + " $products_name = $parent_name['products_name'] . ' - ' . $products_name_input;\n" + " if (!isset($products_description_old[$language_id])) {\n" + " $_POST['products_url'][$language_id] = urldecode($_POST['products_url'][$language_id]);\n" + " if (substr($_POST['products_url'][$language_id], 0, 7) == 'http://') $_POST['products_url'][$language_id] = substr($_POST['products_url'][$language_id], 7);\n" + " $sql_data_array = array('products_name' => $products_name,\n" + " 'products_blurb' => tep_db_prepare_input(tep_db_encoder($_POST['products_blurb'][$language_id])),\n" + " 'products_description' => tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id])),\n" + " 'products_url' => tep_db_prepare_input($_POST['products_url'][$language_id]),\n" + " 'products_head_title_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_title_tag'][$language_id])),\n" + " 'products_head_desc_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_desc_tag'][$language_id])),\n" + " 'products_head_keywords_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_keywords_tag'][$language_id]))\n" + " );\n" + " } else {\n" + " $sql_data_array = array(); //declare the array and add to it anything changed\n" + " $products_name_input = tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id]));\n" + " $parent_name_query = tep_db_query(\"SELECT products_name\n" + " FROM \" . TABLE_PRODUCTS_DESCRIPTION . \"\n" + " WHERE products_id = \" . (int)$products_old['products_parent_id'] . \" and language_id = \" . (int)$language_id);\n" + " $parent_name = tep_db_fetch_array($parent_name_query);\n" + " $products_name = $parent_name['products_name'] . ' - ' . $products_name_input;\n" + " if ($products_description_old[$language_id]['products_name'] != $products_name) {\n" + " $sql_data_array['products_name'] = tep_db_encoder($products_name);\n" + " }\n" + " $products_blurb = tep_db_prepare_input(tep_db_encoder($_POST['products_blurb'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_blurb'] != $products_blurb) $sql_data_array['products_blurb'] = tep_db_encoder($products_blurb);\n" + " $products_description = tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_description'] != $products_description) $sql_data_array['products_description'] = tep_db_encoder($products_description);\n" + " $_POST['products_url'][$language_id] = urldecode($_POST['products_url'][$language_id]);\n" + " if (substr($_POST['products_url'][$language_id], 0, 7) == 'http://') $_POST['products_url'][$language_id] = substr($_POST['products_url'][$language_id], 7);\n" + " $products_url = tep_db_prepare_input($_POST['products_url'][$language_id]);\n" + " if ($products_description_old[$language_id]['products_url'] != $products_url) $sql_data_array['products_url'] = $products_url;\n" + " $products_head_title_tag = tep_db_prepare_input(tep_db_encoder($_POST['products_head_title_tag'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_head_title_tag'] != $products_head_title_tag) $sql_data_array['products_head_title_tag'] = $products_head_title_tag;\n" + " $products_head_desc_tag = tep_db_prepare_input(tep_db_encoder($_POST['products_head_desc_tag'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_head_desc_tag'] != $products_head_desc_tag) $sql_data_array['products_head_desc_tag'] = $products_head_desc_tag;\n" + " $products_head_keywords_tag = tep_db_prepare_input(tep_db_encoder($_POST['products_head_keywords_tag'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_head_keywords_tag'] != $products_head_keywords_tag) $sql_data_array['products_head_keywords_tag'] = $products_head_keywords_tag; \n" + " }\n" + " \n" + " // check to see if there is anything to actually update in the products table\n" + " if (count($sql_data_array) > 0 ) {\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', 'products_id = ' . (int)$products_id . ' and language_id = ' . (int)$language_id);\n" + " }\n" + " }\n" + " \n" + " } else {\n" + " // process the products description table data\n" + " $products_description_parent = array(); // save the name and description for later use in processing sub products\n" + " for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n" + " $language_id = $languages[$i]['id'];\n" + " $products_description_parent[$language_id] = array('products_name' => tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id])),\n" + " 'products_blurb' => tep_db_prepare_input(tep_db_encoder($_POST['products_blurb'][$language_id])), \n" + " 'products_description' => tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id]))\n" + " );\n" + " if (!isset($products_description_old[$language_id])) {\n" + " $_POST['products_url'][$language_id] = urldecode($_POST['products_url'][$language_id]);\n" + " if (substr($_POST['products_url'][$language_id], 0, 7) == 'http://') $_POST['products_url'][$language_id] = substr($_POST['products_url'][$language_id], 7);\n" + " $sql_data_array = array('products_name' => tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id])),\n" + " 'products_blurb' => tep_db_prepare_input(tep_db_encoder($_POST['products_blurb'][$language_id])),\n" + " 'products_description' => tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id])),\n" + " 'products_url' => tep_db_prepare_input($_POST['products_url'][$language_id]),\n" + " 'products_head_title_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_title_tag'][$language_id])),\n" + " 'products_head_desc_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_desc_tag'][$language_id])),\n" + " 'products_head_keywords_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_keywords_tag'][$language_id]))\n" + " );\n" + " } else {\n" + " $sql_data_array = array(); //declare the array and add to it anything changed\n" + " $products_name = tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_name'] != $products_name) {\n" + " $sql_data_array['products_name'] = $products_name;\n" + " // if this is a parent product, any subs may need updating due to the name change\n" + " tep_update_sub_name($products_id, $products_description_old[$language_id]['products_name'], $products_name, $language_id);\n" + " }\n" + " $products_blurb = tep_db_prepare_input(tep_db_encoder($_POST['products_blurb'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_blurb'] != $products_blurb) $sql_data_array['products_blurb'] = tep_db_encoder($products_blurb);\n" + " $products_description = tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_description'] != $products_description) $sql_data_array['products_description'] = tep_db_encoder($products_description);\n" + " $_POST['products_url'][$language_id] = urldecode($_POST['products_url'][$language_id]);\n" + " if (substr($_POST['products_url'][$language_id], 0, 7) == 'http://') $_POST['products_url'][$language_id] = substr($_POST['products_url'][$language_id], 7);\n" + " $products_url = tep_db_prepare_input($_POST['products_url'][$language_id]);\n" + " if ($products_description_old[$language_id]['products_url'] != $products_url) $sql_data_array['products_url'] = $products_url;\n" + " $products_head_title_tag = tep_db_prepare_input(tep_db_encoder($_POST['products_head_title_tag'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_head_title_tag'] != $products_head_title_tag) $sql_data_array['products_head_title_tag'] = $products_head_title_tag;\n" + " $products_head_desc_tag = tep_db_prepare_input(tep_db_encoder($_POST['products_head_desc_tag'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_head_desc_tag'] != $products_head_desc_tag) $sql_data_array['products_head_desc_tag'] = $products_head_desc_tag;\n" + " $products_head_keywords_tag = tep_db_prepare_input(tep_db_encoder($_POST['products_head_keywords_tag'][$language_id]));\n" + " if ($products_description_old[$language_id]['products_head_keywords_tag'] != $products_head_keywords_tag) $sql_data_array['products_head_keywords_tag'] = $products_head_keywords_tag; \n" + " }\n" + " \n" + " // check to see if there is anything to actually update in the products table\n" + " if (count($sql_data_array) > 0 ) {\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', 'products_id = ' . (int)$products_id . ' and language_id = ' . (int)$language_id);\n" + " }\n" + " }\n" + " \n" + " // Extra Fields\n" + " if (isset($_POST['extra_field'])) { // Check to see if there are any need to update extra fields.\n" + " $extra_fields_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" WHERE products_id = \" . (int)$products_id);\n" + " $extra_product_entry = array();\n" + " while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {\n" + " $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];\n" + " }\n" + " unset($extra_fields_query);\n" + " foreach ($_POST['extra_field'] as $key => $val) {\n" + " if (isset($extra_product_entry[$key])) { // an entry exists\n" + " if ($val == '') {\n" + " tep_db_query(\"DELETE FROM \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" where products_id = \" . (int)$products_id . \" AND products_extra_fields_id = \" . $key);\n" + " } elseif ($val != $extra_product_entry[$key]) { \n" + " tep_db_query(\"UPDATE \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" SET products_extra_fields_value = '\" . tep_db_input($val) . \"' WHERE products_id = \" . (int)$products_id . \" AND products_extra_fields_id = \" . $key);\n" + " }\n" + " } else { // an entry does not exist\n" + " if ($val != '') tep_db_query(\"INSERT INTO \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('\" . (int)$products_id . \"', '\" . $key . \"', '\" . tep_db_input($val) . \"')\");\n" + " }\n" + " }\n" + " } // Check to see if there are any need to update extra fields.\n" + " \n" + " // Sub Products\n" + " $prodidarray = isset($_POST['subproductid']) ? $_POST['subproductid'] : array();\n" + " $namearray = isset($_POST['subprodname']) ? tep_db_prepare_input(tep_db_encoder($_POST['subprodname'])) : array();\n" + " $modelarray = isset($_POST['subprodmodel']) ? tep_db_prepare_input(tep_db_encoder($_POST['subprodmodel'])) : array();\n" + " $pricearray = isset($_POST['subprodprice']) ? $_POST['subprodprice'] : array();\n" + " $weightarray = isset($_POST['subprodweight']) ? $_POST['subprodweight'] : array();\n" + " $quantityarray = isset($_POST['subprodqty']) ? $_POST['subprodqty'] : array();\n" + " $picturearray = isset($_FILES['subprodimage']) ? $_FILES['subprodimage'] : array();\n" + " $prevarray = isset($_POST['subprodprevimage']) ? $_POST['subprodprevimage'] : array();\n" + " $deletearray = isset($_POST['subproddelete']) ? $_POST['subproddelete'] : array();\n" + " \n" + " $parent_product_qty = 0;\n" + " for ($i=0; $i < count($namearray); $i++) {\n" + " // Go through each row that has a product name\n" + " if ($namearray[$i] != '' && !isset($deletearray[$i])) {\n" + " $sub_products_id = isset($prodidarray[$i]) ? (int)$prodidarray[$i] : 0;\n" + " if ($sub_products_id > 0) { // this is an existing sub product\n" + " $products_sub_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS . \" WHERE products_id = \" . $sub_products_id);\n" + " $products_sub = tep_db_fetch_array($products_sub_query);\n" + " \n" + " $sql_data_array = array(); //declare the array and add to it anything changed\n" + " $products_price = tep_db_prepare_input($pricearray[$i]);\n" + " if ($products_price != $products_sub['products_price']) $sql_data_array['products_price'] = $products_price;\n" + " $products_model = tep_db_prepare_input($modelarray[$i]);\n" + " if ($products_model != $products_sub['products_model']) $sql_data_array['products_model'] = $products_model;\n" + " $products_quantity = isset($quantityarray[$i]) ? tep_db_prepare_input($quantityarray[$i]) : 0;\n" + " $parent_product_qty += $products_quantity;\n" + " if ($products_quantity != $products_sub['products_quantity']) $sql_data_array['products_quantity'] = $products_quantity;\n" + " $products_weight = isset($weightarray[$i]) ? tep_db_prepare_input($weightarray[$i]) : 0;\n" + " if ($products_weight != $products_sub['products_weight']) $sql_data_array['products_weight'] = $products_weight;\n" + " \n" + " if ($picturearray['name'][$i] != '' && $picturearray['name'][$i] != $products_sub['products_image']) {\n" + " $sql_data_array['products_image'] = $picturearray['name'][$i];\n" + " $uploadFile = DIR_FS_CATALOG_IMAGES . $picturearray['name'][$i];\n" + " @move_uploaded_file($picturearray['tmp_name'][$i], $uploadFile);\n" + " } elseif ($picturearray['name'][$i] == '' && $prevarray[$i] != '' && $prevarray[$i] != $products_sub['products_image']) {\n" + " $sql_data_array['products_image'] = $prevarray[$i]; // the image could have been upload as part of the preview\n" + " }\n" + " \n" + " // there are several fields that are needed from the parent product\n" + " if ($products_date_available != $products_sub['products_date_available']) $sql_data_array['products_date_available'] = $products_date_available;\n" + " if ($products_tax_class_id != $products_sub['products_tax_class_id']) $sql_data_array['products_tax_class_id'] = $products_tax_class_id;\n" + " if ($manufacturers_id != $products_sub['manufacturers_id']) $sql_data_array['manufacturers_id'] = $manufacturers_id;\n" + " \n" + " if (count($sql_data_array) > 0) {\n" + " $sql_data_array['products_last_modified'] = 'now()';\n" + " tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', 'products_id = ' . (int)$sub_products_id);\n" + " }\n" + " unset($products_sub_query);\n" + " unset($products_sub);\n" + " \n" + " $products_description_sub_query = tep_db_query(\"SELECT language_id, products_name\n" + " FROM \" . TABLE_PRODUCTS_DESCRIPTION . \"\n" + " WHERE products_id = \" . $sub_products_id);\n" + " $products_description_sub = array();\n" + " while ($description_sub = tep_db_fetch_array($products_description_sub_query)) {\n" + " $products_description_sub[$description_sub['language_id']] = array('products_name' => $description_sub['products_name']);\n" + " }\n" + " for ($l=0, $lc=sizeof($languages); $l<$lc; $l++) {\n" + " $language_id = $languages[$l]['id'];\n" + " $parent_name = isset($products_description_parent[$language_id]['products_name']) ? $products_description_parent[$language_id]['products_name'] : '';\n" + " $new_sub_name = strstr($namearray[$i],$parent_name . ' - ') ? $namearray[$i] : $parent_name . ' - ' . $namearray[$i];\n" + " if (isset($products_description_sub[$language_id])) {\n" + " if ($new_sub_name != $products_description_sub[$language_id]['product_name']) {\n" + " $sql_data_array = array('products_name' => tep_db_encoder($new_sub_name));\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', 'products_id = ' . (int)$prodidarray[$i] . ' and language_id = ' . (int)$language_id);\n" + " }\n" + " } else {\n" + " $sql_data_array = array('products_name' => tep_db_prepare_input(tep_db_encoder($new_sub_name)),\n" + " 'products_id' => (int)$prodidarray[$i],\n" + " 'language_id' => (int)$language_id\n" + " );\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);\n" + " }\n" + " }\n" + " unset($products_description_sub_query);\n" + " unset($products_description_sub);\n" + " \n" + " } else { // this most be a new sub product\n" + " $sql_data_array = array('products_price' => tep_db_prepare_input($pricearray[$i]),\n" + " 'products_model' => tep_db_prepare_input($modelarray[$i]),\n" + " 'products_quantity' => tep_db_prepare_input($quantityarray[$i]),\n" + " 'products_weight' => tep_db_prepare_input($weightarray[$i]),\n" + " 'products_date_available' => $products_date_available,\n" + " 'products_tax_class_id' => tep_db_prepare_input($_POST['products_tax_class_id']),\n" + " 'manufacturers_id' => (int)tep_db_prepare_input($_POST['manufacturers_id']),\n" + " 'products_parent_id' => $products_id,\n" + " 'products_date_added' => 'now()',\n" + " 'products_status' => 0);\n" + " if ($picturearray['name'][$i] != '') {\n" + " $sql_data_array['products_image'] = $picturearray['name'][$i];\n" + " $uploadFile = DIR_FS_CATALOG_IMAGES . $picturearray['name'][$i];\n" + " @move_uploaded_file($picturearray['tmp_name'][$i], $uploadFile);\n" + " }\n" + " \n" + " tep_db_perform(TABLE_PRODUCTS, $sql_data_array);\n" + " $sub_products_id = tep_db_insert_id();\n" + " \n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) (select \" . $sub_products_id . \", categories_id from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = \" . $products_id . \")\");\n" + " \n" + " for ($l=0, $lc=sizeof($languages); $l<$lc; $l++) {\n" + " $language_id = $languages[$l]['id'];\n" + " if (isset($products_description_parent[$language_id])) {\n" + " $new_sub_name = strstr($namearray[$i],$products_description_parent[$language_id]['products_name'] . ' - ') ? $namearray[$i] : $products_description_parent[$language_id]['products_name'] . ' - ' . $namearray[$i];\n" + " $sql_data_array = array('products_name' => $new_sub_name,\n" + " 'products_description' => $namearray[$i],\n" + " 'language_id' => (int)$language_id,\n" + " 'products_id' => $sub_products_id);\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);\n" + " }\n" + " }\n" + " }\n" + " \n" + " } // End on if the sub prod name is set\n" + " } // end of loop on the sub products name inoput field\n" + " \n" + " // Check for sub products to be deleted\n" + " for ($i=0; $i < count($deletearray); $i++) {\n" + " tep_db_query(\"DELETE FROM \" . TABLE_PRODUCTS . \" WHERE products_id = \" . (int)$deletearray[$i]);\n" + " tep_db_query(\"DELETE FROM \" . TABLE_PRODUCTS_DESCRIPTION . \" WHERE products_id = \" . (int)$deletearray[$i]);\n" + " tep_db_query(\"DELETE FROM \" . TABLE_PRODUCTS_TO_CATEGORIES . \" WHERE products_id = \" . (int)$deletearray[$i]);\n" + " }\n" + " // End of Sub Products\n" + " }\n" + " \n" + " // if has subproduct, update parent product's qty\n" + " if ($parent_product_qty > 0) {\n" + " tep_db_query(\"UPDATE \" . TABLE_PRODUCTS . \" SET products_quantity = '\" . $parent_product_qty . \"' WHERE products_id = '\" . $products_old['products_id'] . \"'\");\n" + " }\n" + " \n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " \n" + " \n" + " if ($isSubProduct) {\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_old['products_parent_id']));\n" + " } else {\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_old['products_id']));\n" + " }\n" + " break;\n" + " \n" + " case 'insert_product':\n" + " if (isset($_POST[IMAGE_BACK]) || !isset($_POST['sort_order'])) {\n" + " $action = 'new_product';\n" + " } else {\n" + " $languages = tep_get_languages();\n" + " \n" + " $products_date_available = tep_db_prepare_input($_POST['products_date_available']);\n" + " $products_quantity = tep_db_prepare_input($_POST['products_quantity']);\n" + " $products_model = tep_db_prepare_input(tep_db_encoder($_POST['products_model']));\n" + " $products_price = tep_db_prepare_input($_POST['products_price']);\n" + " $products_weight = isset($_POST['products_weight']) ? tep_db_prepare_input($_POST['products_weight']) : 0;\n" + " $products_status = isset($_POST['products_status']) ? tep_db_prepare_input($_POST['products_status']) : 0;\n" + " $products_tax_class_id = isset($_POST['products_tax_class_id']) ? tep_db_prepare_input($_POST['products_tax_class_id']) : 0;\n" + " $manufacturers_id = isset($_POST['manufacturers_id']) ? tep_db_prepare_input($_POST['manufacturers_id']) : 0;\n" + " $sort_order = isset($_POST['sort_order']) ? tep_db_prepare_input($_POST['sort_order']) : 0;\n" + " $sql_data_array = array('products_date_available' => $products_date_available,\n" + " 'products_quantity' => $products_quantity,\n" + " 'products_model' => $products_model,\n" + " // multi-vendor shipping\n" + " 'vendors_prod_id' => tep_db_prepare_input($_POST['vendors_prod_id']),\n" + " 'vendors_product_price' => tep_db_prepare_input($_POST['vendors_product_price']),\n" + " 'vendors_id' => tep_db_prepare_input($_POST['vendors_id']),\n" + " 'vendors_prod_comments' => tep_db_prepare_input($_POST['vendors_prod_comments']),\n" + " // multi-vendor shipping //eof\n" + " 'products_price' => $products_price,\n" + " 'products_weight' => $products_weight,\n" + " 'products_status' => $products_status,\n" + " 'products_tax_class_id' => $products_tax_class_id,\n" + " 'manufacturers_id' => $manufacturers_id,\n" + " 'sort_order' => $sort_order);\n" + " \n\n\n" + " $images = array(array('table' => 'products_image', 'delete' => 'delete_image', 'unlink' => 'unlink_image', 'dir' => 'products_image_destination'),\n" + " array('table' => 'products_image_med', 'delete' => 'delete_image_med', 'unlink' => 'unlink_image_med', 'dir' => 'products_image_med_destination'),\n" + " array('table' => 'products_image_lrg', 'delete' => 'delete_image_lrg', 'unlink' => 'unlink_image_lrg', 'dir' => 'products_image_lrg_destination'),\n" + " array('field' => 'products_image', 'path' => 'file_dir_exist_dest_small', 'file' => 'file_exist_dest_small'),\n" + " array('field' => 'products_image_med', 'path' => 'file_dir_exist_dest_med', 'file' => 'file_exist_dest_med'),\n" + " array('field' => 'products_image_lrg', 'path' => 'file_dir_exist_dest_lrg', 'file' => 'file_exist_dest_lrg'),\n" + " array('table' => 'products_image_sm_1', 'delete' => 'delete_image_sm_1', 'unlink' => 'unlink_image_sm_1', 'dir' => 'products_image_sm_1_destination'),\n" + " array('table' => 'products_image_xl_1', 'delete' => 'delete_image_xl_1', 'unlink' => 'unlink_image_xl_1', 'dir' => 'products_image_xl_1_destination'),\n" + " array('table' => 'products_image_sm_2', 'delete' => 'delete_image_sm_2', 'unlink' => 'unlink_image_sm_2', 'dir' => 'products_image_sm_2_destination'),\n" + " array('table' => 'products_image_xl_2', 'delete' => 'delete_image_xl_2', 'unlink' => 'unlink_image_xl_2', 'dir' => 'products_image_xl_2_destination'),\n" + " array('table' => 'products_image_sm_3', 'delete' => 'delete_image_sm_3', 'unlink' => 'unlink_image_sm_3', 'dir' => 'products_image_sm_3_destination'),\n" + " array('table' => 'products_image_xl_3', 'delete' => 'delete_image_xl_3', 'unlink' => 'unlink_image_xl_3', 'dir' => 'products_image_xl_3_destination'),\n" + " array('table' => 'products_image_sm_4', 'delete' => 'delete_image_sm_4', 'unlink' => 'unlink_image_sm_4', 'dir' => 'products_image_sm_4_destination'),\n" + " array('table' => 'products_image_xl_4', 'delete' => 'delete_image_xl_4', 'unlink' => 'unlink_image_xl_4', 'dir' => 'products_image_xl_4_destination'),\n" + " array('table' => 'products_image_sm_5', 'delete' => 'delete_image_sm_5', 'unlink' => 'unlink_image_sm_5', 'dir' => 'products_image_sm_5_destination'),\n" + " array('table' => 'products_image_xl_5', 'delete' => 'delete_image_xl_5', 'unlink' => 'unlink_image_xl_5', 'dir' => 'products_image_xl_5_destination'),\n" + " array('table' => 'products_image_sm_6', 'delete' => 'delete_image_sm_6', 'unlink' => 'unlink_image_sm_6', 'dir' => 'products_image_sm_6_destination'),\n" + " array('table' => 'products_image_xl_6', 'delete' => 'delete_image_xl_6', 'unlink' => 'unlink_image_xl_6', 'dir' => 'products_image_xl_6_destination')\n" + " );\n" + " foreach ($images as $image) {\n" + " if (isset($_POST[$image['delete']]) && $_POST[$image['delete']] == 'yes' && $products_old[$image['table']] != '') {\n" + " unlink(DIR_FS_CATALOG_IMAGES . $products_old[$image['table']]);\n" + " $sql_data_array[$image['table']] = '';\n" + " } elseif (isset($_POST[$image['unlink']]) && $_POST[$image['unlink']] == 'yes' && $products_old[$image['table']] != '') { \n" + " $sql_data_array[$image['table']] = '';\n" + " } elseif (isset($_FILES[$image['table']]) && tep_not_null($_FILES[$image['table']]['name']) && strtolower($_FILES[$image['table']]['name']) != 'none') {\n" + " $uploadFile = DIR_FS_CATALOG_IMAGES . urldecode($_POST[$image['dir']]) . $_FILES[$image['table']]['name'];\n" + " @move_uploaded_file($_FILES[$image['table']]['tmp_name'], $uploadFile);\n" + " $sql_data_array[$image['table']] = tep_db_prepare_input(urldecode($_POST[$image['dir']]) . $_FILES[$image['table']]['name']);\n" + " } elseif(isset($_POST[$image['file']]) && tep_not_null($_POST[$image['file']])) {\n" + " $sql_data_array[$image['field']] = tep_db_prepare_input(rawurldecode($_POST[$image['path']]) . rawurldecode($_POST[$image['file']]));\n" + " } elseif (isset($_POST[$image['table']]) && tep_not_null($_POST[$image['table']]) && strtolower($_POST[$image['table']]) != 'none') {\n" + " $sql_data_array[$image['table']] = tep_db_prepare_input($_POST[$image['table']]);\n" + " }\n" + " }\n" + " \n" + " $customergroupid = \"\";\n" + " if (isset($_POST['products_group_access'])) {\n" + " foreach ($_POST['products_group_access'] as $value) {\n" + " $customergroupid .= $value . ',';\n" + " } \n" + " }\n" + " $customergroupid = substr($customergroupid,0,(strlen($customergroupid)-1));\n" + " if ($products_old['products_group_access'] != $customergroupid) $sql_data_array['products_group_access'] = $customergroupid;\n" + " $customergroupid = \"\";\n" + " if (isset($_POST['products_nav_access'])) {\n" + " foreach ($_POST['products_nav_access'] as $value) {\n" + " $customergroupid .= $value . ',';\n" + " }\n" + " }\n" + " $customergroupid = substr($customergroupid,0,(strlen($customergroupid)-1));\n" + " if ($products_old['products_nav_access'] != $customergroupid) $sql_data_array['products_nav_access'] = $customergroupid;\n" + " \n" + " $pricing_array = tep_get_pricing();\n" + " for ($i = 1; $i <= 11; ++$i) {\n" + " if ($products_old['products_price'.$i] != $pricing_array[$i]['price']) $sql_data_array['products_price'.$i] = $pricing_array[$i]['price'];\n" + " if ($products_old['products_price'.$i.'_qty'] != $pricing_array[$i]['qty']) $sql_data_array['products_price'.$i.'_qty'] = $pricing_array[$i]['qty'];\n" + " }\n" + " \n" + " if (isset($_POST['products_history']) && $_POST['products_history'] > 0) {\n" + " if ($_POST['products_history_qty'] == 'days') {\n" + " $sql_data_array['products_qty_days'] = $_POST['products_history'];\n" + " $sql_data_array['products_qty_years'] = 0;\n" + " } else {\n" + " $sql_data_array['products_qty_days'] = 0;\n" + " $sql_data_array['products_qty_years'] = $_POST['products_history'];\n" + " }\n" + " }\n" + " \n" + " $sql_data_array['products_date_added'] = 'now()';\n" + " tep_db_perform(TABLE_PRODUCTS, $sql_data_array);\n" + " $products_id = tep_db_insert_id();\n" + " \n" + " tep_update_group_pricing($products_id);\n" + " \n" + " // process the products description table data\n" + " $products_description_parent = array(); // save the name and description for later use in processing sub products\n" + " for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n" + " $language_id = $languages[$i]['id'];\n" + " //if ($_POST['products_name'][$language_id] != '') {\n" + " $products_description_parent[$language_id] = array('products_name' => tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id])),\n" + " 'products_description' => tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id]))\n" + " );\n" + " $_POST['products_url'][$language_id] = urldecode($_POST['products_url'][$language_id]);\n" + " if (substr($_POST['products_url'][$language_id], 0, 7) == 'http://') $_POST['products_url'][$language_id] = substr($_POST['products_url'][$language_id], 7);\n" + " $sql_data_array = array('products_name' => tep_db_prepare_input(tep_db_encoder($_POST['products_name'][$language_id])),\n" + " 'products_blurb' => tep_db_prepare_input(tep_db_encoder($_POST['products_blurb'][$language_id])), \n" + " 'products_description' => tep_db_prepare_input(tep_db_encoder($_POST['products_description'][$language_id])),\n" + " 'products_url' => tep_db_prepare_input($_POST['products_url'][$language_id]),\n" + " 'products_head_title_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_title_tag'][$language_id])),\n" + " 'products_head_desc_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_desc_tag'][$language_id])),\n" + " 'products_head_keywords_tag' => tep_db_prepare_input(tep_db_encoder($_POST['products_head_keywords_tag'][$language_id])),\n" + " 'products_id' => $products_id,\n" + " 'language_id' => $language_id\n" + " );\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);\n" + " // }\n" + " }\n" + " \n" + " // add it to the cirrent category\n" + " tep_db_query(\"INSERT INTO \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) VALUES (\" . (int)$products_id . \", \" . (int)$current_category_id . \")\");\n" + " \n" + " // Extra Fields\n" + " if (isset($_POST['extra_field'])) { // Check to see if there are any need to update extra fields.\n" + " $extra_fields_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" WHERE products_id = \" . (int)$products_id);\n" + " $extra_product_entry = array();\n" + " while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {\n" + " $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];\n" + " }\n" + " unset($extra_fields_query);\n" + " foreach (tep_db_prepare_input(tep_db_encoder($_POST['extra_field'])) as $key => $val) {\n" + " if (isset($extra_product_entry[$key])) { // an entry exists\n" + " if ($val == '') {\n" + " tep_db_query(\"DELETE FROM \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" where products_id = \" . (int)$products_id . \" AND products_extra_fields_id = \" . $key);\n" + " } elseif ($val != $extra_product_entry[$key]) { \n" + " tep_db_query(\"UPDATE \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" SET products_extra_fields_value = '\" . tep_db_input($val) . \"' WHERE products_id = \" . (int)$products_id . \" AND products_extra_fields_id = \" . $key);\n" + " }\n" + " } else { // an entry does not exist\n" + " if ($val != '') tep_db_query(\"INSERT INTO \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('\" . (int)$products_id . \"', '\" . $key . \"', '\" . tep_db_input($val) . \"')\");\n" + " }\n" + " }\n" + " } // Check to see if there are any need to update extra fields.\n" + " \n" + " // Sub Products\n" + " $prodidarray = isset($_POST['subproductid']) ? $_POST['subproductid'] : array();\n" + " $namearray = isset($_POST['subprodname']) ? tep_db_prepare_input(tep_db_encoder($_POST['subprodname'])) : array();\n" + " $modelarray = isset($_POST['subprodmodel']) ? tep_db_prepare_input(tep_db_encoder($_POST['subprodmodel'])) : array();\n" + " $pricearray = isset($_POST['subprodprice']) ? $_POST['subprodprice'] : array();\n" + " $weightarray = isset($_POST['subprodweight']) ? $_POST['subprodweight'] : array();\n" + " $quantityarray = isset($_POST['subprodqty']) ? $_POST['subprodqty'] : array();\n" + " $picturearray = isset($_FILES['subprodimage']) ? $_FILES['subprodimage'] : array();\n" + " $prevarray = isset($_POST['subprodprevimage']) ? $_POST['subprodprevimage'] : array();\n" + " $deletearray = isset($_POST['subproddelete']) ? $_POST['subproddelete'] : array();\n" + " \n" + " $parent_product_qty = 0;\n" + " for ($i=0; $i < count($namearray); $i++) {\n" + " // Go through each row that has a product name\n" + " if ($namearray[$i] != '') {\n" + " $parent_product_qty += $quantityarray[$i];\n" + " $sql_data_array = array('products_price' => tep_db_prepare_input($pricearray[$i]),\n" + " 'products_model' => tep_db_prepare_input($modelarray[$i]),\n" + " 'products_quantity' => tep_db_prepare_input($quantityarray[$i]),\n" + " 'products_weight' => tep_db_prepare_input($weightarray[$i]),\n" + " 'products_date_available' => $products_date_available,\n" + " 'products_tax_class_id' => tep_db_prepare_input($_POST['products_tax_class_id']),\n" + " 'manufacturers_id' => (int)tep_db_prepare_input($_POST['manufacturers_id']),\n" + " 'products_parent_id' => $products_id,\n" + " 'products_date_added' => 'now()',\n" + " 'products_status' => 0);\n" + " if ($picturearray['name'][$i] != '') {\n" + " $sql_data_array['products_image'] = $picturearray['name'][$i];\n" + " $uploadFile = DIR_FS_CATALOG_IMAGES . $picturearray['name'][$i];\n" + " @move_uploaded_file($picturearray['tmp_name'][$i], $uploadFile);\n" + " } elseif ($picturearray['name'][$i] == '' && $prevarray[$i] != '') {\n" + " $sql_data_array['products_image'] = $prevarray[$i]; // the image could have been upload as part of the preview\n" + " }\n" + " \n" + " tep_db_perform(TABLE_PRODUCTS, $sql_data_array);\n" + " $sub_products_id = tep_db_insert_id();\n" + " \n" + " for ($l=0, $lc=sizeof($languages); $l<$lc; $l++) {\n" + " $language_id = $languages[$l]['id'];\n" + " $parent_name = isset($products_description_parent[$language_id]['products_name']) ? $products_description_parent[$language_id]['products_name'] : '';\n" + " $new_sub_name = strstr($namearray[$i],$parent_name . ' - ') ? $namearray[$i] : $parent_name . ' - ' . $namearray[$i];\n" + " $sql_data_array = array('products_name' => tep_db_prepare_input(tep_db_encoder($new_sub_name)),\n" + " 'products_description' => tep_db_prepare_input(tep_db_encoder($namearray[$i])),\n" + " 'language_id' => (int)$language_id,\n" + " 'products_id' => (int)$sub_products_id);\n" + " tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);\n" + " }\n" + " \n" + " // add it to the current category\n" + " tep_db_query(\"INSERT INTO \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) VALUES (\" . (int)$sub_products_id . \", \" . (int)$current_category_id . \")\");\n" + " \n" + " } // End on if the sub prod name is set\n" + " } // end of loop on the sub products name inoput field\n" + " // End of Sub Products\n" + " \n" + " // if has subproduct, update parent product's qty\n" + " if ($parent_product_qty > 0) {\n" + " tep_db_query(\"UPDATE \" . TABLE_PRODUCTS . \" SET products_quantity = '\" . $parent_product_qty . \"' WHERE products_id = '\" . $products_id . \"'\");\n" + " }\n" + " \n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " \n" + " // RCI code start\n" + " echo $cre_RCI->get('categories', 'insertproduct', false); \n" + " // RCI code eof\n" + " \n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));\n" + " }\n" + " break;\n" + " \n" + " case 'copy_to_confirm':\n" + " if (isset($_POST['products_id']) && isset($_POST['categories_id'])) {\n" + " $products_id = tep_db_prepare_input($_POST['products_id']);\n" + " $categories_id = tep_db_prepare_input($_POST['categories_id']);\n" + " if ($_POST['copy_as'] == 'link') {\n" + " if ($categories_id != $current_category_id) {\n" + " $check_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$products_id . \"' and categories_id = '\" . (int)$categories_id . \"'\");\n" + " $check = tep_db_fetch_array($check_query);\n" + " if ($check['total'] < '1') {\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) values ('\" . (int)$products_id . \"', '\" . (int)$categories_id . \"')\");\n" + " }\n" + " $sub_products_query = tep_db_query(\"select products_id from \" . TABLE_PRODUCTS . \" where products_parent_id = '\" . (int)$products_id . \"'\");\n" + " while ($sub_products = tep_db_fetch_array($sub_products_query)) {\n" + " $check_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$sub_products['products_id'] . \"' and categories_id = '\" . (int)$categories_id . \"'\");\n" + " $check = tep_db_fetch_array($check_query);\n" + " if ($check['total'] < '1') {\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) values ('\" . (int)$sub_products['products_id'] . \"', '\" . (int)$categories_id . \"')\");\n" + " }\n" + " }\n" + " } else {\n" + " $messageStack->add_session('search', ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');\n" + " }\n" + " } elseif ($_POST['copy_as'] == 'duplicate') {\n" + " $product_query = tep_db_query(\"SELECT products_quantity, products_model, vendors_prod_id, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, vendors_product_price, vendors_prod_comments, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price9, products_price10, products_price11, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_price9_qty, products_price10_qty, products_price11_qty, products_qty_blocks, products_date_available, products_weight, products_tax_class_id, manufacturers_id, products_group_access, products_nav_access, sort_order, products_qty_days, products_qty_years \n" + " from \" . TABLE_PRODUCTS . \" \n" + " WHERE products_id = '\" . (int)$products_id . \"'\");\n" + " $product = tep_db_fetch_array($product_query);\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS . \" (products_quantity, products_model, vendors_prod_id, vendors_product_price, vendors_prod_comments,vendors_id, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price9, products_price10, products_price11, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_price9_qty, products_price10_qty, products_price11_qty, products_qty_blocks, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_group_access, products_nav_access, sort_order, products_qty_days, products_qty_years) values\n" + " ('\" . tep_db_input($product['products_quantity']) . \"', '\" . tep_db_input($product['products_model']) . \"', '\".tep_db_input($product['vendors_prod_id']) . \"', '\" . tep_db_input($product['vendors_product_price']) . \"', '\" . tep_db_input($product['vendors_prod_comments']) . \"', '\" . (int)$product['vendors_id'] . \"', '\" . tep_db_input($product['products_image']) . \"', '\" . tep_db_input($product['products_image_med']) . \"', '\" . tep_db_input($product['products_image_lrg']) . \"', '\" . tep_db_input($product['products_image_sm_1']) . \"', '\" . tep_db_input($product['products_image_xl_1']) . \"', '\" . tep_db_input($product['products_image_sm_2']) . \"', '\" . tep_db_input($product['products_image_xl_2']) . \"', '\" . tep_db_input($product['products_image_sm_3']) . \"', '\" . tep_db_input($product['products_image_xl_3']) . \"', '\" . tep_db_input($product['products_image_sm_4']) . \"', '\" . tep_db_input($product['products_image_xl_4']) . \"', '\" . tep_db_input($product['products_image_sm_5']) . \"', '\" . tep_db_input($product['products_image_xl_5']) . \"', '\" . tep_db_input($product['products_image_sm_6']) . \"', '\" . tep_db_input($product['products_image_xl_6']) . \"', '\" . tep_db_input($product['products_price']) . \"',\n" + " '\" . tep_db_input($product['products_price1']) . \"', '\" . tep_db_input($product['products_price2']) . \"', '\" . tep_db_input($product['products_price3']) . \"', '\" . tep_db_input($product['products_price4']) . \"', '\" . tep_db_input($product['products_price5']) . \"', '\" . tep_db_input($product['products_price6']) . \"', '\" . tep_db_input($product['products_price7']) . \"', '\" . tep_db_input($product['products_price8']) . \"', '\" . tep_db_input($product['products_price9']) . \"', '\" . tep_db_input($product['products_price10']) . \"', '\" . tep_db_input($product['products_price11']) . \"', '\" . tep_db_input($product['products_price1_qty']) . \"', '\" . tep_db_input($product['products_price2_qty']) . \"', '\" . tep_db_input($product['products_price3_qty']) . \"', '\" . tep_db_input($product['products_price4_qty']) . \"', '\" . tep_db_input($product['products_price5_qty']) . \"', '\" . tep_db_input($product['products_price6_qty']) . \"', '\" . tep_db_input($product['products_price7_qty']) . \"', '\" . tep_db_input($product['products_price8_qty']) . \"', '\" . tep_db_input($product['products_price9_qty']) . \"', '\" . tep_db_input($product['products_price10_qty']) . \"', '\" . tep_db_input($product['products_price11_qty']) . \"', '\" . tep_db_input($product['products_qty_blocks']) . \"',\n" + " now(), '\" . tep_db_input($product['products_date_available']) . \"', '\" . tep_db_input($product['products_weight']) . \"', '0', '\" . (int)$product['products_tax_class_id'] . \"', '\" . (int)$product['manufacturers_id'] . \"', '\" . tep_db_input($product['products_group_access']) . \"', '\" . tep_db_input($product['products_nav_access']) . \"', '\" . tep_db_input($product['sort_order']) . \"', '\" . tep_db_input($product['products_qty_days']) . \"', '\" . tep_db_input($product['products_qty_years']) . \"')\");\n" + " $dup_products_id = tep_db_insert_id();\n" + " $description_query = tep_db_query(\"select language_id, products_name, products_blurb, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from \" . TABLE_PRODUCTS_DESCRIPTION . \" where products_id = '\" . (int)$products_id . \"'\");\n" + " while ($description = tep_db_fetch_array($description_query)) {\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_DESCRIPTION . \" (products_id, language_id, products_name, products_blurb, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('\" . (int)$dup_products_id . \"', '\" . (int)$description['language_id'] . \"', '\" . tep_db_input($description['products_name']) . \"', '\" . tep_db_input($description['products_blurb']) . \"', '\" . tep_db_input($description['products_description']) . \"', '\" . tep_db_input($description['products_head_title_tag']) . \"', '\" . tep_db_input($description['products_head_desc_tag']) . \"', '\" . tep_db_input($description['products_head_keywords_tag']) . \"', '\" . tep_db_input($description['products_url']) . \"', '0')\");\n" + " }\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) values ('\" . (int)$dup_products_id . \"', '\" . (int)$categories_id . \"')\");\n" + " $products_id_from=tep_db_input($products_id);\n" + " $products_id_to= $dup_products_id;\n" + " $products_id = $dup_products_id;\n" + " if ( $_POST['copy_attributes']=='copy_attributes_yes' and $_POST['copy_as'] == 'duplicate' ) {\n" + " $copy_attributes_delete_first='1';\n" + " $copy_attributes_duplicates_skipped='1';\n" + " $copy_attributes_duplicates_overwrite='0';\n" + " if (DOWNLOAD_ENABLED == 'true') {\n" + " $copy_attributes_include_downloads='1';\n" + " $copy_attributes_include_filename='1';\n" + " } else {\n" + " $copy_attributes_include_downloads='0';\n" + " $copy_attributes_include_filename='0';\n" + " }\n" + " tep_copy_products_attributes($products_id_from,$products_id_to);\n" + " }\n" + " $products_id1 = tep_db_prepare_input($_POST['products_id']);\n" + " $sub_products_query = tep_db_query(\"select products_id from \" . TABLE_PRODUCTS . \" where products_parent_id = '\" . (int)$products_id1 . \"'\");\n" + " while ($sub_products = tep_db_fetch_array($sub_products_query)) {\n" + " $product_query = tep_db_query(\"select products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price9, products_price10, products_price11, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_price9_qty, products_price10_qty, products_price11_qty, products_qty_blocks, products_date_available, products_weight, products_tax_class_id, manufacturers_id, sort_order, products_qty_days, products_qty_years from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$sub_products['products_id'] . \"'\");\n" + " $product = tep_db_fetch_array($product_query);\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS . \" (products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price9, products_price10, products_price11, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_price9_qty, products_price10_qty, products_price11_qty, products_qty_blocks, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_parent_id, sort_order, products_qty_days, products_qty_years) values\n" + " ('\" . tep_db_input($product['products_quantity']) . \"', '\" . tep_db_input($product['products_model']) . \"', '\" . tep_db_input($product['products_image']) . \"', '\" . tep_db_input($product['products_image_med']) . \"', '\" . tep_db_input($product['products_image_lrg']) . \"', '\" . tep_db_input($product['products_image_sm_1']) . \"', '\" . tep_db_input($product['products_image_xl_1']) . \"', '\" . tep_db_input($product['products_image_sm_2']) . \"', '\" . tep_db_input($product['products_image_xl_2']) . \"', '\" . tep_db_input($product['products_image_sm_3']) . \"', '\" . tep_db_input($product['products_image_xl_3']) . \"', '\" . tep_db_input($product['products_image_sm_4']) . \"', '\" . tep_db_input($product['products_image_xl_4']) . \"', '\" . tep_db_input($product['products_image_sm_5']) . \"', '\" . tep_db_input($product['products_image_xl_5']) . \"', '\" . tep_db_input($product['products_image_sm_6']) . \"', '\" . tep_db_input($product['products_image_xl_6']) . \"', '\" . tep_db_input($product['products_price']) . \"',\n" + " '\" . tep_db_input($product['products_price1']) . \"', '\" . tep_db_input($product['products_price2']) . \"', '\" . tep_db_input($product['products_price3']) . \"', '\" . tep_db_input($product['products_price4']) . \"', '\" . tep_db_input($product['products_price5']) . \"', '\" . tep_db_input($product['products_price6']) . \"', '\" . tep_db_input($product['products_price7']) . \"', '\" . tep_db_input($product['products_price8']) . \"', '\" . tep_db_input($product['products_price9']) . \"', '\" . tep_db_input($product['products_price10']) . \"', '\" . tep_db_input($product['products_price11']) . \"', '\" . tep_db_input($product['products_price1_qty']) . \"', '\" . tep_db_input($product['products_price2_qty']) . \"', '\" . tep_db_input($product['products_price3_qty']) . \"', '\" . tep_db_input($product['products_price4_qty']) . \"', '\" . tep_db_input($product['products_price5_qty']) . \"', '\" . tep_db_input($product['products_price6_qty']) . \"', '\" . tep_db_input($product['products_price7_qty']) . \"', '\" . tep_db_input($product['products_price8_qty']) . \"', '\" . tep_db_input($product['products_price9_qty']) . \"', '\" . tep_db_input($product['products_price10_qty']) . \"', '\" . tep_db_input($product['products_price11_qty']) . \"', '\" . tep_db_input($product['products_qty_blocks']) . \"',\n" + " now(), '\" . tep_db_input($product['products_date_available']) . \"', '\" . tep_db_input($product['products_weight']) . \"', '0', '\" . (int)$product['products_tax_class_id'] . \"', '\" . (int)$product['manufacturers_id'] . \"', '\" . $dup_products_id . \"', '\" . (int)$product['sort_order'] . \"', '\" . tep_db_input($product['products_qty_days']) . \"', '\" . tep_db_input($product['products_qty_years']) . \"')\"); \n" + " $dup_products_id1 = tep_db_insert_id();\n" + " $description_query = tep_db_query(\"select language_id, products_name, products_blurb, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from \" . TABLE_PRODUCTS_DESCRIPTION . \" where products_id = '\" . (int)$sub_products['products_id'] . \"'\");\n" + " while ($description = tep_db_fetch_array($description_query)) {\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_DESCRIPTION . \" (products_id, language_id, products_name, products_blurb, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('\" . (int)$dup_products_id1 . \"', '\" . (int)$description['language_id'] . \"', '\" . tep_db_input($description['products_name']) . \"', '\" . tep_db_input($description['products_blurb']) . \"', '\" . tep_db_input($description['products_description']) . \"', '\" . tep_db_input($description['products_head_title_tag']) . \"', '\" . tep_db_input($description['products_head_desc_tag']) . \"', '\" . tep_db_input($description['products_head_keywords_tag']) . \"', '\" . tep_db_input($description['products_url']) . \"', '0')\");\n" + " }\n" + " tep_db_query(\"insert into \" . TABLE_PRODUCTS_TO_CATEGORIES . \" (products_id, categories_id) values ('\" . (int)$dup_products_id1 . \"', '\" . (int)$categories_id . \"')\");\n" + " $products_id_from=tep_db_input($sub_products['products_id']);\n" + " $products_id_to= $dup_products_id1;\n" + " if ( $_POST['copy_attributes']=='copy_attributes_yes' and $_POST['copy_as'] == 'duplicate' ) {\n" + " $copy_attributes_delete_first='1';\n" + " $copy_attributes_duplicates_skipped='1';\n" + " $copy_attributes_duplicates_overwrite='0';\n" + " if (DOWNLOAD_ENABLED == 'true') {\n" + " $copy_attributes_include_downloads='1';\n" + " $copy_attributes_include_filename='1';\n" + " } else {\n" + " $copy_attributes_include_downloads='0';\n" + " $copy_attributes_include_filename='0';\n" + " }\n" + " tep_copy_products_attributes($products_id_from,$products_id_to);\n" + " }\n" + " }\n" + " }\n" + " if (USE_CACHE == 'true') {\n" + " tep_reset_cache_block('categories');\n" + " tep_reset_cache_block('also_purchased');\n" + " }\n" + " tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));\n" + " }\n" + " break;\n" + " \n" + " case 'new_product_preview':\n" + " $images = array(array('table' => 'products_image', 'delete' => 'delete_image', 'unlink' => 'unlink_image'),\n" + " array('table' => 'products_image_med', 'delete' => 'delete_image_med', 'unlink' => 'unlink_image_med'),\n" + " array('table' => 'products_image_lrg', 'delete' => 'delete_image_lrg', 'unlink' => 'unlink_image_lrg'),\n" + " array('table' => 'products_image_sm_1', 'delete' => 'delete_image_sm_1', 'unlink' => 'unlink_image_sm_1'),\n" + " array('table' => 'products_image_xl_1', 'delete' => 'delete_image_xl_1', 'unlink' => 'unlink_image_xl_1'),\n" + " array('table' => 'products_image_sm_2', 'delete' => 'delete_image_sm_2', 'unlink' => 'unlink_image_sm_2'),\n" + " array('table' => 'products_image_xl_2', 'delete' => 'delete_image_xl_2', 'unlink' => 'unlink_image_xl_2'),\n" + " array('table' => 'products_image_sm_3', 'delete' => 'delete_image_sm_3', 'unlink' => 'unlink_image_sm_3'),\n" + " array('table' => 'products_image_xl_3', 'delete' => 'delete_image_xl_3', 'unlink' => 'unlink_image_xl_3'),\n" + " array('table' => 'products_image_sm_4', 'delete' => 'delete_image_sm_4', 'unlink' => 'unlink_image_sm_4'),\n" + " array('table' => 'products_image_xl_4', 'delete' => 'delete_image_xl_4', 'unlink' => 'unlink_image_xl_4'),\n" + " array('table' => 'products_image_sm_5', 'delete' => 'delete_image_sm_5', 'unlink' => 'unlink_image_sm_5'),\n" + " array('table' => 'products_image_xl_5', 'delete' => 'delete_image_xl_5', 'unlink' => 'unlink_image_xl_5'),\n" + " array('table' => 'products_image_sm_6', 'delete' => 'delete_image_sm_6', 'unlink' => 'unlink_image_sm_6'),\n" + " array('table' => 'products_image_xl_6', 'delete' => 'delete_image_xl_6', 'unlink' => 'unlink_image_xl_6')\n" + " );\n" + " foreach ($images as $image) {\n" + " $dir_dest = $_POST[$image['table'].'_destination'];\n" + " $dir_dest = str_ireplace( \"%2F\", \"/\", $dir_dest);\n" + " ${$image['table'].'_name'} = '';\n" + " if (isset($_FILES[$image['table']]) && tep_not_null($_FILES[$image['table']]['name']) && strtolower($_FILES[$image['table']]['name']) != 'none') {\n" + " $image_upload = new upload($image['table']);\n" + " $image_upload->set_destination(DIR_FS_CATALOG_IMAGES . $dir_dest);\n" + " if ($image_upload->parse() && $image_upload->save()) {\n" + " ${$image['table'].'_name'} = $image_upload->filename;\n" + " } else {\n" + " ${$image['table'].'_name'} = (isset($_POST[$image['table'].'_previous']) ? $_POST[$image['table'].'_previous'] : '');\n" + " }\n" + " }\n" + " }\n" + " \n" + " $picturearray = (isset($_FILES['subprodimage']) ? $_FILES['subprodimage'] : array());\n" + " $namearray = (isset($_POST['subprodname']) ? $_POST['subprodname'] : array());\n" + " $new_sub_prod_image = array();\n" + " $i = 0;\n" + " for ($i=0; $i < count($namearray); $i++) {\n" + " if ($namearray[$i] != '') {\n" + " foreach($picturearray['name'] as $xkey=>$xval) {\n" + " if ($xval != '') {\n" + " if ($picturearray['name'][$xkey] != '') {\n" + " $new_sub_prod_image[$xkey] = $picturearray['name'][$xkey];\n" + " $_POST['subprodprevimage'][$xkey] = $picturearray['name'][$xkey];\n" + " $uploadFile = DIR_FS_CATALOG_IMAGES . $picturearray['name'][$xkey];\n" + " if (move_uploaded_file($picturearray['tmp_name'][$xkey], $uploadFile) && $xval != \"\") {\n" + " $messageStack->add('search', SUCCESS_FILE_SAVED_SUCCESSFULLY, 'success');\n" + " } else if($xval != \"\") {\n" + " $messageStack->add('search', ERROR_FILE_NOT_SAVED, 'error');\n" + " }\n" + " }\n" + " }\n" + " }\n" + " break;\n" + " }\n" + " }\n" + " break;\n" + " } // end switch($action)\n" + "} // end tep_not_null($action)\n" + "// check if the catalog image directory exists\n" + "if (is_dir(DIR_FS_CATALOG_IMAGES)) {\n" + " if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');\n" + "} else {\n" + " $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');\n" + "}\n" + "switch (true) {\n" + " case (CATEGORIES_SORT_ORDER==\"products_name\"):\n" + " $order_it_by = \"pd.products_name\";\n" + " break;\n" + " case (CATEGORIES_SORT_ORDER==\"products_name-desc\"):\n" + " $order_it_by = \"pd.products_name DESC\";\n" + " break;\n" + " case (CATEGORIES_SORT_ORDER==\"model\"):\n" + " $order_it_by = \"p.products_model\";\n" + " break;\n" + " case (CATEGORIES_SORT_ORDER==\"model-desc\"):\n" + " $order_it_by = \"p.products_model DESC\";\n" + " break;\n" + " default:\n" + " $order_it_by = \"pd.products_name\";\n" + " break;\n" + "}\n" + "$go_back_to=$_SERVER[\"REQUEST_URI\"];\n" + "?>\n" + "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" + "<html <?php echo HTML_PARAMS; ?>>\n" + "<head>\n" + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=<?php echo CHARSET; ?>\">\n" + "<title><?php echo TITLE; ?></title>\n" + "<script type=\"text/javascript\" src=\"includes/prototype.js\"></script>\n" + "<link rel=\"stylesheet\" type=\"text/css\" href=\"includes/stylesheet.css\">\n" + "<!--[if IE]>\n" + "<link rel=\"stylesheet\" type=\"text/css\" href=\"includes/stylesheet-ie.css\">\n" + "<![endif]-->\n" + "<script type=\"text/javascript\" src=\"includes/general.js\"></script>\n" + "<!-- Tabs code -->\n" + "<script type=\"text/javascript\" src=\"includes/javascript/tabpane/local/webfxlayout.js\"></script>\n" + "<link type=\"text/css\" rel=\"stylesheet\" href=\"includes/javascript/tabpane/tab.webfx.css\">\n" + "<style type=\"text/css\">\n" + ".dynamic-tab-pane-control h2 {\n" + " text-align: center;\n" + " width: auto;\n" + "}\n\n" + ".dynamic-tab-pane-control h2 a {\n" + " display: inline;\n" + " width: auto;\n" + "}\n\n" + ".dynamic-tab-pane-control a:hover {\n" + " background: transparent;\n" + "}\n" + "</style>\n" + "<script type=\"text/javascript\" src=\"includes/javascript/tabpane/tabpane.js\"></script>\n" + "<!-- End Tabs -->\n" + "<link rel=\"stylesheet\" type=\"text/css\" href=\"includes/javascript/spiffyCal/spiffyCal_v2_1.css\">\n" + "<script type=\"text/javascript\" src=\"includes/javascript/spiffyCal/spiffyCal_v2_1.js\"></script>\n" + "<script language=\"javascript\"><!--\n" + "function checkUncheckAll(theElement, obj) {\n" + " var theForm = theElement.form, z = 1;\n" + " for (z=1; z < theForm.length; z++) {\n" + " if (theForm[z].type == 'checkbox' && theForm[z].name == obj) {\n" + " if (theElement.checked) {\n" + " theForm[z].checked = true;\n" + " } else{\n" + " theForm[z].checked = false;\n" + " }\n" + " }\n" + " }\n" + "}\n" + "function retailCheck(theElement, obj) {\n" + " var theForm = theElement.form, z = 1;\n" + " for (z=1; z < theForm.length; z++) {\n" + " if (theForm[z].type == 'checkbox' && theForm[z].name == obj && theForm[z].value == 'G') {\n" + " if (theElement.checked) {\n" + " theForm[z].disabled = false;\n" + " } else{\n" + " theForm[z].checked = false;\n" + " theForm[z].disabled = true;\n" + " }\n" + " return;\n" + " }\n" + " }\n" + "}\n\n" + "//--></script>\n" + "<?php\n" + "include_once(DIR_WS_INCLUDES . 'javascript/' . 'webmakers_added_js.php')\n" + "?>\n" + "<script type=\"text/javascript\">\n" + "<!--\n" + "function popupWindow(url) {\n" + " window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')\n" + "}\n" + "function trim(str) {\n" + " return str.replace(/^\\s+|\\s+$/g,\"\");\n" + "}\n\n" + "function getHTTPObject() {\n" + " var xmlhttp;\n" + " /*@cc_on\n" + " @if (@_jscript_version >= 5)\n" + " try {\n" + " xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n" + " } catch (e) {\n" + " try {\n" + " xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n" + " } catch (E) {\n" + " xmlhttp = false;\n" + " }\n" + " }\n" + " @else\n" + " xmlhttp = false;\n" + " @end @*/\n" + " if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {\n" + " try {\n" + " xmlhttp = new XMLHttpRequest();\n" + " } catch (e) {\n" + " xmlhttp = false;\n" + " }\n" + " }\n" + " return xmlhttp;\n" + "}\n\n" + "var img_file;\n\n" + "function handleHttpResponse() {\n" + " if (http.readyState == 4) {\n" + " results = http.responseText;\n" + " obj = document.getElementById(img_file);\n" + " obj.innerHTML = results;\n" + " }\n" + "}\n" + "<?php\n" + "if ($request_type == 'SSL') {\n" + "?>\n" + "var url = \"<?php echo HTTPS_SERVER; ?>\";\n" + "<?php\n" + "} else {\n" + "?>\n" + "var url = \"<?php echo HTTP_SERVER; ?>\";\n" + "<?php\n" + "}\n" + "?>\n" + "function previewFile(obj1, obj2, obj3, obj) {\n" + " pathobj = document.getElementById(obj);\n" + " path = unescape(pathobj.value);\n" + " if (path == '/') {\n" + " path = '';\n" + " }\n" + " imgurl = url + '<?php echo DIR_WS_CATALOG; ?>' + 'images/' + path + obj1.value;\n" + " img = document.getElementById(obj2);\n" + " img.src = imgurl;\n" + " fileobj = document.getElementById(obj3);\n" + " fileobj.value = obj1.value;\n" + "}\n\n" + "function listFile(obj, obj2, obj3, obj4) {\n" + " img_file = obj3;\n" + " listurl = url + '<?php echo DIR_WS_ADMIN; ?>' + 'get_file_list.php?';\n" + "<?php\n" + "if (isset($_GET[tep_session_name()])) {\n" + "?>\n" + " listurl += '<?php echo tep_session_name() . '=' . $_GET[tep_session_name()] . '&'; ?>'\n" + "<?php\n" + "}\n" + "?>\n" + " listurl += 'dir=' + escape(obj.value) + '&field=' + obj2 + '&field2=' + obj4 + '&field3=' + obj.name;\n" + " http.open(\"GET\", listurl, true);\n" + " http.onreadystatechange = handleHttpResponse;\n" + " http.send(null);\n" + " document.getElementById(obj2).src = '';\n" + "}\n\n" + "var http = getHTTPObject();\n" + "//-->\n" + "</script>\n" + "</head>\n" + "<body marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bgcolor=\"#FFFFFF\" onLoad=\"SetFocus();\">\n" + "<div id=\"spiffycalendar\" class=\"text\"></div>\n" + "<!-- header //-->\n" + "<?php require(DIR_WS_INCLUDES . 'header.php'); ?>\n" + "<!-- header_eof //-->\n" + "<!-- body //-->\n" + "<div id=\"body\">\n" + "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" class=\"body-table\">\n" + " <tr>\n" + " <?php\n" + " if(defined('BOX_WIDTH')){\n" + " $boxwidth = BOX_WIDTH ;\n" + " } else {\n" + " $boxwidth = 150 ;\n" + " }\n" + " ?>\n" + " <!-- left_navigation //-->\n" + " <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>\n" + " <!-- left_navigation_eof //-->\n" + " <!-- body_text //-->\n" + " <td class=\"page-container\" valign=\"top\">\n" + " <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <?php\n" + " $manage_image = new DirSelect($ImageLocations);\n" + " $image_dir = $manage_image->getDirs();\n" + " $image_file = $manage_image->getFiles('');\n" + " $file_dir = '<option value=\"\">/</option>';\n" + " foreach($image_dir as $relative => $fullpath) {\n" + " if (substr($relative, -1) == '/'){\n" + " $relative = substr($relative, 1);\n" + " $file_dir .= '<option value=\"' . rawurlencode($relative) . '\">' . $relative . '</option>';\n" + " }\n" + " }\n" + " $file_list = '<option value=\"\"> -- None -- </option>';\n" + " foreach ($image_file[1] as $relative => $fullpath) {\n" + " $file_list .= '<option value=\"' . rawurlencode($relative) . '\">' . $relative . '</option>';\n" + " }\n" + " if ( isset($action) && ($action == 'new_category' || $action == 'edit_category') ) {\n" + " if ( ($cID) && (!$_POST) ) {\n" + " $categories_query = tep_db_query(\"select c.categories_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, cd.categories_head_title_tag, cd.categories_head_desc_tag, cd.categories_head_keywords_tag, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified,products_group_access, c.products_nav_access from \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd where c.categories_id = '\" . $cID . \"' and c.categories_id = cd.categories_id and cd.language_id = '\" . $languages_id . \"' order by c.sort_order, cd.categories_name\");\n" + " $category = tep_db_fetch_array($categories_query);\n" + " $cInfo = new objectInfo($category);\n" + " } elseif ($_POST) {\n" + " $cInfo = new objectInfo($_POST);\n" + " $categories_name = (isset($_POST['categories_name']) ? $_POST['categories_name'] : '' );\n" + " $categories_heading_title = (isset($_POST['categories_heading_title']) ? $_POST['categories_heading_title'] : '' );\n" + " $categories_description = (isset($_POST['categories_description']) ? $_POST['categories_description'] : '' );\n" + " $categories_head_title_tag = (isset($_POST['categories_head_title_tag']) ? $_POST['categories_head_title_tag'] : '' );\n" + " $categories_head_desc_tag = (isset($_POST['categories_head_desc_tag']) ? $_POST['categories_head_desc_tag'] : '' );\n" + " $categories_head_keywords_tag = (isset($_POST['categories_head_keywords_tag']) ? $_POST['categories_head_keywords_tag'] : '' );\n" + " $categories_url = (isset($_POST['categories_url']) ? $_POST['categories_url'] : '' );\n" + " $categories_image = (isset($_POST['categories_image']) ? $_POST['categories_image'] : '' );\n" + " } else {\n" + " $cInfo = new objectInfo(array());\n" + " $cInfo ->categories_name = (isset($cInfo ->categories_name) ? $cInfo ->categories_name : '' );\n" + " $cInfo ->categories_heading_title = (isset($_POST['categories_heading_title']) ? $_POST['categories_heading_title'] : '' );\n" + " $cInfo ->categories_description = (isset($_POST['categories_description']) ? $_POST['categories_description'] : '' );\n" + " $cInfo ->categories_head_title_tag = (isset($_POST['categories_head_title_tag']) ? $_POST['categories_head_title_tag'] : '' );\n" + " $cInfo ->categories_head_desc_tag = (isset($_POST['categories_head_desc_tag']) ? $_POST['categories_head_desc_tag'] : '' );\n" + " $cInfo ->categories_head_keywords_tag = (isset($_POST['categories_head_keywords_tag']) ? $_POST['categories_head_keywords_tag'] : '' );\n" + " $cInfo ->categories_url = (isset($_POST['categories_url']) ? $_POST['categories_url'] : '' );\n" + " $cInfo ->categories_image = (isset($cInfo ->categories_image) ? $cInfo ->categories_image : '' );\n" + " $cInfo ->sort_order = (isset($cInfo ->sort_order) ? $cInfo ->sort_order : '' );\n" + " $cInfo ->products_group_access = (isset($cInfo ->products_group_access) ? $cInfo ->products_group_access : '' );\n" + " $cInfo->products_nav_access = (isset($cInfo ->products_nav_access) ? $cInfo ->products_nav_access : '' );\n" + " }\n" + " $languages = tep_get_languages();\n" + " $text_new_or_edit = ($action=='new_category') ? TEXT_INFO_HEADING_NEW_CATEGORY : TEXT_INFO_HEADING_EDIT_CATEGORY;\n" + " // editor functions\n" + " echo tep_load_html_editor();\n" + " $category_elements = '';\n" + " for ($i=0; $i<sizeof($languages); $i++) {\n" + " $category_elements .= 'categories_description[' . $languages[$i]['id'] . '],';\n" + " }\n" + " echo tep_insert_html_editor($category_elements);\n" + " // editor functions eof\n" + " // RCI start\n" + " echo $cre_RCI->get('categories', 'cedittop');\n" + " // RCI eof\n" + " ?>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"pageHeading\">\n" + " <?php echo sprintf($text_new_or_edit, tep_output_generated_category_path($current_category_id)); ?> \n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetcinfo\n" + " if ($cre_RCO->get('categories', 'fieldsetcinfo') !== true) { \n" + " ?> \n" + " <tr>\n" + " <?php echo tep_draw_form('new_category', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=new_category_preview', 'post', 'enctype=\"multipart/form-data\"'); ?>\n" + " <td><fieldset><legend><?php echo TEXT_GENERAL_OPTIONS; ?></legend>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\" align=\"center\" summary=\"category image and sort order\">\n" + " <tr valign=\"top\">\n" + " <?php echo tep_draw_hidden_field('categories_previous_image', (isset($cInfo->categories_image) ? $cInfo->categories_image :'')); ?>\n" + " <td width=\"33%\" class=\"main\">\n" + " <div class=\"tab-pane\" id=\"imgTabPane1\">\n" + " <script type=\"text/javascript\">\n" + " imgTp1 = new WebFXTabPane( document.getElementById( \"imgTabPane1\" ) );\n" + " </script>\n" + " <div class=\"tab-page\" id=\"new_file\">\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_NEW_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp1.addTabPage( document.getElementById( \"new_file\" ) );</script>\n" + " <strong><?php echo TEXT_EDIT_CATEGORIES_IMAGE; ?></strong><br><?php echo tep_draw_file_field('categories_image'); ?>\n" + " <br><br>\n" + " <strong><?php echo TEXT_SELECT_CATEGORIES_IMAGE_DIR; ?></strong><br><select name=\"file_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </div>\n" + " <div class=\"tab-page\" id=\"existing_file\">\n" + " <input type=\"hidden\" name=\"file_exist_dest\" id=\"file_exist_dest\" value=\"\">\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_EXISTING_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp1.addTabPage( document.getElementById( \"existing_file\" ) );</script>\n" + " <strong><?php echo TEXT_CATEGORIES_IMAGE_DIR; ?></strong><select name=\"file_dir_exist_dest\" class=\"dirWidth\" id=\"file_dir_exist_dest\" onChange=\"listFile(this, 'img_file_preview', 'img_file', 'file_exist_dest');\"><?php echo $file_dir; ?></select>\n" + " <div id=\"img_file\"><b><?php echo TEXT_CATEGORIES_IMAGE_FILE; ?></b><select name=\"file_exist_dest_select\" class=\"dirWidth\" id=\"file_exist_dest_select\" onChange=\"previewFile(this, 'img_file_preview', 'file_exist_dest', 'file_dir_exist_dest');\"><?php echo $file_list; ?></select></div>\n" + " <div align=\"right\"><img id=\"img_file_preview\" src=\"\" /></div>\n" + " </div>\n" + " </div>\n" + " </td>\n" + " <td width=\"33%\" class=\"main\" align=\"center\">\n" + " <?php \n" + " if ($cInfo->categories_image == '') { } else {?>\n" + " <strong><?php echo TEXT_EXISTING_CATEGORIES_IMAGE; ?></strong><br>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_image, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"center\" hspace=\"0\" vspace=\"5\"') . '<br>' . $cInfo->categories_image . '<br>' . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image);\n" + " }\n" + " if (!($cInfo->categories_image =='')) {\n" + " echo '<br> <input type=\"checkbox\" name=\"unlink_cat_image\" value=\"yes\">' . TEXT_CATEGORIES_IMAGE_REMOVE_SHORT;\n" + " echo '<br> <input type=\"checkbox\" name=\"delete_cat_image\" value=\"yes\">' . TEXT_CATEGORIES_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'). '</td>';\n" + " }\n" + " ?>\n" + " </td>\n" + " <td width=\"33%\" class=\"main\" align=\"center\"><strong><?php echo TEXT_EDIT_SORT_ORDER; ?></strong>&nbsp;<?php echo tep_draw_input_field('sort_order', $cInfo->sort_order, 'size=\"2\"'); ?></td>\n" + " </tr>\n" + " </table>\n" + " </fieldset></td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetcinfo\n" + " ?> \n" + " <tr>\n" + " <td colspan=\"3\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetcdescr \n" + " if ($cre_RCO->get('categories', 'fieldsetcdescr') !== true) { \n" + " ?> \n" + " <tr>\n" + " <td colspan=\"3\">\n" + " <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" align=\"center\">\n" + " <tr>\n" + " <td class=\"main\" valign=\"top\" width=\"100%\"><div class=\"tab-pane\" id=\"tabPane1\">\n" + " <script type=\"text/javascript\">\n" + " tp1 = new WebFXTabPane( document.getElementById( \"tabPane1\" ) );\n" + " </script>\n" + " <?php\n" + " for ($i=0; $i<sizeof($languages); $i++) {\n" + " ?>\n" + " <div class=\"tab-page\" id=\"<?php echo $languages[$i]['name'];?>\">\n" + " <h2 class=\"tab\"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'], '', '', 'align=\"middle\" style=\"height:16px; width:30px;\"') . '&nbsp;' .$languages[$i]['name'];?></h2>\n" + " <script type=\"text/javascript\">tp1.addTabPage( document.getElementById( \"<?php echo $languages[$i]['name'];?>\" ) );</script>\n" + " <table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" summary=\"tab table\">\n" + " <tr>\n" + " <td valign=\"top\">\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\" summary=\"Title table\">\n" + " <tr valign=\"top\">\n" + " <td class=\"main\" width=\"20%\"><strong><?php echo TEXT_EDIT_CATEGORIES_NAME; ?></strong></td>\n" + " <td class=\"main\" width=\"80%\">\n" + " <?php\n" + " if (isset($cInfo->categories_id)) {\n" + " echo tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', (isset($categories_name[$languages[$i]['id']]) ? stripslashes($categories_name[$languages[$i]['id']]) : tep_get_category_name($cInfo->categories_id, $languages[$i]['id'])), 'size=\"64\" maxlength=\"64\"'); \n" + " } else{\n" + " echo tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', (isset($categories_name[$languages[$i]['id']]) ? stripslashes($categories_name[$languages[$i]['id']]) : ''), 'size=\"64\" maxlength=\"64\"'); \n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " <tr valign=\"top\">\n" + " <td class=\"main\" width=\"20%\"><strong><?php echo TEXT_EDIT_CATEGORIES_HEADING_TITLE; ?></strong></td>\n" + " <td class=\"main\">\n" + " <?php\n" + " if (isset($cInfo->categories_id)) {\n" + " echo tep_draw_input_field('categories_heading_title[' . $languages[$i]['id'] . ']', (isset($categories_heading_title[$languages[$i]['id']]) ? stripslashes($categories_heading_title[$languages[$i]['id']]) : tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id'])), 'size=\"64\" maxlength=\"64\"'); \n" + " } else {\n" + " echo tep_draw_input_field('categories_heading_title[' . $languages[$i]['id'] . ']', (isset($categories_heading_title[$languages[$i]['id']]) ? stripslashes($categories_heading_title[$languages[$i]['id']]) : ''), 'size=\"64\" maxlength=\"64\"'); \n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>\n" + " </tr>\n" + " </table>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\" summary=\"description tabe\">\n" + " <tr valign=\"top\">\n" + " <td class=\"main\"><strong><?php echo TEXT_EDIT_CATEGORIES_DESCRIPTION; ?></strong></td>\n" + " </tr>\n" + " <tr>\n" + " <td>\n" + " <?php\n" + " if (isset($cInfo->categories_id)) {\n" + " echo tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($categories_description[$languages[$i]['id']]) ? stripslashes($categories_description[$languages[$i]['id']]) : tep_get_category_description($cInfo->categories_id, $languages[$i]['id'])));\n" + " } else {\n" + " echo tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($categories_description[$languages[$i]['id']]) ? stripslashes($categories_description[$languages[$i]['id']]) : ''));\n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\" summary=\"meta content holder table\">\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetcmeta \n" + " if ($cre_RCO->get('categories', 'fieldsetcmeta') !== true) { \n" + " ?> \n" + " <tr>\n" + " <td valign=\"top\"><fieldset><legend><?php echo TEXT_PRODUCT_METTA_INFO; ?></legend>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n" + " <tr>\n" + " <td class=\"main\"><strong><?php echo TEXT_EDIT_CATEGORIES_TITLE_TAG; ?></strong></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\">\n" + " <?php\n" + " if (isset($cInfo->categories_id)) {\n" + " echo tep_draw_textarea_field('categories_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '15', '1', (isset($categories_head_title_tag[$languages[$i]['id']]) ? stripslashes($categories_head_title_tag[$languages[$i]['id']]) : tep_get_category_head_title_tag($cInfo->categories_id, $languages[$i]['id'])),'style=\"width: 100%\"');\n" + " } else {\n" + " echo tep_draw_textarea_field('categories_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '15', '1', (isset($categories_head_title_tag[$languages[$i]['id']]) ? stripslashes($categories_head_title_tag[$languages[$i]['id']]) : ''),'style=\"width: 100%\"');\n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n" + " <tr>\n" + " <td width=\"50%\" class=\"main\"><strong><?php echo TEXT_EDIT_CATEGORIES_DESC_TAG;?></strong></td>\n" + " <td width=\"50%\" class=\"main\"><strong><?php echo TEXT_EDIT_CATEGORIES_KEYWORDS_TAG; ?></strong></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\">\n" + " <?php\n" + " if (isset($cInfo->categories_id)) {\n" + " echo tep_draw_textarea_field('categories_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '25', '5', (isset($categories_head_desc_tag[$languages[$i]['id']]) ? stripslashes($categories_head_desc_tag[$languages[$i]['id']]) : tep_get_category_head_desc_tag($cInfo->categories_id, $languages[$i]['id'])),'style=\"width: 100%\"');\n" + " } else {\n" + " echo tep_draw_textarea_field('categories_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '25', '5', (isset($categories_head_desc_tag[$languages[$i]['id']]) ? stripslashes($categories_head_desc_tag[$languages[$i]['id']]) : ''),'style=\"width: 100%\"');\n" + " }\n" + " ?>\n" + " </td>\n" + " <td class=\"main\">\n" + " <?php\n" + " if (isset($cInfo->categories_id)) {\n" + " echo tep_draw_textarea_field('categories_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '25', '5', (isset($categories_head_keywords_tag[$languages[$i]['id']]) ? stripslashes($categories_head_keywords_tag[$languages[$i]['id']]) : tep_get_category_head_keywords_tag($cInfo->categories_id, $languages[$i]['id'])),'style=\"width: 100%\"');\n" + " } else {\n" + " echo tep_draw_textarea_field('categories_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '25', '5', (isset($categories_head_keywords_tag[$languages[$i]['id']]) ? stripslashes($categories_head_keywords_tag[$languages[$i]['id']]) : ''),'style=\"width: 100%\"');\n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " <br>\n" + " </fieldset></td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetcmeta\n" + " ?>\n" + " </table>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </div>\n" + " <?php\n" + " }\n" + " ?>\n" + " </div>\n" + " <script type=\"text/javascript\">\n" + " //<![CDATA[\n" + " setupAllTabs();\n" + " //]]>\n" + " </script>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"3\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " </table>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetcdescr\n" + " ?>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetcgroups\n" + " if ($cre_RCO->get('categories', 'fieldsetcgroups') !== true) { \n" + " ?> \n" + " <tr>\n" + " <td><fieldset><legend><?php echo TEXT_PRODUCTS_GROUP_ACCESS; ?></legend>\n" + " <table width=\"80%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\" align=\"center\" summary=\"category Image and sort order\">\n" + " <tr valign=\"top\">\n" + " <td width=\"50%\" class=\"main\">&nbsp;\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <tr>\n" + " <td class=\"main\">\n" + " <?php\n" + " $customergroup_query = tep_db_query(\"select customers_group_name,customers_group_id from \".TABLE_CUSTOMERS_GROUPS . \" where group_status = '1' and group_access = '1'\");\n" + " while ($customergroup = tep_db_fetch_array($customergroup_query)) {\n" + " $products_groups[] = $customergroup;\n" + " if ($customergroup['customers_group_id'] == '0') {\n" + " $products_groups[] = array('customers_group_id' => 'G', 'customers_group_name' => 'Guest');\n" + " }\n" + " }\n" + " echo tep_draw_checkbox_field('access', '', false, '', 'onclick=\"checkUncheckAll(this, \\'products_group_access[]\\');\"') . ' ' . TEXT_ACCESS . '<br>';\n" + " $products_group_access = array();\n" + " $products_group_array = explode(',',$cInfo->products_group_access);\n" + " if (!tep_not_null($cInfo->categories_id)) {\n" + " $cid_array = explode('_', $_GET['cPath']);\n" + " $cid = array_pop($cid_array);\n" + " $customergroup = tep_db_fetch_array(tep_db_query(\"select products_group_access from \".TABLE_CATEGORIES . \" where categories_id = '\" . $cid . \"'\"));\n" + " $products_groups1 = explode(',', $customergroup['products_group_access']);\n" + " foreach ($products_groups1 as $value) {\n" + " $products_group_access[$value['customers_group_id']] = true;\n" + " }\n" + " } else {\n" + " foreach ($products_group_array as $value) {\n" + " $products_group_access[$value] = true;\n" + " }\n" + " }\n" + " foreach ($products_groups as $value) {\n" + " if ($value['customers_group_id'] == 'G') {\n" + " echo '&nbsp;&nbsp;';\n" + " }\n" + " echo '&nbsp;&nbsp;' . tep_draw_checkbox_field('products_group_access[]', $value['customers_group_id'], isset($products_group_access[$value['customers_group_id']]), '', ($value['customers_group_id'] == '0' ? 'onclick=\"retailCheck(this, \\'products_group_access[]\\');\"' : '')) . ' ' . $value['customers_group_name'] . '<br>';\n" + " }\n" + " ?>\n" + " </td>\n" + " <td class=\"main\" width=\"50%\">\n" + " <?php /* commented out - this is for future use\n" + " echo tep_draw_checkbox_field('show_in_nav', '', false, '', 'onclick=\"checkUncheckAll(this, \\'products_nav_access[]\\');\"') . ' ' . TEXT_SHOW_IN_NAV . '<br>';\n" + " $products_group_access = array();\n" + " $products_group_array = explode(',',$cInfo->products_nav_access);\n" + " foreach ($products_group_array as $value) {\n" + " $products_group_access[$value] = true;\n" + " }\n" + " foreach ($products_groups as $value) {\n" + " echo '&nbsp;&nbsp;' . tep_draw_checkbox_field('products_nav_access[]', $value['customers_group_id'], isset($products_group_access[$value['customers_group_id']])) . ' ' . $value['customers_group_name'] . '<br>';\n" + " }\n" + " */ ?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </td>\n" + " <td><fieldset><legend><?php echo TEXT_PUSH_SAVE_OPTION;?></legend>\n" + " <?php\n" + " echo tep_draw_radio_field('Push', '1').TEXT_DO_NOT_PUSH.\"<br>\";\n" + " echo tep_draw_radio_field('Push', '2').TEXT_PUSH_SUB_CATEGORIES.\"<br>\";\n" + " echo tep_draw_radio_field('Push', '3').TEXT_PUSH_SUB_CATEGORIES_PRODUCTS.\"<br><br>\";\n" + " echo tep_image('images/icons/warning.gif',TEXT_PUSH_WARNING) . '&nbsp;<font size=\"1\">'.TEXT_PUSH_WARNING.'</font>'.\"<br>\";\n" + " ?>\n" + " </fieldset></td>\n" + " </tr>\n" + " </table>\n" + " </fieldset></td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetcgroups \n" + " ?>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <tr>\n" + " <td class=\"main\" align=\"right\">\n" + " <?php\n" + " echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($cID) ? '&cID=' . $cID : '')) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>&nbsp;' . tep_draw_hidden_field('categories_date_added', (isset($cInfo->date_added) ? $cInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $cInfo->parent_id) . tep_image_submit('button_preview_upload.gif', IMAGE_PREVIEW) . '&nbsp;&nbsp;'; \n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </form>\n" + " <?php\n" + " // new_category_preview (active when ALLOW_CATEGORY_DESCRIPTIONS is 'true')\n" + " } else if (isset($action) && $action == 'new_category_preview') {\n" + " if (isset($_POST)) {\n" + " $cInfo = new objectInfo($_POST);\n" + " $categories_name = $_POST['categories_name'];\n" + " $categories_heading_title = $_POST['categories_heading_title'];\n" + " $categories_description = $_POST['categories_description'];\n" + " $categories_head_title_tag = $_POST['categories_head_title_tag'];\n" + " $categories_head_desc_tag = $_POST['categories_head_desc_tag'];\n" + " $categories_head_keywords_tag = $_POST['categories_head_keywords_tag'];\n" + " $categories_image = (isset($_POST['categories_image']) ? $_POST['categories_image'] : '');\n" + " $categories_previous_image = (isset($_POST['categories_previous_image']) ? $_POST['categories_previous_image'] : '');\n" + " $categories_type_image = (isset($_POST['categories_type_image']) ? $_POST['categories_type_image'] : '');\n" + " $categories_file_destination = (isset($_POST['file_destination']) ? $_POST['file_destination'] : '');\n" + " $categories_file_destination = str_ireplace( \"%2F\", \"/\", $categories_file_destination);\n" + " $unlink_cat_image = (isset($_POST['unlink_cat_image']) ? $_POST['unlink_cat_image'] : '');\n" + " $delete_cat_image = (isset($_POST['delete_cat_image']) ? $_POST['delete_cat_image'] : '');\n" + " // copy image only if modified\n" + " if ( (isset($_POST['delete_cat_image'])) && ($_POST['delete_cat_image'] == 'yes') ) {\n" + " unlink(DIR_FS_CATALOG_IMAGES . $categories_previous_image);\n" + " }\n" + " if (((isset($_POST['unlink_cat_image'])) && ($_POST['unlink_cat_image'] == 'yes')) || ((isset($_POST['delete_cat_image'])) && ($_POST['delete_cat_image'] == 'yes'))) {\n" + " $categories_image = '';\n" + " $categories_image_name = '';\n" + " } else {\n" + " $categories_image_tmp = '';\n" + " $categories_image_tmp = new upload('categories_image');\n" + " $categories_image_tmp->set_destination(DIR_FS_CATALOG_IMAGES . $categories_file_destination);\n" + " if ($categories_image_tmp->parse() && $categories_image_tmp->save()) {\n" + " $categories_image_name = $categories_file_destination . $categories_image_tmp->filename;\n" + " } elseif (isset($_POST['file_exist_dest']) && tep_not_null($_POST['file_exist_dest'])) {\n" + " $categories_image_name = rawurldecode($_POST['file_dir_exist_dest']) . $_POST['file_exist_dest'];\n" + " } else if (is_file(DIR_FS_CATALOG_IMAGES . $categories_file_destination . $categories_image)){\n" + " $categories_image_name = $categories_file_destination . $categories_image;\n" + " } else {\n" + " $categories_image_name = $categories_previous_image;\n" + " }\n" + " }\n" + " } else {\n" + " $category_query = tep_db_query(\"select c.categories_id, cd.language_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, cd.categories_head_title_tag, cd.categories_head_desc_tag, cd.categories_head_keywords_tag, c.categories_image, c.sort_order, c.date_added, c.last_modified from \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd where c.categories_id = cd.categories_id and c.categories_id = '\" . $cID . \"'\");\n" + " $category = tep_db_fetch_array($category_query);\n" + " $cInfo = new objectInfo($category);\n" + " $categories_image_name = $cInfo->categories_image;\n" + " }\n" + " $form_action = ((isset($cID)) && tep_not_null($cID) ) ? 'update_category' : 'insert_category';\n" + " echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=' . $form_action, 'post', 'enctype=\"multipart/form-data\"');\n" + " $read = '';\n" + " if (isset($_GET['read'])){\n" + " $read = $_GET['read'];\n" + " }\n" + " $languages = tep_get_languages();\n" + " for ($i=0; $i<sizeof($languages); $i++) {\n" + " if ($read == 'only') {\n" + " $cInfo->categories_name = tep_get_category_name($cInfo->categories_id, $languages[$i]['id']);\n" + " $cInfo->categories_heading_title = tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']);\n" + " $cInfo->categories_description = tep_get_category_description($cInfo->categories_id, $languages[$i]['id']);\n" + " $cInfo->category_template_id = tep_get_category_template_id($cInfo->categories_id, $languages[$i]['id']);\n" + " $cInfo->categories_head_title_tag = tep_get_category_head_title_tag($cInfo->categories_id, $languages[$i]['id']);\n" + " $cInfo->categories_head_desc_tag = tep_get_category_head_desc_tag($cInfo->categories_id, $languages[$i]['id']);\n" + " $cInfo->categories_head_keywords_tag = tep_get_category_head_keywords_tag($cInfo->categories_id, $languages[$i]['id']);\n" + " } else {\n" + " $cInfo->categories_name = tep_db_prepare_input($categories_name[$languages[$i]['id']]);\n" + " $cInfo->categories_heading_title = tep_db_prepare_input($categories_heading_title[$languages[$i]['id']]);\n" + " $cInfo->categories_description = tep_db_prepare_input($categories_description[$languages[$i]['id']]);\n" + " $cInfo->category_template_id = (isset($category_template_id[$languages[$i]['id']]) ? tep_db_prepare_input($category_template_id[$languages[$i]['id']]) : 0) ;\n" + " $cInfo->categories_head_title_tag = tep_db_prepare_input($categories_head_title_tag[$languages[$i]['id']]);\n" + " $cInfo->categories_head_desc_tag = tep_db_prepare_input($categories_head_desc_tag[$languages[$i]['id']]);\n" + " $cInfo->categories_head_keywords_tag = tep_db_prepare_input($categories_head_keywords_tag[$languages[$i]['id']]);\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td class=\"pageHeading\"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $cInfo->categories_heading_title; ?></td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php //echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $categories_image_name, $cInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"right\" hspace=\"5\" vspace=\"5\"') . $cInfo->categories_description; ?>\n" + " \n" + " <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td class=\"main\" ><?php echo $cInfo->categories_description; ?></td>\n" + " <td class=\"main\" width=\"10\"></td>\n" + " <?php \n" + " if ($categories_image_name) {\n" + " echo '<td class=\"main\" valign=\"top\" >' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $categories_image_name, $categories_image_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"right\" hspace=\"5\" vspace=\"5\"') . '</td>'; \n" + " }\n" + " ?> \n" + " </tr>\n" + " </table>\n\n\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " if ($read == 'only') {\n" + " if (isset($_GET['origin'])) {\n" + " $pos_params = strpos($_GET['origin'], '?', 0);\n" + " if ($pos_params != false) {\n" + " $back_url = substr($_GET['origin'], 0, $pos_params);\n" + " $back_url_params = substr($_GET['origin'], $pos_params + 1);\n" + " } else {\n" + " $back_url = $_GET['origin'];\n" + " $back_url_params = '';\n" + " }\n" + " } else {\n" + " $back_url = FILENAME_CATEGORIES;\n" + " $back_url_params = 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id;\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td align=\"right\"><?php echo '<a href=\"' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '\">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>\n" + " </tr>\n" + " <?php\n" + " } else {\n" + " ?>\n" + " <tr>\n" + " <td align=\"right\" class=\"smallText\">\n" + " <?php\n" + " reset($_POST);\n" + " while (list($key, $value) = each($_POST)) {\n" + " if (is_array($value)) {\n" + " while (list($k, $v) = each($value)) {\n" + " echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v))) . \"\\n\";\n" + " }\n" + " } else {\n" + " echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value))) . \"\\n\";\n" + " }\n" + " }\n" + " echo tep_draw_hidden_field('X_categories_image', stripslashes($categories_image_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('categories_image_name', stripslashes($categories_image_name)) . \"\\n\";\n" + " echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name=\"edit\"') . \"\\n\\n\"; \n" + " echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>&nbsp;';\n" + " if ($cID) {\n" + " echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . \"\\n\";\n" + " } else {\n" + " echo tep_image_submit('button_insert.gif', IMAGE_INSERT) . \"\\n\";\n" + " } \n" + " ?>&nbsp;\n" + " </td>\n" + " </form>\n" + " </tr>\n" + " <?php\n" + " }\n" + " } elseif ($action == 'new_product') {\n" + " $parameters = array('products_name' => '',\n" + " 'products_blurb' => '',\n" + " 'products_description' => '',\n" + " 'products_url' => '',\n" + " 'products_id' => '',\n" + " 'products_quantity' => '',\n" + " 'products_model' => '',\n" + " 'products_image' => '',\n" + " 'products_image_med' => '',\n" + " 'products_image_lrg' => '',\n" + " 'products_image_sm_1' => '',\n" + " 'products_image_xl_1' => '',\n" + " 'products_image_sm_2' => '',\n" + " 'products_image_xl_2' => '',\n" + " 'products_image_sm_3' => '',\n" + " 'products_image_xl_3' => '',\n" + " 'products_image_sm_4' => '',\n" + " 'products_image_xl_4' => '',\n" + " 'products_image_sm_5' => '',\n" + " 'products_image_xl_5' => '',\n" + " 'products_image_sm_6' => '',\n" + " 'products_image_xl_6' => '',\n" + " 'products_price' => '',\n" + " 'products_price1' => '',\n" + " 'products_price2' => '',\n" + " 'products_price3' => '',\n" + " 'products_price4' => '',\n" + " 'products_price5' => '',\n" + " 'products_price6' => '',\n" + " 'products_price7' => '',\n" + " 'products_price8' => '',\n" + " 'products_price9' => '',\n" + " 'products_price10' => '',\n" + " 'products_price11' => '',\n" + " 'products_price1_qty' => '',\n" + " 'products_price2_qty' => '',\n" + " 'products_price3_qty' => '',\n" + " 'products_price4_qty' => '',\n" + " 'products_price5_qty' => '',\n" + " 'products_price6_qty' => '',\n" + " 'products_price7_qty' => '',\n" + " 'products_price8_qty' => '',\n" + " 'products_price9_qty' => '',\n" + " 'products_price10_qty' => '',\n" + " 'products_price11_qty' => '',\n" + " 'products_qty_blocks' => '',\n" + " 'products_group_access' => 'G,0',\n" + " 'products_nav_access' => 'G,0',\n" + " 'products_weight' => '',\n" + " 'products_date_added' => '',\n" + " 'products_last_modified' => '',\n" + " 'products_date_available' => date('Y-m-d'),\n" + " 'products_status' => '',\n" + " 'products_tax_class_id' => '',\n" + " 'manufacturers_id' => '',\n" + " 'sort_order' => '',\n" + " 'products_qty_days' => '',\n" + " 'products_qty_years' => '');\n" + " \n" + " $pInfo = new objectInfo($parameters);\n" + " if (isset($pID) && empty($_POST)) {\n" + " $products_extra_fields_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" WHERE products_id=\" . (int)$pID);\n" + " while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {\n" + " $extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];\n" + " $extra_field_array=array('extra_field'=>$extra_field);\n" + " $pInfo->objectInfo($extra_field_array);\n" + " }\n" + " $product_query = tep_db_query(\"select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.vendors_id, p.vendors_prod_id, p.vendors_prod_comments, p.vendors_product_price, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id,products_group_access, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, p.products_price11_qty, p.products_group_access, p.products_nav_access, p.sort_order, p.products_qty_days, p.products_qty_years from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_DESCRIPTION . \" pd where p.products_id = '\" . (int)$pID . \"' and p.products_id = pd.products_id and pd.language_id = '\" . (int)$languages_id . \"'\");\n" + " $product = tep_db_fetch_array($product_query);\n" + " if (!empty($product)){\n" + " $pInfo->objectInfo($product);\n" + " }\n" + " } elseif ((isset($_POST)) && (tep_not_null($_POST)) ){\n" + " $pInfo->objectInfo($_POST);\n" + " $products_name = $_POST['products_name'];\n" + " $products_blurb = $_POST['products_blurb']; \n" + " $products_description = $_POST['products_description'];\n" + " $products_url = $_POST['products_url'];\n" + " }\n" + " $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));\n" + " $manufacturers_query = tep_db_query(\"select manufacturers_id, manufacturers_name from \" . TABLE_MANUFACTURERS . \" order by manufacturers_name\");\n" + " while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {\n" + " $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],\n" + " 'text' => $manufacturers['manufacturers_name']);\n" + " }\n" + " // multi-vendor shipping\n" + " $vendors_array = array(array('id' => '1', 'text' => 'NONE'));\n" + " $vendors_query = tep_db_query(\"select vendors_id, vendors_name from \" . TABLE_VENDORS . \" order by vendors_name\");\n" + " while ($vendors = tep_db_fetch_array($vendors_query)) {\n" + " $vendors_array[] = array('id' => $vendors['vendors_id'],\n" + " 'text' => $vendors['vendors_name']);\n" + " }\n" + " // multi-vendor shipping //eof \n" + " $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));\n" + " $tax_class_query = tep_db_query(\"select tax_class_id, tax_class_title from \" . TABLE_TAX_CLASS . \" order by tax_class_title\");\n" + " while ($tax_class = tep_db_fetch_array($tax_class_query)) {\n" + " $tax_class_array[] = array('id' => $tax_class['tax_class_id'],\n" + " 'text' => $tax_class['tax_class_title']);\n" + " }\n" + " $languages = tep_get_languages();\n" + " if (!isset($pInfo->products_status)) $pInfo->products_status = '1';\n" + " switch ($pInfo->products_status) {\n" + " case '0': $in_status = false; $out_status = true; break;\n" + " case '1':\n" + " default: $in_status = true; $out_status = false;\n" + " }\n" + " ?>\n" + " <script type=\"text/javascript\">\n" + " <!--\n" + " var dateAvailable = new ctlSpiffyCalendarBox(\"dateAvailable\", \"new_product\", \"products_date_available\",\"btnDate1\",\"<?php echo $pInfo->products_date_available; ?>\",scBTNMODE_CUSTOMBLUE);\n" + " //-->\n" + " </script>\n" + " <script type=\"text/javascript\"><!--\n" + " var tax_rates = new Array();\n" + " <?php\n" + " for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {\n" + " if ($tax_class_array[$i]['id'] > 0) {\n" + " echo 'tax_rates[\"' . $tax_class_array[$i]['id'] . '\"] = ' . tep_get_tax_rate($tax_class_array[$i]['id']) . ';' . \"\\n\";\n" + " }\n" + " }\n" + " ?>\n" + " function doRound(x, places) {\n" + " return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);\n" + " }\n" + " function getTaxRate() {\n" + " var selected_value = document.forms[\"new_product\"].products_tax_class_id.selectedIndex;\n" + " var parameterVal = document.forms[\"new_product\"].products_tax_class_id[selected_value].value;\n" + " if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {\n" + " return tax_rates[parameterVal];\n" + " } else {\n" + " return 0;\n" + " }\n" + " }\n" + " function updateGross() {\n" + " var taxRate = getTaxRate();\n" + " var grossValue = document.forms[\"new_product\"].products_price.value;\n" + " if (taxRate > 0) {\n" + " grossValue = grossValue * ((taxRate / 100) + 1);\n" + " }\n" + " document.forms[\"new_product\"].products_price_gross.value = doRound(grossValue, 4);\n" + " document.forms[\"new_product\"].products_price0.value = document.forms[\"new_product\"].products_price.value;\n" + " }\n" + " function updateNet() {\n" + " var taxRate = getTaxRate();\n" + " var netValue = document.forms[\"new_product\"].products_price_gross.value;\n" + " if (taxRate > 0) {\n" + " netValue = netValue / ((taxRate / 100) + 1);\n" + " }\n" + " document.forms[\"new_product\"].products_price.value = doRound(netValue, 4);\n" + " document.forms[\"new_product\"].products_price0.value = document.forms[\"new_product\"].products_price.value;\n" + " }\n" + " function setRetailPrice() {\n" + " var newValue = document.forms[\"new_product\"].products_price0.value;\n" + " document.forms[\"new_product\"].products_price.value = newValue;\n" + " updateGross();\n" + " updateNet();\n" + " }\n" + " function checkdelete() {\n" + " var thereturnvalue = true;\n" + " for(i=0; i < document.new_product.elements.length; i++) {\n" + " if (document.new_product.elements[i].name == 'subproddelete[]') {\n" + " if (document.new_product.elements[i].checked) {\n" + " var agree=confirm(\"Are you sure you want to delete these sub-products?\");\n" + " if (agree) {\n" + " thereturnvalue = true;\n" + " break;\n" + " } else {\n" + " thereturnvalue = false;\n" + " break;\n" + " } \n" + " }\n" + " }\n" + " }\n" + " return thereturnvalue;\n" + " }\n" + " //--></script>\n" + " <?php\n" + " // editor functions\n" + " echo tep_load_html_editor();\n" + " $products_elements = '';\n" + " for ($i=0; $i<sizeof($languages); $i++) {\n" + " $products_elements .= 'products_description[' . $languages[$i]['id'] . '],';\n" + " }\n" + " echo tep_insert_html_editor($products_elements);\n" + " // editor functions eof\n" + " // RCI start\n" + " echo $cre_RCI->get('categories', 'pedittop');\n" + " // RCI eof \n" + " if ( !empty($pID) ) {\n" + " $form_action_text = 'Update';\n" + " $form_action_action = 'update_product';\n" + " $form_action_button = tep_image_submit('button_quick_save.gif',IMAGE_UPDATE,'name=\"Operation\" onClick=\"document.pressed=this.value\" VALUE=\"'.$form_action_action.'\"');\n" + " } else {\n" + " $form_action_text = 'Insert';\n" + " $form_action_action = 'insert_product';\n" + " $form_action_button = tep_image_submit('button_quick_save.gif',IMAGE_UPDATE,'name=\"Operation\" onClick=\"document.pressed=this.value\" VALUE=\"'.$form_action_action.'\"');\n" + " }\n" + " ?>\n" + " <script type=\"text/javascript\">\n" + " function OnSubmitForm() {\n" + " if(trim(document.pressed) == '<?php echo $form_action_text;?>') {\n" + " document.new_product.action =\"<?php echo str_replace('&amp;', '&', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&pID=' . $pID : '') . '&action=' . $form_action_action)); ?>\";\n" + " } else if(trim(document.pressed) == 'Preview') {\n" + " document.new_product.action =\"<?php echo str_replace('&amp;', '&', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&pID=' . $pID : '') . '&action=new_product_preview')); ?>\";\n" + " }\n" + " return true;\n" + " }\n" + " </script>\n" + " <form name=\"new_product\" method=\"post\" enctype=\"multipart/form-data\" onSubmit=\"return OnSubmitForm();return checkdelete();setRetailPrice()\">\n" + " <table border=\"0\" width=\"98%\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"> \n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"pageHeading\">\n" + " <?php \n" + " $text_new_or_edit = (isset($_GET['pID'])) ? sprintf(TEXT_INFO_HEADING_EDIT_PRODUCT, tep_get_products_name($_GET['pID'], $language_id)) : sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); \n" + " echo $text_new_or_edit;\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetpinfo\n" + " if ($cre_RCO->get('categories', 'fieldsetpinfo') !== true) { \n" + " ?>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><fieldset><legend><?php echo TEXT_GENERAL_OPTIONS; ?></legend>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr valign=\"top\">\n" + " <td width=\"50%\"><table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_STATUS; ?></td>\n" + " <?php\n" + " $parentid_query = tep_db_query(\"select products_parent_id from products where products_id =\".(int)$pID);\n" + " $parentid = tep_db_fetch_array($parentid_query);\n" + " if ($parentid[\"products_parent_id\"] == 0) {\n" + " ?>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_radio_field('products_status', '1', $in_status) . '&nbsp;' . TEXT_PRODUCT_AVAILABLE . '&nbsp;' . tep_draw_radio_field('products_status', '0', $out_status) . '&nbsp;' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>\n" + " <?php\n" + " } else{\n" + " ?>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_SUBPRODUCT; ?></td> <?php\n" + " }\n" + " ?>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small><?php DATE_FORMAT;?></small></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'; ?>\n" + " <script script type=\"text/javascript\">dateAvailable.writeControl(); dateAvailable.dateFormat=\"yyyy-MM-dd\";</script>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>\n" + " </tr>\n" + " </table></td>\n" + " <td width=\"50%\"><table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_SORT_ORDER; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('sort_order', $pInfo->sort_order); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr> \n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_MODEL; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_model', $pInfo->products_model); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " <?php\n" + " if (defined('MVS_STATUS') && MVS_STATUS == 'true') {\n" + " ?>\n" + " <!-- multi-vendor shipping -->\n" + " <tr>\n" + " <td colspan=\"2\" valign=\"top\" width=\"100%\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td valign=\"top\" width=\"50%\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\" width=\"150\"><?php echo TEXT_PRODUCTS_VENDORS; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_pull_down_menu('vendors_id', $vendors_array, $pInfo->vendors_id); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\" width=\"150\"><?php echo TEXT_VENDORS_PROD_ID; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('vendors_prod_id', $pInfo->vendors_prod_id); ?></td>\n" + " </tr> \n" + " </table></td>\n" + " <td valign=\"top\" width=\"50%\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"> \n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_VENDORS_PROD_COMMENTS; ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo tep_draw_textarea_field('vendors_prod_comments', 'soft', '43', '4', (isset($vendors_prod_comments) ? $vendors_prod_comments : tep_get_vendors_prod_comments($pInfo->products_id))); ?></td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " <!-- multi-vendor shipping //eof -->\n" + " <?php\n" + " }\n" + " ?>\n" + "<?php\n" + "// RCI code start\n" + "echo $cre_RCI->get('categories', 'peditoptions', false); \n" + "// RCI code eof\n" + "?>\n" + " </table>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <tr bgcolor=\"#ebebff\">\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>\n" + " <td class=\"main\"><?php echo '&nbsp;' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange=\"updateGross()\"'); ?></td>\n" + " </tr>\n" + " <tr bgcolor=\"#ebebff\">\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>\n" + " <td class=\"main\"><?php echo '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp=\"updateGross()\"'); ?></td>\n" + " </tr>\n" + " <tr bgcolor=\"#ebebff\">\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>\n" + " <td class=\"main\"><?php echo '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp=\"updateNet()\"'); ?></td>\n" + " </tr>\n" + " <?php\n" + " if (defined('MVS_STATUS') && MVS_STATUS == 'true') {\n" + " ?>\n" + " <!-- multi-vendor shipping -->\n" + " <tr bgcolor=\"#ebebff\">\n" + " <td class=\"main\"><?php echo TEXT_VENDORS_PRODUCT_PRICE_BASE; ?></td>\n" + " <td class=\"main\"><?php echo '&nbsp;' . tep_draw_input_field('vendors_product_price', $pInfo->vendors_product_price, 'onKeyUp=\"updateNet()\"'); ?></td>\n" + " </tr>\n" + " <!-- multi-vendor shipping //eof -->\n" + " <?php\n" + " }\n" + " ?>\n" + " <script type=\"text/javascript\">\n" + " <!--\n" + " updateGross();\n" + " //-->\n" + " </script>\n" + " <tr bgcolor=\"#ebebff\">\n" + " <td class=\"main\" valign='top'><?php echo TEXT_PRODUCTS_GROUP_ACCESS; ?></td>\n" + " <td class=\"main\">\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <tr>\n" + " <td class=\"main\">\n" + " <?php\n" + " $customergroup_query = tep_db_query(\"select customers_group_name,customers_group_id from \".TABLE_CUSTOMERS_GROUPS . \" where group_status = '1' and group_access = '1'\");\n" + " while ($customergroup = tep_db_fetch_array($customergroup_query)) {\n" + " $products_groups[] = $customergroup;\n" + " if ($customergroup['customers_group_id'] == '0') {\n" + " $products_groups[] = array('customers_group_id' => 'G', 'customers_group_name' => 'Guest');\n" + " }\n" + " }\n" + " echo tep_draw_checkbox_field('access', '', false, '', 'onclick=\"checkUncheckAll(this, \\'products_group_access[]\\');\"') . ' ' . TEXT_ACCESS . '<br>';\n" + " $products_group_access = array();\n" + " $products_group_array = explode(',',$pInfo->products_group_access);\n" + " if (!tep_not_null($pInfo->products_id)) {\n" + " $cid_array = explode('_', $_GET['cPath']);\n" + " $cid = array_pop($cid_array);\n" + " $customergroup = tep_db_fetch_array(tep_db_query(\"select products_group_access from \".TABLE_CATEGORIES . \" where categories_id = '\" . $cid . \"'\"));\n" + " $products_groups1 = explode(',', $customergroup['products_group_access']);\n" + " foreach ($products_groups1 as $value) {\n" + " $products_group_access[$value['customers_group_id']] = true;\n" + " }\n" + " } else {\n" + " foreach ($products_group_array as $value) {\n" + " $products_group_access[$value] = true;\n" + " }\n" + " }\n" + " foreach ($products_groups as $value) {\n" + " if ($value['customers_group_id'] == 'G') {\n" + " echo '&nbsp;&nbsp;';\n" + " }\n" + " echo '&nbsp;&nbsp;' . tep_draw_checkbox_field('products_group_access[]', $value['customers_group_id'], isset($products_group_access[$value['customers_group_id']]), '', ($value['customers_group_id'] == '0' ? 'onclick=\"retailCheck(this, \\'products_group_access[]\\');\"' : '')) . ' ' . $value['customers_group_name'] . '<br>';\n" + " }\n" + " ?>\n" + " </td>\n" + " <td class=\"main\" width=\"50%\">&nbsp;\n" + " <?php /* this is reserved for future use\n" + " echo tep_draw_checkbox_field('show_in_nav', '', false, '', 'onclick=\"checkUncheckAll(this, \\'products_nav_access[]\\');\"') . ' ' . TEXT_SHOW_IN_NAV . '<br>';\n" + " $products_group_access = array();\n" + " $products_group_array = explode(',',$pInfo->products_nav_access);\n" + " foreach ($products_group_array as $value) {\n" + " $products_group_access[$value] = true;\n" + " }\n" + " foreach ($products_groups as $value) {\n" + " echo '&nbsp;&nbsp;' . tep_draw_checkbox_field('products_nav_access[]', $value['customers_group_id'], isset($products_group_access[$value['customers_group_id']])) . ' ' . $value['customers_group_name'] . '<br>';\n" + " }\n" + " */ ?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </fieldset></td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetpinfo\n" + " ?> \n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr>\n" + " <?php\n" + " $products_price_qty[1] = $pInfo->products_price1_qty;\n" + " if ($pInfo->products_price1_qty == 0) {\n" + " $products_price_qty[1] = TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[2] = $pInfo->products_price2_qty;\n" + " if ($pInfo->products_price2_qty == 0) {\n" + " $products_price_qty[2] = 2 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[3] = $pInfo->products_price3_qty;\n" + " if ($pInfo->products_price3_qty == 0) {\n" + " $products_price_qty[3] = 3 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[4] = $pInfo->products_price4_qty;\n" + " if ($pInfo->products_price4_qty == 0) {\n" + " $products_price_qty[4] = 4 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[5] = $pInfo->products_price5_qty;\n" + " if ($pInfo->products_price5_qty == 0) {\n" + " $products_price_qty[5] = 5 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[6] = $pInfo->products_price6_qty;\n" + " if ($pInfo->products_price6_qty == 0) {\n" + " $products_price_qty[6] = 6 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[7] = $pInfo->products_price7_qty;\n" + " if ($pInfo->products_price7_qty == 0) {\n" + " $products_price_qty[7] = 7 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[8] = $pInfo->products_price8_qty;\n" + " if ($pInfo->products_price8_qty == 0) {\n" + " $products_price_qty[8] = 8 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[9] = $pInfo->products_price9_qty;\n" + " if ($pInfo->products_price9_qty == 0) {\n" + " $products_price_qty[9] = 9 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[10] = $pInfo->products_price10_qty;\n" + " if ($pInfo->products_price10_qty == 0) {\n" + " $products_price_qty[10] = 10 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price_qty[11] = $pInfo->products_price11_qty;\n" + " if ($pInfo->products_price11_qty == 0) {\n" + " $products_price_qty[11] = 11 * TEXT_PRODUCTS_QTY_DISCOUNT;\n" + " }\n" + " $products_price[1]= $pInfo->products_price1;\n" + " $products_price[2]= $pInfo->products_price2;\n" + " $products_price[3]= $pInfo->products_price3;\n" + " $products_price[4]= $pInfo->products_price4;\n" + " $products_price[5]= $pInfo->products_price5;\n" + " $products_price[6]= $pInfo->products_price6;\n" + " $products_price[7]= $pInfo->products_price7;\n" + " $products_price[8]= $pInfo->products_price8;\n" + " $products_price[9]= $pInfo->products_price9;\n" + " $products_price[10]= $pInfo->products_price10;\n" + " $products_price[11]= $pInfo->products_price11;\n" + " \n" + " // RCO start fieldsetqpb\n" + " if ($cre_RCO->get('categories', 'fieldsetqpb') !== true) { \n" + " ?> \n" + " <tr>\n" + " <td colspan=\"2\">\n" + " <fieldset><legend><?php echo TEXT_PRODUCTS_PRICE_GRP; ?></legend>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr valign=\"top\">\n" + " <td width=\"50%\">\n" + " <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + "<?php\n" + " if (PWA_ON == 'false') {\n" + " if ($pInfo->products_qty_days > 0) {\n" + " $products_history = (int)$pInfo->products_qty_days;\n" + " $products_history_flag = true;\n" + " } else {\n" + " $products_history = (int)$pInfo->products_qty_years;\n" + " $products_history_flag = false;\n" + " }\n" + "?>\n" + " <tr>\n" + " <td class=\"main\" colspan=\"12\"><?php echo '<b>' . TEXT_QTY_BASED_HISTORY . '</b> ' . tep_draw_input_field('products_history', $products_history, 'size=\"4\"') . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . tep_draw_radio_field('products_history_qty', 'days', $products_history_flag) . ' ' . TEXT_PRODUCTS_QTY_DAYS . '&nbsp;&nbsp;&nbsp;' . tep_draw_radio_field('products_history_qty', 'years', !$products_history_flag) . ' ' . TEXT_PRODUCTS_QTY_YEARS; ?></td>\n" + " </tr>\n" + "<?php\n" + " }\n" + "?>\n" + " <tr>\n" + " <td class=\"main\"><b><?php echo TEXT_PRODUCTS_GROUPS; ?></b></td>\n" + " <td class=\"main\" align=\"center\"><b><?php echo TEXT_PRODUCTS_BASE; ?></b></td>\n" + " <td class=\"main\"><?php echo tep_draw_input_field('products_price1_qty', $products_price_qty[1], 'size=\"4\"'); ?></td>\n" + " <?php\n" + " echo '<td class=\"main\">&gt;</td>';\n" + " for ($i = 2; $i < PRODUCT_QTY_PRICE_LEVEL; $i++) {\n" + " echo '<td class=\"main\" align=\"center\">' . tep_draw_input_field('products_price' . $i . '_qty', $products_price_qty[$i], 'size=\"4\"') . '</td>';\n" + " echo '<td class=\"main\">&gt;</td>';\n" + " }\n" + "// if (PRODUCT_QTY_PRICE_LEVEL == 11) {\n" + "// echo '<td class=\"main\" align=\"center\"><b>' . TEXT_PRODUCTS_ABOVE . '</b></td>';\n" + "// } else {\n" + " echo '<td class=\"main\">' . tep_draw_input_field('products_price' . PRODUCT_QTY_PRICE_LEVEL . '_qty', $products_price_qty[PRODUCT_QTY_PRICE_LEVEL], 'size=\"4\"') . '</td>';\n" + "// }\n" + " ?>\n" + " </tr>\n" + " <?php\n" + " $group_query = tep_db_query(\"SELECT customers_group_id FROM \" . TABLE_CUSTOMERS_GROUPS . \" WHERE customers_group_id = 0 AND group_status = '1' AND group_price = '1'\");\n" + " if (tep_db_num_rows($group_query) > 0) {\n" + " ?>\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_PRODUCTS_PRICE; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_input_field('products_price0', $pInfo->products_price, 'onKeyUp=\"setRetailPrice()\" size=\"4\"') . '<span style=\"color:#FF0000;\">*</span>'; ?></td>\n" + " <?php\n" + " for ($i = 1; $i <= PRODUCT_QTY_PRICE_LEVEL; $i++) {\n" + " echo '<td class=\"main\">' . tep_draw_input_field('products_price' . $i, $products_price[$i], 'size=\"4\"') . '</td>';\n" + " echo '<td class=\"main\">&nbsp;</td>';\n" + " }\n" + " ?>\n" + " </tr>\n" + " <?php\n" + " }\n" + " $customers_group_query = tep_db_query(\"select customers_group_id, customers_group_name from \" . TABLE_CUSTOMERS_GROUPS . \" where customers_group_id != '0' AND group_status = '1' AND group_price = '1' order by customers_group_id\");\n" + " $header = false;\n" + " while ($customers_group = tep_db_fetch_array($customers_group_query)) {\n" + " if (tep_db_num_rows($customers_group_query) > 0) {\n" + " $attributes_query = tep_db_query(\"select customers_group_id, customers_group_price, customers_group_price1, customers_group_price2, customers_group_price3, customers_group_price4, customers_group_price5, customers_group_price6, customers_group_price7, customers_group_price8, customers_group_price9, customers_group_price10, customers_group_price11 from \" . TABLE_PRODUCTS_GROUPS . \" where products_id = '\" . $pInfo->products_id . \"' and customers_group_id = '\" . $customers_group['customers_group_id'] . \"' order by customers_group_id\");\n" + " } else {\n" + " $attributes = array('customers_group_id' => 'new');\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td class=\"main\">\n" + " <?php // only change in version 4.1.1\n" + " if ($attributes = tep_db_fetch_array($attributes_query)) {\n" + " echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . '&nbsp;' . $customers_group['customers_group_name'];\n" + " } else{\n" + " echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', false) . '&nbsp;' . $customers_group['customers_group_name'];\n" + " }\n" + " ?>&nbsp;\n" + " </td>\n" + " <td class=\"main\">\n" + " <?php\n" + " if ($attributes) {\n" + " echo tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $attributes['customers_group_price'], 'size=\"4\"');\n" + " } else {\n" + " if (isset($pInfo->sppcprice[$customers_group['customers_group_id']])) { // when a preview was done and the back button used\n" + " $sppc_cg_price = $pInfo->sppcprice[$customers_group['customers_group_id']];\n" + " } else { // nothing in the db, nothing in the post variables\n" + " $sppc_cg_price = '';\n" + " }\n" + " echo tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $sppc_cg_price , 'size=\"4\"');\n" + " } \n" + " ?>\n" + " </td>\n" + " <?php\n" + " for ($i = 1; $i <= PRODUCT_QTY_PRICE_LEVEL; $i++) {\n" + " echo '<td class=\"main\">';\n" + " if ($attributes) {\n" + " echo tep_draw_input_field('sppcprice' . $i . '[' . $customers_group['customers_group_id'] . ']', $attributes['customers_group_price' . $i], 'size=\"4\"');\n" + " } else {\n" + " eval('$ret = isset($pInfo->sppcprice' . $i . '[$customers_group[\"customers_group_id\"]]);');\n" + " if ($ret) { // when a preview was done and the back button used\n" + " eval('$sppc_cg_price = $pInfo->sppcprice' . $i . '[$customers_group[\"customers_group_id\"]];');\n" + " } else { // nothing in the db, nothing in the post variables\n" + " $sppc_cg_price = '';\n" + " }\n" + " echo tep_draw_input_field('sppcprice' . $i . '[' . $customers_group['customers_group_id'] . ']', $sppc_cg_price , 'size=\"4\"');\n" + " }\n" + " echo '</td>';\n" + " echo '<td class=\"main\">&nbsp;</td>';\n" + " }\n" + " ?>\n" + " </tr>\n" + " <?php\n" + " } // end while ($customers_group = tep_db_fetch_array($customers_group_query))\n" + " ?>\n" + " </table>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </fieldset>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetqpb\n" + " ?>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetdescr\n" + " if ($cre_RCO->get('categories', 'fieldsetdescr') !== true) { \n" + " ?> \n" + " <tr>\n" + " <td colspan=\"2\"><!-- tabs -->\n" + " <table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\" align=\"center\">\n" + " <tr>\n" + " <td class=\"main\" valign=\"top\" width=\"100%\"><div class=\"tab-pane\" id=\"tabPane1\">\n" + " <script type=\"text/javascript\">tp1 = new WebFXTabPane( document.getElementById( \"tabPane1\" ) );</script>\n" + " <?php\n" + " for ($i=0; $i<sizeof($languages); $i++) {\n" + " ?>\n" + " <div class=\"tab-page\" id=\"<?php echo $languages[$i]['name'];?>\">\n" + " <h2 class=\"tab\"><nobr><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'],'align=\"absmiddle\" style=\"height:16px; width:30px;\"') . '&nbsp;' .$languages[$i]['name'];?></nobr></h2>\n" + " <script type=\"text/javascript\">tp1.addTabPage( document.getElementById( \"<?php echo $languages[$i]['name'];?>\" ) );</script>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" summary=\"tab table\">\n" + " <tr>\n" + " <td valign=\"top\"><table border=\"0\" cellspacing=\"4\" cellpadding=\"0\" summary=\"Title table\">\n" + " <tr valign=\"top\">\n" + " <td class=\"main\"><strong><?php echo TEXT_PRODUCTS_NAME; ?></strong></td>\n" + " <?php\n" + " if ($parentid[\"products_parent_id\"] == 0) {\n" + " $products_name_field = isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']);\n" + " } else {\n" + " $products_name_field = isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']);\n" + " $products_parent_name_field = tep_get_products_name($parentid[\"products_parent_id\"], $languages[$i]['id']);\n" + " $products_name_field = substr( $products_name_field, strlen( $products_parent_name_field . ' - ' ));\n" + " }\n" + " ?>\n" + " <td class=\"main\"><?php echo tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', $products_name_field, 'size=\"64\" maxlength=\"64\"'); ?></td>\n" + " </tr>\n" + " <tr valign=\"top\">\n" + " <td class=\"main\"><?php echo '<strong>' . TEXT_PRODUCTS_URL . '</strong><br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>\n" + " <td class=\"main\"><?php echo tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : tep_get_products_url($pInfo->products_id, $languages[$i]['id'])), 'size=\"64\" maxlength=\"255\"'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>\n" + " </tr>\n" + " </table>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\" summary=\"description tabe\">\n" + " <tr valign=\"top\">\n" + " <td class=\"main\"><strong><?php echo TEXT_PRODUCTS_BLURB; ?></strong></td>\n" + " </tr>\n" + " <tr>\n" + " <td><?php echo tep_draw_textarea_field('products_blurb[' . $languages[$i]['id'] . ']', 'soft', '70', '3', (isset($products_blurb[$languages[$i]['id']]) ? $products_blurb[$languages[$i]['id']] : tep_get_products_blurb($pInfo->products_id, $languages[$i]['id'])), 'style=\"width: 100%;\" mce_editable=\"true\"'); ?> </td>\n" + " </tr>\n" + " </table> \n" + " <?php if ($parentid[\"products_parent_id\"] == 0) {\n" + " ?>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\" summary=\"description tabe\">\n" + " <tr valign=\"top\">\n" + " <td class=\"main\"><strong><?php echo TEXT_PRODUCTS_DESCRIPTION; ?></strong></td>\n" + " </tr>\n" + " <tr>\n" + " <td><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>\n" + " </tr>\n" + " </table>\n" + " <?php\n" + " }\n" + " // RCO start fieldsetmeta\n" + " if ($cre_RCO->get('categories', 'fieldsetmeta') !== true) { \n" + " if ($parentid[\"products_parent_id\"] == 0) {\n" + " ?> \n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\" summary=\"meta content holder table\">\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr> \n" + " <tr>\n" + " <td class=\"main\"><fieldset><legend><?php echo TEXT_PRODUCT_METTA_INFO; ?></legend>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n" + " <tr>\n" + " <td class=\"main\"><strong><?php echo TEXT_PRODUCTS_PAGE_TITLE;?></strong></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '15', '2', (isset($products_head_title_tag[$languages[$i]['id']]) ? $products_head_title_tag[$languages[$i]['id']] : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id'])),'style=\"width:100%\"'); ?></td>\n" + " </tr>\n" + " </table>\n" + " <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n" + " <tr class=\"main\">\n" + " <td width=\"50%\"><strong><?php echo TEXT_PRODUCTS_HEADER_DESCRIPTION;?></strong></td>\n" + " <td width=\"50%\"><strong><?php echo TEXT_PRODUCTS_KEYWORDS; ?></strong></td>\n" + " </tr>\n" + " <tr class=\"main\">\n" + " <td><?php echo tep_draw_textarea_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '35', '5', (isset($products_head_desc_tag[$languages[$i]['id']]) ? $products_head_desc_tag[$languages[$i]['id']] : tep_get_products_head_desc_tag($pInfo->products_id, $languages[$i]['id'])),'style=\"width:100%\"'); ?></td>\n" + " <td><?php echo tep_draw_textarea_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '35', '5', (isset($products_head_keywords_tag[$languages[$i]['id']]) ? $products_head_keywords_tag[$languages[$i]['id']] : tep_get_products_head_keywords_tag($pInfo->products_id, $languages[$i]['id'])),'style=\"width:100%\"'); ?></td>\n" + " </tr>\n" + " </table>\n" + " </fieldset></td>\n" + " </tr>\n" + " </table>\n" + " <?php\n" + " }\n" + " }\n" + " ?>\n" + " </tr>\n" + " </table>\n" + " </div>\n" + " <?php\n" + " }\n" + " ?>\n" + " </div>\n" + " <script type=\"text/javascript\">\n" + " //<![CDATA[\n" + " setupAllTabs();\n" + " //]]>\n" + " </script>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetdescr\n" + " ?>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetimages\n" + " if ($cre_RCO->get('categories', 'fieldsetimages') !== true) { \n" + " ?> \n" + " <tr> \n" + " <td colspan=\"2\"> \n" + " <fieldset><legend><!-- Product Images --><?php echo TEXT_PRODUCT_IMAGES;?></legend>\n" + " <table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">\n" + " <!-- // BOF: MaxiDVD Added for Ulimited Images Pack! -->\n" + " <tr>\n" + " <td class=\"dataTableRow\" valign=\"top\">\n" + " <span class=\"main\"><?php echo TEXT_PRODUCTS_IMAGE_NOTE; ?></span>\n" + " <br><br>\n" + " <div class=\"tab-pane\" id=\"imgTabPane1\">\n" + " <script type=\"text/javascript\">\n" + " imgTp1 = new WebFXTabPane( document.getElementById( \"imgTabPane1\" ) );\n" + " </script>\n" + " <div class=\"tab-page\" id=\"new_file\">\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_NEW_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp1.addTabPage( document.getElementById( \"new_file\" ) );</script>\n" + " <span class= \"main\"><strong><?php echo TEXT_UPLOAD_PRODUCTS_IMAGE; ?></strong></span>\n" + " <br><?php echo tep_draw_file_field('products_image') . tep_draw_hidden_field('products_image_previous', $pInfo->products_image); ?>\n" + " <br>\n" + " <select name=\"products_image_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </div>\n" + " <div class=\"tab-page\" id=\"existing_file\">\n" + " <input type=\"hidden\" name=\"file_exist_dest_small\" id=\"file_exist_dest_small\" />\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_EXISTING_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp1.addTabPage( document.getElementById( \"existing_file\" ) );</script>\n" + " <span class= \"main\"><strong><?php echo TEXT_CATEGORIES_IMAGE_DIR; ?></strong><select name=\"file_dir_exist_dest_small\" class=\"dirWidth\" id=\"file_dir_exist_dest_small\" onChange=\"listFile(this, 'img_file_preview_small', 'img_file_small', 'file_exist_dest_small');\"><?php echo $file_dir; ?></select></span>\n" + " <div id=\"img_file_small\" class=\"main\"><b><?php echo TEXT_CATEGORIES_IMAGE_FILE; ?></b><select name=\"file_exist_dest_select\" class=\"dirWidth\" id=\"file_exist_dest_select\" onChange=\"previewFile(this, 'img_file_preview_small', 'file_exist_dest_small', 'file_dir_exist_dest_small');\"><?php echo $file_list; ?></select></div>\n" + " <div align=\"right\"><img id=\"img_file_preview_small\" src=\"\" /></div>\n" + " </div>\n" + " </div>\n" + " </td>\n" + " <td class=\"dataTableRow\" valign=\"top\">\n" + " <span class=\"smallText\">\n" + " <?php if (($pID) && ($pInfo->products_image) != '')\n" + " echo tep_draw_separator('pixel_trans.gif', '24', '17\" align=\"left') . $pInfo->products_image . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image, $pInfo->products_image, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " </span>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"dataTableRow\" valign=\"top\">\n" + " <span class=\"main\"><?php echo TEXT_PRODUCTS_IMAGE_MEDIUM; ?></span>\n" + " <br><br>\n" + " <div class=\"tab-pane\" id=\"imgTabPane1\">\n" + " <script type=\"text/javascript\">\n" + " imgTp2 = new WebFXTabPane( document.getElementById( \"imgTabPane1\" ) );\n" + " </script>\n" + " <div class=\"tab-page\" id=\"new_file_med\">\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_NEW_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp2.addTabPage( document.getElementById( \"new_file_med\" ) );</script>\n" + " <span class= \"main\"><strong><?php echo TEXT_UPLOAD_PRODUCTS_IMAGE; ?></strong></span>\n" + " <br>\n" + " <?php echo tep_draw_file_field('products_image_med') . tep_draw_hidden_field('products_image_med_previous', $pInfo->products_image_med); ?>\n" + " <br>\n" + " <select name=\"products_image_med_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </div>\n" + " <div class=\"tab-page\" id=\"existing_file_med\">\n" + " <input type=\"hidden\" name=\"file_exist_dest_med\" id=\"file_exist_dest_med\" />\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_EXISTING_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp2.addTabPage( document.getElementById( \"existing_file_med\" ) );</script>\n" + " <span class= \"main\"><strong><?php echo TEXT_CATEGORIES_IMAGE_DIR; ?></strong><select name=\"file_dir_exist_dest_med\" class=\"dirWidth\" id=\"file_dir_exist_dest_med\" onChange=\"listFile(this, 'img_file_preview_med', 'img_file_med', 'file_exist_dest_med');\"><?php echo $file_dir; ?></select></span>\n" + " <div id=\"img_file_med\" class=\"main\"><b><?php echo TEXT_CATEGORIES_IMAGE_FILE; ?></b><select name=\"img_file_preview_med_select\" class=\"dirWidth\" id=\"img_file_preview_med_select\" onChange=\"previewFile(this, 'img_file_preview_med', 'file_exist_dest_med', 'file_dir_exist_dest_med');\"><?php echo $file_list; ?></select></div>\n" + " <div align=\"right\"><img id=\"img_file_preview_med\" src=\"\" /></div>\n" + " </div>\n" + " </div>\n" + " </td>\n" + " <td class=\"dataTableRow\" valign=\"top\">\n" + " <span class=\"smallText\">\n" + " <?php if (($pID) && ($pInfo->products_image_med) != '')\n" + " echo tep_draw_separator('pixel_trans.gif', '24', '17\" align=\"left') . $pInfo->products_image_med . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_med, $pInfo->products_image_med, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_med\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_med\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " </span>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"dataTableRow\" valign=\"top\">\n" + " <span class=\"main\"><?php echo TEXT_PRODUCTS_IMAGE_LARGE; ?></span>\n" + " <br><br>\n" + " <div class=\"tab-pane\" id=\"imgTabPane1\">\n" + " <script type=\"text/javascript\">\n" + " imgTp3 = new WebFXTabPane( document.getElementById( \"imgTabPane1\" ) );\n" + " </script>\n" + " <div class=\"tab-page\" id=\"new_file_lrg\">\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_NEW_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp3.addTabPage( document.getElementById( \"new_file_lrg\" ) );</script>\n" + " <span class= \"main\"><strong><?php echo TEXT_UPLOAD_PRODUCTS_IMAGE; ?></strong></span>\n" + " <br>\n" + " <?php echo tep_draw_file_field('products_image_lrg') . tep_draw_hidden_field('products_image_lrg_previous', $pInfo->products_image_lrg); ?>\n" + " <br>\n" + " <select name=\"products_image_lrg_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </div>\n" + " <div class=\"tab-page\" id=\"existing_file_lrg\">\n" + " <input type=\"hidden\" name=\"file_exist_dest_lrg\" id=\"file_exist_dest_lrg\" />\n" + " <h2 class=\"tab\"><?php echo TEXT_TAB_PANE_EXISTING_FILE; ?></h2>\n" + " <script type=\"text/javascript\">imgTp3.addTabPage( document.getElementById( \"existing_file_lrg\" ) );</script>\n" + " <span class= \"main\"><strong><?php echo TEXT_CATEGORIES_IMAGE_DIR; ?></strong><select name=\"file_dir_exist_dest_lrg\" class=\"dirWidth\" id=\"file_dir_exist_dest_lrg\" onChange=\"listFile(this, 'img_file_preview_lrg', 'img_file_lrg', 'file_exist_dest_lrg');\"><?php echo $file_dir; ?></select></span>\n" + " <div id=\"img_file_lrg\" class=\"main\"><b><?php echo TEXT_CATEGORIES_IMAGE_FILE; ?></b><select name=\"img_file_preview_lrg_select\" class=\"dirWidth\" id=\"img_file_preview_lrg_select\" onChange=\"previewFile(this, 'img_file_preview_lrg', 'file_exist_dest_lrg', 'file_dir_exist_dest_lrg');\"><?php echo $file_list; ?></select></div>\n" + " <div align=\"right\"><img id=\"img_file_preview_lrg\" src=\"\" /></div>\n" + " </div>\n" + " </div>\n" + " </td>\n" + " <td class=\"dataTableRow\" valign=\"top\">\n" + " <span class=\"smallText\">\n" + " <?php if (($pID) && ($pInfo->products_image_lrg) != '')\n" + " echo tep_draw_separator('pixel_trans.gif', '24', '17\" align=\"left') . $pInfo->products_image_lrg . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_lrg, $pInfo->products_image_lrg, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_lrg\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_lrg\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " </span>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </fieldset>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetimages\n" + " ?>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr> \n" + " <?php\n" + " // RCO start fieldsetaddimages\n" + " if ($cre_RCO->get('categories', 'fieldsetaddimages') !== true) { \n" + " if ($parentid[\"products_parent_id\"] == 0) {\n" + " if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') {\n" + " ?>\n" + " <tr> \n" + " <td class=\"main\" colspan=\"2\"><fieldset><legend><?php echo TEXT_PRODUCTS_IMAGE_ADDITIONAL;?></legend>\n" + " <table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n" + " <tr>\n" + " <td class=\"smalltext\"><table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n" + " <tr>\n" + " <td class=\"smalltext\" colspan=\"2\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_TH_NOTICE; ?></td>\n" + " <td class=\"smalltext\" colspan=\"2\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_XL_NOTICE; ?></td>\n" + " </tr>\n" + " </table>\n" + " <table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n" + " <tr>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\"><?php echo TEXT_PRODUCTS_IMAGE_SM_1; ?></span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\">\n" + " <?php echo tep_draw_file_field('products_image_sm_1') . tep_draw_hidden_field('products_image_sm_1_previous', $pInfo->products_image_sm_1); ?>\n" + " <br>\n" + " <select name=\"products_image_sm_1_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\"><?php echo TEXT_PRODUCTS_IMAGE_XL_1; ?></span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\">\n" + " <?php echo tep_draw_file_field('products_image_xl_1') . tep_draw_hidden_field('products_image_xl_1_previous', $pInfo->products_image_xl_1); ?>\n" + " <br>\n" + " <select name=\"products_image_xl_1_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </span></td>\n" + " </tr>\n" + " <?php\n" + " if (($pID) && ($pInfo->products_image_sm_1) != '' or ($pInfo->products_image_xl_1) != '') {\n" + " ?>\n" + " <tr>\n" + " <td class=\"dataTableRow\" colspan=\"2\" valign=\"top\"><?php if (tep_not_null($pInfo->products_image_sm_1)) { ?>\n" + " <span class=\"smallText\"><?php echo $pInfo->products_image_sm_1 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_1, $pInfo->products_image_sm_1, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_sm_1\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_sm_1\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>\n" + " <?php } ?>\n" + " </td>\n" + " <td class=\"dataTableRow\" colspan=\"2\" valign=\"top\"><?php if (tep_not_null($pInfo->products_image_xl_1)) { ?>\n" + " <span class=\"smallText\"><?php echo $pInfo->products_image_xl_1 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_1, $pInfo->products_image_xl_1, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_xl_1\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_xl_1\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>\n" + " <?php } ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td class=\"smallText\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_SM_2; ?></td>\n" + " <td class=\"smallText\" valign=\"top\">\n" + " <?php echo tep_draw_file_field('products_image_sm_2') . tep_draw_hidden_field('products_image_sm_2_previous', $pInfo->products_image_sm_2); ?>\n" + " <br>\n" + " <select name=\"products_image_sm_2_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </td>\n" + " <td class=\"smallText\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_XL_2; ?></td>\n" + " <td class=\"smallText\" valign=\"top\">\n" + " <?php echo tep_draw_file_field('products_image_xl_2') . tep_draw_hidden_field('products_image_xl_2_previous', $pInfo->products_image_xl_2); ?>\n" + " <br>\n" + " <select name=\"products_image_xl_2_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " if (($pID) && ($pInfo->products_image_sm_2) != '' or ($pInfo->products_image_xl_2) != '') {\n" + " ?>\n" + " <tr>\n" + " <td class=\"smallText\" valign=\"top\" colspan=\"2\"><?php if (tep_not_null($pInfo->products_image_sm_2)) { ?>\n" + " <?php echo $pInfo->products_image_sm_2 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_2, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_sm_2\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_sm_2\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " <?php } ?>\n" + " </td>\n" + " <td class=\"smallText\" valign=\"top\" colspan=\"2\"><?php if (tep_not_null($pInfo->products_image_xl_2)) { ?>\n" + " <?php echo $pInfo->products_image_xl_2 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_2, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_xl_2\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_xl_2\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " <?php } ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\"><?php echo TEXT_PRODUCTS_IMAGE_SM_3; ?></span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\">\n" + " <?php echo tep_draw_file_field('products_image_sm_3') . tep_draw_hidden_field('products_image_sm_3_previous', $pInfo->products_image_sm_3); ?>\n" + " <br>\n" + " <select name=\"products_image_sm_3_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\"><?php echo TEXT_PRODUCTS_IMAGE_XL_3; ?></span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\">\n" + " <?php echo tep_draw_file_field('products_image_xl_3') . tep_draw_hidden_field('products_image_xl_3_previous', $pInfo->products_image_xl_3); ?>\n" + " <br>\n" + " <select name=\"products_image_xl_3_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </span></td>\n" + " </tr>\n" + " <?php\n" + " if (($pID) && ($pInfo->products_image_sm_3) != '' or ($pInfo->products_image_xl_3) != '') {\n" + " ?>\n" + " <tr>\n" + " <td class=\"dataTableRow\" colspan=\"2\" valign=\"top\"><?php if (tep_not_null($pInfo->products_image_sm_3)) { ?>\n" + " <span class=\"smallText\"><?php echo $pInfo->products_image_sm_3 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_3, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_sm_3\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_sm_3\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>\n" + " <?php } ?>\n" + " </td>\n" + " <td class=\"dataTableRow\" colspan=\"2\" valign=\"top\"><?php if (tep_not_null($pInfo->products_image_xl_3)) { ?>\n" + " <span class=\"smallText\"><?php echo $pInfo->products_image_xl_3 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_3, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_xl_3\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_xl_3\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>\n" + " <?php } ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td class=\"smallText\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_SM_4; ?></td>\n" + " <td class=\"smallText\" valign=\"top\">\n" + " <?php echo tep_draw_file_field('products_image_sm_4') . tep_draw_hidden_field('products_image_sm_4_previous', $pInfo->products_image_sm_4); ?>\n" + " <br>\n" + " <select name=\"products_image_sm_4_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </td>\n" + " <td class=\"smallText\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_XL_4; ?></td>\n" + " <td class=\"smallText\" valign=\"top\">\n" + " <?php echo tep_draw_file_field('products_image_xl_4') . tep_draw_hidden_field('products_image_xl_4_previous', $pInfo->products_image_xl_4); ?>\n" + " <br>\n" + " <select name=\"products_image_xl_4_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " if (($pID) && ($pInfo->products_image_sm_4) != '' or ($pInfo->products_image_xl_4) != '') {\n" + " ?>\n" + " <tr>\n" + " <td class=\"smallText\" valign=\"top\" colspan=\"2\"><?php if (tep_not_null($pInfo->products_image_sm_4)) { ?>\n" + " <?php echo $pInfo->products_image_sm_4 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_4, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_sm_4\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_sm_4\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " <?php } ?>\n" + " </td>\n" + " <td class=\"smallText\" valign=\"top\" colspan=\"2\"><?php if (tep_not_null($pInfo->products_image_xl_4)) { ?>\n" + " <?php echo $pInfo->products_image_xl_4 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_4, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_xl_4\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_xl_4\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " <?php } ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\"><?php echo TEXT_PRODUCTS_IMAGE_SM_5; ?></span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\">\n" + " <?php echo tep_draw_file_field('products_image_sm_5') . tep_draw_hidden_field('products_image_sm_5_previous', $pInfo->products_image_sm_5); ?>\n" + " <br>\n" + " <select name=\"products_image_sm_5_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\"><?php echo TEXT_PRODUCTS_IMAGE_XL_5; ?></span></td>\n" + " <td class=\"dataTableRow\" valign=\"top\"><span class=\"smallText\">\n" + " <?php echo tep_draw_file_field('products_image_xl_5') . tep_draw_hidden_field('products_image_xl_5_previous', $pInfo->products_image_xl_5); ?>\n" + " <br>\n" + " <select name=\"products_image_xl_5_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </span></td>\n" + " </tr>\n" + " <?php\n" + " if (($pID) && ($pInfo->products_image_sm_5) != '' or ($pInfo->products_image_xl_5) != '') {\n" + " ?>\n" + " <tr>\n" + " <td class=\"dataTableRow\" colspan=\"2\" valign=\"top\"><?php if (tep_not_null($pInfo->products_image_sm_5)) { ?>\n" + " <span class=\"smallText\"><?php echo $pInfo->products_image_sm_5 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_5, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_sm_5\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_sm_5\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>\n" + " <?php } ?>\n" + " </td>\n" + " <td class=\"dataTableRow\" colspan=\"2\" valign=\"top\"><?php if (tep_not_null($pInfo->products_image_xl_5)) { ?>\n" + " <span class=\"smallText\"><?php echo $pInfo->products_image_xl_5 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_5, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_xl_5\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_xl_5\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>\n" + " <?php } ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td class=\"smallText\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_SM_6; ?></td>\n" + " <td class=\"smalltext\" valign=\"top\">\n" + " <?php echo tep_draw_file_field('products_image_sm_6') . tep_draw_hidden_field('products_image_sm_6_previous', $pInfo->products_image_sm_6); ?>\n" + " <br>\n" + " <select name=\"products_image_sm_6_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </td>\n" + " <td class=\"smallText\" valign=\"top\"><?php echo TEXT_PRODUCTS_IMAGE_XL_6; ?></td>\n" + " <td class=\"smalltext\" valign=\"top\">\n" + " <?php echo tep_draw_file_field('products_image_xl_6') . tep_draw_hidden_field('products_image_xl_6_previous', $pInfo->products_image_xl_6); ?>\n" + " <br>\n" + " <select name=\"products_image_xl_6_destination\" class=\"dirWidth\" id=\"dirPath\" ><?php echo $file_dir; ?></select>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " if (($pID) && ($pInfo->products_image_sm_6) != '' or ($pInfo->products_image_xl_6) != '') {\n" + " ?>\n" + " <tr>\n" + " <td class=\"smallText\" valign=\"top\" colspan=\"2\"><?php if (tep_not_null($pInfo->products_image_sm_6)) { ?>\n" + " <?php echo $pInfo->products_image_sm_6 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_6, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_sm_6\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_sm_6\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " <?php } ?>\n" + " </td>\n" + " <td class=\"smallText\" valign=\"top\" colspan=\"2\"><?php if (tep_not_null($pInfo->products_image_xl_6)) { ?>\n" + " <?php echo $pInfo->products_image_xl_6 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_6, '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"left\" hspace=\"0\" vspace=\"5\"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"unlink_image_xl_6\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type=\"checkbox\" name=\"delete_image_xl_6\" value=\"yes\">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>\n" + " <?php } ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " </table></td>\n" + " </tr>\n" + " </table>\n" + " </fieldset></td>\n" + " </tr>\n" + " <?php\n" + " } else {\n" + " echo tep_draw_hidden_field('products_image_sm_1_previous', $pInfo->products_image_sm_1) .\n" + " tep_draw_hidden_field('products_image_xl_1_previous', $pInfo->products_image_xl_1) .\n" + " tep_draw_hidden_field('products_image_sm_2_previous', $pInfo->products_image_sm_2) .\n" + " tep_draw_hidden_field('products_image_xl_2_previous', $pInfo->products_image_xl_2) .\n" + " tep_draw_hidden_field('products_image_sm_3_previous', $pInfo->products_image_sm_3) .\n" + " tep_draw_hidden_field('products_image_xl_3_previous', $pInfo->products_image_xl_3) .\n" + " tep_draw_hidden_field('products_image_sm_4_previous', $pInfo->products_image_sm_4) .\n" + " tep_draw_hidden_field('products_image_xl_4_previous', $pInfo->products_image_xl_4) .\n" + " tep_draw_hidden_field('products_image_sm_5_previous', $pInfo->products_image_sm_5) .\n" + " tep_draw_hidden_field('products_image_xl_5_previous', $pInfo->products_image_xl_5) .\n" + " tep_draw_hidden_field('products_image_sm_6_previous', $pInfo->products_image_sm_6) .\n" + " tep_draw_hidden_field('products_image_xl_6_previous', $pInfo->products_image_xl_6);\n" + " }\n" + " }\n" + " } // RCO eof fieldsetaddimages\n" + " ?>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr>\n" + " <?php\n" + " // RCO start fieldsetsubprods\n" + " if ($cre_RCO->get('categories', 'fieldsetsubprods') !== true) { \n" + " ?> \n" + " <!-- Beginning of sub products div as well as looking its products up -->\n" + " <tr> \n" + " <td colspan=\"2\" class=\"main\">\n" + " <?php\n" + " $parentid_query = tep_db_query(\"select products_parent_id from products where products_id =\".(int)$pID);\n" + " $parentid = tep_db_fetch_array($parentid_query);\n" + " if ($parentid['products_parent_id'] == 0) {\n" + " ?>\n" + " <fieldset><legend><?php echo TEXT_SUB_PRODUCT; ?></legend>\n" + " <table cellpadding=\"2\" width=\"100%\">\n" + " <tr>\n" + " <td><table>\n" + " <tr>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_DELETE; ?></td>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_NAME; ?></td>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_PRICE; ?></td>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_MODEL; ?></td>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_QTY; ?></td>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_WEIGHT; ?></td>\n" + " <td class=\"main\"><?php echo TEXT_SUB_PRODUCT_IMAGE; ?></td>\n" + " </tr>\n" + " <?php\n" + " $parent_name = tep_get_products_name($pInfo->products_id, $languages_id);\n" + " $additionalcounter = 0;\n" + " if ( (isset($pID)) && ($pID >= '1') ) {\n" + " $tempcheckproductid = $pID;\n" + " $subscount_query = tep_db_query(\"select count(p.products_id) as total from products p , products_description pd where pd.products_id = p.products_id and pd.language_id = \" . (int)$languages_id . \" and p.products_parent_id =\".$tempcheckproductid);\n" + " $subscount = tep_db_fetch_array($subscount_query);\n" + " $totalsubs = 0;\n" + " if ($subscount[\"total\"] > 0) {\n" + " $totalsubs = (int)$subscount[\"total\"];\n" + " }\n" + " if ($totalsubs > 0) {\n" + " $currentsubs_query = tep_db_query(\"select p.products_image, p.products_id, pd.products_name, pd.products_description, p.products_price, p.products_model, p.products_quantity, p.products_weight from products p, products_description pd where pd.products_id = p.products_id and pd.language_id = \" . (int)$languages_id . \" and p.products_parent_id =\".$tempcheckproductid);\n" + " while ($currentsubs = tep_db_fetch_array($currentsubs_query)) {\n" + " $subname = substr( $currentsubs[\"products_name\"], strlen( $parent_name . ' - ' ));\n" + " echo \"<tr>\";\n" + " echo '<td class=\"main\">'.tep_draw_checkbox_field('subproddelete[]', $currentsubs[\"products_id\"]).'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodname[]',$subname).'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodprice[]',$currentsubs[\"products_price\"],'size=\"5\"').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodmodel[]',$currentsubs[\"products_model\"]).'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodqty[]',$currentsubs[\"products_quantity\"],'size=\"4\"').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodweight[]',$currentsubs[\"products_weight\"],'size=\"5\"').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_file_field('subprodimage[]').'<br>'.$currentsubs[\"products_image\"].tep_draw_hidden_field('subprodprevimage[]', $currentsubs[\"products_image\"]).'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_hidden_field('subproductid[]',$currentsubs[\"products_id\"]).'</td>';\n" + " echo '<td class=\"main\" align=\"left\">'.'<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&action=new_product&pID=' . $currentsubs[\"products_id\"] : '')) . '\">' . tep_image_button('button_edit_sm.gif', IMAGE_EDIT) . '</a>';\n" + " //RCI start\n" + " echo $cre_RCI->get('categories', 'subproducts');\n" + " //RCI eof\n" + " echo '</td>';\n" + " echo \"</tr>\";\n" + " $additionalcounter = $additionalcounter + 1;\n" + " }\n" + " }\n" + " }\n" + " $temptotalboxes = (int)MAX_PRODUCT_SUB_ROWS + (int)$additionalcounter;\n" + " while ($additionalcounter < $temptotalboxes) {\n" + " // This is where we display the number of sub products that they want to add by default to the main product\n" + " echo \"<tr>\";\n" + " echo '<td class=\"main\">'.tep_draw_checkbox_field('subproddelete','').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodname[]',(isset($_POST['subprodname'][$additionalcounter])? $_POST['subprodname'][$additionalcounter] : '')).'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodprice[]',(isset($_POST['subprodprice'][$additionalcounter])? $_POST['subprodprice'][$additionalcounter] : ''),'size=\"5\"').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodmodel[]',(isset($_POST['subprodmodel'][$additionalcounter])? $_POST['subprodmodel'][$additionalcounter] : '')).'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodqty[]',(isset($_POST['subprodqty'][$additionalcounter])? $_POST['subprodqty'][$additionalcounter] : ''),'size=\"4\"').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_input_field('subprodweight[]',(isset($_POST['subprodweight'][$additionalcounter])? $_POST['subprodweight'][$additionalcounter] : ''),'size=\"5\"').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_file_field('subprodimage[]').tep_draw_hidden_field('subprodprevimage[]', '').'</td>';\n" + " echo '<td class=\"main\">'.tep_draw_hidden_field('subproductid[]','0').'</td>';\n" + " echo '<td class=\"main\" align=\"left\" valign=\"top\"></td>';\n" + " echo \"</tr>\";\n" + " $additionalcounter = $additionalcounter + 1;\n" + " }\n" + " ?>\n" + " </table></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"7\"><blockquote><?php echo TEXT_SUB_PRODUCT_NOTE_1 . '<br>' , TEXT_SUB_PRODUCT_NOTE_2; ?></blockquote></td>\n" + " </tr>\n" + " </table>\n" + " </fieldset>\n" + " <?php\n" + " } else {\n" + " ?>\n" + " <fieldset><legend><?php echo TEXT_SUB_PRODUCT; ?></legend>\n" + " <table cellpadding=\"0\" cellpadding=\"2\" width=\"100%\">\n" + " <tr>\n" + " <td>\n" + " <?php echo TEXT_PARENT_PRODUCT_WARNING.'<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&action=new_product&pID=' . $parentid[\"products_parent_id\"] : '')) . '\">' . TEXT_PARENT_PRODUCT_WARNING2 . '</a>'.TEXT_PARENT_PRODUCT_WARNING3;?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </fieldset>\n" + " <?php \n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " } // RCO eof fieldsetsubprods\n" + " ?>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>\n" + " </tr>\n" + " <?php\n" + " // RCO start fieldsetextra\n" + " if ($cre_RCO->get('categories', 'fieldsetextra') !== true) { \n" + " if ($parentid['products_parent_id'] == 0) {\n" + " ?> \n" + " <tr> \n" + " <td colspan=\"2\"> \n" + " <fieldset><legend>Extra Fields</legend>\n" + " <table cellpadding=\"0\" cellpadding=\"2\" width=\"100%\">\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><table>\n" + " <!-- End of sub products div as well as looking its products up -->\n" + " <?php\n" + " for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n" + " $languages_array[$languages[$i]['id']]=$languages[$i];\n" + " }\n" + " $extra_fields_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS_EXTRA_FIELDS . \" ORDER BY products_extra_fields_order\");\n" + " while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {\n" + " // display language icon or blank space\n" + " if ($extra_fields['languages_id'] == 0) {\n" + " $m=tep_draw_separator('pixel_trans.gif', '24', '15');\n" + " } else {\n" + " $m= tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages_array[$extra_fields['languages_id']]['directory'] . '/images/' . $languages_array[$extra_fields['languages_id']]['image'], $languages_array[$extra_fields['languages_id']]['name']);\n" + " }\n" + " ?>\n" + " <tr bgcolor=\"#ebebff\">\n" + " <td class=\"main\"><?php echo $extra_fields['products_extra_fields_name']; ?>:</td>\n" + " <td class=\"main\">\n" + " <?php\n" + " if (isset($pInfo->extra_field)) {\n" + " echo $m . '&nbsp;' . tep_draw_input_field(\"extra_field[\".$extra_fields['products_extra_fields_id'].\"]\", (isset($pInfo->extra_field[$extra_fields['products_extra_fields_id']]) ? $pInfo->extra_field[$extra_fields['products_extra_fields_id']] : ''));\n" + " } else {\n" + " echo $m . '&nbsp;' . tep_draw_input_field(\"extra_field[\".$extra_fields['products_extra_fields_id'].\"]\", '');\n" + " }\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " </table></td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"2\"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " </table>\n" + " </fieldset>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " } // RCO eof fieldsetextra\n" + " ?>\n" + " </table> \n" + " <table cellpadding=\"0\" cellpadding=\"2\" width=\"100%\">\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td valign=\"top\" align=\"right\"> <table align=\"right\" border=\"0\">\n" + " <tr>\n" + " <td class=\"main\" align=\"right\">\n" + " <?php\n" + " echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d')));\n" + " echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&pID=' . $pID : '')) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';\n" + " if ($parentid['products_parent_id'] == 0) {\n" + " // RCO start\n" + " if ($cre_RCO->get('categories', 'buttonattributes') !== true) { \n" + " echo '<a href=\"' . tep_href_link(FILENAME_ATTRIBUTES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\">' . tep_image_button('button_edit_attributes.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>';\n" + " }\n" + " // RCO eof\n" + " }\n" + " echo tep_image_submit('button_preview_upload.gif', 'Preview','name=\"Operation\" onClick=\"document.pressed=this.value\"');\n" + " echo tep_image_submit('button_'.$form_action_text.'.gif',$form_action_text,'name=\"Operation\" onClick=\"document.pressed=this.value\"');\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " </table>\n" + " </form>\n" + " <?php\n" + " // new product preview begin\n" + " } elseif ($action == 'new_product_preview') {\n" + " if ( (isset($_POST)) && (tep_not_null($_POST))) {\n" + " $pInfo = new objectInfo($_POST);\n" + " $products_name = $_POST['products_name'];\n" + " $products_blurb = $_POST['products_blurb']; \n" + " $products_description = $_POST['products_description'];\n" + " $products_head_title_tag = $_POST['products_head_title_tag'];\n" + " $products_head_desc_tag = $_POST['products_head_desc_tag'];\n" + " $products_head_keywords_tag = $_POST['products_head_keywords_tag'];\n" + " $products_url = $_POST['products_url'];\n" + " $products_image_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_destination']);\n" + " $products_image_med_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_med_destination']);\n" + " $products_image_lrg_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_lrg_destination']);\n" + " $products_image_sm_1_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_sm_1_destination']);\n" + " $products_image_sm_2_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_sm_2_destination']);\n" + " $products_image_sm_3_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_sm_3_destination']);\n" + " $products_image_sm_4_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_sm_4_destination']);\n" + " $products_image_sm_5_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_sm_5_destination']);\n" + " $products_image_sm_6_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_sm_6_destination']);\n" + " $products_image_xl_1_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_xl_1_destination']);\n" + " $products_image_xl_2_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_xl_2_destination']);\n" + " $products_image_xl_3_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_xl_3_destination']);\n" + " $products_image_xl_4_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_xl_4_destination']);\n" + " $products_image_xl_5_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_xl_5_destination']);\n" + " $products_image_xl_6_destination = str_ireplace( \"%2F\", \"/\", $_POST['products_image_xl_6_destination']);\n" + " } else {\n" + " $product_query = tep_db_query(\"select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price1_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, products_price11_qty, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_DESCRIPTION . \" pd where pd.products_id = p.products_id and p.products_id = '\" . (int)$pID . \"'\");\n" + " $product = tep_db_fetch_array($product_query);\n" + " $pInfo = new objectInfo($product);\n" + " $products_image_destination ='';\n" + " $products_image_med_destination = '';\n" + " $products_image_lrg_destination = '';\n" + " $products_image_sm_1_destination = '';\n" + " $products_image_sm_2_destination = '';\n" + " $products_image_sm_3_destination = '';\n" + " $products_image_sm_4_destination ='';\n" + " $products_image_sm_5_destination = '';\n" + " $products_image_sm_6_destination = '';\n" + " $products_image_xl_1_destination = '';\n" + " $products_image_xl_2_destination = '';\n" + " $products_image_xl_3_destination = '';\n" + " $products_image_xl_4_destination = '';\n" + " $products_image_xl_5_destination = '';\n" + " $products_image_xl_6_destination = '';\n" + " $products_image_name = $pInfo->products_image;\n" + " $products_image_med_name =$pInfo->products_image_med;\n" + " $products_image_lrg_name = $pInfo->products_image_lrg;\n" + " $products_image_sm_1_name = $pInfo->products_image_sm_1;\n" + " $products_image_sm_2_name = $pInfo->products_image_sm_2;\n" + " $products_image_sm_3_name = $pInfo->products_image_sm_3;\n" + " $products_image_sm_4_name = $pInfo->products_image_sm_4;\n" + " $products_image_sm_5_name = $pInfo->products_image_sm_5;\n" + " $products_image_sm_6_name = $pInfo->products_image_sm_6;\n" + " $products_image_xl_1_name = $pInfo->products_image_xl_1;\n" + " $products_image_xl_2_name = $pInfo->products_image_xl_2;\n" + " $products_image_xl_3_name = $pInfo->products_image_xl_3;\n" + " $products_image_xl_4_name = $pInfo->products_image_xl_4;\n" + " $products_image_xl_5_name = $pInfo->products_image_xl_5;\n" + " $products_image_xl_6_name = $pInfo->products_image_xl_6;\n" + " }\n" + " $form_action = (!empty($pID)) ? 'update_product' : 'insert_product';\n" + " echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&pID=' . $pID : '') . '&action=' . $form_action, 'post', 'enctype=\"multipart/form-data\"');\n" + " $read = '';\n" + " if (isset($_GET['read'])){\n" + " $read = $_GET['read'];\n" + " }\n" + " $languages = tep_get_languages();\n" + " for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n" + " if ($read == 'only') {\n" + " $pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);\n" + " $pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);\n" + " $pInfo->products_head_title_tag = (isset($products_head_title_tag[$languages[$i]['id']]) ? tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]) : '');\n" + " $pInfo->products_head_desc_tag = (isset($products_head_desc_tag[$languages[$i]['id']]) ? tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]) : '');\n" + " $pInfo->products_head_keywords_tag = (isset($products_head_keywords_tag[$languages[$i]['id']]) ? tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]) : '');\n" + " $pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);\n" + " } else {\n" + " $pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);\n" + " $pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);\n" + " $pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);\n" + " $pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);\n" + " $pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);\n" + " $pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);\n" + " }\n" + " ?>\n" + " <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">\n" + " <tr>\n" + " <td><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td class=\"pageHeading\"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $pInfo->products_name; ?></td>\n" + " <td class=\"pageHeading\" align=\"right\"><?php echo $currencies->format($pInfo->products_price); ?></td>\n" + " </tr>\n" + " <?php\n" + " if (defined('MVS_STATUS') && MVS_STATUS == 'true') {\n" + " ?>\n" + " <!-- multi-vendor shipping -->\n" + " <tr>\n" + " <td class=\"pageHeading\" align=\"right\"><?php echo TEXT_VENDORS_PRODUCT_PRICE_INFO . '<br>' . $currencies->format($pInfo->vendors_product_price); ?></td>\n" + " </tr>\n" + " <!-- multi-vendor shipping //eof -->\n" + " <?php\n" + " }\n" + " ?>\n" + " </table></td>\n" + " </tr>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php \n" + " if ($products_image_med_name) {\n" + " echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_med_destination . $products_image_med_name, $products_image_med_destination . $products_image_med_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'align=\"right\" hspace=\"5\" vspace=\"5\"'); \n" + " } elseif ($products_image_lrg_name) {\n" + " ?>\n" + " <script script type=\"text/javascript\">\n" + " <!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_lrg_destination . $products_image_lrg_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_med_destination . $products_image_name, $products_image_med_destination . $products_image_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"right\" hspace=\"5\" vspace=\"5\"') . '</a>'; ?>');\n" + " //--> \n" + " </script>\n" + " <?php \n" + " } elseif ($products_image_name) { \n" + " echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_name, $products_image_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=\"right\" hspace=\"5\" vspace=\"5\"');\n" + " }\n" + " echo $pInfo->products_description . '<br><br>';\n" + " \n" + " if ($read == 'only') {\n" + " $products_extra_fields_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . \" WHERE products_id=\" . (int)$pID);\n" + " while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {\n" + " $extra_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];\n" + " }\n" + " } else {\n" + " $extra_fields_array = $_POST['extra_field'];\n" + " }\n" + " ?> \n" + " <br><br><b>Extra Fields</b><br>\n" + " <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n" + " <?php\n" + " $extra_fields_names_query = tep_db_query(\"SELECT * FROM \" . TABLE_PRODUCTS_EXTRA_FIELDS. \" WHERE languages_id='0' or languages_id='\".(int)$languages[$i]['id'].\"' ORDER BY products_extra_fields_order\");\n" + " while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {\n" + " $extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];\n" + " ?>\n" + " <tr bgcolor=\"#F0F9FF\">\n" + " <td class=\"main\" align=\"right\"><b><?php echo (isset($extra_fields_names['products_extra_fields_name']) ? $extra_fields_names['products_extra_fields_name'] : '');?> : </b></td>\n" + " <td class=\"main\" align=\"left\"><b><?php echo (isset($extra_fields_array[$extra_fields_names['products_extra_fields_id']]) ? $extra_fields_array[$extra_fields_names['products_extra_fields_id']] : '');?></b></td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " </table>\n" + " <br>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " if ($pInfo->products_url) {\n" + " ?>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"main\"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <?php\n" + " if ($pInfo->products_date_available > date('Y-m-d')) {\n" + " ?>\n" + " <tr>\n" + " <td align=\"center\" class=\"smallText\"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)); ?></td>\n" + " </tr>\n" + " <?php\n" + " } else {\n" + " ?>\n" + " <tr>\n" + " <td align=\"center\" class=\"smallText\"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)); ?></td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " ?>\n" + " <tr>\n" + " <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>\n" + " </tr>\n" + " <?php\n" + " } // end for\n" + " ?>\n" + " <tr>\n" + " <td><fieldset>\n" + " <legend><b><!-- Extra Images --><?php echo TEXT_EXTRA_IMAGES;?></b></legend>\n" + " <?php if ($products_image_xl_1_name) { ?>\n" + " <script script type=\"text/javascript\"><!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_1_destination . $products_image_xl_1_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_1_destination . $products_image_sm_1_name, $products_image_sm_1_destination . $products_image_sm_1_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"') . '</a>'; ?>');\n" + " //--></script>\n" + " <?php } elseif ($products_image_sm_1_name) { ?>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_1_destination . $products_image_sm_1_name, $products_image_sm_1_destination . $products_image_sm_1_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"'); }; ?>\n" + " <?php if ($products_image_xl_2_name) { ?>\n" + " <script script type=\"text/javascript\"><!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_xl_2_destination . $products_image_xl_2_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_2_destination . $products_image_sm_2_name, $products_image_sm_2_destination . $products_image_sm_2_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"') . '</a>'; ?>');\n" + " //-->\n" + " </script>\n" + " <?php } elseif ($products_image_sm_2_name) { ?>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_2_destination . $products_image_sm_2_name, $products_image_sm_2_destination . $products_image_sm_2_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"'); }; ?>\n" + " <?php if ($products_image_xl_3_name) { ?>\n" + " <script script type=\"text/javascript\"><!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_xl_3_destination . $products_image_xl_3_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_3_destination . $products_image_sm_3_name, $products_image_sm_3_destination . $products_image_sm_3_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"') . '</a>'; ?>');\n" + " //-->\n" + " </script>\n" + " <?php } elseif ($products_image_sm_3_name) { ?>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_3_destination . $products_image_sm_3_name, $products_image_sm_3_destination . $products_image_sm_3_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"'); }; ?>\n" + " <?php if ($products_image_xl_4_name) { ?>\n" + " <script script type=\"text/javascript\"><!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_xl_4_destination . $products_image_xl_4_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_4_destination . $products_image_sm_4_name, $products_image_sm_4_destination . $products_image_sm_4_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"') . '</a>'; ?>');\n" + " //-->\n" + " </script>\n" + " <?php } elseif ($products_image_sm_4_name) { ?>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_4_destination . $products_image_sm_4_name, $products_image_sm_4_destination . $products_image_sm_4_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"'); }; ?>\n" + " <?php if ($products_image_xl_5_name) { ?>\n" + " <script script type=\"text/javascript\"><!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_xl_5_destination . $products_image_xl_5_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_5_destination . $products_image_sm_5_name, $products_image_sm_5_destination . $products_image_sm_5_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"') . '</a>'; ?>');\n" + " //-->\n" + " </script>\n" + " <?php } elseif ($products_image_sm_5_name) { ?>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_5_destination . $products_image_sm_5_name, $products_image_sm_5_destination . $products_image_sm_5_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"5\" vspace=\"5\"'); }; ?>\n" + " <?php if ($products_image_xl_6_name) { ?>\n" + " <script script type=\"text/javascript\"><!--\n" + " document.write('<?php echo '<a href=\"javascript:popupWindow(\\\\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_xl_6_destination . $products_image_xl_6_name) . '\\\\\\')\">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_6_destination . $products_image_sm_6_name, $products_image_sm_6_destination . $products_image_sm_6_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"6\" vspace=\"6\"') . '</a>'; ?>');\n" + " //-->\n" + " </script>\n" + " <?php } elseif ($products_image_sm_6_name) { ?>\n" + " <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_6_destination . $products_image_sm_6_name, $products_image_sm_6_destination . $products_image_sm_6_name, ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'align=\"center\" hspace=\"6\" vspace=\"6\"'); };?>\n" + " </fieldset></td>\n" + " </tr>\n" + " <?php\n" + " if (isset($read) && ($read == 'only')) {\n" + " if (isset($_GET['origin'])) {\n" + " $pos_params = strpos($_GET['origin'], '?', 0);\n" + " if ($pos_params != false) {\n" + " $back_url = substr($_GET['origin'], 0, $pos_params);\n" + " $back_url_params = substr($_GET['origin'], $pos_params + 1);\n" + " } else {\n" + " $back_url = $_GET['origin'];\n" + " $back_url_params = '';\n" + " }\n" + " } else {\n" + " $back_url = FILENAME_CATEGORIES;\n" + " $back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;\n" + " } \n" + " ?>\n" + " <tr>\n" + " <td align=\"right\"><?php echo '<a href=\"' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '\">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>\n" + " </tr>\n" + " <?php\n" + " } else {\n" + " ?>\n" + " <tr>\n" + " <td align=\"right\" class=\"smallText\">\n" + " <?php\n" + " reset($_POST);\n" + " while (list($key, $value) = each($_POST)) {\n" + " if (!is_array($_POST[$key])) {\n" + " echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value))) . \"\\n\";\n" + " } else {\n" + " while (list($k, $v) = each($value)) {\n" + " echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v))) . \"\\n\";\n" + " }\n" + " }\n" + " }\n" + " if ($_POST['extra_field']) { // Check to see if there are any need to update extra fields.\n" + " foreach ($_POST['extra_field'] as $key=>$val) {\n" + " echo tep_draw_hidden_field('extra_field['.$key.']', stripslashes($val)) . \"\\n\";\n" + " }\n" + " } // Check to see if there are any need to update extra fields.\n" + " echo tep_draw_hidden_field('products_image', stripslashes($products_image_destination . $products_image_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_med', stripslashes($products_image_med_destination . $products_image_med_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_lrg', stripslashes($products_image_lrg_destination . $products_image_lrg_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_sm_1', stripslashes($products_image_sm_1_destination . $products_image_sm_1_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_xl_1', stripslashes($products_image_xl_1_destination . $products_image_xl_1_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_sm_2', stripslashes($products_image_sm_2_destination . $products_image_sm_2_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_xl_2', stripslashes($products_image_xl_2_destination . $products_image_xl_2_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_sm_3', stripslashes($products_image_sm_3_destination . $products_image_sm_3_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_xl_3', stripslashes($products_image_xl_3_destination . $products_image_xl_3_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_sm_4', stripslashes($products_image_sm_4_destination . $products_image_sm_4_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_xl_4', stripslashes($products_image_xl_4_destination . $products_image_xl_4_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_sm_5', stripslashes($products_image_sm_5_destination . $products_image_sm_5_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_xl_5', stripslashes($products_image_xl_5_destination . $products_image_xl_5_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_sm_6', stripslashes($products_image_sm_6_destination . $products_image_sm_6_name)) . \"\\n\";\n" + " echo tep_draw_hidden_field('products_image_xl_6', stripslashes($products_image_xl_6_destination . $products_image_xl_6_name)) . \"\\n\";\n\n" + " echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name=\"edit\"') . '&nbsp;&nbsp;' . \"\\n\";\n" + " if (!empty($pID)) {\n" + " echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . \"\\n\";;\n" + " } else {\n" + " echo tep_image_submit('button_insert.gif', IMAGE_INSERT) . \"\\n\";;\n" + " }\n" + " echo '&nbsp;&nbsp;<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($pID) ? '&pID=' . $pID : '')) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + " </form>\n" + " <?php\n" + " }\n" + " } else {\n" + " ?>\n" + " <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">\n" + " <tr>\n" + " <td><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td class=\"pageHeading\"><?php echo HEADING_TITLE; ?></td>\n" + " <td class=\"pageHeading\" align=\"right\"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>\n" + " <td align=\"right\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td class=\"smallText\" align=\"right\">\n" + " <?php\n" + " echo tep_draw_form('search', FILENAME_CATEGORIES);\n" + " echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search');\n" + " echo '</form>';\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td class=\"smallText\" align=\"right\">\n" + " <?php\n" + " echo tep_draw_form('goto', FILENAME_CATEGORIES, '', 'get');\n" + " echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange=\"this.form.submit();\"');\n" + " if (isset($_GET[tep_session_name()])) {\n" + " echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);\n" + " }\n" + " echo '</form>';\n" + " ?>\n" + " </td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " </table></td>\n" + " </tr>\n" + " <?php\n" + " // RCI start\n" + " echo $cre_RCI->get('categories', 'listingtop');\n" + " // RCI eof\n" + " ?>\n" + " <tr>\n" + " <td>\n" + " <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n" + " <tr>\n" + " <td valign=\"top\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" class=\"data-table\">\n" + " <?php\n" + " echo tep_draw_form('sort', FILENAME_CATEGORIES, tep_get_all_get_params(array('action')) . 'action=sort', 'post', '', 'SSL');\n" + " ?>\n" + " <tr class=\"dataTableHeadingRow\">\n" + " <td class=\"dataTableHeadingContent\"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>\n" + " <td class=\"dataTableHeadingContent\" align=\"center\"><?php echo TABLE_HEADING_STATUS; ?></td>\n" + " <td class=\"dataTableHeadingContent\" align=\"center\" width=\"50\"><?php echo TABLE_HEADING_SORT_ORDER; ?></td>\n" + " <td class=\"dataTableHeadingContent\" align=\"right\"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>\n" + " </tr>\n" + " <?php\n" + " $categories_count = 0;\n" + " $rows = 0;\n" + " if (isset($_POST['search'])) {\n" + " $search = str_replace(\"'\", \"&#39\", tep_db_prepare_input($_POST['search'])); \n" + " $categories_query = tep_db_query(\"select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd where c.categories_id = cd.categories_id and cd.language_id = '\" . (int)$languages_id . \"' and cd.categories_name like '%\" . tep_db_input($search) . \"%' order by c.sort_order, cd.categories_name\");\n" + " } else {\n" + " $categories_query = tep_db_query(\"select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd where c.parent_id = '\" . (int)$current_category_id . \"' and c.categories_id = cd.categories_id and cd.language_id = '\" . (int)$languages_id . \"' order by c.sort_order, cd.categories_name\");\n" + " }\n" + " $sort_order = 0;\n" + " while ($categories = tep_db_fetch_array($categories_query)) {\n" + " if (empty($cID)){\n" + " $cID = $categories['categories_id'];\n" + " }\n" + " $categories_count++;\n" + " $sort_order += 10;\n" + " $rows++;\n" + " // Get parent_id for subcategories if search\n" + " if (isset($_POST['search'])) $cPath= $categories['parent_id'];\n" + " if ((!isset($_GET['cID']) && !isset($_GET['pID']) || (isset($_GET['cID']) && ($_GET['cID'] == $categories['categories_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {\n" + " $category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id']));\n" + " $category_products = array('products_count' => tep_products_in_category_count($categories['categories_id']));\n" + " $cInfo_array = array_merge($categories, $category_childs, $category_products);\n" + " $cInfo = new objectInfo($cInfo_array);\n" + " }\n" + " if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) {\n" + " echo '<tr id=\"defaultSelected\" class=\"dataTableRowSelected\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">' . \"\\n\";\n" + " $onclick = 'document.location.href=\\'' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '\\'';\n" + " } else {\n" + " echo '<tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">' . \"\\n\";\n" + " $onclick = 'document.location.href=\\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\\'';\n" + " }\n" + " ?>\n" + " <td class=\"dataTableContent\" onclick=\"<?php echo $onclick; ?>\"><?php echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '\">' . tep_image(DIR_WS_ICONS . 'folder.png', ICON_FOLDER) . '</a>&nbsp;<b>' . $categories['categories_name'] . '</b>'; ?></td>\n" + " <td class=\"dataTableContent\" align=\"center\" onclick=\"<?php echo $onclick; ?>\">&nbsp;</td>\n" + " <td class=\"dataTableContent\" align=\"center\"><?php echo tep_draw_input_field('c_sort_order[' . $categories['categories_id'] . ']', $sort_order, 'size=\"4\"');?></td>\n" + " <td class=\"dataTableContent\" align=\"right\" onclick=\"<?php echo $onclick; ?>\"><?php echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id'] . '&action=edit_category') . '\">' . tep_image(DIR_WS_ICONS . 'page_edit.png', ICON_EDIT) . '</a>'; ?>&nbsp;&nbsp;\n" + " <?php\n" + " if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) {\n" + " echo tep_image(DIR_WS_IMAGES . 'arrow_right_blue.png', '');\n" + " } else {\n" + " echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\">' . tep_image(DIR_WS_IMAGES . 'information.png', IMAGE_ICON_INFO) . '</a>';\n" + " }\n" + " ?>&nbsp;\n" + " </td>\n" + " </tr>\n" + " \n" + " \n" + " \n" + " \n" + " <?php\n" + " }\n" + " $products_count = 0;\n" + " if (isset($_POST['search'])) {\n" + " $search = str_replace(\"'\", \"&#39\", tep_db_prepare_input($_POST['search'])); \n" + " $products_query = tep_db_query(\"SELECT p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.vendors_product_price, p.vendors_prod_comments, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model, p2c.categories_id\n" + " FROM \" . TABLE_PRODUCTS . \" p,\n" + " \" . TABLE_PRODUCTS_DESCRIPTION . \" pd,\n" + " \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c\n" + " WHERE p.products_id = pd.products_id\n" + " and pd.language_id = \" . (int)$languages_id . \"\n" + " and p.products_id = p2c.products_id\n" + " and (pd.products_name like '%\" . tep_db_input($search) . \"%' or\n" + " p.products_model like '%\" . tep_db_input($search) . \"%')\n" + " ORDER BY p.sort_order, pd.products_name\");\n" + " } else {\n" + " $products_query = tep_db_query(\"SELECT p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.vendors_product_price, p.vendors_prod_comments, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model, p2c.categories_id\n" + " from \" . TABLE_PRODUCTS . \" p,\n" + " \" . TABLE_PRODUCTS_DESCRIPTION . \" pd,\n" + " \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c\n" + " WHERE p.products_id = pd.products_id\n" + " and pd.language_id = \" . (int)$languages_id . \"\n" + " and p.products_id = p2c.products_id\n" + " and p2c.categories_id = \" . (int)$current_category_id . \"\n" + " and p.products_parent_id = 0\n" + " ORDER BY sort_order, pd.products_name\");\n" + " }\n" + " $sort_order = 0;\n" + " while ($products = tep_db_fetch_array($products_query)) {\n" + " if (empty($pID)){\n" + " $pID = $products['products_id'];\n" + " }\n" + " $products_count++;\n" + " $sort_order += 10;\n" + " $rows++;\n" + " // Get categories_id for product if search\n" + " if (isset($_POST['search'])) {\n" + " $product_category_query = tep_db_query(\"SELECT categories_id\n" + " FROM \" . TABLE_PRODUCTS_TO_CATEGORIES . \"\n" + " WHERE products_id = \" . $products['products_id'] . \"\n" + " ORDER BY categories_id\");\n" + " $prodcats = tep_db_fetch_array($product_category_query);\n" + " $cPath = $prodcats['categories_id'];\n" + " }\n" + " if ( (!isset($_GET['pID']) && !isset($_GET['cID']) || (isset($_GET['pID']) && ($_GET['pID'] == $products['products_id']))) && !isset($pInfo) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {\n" + " // find out the rating average from customer reviews\n" + " $reviews_query = tep_db_query(\"select (avg(reviews_rating) / 5 * 100) as average_rating from \" . TABLE_REVIEWS . \" where products_id = '\" . (int)$products['products_id'] . \"'\");\n" + " $reviews = tep_db_fetch_array($reviews_query);\n" + " $pInfo_array = array_merge($products, $reviews);\n" + " $pInfo = new objectInfo($pInfo_array);\n" + " }\n" + " // RCO start plistrows\n" + " if ($cre_RCO->get('categories', 'plistrows') !== true) {\n" + " if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id) ) {\n" + " echo '<tr id=\"defaultSelected\" class=\"dataTableRowSelected\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">' . \"\\n\";\n" + " $onclick = 'document.location.href=\\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\\'';\n" + " } else {\n" + " echo '<tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">' . \"\\n\";\n" + " $onclick = 'document.location.href=\\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '\\'';\n" + " }\n" + " ?>\n" + " <td class=\"dataTableContent\" onclick=\"<?php echo $onclick; ?>\"><?php echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\">' . tep_image(DIR_WS_ICONS . 'magnifier.png', ICON_PREVIEW) . '</a>&nbsp;' . $products['products_name']; ?></td>\n" + " <td class=\"dataTableContent\" align=\"center\" onclick=\"<?php echo $onclick; ?>\">\n" + " <?php\n" + " if ($products['products_status'] == '1') {\n" + " echo tep_image(DIR_WS_IMAGES . 'accept.png', IMAGE_ICON_STATUS_GREEN, 16, 16) . '&nbsp;&nbsp;<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '\">' . tep_image(DIR_WS_IMAGES . 'cancel-off.png', IMAGE_ICON_STATUS_RED_LIGHT, 16, 16) . '</a>';\n" + " } else {\n" + " echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '\">' . tep_image(DIR_WS_IMAGES . 'accept-off.png', IMAGE_ICON_STATUS_GREEN_LIGHT, 16, 16) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'cancel.png', IMAGE_ICON_STATUS_RED, 16, 16);\n" + " }\n" + " ?>\n" + " </td>\n" + " <td class=\"dataTableContent\" align=\"center\"><?php echo tep_draw_input_field('sort_order[' . $products['products_id'] . ']', $sort_order, 'size=\"4\"');?></td>\n" + " <td class=\"dataTableContent\" align=\"right\" onclick=\"<?php echo $onclick; ?>\"><?php echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product') . '\">' . tep_image(DIR_WS_ICONS . 'page_edit.png', ICON_EDIT) . '</a>'; ?>&nbsp;&nbsp;\n" + " <?php\n" + " if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) {\n" + " echo tep_image(DIR_WS_IMAGES . 'arrow_right_blue.png', '');\n" + " } else {\n" + " echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '\">' . tep_image(DIR_WS_IMAGES . 'information.png', IMAGE_ICON_INFO) . '</a>';\n" + " }\n" + " ?>&nbsp;\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " // RCO end plistrows\n" + " }\n" + " }\n" + " $cPath_back = '';\n" + " if (sizeof($cPath_array) > 0) {\n" + " for ($i=0, $n=sizeof($cPath_array)-1; $i<$n; $i++) {\n" + " if (empty($cPath_back)) {\n" + " $cPath_back .= $cPath_array[$i];\n" + " } else {\n" + " $cPath_back .= '_' . $cPath_array[$i];\n" + " }\n" + " }\n" + " }\n" + " $cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : '';\n" + " ?>\n" + " </table>\n" + " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"data-table-foot\">\n" + " <tr>\n" + " <td colspan=\"4\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">\n" + " <tr>\n" + " <td class=\"smallText\"><?php echo TEXT_CATEGORIES . '&nbsp;' . $categories_count . '<br>' . TEXT_PRODUCTS . '&nbsp;' . $products_count; ?></td>\n" + " <td align=\"right\" class=\"smallText\">\n" + " <?php\n" + " if (sizeof($cPath_array) > 0) echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, $cPath_back . 'cID=' . $current_category_id) . '\">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; \n" + " echo tep_image_submit('button_update_sort_order.gif', IMAGE_UPDATE_SORT_ORDER);\n" + " // RCO start listing buttons\n" + " if ($cre_RCO->get('categories', 'listingbuttons') !== true) { \n" + " if (!isset($_POST['search'])) echo '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_category') . '\">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_product') . '\">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; \n" + " }\n" + " // RCO eof\n" + " ?>&nbsp;\n" + " </td>\n" + " </tr>\n" + " <tr>\n" + " <td colspan=\"5\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">\n" + " <tr> \n" + " <?php\n" + " // RCI code start\n" + " echo $cre_RCI->get('categories', 'listingbottom');\n" + " // RCI code eof\n" + " ?>\n" + " </tr>\n" + " </table></td>\n" + " </tr> \n" + " </table></td>\n" + " </tr>\n" + " </form>\n" + " </table></td>\n" + " <?php\n" + " $heading = array();\n" + " $contents = array();\n" + " switch ($action) {\n" + " case 'new_category':\n" + " case 'new_category':\n" + " $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CATEGORY . '</b>');\n" + " $contents = array('form' => tep_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype=\"multipart/form-data\"'));\n" + " $contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);\n" + " $category_inputs_string = '';\n" + " $languages = tep_get_languages();\n" + " for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {\n" + " $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');\n" + " }\n" + " $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_NAME . $category_inputs_string);\n" + " $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));\n" + " $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size=\"2\"'));\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');\n" + " break;\n" + " \n" + " case 'delete_category':\n" + " $heading[] = array('text' => TEXT_INFO_HEADING_DELETE_CATEGORY);\n" + " $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));\n" + " $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);\n" + " $contents[] = array('text' => '<br><b>' . $cInfo->categories_name . '</b>');\n" + " if ($cInfo->childs_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));\n" + " if ($cInfo->products_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count));\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_delete.gif', IMAGE_DELETE));\n" + " break;\n" + " \n" + " case 'move_category':\n" + " $heading[] = array('text' => TEXT_INFO_HEADING_MOVE_CATEGORY);\n" + " $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));\n" + " $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));\n" + " $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_move.gif', IMAGE_MOVE));\n" + " break;\n" + " \n" + " case 'delete_product':\n" + " $heading[] = array('text' => TEXT_INFO_HEADING_DELETE_PRODUCT);\n" + " $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));\n" + " $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);\n" + " $contents[] = array('text' => '<br><b>' . $pInfo->products_name . '</b>');\n" + " $product_categories_string = '';\n" + " $product_categories = tep_generate_category_path($pInfo->products_id, 'product');\n" + " for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {\n" + " $category_path = '';\n" + " for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {\n" + " $category_path .= $product_categories[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';\n" + " }\n" + " $category_path = substr($category_path, 0, -16);\n" + " $product_categories_string .= tep_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i])-1]['id'], true) . '&nbsp;' . $category_path . '<br>';\n" + " }\n" + " $product_categories_string = substr($product_categories_string, 0, -4);\n" + " $contents[] = array('text' => '<br>' . $product_categories_string);\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_delete.gif', IMAGE_DELETE));\n" + " break;\n" + " \n" + " case 'move_product':\n" + " $heading[] = array('text' => TEXT_INFO_HEADING_MOVE_PRODUCT);\n" + " $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));\n" + " $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));\n" + " $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');\n" + " $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_move.gif', IMAGE_MOVE));\n" + " break;\n" + " \n" + " case 'copy_to':\n" + " $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');\n" + " $contents = array('form' => tep_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));\n" + " $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);\n" + " $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');\n" + " $contents[] = array('text' => '<br>' . TEXT_CATEGORIES . '<br>' . tep_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id));\n" + " $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " // only ask about attributes if they exist\n" + " if (tep_has_product_attributes($pInfo->products_id)) {\n" + " $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_ONLY);\n" + " $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " }\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_copy.gif', IMAGE_COPY));\n" + " break;\n" + " \n" + " case 'copy_product_attributes':\n" + " $copy_attributes_delete_first='1';\n" + " $copy_attributes_duplicates_skipped='1';\n" + " $copy_attributes_duplicates_overwrite='0';\n" + " if (DOWNLOAD_ENABLED == 'true') {\n" + " $copy_attributes_include_downloads='1';\n" + " $copy_attributes_include_filename='1';\n" + " } else {\n" + " $copy_attributes_include_downloads='0';\n" + " $copy_attributes_include_filename='0';\n" + " }\n" + " $heading[] = array('text' => TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT);\n" + " $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes&cPath=' . $cPath . '&pID=' . $pInfo->products_id) . tep_draw_hidden_field('products_id', $pInfo->products_id) . tep_draw_hidden_field('products_name', $pInfo->products_name));\n" + " $contents[] = array('text' => '<br>'.TEXT_COPYING_ATTRIBUTES_FROM.' #' . $pInfo->products_id . '<br><b>' . $pInfo->products_name . '</b>');\n" + " $contents[] = array('text' => TEXT_COPYING_ATTRIBUTES_TO.' #&nbsp;' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size=\"3\"'));\n" + " $contents[] = array('text' => '<br>'.TEXT_DELETE_ALL_ATTRIBUTE.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size=\"2\"'));\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " $contents[] = array('text' => '<br>' . TEXT_OTHERWISE);\n" + " $contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size=\"2\"'));\n" + " $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;'.TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size=\"2\"'));\n" + " if (DOWNLOAD_ENABLED == 'true') {\n" + " $contents[] = array('text' => '<br>'.TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size=\"2\"'));\n" + " }\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);\n" + " if ($pID) {\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER);\n" + " } else {\n" + " $contents[] = array('align' => 'center', 'text' => '<br>'.TEXT_SELECT_PRODUCT_FOR_DISPLAY);\n" + " }\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_copy.gif', TEXT_BUTTON_COPY_ATTRIBUTES));\n" + " break;\n" + " \n" + " case 'copy_product_attributes_categories':\n" + " $copy_attributes_delete_first='1';\n" + " $copy_attributes_duplicates_skipped='1';\n" + " $copy_attributes_duplicates_overwrite='0';\n" + " if (DOWNLOAD_ENABLED == 'true') {\n" + " $copy_attributes_include_downloads='1';\n" + " $copy_attributes_include_filename='1';\n" + " } else {\n" + " $copy_attributes_include_downloads='0';\n" + " $copy_attributes_include_filename='0';\n" + " }\n" + " $heading[] = array('text' => TEXT_COPY_PRODUCT_ATTRIBUTES_TO_CATEGORY);\n" + " $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes_categories&cPath=' . $cPath . '&cID=' . $cID . '&make_copy_from_products_id=' . $copy_from_products_id));\n" + " $contents[] = array('text' => TEXT_COPY_PRODUCT_ATTRIBUTES_FROM_PRODUCT_ID.'#&nbsp;' . tep_draw_input_field('make_copy_from_products_id', $make_copy_from_products_id, 'size=\"3\"'));\n" + " $contents[] = array('text' => '<br>'.TEXT_COPYING_TO_ALL_PRODUCTS_IN_CATEGORY_ID.'#&nbsp;' . $cID . '<br>'.TEXT_CATEGORY_NAME.' <b>' . tep_get_category_name($cID, $languages_id) . '</b>');\n" + " $contents[] = array('text' => '<br>'.TEXT_DELETE_ALL_ATTRIBUTE.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size=\"2\"'));\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " $contents[] = array('text' => '<br>' . TEXT_OTHERWISE);\n" + " $contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size=\"2\"'));\n" + " $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;'.TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size=\"2\"'));\n" + " if (DOWNLOAD_ENABLED == 'true') {\n" + " $contents[] = array('text' => '<br>'.TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size=\"2\"'));\n" + " }\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_ATTRIBUTES_PRODUCT_LOOKUP);\n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID) . '\">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . tep_image_submit('button_copy.gif', 'Copy Attribtues'));\n" + " break;\n" + " \n" + " default:\n" + " if ($rows > 0) {\n" + " if (isset($cInfo) && is_object($cInfo)) { // category info box contents\n" + " $heading[] = array('text' => $cInfo->categories_name);\n" + " // RCO start\n" + " if ($cre_RCO->get('categories', 'csidebarbuttons') !== true) { \n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '\">' . tep_image_button('button_page_edit.png', IMAGE_EDIT) . '</a><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '\">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '\">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');\n" + " }\n" + " // RCO eof\n" + " $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' <b>' . tep_date_short($cInfo->date_added) . '</b>');\n" + " if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' <b>' . tep_date_short($cInfo->last_modified) . '</b>');\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);\n" + " $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' <b>' . $cInfo->childs_count . '</b><br>' . TEXT_PRODUCTS . ' <b>' . $cInfo->products_count . '</b>');\n" + " // RCO start\n" + " if ($cre_RCO->get('categories', 'csidebarattributes') !== true) { \n" + " if ($cInfo->childs_count == 0 and $cInfo->products_count >= 1) {\n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " if ($cID) {\n" + " $contents[] = array('align' => 'center', 'text' => '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=copy_product_attributes_categories') . '\"><br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');\n" + " } else {\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_ATTRIBUTES_COPY_TO);\n" + " }\n" + " }\n" + " }\n" + " // RCO eof\n" + " // RCI include category sidebar bottom text\n" + " $returned_rci = $cre_RCI->get('categories', 'csidebarbottom');\n" + " $contents[] = array('text' => $returned_rci);\n" + " } elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents\n" + " // multi-vendor shipping \n" + " $vendors_query_2 = tep_db_query(\"SELECT v.vendors_id, v.vendors_name \n" + " from vendors v, products p \n" + " WHERE v.vendors_id=p.vendors_id \n" + " and p.products_id='\" . $pInfo->products_id . \"'\");\n" + " while ($vendors_2 = tep_db_fetch_array($vendors_query_2)) {\n" + " $current_vendor_name = $vendors_2['vendors_name'];\n" + " }\n" + " // multi-vendor shipping //eof \n" + " $heading[] = array('text' => tep_get_products_name($pInfo->products_id, $languages_id));\n" + " // RCO start\n" + " if ($cre_RCO->get('categories', 'psidebarbuttons') !== true) { \n" + " $contents[] = array('align' => 'center', 'text' => '<br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $pInfo->categories_id . '&pID=' . $pInfo->products_id . '&action=new_product') . '\">' . tep_image_button('button_page_edit.png', IMAGE_EDIT) . '</a><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $pInfo->categories_id . '&pID=' . $pInfo->products_id . '&action=delete_product') . '\">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $pInfo->categories_id . '&pID=' . $pInfo->products_id . '&action=move_product') . '\">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a><a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $pInfo->categories_id . '&pID=' . $pInfo->products_id . '&action=copy_to') . '\">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');\n" + " $contents[] = array('align' => 'center', 'text' => tep_draw_separator('pixel_trans.gif', '1', '16') . '<a href=\"' . tep_href_link(FILENAME_ATTRIBUTES, 'cPath=' . $pInfo->categories_id . '&pID=' . $pInfo->products_id) . '\">' . tep_image_button('button_edit_attributes.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>');\n" + " }\n" + " // RCO eof\n" + " //RCI include product sidebar buttons\n" + " $returned_rci = $cre_RCI->get('categories', 'psidebarbuttons');\n" + " $contents[] = array('align' => 'center', 'text' => $returned_rci);\n" + " $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' <b>' . tep_date_short($pInfo->products_date_added) . '</b>');\n" + " if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' <b>' . tep_date_short($pInfo->products_last_modified) . '</b>');\n" + " if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' <b>' . tep_date_short($pInfo->products_date_available) . '</b>');\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($pInfo->products_image, tep_get_products_name($pInfo->products_id, $languages_id), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);\n" + " $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' <b>' . $currencies->format($pInfo->products_price) . '</b><br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' <b>' . $pInfo->products_quantity . '</b>');\n" + " // multi-vendor shipping\n" + " if (defined('MVS_STATUS') && MVS_STATUS == 'true') {\n" + " $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' <b>' . $currencies->format($pInfo->products_price) . '</b><br>' . TEXT_VENDOR . ' <b>' . $current_vendor_name . '</b><br>' . TEXT_VENDORS_PRODUCT_PRICE_INFO . '<b>' . $currencies->format($pInfo->vendors_product_price) . '</b><br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' <b>' . $pInfo->products_quantity . '</b>');\n" + " }\n" + " // multi-vendor shipping //eof \n" + " $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' <b>' . number_format($pInfo->average_rating, 2) . '%</b>');\n" + " //RCI include product sidebar product text\n" + " $returned_rci = $cre_RCI->get('categories', 'psidebarproducttext');\n" + " $contents[] = array('text' => $returned_rci);\n" + " // RCO start\n" + " if ($cre_RCO->get('categories', 'psidebarattributes') !== true) { \n" + " $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));\n" + " $contents[] = array('align' => 'center', 'text' => '<a href=\"' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $pInfo->categories_id . '&pID=' . $pInfo->products_id . '&action=copy_product_attributes') . '\"><br>' . tep_image_button('button_copy_to.gif', TEXT_BUTTON_COPY_ATTRIBUTES) . '</a>');\n" + " if ($pID) {\n" + " $contents[] = array('align' => 'center', 'text' => '<br>' . sprintf(TEXT_ATTRIBUTES_NAMES_HELPER, $pID) . '<font color=#FF0000><b>' . $pID . '</b></font>');\n" + " } else {\n" + " $contents[] = array('align' => 'center', 'text' => '<br>'. TEXT_SELECT_PRODUCT_TO_DISPLAY_ATTRIBUTES);\n" + " }\n" + " }\n" + " // RCO eof\n" + " //RCI include product sidebar bottom product text\n" + " $returned_rci = $cre_RCI->get('categories', 'psidebarbottom');\n" + " $contents[] = array('text' => $returned_rci);\n" + " }\n" + " } else { \n" + " $heading[] = array('text' => EMPTY_CATEGORY);\n" + " $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);\n" + " }\n" + " break;\n" + " } \n" + " if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {\n" + " echo '<td width=\"25%\" valign=\"top\">' . \"\\n\";\n" + " $box = new box;\n" + " echo $box->infoBox($heading, $contents);\n" + " echo '</td>' . \"\\n\";\n" + " }\n" + " ?>\n" + " </tr>\n" + " </table>\n" + " </td>\n" + " </tr>\n" + " <?php\n" + " }\n" + " // RCI code start\n" + " echo $cre_RCI->get('categories', 'bottom'); \n" + " echo $cre_RCI->get('global', 'bottom'); \n" + " // RCI code eof\n" + " ?>\n" + " </table>\n" + " </td>\n" + " <!-- body_text_eof //-->\n" + " </tr>\n" + "</table>\n" + "</div>\n" + "<!-- body_eof //-->\n" + "<!-- footer //-->\n" + "<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>\n" + "<!-- footer_eof //-->\n" + "<br>\n" + "</body>\n" + "</html>\n" + "<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>"; final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); final Matcher matcher = pattern.matcher(string); while (matcher.find()) { System.out.println("Full match: " + matcher.group(0)); for (int i = 1; i <= matcher.groupCount(); i++) { System.out.println("Group " + i + ": " + matcher.group(i)); } } } }

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html