<?php 

	/* 
	** File: UPDATE_SHIPPING
	** Description: Update the contents of one record from the "shipping" table.
	** Version: $Revision: 1.4 $
	** Created: 6/29/99
	** Author: Shannon -jj Behrens
	** Email: shannon.behrens@clearink.com
	** CVS Author: $Author: leon $
	** Last Revised: $Date: 1999/12/09 23:23:26 $
	**
	** Log : $Log: UPDATE_SHIPPING,v $
	** Log : Revision 1.4  1999/12/09 23:23:26  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.3  1999/11/02 19:09:47  leon
	** Log : Localized the UPDATE action modules
	** Log :
	** Log : Revision 1.2  1999/08/18 22:31:55  leon
	** Log : Returning opening PHP tag to XML-friendly tag
	** Log :
	** Log : Revision 1.1  1999/07/28 21:16:42  leon
	** Log : New actions based on code donation from a live project
	** Log :
	**
	** Copyright (c) 1999 Working Dogs. All rights reserved. 
	**
	** Expected input: $ID, $Method, $Message
	*/
	
	/* Make sure the user has admin rights. */
	if( !$UserInfo["Permission"]["Administrate"] )
	{
		print(L_UPDATESHIPPING_DENIED . "<BR>\n");
	}
	else
	{
		$updateQuery = "UPDATE shipping SET ";
		$updateQuery .= "Method = " . intval($Method) . ", ";
		$updateQuery .= "Message = '" . addslashes(substr($Message,0,255)) . "' ";
		$updateQuery .= "WHERE ID = " . intval($ID);
		
		if (!mysql_query($updateQuery, $DatabaseLink))
		{	
			print("<!-- " . mysql_errno() . ": " . mysql_error() . 
				"  Query was: $updateQuery -->\n");
				
			$ActionResults[] = L_UPDATESHIPPING_FAILURE;
		}
		else
		{
			$ActionResults[] = L_UPDATESHIPPING_SUCCESS;
		}
	}
	
?>
