<?php
	/*
	** File: SAVE_BASKET
	** Description: save all SKUs in basket to wishlist
	** Version: $Revision: 1.8 $
	** Created: 06/10/1999
	** Author: Leon Atkinson
	** Email: leon@clearink.com
	** CVS Author: $Author: leon $
	** Last Revised: $Date: 1999/12/09 23:23:21 $
	**
	** Log : $Log: SAVE_BASKET,v $
	** Log : Revision 1.8  1999/12/09 23:23:21  leon
	** Log : Changed ActionResults use so that it's an array instead of a
	** Log : continually-growing string.  Note the little function in standard_library
	** Log : for printing out all the action results.
	** Log :
	** Log : Revision 1.7  1999/11/13 01:20:42  leon
	** Log : More localization work.
	** Log :
	** Log : Revision 1.6  1999/11/09 00:28:14  leon
	** Log : Changed use of notes column.  This column now stores an array of variation
	** Log : IDs in serialized form.  Names for attributes and variations are pulled
	** Log : from the database using two new functions in the attribute_functions
	** Log : include module.
	** Log :
	** Log : Revision 1.5  1999/08/18 22:31:51  leon
	** Log : Returning opening PHP tag to XML-friendly tag
	** Log :
	** Log : Revision 1.4  1999/07/28 19:27:15  leon
	** Log : Mass update based on code donation from a live project
	** Log :
	**
	** Copyright (c) 1999 Working Dogs.  All rights reserved.
	*/


	//insert into user_sku
	$Query = "INSERT INTO user_sku ";
	$Query .= "SELECT 0, s.User, ss.SKU, ss.Quantity, ss.Notes ";
	$Query .= "FROM session s, session_sku ss ";
	$Query .= "WHERE s.ID = ss.Session ";
	$Query .= "AND s.ID = '$sid' ";
	$DatabaseResult = mysql_query($Query, $DatabaseLink);
	if(!$DatabaseResult)
	{
		print("<!--\n");
		print("$Query \n");
		print(mysql_errno() . ": " . mysql_error()) . "\n"; 
		print("-->\n");
		$ActionResults[] = L_SAVEBASKET_FAILURE;
	}
	else
	{
		//delete basket
		$Query = "DELETE FROM session_sku WHERE Session='$sid'";
		$DatabaseResult = mysql_query($Query, $DatabaseLink);
	}
	


?>
