<html>
<head>
<title>EZ Shopper - Upgrade Script for adding shipping options</title>
</head>
<body>
<?php
/***************************************************************************
 *			upgradeship.php                        	           *
 *                     	          				           *
 *   File Info:		  EZ Shopper Upgrade Shipping script               *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/

include_once("./header.inc");
include_once("./config.php");

echo "<center><img src=images/computer1.gif border=0><h3> Upgrade EZ Shopper to accept shipping options</h3></center>";

$table = "setting";
$conn = @mysql_connect($server,$user,$password)
	or die("Unable to connect to SQL database...");
$rs = @mysql_select_db($database,$conn) 
	or die("Unable to select the database...Please press 'Create Database' to create new database.");

$sql = "alter table $table add shiprates double";
$result = @mysql_query($sql,$conn);

if (!$result)
{
	echo"<center>Seems that your sql database has already been updated.....<center>";
	echo "<img src=./images/line.gif border=0>";
	include_once("./footer.inc");
	exit();
}

if ($result)
{
	$sqls = "update $table set shiprates = 0";
	$results = @mysql_query($sqls,$conn);
	if ($results)
	{
		echo "<center><p align=justify>Successfully added shipping rate into sql database. Also set shipping rate = 0...</p></center>";
	}
	else
	{
		echo"<center>No action taken....seems that your sql database has already been updated...</center>";
		echo "<hr width=400>";
		include_once("./footer.inc");
		exit();
	}
}
	
$table = "shipopts";
$sqls = "CREATE TABLE $table (shipitem char(100),shipitemprice double)";
$results = @mysql_query($sqls,$conn);

if (!$results)
{
	echo"<center>Seems that your sql database has already been updated.....<center>";
	echo "<img src=./images/line.gif border=0>";
	include_once("./footer.inc");
	exit();
}

if ($results)
{
	echo "<center><p align=justify>Successfully added shipping options table into sql database.<br>This file is no longer needed and should be deleted from your store directory.</p></center>";
}

echo "<hr width=400>";
include_once("./footer.inc");
?>
</body>
</html>
