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