if ($_GET['action'] == 'insert') {
                $insert_sql_data = array('manufacturers_id' => $manufacturers_id, 'languages_id' => $language_id);
                $sql_data_array = xtc_array_merge($sql_data_array, $insert_sql_data);
                xtc_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array);
            } elseif ($_GET['action'] == 'save') {
                //BOF - web28 - 2010-07-11 - BUGFIX no entry stored for previous deactivated languages
                $manufacturers_query = xtc_db_query("select * from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . $language_id . "' and manufacturers_id = '" . xtc_db_input($manufacturers_id) . "'");
                if (xtc_db_num_rows($manufacturers_query) == 0) {
                    xtc_db_perform(TABLE_MANUFACTURERS_INFO, array('manufacturers_id' => xtc_db_input($manufacturers_id), 'languages_id' => $language_id));
                }
                //EOF - web28 - 2010-07-11 - BUGFIX no entry stored for previous deactivated languages
                xtc_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array, 'update', "manufacturers_id = '" . xtc_db_input($manufacturers_id) . "' and languages_id = '" . $language_id . "'");
            }
        }
        if (USE_CACHE == 'true') {
            xtc_reset_cache_block('manufacturers');
        }
        xtc_redirect(xtc_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers_id));
        break;
}
require DIR_WS_INCLUDES . 'head.php';
?>
</head>
<?php 
if (USE_WYSIWYG == 'true' && $_GET['action']) {
    echo '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">';
} else {
    echo '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">';
}
?>
	
 function remove_product($product_id)
 {
     // get content of product
     $product_content_query = xtc_db_query("SELECT content_file FROM " . TABLE_PRODUCTS_CONTENT . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     // check if used elsewhere, delete db-entry + file if not
     while ($product_content = xtc_db_fetch_array($product_content_query)) {
         $duplicate_content_query = xtc_db_query("SELECT count(*) AS total FROM " . TABLE_PRODUCTS_CONTENT . " WHERE content_file = '" . xtc_db_input($product_content['content_file']) . "' AND products_id != '" . xtc_db_input($product_id) . "'");
         $duplicate_content = xtc_db_fetch_array($duplicate_content_query);
         if ($duplicate_content['total'] == 0) {
             @unlink(DIR_FS_DOCUMENT_ROOT . 'media/products/' . $product_content['content_file']);
         }
         //delete DB-Entry
         xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_CONTENT . " WHERE products_id = '" . xtc_db_input($product_id) . "' AND (content_file = '" . $product_content['content_file'] . "' OR content_file = '')");
     }
     $product_image_query = xtc_db_query("SELECT products_image FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     $product_image = xtc_db_fetch_array($product_image_query);
     $duplicate_image_query = xtc_db_query("SELECT count(*) AS total FROM " . TABLE_PRODUCTS . " WHERE products_image = '" . xtc_db_input($product_image['products_image']) . "'");
     $duplicate_image = xtc_db_fetch_array($duplicate_image_query);
     if ($duplicate_image['total'] < 2) {
         xtc_del_image_file($product_image['products_image']);
     }
     //delete more images
     $mo_images_query = xtc_db_query("SELECT image_name FROM " . TABLE_PRODUCTS_IMAGES . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     while ($mo_images_values = xtc_db_fetch_array($mo_images_query)) {
         $duplicate_more_image_query = xtc_db_query("SELECT count(*) AS total FROM " . TABLE_PRODUCTS_IMAGES . " WHERE image_name = '" . $mo_images_values['image_name'] . "'");
         $duplicate_more_image = xtc_db_fetch_array($duplicate_more_image_query);
         if ($duplicate_more_image['total'] < 2) {
             xtc_del_image_file($mo_images_values['image_name']);
         }
     }
     xtc_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     xtc_db_query("DELETE FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_IMAGES . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_DESCRIPTION . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . xtc_db_input($product_id) . "'");
     xtc_db_query("DELETE FROM " . TABLE_CUSTOMERS_BASKET . " WHERE products_id = '" . xtc_db_input($product_id) . "' OR products_id LIKE '" . xtc_db_input($product_id) . "{%'");
     //GTB - 2010-09-15 - delete also Products with attribs
     xtc_db_query("DELETE FROM " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " WHERE products_id = '" . xtc_db_input($product_id) . "' OR products_id LIKE '" . xtc_db_input($product_id) . "{%'");
     //GTB - 2010-09-15 - delete also Products with attribs
     $customers_statuses_array = xtc_get_customers_statuses();
     for ($i = 0, $n = sizeof($customers_statuses_array); $i < $n; $i++) {
         if (isset($customers_statuses_array[$i]['id'])) {
             xtc_db_query("delete from personal_offers_by_customers_status_" . $customers_statuses_array[$i]['id'] . " where products_id = '" . xtc_db_input($product_id) . "'");
         }
     }
     $product_reviews_query = xtc_db_query("select reviews_id from " . TABLE_REVIEWS . " where products_id = '" . xtc_db_input($product_id) . "'");
     while ($product_reviews = xtc_db_fetch_array($product_reviews_query)) {
         xtc_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . $product_reviews['reviews_id'] . "'");
     }
     xtc_db_query("delete from " . TABLE_REVIEWS . " where products_id = '" . xtc_db_input($product_id) . "'");
     if (USE_CACHE == 'true') {
         xtc_reset_cache_block('categories');
         xtc_reset_cache_block('also_purchased');
     }
 }
            if (USE_CACHE == 'true') {
                xtc_reset_cache_block('wholesalers');
            }
            xtc_redirect(xtc_href_link(FILENAME_WHOLESALERS, 'page=' . $_GET['page'] . '&wID=' . $wholesaler_id));
        } else {
            $_SESSION['repopulate_form'] = $_REQUEST;
            $_SESSION['errors'] = $error;
            xtc_redirect(xtc_href_link(FILENAME_WHOLESALERS, 'page=' . $_GET['page'] . '&action=' . $url_action . '&errors=1&wID=' . $wholesaler_id));
        }
        break;
    case 'deleteconfirm':
        $wholesaler_id = xtc_db_prepare_input($_GET['wID']);
        xtc_db_query("delete from " . TABLE_WHOLESALERS . " where wholesaler_id = '" . xtc_db_input($wholesaler_id) . "'");
        xtc_db_query("update " . TABLE_PRODUCTS . " set wholesaler_id = '' where wholesaler_id = '" . xtc_db_input($wholesaler_id) . "'");
        if (USE_CACHE == 'true') {
            xtc_reset_cache_block('wholesalers');
        }
        xtc_redirect(xtc_href_link(FILENAME_WHOLESALERS, 'page=' . $_GET['page']));
        break;
}
require DIR_WS_INCLUDES . 'head.php';
?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php 
require DIR_WS_INCLUDES . 'header.php';
?>
<!-- header_eof //-->

<!-- body //-->