<html>
<head>
<title>
128 Concepts EZ Shopper
</title>
</head>
<body>
<?php
/***************************************************************************
 *			create_table6.php	                           *
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~	                   *
 *   File Info:		  Create setting table                             *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include("./config.php");
include("./header.inc");
?>
<center>
<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><hr>

<?php

// User defined fields --- u can amend //

$fields="32";
$name[0] = "setid";
$name[1] = "mincost";
$name[2] = "shipcost";
$name[3] = "company";
$name[4] = "cline1";
$name[5] = "cline2";
$name[6] = "cline3";
$name[7] = "cline4";
$name[8] = "sitecompany";
$name[9] = "siteaddress";
$name[10] = "sitetown";
$name[11] = "sitecounty";
$name[12] = "sitepostcode";
$name[13] = "sitecountry";
$name[14] = "sitetel";
$name[15] = "siteemail";
$name[16] = "footer";
$name[17] = "color";
$name[18] = "highlight";
$name[19] = "backcolor";
$name[20] = "backcolor1";
$name[21] = "online";
$name[22] = "scurrency";
$name[23] = "usecat";
$name[24] = "wcurrency";
$name[25] = "conv1";
$name[26] = "conv2";
$name[27] = "conv3";
$name[28] = "conv4";
$name[29] = "conv5";
$name[30] = "zone1";
$name[31] = "zone2";
$name[32] = "zone3";
$name[33] = "hits";
$name[34] = "shiprates";
$type[0] = "char";
$type[1] = "double";
$type[2] = "double";
$type[3] = "char";
$type[4] = "char";
$type[5] = "char";
$type[6] = "char";
$type[7] = "char";
$type[8] = "char";
$type[9] = "char";
$type[10] = "char";
$type[11] = "char";
$type[12] = "char";
$type[13] = "char";
$type[14] = "char";
$type[15] = "char";
$type[16]= "char";
$type[17] = "char";
$type[18] = "char";
$type[19] = "char";
$type[20] = "char";
$type[21] = "int";
$type[22] = "char";
$type[23] = "char";
$type[24] = "char";
$type[25] = "double";
$type[26] = "double";
$type[27] = "double";
$type[28] = "double";
$type[29] = "double";
$type[30] = "double";
$type[31] = "double";
$type[32] = "double";
$type[33] = "int";
$type[34] = "double";
$size[0] = "6";
$size[1] = "";
$size[2] = "";
$size[3] = "100";
$size[4] = "100";
$size[5] = "100";
$size[6] = "100";
$size[7] = "20";
$size[8] = "50";
$size[9] = "150";
$size[10] = "50";
$size[11] = "50";
$size[12] = "25";
$size[13] = "50";
$size[14] = "20";
$size[15] = "75";
$size[16] = "150";
$size[17] = "7";
$size[18] = "7";
$size[19] = "7";
$size[20] = "7";
$size[21] = "";
$size[22] = "3";
$size[23] = "3";
$size[24] = "50";
$size[25] = "";
$size[26] = "";
$size[27] = "";
$size[28] = "";
$size[29] = "";
$size[30] = "";
$size[31] = "";
$size[32] = "";
$size[33] = "";
$size[34] = "";

// -------------------------------------------- //
$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 = "create table $table (";
for ($i=0;$i<count($name);$i++)
{
	$sql.="$name[$i] $type[$i]";
             if (($type[$i] == "char") or ($type[$i] == "varchar"))
             {
		if ($size[$i] !="") { $sql.="($size[$i])"; }
            }
	if (($i+1) != count($name) )	{ $sql.= ",";}
} $sql.= ")";
echo("SQL COMMAND: $sql <hr>");
$result=mysql_query($sql,$conn)
	or die("Unable to excute the SQL query!!! Possibly SQL command already executed");
if($result)
{
	echo("RESULT: table \"$table\" has been created..."); 
	$sqls = "INSERT INTO $table (setid,mincost,shipcost,company,cline1,cline2,cline3,cline4,sitecompany,siteaddress,sitetown,sitecounty,sitepostcode,sitecountry,sitetel,siteemail,footer,color,highlight,backcolor,backcolor1,online,scurrency,usecat,wcurrency,conv1,conv2,conv3,conv4,conv5,zone1,zone2,zone3,hits) values('admin','50','2.95','128 Concepts','PO BOX 11236','Kings Norton','Birmingham','B30 1YA','Your company','Your address1, Your address2, Your address 3','Your town','Your county','Your Zip or Post Code','Your Country','Tel:Your Telephone','email:yourname@yourdomain.com','------ Developed by 128 Concepts Copyright 2002-2003 ?------','#00CC00','#DD0000','#FFFFFF','#00CCFF',0,'gbp','NO','NO',0,0,0,0,0,0,0,0,0)";
echo("<br><br>SQL COMMAND: $sqls");
$results=mysql_query($sqls,$conn)
	or die("Unable to excute the SQL query!!! Possibly SQL command already executed");
if ($results)
{
	echo("<br><br>RESULT: Site Settings has been created..."); 
	echo "<br><br><br>";
}
}
include("./your-footer.inc");
?>
</body>
</html>