<?php
/***************************************************************************
 *			upd_setting.php                                    *
 *                     	          				           *
 *   File Info:		  Updating Setting                                 *
 *   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();
}
$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);
if ($rs == '0')
{	
echo "<br><br><center><img src=images/line.gif border=0 height=1 width=600></center><p align=\"center\"><img src=images/keybord1.gif border=0><font face = Verdana size = 2>  Unable to edit your settings - require settings table to be created !<br>Please create the settings table using the 'Create command' in Administration Panel </strong></font>
<br><br><img src=images/line.gif border=0 height=1 width=600><br><br><br><br></p>";
	include("./your-footer.inc");
	exit();
}
else 
{

	while($row = mysql_fetch_array($rs))
	{
	$mincost = $row["mincost"];
	$shipcost = $row["shipcost"];
	$company = $row["company"];
	$cline1  = $row["cline1"];
	$cline2     =  $row["cline2"];
	$cline3       =  $row["cline3"];
	$cline4  = $row["cline4"];
	$sitecompany     =  $row["sitecompany"];
	$siteaddress       =  $row["siteaddress"];
	$sitetown  = $row["sitetown"];
	$sitecounty     =  $row["sitecounty"];
	$sitepostcode       =  $row["sitepostcode"];
	$sitecountry  = $row["sitecountry"];
	$sitetel     =  $row["sitetel"];
	$siteemail       =  $row["siteemail"];
	$footer       =  $row["footer"];
	$color = $row["color"];
	$highlight = $row["highlight"];
	$backcolor = $row["backcolor"];
	$backcolor1 = $row["backcolor1"];
	$scurrency = $row["scurrency"];
	$usecat = $row["usecat"];
	$wcurrency = $row["wcurrency"];
	$conv1 = $row["conv1"];
	$conv2 = $row["conv2"];
	$conv3 = $row["conv3"];
	$conv4 = $row["conv4"];
	$conv5 = $row["conv5"];
	$zone1 = $row["zone1"];
	$zone2 = $row["zone2"];
	$zone3 = $row["zone3"];
	$shiprates = $row["shiprates"];
	}
	echo "<center><img src=images/keybord1.gif border=0><font face = Verdana size = 2 color = navy> Please update fields you wish to update for your user details</font><br><br>
	 <table width=100% cellpadding=2 cellspacing=0 border=0 bgcolor=#cfe7fa  align = center>
	 <form action = upd_settings.php method = post><tr>
	 <td valign=top><strong>Minimum Cost:</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"mincost\" value = $mincost size=5 maxlength=10>
	</td></tr><tr><tr>
	<td valign=top><strong>Shipping</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"shipcost\" value = $shipcost size=5 maxlength=10> 
	</td></tr><tr><tr>
	 <td valign=top><strong>Company</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"company\" value = '$company' size=65 maxlength=100>
	</td></tr><tr><tr>
	 <td valign=top><strong>Address 1</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"cline1\" value = '$cline1' size=65 maxlength=100>
	</td></tr>
	<tr><tr>
	<td valign=top><strong>Address 2</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"cline2\" value = '$cline2' size=65 maxlength=100>
	</td></tr><tr>
	 <td valign=top><strong>City</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"cline3\" value = '$cline3' size=50 maxlength=50>
	</td></tr><tr>
	<td valign=top><strong>Post Code</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"cline4\" value = '$cline4' size=20 maxlength=20>
	</td></tr><tr>
	<td valign=top><strong>Site Company</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"sitecompany\" value = '$sitecompany' size=50 maxlength=50>
	</td></tr><tr>
	<td valign=top><strong>Site Address</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"siteaddress\" value = '$siteaddress' size=65 maxlength=150>
	</td></tr><tr>
	 <td valign=top><strong>Site Town</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"sitetown\" value = '$sitetown' size=50 maxlength=50>
	</td></tr><tr>
	 <td valign=top><strong>Site County</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"sitecounty\" value = '$sitecounty' size=50 maxlength=50>
	</td></tr><tr>
	 <td valign=top><strong>Site Post Code</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"sitepostcode\" value = '$sitepostcode' size=20 maxlength=25>
	</td></tr><tr>
	 <td valign=top><strong>Site Country</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"sitecountry\" value = '$sitecountry' size=50 maxlength=50>
	</td></tr><tr>
	<td valign=top><strong>Site Telephone</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"sitetel\" value = '$sitetel' size=20 maxlength=20>
	</td></tr><tr>
	 <td valign=top><strong>Site Email</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"siteemail\" value = '$siteemail' size=30 maxlength=75>
	</td></tr><tr>
	<td valign=top><strong>Footer</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"footer\" value = '$footer' size=65 maxlength=150>
	</td></tr>
	 <td valign=top><strong>Color 1 [text]</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"color\" value = '$color' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Color 2 [highlight]</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"highlight\" value = '$highlight' size=7 maxlength=7>
	</td></tr>
	
	 <td valign=top><strong>Color 3 [table]</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"backcolor\" value = '$backcolor' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Color 4 [table]</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"backcolor1\" value = '$backcolor1' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Site Currency:</strong></td>
	<td valign=top>
	 <select name = scurrency><option value=\"usd\" ";if($scurrency=="usd"){echo "selected";}echo" >$ (US Dollar)</option><option value=\"cad\" ";if($scurrency=="cad"){echo "selected";}echo" >$ (CAN Dollar)</option><option value=\"aud\" ";if($scurrency=="aud"){echo "selected";}echo" >$ (AUS Dollar)</option><option value=\"jpy\" ";if($scurrency=="jpy"){echo "selected";}echo" >&yen; (Yen)</option><option value=\"gbp\" ";if($scurrency=="gbp"){echo "selected";}echo" >&pound; (Pound)</option><option value=\"eur\" ";if($scurrency=="eur"){echo "selected";}echo" >&euro; (Euro)</option></select>
	</td></tr>
	<td valign=top><strong>User Category:</strong></td>
	<td valign = top><select name = usecat><option value=\"YES\" ";if ($usecat == "YES"){echo "selected";} echo ">YES</option><option value=\"NO\" ";if($usecat == "NO"){echo "selected";} echo ">NO</option></select>
	</td></tr>
	 
	<td valign=top><strong>World Currency:</strong></td>
	<td valign = top><select name = wcurrency><option value=\"NO\" ";if ($wcurrency == "NO"){echo "selected";} echo ">-- NO --</option>
	<option value=\"ARS\" ";if($wcurrency == "ARS"){echo "selected";} echo ">-- Argentina Peso --</option>
	<option value=\"BRL\" ";if($wcurrency == "BRL"){echo "selected";} echo ">-- Brazil Real --</option>
	<option value=\"BND\" ";if($wcurrency == "BND"){echo "selected";} echo ">-- Brunei Dollar --</option>
	<option value=\"CNY\" ";if($wcurrency == "CNY"){echo "selected";} echo ">-- China Yuan Renminbi --</option>
	<option value=\"EGY\" ";if($wcurrency == "EGY"){echo "selected";} echo ">-- Egypt Pound --</option>
	<option value=\"HKD\" ";if($wcurrency == "HKD"){echo "selected";} echo ">-- Hong Kong Dollar --</option>
	<option value=\"INR\" ";if($wcurrency == "INR"){echo "selected";} echo ">-- India Rupee --</option>
	<option value=\"IDR\" ";if($wcurrency == "IDR"){echo "selected";} echo ">-- Indonesia Rupiah --</option>
	<option value=\"KWD\" ";if($wcurrency == "KWD"){echo "selected";} echo ">-- Kuwait Dinar --</option>
	<option value=\"MYR\" ";if($wcurrency == "MYR"){echo "selected";} echo ">-- Malaysia Ringgit --</option>
	<option value=\"NZD\" ";if($wcurrency == "NZD"){echo "selected";} echo ">-- New Zealand Dollar  --</option>
	<option value=\"NOR\" ";if($wcurrency == "NOR"){echo "selected";} echo ">-- Norway Krone  --</option>
	<option value=\"PKR\" ";if($wcurrency == "PKR"){echo "selected";} echo ">-- Pakistan Rupee  --</option>
	<option value=\"PHP\" ";if($wcurrency == "PHP"){echo "selected";} echo ">-- Philippines Peso  --</option>
	<option value=\"PLN\" ";if($wcurrency == "PLN"){echo "selected";} echo ">-- Poland Zloty  --</option>
	<option value=\"ROL\" ";if($wcurrency == "ROL"){echo "selected";} echo ">-- Romania Leu  --</option>
	<option value=\"RUR\" ";if($wcurrency == "RUR"){echo "selected";} echo ">-- Russia Ruble   --</option>
	<option value=\"SAR\" ";if($wcurrency == "SAR"){echo "selected";} echo ">-- Saudi Arabia Riyal   --</option>
	<option value=\"ZAR\" ";if($wcurrency == "ZAR"){echo "selected";} echo ">-- South Africa Rand   --</option>
	<option value=\"SGD\" ";if($wcurrency == "SGD"){echo "selected";} echo ">-- Singapore Dollar   --</option>
	<option value=\"KRW\" ";if($wcurrency == "KRW"){echo "selected";} echo ">-- South Korea Won   --</option>
	<option value=\"SEK\" ";if($wcurrency == "SEK"){echo "selected";} echo ">-- Sweden Krona   --</option>
	<option value=\"CHF\" ";if($wcurrency == "CHF"){echo "selected";} echo ">-- Switzerland Franc   --</option>
	<option value=\"TWD\" ";if($wcurrency == "TWD"){echo "selected";} echo ">-- Taiwan New Dollar   --</option>
	<option value=\"THB\" ";if($wcurrency == "THB"){echo "selected";} echo ">-- Thailand Baht   --</option>
	<option value=\"VND\" ";if($wcurrency == "VND"){echo "selected";} echo ">-- Vietnam Dong    --</option>
<option value=\"USD\" ";if($wcurrency == "USD"){echo "selected";} echo ">-- US Dollars   --</option>
</select>
	</td></tr>
	<td valign=top><strong>UK &pound Conversion</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"conv1\" value = '$conv1' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>USA $ Conversion</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"conv2\" value = '$conv2' size=7 maxlength=7>
	</td></tr>
	
	 <td valign=top><strong>Euro Conversion</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"conv3\" value = '$conv3' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Japan Conversion</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"conv4\" value = '$conv4' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Canada Conversion</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"conv5\" value = '$conv5' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Zone 1 Shipping</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"zone1\" value = '$zone1' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Zone 2 Shipping</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"zone2\" value = '$zone2' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Zone 3 Shipping</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"zone3\" value = '$zone3' size=7 maxlength=7>
	</td></tr>
	 <td valign=top><strong>Fixed Shipping Rate</strong></td>
	<td valign=top>
	<INPUT type=\"text\" name=\"shiprates\" value = '$shiprates' size=7 maxlength=7>
	</td></tr>
	<td>
	<input type=\"submit\" value=\"Update Details\"></td>
	 </form></table>";
	
	echo($form);
	echo("<br><center><p align=justify><img src=images/readme.gif border=0><font face=verdana size=2>You can update the settings for the site here...If you leave wish to leave a field unchanged, do not enter any text. Do not use character ' in your updated fields. To update colors, make sure they have no # and is 6 characters long.You must use hexadecimal to create your color settings. If you are using world currency, please input the exchange currency for 1 unit of world currency to 1 unit of either USA Dollar, UK Sterling, Euros, Japanese Yen, Canadian Dollars. N.B Use regular currency exchange rates for up-to-date exchange of currencies. Also Color 1,2,3 and 4 is not used in this version of EZ Shopper. If you using older version then you can use Color 1,2,3 and 4.<br></font></center><br>");
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Minimum cost:-</b> This is the minimum amount of an order before free shipping applies.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Shipping:-</b> This is the shipping cost for an order. Be in local currency of the store.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Site Currency:-</b> This is the base currency for your e-commerce store.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>User Category:-</b> YES for user-defined product categories - NO for default product categories.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>World Currency:-</b> NO will use base currency. Other choices will use that world currency.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>UK Conversion-</b> This is the exchange rate from world currency to 1 sterling.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>USA Conversion-</b> This is the exchange rate from world currency to 1 USA dollar .</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Euro Conversion-</b> This is the exchange rate from world currency to 1 Euro.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Japan Conversion-</b> This is the exchange rate from world currency to 1 Japanese yen.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Canada Conversion-</b> This is the exchange rate from world currency to 1 Canada dollar.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Zone 1 shipping-</b> This is shipping cost for shipping to countries in zone 1.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Zone 2 shipping-</b> This is shipping cost for shipping to countries in zone 2.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Zone 3 shipping-</b> This is shipping cost for shipping to countries in zone 3.</font><br>";
echo "<img src=images/bullets.gif border=0><font face=verdana size=2><b>Fixed shipping rate-</b> This is fixed shipping cost for any order.</font><br>";
}
?>
<html>
<head>
<title>
Update EZ Shopper Settings
</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>

<?php  

include ("./your-footer.inc");
?>
</body>
</html>
