<?php
/***************************************************************************
 *			upd_settings.php                                   *
 *                     	          				           *
 *   File Info:		  Updating Settings                                *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include ("config.php");
include ("./your-header.inc");
include ("./tests.php");


if ($_SESSION['admin'] == NULL)
{
echo "<br><br><center><img src=images/line.gif border=0 height=1 width=400></center><p align=\"center\"><img src=images/keybord1.gif border=0><b><strong><font face = Verdana size = 3>   Sorry you are not the administrator!</strong></font></b><br>Click here to return to log in screen  <a href='shop_showall.php'>here.</a>
<br><br><img src=images/line.gif border=0 height=1 width=400><br><br><br><br></p>";
	include("./your-footer.inc");  
	exit();
}
 if ((session_is_registered("admin")) and ($_SESSION['admin'] != "admin"))
{
 echo "<br><br><center><img src=images/line.gif border=0 height=1 width=400></center><p align=\"center\"><img src=images/keybord1.gif border=0><b><strong><font face = Verdana size = 3>   Sorry you are not the administrator!</strong></font></b><br>Click here to return to log in screen  <a href='reglog.php'>here.</a>
<br><br><img src=images/line.gif border=0 height=1 width=400><br><br><br><br></p>";
	include("./your-footer.inc");  
	exit();
}
 if ($_SERVER['REQUEST_METHOD'] == "POST") 
  {
        # escape data and set variables
        $mincost = addslashes($_POST["mincost"]);
        $shipcost = addslashes($_POST["shipcost"]);
        $company = addslashes($_POST["company"]);
        $cline1=addslashes($_POST["cline1"]);
        $cline2=addslashes($_POST["cline2"]);
        $cline3=addslashes($_POST["cline3"]);
        $cline4=addslashes($_POST["cline4"]);
        $sitecompany=addslashes($_POST["sitecompany"]);
        $siteaddress=addslashes($_POST["siteaddress"]);
        $sitetown=addslashes($_POST["sitetown"]);
        $sitecounty=addslashes($_POST["sitecounty"]);
        $sitepostcode=addslashes($_POST["sitepostcode"]);
        $sitecountry=addslashes($_POST["sitecountry"]);
        $sitetel=addslashes($_POST["sitetel"]);
        $siteemail=addslashes($_POST["siteemail"]);
        $footer=addslashes($_POST["footer"]);
        $color = addslashes($_POST["color"]);
        $highlight = addslashes($_POST["highlight"]);
        $backcolor = addslashes($_POST["backcolor"]);
        $backcolor1 = addslashes($_POST["backcolor1"]);
        $scurrency = addslashes($_POST["scurrency"]);
        $usecat = addslashes($_POST["usecat"]);
        $wcurrency = addslashes($_POST["wcurrency"]);
       $conv1 = addslashes($_POST["conv1"]);
       $conv2 = addslashes($_POST["conv2"]);  
       $conv3 = addslashes($_POST["conv3"]);
       $conv4 = addslashes($_POST["conv4"]);
       $conv5 = addslashes($_POST["conv5"]);
       $zone1 = addslashes($_POST["zone1"]);
       $zone2 = addslashes($_POST["zone2"]);
       $zone3 = addslashes($_POST["zone3"]);
       $shiprates = addslashes($_POST["shiprates"]);
}
# convert all color inputs to UPPER CASE
if ($color != NULL)
	$color = strtoupper($color);
if ($highlight != NULL)
	$highlight = strtoupper($highlight);
if ($backcolor != NULL)
	$backcolor = strtoupper($backcolor);
if ($backcolor1 != NULL)
	$backcolor1 = strtoupper($backcolor1);

# validate colors
$badderr = isBadColor($color);
if ($badderr)
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details, <br>Color 1 field must contain characters 0-9 and A-F</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$badderr = isBadColor($color);
if ($badderr)
{
	echo("<br><br><center>Opps...unable to continue updating your settings details, Color 1 field must contain characters 0-9 and A-F</center><br><br>");
	include("./your-footer.inc");
	exit();
}$badderr1 = isBadColor($highlight);
if ($badderr1)
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details, <br>Color 2 field must contain characters 0-9 and A-F</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}$badderr2 = isBadColor($backcolor);
if ($badderr2)
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details, <br>Color 3 field must contain characters 0-9 and A-F</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$badderr3 = isBadColor($backcolor1);
if ($badderr3)
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details, <br>Color 4 field must contain characters 0-9 and A-F</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr4 = isBadNumber($mincost);
if ($baderr4)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Min. Cost field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr5 = isBadNumber($shipcost);
if ($baderr5)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Shipping Cost field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr6 = isBadNumber($conv1);
if ($baderr6)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> UK Conversion field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($conv1 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> UK Conversion must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr7 = isBadNumber($conv2);
if ($baderr7)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> USA Conversion field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($conv2 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> USA Conversion must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr8 = isBadNumber($conv3);
if ($baderr8)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Euro Conversion field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($conv3 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Euro Conversion must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr9 = isBadNumber($conv4);
if ($baderr9)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Japan Conversion field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($conv4 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Japan Conversion must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr10 = isBadNumber($conv5);
if ($baderr10)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Canada Conversion field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($conv5 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Canada Conversion must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr11 = isBadNumber($zone1);
if ($baderr11)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Zone 1 shipping field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($zone1 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Zone 1 shipping must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr12 = isBadNumber($zone2);
if ($baderr12)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Zone 2 shipping field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($zone2 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Zone 2 shipping must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr13 = isBadNumber($zone3);
if ($baderr13)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Zone 3 shipping field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($zone3 < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Zone 3 shipping must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$baderr14 = isBadNumber($shiprates);
if ($baderr14)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Fixed shipping rate field must contain characters 0-9 and '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($shiprates < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Fixed shipping rate must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($mincost < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Min. Cost must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($shipcost < 0)
{
echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details,<br> Shipping Cost must be greater or equal to 0 '.'</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($mincost != NULL and $shipcost != NULL and $company != NULL and $cline1 != NULL and $cline2 != NULL and $cline3 != NULL and $cline4 != NULL and $sitecompany != NULL and $siteaddress != NULL and $sitetown != NULL and $sitecounty != NULL and $sitepostcode != NULL and $sitecountry != NULL and $sitetel != NULL and $siteemail != NULL and $footer != NULL and $color !=NULL and $highlight != NULL and $backcolor != NULL and $backcolor1 != NULL)
{

}
else
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...unable to continue updating your settings details, all data fields must have data!!!</font><img src=images/line.gif border=0 width=100% height=1><br></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($scurrency == "aud")
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Opps...this currency is not supported in this shopping cart!!!<br>We apologise if you wish to use this currency as your main shopping cart currency.<br>Please select another alternative shopping cart currency from the list.</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
$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 'mydata'...Please press 'Create Database' to create new database.");
$sql = "select * from $table";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
$num = mysql_numrows($rs);
if ($num == 0)
{
	echo("<br><br><center><img src=images/line.gif border=0 width=100% height=1><br><font face=verdana size=2>Unable to find settings information<br>You may need to create settings table!!!</font><br><img src=images/line.gif border=0 width=100% height=1></center><br><br>");
	include("./your-footer.inc");
	exit();
}
if ($num > 0)
{
	echo "<center><img src=images/computer1.gif border=0><font face=verdana size=2 color=darkred>  Updating your SETTINGS</center></font><br><img src=images/line.gif border=0 width=100% height=1>";
	echo "<font face=verdana size=2>Minimum Cost : $mincost</font><br>";
	echo "<font face=verdana size=2>Shipping : $shipcost</font><br>";
	echo "<font face=verdana size=2>Company : $company</font><br>";
	echo "<font face=verdana size=2>Address 1  : $cline1</font><br>";
	echo "<font face=verdana size=2>Address 2  : $cline2</font><br>";
	echo "<font face=verdana size=2>Town/City  : $cline3</font><br>";
	echo "<font face=verdana size=2>Post Code : $cline4</font><br>";
	echo "<font face=verdana size=2>Site Company  : $sitecompany</font><br>";
	echo "<font face=verdana size=2>Site Address  : $siteaddress</font><br>";
	echo "<font face=verdana size=2>Site Town/City  : $sitetown</font><br>";
	echo "<font face=verdana size=2>Site County : $sitecounty</font><br>";
	echo "<font face=verdana size=2>Site Postcode  : $sitepostcode</font><br>";
	echo "<font face=verdana size=2>Site Country  : $sitecountry</font><br>";
	echo "<font face=verdana size=2>Site Telephone  : $sitetel</font><br>";
	echo "<font face=verdana size=2>Site Email : $siteemail</font><br>";
	echo "<font face=verdana size=2>Footer  : $footer</font><br>";
	echo "<font face=verdana size=2>Color 1 : $color</font><br>";
	echo "<font face=verdana size=2>Color 2 : $highlight</font><br>";
	echo "<font face=verdana size=2>Color 3 : $backcolor</font><br>";
	echo "<font face=verdana size=2>Color 4 : $backcolor1</font><br>";
	echo "<font face=verdana size=2>User Category: $usecat</font><br>";
	echo "<font face=verdana size=2>Site Currency: $scurrency</font><br>";
	echo "<font face=verdana size=2>World Currency: $wcurrency</font><br>";
	echo "<font face=verdana size=2>UK Conversion: $conv1</font><br>";
	echo "<font face=verdana size=2>USA Conversion: $conv2</font><br>";
	echo "<font face=verdana size=2>EURO Conversion: $conv3</font><br>";
	echo "<font face=verdana size=2>Japan Conversion: $conv4</font><br>";
	echo "<font face=verdana size=2>Canada Conversion: $conv5</font><br>";
	echo "<font face=verdana size=2>Zone 1 Shipping: $zone1</font><br>";
	echo "<font face=verdana size=2>Zone 2 Shipping: $zone2</font><br>";
	echo "<font face=verdana size=2>Zone 3 Shipping: $zone3</font><br>";
	echo "<font face=verdana size=2>Fixed shipping rate: $shiprates</font><br><img src=images/line.gif border=0 width=100% height=1><br>";
	
echo("<br><img src=images/line.gif border=0 width=100% height=1><font face=verdana size=2>Updating Minium Cost</font><br>");
$sql="UPDATE $table set mincost=";
$sql.="'$mincost'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Shipping</font><br>");
$sql="UPDATE $table set shipcost=";
$sql.="'$shipcost'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Company</font><br>");
$sql="UPDATE $table set company=";
$sql.="'$company'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Address 1</font><br>");
$sql="UPDATE $table set cline1=";
$sql.="'$cline1'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Address 2</font><br>");
$sql="UPDATE $table set cline2=";
$sql.="'$cline2'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Town/City</font><br>");
$sql="UPDATE $table set cline3=";
$sql.="'$cline3'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Post Code</font><br>");
$sql="UPDATE $table set cline4=";
$sql.="'$cline4'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Company</font><br>");
$sql="UPDATE $table set sitecompany=";
$sql.="'$sitecompany'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Address</font><br>");
$sql="UPDATE $table set siteaddress=";
$sql.="'$siteaddress'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Town/City</font><br>");
$sql="UPDATE $table set sitetown=";
$sql.="'$sitetown'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site County</font><br>");
$sql="UPDATE $table set sitecounty=";
$sql.="'$sitecounty'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site PostCode</font><br>");
$sql="UPDATE $table set sitepostcode=";
$sql.="'$sitepostcode'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Country</font><br>");
$sql="UPDATE $table set sitecountry=";
$sql.="'$sitecountry'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Telephone</font><br>");
$sql="UPDATE $table set sitetel=";
$sql.="'$sitetel'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Email</font><br>");
$sql="UPDATE $table set siteemail=";
$sql.="'$siteemail'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Footer</font><br>");
$sql="UPDATE $table set footer=";
$sql.="'$footer'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Color 1</font><br>");
$sql="UPDATE $table set color=";
$sql.="'$color'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Color 2</font><br>");
$sql="UPDATE $table set highlight=";
$sql.="'$highlight'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Color 3</font><br>");
$sql="UPDATE $table set backcolor=";
$sql.="'$backcolor'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Color 4</font><br>");
$sql="UPDATE $table set backcolor1=";
$sql.="'$backcolor1'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Site Currency</font><br>");
$sql="UPDATE $table set scurrency=";
$sql.="'$scurrency'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating User Category</font><br>");
$sql="UPDATE $table set usecat=";
$sql.="'$usecat'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating World Currency</font><br>");
$sql="UPDATE $table set wcurrency=";
$sql.="'$wcurrency'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating UK Conversion</font><br>");
$sql="UPDATE $table set conv1=";
$sql.="'$conv1'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating USA Conversion</font><br>");
$sql="UPDATE $table set conv2=";
$sql.="'$conv2'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Euro Conversion</font><br>");
$sql="UPDATE $table set conv3=";
$sql.="'$conv3'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Japan Conversion</font><br>");
$sql="UPDATE $table set conv4=";
$sql.="'$conv4'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Canada Conversion</font><br>");
$sql="UPDATE $table set conv5=";
$sql.="'$conv5'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Zone 1 Shipping</font><br>");
$sql="UPDATE $table set zone1=";
$sql.="'$zone1'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Zone 2 Shipping</font><br>");
$sql="UPDATE $table set zone2=";
$sql.="'$zone2'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Zone 3 Shipping</font><br>");
$sql="UPDATE $table set zone3=";
$sql.="'$zone3'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<font face=verdana size=2>Updating Fixed Shipping Rate</font><br>");
$sql="UPDATE $table set shiprates=";
$sql.="'$shiprates'";
$sql_result = mysql_query($sql,$conn)
	or die("Couldn't update record.");
echo("<br><center><img src=images/bullets.gif border=0><font face = Verdana size = 2> Your settings have been updated successfully!!!</font></center><br>");
}

function isBadColor($str)
 {
   $x = 0;
  if (strlen($str) !=6) {
    return true;
 }
 	if(strlen($str) ==6){
      $valid_chars = "0123456789ABCDEF";      
	for($i=0;$i<strlen($str);$i++){
        if(strchr($valid_chars,substr($str,$i,1))==false) $x++;
      }
      if($x>0) return true;
    }else{
      return true;
    }

 }

function isBadNumber($str)
 {
   $x = 0;

 if(strlen($str) >= 1){
      $valid_chars = "0123456789.-";      
	for($i=0;$i<strlen($str);$i++){
        if(strchr($valid_chars,substr($str,$i,1))==false) $x++;
      }
      if($x>0) return true;
    }else{
      return true;
    }

 }
?>
<html>
<head>
<title>
Update SETTNGS for site
</title>
</head>
<body>
<center><br>
<table width="500" border=1><tr align="justify" class="subtitle"><td>
  <p align="center">
  <img border="0" src="images/database.GIF" width="24" height="24"><font face=Verdana size=1><a href="./create_db.php">Create database</a>&nbsp;
  <img border="0" src="images/database.GIF" width="24" height="24"></font><a href="./delete_db.php"><font face=Verdana size=1>Delete database</font></a><font face="Verdana" size="1">&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"><a href="./create_menu.php">Create table</a>&nbsp;&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24">&nbsp;
  </font> <a href="./add_menu.php"><font face=Verdana size=1>Add Record </font></a>  
  </p>
  <p align="center">&nbsp;<font face="Verdana" size="1"><img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./view_menu.php"><font face=verdana size=1>View Records</font></a>&nbsp;
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./del_menu.php"><font face=verdana size=1>Delete Record</font></a>
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font> <a href="./upd_menu.php"><font face=verdana size=1>Update Record</font></a>&nbsp;
  <img border="0" src="images/home-to.GIF" width="24" height="24"><font face=verdana size=1>&nbsp; <a href="./index.php">Home</a></font>  </a></td></tr></table><br></center>
<br><center><img src=images/back-to.gif border=0><a href=login.php><font face=verdana size=2> Administrator's Panel</a>
<?php  	
include ("./your-footer.inc");
?>
</body>
</html>
