/***
$iD crossell.php$
Copyright (C) 2001 - 2004 IN-Solution, Tristan Bremer
http://www.in-solution.de
Updated by John Wood -->
http://www.z-is.net
All rights reserved.
This program is free software licensed under the GNU General Public
License (GPL).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
***********************************************************************************
based on:
(c) 2000 - 2001 The Exchange Project
(c) 2001 - 2003 osCommerce, Open Source E-Commerce Solutions
Released under the GNU General Public License
***********************************************************************************
***/
require('includes/application_top.php');
require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();
$languages = tep_get_languages();
$in_products_id = tep_db_prepare_input($HTTP_GET_VARS['in_products_id']);
switch ($HTTP_GET_VARS['action']) {
case 'new':
$xsell_query = tep_db_query("INSERT INTO ". TABLE_PRODUCTS_XSELL . " (products_id, xsell_id) VALUES (" . $HTTP_GET_VARS['in_products_id'] . ", " . $HTTP_GET_VARS['iID'] . ")");
break;
case 'delete':
$xsell_query = tep_db_query("DELETE FROM ". TABLE_PRODUCTS_XSELL . " WHERE xsell_id='" . $HTTP_GET_VARS['iID'] . "'");
break;
}
if (isset($in_products_id) && tep_not_null($in_products_id)) {
$product_query = tep_db_query("SELECT products_name FROM " . TABLE_PRODUCTS_DESCRIPTION . " WHERE products_id='" . $in_products_id . "'");
$product = tep_db_fetch_array($product_query);
$xsell_query = tep_db_query("SELECT pd.products_name,px.xsell_id,p.products_price, p.products_tax_class_id FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd
LEFT JOIN " . TABLE_PRODUCTS . " p ON p.products_id=pd.products_id
LEFT JOIN " . TABLE_PRODUCTS_XSELL . " px ON px.xsell_id=pd.products_id
WHERE px.products_id='" . $in_products_id . "' AND pd.language_id = '" . $languages_id . "'
");
}
?>
>