<?php
// This code is copyright Internet Business Solutions SL.
// Unauthorized copying, use or transmittal without the
// express permission of Internet Business Solutions SL
// is strictly prohibited.
// Author: Vince Reid, vince@virtualred.net
$sVersion='PHP v7.8.9';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Create Ecommerce Plus mySQL database version <?php print $sVersion?></title>
<style type="text/css">
<!--
p {  font: 11pt  Arial, Helvetica, sans-serif}
BODY {  font: 11pt Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body>
<div style="padding:24px;border: 1px solid #F63;width: 680px; margin: 0 auto;background:#ebf4fb;-moz-border-radius:10px;-webkit-border-radius:10px;margin-top:40px;">
<?php
include 'vsadmin/db_conn_open.php';

$haserrors=FALSE;
$tablenotcreated=[];
$txtcollen=8000;

function escape_string($estr){
	return(@$GLOBALS['ectdatabase']?$GLOBALS['ectdatabase']->real_escape_string($estr):mysql_real_escape_string($estr));
}
function ect_query($ectsql){
	return(@$GLOBALS['ectdatabase']?$GLOBALS['ectdatabase']->query($ectsql):mysql_query($ectsql));
}
function ect_fetch_assoc($ectres){
	return(@$GLOBALS['ectdatabase']?$ectres->fetch_assoc():mysql_fetch_assoc($ectres));
}
function ect_num_rows($ectres){
	return(@$GLOBALS['ectdatabase']?$ectres->num_rows:mysql_num_rows($ectres));
}
function ect_free_result($ectres){
	@$GLOBALS['ectdatabase']?$ectres->free_result():mysql_free_result($ectres);
}
function ect_error(){
	print(@$GLOBALS['ectdatabase']?$GLOBALS['ectdatabase']->error:mysql_error());
}
function print_sql_error($tablename){
	global $haserrors,$tablenotcreated;
	$theerror=(@$GLOBALS['ectdatabase']?$GLOBALS['ectdatabase']->error:mysql_error());
	if($tablename!=''){
		if(strpos($theerror,'already exists')===FALSE)
			$haserrors=TRUE;
		else{
			$theerror='';
			print('Table ' . $tablename . " already exists. Not creating.<br />");
		}
	}else
		$haserrors=TRUE;
	if($theerror!='') print('<font color="#FF0000">' . $tablename . " : " . $theerror . "</font><br />");
	$tablenotcreated[$tablename]=TRUE;
}
function checktablecreated($tablename){
	global $tablenotcreated;
	if(@$tablenotcreated[$tablename]){
		print('Table ' . $tablename . ' already exists. No default data added.<br />');
		return(FALSE);
	}else{
		print('Adding ' . $tablename . ' table default data<br />');
		return(TRUE);
	}
}

if(@$_POST["posted"]=="1"){

// ect_query("DROP TABLE address,admin,adminlogin,affiliates,cart,cartoptions,clientlogin,countries,coupons,cpnassign,customerlogin,dropshipper,installedmods,ipblocking,mailinglist,multibuyblock,multisections,optiongroup,options,orders,orderstatus,payprovider,postalzones,pricebreaks,prodoptions,products,relatedprods,sections,states,tmplogin,uspsmethods,zonecharges") or print_sql_error('');

$databaseengine="myisam";
if(@$_POST['databaseengine']=='innodb') $databaseengine="innodb";

$sSQL="CREATE TABLE abandonedcartemail (aceID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,aceOrderID INT NOT NULL DEFAULT 0,aceDateSent DATE,aceKey VARCHAR(255) NULL, INDEX (aceOrderID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('abandonedcartemail');

$sSQL="CREATE TABLE address (addID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="addCustID INT DEFAULT 0,";
$sSQL.="addIsDefault TINYINT DEFAULT 0,";
$sSQL.="addName VARCHAR(255) NULL,";
$sSQL.="addLastName VARCHAR(255) NULL,";
$sSQL.="addAddress VARCHAR(255) NULL,";
$sSQL.="addAddress2 VARCHAR(255) NULL,";
$sSQL.="addCity VARCHAR(255) NULL,";
$sSQL.="addState VARCHAR(255) NULL,";
$sSQL.="addZip VARCHAR(255) NULL,";
$sSQL.="addCountry VARCHAR(255) NULL,";
$sSQL.="addPhone VARCHAR(255) NULL,";
$sSQL.="addShipFlags TINYINT DEFAULT 0,";
$sSQL.="addExtra1 VARCHAR(255) NULL,";
$sSQL.="addExtra2 VARCHAR(255) NULL,";
$sSQL.="INDEX (addCustID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('address');
	
$sSQL="CREATE TABLE admin (adminID INT NOT NULL PRIMARY KEY,";
$sSQL.="adminVersion VARCHAR(50),";
$sSQL.="adminUser VARCHAR(50) NULL,";
$sSQL.="adminPassword VARCHAR(50) NULL,";
$sSQL.="adminEmail VARCHAR(255) NOT NULL,";
$sSQL.="usemailer VARCHAR(64) NULL,";
$sSQL.="smtpserver VARCHAR(100) NULL,";
$sSQL.="smtpport VARCHAR(64) NULL,";
$sSQL.="smtpsecure VARCHAR(64) NULL,";
$sSQL.="emailfromname VARCHAR(128) NULL,";
$sSQL.="emailUser VARCHAR(50) NULL,";
$sSQL.="emailPass VARCHAR(50) NULL,";
$sSQL.="htmlemails TINYINT(1) DEFAULT 1,";
$sSQL.="adminStoreURL VARCHAR(255) NULL,";
$sSQL.="adminStoreURLSSL VARCHAR(255) NULL,";
$sSQL.="adminProdsPerPage INT DEFAULT 0,";
$sSQL.="adminShipping INT DEFAULT 0,";
$sSQL.="adminIntShipping INT DEFAULT 0,";
$sSQL.="adminCountry INT DEFAULT 0,";
$sSQL.="adminZipCode VARCHAR(50) NULL,";
$sSQL.="shipInsuranceDom TINYINT DEFAULT 0,";
$sSQL.="shipInsuranceInt TINYINT DEFAULT 0,";
$sSQL.="noCarrierDomIns TINYINT(1) DEFAULT 0,";
$sSQL.="noCarrierIntIns TINYINT(1) DEFAULT 0,";
$sSQL.="insuranceDomPercent DOUBLE DEFAULT 0,";
$sSQL.="insuranceIntPercent DOUBLE DEFAULT 0,";
$sSQL.="insuranceDomMin DOUBLE DEFAULT 0,";
$sSQL.="insuranceIntMin DOUBLE DEFAULT 0,";
$sSQL.="adminEmailConfirm TINYINT DEFAULT 0,";
$sSQL.="adminDelUncompleted INT DEFAULT 0,";
$sSQL.="adminUSZones TINYINT DEFAULT 0,";
$sSQL.="adminUnits TINYINT DEFAULT 0,";
$sSQL.="adminStockManage INT DEFAULT 0,";
$sSQL.="adminHandling DOUBLE DEFAULT 0,";
$sSQL.="adminHandlingPercent DOUBLE DEFAULT 0,";
$sSQL.="adminTweaks INT DEFAULT 0,";
$sSQL.="adminUPSLicense TEXT NULL,";
$sSQL.="adminDelCC INT DEFAULT 0,";
$sSQL.="adminClearCart INT DEFAULT 0,";
$sSQL.="adminlanguages INT DEFAULT 0,";
$sSQL.="adminlangsettings INT DEFAULT 0,";
$sSQL.="adminlang VARCHAR(10) NULL,";
$sSQL.="storelang VARCHAR(10) NULL,";
$sSQL.="adminSecret VARCHAR(50),";
$sSQL.="updLastCheck DATE,";
$sSQL.="updRecommended VARCHAR(50) NULL,";
$sSQL.="updSecurity TINYINT(1) DEFAULT 0,";
$sSQL.="updShouldUpd TINYINT(1) DEFAULT 0,";
$sSQL.="currRate1 DOUBLE DEFAULT 0,";
$sSQL.="currSymbol1 VARCHAR(50) NULL,";
$sSQL.="currRate2 DOUBLE DEFAULT 0,";
$sSQL.="currSymbol2 VARCHAR(50) NULL,";
$sSQL.="currRate3 DOUBLE DEFAULT 0,";
$sSQL.="currSymbol3 VARCHAR(50) NULL,";
$sSQL.="currConvUser VARCHAR(50) NULL,";
$sSQL.="currConvPw VARCHAR(50) NULL,";
$sSQL.="catalogRoot INT DEFAULT 0,";
$sSQL.="cardinalProcessor VARCHAR(50) NULL,";
$sSQL.="cardinalMerchant VARCHAR(50) NULL,";
$sSQL.="cardinalPwd VARCHAR(50) NULL,";
$sSQL.="prodFilter INT DEFAULT 0,";
$sSQL.="prodFilterText VARCHAR(255) NULL,";
$sSQL.="prodFilterText2 VARCHAR(255) NULL,";
$sSQL.="prodFilterText3 VARCHAR(255) NULL,";
$sSQL.="prodFilterOrder VARCHAR(255) NULL,";
$sSQL.="sideFilter INT DEFAULT 0,";
$sSQL.="sideFilterText VARCHAR(255) NULL,";
$sSQL.="sideFilterText2 VARCHAR(255) NULL,";
$sSQL.="sideFilterText3 VARCHAR(255) NULL,";
$sSQL.="sideFilterOrder VARCHAR(255) NULL,";
$sSQL.="adminPWLastChange DATETIME,";
$sSQL.="adminUserLock INT DEFAULT 0,";
$sSQL.="adminPayLater INT DEFAULT 0,";
$sSQL.="sortOrder INT DEFAULT 0,";
$sSQL.="sortOptions INT DEFAULT 0,";
$sSQL.="adminAltRates INT DEFAULT 0,";
$sSQL.="reCAPTCHAsitekey VARCHAR(100),";
$sSQL.="reCAPTCHAsecret VARCHAR(100),";
$sSQL.="reCAPTCHAuseon INT DEFAULT 0,";
$sSQL.="googleTagID VARCHAR(50),";
$sSQL.="googleTagNoHead TINYINT(1) DEFAULT 0,";
$sSQL.="packingslipuseinvoice TINYINT DEFAULT 0,";
$sSQL.="onvacation TINYINT DEFAULT 0,";
$sSQL.="vacationmessage TEXT NULL,";
$sSQL.="mailchimpAPIKey VARCHAR(100),";
$sSQL.="mailchimpList VARCHAR(100),";
$sSQL.="blockMultiPurchase SMALLINT DEFAULT 0,";
$sSQL.="blockMaxCartAdds SMALLINT DEFAULT 0,";
$sSQL.="blockContactEmails SMALLINT DEFAULT 0,";
$sSQL.="adminDeviceNotifAlert VARCHAR(255),";
$sSQL.="uploadDir VARCHAR(1024),";
$sSQL.="adminPwReset VARCHAR(16),";
$sSQL.="adminBestSellerDate DATE,";
$sSQL.="adminBestSellerCache TEXT,";
$sSQL.="avalarastate TINYINT(1),";
$sSQL.="avalaraacctno VARCHAR(50),";
$sSQL.="avalaralicensekey VARCHAR(50),";
$sSQL.="avalaracompanycode VARCHAR(50),";
$sSQL.="adminLogging TINYINT(1),";
$sSQL.="currLastUpdate DATETIME) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('admin');

$sSQL="CREATE TABLE adminshipping (adminShipID INT PRIMARY KEY," .
		"adminPacking SMALLINT DEFAULT 0," .
		"AusPostAPI VARCHAR(100)," .
		"adminCanPostUser VARCHAR(100)," .
		"adminCanPostLogin VARCHAR(100)," .
		"adminCanPostPass VARCHAR(100)," .
		"adminUSPSUser VARCHAR(100)," .
		"smartPostHub VARCHAR(15)," .
		"adminUPSUser VARCHAR(100)," .
		"uspsPw VARCHAR(100)," .
		"uspsAccount VARCHAR(32)," .
		"uspsAccessToken TEXT," .
		"uspsTokenTimeout INT DEFAULT 0," .
		"uspsCommercial TINYINT(1)," .
		"uspsCntnrFE TINYINT(1)," .
		"uspsCntnrFB TINYINT(1)," .
		"uspsCntnrFP TINYINT(1)," .
		"uspsCntnrFS TINYINT(1)," .
		"uspsCntnrPL TINYINT(1)," .
		"uspsCntnrSB TINYINT(1)," .
		"adminUPSpw VARCHAR(100)," .
		"adminUPSAccess VARCHAR(100)," .
		"adminUPSAccessTime INT DEFAULT 0," .
		"adminUPSAccess2 VARCHAR(1500)," .
		"adminUPSAccount VARCHAR(100)," .
		"adminUPSNegotiated SMALLINT DEFAULT 0," .
		"FedexAccountNo VARCHAR(100)," .
		"FedexMeter VARCHAR(100)," .
		"FedexUserKey VARCHAR(100)," .
		"FedexUserPwd VARCHAR(100)," .
		"DHLSiteID VARCHAR(50)," .
		"DHLSitePW VARCHAR(50)," .
		"DHLAccountNo VARCHAR(50)," .
		"shipTheoryUser VARCHAR(50)," .
		"shipTheoryPass VARCHAR(50)," .
		"shipStationUser VARCHAR(50)," .
		"shipStationPass VARCHAR(50)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('adminshipping');

$sSQL="CREATE TABLE adminlogin (adminloginid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="adminloginname VARCHAR(255) NOT NULL,";
$sSQL.="adminloginpassword VARCHAR(255) NOT NULL,";
$sSQL.="adminLoginLastChange DATETIME,";
$sSQL.="adminLoginLock INT DEFAULT 0,";
$sSQL.="dropShipper INT DEFAULT 0,";
$sSQL.="adminloginpermissions VARCHAR(255) NOT NULL) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('adminlogin');

$sSQL="CREATE TABLE affiliates (affilID VARCHAR(32) NOT NULL PRIMARY KEY,";
$sSQL.="affilPW VARCHAR(32),";
$sSQL.="affilEmail VARCHAR(128),";
$sSQL.="affilName VARCHAR(255),";
$sSQL.="affilAddress VARCHAR(255),";
$sSQL.="affilCity VARCHAR(255),";
$sSQL.="affilState VARCHAR(255),";
$sSQL.="affilZip VARCHAR(255),";
$sSQL.="affilCountry VARCHAR(255),";
$sSQL.="affilInform TINYINT DEFAULT 0,";
$sSQL.="affilDate DATE,";
$sSQL.="affilCommision DOUBLE DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('affiliates');

$sSQL="CREATE TABLE ajaxfloodcontrol (afcID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,afcAction INT NOT NULL DEFAULT 0,afcIP VARCHAR(128),afcSession VARCHAR(128),afcDate DATETIME,";
$sSQL.="INDEX (afcAction), INDEX (afcIP), INDEX (afcSession), INDEX (afcDate)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('auditlog');

ect_query("CREATE TABLE alternaterates (altrateid INT PRIMARY KEY,altratename VARCHAR(255) NOT NULL,altratetext VARCHAR(255) NULL,altratetext2 VARCHAR(255) NULL,altratetext3 VARCHAR(255) NULL, usealtmethod INT DEFAULT 0, usealtmethodintl INT DEFAULT 0, altrateorder INT DEFAULT 0, altrateorderintl INT DEFAULT 0) ENGINE=" . $databaseengine) or print_sql_error('alternaterates');
if(checktablecreated('alternaterates')){
	for($index=1; $index<=11; $index++){
		$sSQL="INSERT INTO alternaterates (altrateid,altratename,altratetext,altratetext2,altratetext3,usealtmethod,usealtmethodintl) VALUES (";

		if($index==1) $altratename='Flat Rate Shipping';
		if($index==2) $altratename='Weight Based Shipping';
		if($index==3) $altratename='U.S.P.S. Shipping';
		if($index==4) $altratename='UPS Shipping';
		if($index==5) $altratename='Price Based Shipping';
		if($index==6) $altratename='Canada Post';
		if($index==7) $altratename='FedEx Shipping';
		if($index==8) $altratename='FedEx SmartPost&reg;';
		if($index==9) $altratename='DHL Shipping';
		if($index==10) $altratename='Australia Post';
		if($index==11) $altratename='UPS SurePost';

		$sSQL.=$index . ",'" . $altratename . "','" . $altratename . "','" . $altratename . "','" . $altratename . "',0,0)";
		ect_query($sSQL) or print_sql_error('');
	}
}

$sSQL="CREATE TABLE auditlog (logID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,userID VARCHAR(50),eventType VARCHAR(50),eventDate DATETIME,eventSuccess TINYINT DEFAULT 0,eventOrigin VARCHAR(50),areaAffected VARCHAR(50),eventText TEXT NULL) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('auditlog');

$sSQL="CREATE TABLE cart (cartID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="cartSessionID VARCHAR(100),";
$sSQL.="cartProdID VARCHAR(255),";
$sSQL.="cartOrigProdID VARCHAR(255),";
$sSQL.="cartProdName VARCHAR(255),";
$sSQL.="cartTrackNum VARCHAR(255),";
$sSQL.="cartProdPrice DOUBLE,";
$sSQL.="cartDateAdded DATETIME,";
$sSQL.="cartQuantity INT DEFAULT 0,";
$sSQL.="cartOrderID INT DEFAULT 0,";
$sSQL.="cartClientID INT DEFAULT 0,";
$sSQL.="cartCompleted TINYINT,";
$sSQL.="cartGiftWrap TINYINT(1),";
$sSQL.="cartItemShipped TINYINT(1),";
$sSQL.="cartGiftMessage TEXT,";
$sSQL.="cartListID INT DEFAULT 0,";
$sSQL.="INDEX (cartClientID),INDEX (cartCompleted),INDEX (cartDateAdded),INDEX (cartOrderID),INDEX (cartListID),INDEX(cartOrigProdID),INDEX(cartProdID),INDEX(cartSessionID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('cart');

$sSQL="CREATE TABLE cartoptions (coID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="coCartID INT,";
$sSQL.="coOptID INT,";
$sSQL.="coOptGroup VARCHAR(255),";
$sSQL.="coCartOption VARCHAR(" . $txtcollen . "),";
$sSQL.="coPriceDiff DOUBLE DEFAULT 0,";
$sSQL.="coWeightDiff DOUBLE DEFAULT 0,";
$sSQL.="coMultiply TINYINT(1) NOT NULL DEFAULT 0,";
$sSQL.="INDEX (coCartID), INDEX (coOptID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('cartoptions');

$sSQL="CREATE TABLE contentregions (contentID INT PRIMARY KEY,";
$sSQL.="contentName VARCHAR(255) NULL,contentX INT DEFAULT 0,contentY INT DEFAULT 0,contentData TEXT NULL,contentData2 TEXT NULL,contentData3 TEXT NULL) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('contentregions');

$sSQL="CREATE TABLE countries (countryID INT NOT NULL PRIMARY KEY,";
$sSQL.="countryName VARCHAR(255),";
$sSQL.="countryName2 VARCHAR(255),";
$sSQL.="countryName3 VARCHAR(255),";
$sSQL.="countryEnabled TINYINT DEFAULT 0,";
$sSQL.="countryTax DOUBLE DEFAULT 0,";
$sSQL.="countryTaxThreshold DOUBLE DEFAULT 0,";
$sSQL.="countryOrder INT DEFAULT 0,";
$sSQL.="countryZone INT DEFAULT 0,";
$sSQL.="loadStates INT DEFAULT 0,";
$sSQL.="countryLCID VARCHAR(50),";
$sSQL.="countryCurrency VARCHAR(50),";
$sSQL.="countryCode VARCHAR(50),";
$sSQL.="countryCode3 VARCHAR(8),";
$sSQL.="countryNumCurrency INT DEFAULT 0,";
$sSQL.="countryFreeShip TINYINT DEFAULT 0,";
$sSQL.="currSymbolText VARCHAR(255),";
$sSQL.="currDecimalSep VARCHAR(255),";
$sSQL.="currThousandsSep VARCHAR(255),";
$sSQL.="currPostAmount TINYINT DEFAULT 0,";
$sSQL.="currDecimals INT DEFAULT 0,";
$sSQL.="currSymbolHTML VARCHAR(255),";	
$sSQL.="INDEX (countryName)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('countries');

$sSQL="CREATE TABLE coupons (cpnID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="cpnName VARCHAR(255) NULL,";
$sSQL.="cpnName2 VARCHAR(255) NULL,";
$sSQL.="cpnName3 VARCHAR(255) NULL,";
$sSQL.="cpnWorkingName VARCHAR(255),";
$sSQL.="cpnNumber VARCHAR(255),";
$sSQL.="cpnType INT DEFAULT 0,";
$sSQL.="cpnStartDate DATETIME,";
$sSQL.="cpnEndDate DATETIME,";
$sSQL.="cpnDiscount DOUBLE DEFAULT 0,";
$sSQL.="cpnThreshold DOUBLE DEFAULT 0,";
$sSQL.="cpnThresholdMax DOUBLE DEFAULT 0,";
$sSQL.="cpnThresholdRepeat DOUBLE DEFAULT 0,";
$sSQL.="cpnQuantity INT DEFAULT 0,";
$sSQL.="cpnQuantityMax INT DEFAULT 0,";
$sSQL.="cpnQuantityRepeat INT DEFAULT 0,";
$sSQL.="cpnNumAvail INT DEFAULT 0,";
$sSQL.="cpnCntry TINYINT DEFAULT 0,";
$sSQL.="cpnIsCoupon TINYINT DEFAULT 0,";
$sSQL.="cpnHandling TINYINT(1) DEFAULT 0,";
$sSQL.="cpnInsurance TINYINT(1) DEFAULT 0,";
$sSQL.="cpnLoginLevel INT DEFAULT 0,";
$sSQL.="cpnSitewide TINYINT DEFAULT 0,INDEX (cpnStartDate),INDEX (cpnEndDate)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('coupons');

$sSQL="CREATE TABLE couponsapplied (cpaCpnID INT DEFAULT 0 NOT NULL,cpaOrdID INT DEFAULT 0 NOT NULL,cpaAmount DOUBLE DEFAULT 0,cpaTxt VARCHAR(255), PRIMARY KEY(cpaCpnID,cpaOrdID),INDEX(cpaCpnID),INDEX(cpaOrdID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('couponsapplied');

$sSQL="CREATE TABLE cpnassign (cpaID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="cpaCpnID INT DEFAULT 0,";
$sSQL.="cpaType TINYINT DEFAULT 0,";
$sSQL.="cpaAssignment VARCHAR(255),";
$sSQL.="INDEX(cpaAssignment), INDEX(cpaCpnID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('cpnassign');
$sSQL="CREATE UNIQUE INDEX ui_cpnassign ON cpnassign (cpaCpnID,cpaType,cpaAssignment)";
ect_query($sSQL);

$sSQL="CREATE TABLE customerlists (listID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="listName VARCHAR(255) NOT NULL,";
$sSQL.="listOwner INT NOT NULL DEFAULT 0,";
$sSQL.="listAccess VARCHAR(255) NOT NULL,";
$sSQL.="INDEX (listOwner)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('customerlists');

$sSQL="CREATE TABLE customerlogin (clID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="clUserName VARCHAR(50) NULL,";
$sSQL.="clPW VARCHAR(50) NULL,";
$sSQL.="clLoginLevel TINYINT DEFAULT 0,";
$sSQL.="clPercentDiscount DOUBLE DEFAULT 0,";
$sSQL.="clActions INT DEFAULT 0,";
$sSQL.="clEmail VARCHAR(255) NULL,";
$sSQL.="loyaltyPoints INT DEFAULT 0,";
$sSQL.="clientCustom1 VARCHAR(255) NULL,";
$sSQL.="clientCustom2 VARCHAR(255) NULL,";
$sSQL.="avalaraentityuse VARCHAR(10) NULL,";
$sSQL.="clientAdminNotes TEXT NULL,";
$sSQL.="clDateCreated DATETIME) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('customerlogin');

$sSQL="CREATE TABLE devicenotifications (dnID VARCHAR(127) PRIMARY KEY,dnLastUpdated DATETIME) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('devicenotifications');

$sSQL="CREATE TABLE dropshipper (dsID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="dsName VARCHAR(255) NULL,";
$sSQL.="dsEmail VARCHAR(255) NULL,";
$sSQL.="dsAddress VARCHAR(255) NULL,";
$sSQL.="dsCity VARCHAR(255) NULL,";
$sSQL.="dsState VARCHAR(255) NULL,";
$sSQL.="dsZip VARCHAR(255) NULL,";
$sSQL.="dsCountry VARCHAR(255) NULL,";
$sSQL.="dsEmailHeader TEXT NULL,";
$sSQL.="dsAction INT DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('dropshipper');

$sSQL="CREATE TABLE emailmessages (emailID INT PRIMARY KEY,";
$sSQL.="giftcertsubject VARCHAR(255) NULL,";
$sSQL.="giftcertsubject2 VARCHAR(255) NULL,";
$sSQL.="giftcertsubject3 VARCHAR(255) NULL,";
$sSQL.="giftcertemail TEXT NULL,";
$sSQL.="giftcertemail2 TEXT NULL,";
$sSQL.="giftcertemail3 TEXT NULL,";
$sSQL.="giftcertsendersubject VARCHAR(255) NULL,";
$sSQL.="giftcertsendersubject2 VARCHAR(255) NULL,";
$sSQL.="giftcertsendersubject3 VARCHAR(255) NULL,";
$sSQL.="giftcertsender TEXT NULL,";
$sSQL.="giftcertsender2 TEXT NULL,";
$sSQL.="giftcertsender3 TEXT NULL,";
$sSQL.="emailsubject VARCHAR(255) NULL,";
$sSQL.="emailsubject2 VARCHAR(255) NULL,";
$sSQL.="emailsubject3 VARCHAR(255) NULL,";
$sSQL.="emailheaders TEXT NULL,";
$sSQL.="emailheaders2 TEXT NULL,";
$sSQL.="emailheaders3 TEXT NULL,";
$sSQL.="receiptheaders TEXT NULL,";
$sSQL.="receiptheaders2 TEXT NULL,";
$sSQL.="receiptheaders3 TEXT NULL,";
$sSQL.="dropshipsubject VARCHAR(255) NULL,";
$sSQL.="dropshipsubject2 VARCHAR(255) NULL,";
$sSQL.="dropshipsubject3 VARCHAR(255) NULL,";
$sSQL.="dropshipheaders TEXT NULL,";
$sSQL.="dropshipheaders2 TEXT NULL,";
$sSQL.="dropshipheaders3 TEXT NULL,";
$sSQL.="abandonedcartsubject VARCHAR(255) NULL,";
$sSQL.="abandonedcartsubject2 VARCHAR(255) NULL,";
$sSQL.="abandonedcartsubject3 VARCHAR(255) NULL,";
$sSQL.="abandonedcartemail TEXT NULL,";
$sSQL.="abandonedcartemail2 TEXT NULL,";
$sSQL.="abandonedcartemail3 TEXT NULL,";
$sSQL.="shiplineitemsubject VARCHAR(255) NULL,";
$sSQL.="shiplineitemsubject2 VARCHAR(255) NULL,";
$sSQL.="shiplineitemsubject3 VARCHAR(255) NULL,";
$sSQL.="shiplineitememail TEXT NULL,";
$sSQL.="shiplineitememail2 TEXT NULL,";
$sSQL.="shiplineitememail3 TEXT NULL,";
$sSQL.="invoiceheader TEXT NULL,";
$sSQL.="invoiceaddress TEXT NULL,";
$sSQL.="invoicefooter TEXT NULL,";
$sSQL.="packingslipheader TEXT NULL,";
$sSQL.="packingslipaddress TEXT NULL,";
$sSQL.="packingslipfooter TEXT NULL,";
$sSQL.="notifystocksubject VARCHAR(255) NULL,notifystocksubject2 VARCHAR(255) NULL,notifystocksubject3 VARCHAR(255) NULL,";
$sSQL.="notifystockemail TEXT NULL,notifystockemail2 TEXT NULL,notifystockemail3 TEXT NULL,";
$sSQL.="orderstatussubject VARCHAR(255) NULL,orderstatussubject2 VARCHAR(255) NULL,orderstatussubject3 VARCHAR(255) NULL,";
$sSQL.="orderstatusemail TEXT NULL,orderstatusemail2 TEXT NULL,orderstatusemail3 TEXT NULL) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('emailmessages');

$sSQL="CREATE TABLE giftcertificate (gcID VARCHAR(127) PRIMARY KEY,";
$sSQL.="gcTo VARCHAR(255) NULL,";
$sSQL.="gcFrom VARCHAR(255) NULL,";
$sSQL.="gcEmail VARCHAR(255) NULL,";
$sSQL.="gcOrigAmount DOUBLE DEFAULT 0,";
$sSQL.="gcRemaining DOUBLE DEFAULT 0,";
$sSQL.="gcDateCreated DATE,";
$sSQL.="gcDateUsed DATE,";
$sSQL.="gcCartID INT DEFAULT 0 NOT NULL,";
$sSQL.="gcOrderID INT DEFAULT 0 NOT NULL,";
$sSQL.="gcAuthorized TINYINT(1) DEFAULT 0,";
$sSQL.="gcMessage TEXT NULL, INDEX (gcCartID), INDEX (gcOrderID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('giftcertificate');

$sSQL="CREATE TABLE giftcertsapplied (gcaGCID VARCHAR(127) NOT NULL,";
$sSQL.="gcaOrdID INT DEFAULT 0 NOT NULL,";
$sSQL.="gcaAmount DOUBLE DEFAULT 0,";
$sSQL.="PRIMARY KEY(gcaGCID,gcaOrdID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('giftcertsapplied');

$sSQL ="CREATE TABLE imageuploads (upID INT AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="upOrderID INT DEFAULT 0,";
$sSQL.="upComments VARCHAR(1024),";
$sSQL.="upFilename VARCHAR(255)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('imageuploads');

$sSQL="CREATE TABLE installedmods (modkey VARCHAR(100) PRIMARY KEY,modtitle VARCHAR(255) NOT NULL, modauthor VARCHAR(255) NULL, modauthorlink VARCHAR(255) NULL, modversion VARCHAR(255) NULL, modectversion VARCHAR(255) NULL, modlink VARCHAR(255) NULL, moddate DATETIME NOT NULL, modnotes TEXT NULL) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('installedmods');

$sSQL="CREATE TABLE ipblocking (dcid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="dcip1 INT DEFAULT 0,";
$sSQL.="dcip2 INT DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('ipblocking');

$sSQL="CREATE TABLE mailinglist (email VARCHAR(100) PRIMARY KEY,";
$sSQL.="mlName VARCHAR(255),";
$sSQL.="emailFormat TINYINT DEFAULT 0,";
$sSQL.="mlConfirmDate DATE,";
$sSQL.="mlIPAddress VARCHAR(255),";
$sSQL.="emailsent TINYINT(1) DEFAULT 0,";
$sSQL.="selected TINYINT(1) DEFAULT 0,";
$sSQL.="isconfirmed TINYINT(1) DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('mailinglist');

$sSQL="CREATE TABLE multibuyblock (ssdenyid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="ssdenyip VARCHAR(100) NOT NULL,";
$sSQL.="sstimesaccess INT DEFAULT 0,";
$sSQL.="lastaccess DATETIME,";
$sSQL.="INDEX (ssdenyip), UNIQUE (ssdenyip)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('multibuyblock');

$sSQL="CREATE TABLE multisearchcriteria (mSCpID VARCHAR(128) NOT NULL,mSCscID INT DEFAULT 0 NOT NULL, PRIMARY KEY(mSCpID,mSCscID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('multisearchcriteria');

$sSQL="CREATE TABLE multisections (pID VARCHAR(128) NOT NULL,";
$sSQL.="pSection INT DEFAULT 0 NOT NULL,";
$sSQL.="PRIMARY KEY (pID, pSection)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('multisections');

ect_query("CREATE TABLE notifyinstock (nsProdID VARCHAR(100) NOT NULL,nsOptID INT DEFAULT 0,nsTriggerProdID VARCHAR(100) NOT NULL,nsEmail VARCHAR(70) NOT NULL,nsDate DATETIME, PRIMARY KEY(nsTriggerProdID,nsEmail)) ENGINE=" . $databaseengine) or print_sql_error('notifyinstock');

$sSQL="CREATE TABLE optiongroup (optGrpID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="optGrpName VARCHAR(255),";
$sSQL.="optGrpName2 VARCHAR(255),";
$sSQL.="optGrpName3 VARCHAR(255),";
$sSQL.="optGrpWorkingName VARCHAR(255),";
$sSQL.="optType INT DEFAULT 0,";
$sSQL.="optFlags INT DEFAULT 0,";
$sSQL.="optMultiply TINYINT(1) DEFAULT 0,";
$sSQL.="optAcceptChars VARCHAR(255),";
$sSQL.="optTxtMaxLen INT DEFAULT 0,";
$sSQL.="optTxtCharge DOUBLE DEFAULT 0,";
$sSQL.="optTooltip TEXT,";
$sSQL.="optGrpSelect TINYINT(1) DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('optiongroup');

$sSQL="CREATE TABLE options (optID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="optGroup INT,";
$sSQL.="optName VARCHAR(255),";
$sSQL.="optName2 VARCHAR(255),";
$sSQL.="optName3 VARCHAR(255),";
$sSQL.="optDependants VARCHAR(255),";
$sSQL.="optPriceDiff DOUBLE DEFAULT 0,";
$sSQL.="optWholesalePriceDiff DOUBLE DEFAULT 0,";
$sSQL.="optWeightDiff DOUBLE DEFAULT 0,";
$sSQL.="optStock INT DEFAULT 0,";
$sSQL.="optRegExp VARCHAR(255),";
$sSQL.="optPlaceholder VARCHAR(255),";
$sSQL.="optPlaceholder2 VARCHAR(255),";
$sSQL.="optPlaceholder3 VARCHAR(255),";
$sSQL.="optDefault TINYINT(1) DEFAULT 0,";
$sSQL.="optAltImage VARCHAR(255),";
$sSQL.="optAltLargeImage VARCHAR(255),";
$sSQL.="optClass VARCHAR(255),";
$sSQL.="INDEX (optGroup)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('options');

$sSQL="CREATE TABLE orders (ordID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="ordSessionID VARCHAR(100),";
$sSQL.="ordName VARCHAR(255),";
$sSQL.="ordLastName VARCHAR(255),";
$sSQL.="ordAddress VARCHAR(255),";
$sSQL.="ordAddress2 VARCHAR(255),";
$sSQL.="ordCity VARCHAR(255),";
$sSQL.="ordState VARCHAR(255),";
$sSQL.="ordZip VARCHAR(50),";
$sSQL.="ordCountry VARCHAR(50),";
$sSQL.="ordEmail VARCHAR(255),";
$sSQL.="ordPhone VARCHAR(50),";
$sSQL.="ordShipName VARCHAR(255),";
$sSQL.="ordShipLastName VARCHAR(255),";
$sSQL.="ordShipAddress VARCHAR(255),";
$sSQL.="ordShipAddress2 VARCHAR(255),";
$sSQL.="ordShipCity VARCHAR(255),";
$sSQL.="ordShipState VARCHAR(255),";
$sSQL.="ordShipZip VARCHAR(50),";
$sSQL.="ordShipCountry VARCHAR(50),";
$sSQL.="ordShipPhone VARCHAR(50),";
$sSQL.="ordAuthNumber VARCHAR(255),";
$sSQL.="ordAuthStatus VARCHAR(255),";
$sSQL.="ordAffiliate VARCHAR(50),";
$sSQL.="ordPayProvider INT DEFAULT 0,";
$sSQL.="ordTransID VARCHAR(255) NULL,";
$sSQL.="ordTransSession VARCHAR(255) NULL,";
$sSQL.="ordShipping DOUBLE DEFAULT 0,";
$sSQL.="ordStateTax DOUBLE DEFAULT 0,";
$sSQL.="ordCountryTax DOUBLE DEFAULT 0,";
$sSQL.="ordHSTTax DOUBLE DEFAULT 0,";
$sSQL.="ordHandling DOUBLE DEFAULT 0,";
$sSQL.="ordShipType VARCHAR(255),";
$sSQL.="ordShipCarrier INT DEFAULT 0,";
$sSQL.="ordClientID INT DEFAULT 0,";
$sSQL.="ordTotal DOUBLE DEFAULT 0,";
$sSQL.="ordDate DATETIME,";
$sSQL.="ordIP VARCHAR(100),";
$sSQL.="ordDiscount DOUBLE DEFAULT 0,";
$sSQL.="ordDiscountText VARCHAR(255),";
$sSQL.="ordExtra1 TEXT NULL,";
$sSQL.="ordExtra2 TEXT NULL,";
$sSQL.="ordShipExtra1 TEXT NULL,";
$sSQL.="ordShipExtra2 TEXT NULL,";
$sSQL.="ordCheckoutExtra1 TEXT NULL,";
$sSQL.="ordCheckoutExtra2 TEXT NULL,";
$sSQL.="ordTrackNum VARCHAR(255) NULL,";
$sSQL.="ordAVS VARCHAR(50) NULL,";
$sSQL.="ordCVV VARCHAR(50) NULL,";
$sSQL.="ordUserAgent VARCHAR(255) NULL,";
$sSQL.="ordAddInfo TEXT,";
$sSQL.="ordPrivateStatus TEXT,";
$sSQL.="ordCNum TEXT NULL,";
$sSQL.="ordComLoc TINYINT DEFAULT 0,";
$sSQL.="ordStatus TINYINT DEFAULT 0,";
$sSQL.="ordStatusDate DATETIME,";
$sSQL.="ordStatusInfo TEXT NULL,";
$sSQL.="ordInvoice VARCHAR(255) NULL,";
$sSQL.="ordReferer VARCHAR(255) NULL,";
$sSQL.="ordQuerystr VARCHAR(255) NULL,";
$sSQL.="ordLang TINYINT DEFAULT 0,";
$sSQL.="loyaltyPoints INT DEFAULT 0,";
$sSQL.="pointsRedeemed INT DEFAULT 0,";
$sSQL.="INDEX (ordClientID), INDEX (ordDate), INDEX (ordSessionID), INDEX (ordStatus)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('orders');

$sSQL="CREATE TABLE orderstatus (statID INT PRIMARY KEY,";
$sSQL.="statPrivate VARCHAR(255) NULL,";
$sSQL.="emailstatus TINYINT(1) DEFAULT 0,";
$sSQL.="statPublic VARCHAR(255) NULL,";
$sSQL.="statPublic2 VARCHAR(255) NULL,";
$sSQL.="statPublic3 VARCHAR(255) NULL) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('orderstatus');

$sSQL="CREATE TABLE passwordhistory (pwhID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,liID INT DEFAULT 0,pwhPwd VARCHAR(50) NULL,datePWChanged DATETIME) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('passwordhistory');

$sSQL="CREATE TABLE payprovider (payProvID INT NOT NULL PRIMARY KEY,";
$sSQL.="payProvName VARCHAR(255),";
$sSQL.="payProvShow VARCHAR(255),";
$sSQL.="payProvShow2 VARCHAR(255),";
$sSQL.="payProvShow3 VARCHAR(255),";
$sSQL.="payProvEnabled TINYINT,";
$sSQL.="payProvAvailable TINYINT,";
$sSQL.="payProvDemo TINYINT,";
$sSQL.="payProvData1 VARCHAR(2048),";
$sSQL.="payProvData2 VARCHAR(2048),";
$sSQL.="payProvData3 VARCHAR(2048),";
$sSQL.="payProvOrder INT DEFAULT 0,";
$sSQL.="payProvMethod INT DEFAULT 0,";
$sSQL.="ppHandlingCharge DOUBLE DEFAULT 0,";
$sSQL.="ppHandlingPercent DOUBLE DEFAULT 0,";
$sSQL.="pProvHeaders TEXT NULL,";
$sSQL.="pProvHeaders2 TEXT NULL,";
$sSQL.="pProvHeaders3 TEXT NULL,";
$sSQL.="pProvDropShipHeaders TEXT NULL,";
$sSQL.="pProvDropShipHeaders2 TEXT NULL,";
$sSQL.="pProvDropShipHeaders3 TEXT NULL,";
$sSQL.="payProvFlag1 TINYINT(1) DEFAULT 0,";
$sSQL.="payProvFlag2 TINYINT(1) DEFAULT 0,";
$sSQL.="payProvFlag3 TINYINT(1) DEFAULT 0,";
$sSQL.="payProvData4 VARCHAR(2048),";
$sSQL.="payProvData5 VARCHAR(2048),";
$sSQL.="payProvData6 VARCHAR(2048),";
$sSQL.="payProvBits INT DEFAULT 0,";
$sSQL.="payProvLevel INT DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('payprovider');

$sSQL="CREATE TABLE postalzones (pzID INT NOT NULL PRIMARY KEY,";
$sSQL.="pzName VARCHAR(50),";
$sSQL.="pzMultiShipping TINYINT DEFAULT 0,";
$sSQL.="pzMethodName1 VARCHAR(255) NULL,";
$sSQL.="pzMethodName2 VARCHAR(255) NULL,";
$sSQL.="pzMethodName3 VARCHAR(255) NULL,";
$sSQL.="pzMethodName4 VARCHAR(255) NULL,";
$sSQL.="pzMethodName5 VARCHAR(255) NULL,";
$sSQL.="pzFSA TINYINT DEFAULT 1) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('postalzones');

$sSQL="CREATE TABLE pricebreaks (pbQuantity INT NOT NULL,";
$sSQL.="pbProdID VARCHAR(100) NOT NULL,";
$sSQL.="pPrice DOUBLE DEFAULT 0,";
$sSQL.="pWholesalePrice DOUBLE DEFAULT 0,";
$sSQL.="pbPercent TINYINT(1) DEFAULT 0,";
$sSQL.="pbWholesalePercent TINYINT(1) DEFAULT 0,";
$sSQL.="PRIMARY KEY(pbProdID,pbQuantity)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('pricebreaks');

$sSQL="CREATE TABLE prodoptions (poID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="poProdID VARCHAR(128),";
$sSQL.="poOptionGroup INT,";
$sSQL.="INDEX (poProdID), INDEX (poOptionGroup)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('prodoptions');

$sSQL="CREATE TABLE productimages (imageProduct VARCHAR(128),imageSrc VARCHAR(255) NOT NULL,imageNumber INT DEFAULT 0 NOT NULL,imageType SMALLINT DEFAULT 0 NOT NULL, PRIMARY KEY(imageProduct,imageType,imageNumber)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('productimages');
ect_query("ALTER TABLE productimages ADD INDEX (imageProduct)") or ect_error();
ect_query("ALTER TABLE productimages ADD INDEX (imageType)") or ect_error();

ect_query("CREATE TABLE productimages_archive LIKE productimages");

$sSQL = "CREATE TABLE productpackages (packageID VARCHAR(100) NOT NULL,pID VARCHAR(100) NOT NULL,quantity INT NOT NULL DEFAULT 0,PRIMARY KEY(packageID,pID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('productpackages');
ect_query("ALTER TABLE productpackages ADD INDEX (packageID)") or ect_error();
ect_query("ALTER TABLE productpackages ADD INDEX (pID)") or ect_error();

$sSQL="CREATE TABLE products (pID VARCHAR(128) NOT NULL PRIMARY KEY,";
$sSQL.="pName VARCHAR(255) NOT NULL,";
$sSQL.="pName2 VARCHAR(255) DEFAULT '',";
$sSQL.="pName3 VARCHAR(255) DEFAULT '',";
$sSQL.="pSection INT DEFAULT 0 NOT NULL,";
$sSQL.="pDescription TEXT,";
$sSQL.="pDescription2 TEXT,";
$sSQL.="pDescription3 TEXT,";
$sSQL.="pLongdescription TEXT,";
$sSQL.="pLongdescription2 TEXT,";
$sSQL.="pLongdescription3 TEXT,";
$sSQL.="pSearchParams TEXT NULL,";
$sSQL.="pSearchParams2 TEXT NULL,";
$sSQL.="pSearchParams3 TEXT NULL,";
$sSQL.="pDownload VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pCustomCSS VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pStaticURL VARCHAR(255) DEFAULT '' NOT NULL,";
$sSQL.="pStaticURL2 VARCHAR(255) DEFAULT '' NOT NULL,";
$sSQL.="pStaticURL3 VARCHAR(255) DEFAULT '' NOT NULL,";
$sSQL.="pPrice DOUBLE DEFAULT 0 NOT NULL,";
$sSQL.="pListPrice DOUBLE DEFAULT 0,";
$sSQL.="pWholesalePrice DOUBLE DEFAULT 0,";
$sSQL.="pShipping DOUBLE DEFAULT 0,";
$sSQL.="pShipping2 DOUBLE DEFAULT 0,";
$sSQL.="pWeight DOUBLE DEFAULT 0,";
$sSQL.="pDisplay TINYINT(1) DEFAULT 1,";
$sSQL.="pSell TINYINT(1) DEFAULT 1,";
$sSQL.="pStaticPage TINYINT(1) DEFAULT 0,";
$sSQL.="pStockByOpts TINYINT(1) DEFAULT 0,";
$sSQL.="pRecommend TINYINT(1) DEFAULT 0,";
$sSQL.="pGiftWrap TINYINT(1) DEFAULT 0,";
$sSQL.="pBackOrder TINYINT(1) DEFAULT 0,";
$sSQL.="pExemptions TINYINT DEFAULT 0,";
$sSQL.="pInStock INT DEFAULT 0,";
$sSQL.="pDropship INT DEFAULT 0,";
$sSQL.="pPopularity INT DEFAULT 0,";
$sSQL.="pNumSales INT DEFAULT 0,";
$sSQL.="pManufacturer INT DEFAULT 0,";
$sSQL.="pDims VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pSKU VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pTitle VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pTitle2 VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pTitle3 VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pMetaDesc VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pMetaDesc2 VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pMetaDesc3 VARCHAR(255) DEFAULT '' NULL,";
$sSQL.="pCustom1 VARCHAR(2048) DEFAULT '' NULL,";
$sSQL.="pCustom2 VARCHAR(2048) DEFAULT '' NULL,";
$sSQL.="pCustom3 VARCHAR(2048) DEFAULT '' NULL,";
$sSQL.="pDateAdded DATE,";
$sSQL.="pTax DOUBLE NULL,";
$sSQL.="pTaxCode VARCHAR(50) DEFAULT '' NULL,";
$sSQL.="pOrder INT DEFAULT 0,";
$sSQL.="pTotRating INT DEFAULT 0,";
$sSQL.="pNumRatings INT DEFAULT 0,";
$sSQL.="pMinQuant INT DEFAULT 0,";
$sSQL.="pUpload TINYINT DEFAULT 0,";
$sSQL.="pSiteID TINYINT DEFAULT 0,";
$sSQL.="pSchemaType TINYINT DEFAULT 0,";
$sSQL.="INDEX (pDateAdded),INDEX (pDisplay),INDEX (pManufacturer),INDEX (pName),INDEX (pNumRatings),INDEX (pNumSales),INDEX (pOrder),INDEX (pPopularity),INDEX (pPrice),INDEX (pSection),INDEX (pSKU),INDEX (pTotRating)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('products');

ect_query("CREATE TABLE products_archive LIKE products");

$sSQL="CREATE TABLE ratings (rtID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="rtProdID VARCHAR(255) NOT NULL,";
$sSQL.="rtRating TINYINT DEFAULT 0,";
$sSQL.="rtLanguage TINYINT DEFAULT 0,";
$sSQL.="rtDate DATE,";
$sSQL.="rtApproved TINYINT(1) DEFAULT 0,";
$sSQL.="rtIPAddress VARCHAR(255) NULL,";
$sSQL.="rtPosterName VARCHAR(255),";
$sSQL.="rtPosterLoginID INT DEFAULT 0,";
$sSQL.="rtPosterEmail VARCHAR(255) NULL,";
$sSQL.="rtHeader VARCHAR(255) NULL,";
$sSQL.="rtComments TEXT NULL,";
$sSQL.="INDEX (rtProdID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('ratings');

$sSQL="CREATE TABLE recentlyviewed (rvID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="rvProdID VARCHAR(255) NOT NULL,";
$sSQL.="rvProdName VARCHAR(255) NOT NULL,";
$sSQL.="rvProdSection INT NOT NULL DEFAULT 0,";
$sSQL.="rvProdURL VARCHAR(255) NOT NULL,";
$sSQL.="rvSessionID VARCHAR(50) NOT NULL,";
$sSQL.="rvCustomerID INT NOT NULL DEFAULT 0,";
$sSQL.="rvDate DATETIME NOT NULL,";
$sSQL.="INDEX (rvCustomerID),INDEX (rvDate),INDEX (rvProdId),INDEX (rvProdSection),INDEX (rvSessionID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('recentlyviewed');

$sSQL="CREATE TABLE relatedprods (rpProdID VARCHAR(100) NOT NULL,";
$sSQL.="rpRelProdID VARCHAR(100) NOT NULL,";
$sSQL.="PRIMARY KEY (rpProdID, rpRelProdID)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('relatedprods');

$sSQL="CREATE TABLE searchcriteria (scID INT PRIMARY KEY,";
$sSQL.="scOrder INT DEFAULT 0,";
$sSQL.="scGroup INT DEFAULT 0,";
$sSQL.="scName VARCHAR(100) NULL,";
$sSQL.="scName2 VARCHAR(100) NULL,";
$sSQL.="scName3 VARCHAR(100) NULL,";
$sSQL.="scWorkingName VARCHAR(100) NULL,";
$sSQL.="scLogo VARCHAR(255) NULL,";
$sSQL.="scURL VARCHAR(255) NULL,";
$sSQL.="scURL2 VARCHAR(255) NULL,";
$sSQL.="scURL3 VARCHAR(255) NULL,";
$sSQL.="scEmail VARCHAR(255) NULL,";
$sSQL.="scDescription TEXT NULL,";
$sSQL.="scDescription2 TEXT NULL,";
$sSQL.="scDescription3 TEXT NULL,";
$sSQL.="scHeader TEXT NULL,";
$sSQL.="scHeader2 TEXT NULL,";
$sSQL.="scHeader3 TEXT NULL,";
$sSQL.="scNotes TEXT NULL,";
$sSQL.="INDEX (scGroup),INDEX (scOrder),INDEX (scName),INDEX (scName2),INDEX (scName3)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('searchcriteria');

$sSQL="CREATE TABLE searchcriteriagroup (scgID INT PRIMARY KEY,";
$sSQL.="scgOrder INT DEFAULT 0,scgTitle VARCHAR(128) NOT NULL,scgTitle2 VARCHAR(128),scgTitle3 VARCHAR(128),scgWorkingName VARCHAR(128),";
$sSQL.="INDEX (scgOrder)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('searchcriteriagroup');

$sSQL="CREATE TABLE sections (sectionID INT PRIMARY KEY,";
$sSQL.="sectionName VARCHAR(255) NOT NULL,";
$sSQL.="sectionName2 VARCHAR(255) NOT NULL,";
$sSQL.="sectionName3 VARCHAR(255) NOT NULL,";
$sSQL.="sectionWorkingName VARCHAR(255),";
$sSQL.="sectionurl VARCHAR(255) NOT NULL,";
$sSQL.="sectionurl2 VARCHAR(255) NOT NULL,";
$sSQL.="sectionurl3 VARCHAR(255) NOT NULL,";
$sSQL.="sTitle VARCHAR(255) NULL,";
$sSQL.="sTitle2 VARCHAR(255) NULL,";
$sSQL.="sTitle3 VARCHAR(255) NULL,";
$sSQL.="sMetaDesc VARCHAR(255) NULL,";
$sSQL.="sMetaDesc2 VARCHAR(255) NULL,";
$sSQL.="sMetaDesc3 VARCHAR(255) NULL,";
$sSQL.="sCustomCSS VARCHAR(255) NULL,";
$sSQL.="sectionImage VARCHAR(255),";
$sSQL.="sectionDescription TEXT,";
$sSQL.="sectionDescription2 TEXT,";
$sSQL.="sectionDescription3 TEXT,";
$sSQL.="sectionHeader TEXT,";
$sSQL.="sectionHeader2 TEXT,";
$sSQL.="sectionHeader3 TEXT,";
$sSQL.="sectionFooter TEXT,";
$sSQL.="sectionFooter2 TEXT,";
$sSQL.="sectionFooter3 TEXT,";
$sSQL.="topSection INT DEFAULT 0,";
$sSQL.="rootSection INT DEFAULT 0,";
$sSQL.="sectionOrder INT DEFAULT 0,";
$sSQL.="sectionDisabled TINYINT DEFAULT 0,";
$sSQL.="sRecommend TINYINT(1) DEFAULT 0,";
$sSQL.="INDEX (sectionDisabled),INDEX (sectionOrder),INDEX (topSection)) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('sections');

ect_query("CREATE TABLE shipoptions (soIndex INT NOT NULL DEFAULT 0,soOrderID INT NOT NULL DEFAULT 0,soFreeShipExempt DOUBLE DEFAULT 0,soMethodName VARCHAR(255) NULL,soCost DOUBLE DEFAULT 0,soFreeShip TINYINT DEFAULT 0,soShipType INT DEFAULT 0,soDeliveryTime VARCHAR(255) NULL,soDateAdded DATETIME NOT NULL, PRIMARY KEY(soIndex,soOrderID), INDEX(soDateAdded)) ENGINE=" . $databaseengine) or print_sql_error('shipoptions');

$sSQL="CREATE TABLE states (stateID INT NOT NULL PRIMARY KEY,";
$sSQL.="stateName VARCHAR(50),";
$sSQL.="stateName2 VARCHAR(50),";
$sSQL.="stateName3 VARCHAR(50),";
$sSQL.="stateAbbrev VARCHAR(50),";
$sSQL.="stateTax DOUBLE DEFAULT 0,";
$sSQL.="stateEnabled TINYINT,";
$sSQL.="stateZone INT DEFAULT 0,";
$sSQL.="stateCountryID INT DEFAULT 0,";
$sSQL.="stateFreeShip TINYINT DEFAULT 1) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('states');

ect_query("CREATE TABLE subsectionidcache (sectionID INT,sectionDisabled INT,subSections TEXT NOT NULL, PRIMARY KEY(sectionID,sectionDisabled))") or print_sql_error('subsectionidcache');

$sSQL="CREATE TABLE tmplogin (tmploginid VARCHAR(100) PRIMARY KEY,";
$sSQL.="tmploginname VARCHAR(50) NULL,";
$sSQL.="tmploginchk DOUBLE DEFAULT 0,";
$sSQL.="tmplogindate DATETIME) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('tmplogin');

$sSQL="CREATE TABLE uspsmethods (uspsID INT PRIMARY KEY,";
$sSQL.="uspsMethod VARCHAR(150) NOT NULL,";
$sSQL.="uspsShowAs VARCHAR(150) NOT NULL,";
$sSQL.="uspsUseMethod TINYINT DEFAULT 0,";
$sSQL.="uspsFSA TINYINT DEFAULT 0,";
$sSQL.="uspsOrder INT DEFAULT 0,";
$sSQL.="uspsLocal TINYINT DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('uspsmethods');

$sSQL="CREATE TABLE zonecharges (zcID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,";
$sSQL.="zcZone INT DEFAULT 0,";
$sSQL.="zcWeight DOUBLE DEFAULT 0,";
$sSQL.="zcRate DOUBLE DEFAULT 0,";
$sSQL.="zcRate2 DOUBLE DEFAULT 0,";
$sSQL.="zcRate3 DOUBLE DEFAULT 0,";
$sSQL.="zcRate4 DOUBLE DEFAULT 0,";
$sSQL.="zcRate5 DOUBLE DEFAULT 0,";
$sSQL.="zcRatePC TINYINT(1) DEFAULT 0,";
$sSQL.="zcRatePC2 TINYINT(1) DEFAULT 0,";
$sSQL.="zcRatePC3 TINYINT(1) DEFAULT 0,";
$sSQL.="zcRatePC4 TINYINT(1) DEFAULT 0,";
$sSQL.="zcRatePC5 TINYINT(1) DEFAULT 0) ENGINE=" . $databaseengine;
ect_query($sSQL) or print_sql_error('zonecharges');

// Dumping admin table
$guessURL = str_replace('\\', '/', "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));
if(substr($guessURL, -1) != '/') $guessURL .= '/';

if(checktablecreated('admin')){
	ect_query("INSERT INTO admin (adminID,adminVersion,adminUser,adminPassword,adminEmail,adminStoreURL,adminProdsPerPage,adminShipping,adminCountry,adminZipCode,adminEmailConfirm,adminDelUncompleted,adminUSZones,adminUnits,adminStockManage,adminHandling,adminTweaks,adminDelCC,currLastUpdate) VALUES (1,'Ecommerce Plus " . $sVersion . "','mystore','50481f28d0f9c62842ad64b8985ab91c','you@yourstoreurl.com','" . escape_string($guessURL) . "',8,2,1,'YOURZIP',0,4,0,1,0,0,0,7,'" . date("Y-m-d H:i:s", time()-100000) . "')") or print_sql_error('');
	ect_query("UPDATE admin SET sideFilter=127,sideFilterText='&Attributes&Price&Sort Order&Per Page&Filter By',sideFilterText2='&Attributes&Price&Sort Order&Per Page&Filter By',sideFilterText3='&Attributes&Price&Sort Order&Per Page&Filter By'") or print_sql_error('');
}
if(checktablecreated('adminshipping')){
	$sSQL="INSERT INTO adminshipping (adminShipID,AusPostAPI,adminCanPostLogin,adminCanPostPass,adminCanPostUser,adminPacking,adminUSPSUser,smartPostHub,adminUPSUser,adminUPSpw,adminUPSAccess,adminUPSAccount,adminUPSNegotiated,FedexAccountNo,FedexMeter,FedexUserKey,FedexUserPwd,DHLSiteID,DHLSitePW,DHLAccountNo) VALUES (1," .
		"'','','','',0,'','','','','','',0,'','','','','','','')";
	ect_query($sSQL) or print_sql_error('');
}
// Audit log initial entry
if(checktablecreated('auditlog')){
	$sSQL="INSERT INTO auditlog (userID,eventType,eventDate,eventSuccess,eventOrigin,areaAffected) VALUES ('INSTALL','CREATELOG','" . date('Y-m-d H:i:s') . "',1,'','AUDITLOG')";
	ect_query($sSQL);
}
// Dumping cart table
if(checktablecreated('cart')){
	ect_query("INSERT INTO cart (cartID,cartSessionID,cartProdID,cartProdName,cartProdPrice,cartDateAdded,cartQuantity,cartOrderID,cartCompleted) VALUES (1,'935000845','pc001','#1 PC multimedia package',1200,'" . date("Y-m-d H:i:s", time()) . "',1,501,1)");
}
// Dumping cartoptions table
if(checktablecreated('cartoptions')){
	ect_query("INSERT INTO cartoptions (coID,coCartID,coOptID,coOptGroup,coCartOption,coPriceDiff) VALUES (1,1,23,'Processor','Intel Pentium IV 1.5GHz',25.5)");
	ect_query("INSERT INTO cartoptions (coID,coCartID,coOptID,coOptGroup,coCartOption,coPriceDiff) VALUES (2,1,28,'Hard Disk','60 Gigabytes',34)");
	ect_query("INSERT INTO cartoptions (coID,coCartID,coOptID,coOptGroup,coCartOption,coPriceDiff) VALUES (3,1,30,'Monitor','15\" Standard',0)");
	ect_query("INSERT INTO cartoptions (coID,coCartID,coOptID,coOptGroup,coCartOption,coPriceDiff) VALUES (4,1,35,'Network Card','Yes',15)");
}
// Dumping countries table
if(checktablecreated('countries')){
	$sSQL="INSERT INTO countries (countryID, countryName, countryName2, countryName3, countryEnabled, countryTax, countryOrder, countryZone, loadStates, countryLCID, countryCurrency, countryCode, countryCode3, countryNumCurrency, countryFreeShip, currSymbolText, currDecimalSep, currThousandsSep, currPostAmount, currDecimals, currSymbolHTML) VALUES
		(1, 'United States of America', 'United States of America', 'United States of America', 1, 0, 2, 1, 2, 'en_US', 'USD', 'US', 'USA', 840, 0, '$', '.', ',', 0, 2, '$'),
		(2, 'Canada', 'Canada', 'Canada', 1, 0, 0, 2, 2, 'en_CA', 'CAD', 'CA', 'CAN', 124, 0, 'CDN$ ', '.', ',', 0, 2, 'CDN$ '),
		(3, 'Afghanistan', 'Afghanistan', 'Afghanistan', 0, 0, 0, 4, 2, '', 'AFA', 'AF', 'AFG', 0, 0, 'AFA', ',', '.', 0, 2, 'AFA'),
		(4, 'Albania', 'Albania', 'Albania', 0, 0, 0, 4, 2, '', 'ALL', 'AL', 'ALB', 8, 0, 'ALL', ',', '.', 0, 2, 'ALL'),
		(5, 'Algeria', 'Algeria', 'Algeria', 0, 0, 0, 4, 2, '', 'DZD', 'DZ', 'DZA', 12, 0, 'DZD', ',', '.', 0, 2, 'DZD'),
		(6, 'Andorra', 'Andorra', 'Andorra', 0, 0, 0, 3, 2, '', 'EUR', 'AD', 'AND', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(7, 'Angola', 'Angola', 'Angola', 0, 0, 0, 4, 2, '', 'AOA', 'AO', 'AGO', 973, 0, 'AOA', ',', '.', 0, 2, 'AOA'),
		(8, 'Anguilla', 'Anguilla', 'Anguilla', 0, 0, 0, 4, 2, '', 'XCD', 'AI', 'AIA', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(10, 'Antigua and Barbuda', 'Antigua and Barbuda', 'Antigua and Barbuda', 0, 0, 0, 4, 2, '', 'XCD', 'AG', 'ATG', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(11, 'Argentina', 'Argentina', 'Argentina', 1, 0, 0, 2, 2, 'es_AR', 'ARS', 'AR', 'ARG', 32, 0, 'ARS', ',', '.', 0, 2, 'ARS'),
		(12, 'Armenia', 'Armenia', 'Armenia', 0, 0, 0, 4, 2, '', 'AMD', 'AM', 'ARM', 51, 0, 'AMD', ',', '.', 0, 2, 'AMD'),
		(13, 'Aruba', 'Aruba', 'Aruba', 0, 0, 0, 4, 2, '', 'AWG', 'AW', 'ABW', 533, 0, 'AWG', ',', '.', 0, 2, 'AWG'),
		(14, 'Australia', 'Australia', 'Australia', 1, 0, 0, 4, 2, 'en_AU', 'AUD', 'AU', 'AUS', 36, 0, 'AU$ ', '.', ',', 0, 2, 'AU$ '),
		(15, 'Austria', 'Austria', 'Austria', 1, 0, 0, 3, 2, 'de_AT', 'EUR', 'AT', 'AUT', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(16, 'Azerbaijan', 'Azerbaijan', 'Azerbaijan', 0, 0, 0, 4, 2, '', 'AZM', 'AZ', 'AZE', 0, 0, 'AZM', ',', '.', 0, 2, 'AZM'),
		(17, 'Bahamas', 'Bahamas', 'Bahamas', 1, 0, 0, 4, 2, 'en_US', 'BSD', 'BS', 'BHS', 44, 0, 'BSD', ',', '.', 0, 2, 'BSD'),
		(18, 'Bahrain', 'Bahrain', 'Bahrain', 0, 0, 0, 4, 2, '', 'BHD', 'BH', 'BHR', 48, 0, 'BHD', ',', '.', 0, 2, 'BHD'),
		(19, 'Bangladesh', 'Bangladesh', 'Bangladesh', 0, 0, 0, 4, 2, '', 'BDT', 'BD', 'BGD', 50, 0, 'BDT', '.', ',', 0, 2, 'BDT'),
		(20, 'Barbados', 'Barbados', 'Barbados', 0, 0, 0, 4, 2, '', 'BBD', 'BB', 'BRB', 52, 0, 'BBD', ',', '.', 0, 2, 'BBD'),
		(21, 'Belarus', 'Belarus', 'Belarus', 0, 0, 0, 4, 2, '', 'BYR', 'BY', 'BLR', 974, 0, 'BYR', ',', '.', 0, 2, 'BYR'),
		(22, 'Belgium', 'Belgium', 'Belgium', 1, 0, 0, 3, 2, 'fr_BE', 'EUR', 'BE', 'BEL', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(23, 'Belize', 'Belize', 'Belize', 0, 0, 0, 4, 2, '', 'BZD', 'BZ', 'BLZ', 84, 0, 'BZD', ',', '.', 0, 2, 'BZD'),
		(24, 'Benin', 'Benin', 'Benin', 0, 0, 0, 4, 2, '', 'XOF', 'BJ', 'BEN', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(25, 'Bermuda', 'Bermuda', 'Bermuda', 0, 0, 0, 4, 2, '', 'BMD', 'BM', 'BMU', 60, 0, 'BMD', ',', '.', 0, 2, 'BMD'),
		(26, 'Bhutan', 'Bhutan', 'Bhutan', 0, 0, 0, 4, 2, '', 'BTN', 'BT', 'BTN', 64, 0, 'BTN', ',', '.', 0, 2, 'BTN'),
		(27, 'Bolivia', 'Bolivia', 'Bolivia', 0, 0, 0, 2, 2, '', 'BOB', 'BO', 'BOL', 68, 0, 'BOB', ',', '.', 0, 2, 'BOB'),
		(28, 'Bosnia-Herzegovina', 'Bosnia-Herzegovina', 'Bosnia-Herzegovina', 0, 0, 0, 4, 2, '', 'BAM', 'BA', 'BIH', 977, 0, 'BAM', ',', '.', 0, 2, 'BAM'),
		(29, 'Botswana', 'Botswana', 'Botswana', 0, 0, 0, 4, 2, '', 'BWP', 'BW', 'BWA', 72, 0, 'BWP', '.', ',', 0, 2, 'BWP'),
		(30, 'Brazil', 'Brazil', 'Brazil', 1, 0, 0, 2, 2, 'pt_BR', 'BRL', 'BR', 'BRA', 986, 0, 'R$', ',', '.', 0, 2, 'R$'),
		(31, 'Brunei Darussalam', 'Brunei Darussalam', 'Brunei Darussalam', 0, 0, 0, 4, 2, '', 'BND', 'BN', 'BRN', 96, 0, 'BND', '.', ',', 0, 2, 'BND'),
		(32, 'Bulgaria', 'Bulgaria', 'Bulgaria', 0, 0, 0, 4, 2, '', 'BGN', 'BG', 'BGR', 975, 0, 'BGN', ',', '.', 0, 2, 'BGN'),
		(33, 'Burkina Faso', 'Burkina Faso', 'Burkina Faso', 0, 0, 0, 4, 2, '', 'XOF', 'BF', 'BFA', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(34, 'Burundi', 'Burundi', 'Burundi', 0, 0, 0, 4, 2, '', 'BIF', 'BI', 'BDI', 108, 0, 'BIF', ',', '.', 0, 2, 'BIF'),
		(35, 'Cambodia', 'Cambodia', 'Cambodia', 0, 0, 0, 4, 2, '', 'KHR', 'KH', 'KHM', 116, 0, 'KHR', '.', ',', 0, 2, 'KHR'),
		(36, 'Cameroon', 'Cameroon', 'Cameroon', 0, 0, 0, 4, 2, '', 'XAF', 'CM', 'CMR', 950, 0, 'XAF', ',', '.', 0, 2, 'XAF'),
		(37, 'Cape Verde', 'Cape Verde', 'Cape Verde', 0, 0, 0, 4, 2, '', 'CVE', 'CV', 'CPV', 132, 0, 'CVE', ',', '.', 0, 2, 'CVE'),
		(38, 'Cayman Islands', 'Cayman Islands', 'Cayman Islands', 0, 0, 0, 4, 2, '', 'KYD', 'KY', 'CYM', 136, 0, 'KYD', ',', '.', 0, 2, 'KYD'),
		(39, 'Central African Republic', 'Central African Republic', 'Central African Republic', 0, 0, 0, 4, 2, '', 'XAF', 'CF', 'CAF', 950, 0, 'XAF', ',', '.', 0, 2, 'XAF'),
		(40, 'Chad', 'Chad', 'Chad', 0, 0, 0, 4, 2, '', 'XAF', 'TD', 'TCD', 950, 0, 'XAF', ',', '.', 0, 2, 'XAF'),
		(41, 'Chile', 'Chile', 'Chile', 1, 0, 0, 2, 2, 'es_CL', 'CLP', 'CL', 'CHL', 152, 0, 'CLP', ',', '.', 0, 2, 'CLP'),
		(42, 'China', 'China', 'China', 0, 0, 0, 4, 2, 'zh_CN', 'CNY', 'CN', 'CHN', 156, 0, 'CNY', '.', ',', 0, 2, 'CNY'),
		(43, 'Colombia', 'Colombia', 'Colombia', 0, 0, 0, 2, 2, 'es_CO', 'COP', 'CO', 'COL', 170, 0, 'COP', ',', '.', 0, 2, 'COP'),
		(44, 'Comoros', 'Comoros', 'Comoros', 0, 0, 0, 4, 2, '', 'KMF', 'KM', 'COM', 174, 0, 'KMF', ',', '.', 0, 2, 'KMF'),
		(45, 'Costa Rica', 'Costa Rica', 'Costa Rica', 1, 0, 0, 2, 2, 'es_CR', 'CRC', 'CR', 'CRI', 188, 0, 'CRC', ',', '.', 0, 2, 'CRC'),
		(46, 'Croatia', 'Croatia', 'Croatia', 0, 0, 0, 4, 2, 'hr_HR', 'HRK', 'HR', 'HRV', 191, 0, 'HRK', ',', '.', 0, 2, 'HRK'),
		(47, 'Cuba', 'Cuba', 'Cuba', 0, 0, 0, 4, 2, '', 'CUP', 'CU', 'CUB', 192, 0, 'CUP', ',', '.', 0, 2, 'CUP'),
		(48, 'Cyprus', 'Cyprus', 'Cyprus', 0, 0, 0, 4, 2, 'el_CY', 'EUR', 'CY', 'CYP', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(49, 'Czech Republic', 'Czech Republic', 'Czech Republic', 0, 0, 0, 4, 2, 'cs_CZ', 'CZK', 'CZ', 'CZE', 203, 0, 'CZK', ',', '.', 0, 2, 'CZK'),
		(50, 'Denmark', 'Denmark', 'Denmark', 1, 0, 0, 3, 2, 'da_DK', 'DKK', 'DK', 'DNK', 208, 0, 'DKK', ',', '.', 0, 2, 'DKK'),
		(51, 'Djibouti', 'Djibouti', 'Djibouti', 0, 0, 0, 4, 2, '', 'DJF', 'DJ', 'DJI', 262, 0, 'DJF', ',', '.', 0, 2, 'DJF'),
		(52, 'Dominica', 'Dominica', 'Dominica', 0, 0, 0, 4, 2, '', 'XCD', 'DM', 'DMA', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(53, 'Dominican Republic', 'Dominican Republic', 'Dominican Republic', 1, 0, 0, 4, 2, '', 'DOP', 'DO', 'DOM', 214, 0, 'DOP', '.', ',', 0, 2, 'DOP'),
		(54, 'East Timor', 'East Timor', 'East Timor', 0, 0, 0, 4, 2, '', 'IDR', 'TP', '', 360, 0, 'IDR', ',', '.', 0, 2, 'IDR'),
		(55, 'Ecuador', 'Ecuador', 'Ecuador', 0, 0, 0, 4, 2, 'es_EC', 'USD', 'EC', 'ECU', 840, 0, '$', ',', '.', 0, 2, '$'),
		(56, 'Egypt', 'Egypt', 'Egypt', 0, 0, 0, 4, 2, '', 'EGP', 'EG', 'EGY', 818, 0, 'EGP', '.', ',', 0, 2, 'EGP'),
		(57, 'El Salvador', 'El Salvador', 'El Salvador', 0, 0, 0, 2, 2, 'es_SV', 'USD', 'SV', 'SLV', 840, 0, '$', '.', ',', 0, 2, '$'),
		(58, 'Equatorial Guinea', 'Equatorial Guinea', 'Equatorial Guinea', 0, 0, 0, 4, 2, '', 'XAF', 'GQ', 'GNQ', 950, 0, 'XAF', ',', '.', 0, 2, 'XAF'),
		(59, 'Estonia', 'Estonia', 'Estonia', 0, 0, 0, 4, 2, 'et_EE', 'EEK', 'EE', 'EST', 233, 0, 'EEK', ',', '.', 0, 2, 'EEK'),
		(60, 'Ethiopia', 'Ethiopia', 'Ethiopia', 0, 0, 0, 4, 2, '', 'ETB', 'ET', 'ETH', 230, 0, 'ETB', ',', '.', 0, 2, 'ETB'),
		(61, 'Falkland Islands', 'Falkland Islands', 'Falkland Islands', 0, 0, 0, 4, 2, '', 'FKP', 'FK', 'FLK', 238, 0, 'FKP', ',', '.', 0, 2, 'FKP'),
		(62, 'Faroe Islands', 'Faroe Islands', 'Faroe Islands', 0, 0, 0, 4, 2, 'fo_FO', 'DKK', 'FO', 'FRO', 208, 0, 'DKK', ',', '.', 0, 2, 'DKK'),
		(63, 'Fiji', 'Fiji', 'Fiji', 0, 0, 0, 4, 2, '', 'FJD', 'FJ', 'FJI', 242, 0, 'FJD', ',', '.', 0, 2, 'FJD'),
		(64, 'Finland', 'Finland', 'Finland', 1, 0, 0, 3, 2, 'su_FI', 'EUR', 'FI', 'FIN', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(65, 'France', 'France', 'France', 1, 0, 0, 3, 2, 'fr_FR', 'EUR', 'FR', 'FRA', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(66, 'French Guiana', 'French Guiana', 'French Guiana', 0, 0, 0, 4, 2, '', 'EUR', 'GF', 'GUF', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(67, 'French Polynesia', 'French Polynesia', 'French Polynesia', 0, 0, 0, 4, 2, '', 'XPF', 'PF', 'PYF', 953, 0, 'XPF', ',', '.', 0, 2, 'XPF'),
		(68, 'Gabon', 'Gabon', 'Gabon', 0, 0, 0, 4, 2, '', 'XAF', 'GA', 'GAB', 950, 0, 'XAF', ',', '.', 0, 2, 'XAF'),
		(69, 'Gambia', 'Gambia', 'Gambia', 0, 0, 0, 4, 2, '', 'GMD', 'GM', 'GMB', 270, 0, 'GMD', ',', '.', 0, 2, 'GMD'),
		(70, 'Georgia, Republic of', 'Georgia, Republic of', 'Georgia, Republic of', 0, 0, 0, 4, 2, 'ka_GE', 'GEL', 'GE', 'GEO', 981, 0, 'GEL', ',', '.', 0, 2, 'GEL'),
		(71, 'Germany', 'Germany', 'Germany', 1, 0, 0, 3, 2, 'de_DE', 'EUR', 'DE', 'DEU', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(72, 'Ghana', 'Ghana', 'Ghana', 0, 0, 0, 4, 2, '', 'GHC', 'GH', 'GHA', 0, 0, 'GHC', '.', ',', 0, 2, 'GHC'),
		(73, 'Gibraltar', 'Gibraltar', 'Gibraltar', 1, 0, 0, 3, 2, 'en_EN', 'GBP', 'GI', 'GIB', 826, 0, 'GBP', ',', '.', 0, 2, '&pound;'),
		(74, 'Greece', 'Greece', 'Greece', 1, 0, 0, 3, 2, 'el_GR', 'EUR', 'GR', 'GRC', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(75, 'Greenland', 'Greenland', 'Greenland', 1, 0, 0, 3, 2, 'kl_GL', 'DKK', 'GL', 'GRL', 208, 0, 'DKK', ',', '.', 0, 2, 'DKK'),
		(76, 'Grenada', 'Grenada', 'Grenada', 0, 0, 0, 4, 2, '', 'XCD', 'GD', 'GRD', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(77, 'Guadeloupe', 'Guadeloupe', 'Guadeloupe', 0, 0, 0, 4, 2, '', 'EUR', 'GP', 'GLP', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(78, 'Guam', 'Guam', 'Guam', 0, 0, 0, 1, 2, 'en_GU', 'USD', 'GU', 'GUM', 840, 0, '$', ',', '.', 0, 2, '$'),
		(79, 'Guatemala', 'Guatemala', 'Guatemala', 1, 0, 0, 2, 2, 'es_GT', 'GTQ', 'GT', 'GTM', 320, 0, 'GTQ', '.', ',', 0, 2, 'GTQ'),
		(80, 'Guinea', 'Guinea', 'Guinea', 0, 0, 0, 4, 2, '', 'GNF', 'GN', 'GIN', 324, 0, 'GNF', ',', '.', 0, 2, 'GNF'),
		(81, 'Guinea-Bissau', 'Guinea-Bissau', 'Guinea-Bissau', 0, 0, 0, 4, 2, '', 'XOF', 'GW', 'GNB', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(82, 'Guyana', 'Guyana', 'Guyana', 0, 0, 0, 2, 2, '', 'GYD', 'GY', 'GUY', 328, 0, 'GYD', ',', '.', 0, 2, 'GYD'),
		(83, 'Haiti', 'Haiti', 'Haiti', 0, 0, 0, 4, 2, '', 'USD', 'HT', 'HTI', 840, 0, '$', ',', '.', 0, 2, '$'),
		(84, 'Honduras', 'Honduras', 'Honduras', 0, 0, 0, 2, 2, 'es_HN', 'HNL', 'HN', 'HND', 340, 0, 'HNL', '.', ',', 0, 2, 'HNL'),
		(85, 'Hong Kong', 'Hong Kong', 'Hong Kong', 1, 0, 0, 4, 2, 'en_HK', 'HKD', 'HK', 'HKG', 344, 0, 'HK$', '.', ',', 0, 2, 'HK$'),
		(86, 'Hungary', 'Hungary', 'Hungary', 0, 0, 0, 4, 2, 'hu_HU', 'HUF', 'HU', 'HUN', 348, 0, 'HUF', ',', '.', 0, 2, 'HUF'),
		(87, 'Iceland', 'Iceland', 'Iceland', 1, 0, 0, 3, 2, 'is_IS', 'ISK', 'IS', 'ISL', 352, 0, 'ISK', ',', '.', 0, 2, 'ISK'),
		(88, 'India', 'India', 'India', 0, 0, 0, 4, 2, 'en_IN', 'INR', 'IN', 'IND', 356, 0, 'INR', '.', ',', 0, 2, 'INR'),
		(89, 'Indonesia', 'Indonesia', 'Indonesia', 0, 0, 0, 4, 2, 'id_ID', 'IDR', 'ID', 'IDN', 360, 0, 'IDR', ',', '.', 0, 2, 'IDR'),
		(90, 'Iraq', 'Iraq', 'Iraq', 0, 0, 0, 4, 2, 'ar_IQ', 'IQD', 'IQ', 'IRQ', 368, 0, 'IQD', ',', '.', 0, 2, 'IQD'),
		(91, 'Ireland', 'Ireland', 'Ireland', 1, 0, 0, 3, 2, 'en_IE', 'EUR', 'IE', 'IRL', 978, 0, 'EUR', '.', ',', 1, 2, '&euro;'),
		(92, 'Israel', 'Israel', 'Israel', 1, 0, 0, 4, 2, 'he_IL', 'ILS', 'IL', 'ISR', 376, 0, 'ILS', '.', ',', 0, 2, 'ILS'),
		(93, 'Italy', 'Italy', 'Italy', 1, 0, 0, 3, 2, 'it_IT', 'EUR', 'IT', 'ITA', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(94, 'Jamaica', 'Jamaica', 'Jamaica', 0, 0, 0, 4, 2, 'en_JM', 'JMD', 'JM', 'JAM', 388, 0, 'JMD', ',', '.', 0, 2, 'JMD'),
		(95, 'Japan', 'Japan', 'Japan', 1, 0, 0, 4, 2, 'jp_JP', 'JPY', 'JP', 'JPN', 392, 0, 'JPY', '.', ',', 0, 0, '&yen;'),
		(96, 'Jordan', 'Jordan', 'Jordan', 0, 0, 0, 4, 2, 'ar_JO', 'JOD', 'JO', 'JOR', 400, 0, 'JOD', '.', ',', 0, 2, 'JOD'),
		(97, 'Kazakhstan', 'Kazakhstan', 'Kazakhstan', 0, 0, 0, 4, 2, '', 'KZT', 'KZ', 'KAZ', 398, 0, 'KZT', ',', '.', 0, 2, 'KZT'),
		(98, 'Kenya', 'Kenya', 'Kenya', 0, 0, 0, 4, 2, '', 'KES', 'KE', 'KEN', 404, 0, 'KES', '.', ',', 0, 2, 'KES'),
		(99, 'Kiribati', 'Kiribati', 'Kiribati', 0, 0, 0, 4, 2, '', 'AUD', 'KI', 'KIR', 36, 0, 'AU$ ', ',', '.', 0, 2, 'AU$ '),
		(100, 'North Korea', 'North Korea', 'North Korea', 0, 0, 0, 4, 2, 'ko_KR', 'KPW', 'KP', 'PRK', 408, 0, 'KPW', '.', ',', 0, 2, 'KPW'),
		(101, 'South Korea', 'South Korea', 'South Korea', 0, 0, 0, 4, 2, 'ko_KR', 'KRW', 'KR', 'KOR', 410, 0, 'KRW', '.', ',', 0, 2, 'KRW'),
		(102, 'Kuwait', 'Kuwait', 'Kuwait', 0, 0, 0, 4, 2, 'ar_KW', 'KWD', 'KW', 'KWT', 414, 0, 'KWD', ',', '.', 0, 2, 'KWD'),
		(103, 'Latvia', 'Latvia', 'Latvia', 0, 0, 0, 4, 2, 'lv_LV', 'LVL', 'LV', 'LVA', 428, 0, 'LVL', ',', '.', 0, 2, 'LVL'),
		(104, 'Lebanon', 'Lebanon', 'Lebanon', 0, 0, 0, 4, 2, 'ar_LB', 'LBP', 'LB', 'LBN', 422, 0, 'LBP', '.', ',', 0, 2, 'LBP'),
		(105, 'Lesotho', 'Lesotho', 'Lesotho', 0, 0, 0, 4, 2, 'st_LS', 'LSL', 'LS', 'LSO', 426, 0, 'LSL', ',', '.', 0, 2, 'LSL'),
		(106, 'Liberia', 'Liberia', 'Liberia', 0, 0, 0, 4, 2, '', 'LRD', 'LR', 'LBR', 430, 0, 'LRD', ',', '.', 0, 2, 'LRD'),
		(107, 'England', 'England', 'England', 0, 0, 0, 3, 2, '', 'GBP', 'GB', 'GBR', 826, 0, 'GBP', '.', ',', 0, 2, '&pound;'),
		(108, 'Liechtenstein', 'Liechtenstein', 'Liechtenstein', 0, 0, 0, 4, 2, 'de_LI', 'CHF', 'LI', 'LIE', 756, 0, 'CHF', ',', '.', 0, 2, 'CHF'),
		(109, 'Lithuania', 'Lithuania', 'Lithuania', 0, 0, 0, 4, 2, 'lt_LT', 'LTL', 'LT', 'LTU', 440, 0, 'LTL', ',', '.', 0, 2, 'LTL'),
		(110, 'Luxembourg', 'Luxembourg', 'Luxembourg', 1, 0, 0, 3, 2, 'de_LU', 'EUR', 'LU', 'LUX', 978, 0, 'EUR', '.', ',', 1, 2, '&euro;'),
		(111, 'Macao', 'Macao', 'Macao', 0, 0, 0, 4, 2, '', 'MOP', 'MO', 'MAC', 446, 0, 'MOP', '.', ',', 0, 2, 'MOP'),
		(112, 'Macedonia, Republic of', 'Macedonia, Republic of', 'Macedonia, Republic of', 0, 0, 0, 4, 2, 'mk_MK', 'MKD', 'MK', 'MKD', 807, 0, 'MKD', ',', '.', 0, 2, 'MKD'),
		(113, 'Madagascar', 'Madagascar', 'Madagascar', 0, 0, 0, 4, 2, '', 'MGF', 'MG', 'MDG', 0, 0, 'MGF', ',', '.', 0, 2, 'MGF'),
		(114, 'Malawi', 'Malawi', 'Malawi', 0, 0, 0, 4, 2, '', 'MWK', 'MW', 'MWI', 454, 0, 'MWK', ',', '.', 0, 2, 'MWK'),
		(115, 'Malaysia', 'Malaysia', 'Malaysia', 1, 0, 0, 4, 2, 'ms_MY', 'MYR', 'MY', 'MYS', 458, 0, 'MYR', '.', ',', 0, 2, 'MYR'),
		(116, 'Maldives', 'Maldives', 'Maldives', 0, 0, 0, 4, 2, 'dv_MV', 'MVR', 'MV', 'MDV', 462, 0, 'MVR', ',', '.', 0, 2, 'MVR'),
		(117, 'Mali', 'Mali', 'Mali', 0, 0, 0, 4, 2, '', 'XOF', 'ML', 'MLI', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(118, 'Malta', 'Malta', 'Malta', 0, 0, 0, 4, 2, 'en_MT', 'EUR', 'MT', 'MLT', 978, 0, 'EUR', '.', ',', 1, 2, '&euro;'),
		(119, 'Martinique', 'Martinique', 'Martinique', 0, 0, 0, 4, 2, '', 'EUR', 'MQ', 'MTQ', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(120, 'Mauritania', 'Mauritania', 'Mauritania', 0, 0, 0, 4, 2, '', 'MRO', 'MR', 'MRT', 478, 0, 'MRO', ',', '.', 0, 2, 'MRO'),
		(121, 'Mauritius', 'Mauritius', 'Mauritius', 0, 0, 0, 4, 2, '', 'MUR', 'MU', 'MUS', 480, 0, 'MUR', ',', '.', 0, 2, 'MUR'),
		(122, 'Mexico', 'Mexico', 'Mexico', 1, 0, 0, 2, 2, 'es_MX', 'MXN', 'MX', 'MEX', 484, 0, 'MXN', '.', ',', 0, 2, 'MXN'),
		(123, 'Moldova', 'Moldova', 'Moldova', 0, 0, 0, 4, 2, 'ro_MD', 'MDL', 'MD', 'MDA', 498, 0, 'MDL', ',', '.', 0, 2, 'MDL'),
		(124, 'Monaco', 'Monaco', 'Monaco', 1, 0, 0, 3, 2, 'fr_MC', 'EUR', 'MC', 'MCO', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(125, 'Mongolia', 'Mongolia', 'Mongolia', 0, 0, 0, 4, 2, 'mn_CN', 'MNT', 'MN', 'MNG', 496, 0, 'MNT', '.', ',', 0, 2, 'MNT'),
		(126, 'Montserrat', 'Montserrat', 'Montserrat', 0, 0, 0, 4, 2, '', 'XCD', 'MS', 'MSR', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(127, 'Morocco', 'Morocco', 'Morocco', 0, 0, 0, 4, 2, 'ar_MA', 'MAD', 'MA', 'MAR', 504, 0, 'MAD', ',', '.', 0, 2, 'MAD'),
		(128, 'Mozambique', 'Mozambique', 'Mozambique', 0, 0, 0, 4, 2, '', 'MZM', 'MZ', 'MOZ', 0, 0, 'MZM', ',', '.', 0, 2, 'MZM'),
		(129, 'Myanmar', 'Myanmar', 'Myanmar', 0, 0, 0, 4, 2, '', 'MMK', 'MM', 'MMR', 104, 0, 'MMK', '.', ',', 0, 2, 'MMK'),
		(130, 'Namibia', 'Namibia', 'Namibia', 0, 0, 0, 4, 2, '', 'NAD', 'NA', 'NAM', 516, 0, 'NAD', ',', '.', 0, 2, 'NAD'),
		(131, 'Nauru', 'Nauru', 'Nauru', 0, 0, 0, 4, 2, '', 'AUD', 'NR', 'NRU', 36, 0, 'AU$ ', ',', '.', 0, 2, 'AU$ '),
		(132, 'Nepal', 'Nepal', 'Nepal', 0, 0, 0, 4, 2, 'ne_NP', 'NPR', 'NP', 'NPL', 524, 0, 'NPR', '.', ',', 0, 2, 'NPR'),
		(133, 'Netherlands', 'Netherlands', 'Netherlands', 1, 0, 0, 3, 2, 'nl_NL', 'EUR', 'NL', 'NLD', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(134, 'Netherlands Antilles', 'Netherlands Antilles', 'Netherlands Antilles', 0, 0, 0, 4, 2, '', 'ANG', 'AN', '', 532, 0, 'ANG', ',', '.', 0, 2, 'ANG'),
		(135, 'New Caledonia', 'New Caledonia', 'New Caledonia', 0, 0, 0, 4, 2, '', 'XPF', 'NC', 'NCL', 953, 0, 'XPF', ',', '.', 0, 2, 'XPF'),
		(136, 'New Zealand', 'New Zealand', 'New Zealand', 1, 0, 0, 4, 2, 'en_NZ', 'NZD', 'NZ', 'NZL', 554, 0, 'NZ$', '.', ',', 0, 2, 'NZ$'),
		(137, 'Nicaragua', 'Nicaragua', 'Nicaragua', 0, 0, 0, 2, 2, '', 'NIO', 'NI', 'NIC', 558, 0, 'NIO', '.', ',', 0, 2, 'NIO'),
		(138, 'Niger', 'Niger', 'Niger', 0, 0, 0, 4, 2, '', 'XOF', 'NE', 'NER', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(139, 'Nigeria', 'Nigeria', 'Nigeria', 0, 0, 0, 4, 2, '', 'NGN', 'NG', 'NGA', 566, 0, 'NGN', '.', ',', 0, 2, 'NGN'),
		(140, 'Niue', 'Niue', 'Niue', 0, 0, 0, 4, 2, '', 'NZD', 'NU', 'NIU', 554, 0, 'NZ$', ',', '.', 0, 2, 'NZ$'),
		(141, 'Norfolk Island', 'Norfolk Island', 'Norfolk Island', 0, 0, 0, 4, 2, '', 'AUD', 'NF', 'NFK', 36, 0, 'AU$ ', ',', '.', 0, 2, 'AU$ '),
		(142, 'Northern Ireland', 'Northern Ireland', 'Northern Ireland', 1, 0, 0, 3, 2, 'en_GB', 'GBP', 'GB', 'GBR', 826, 0, 'GBP', '.', ',', 0, 2, '&pound;'),
		(143, 'Norway', 'Norway', 'Norway', 1, 0, 0, 3, 2, 'no_NO', 'NOK', 'NO', 'NOR', 578, 0, 'NOK', ',', '.', 0, 2, 'NOK'),
		(144, 'Oman', 'Oman', 'Oman', 0, 0, 0, 4, 2, 'ar_OM', 'OMR', 'OM', 'OMN', 512, 0, 'OMR', ',', '.', 0, 2, 'OMR'),
		(145, 'Pakistan', 'Pakistan', 'Pakistan', 0, 0, 0, 4, 2, 'en_PK', 'PKR', 'PK', 'PAK', 586, 0, 'PKR', '.', ',', 0, 2, 'PKR'),
		(146, 'Panama', 'Panama', 'Panama', 1, 0, 0, 2, 2, 'es_PA', 'PAB', 'PA', 'PAN', 590, 0, 'PAB', '.', ',', 0, 2, 'PAB'),
		(147, 'Papua New Guinea', 'Papua New Guinea', 'Papua New Guinea', 0, 0, 0, 4, 2, '', 'PGK', 'PG', 'PNG', 598, 0, 'PGK', ',', '.', 0, 2, 'PGK'),
		(148, 'Paraguay', 'Paraguay', 'Paraguay', 0, 0, 0, 4, 2, '', 'PYG', 'PY', 'PRY', 600, 0, 'PYG', ',', '.', 0, 2, 'PYG'),
		(149, 'Peru', 'Peru', 'Peru', 0, 0, 0, 2, 2, 'es_PE', 'PEN', 'PE', 'PER', 604, 0, 'PEN', ',', '.', 0, 2, 'PEN'),
		(150, 'Philippines', 'Philippines', 'Philippines', 0, 0, 0, 4, 2, 'en_PH', 'PHP', 'PH', 'PHL', 608, 0, 'PHP', '.', ',', 0, 2, 'PHP'),
		(151, 'Pitcairn Island', 'Pitcairn Island', 'Pitcairn Island', 0, 0, 0, 4, 2, '', 'NZD', 'PN', 'PCN', 554, 0, 'NZ$', ',', '.', 0, 2, 'NZ$'),
		(152, 'Poland', 'Poland', 'Poland', 0, 0, 0, 4, 2, 'pl_PL', 'PLN', 'PL', 'POL', 985, 0, 'PLN', ',', '.', 0, 2, 'PLN'),
		(153, 'Portugal', 'Portugal', 'Portugal', 1, 0, 0, 3, 2, 'pt_PT', 'EUR', 'PT', 'PRT', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(154, 'Qatar', 'Qatar', 'Qatar', 0, 0, 0, 4, 2, 'ar_QA', 'QAR', 'QA', 'QAT', 634, 0, 'QAR', ',', '.', 0, 2, 'QAR'),
		(155, 'Reunion', 'Reunion', 'Reunion', 0, 0, 0, 4, 2, '', 'EUR', 'RE', 'REU', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(156, 'Romania', 'Romania', 'Romania', 0, 0, 0, 4, 2, 'ro_RO', 'RON', 'RO', 'ROU', 946, 0, 'RON', ',', '.', 0, 2, 'RON'),
		(157, 'Russia', 'Russia', 'Russia', 0, 0, 0, 4, 2, 'ru_RU', 'RUB', 'RU', 'RUS', 643, 0, 'RUB', ',', '.', 0, 2, 'RUB'),
		(158, 'Rwanda', 'Rwanda', 'Rwanda', 0, 0, 0, 4, 2, '', 'RWF', 'RW', 'RWA', 646, 0, 'RWF', ',', '.', 0, 2, 'RWF'),
		(159, 'Saint Kitts', 'Saint Kitts', 'Saint Kitts', 0, 0, 0, 4, 2, '', 'XCD', 'KN', 'KNA', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(160, 'Saint Lucia', 'Saint Lucia', 'Saint Lucia', 0, 0, 0, 4, 2, '', 'XCD', 'LC', 'LCA', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(161, 'Saint Vincent and the Grenadines', 'Saint Vincent and the Grenadines', 'Saint Vincent and the Grenadines', 0, 0, 0, 4, 2, '', 'XCD', 'VC', 'VCT', 951, 0, 'XCD', ',', '.', 0, 2, 'XCD'),
		(162, 'Western Samoa', 'Western Samoa', 'Western Samoa', 0, 0, 0, 4, 2, '', 'WST', 'WS', 'WSM', 882, 0, 'WST', ',', '.', 0, 2, 'WST'),
		(163, 'San Marino', 'San Marino', 'San Marino', 0, 0, 0, 4, 2, '', 'EUR', 'SM', 'SMR', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(164, 'Sao Tome and Principe', 'Sao Tome and Principe', 'Sao Tome and Principe', 0, 0, 0, 4, 2, '', 'STD', 'ST', 'STP', 678, 0, 'STD', ',', '.', 0, 2, 'STD'),
		(165, 'Saudi Arabia', 'Saudi Arabia', 'Saudi Arabia', 0, 0, 0, 4, 2, 'ar_SA', 'SAR', 'SA', 'SAU', 682, 0, 'SAR', ',', '.', 0, 2, 'SAR'),
		(166, 'Senegal', 'Senegal', 'Senegal', 0, 0, 0, 4, 2, '', 'XOF', 'SN', 'SEN', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(167, 'Seychelles', 'Seychelles', 'Seychelles', 0, 0, 0, 4, 2, '', 'SCR', 'SC', 'SYC', 690, 0, 'SCR', ',', '.', 0, 2, 'SCR'),
		(168, 'Sierra Leone', 'Sierra Leone', 'Sierra Leone', 0, 0, 0, 4, 2, '', 'SLL', 'SL', 'SLE', 694, 0, 'SLL', ',', '.', 0, 2, 'SLL'),
		(169, 'Singapore', 'Singapore', 'Singapore', 1, 0, 0, 4, 2, 'en_SG', 'SGD', 'SG', 'SGP', 702, 0, 'SGD', '.', ',', 0, 2, 'SGD'),
		(170, 'Slovak Republic', 'Slovak Republic', 'Slovak Republic', 0, 0, 0, 4, 2, '', 'SKK', 'SK', 'SVK', 0, 0, 'SKK', ',', '.', 0, 2, 'SKK'),
		(171, 'Slovenia', 'Slovenia', 'Slovenia', 0, 0, 0, 4, 2, 'sl_SI', 'EUR', 'SI', 'SVN', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(172, 'Solomon Islands', 'Solomon Islands', 'Solomon Islands', 0, 0, 0, 4, 2, '', 'SBD', 'SB', 'SLB', 90, 0, 'SBD', ',', '.', 0, 2, 'SBD'),
		(173, 'Somalia', 'Somalia', 'Somalia', 0, 0, 0, 4, 2, '', 'SOS', 'SO', 'SOM', 706, 0, 'SOS', ',', '.', 0, 2, 'SOS'),
		(174, 'South Africa', 'South Africa', 'South Africa', 0, 0, 0, 4, 2, 'en_ZA', 'ZAR', 'ZA', 'ZAF', 710, 0, 'ZAR', ',', '.', 0, 2, 'ZAR'),
		(175, 'Spain', 'Spain', 'Spain', 1, 0, 0, 3, 2, 'es_ES', 'EUR', 'ES', 'ESP', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(176, 'Sri Lanka', 'Sri Lanka', 'Sri Lanka', 0, 0, 0, 4, 2, 'si_LK', 'LKR', 'LK', 'LKA', 144, 0, 'LKR', '.', ',', 0, 2, 'LKR'),
		(177, 'Saint Helena', 'Saint Helena', 'Saint Helena', 0, 0, 0, 4, 2, '', 'SHP', 'SH', 'SHN', 654, 0, 'SHP', ',', '.', 0, 2, 'SHP'),
		(178, 'Saint Pierre and Miquelon', 'Saint Pierre and Miquelon', 'Saint Pierre and Miquelon', 0, 0, 0, 4, 2, '', 'EUR', 'PM', 'SPM', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(179, 'Sudan', 'Sudan', 'Sudan', 0, 0, 0, 4, 2, 'ar_SD', 'SDD', 'SD', 'SDN', 0, 0, 'SDD', ',', '.', 0, 2, 'SDD'),
		(180, 'Suriname', 'Suriname', 'Suriname', 0, 0, 0, 4, 2, '', 'SRG', 'SR', 'SUR', 0, 0, 'SRG', ',', '.', 0, 2, 'SRG'),
		(181, 'Swaziland', 'Swaziland', 'Swaziland', 0, 0, 0, 4, 2, '', 'SZL', 'SZ', 'SWZ', 748, 0, 'SZL', ',', '.', 0, 2, 'SZL'),
		(182, 'Sweden', 'Sweden', 'Sweden', 1, 0, 0, 3, 2, 'sv_SE', 'SEK', 'SE', 'SWE', 752, 0, 'SEK', ',', '.', 0, 2, 'SEK'),
		(183, 'Switzerland', 'Switzerland', 'Switzerland', 1, 0, 0, 3, 2, 'fr_CH', 'CHF', 'CH', 'CHE', 756, 0, 'CHF', '.', ',', 0, 2, 'CHF'),
		(184, 'Syrian Arab Republic', 'Syrian Arab Republic', 'Syrian Arab Republic', 0, 0, 0, 4, 2, 'ar_SY', 'SYP', 'SY', 'SYR', 760, 0, 'SYP', ',', '.', 0, 2, 'SYP'),
		(185, 'Taiwan', 'Taiwan', 'Taiwan', 1, 0, 0, 4, 2, 'zh_TW', 'TWD', 'TW', 'TWN', 901, 0, 'TWD', '.', ',', 0, 0, 'TWD'),
		(186, 'Tajikistan', 'Tajikistan', 'Tajikistan', 0, 0, 0, 4, 2, 'tg_TJ', 'TJS', 'TJ', 'TJK', 972, 0, 'TJS', ',', '.', 0, 2, 'TJS'),
		(187, 'Tanzania', 'Tanzania', 'Tanzania', 0, 0, 0, 4, 2, '', 'TZS', 'TZ', 'TZA', 834, 0, 'TZS', '.', ',', 0, 2, 'TZS'),
		(188, 'Thailand', 'Thailand', 'Thailand', 1, 0, 0, 4, 2, 'th_TH', 'THB', 'TH', 'THA', 764, 0, 'THB', '.', ',', 0, 2, 'THB'),
		(189, 'Togo', 'Togo', 'Togo', 0, 0, 0, 4, 2, 'ee_TG', 'XOF', 'TG', 'TGO', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(190, 'Tokelau', 'Tokelau', 'Tokelau', 0, 0, 0, 4, 2, '', 'NZD', 'TK', 'TKL', 554, 0, 'NZ$', ',', '.', 0, 2, 'NZ$'),
		(191, 'Tonga', 'Tonga', 'Tonga', 0, 0, 0, 4, 2, 'to_TO', 'TOP', 'TO', 'TON', 776, 0, 'TOP', ',', '.', 0, 2, 'TOP'),
		(192, 'Trinidad and Tobago', 'Trinidad and Tobago', 'Trinidad and Tobago', 0, 0, 0, 4, 2, 'en_TT', 'TTD', 'TT', 'TTO', 780, 0, 'TTD', ',', '.', 0, 2, 'TTD'),
		(193, 'Tunisia', 'Tunisia', 'Tunisia', 0, 0, 0, 4, 2, 'ar_TN', 'TND', 'TN', 'TUN', 788, 0, 'TND', ',', '.', 0, 2, 'TND'),
		(194, 'Turkey', 'Turkey', 'Turkey', 0, 0, 0, 4, 2, 'tr_TR', 'TRY', 'TR', 'TUR', 949, 0, 'TRY', ',', '.', 0, 2, 'TRY'),
		(195, 'Turkmenistan', 'Turkmenistan', 'Turkmenistan', 0, 0, 0, 4, 2, '', 'TMM', 'TM', 'TKM', 0, 0, 'TMM', ',', '.', 0, 2, 'TMM'),
		(196, 'Turks and Caicos Islands', 'Turks and Caicos Islands', 'Turks and Caicos Islands', 0, 0, 0, 4, 2, '', 'USD', 'TC', 'TCA', 840, 0, '$', ',', '.', 0, 2, '$'),
		(197, 'Tuvalu', 'Tuvalu', 'Tuvalu', 0, 0, 0, 4, 2, '', 'TVD', 'TV', 'TUV', 0, 0, 'TVD', ',', '.', 0, 2, 'TVD'),
		(198, 'Uganda', 'Uganda', 'Uganda', 0, 0, 0, 4, 2, '', 'UGX', 'UG', 'UGA', 800, 0, 'UGX', '.', ',', 0, 2, 'UGX'),
		(199, 'Ukraine', 'Ukraine', 'Ukraine', 0, 0, 0, 4, 2, '', 'UAH', 'UA', 'UKR', 980, 0, 'UAH', ',', '.', 0, 2, 'UAH'),
		(200, 'United Arab Emirates', 'United Arab Emirates', 'United Arab Emirates', 0, 0, 0, 4, 2, 'ar_AE', 'AED', 'AE', 'ARE', 784, 0, 'AED', ',', '.', 0, 2, 'AED'),
		(201, 'Great Britain', 'Great Britain', 'Great Britain', 1, 0, 1, 3, 2, 'en_GB', 'GBP', 'GB', 'GBR', 826, 0, 'GBP', '.', ',', 0, 2, '&pound;'),
		(202, 'Uruguay', 'Uruguay', 'Uruguay', 0, 0, 0, 4, 2, 'es_UY', 'UYU', 'UY', 'URY', 858, 0, 'UYU', ',', '.', 0, 2, 'UYU'),
		(203, 'Uzbekistan', 'Uzbekistan', 'Uzbekistan', 0, 0, 0, 4, 2, 'uz_UZ', 'UZS', 'UZ', 'UZB', 860, 0, 'UZS', ',', '.', 0, 2, 'UZS'),
		(204, 'Vanuatu', 'Vanuatu', 'Vanuatu', 0, 0, 0, 4, 2, '', 'VUV', 'VU', 'VUT', 548, 0, 'VUV', ',', '.', 0, 2, 'VUV'),
		(205, 'Vatican City', 'Vatican City', 'Vatican City', 1, 0, 0, 3, 2, '', 'EUR', 'VA', 'VAT', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(206, 'Venezuela', 'Venezuela', 'Venezuela', 0, 0, 0, 2, 2, 'es_VE', 'VEF', 'VE', 'VEN', 937, 0, 'VEF', ',', '.', 0, 2, 'VEF'),
		(207, 'Vietnam', 'Vietnam', 'Vietnam', 0, 0, 0, 4, 2, 'vi_VN', 'VND', 'VN', 'VNM', 704, 0, 'VND', ',', '.', 0, 2, 'VND'),
		(208, 'British Virgin Islands', 'British Virgin Islands', 'British Virgin Islands', 0, 0, 0, 4, 2, 'en_VI', 'USD', 'VG', 'VGB', 840, 0, '$', ',', '.', 0, 2, '$'),
		(209, 'Wallis and Futuna Islands', 'Wallis and Futuna Islands', 'Wallis and Futuna Islands', 0, 0, 0, 4, 2, '', 'XPF', 'WF', 'WLF', 953, 0, 'XPF', ',', '.', 0, 2, 'XPF'),
		(210, 'Yemen', 'Yemen', 'Yemen', 0, 0, 0, 4, 2, 'ar_YE', 'YER', 'YE', 'YEM', 886, 0, 'YER', ',', '.', 0, 2, 'YER'),
		(211, 'Zambia', 'Zambia', 'Zambia', 0, 0, 0, 4, 2, '', 'ZMK', 'ZM', 'ZMB', 894, 0, 'ZMK', ',', '.', 0, 2, 'ZMK'),
		(212, 'Zimbabwe', 'Zimbabwe', 'Zimbabwe', 0, 0, 0, 4, 2, '', 'ZWD', 'ZW', 'ZWE', 0, 0, 'ZWD', '.', ',', 0, 2, 'ZWD'),
		(213, 'Iran', 'Iran', 'Iran', 0, 0, 0, 4, 2, 'fa_IR', 'IRR', 'IR', 'IRN', 364, 0, 'IRR', ',', '.', 0, 2, 'IRR'),
		(214, 'Channel Islands', 'Channel Islands', 'Channel Islands', 0, 0, 0, 3, 2, '', 'GBP', 'GB', 'GBR', 826, 0, 'GBP', '.', ',', 0, 2, '&pound;'),
		(215, 'Puerto Rico', 'Puerto Rico', 'Puerto Rico', 0, 0, 0, 3, 2, 'es_PR', 'USD', 'PR', 'PRI', 840, 0, '$', ',', '.', 0, 2, '$'),
		(216, 'Isle of Man', 'Isle of Man', 'Isle of Man', 0, 0, 0, 3, 2, '', 'GBP', 'GB', 'GBR', 826, 0, 'GBP', '.', ',', 0, 2, '&pound;'),
		(217, 'Azores', 'Azores', 'Azores', 0, 0, 0, 3, 2, '', 'EUR', 'PT', 'PRT', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(218, 'Corsica', 'Corsica', 'Corsica', 0, 0, 0, 3, 2, '', 'EUR', 'FR', 'FRA', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(219, 'Balearic Islands', 'Balearic Islands', 'Balearic Islands', 0, 0, 0, 3, 2, '', 'EUR', 'ES', 'ESP', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(221, 'Serbia', 'Serbia', 'Serbia', 0, 0, 0, 3, 2, 'sr_RS', 'RSD', 'RS', 'SRB', 941, 0, 'RSD', ',', '.', 0, 2, 'RSD'),
		(222, 'Ivory Coast', 'Ivory Coast', 'Ivory Coast', 0, 0, 0, 3, 2, '', 'XOF', 'CI', 'CIV', 952, 0, 'XOF', ',', '.', 0, 2, 'XOF'),
		(223, 'Montenegro', 'Montenegro', 'Montenegro', 0, 0, 0, 3, 2, '', 'EUR', 'ME', 'MNE', 978, 0, 'EUR', ',', '.', 1, 2, '&euro;'),
		(224, 'American Samoa', 'American Samoa', 'American Samoa', 0, 0, 0, 3, 2, 'en_AS', 'USD', 'AS', 'ASM', 840, 0, '$', ',', '.', 0, 2, '$'),
		(220, 'US Virgin Islands', 'US Virgin Islands', 'US Virgin Islands', 0, 0, 0, 3, 0, '', 'USD', 'VI', NULL, 0, 0, NULL, NULL, NULL, 0, 0, NULL);";
	ect_query($sSQL) or print_sql_error('');
}
// Email Messages table data
if(checktablecreated('emailmessages')){
	ect_query("INSERT INTO emailmessages (emailID) VALUES (1)") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertsubject='You received a gift certificate from %fromname%'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertemail='Hi %toname%, %fromname% has sent you a gift certificate to the value of %value%!<br />{Your friend left the following message: %message%}<br />To redeem your gift certificate, simply pop along to our online store at:<br />%storeurl%<br />Then select the goods you require and when checking out enter the gift certificate code below:<br />%certificateid%'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertsendersubject='You sent a gift certificate to %toname%'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertsender='You sent a gift certificate to %toname%.<br />Below is a copy of the email they will receive. You may want to check it was delivered.'") or print_sql_error('');

	ect_query("UPDATE emailmessages SET emailsubject='Thank you for your order'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET emailheaders='%emailmessage%<br />'") or print_sql_error('');

	ect_query("UPDATE emailmessages SET dropshipsubject='We have received the following order'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET dropshipheaders='%emailmessage%<br />'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET orderstatussubject='Order status updated'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET orderstatusemail='Dear %ordername%<br />Your order id %orderid% from %orderdate% has been updated from %oldstatus% to %newstatus% on %date%.<br />{Your tracking number is %trackingnum%<br />}{Additional Info: %statusinfo%<br />}'") or print_sql_error('');

	ect_query("UPDATE emailmessages SET notifystocksubject='We now have stock for %pname%',notifystockemail='The product %pid% / %pname% is now back in stock.%nl%%nl%You can find this in our store at the following location:%nl%%link%%nl%%nl%Many Thanks%nl%%nl%%storeurl%%nl%'") or print_sql_error('');
	
	ect_query("UPDATE emailmessages SET abandonedcartsubject='" . escape_string("Trouble purchasing from our store?") . "'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET abandonedcartemail='" . escape_string("You recently started, but did not complete an order at our store. If we can help in any way or if you are having trouble with your purchase then please let us know. If you would like to continue with your order you can do so by clicking the link below.%nl%%abandonedcartid%") . "'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET abandonedcartsubject2=abandonedcartsubject,abandonedcartsubject3=abandonedcartsubject,abandonedcartemail2=abandonedcartemail,abandonedcartemail3=abandonedcartemail") or print_sql_error('');

	ect_query("UPDATE emailmessages SET shiplineitemsubject='" . escape_string("Items shipped from our store") . "'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET shiplineitememail='" . escape_string("The following item has been shipped %pname%.") . "'") or print_sql_error('');
	ect_query("UPDATE emailmessages SET shiplineitemsubject2=shiplineitemsubject,shiplineitemsubject3=shiplineitemsubject,shiplineitememail2=shiplineitememail,shiplineitememail3=shiplineitememail") or print_sql_error('');

	ect_query("UPDATE emailmessages SET giftcertsubject3=giftcertsubject,giftcertsubject2=giftcertsubject") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertemail3=giftcertemail,giftcertemail2=giftcertemail") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertsendersubject3=giftcertsendersubject,giftcertsendersubject2=giftcertsendersubject") or print_sql_error('');
	ect_query("UPDATE emailmessages SET giftcertsender3=giftcertsender,giftcertsender2=giftcertsender") or print_sql_error('');
	ect_query("UPDATE emailmessages SET emailsubject3=emailsubject,emailsubject2=emailsubject") or print_sql_error('');
	ect_query("UPDATE emailmessages SET emailheaders3=emailheaders,emailheaders2=emailheaders") or print_sql_error('');
	ect_query("UPDATE emailmessages SET dropshipsubject3=dropshipsubject,dropshipsubject2=dropshipsubject") or print_sql_error('');
	ect_query("UPDATE emailmessages SET dropshipheaders3=dropshipheaders,dropshipheaders2=dropshipheaders") or print_sql_error('');
	ect_query("UPDATE emailmessages SET orderstatussubject3=orderstatussubject,orderstatussubject2=orderstatussubject") or print_sql_error('');
	ect_query("UPDATE emailmessages SET orderstatusemail3=orderstatusemail,orderstatusemail2=orderstatusemail") or print_sql_error('');
	ect_query("UPDATE emailmessages SET notifystocksubject2=notifystocksubject,notifystocksubject3=notifystocksubject,notifystockemail2=notifystockemail,notifystockemail3=notifystockemail") or print_sql_error('');
}
// Dumping optionGroup table
if(checktablecreated('optiongroup')){
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (1,'Color','Color',2,1)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (2,'Size','Size (Jackets)',2,1)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (4,'Size','Size (Socks)',2,1)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (6,'Processor','Processor (Multimedia)',2,1)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (7,'Hard Disk','Hard Disk',2,1)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (8,'Monitor','Monitor',2,1)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (9,'Network Card','Network Card',-2,0)");
	ect_query("INSERT INTO optiongroup (optGrpID,optGrpName,optGrpWorkingName,optType,optGrpSelect) VALUES (10,'Processor','Processor (Portables)',2,1)");
}
// Dumping options table
if(checktablecreated('options')){
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (1,1,'Blue',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (2,1,'Red',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (3,1,'Green',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (4,1,'Yellow',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (5,2,'Small',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (6,2,'Medium',1,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (7,2,'Large',1.5,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (8,2,'X-Large',2,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (9,2,'XX-Large',2.2,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (12,4,'8',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (13,4,'8 1/2',0.1,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (14,4,'9',0.15,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (15,4,'9 1/2',0.2,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (16,4,'10',0.25,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (21,6,'Intel Pentium III 1.3GHz',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (22,6,'Intel Pentium III 1.4GHz',15,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (23,6,'Intel Pentium IV 1.5GHz',25.5,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (24,6,'Intel Pentium IV 1.7GHz',45,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (25,6,'Intel Pentium IV 2.0GHz',65,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (26,7,'20 Gigabytes',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (27,7,'40 Gigabytes',10,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (28,7,'60 Gigabytes',34,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (29,7,'80 Gigabytes',44.5,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (30,8,'15\" Standard',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (31,8,'17\" Trinitron',22,5)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (32,8,'19\" Flatron',75,10)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (33,8,'21\" Supertron',185,20)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (34,9,'No',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (35,9,'Yes',15,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (36,10,'Pentium III 1.0 GHz',0,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (37,10,'Pentium III 1.3 GHz',33,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (38,10,'Pentium IV 1.5 GHz',50,0)");
	ect_query("INSERT INTO options (optID,optGroup,optName,optPriceDiff,optWeightDiff) VALUES (39,10,'Pentium IV 1.7 GHz',75,0)");
}
// Dumping orders table
if(checktablecreated('orders')){
	ect_query("INSERT INTO orders (ordID,ordSessionID,ordName,ordAddress,ordCity,ordState,ordZip,ordCountry,ordEmail,ordPhone,ordShipName,ordShipAddress,ordShipCity,ordShipState,ordShipZip,ordShipCountry,ordPayProvider,ordAuthNumber,ordShipping,ordStateTax,ordCountryTax,ordShipType,ordTotal,ordDate,ordStatusDate,ordIP,ordHandling,ordAddInfo,ordStatus,ordStatusInfo) VALUES (501,'935000845','A Customer','1212 The Street','San Jose','California','90210','United States of America','info@ecommercetemplates.com','1121212121212','','','','','','United States of America',4,'Email Only',2.5,0,0,'',1274.5,'" . date("Y-m-d H:i:s", time()) . "','" . date("Y-m-d H:i:s", time()) . "','192.168.0.1',0,'This is just an example order. It is also here to make sure your order numbers do not start at zero, which just doesn\'t look good.',3,'')");
}
// Dumping orderstatus table
if(checktablecreated('orderstatus')){
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (0,'Cancelled','Order Cancelled',0)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (1,'Deleted','Order Deleted',0)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (2,'Unauthorized','Awaiting Payment',0)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (3,'New Order','Order Received',0)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (4,'Authorized','Payment Received',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (5,'Packing','In Packing',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (6,'Shipped','Order Shipped',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (7,'Completed','Order Completed',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (8,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (9,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (10,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (11,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (12,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (13,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (14,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (15,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (16,'','',1)");
	ect_query("INSERT INTO orderstatus (statID,statPrivate,statPublic,emailstatus) VALUES (17,'','',1)");
}
// Dumping payprovider table
if(checktablecreated('payprovider')){
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (1,'PayPal','PayPal',0,0,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (2,'2Checkout','Credit Card',0,1,0,'','',2)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (3,'Auth.net SIM','Credit Card',0,1,0,'','',3)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (4,'Email','Email',1,1,0,'','',4)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (5,'World Pay','Credit Card',0,1,0,'','',5)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (6,'NOCHEX','NOCHEX',0,1,0,'','',6)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (7,'Payflow Pro','Credit Card',0,1,0,'','',7)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (8,'Payflow Link','Credit Card',0,1,0,'','',8)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (9,'PayPoint.net','Credit Card',0,1,0,'','',9)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (10,'Capture Card','Credit Card',0,0,0,'XXXXXOOOOOOO','',10)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (11,'PSiGate','Credit Card',0,1,0,'','',11)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (12,'PSiGate SSL','Credit Card',0,1,0,'','',12)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (13,'Auth.net AIM','Credit Card',0,1,0,'','',13)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (14,'Custom','Credit Card',0,1,0,'','',14)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (15,'Netbanx','Credit Card',0,1,0,'','',15)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (16,'Linkpoint','Credit Card',0,1,0,'','',16)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (17,'Email 2','Email 2',0,1,0,'','',17)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (18,'PayPal Direct','Credit Card',0,0,0,'','',18)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (19,'PayPal Express','PayPal Express',0,0,0,'','',19)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (21,'Amazon Pay','Amazon Pay',0,1,0,'','',21)") or print_sql_error('');
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (22,'PayPal Advanced','Credit Card',0,0,0,'','',22)") or print_sql_error('');
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (23,'Stripe','Credit Card','Credit Card','Credit Card',0,1,0,'','',23)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (24,'SagePay','Credit Card','Credit Card','Credit Card',0,1,0,'','',24)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (25,'Braintree','Credit Card','Credit Card','Credit Card',0,1,0,'','',25)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (26,'Braintree Express','Braintree Express','Braintree Express','Braintree Express',0,0,0,'','',26)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (27,'PayPal Checkout','PayPal Checkout','PayPal Checkout','PayPal Checkout',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (28,'SquareUp','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (29,'NMI','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (30,'eWay','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (31,'Pay360','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (32,'Global Payments','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (33,'Checkout.com','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
	ect_query("INSERT INTO payprovider (payProvID,payProvName,payProvShow,payProvShow2,payProvShow3,payProvEnabled,payProvAvailable,payProvDemo,payProvData1,payProvData2,payProvOrder) VALUES (34,'Moneris Checkout','Credit Card','Credit Card','Credit Card',0,1,0,'','',1)");
}
// Dumping postalzones table
if(checktablecreated('postalzones')){
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (1,'United States')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (2,'Zone 2')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (3,'Zone 3')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (4,'Zone 4')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (5,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (6,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (7,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (8,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (9,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (10,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (11,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (12,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (13,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (14,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (15,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (16,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (17,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (18,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (19,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (20,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (21,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (22,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (23,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (24,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (101,'All States')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (102,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (103,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (104,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (105,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (106,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (107,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (108,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (109,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (110,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (111,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (112,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (113,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (114,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (115,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (116,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (117,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (118,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (119,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (120,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (121,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (122,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (123,'')");
	ect_query("INSERT INTO postalzones (pzID,pzName) VALUES (124,'')");
	ect_query("UPDATE postalzones SET pzMethodName1='Standard Shipping',pzMethodName2='Express Shipping'");
}
// Dumping prodoptions table
if(checktablecreated('prodoptions')){
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (9,'monitor001',8)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (21,'palmtop001',6)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (22,'palmtop001',7)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (23,'mouse001',1)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (25,'portable001',10)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (26,'pc001',8)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (27,'pc001',6)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (28,'pc001',7)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (29,'pc001',9)") or ect_error();
	ect_query("INSERT INTO prodoptions (poID,poProdID,poOptionGroup) VALUES (30,'testproduct',4)") or ect_error();
}
// Dumping Products Images table
if(checktablecreated('productimages')){
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('fscanner001','prodimages/scanner2.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('inkjet001','prodimages/inkjetprinter.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('keyboard001','prodimages/keyboard.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('lprinter001','prodimages/laserprinter.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('monitor001','prodimages/monitor.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('mouse001','prodimages/mouse.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('palmtop001','prodimages/palmtop.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('pc001','prodimages/pc.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('portable001','prodimages/portable.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('scanner001','prodimages/scanner.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('serialcab001','prodimages/computercable.gif',0,0)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('testproduct','prodimages/computercable.gif',0,0)") or ect_error();

	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('fscanner001','prodimages/lscanner2.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('inkjet001','prodimages/linkjetprinter.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('keyboard001','prodimages/lkeyboard.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('lprinter001','prodimages/llaserprinter.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('monitor001','prodimages/lmonitor.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('mouse001','prodimages/lmouse.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('palmtop001','prodimages/lpalmtop.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('pc001','prodimages/lpc.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('portable001','prodimages/lportable.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('scanner001','prodimages/lscanner.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('serialcab001','prodimages/lcomputercable.gif',0,1)") or ect_error();
	ect_query("INSERT INTO productimages (imageProduct,imageSrc,imageNumber,imageType) VALUES ('testproduct','prodimages/lcomputercable.gif',0,1)") or ect_error();
}
// Dumping Products table
if(checktablecreated('products')){
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('fscanner001','Professional Scanner','',2,'600 dpi full color quality for professional quality scanning results. Twice the resolution and twice the quality for your scans, but at an incredible low price.','600 dpi full color quality for professional quality scanning results. Twice the resolution and twice the quality for your scans, but at an incredible low price.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',120,5,0,4.04,1,1,0,4)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('inkjet001','Inkjet Printer','',4,'This inkjet printer really packs a punch for the home user. Full color prints at photo quality. Perfect for everything from letters to the bank manager, to printing out your favourite digital family pictures.','This inkjet printer really packs a punch for the home user. Full color prints at photo quality. Perfect for everything from letters to the bank manager, to printing out your favourite digital family pictures.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',95,4,0,2.02,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('keyboard001','PC Keyboard','',3,'With ergonomic tactile key action, this is a \"must buy\" for all PC users, home and professional alike. Connects via your PC\\'s serial or PS2 port.','With ergonomic tactile key action, this is a \"must buy\" for all PC users, home and professional alike. Connects via your PC\\'s serial or PS2 port.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',19,5,0,1,1,0,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('lprinter001','Laser Printer','',4,'For the small or home office, this laser printer is the perfect solution. Up to 15 black and white pages per minute, and a full 600dpi resolution for the quality your business demands.','For the small or home office, this laser printer is the perfect solution. Up to 15 black and white pages per minute, and a full 600dpi resolution for the quality your business demands.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',499,5,0,2,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('monitor001','PC Monitor','',3,'17\" full color flat screen monitor, with 0.25 dot resolution and 16.25\" viewable area.','17\" full color flat screen monitor, with 0.25 dot resolution and 16.25\" viewable area.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',299,5,0,2.15,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('mouse001','PC Mouse','',3,'Indispensible for using your PC, this mouse has easyglide action and simple connectivity to get your PC up and surfing the internet in no time.','Indispensible for using your PC, this mouse has easyglide action and simple connectivity to get your PC up and surfing the internet in no time.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',7,1,0,0.15,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('palmtop001','Palmtop Computer','',1,'The very latest in palmtop technology. All the power of a PC in a pocket sized system. Great for the mobile business person.','The very latest in palmtop technology. All the power of a PC in a pocket sized system. Great for the mobile business person.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',199,5,0,4.12,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('pc001','#1 PC multimedia package','',1,'This is an example of how you can use the product options to create advanced product descriptions with automatic price calculations.','Internet ready PC package. Just choose your monitor, hard disk size, processor speed and network card.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products. You can also include HTML Markup in the short and long product descriptions.',1200,10,0,6,1,1,0,10)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('portable001','Portable PC','',1,'For those on the go, this portable PC is just the thing. Your choice of processor, 256mb ram and 4gb harddisk make this the perfect solution for all types of applications. Buy now while stocks last.','For those on the go, this portable PC is just the thing. Your choice of processor, 256mb ram and 4gb harddisk make this the perfect solution for all types of applications. Buy now while stocks last.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',1250,6,0,2,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('scanner001','Flatbed scanner','',2,'Up to 300 dpi full color resolution and incredible speed make this a top choice for all your scanning needs. Scan professional quality photos, text or artwork in seconds.','Up to 300 dpi full color resolution and incredible speed make this a top choice for all your scanning needs. Scan professional quality photos, text or artwork in seconds.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',89,6,0,5.1,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('serialcab001','PC Serial Cable','',3,'Can be used for connecting PC systems to peripheral devices such as serial printers and scanners.','Can be used for connecting PC systems to peripheral devices such as serial printers and scanners.<br />As well as a larger image, you can use this \"Long Description\" to add extra detail or information about your products.',2.5,0.2,0,0.1,1,1,0,0)") or ect_error();
	ect_query("INSERT INTO products (pID,pName,pStaticURL,pSection,pDescription,pLongdescription,pPrice,pShipping,pShipping2,pWeight,pDisplay,pSell,pExemptions,pInStock) VALUES ('testproduct','Cheap Test Product','',3,'This is a cheap product for testing. Note how you can use HTML Markup in product descriptions.<br />Also note that as you change the product options, the price changes automatically.','This is a cheap product for testing. Note how you can use HTML Markup in product descriptions.<br />In the long description you can go into more detail about products.',0.01,0,0,3,1,1,0,21)") or ect_error();
}
// Dumping sections table
if(checktablecreated('sections')){
	ect_query("INSERT INTO sections (sectionID,sectionName,sectionName2,sectionName3,sectionWorkingName,sectionImage,sectionDescription,topSection,sectionOrder,rootSection,sectionurl,sectionurl2,sectionurl3) VALUES (1,'Systems','','','Systems','','Complete PC systems including tower systems, laptops and palmtop computers. The very best in PC power.',5,3,1,'','','')") or ect_error();
	ect_query("INSERT INTO sections (sectionID,sectionName,sectionName2,sectionName3,sectionWorkingName,sectionImage,sectionDescription,topSection,sectionOrder,rootSection,sectionurl,sectionurl2,sectionurl3) VALUES (2,'Scanners','','','Scanners','','RGB color scanners and scanner based systems for everything from digital snaps to professional prints.',6,5,1,'','','')") or ect_error();
	ect_query("INSERT INTO sections (sectionID,sectionName,sectionName2,sectionName3,sectionWorkingName,sectionImage,sectionDescription,topSection,sectionOrder,rootSection,sectionurl,sectionurl2,sectionurl3) VALUES (3,'Peripherals','','','Peripherals','','Keyboards, mice, cables and mousemats and all your other PC peripheral needs.',5,2,1,'','','')") or ect_error();
	ect_query("INSERT INTO sections (sectionID,sectionName,sectionName2,sectionName3,sectionWorkingName,sectionImage,sectionDescription,topSection,sectionOrder,rootSection,sectionurl,sectionurl2,sectionurl3) VALUES (4,'Printers','','','Printers','','Inkjet and laser printers for the very best in home and small office printing systems.',6,6,1,'','','')") or ect_error();
	ect_query("INSERT INTO sections (sectionID,sectionName,sectionName2,sectionName3,sectionWorkingName,sectionImage,sectionDescription,topSection,sectionOrder,rootSection,sectionurl,sectionurl2,sectionurl3) VALUES (5,'Computer Parts','','','Computer Parts','','Bits and pieces for your computer',0,1,0,'','','')") or ect_error();
	ect_query("INSERT INTO sections (sectionID,sectionName,sectionName2,sectionName3,sectionWorkingName,sectionImage,sectionDescription,topSection,sectionOrder,rootSection,sectionurl,sectionurl2,sectionurl3) VALUES (6,'Printers and Scanners','','','Printers and Scanners','','Printers and scanners for your PC',0,4,0,'','','')") or ect_error();
}
// Dumping States table
if(checktablecreated('states')){
	$nextfreeid=1;
	function addstate($stateCountryID,$stateName,$stateAbbrev){
		doaddstate($stateCountryID,$stateName,$stateAbbrev,1);
	}
	function adddisabledstate($stateCountryID,$stateName,$stateAbbrev){
		doaddstate($stateCountryID,$stateName,$stateAbbrev,0);
	}
	function doaddstate($stateCountryID,$stateName,$stateAbbrev,$stateEnabled){
		global $nextfreeid;
		$gotstateid=FALSE;
		while(! $gotstateid){
			$result = ect_query("SELECT stateID FROM states WHERE stateID=" . $nextfreeid) or ect_error();
			if(ect_num_rows($result)==0) $gotstateid=TRUE; else $nextfreeid++;
			ect_free_result($result);
		}
		ect_query("INSERT INTO states (stateID,stateCountryID,stateName,stateAbbrev,stateTax,stateEnabled,stateZone,stateFreeShip) VALUES (" . $nextfreeid . "," . $stateCountryID . ",'" . escape_string($stateName) . "','" . escape_string($stateAbbrev) . "',0," . $stateEnabled . ",0,0)") or ect_error();
	}
	// USA
	addstate(1,"Alabama","AL");
	addstate(1,"Alaska","AK");
	addstate(1,"American Samoa","AS");
	addstate(1,"Arizona","AZ");
	addstate(1,"Arkansas","AR");
	addstate(1,"California","CA");
	addstate(1,"Colorado","CO");
	addstate(1,"Connecticut","CT");
	addstate(1,"Delaware","DE");
	addstate(1,"District Of Columbia","DC");
	addstate(1,"Fdr. States Of Micronesia","FM");
	addstate(1,"Florida","FL");
	addstate(1,"Georgia","GA");
	addstate(1,"Guam","GU");
	addstate(1,"Hawaii","HI");
	addstate(1,"Idaho","ID");
	addstate(1,"Illinois","IL");
	addstate(1,"Indiana","IN");
	addstate(1,"Iowa","IA");
	addstate(1,"Kansas","KS");
	addstate(1,"Kentucky","KY");
	addstate(1,"Louisiana","LA");
	addstate(1,"Maine","ME");
	addstate(1,"Marshall Islands","MH");
	addstate(1,"Maryland","MD");
	addstate(1,"Massachusetts","MA");
	addstate(1,"Michigan","MI");
	addstate(1,"Minnesota","MN");
	addstate(1,"Mississippi","MS");
	addstate(1,"Missouri","MO");
	addstate(1,"Montana","MT");
	addstate(1,"Nebraska","NE");
	addstate(1,"Nevada","NV");
	addstate(1,"New Hampshire","NH");
	addstate(1,"New Jersey","NJ");
	addstate(1,"New Mexico","NM");
	addstate(1,"New York","NY");
	addstate(1,"North Carolina","NC");
	addstate(1,"North Dakota","ND");
	addstate(1,"Northern Mariana Islands","MP");
	addstate(1,"Ohio","OH");
	addstate(1,"Oklahoma","OK");
	addstate(1,"Oregon","OR");
	addstate(1,"Palau","PW");
	addstate(1,"Pennsylvania","PA");
	addstate(1,"Puerto Rico","PR");
	addstate(1,"Rhode Island","RI");
	addstate(1,"South Carolina","SC");
	addstate(1,"South Dakota","SD");
	addstate(1,"Tennessee","TN");
	addstate(1,"Texas","TX");
	addstate(1,"Utah","UT");
	addstate(1,"Vermont","VT");
	addstate(1,"Virgin Islands","VI");
	addstate(1,"Virginia","VA");
	addstate(1,"Washington","WA");
	addstate(1,"West Virginia","WV");
	addstate(1,"Wisconsin","WI");
	addstate(1,"Wyoming","WY");
	adddisabledstate(1,"Armed Forces Africa","AE");
	adddisabledstate(1,"Armed Forces Americas","AA");
	adddisabledstate(1,"Armed Forces Canada","AE");
	adddisabledstate(1,"Armed Forces Europe","AE");
	adddisabledstate(1,"Armed Forces Middle East","AE");
	adddisabledstate(1,"Armed Forces Pacific","AP");
	// Canada
	addstate(2,"Alberta","AB");
	addstate(2,"British Columbia","BC");
	addstate(2,"Manitoba","MB");
	addstate(2,"New Brunswick","NB");
	addstate(2,"Newfoundland","NF");
	addstate(2,"North West Territories","NT");
	addstate(2,"Nova Scotia","NS");
	addstate(2,"Nunavut","NU");
	addstate(2,"Ontario","ON");
	addstate(2,"Prince Edward Island","PE");
	addstate(2,"Quebec","QC");
	addstate(2,"Saskatchewan","SK");
	addstate(2,"Yukon Territory","YT");
	// Australia
	addstate(14,"Australian Capital Territory","ACT");
	addstate(14,"New South Wales","NSW");
	addstate(14,"Northern Territory","NT");
	addstate(14,"Queensland","QLD");
	addstate(14,"South Australia","SA");
	addstate(14,"Tasmania","TA");
	addstate(14,"Victoria","VIC");
	addstate(14,"Western Australia","WA");
	// Ireland
	addstate(91,"Carlow","CA");
	addstate(91,"Cavan","CV");
	addstate(91,"Clare","CL");
	addstate(91,"Cork","CO");
	addstate(91,"Donegal","DO");
	addstate(91,"Dublin","DU");
	addstate(91,"Galway","GA");
	addstate(91,"Kerry","KE");
	addstate(91,"Kildare","KI");
	addstate(91,"Kilkenny","KL");
	addstate(91,"Laois","LA");
	addstate(91,"Leitrim","LE");
	addstate(91,"Limerick","LI");
	addstate(91,"Longford","LO");
	addstate(91,"Louth","LU");
	addstate(91,"Mayo","MA");
	addstate(91,"Meath","ME");
	addstate(91,"Monaghan","MO");
	addstate(91,"Offaly","OF");
	addstate(91,"Roscommon","RO");
	addstate(91,"Sligo","SL");
	addstate(91,"Tipperary","TI");
	addstate(91,"Waterford","WA");
	addstate(91,"Westmeath","WE");
	addstate(91,"Wexford","WX");
	addstate(91,"Wicklow","WI");
	// New Zealand
	addstate(136,"Ashburton","AS");
	addstate(136,"Auckland","AU");
	addstate(136,"Bay of Plenty","BP");
	addstate(136,"Buller","BU");
	addstate(136,"Canterbury","CB");
	addstate(136,"Carterton","CA");
	addstate(136,"Central Otago","CO");
	addstate(136,"Clutha","CL");
	addstate(136,"Counties Manukau","CM");
	addstate(136,"Dunedin City","DC");
	addstate(136,"Far North","FN");
	addstate(136,"Franklin","FR");
	addstate(136,"Gisborne","GS");
	addstate(136,"Gore","GO");
	addstate(136,"Grey","GR");
	addstate(136,"Hamilton City","HC");
	addstate(136,"Hastings","HS");
	addstate(136,"Hauraki","HI");
	addstate(136,"Hawke's Bay","HB");
	addstate(136,"Horowhenua","HW");
	addstate(136,"Hurunui","HU");
	addstate(136,"Hutt Valley","HV");
	addstate(136,"Invercargill","IC");
	addstate(136,"Kaikoura","KK");
	addstate(136,"Kaipara","KP");
	addstate(136,"Kapiti Coast","KC");
	addstate(136,"Kawerau","KW");
	addstate(136,"Manawatu","MW");
	addstate(136,"Marlborough","MB");
	addstate(136,"Masteron","MS");
	addstate(136,"Matamata Piako","MP");
	addstate(136,"New Plymouth","NP");
	addstate(136,"North Shore City","NS");
	addstate(136,"Otaki","OT");
	addstate(136,"Otorohanga","OT");
	addstate(136,"Palmerston North","PN");
	addstate(136,"Papakura","PK");
	addstate(136,"Porirua City","PC");
	addstate(136,"Queenstown Lakes","QL");
	addstate(136,"Rotorua","RT");
	addstate(136,"Ruapehu","RU");
	addstate(136,"Selwyn","SN");
	addstate(136,"South Taranaki","ST");
	addstate(136,"South Waikato","SW");
	addstate(136,"South Wairarapa","SA");
	addstate(136,"Southland","SL");
	addstate(136,"Stratford","SF");
	addstate(136,"Tasman","TM");
	addstate(136,"Taupo","TP");
	addstate(136,"Tauranga","TR");
	addstate(136,"Thames Coromandel","TC");
	addstate(136,"Timaru","TM");
	addstate(136,"Waikato","WK");
	addstate(136,"Waimakariri","WM");
	addstate(136,"Waimate","WE");
	addstate(136,"Waiora","WO");
	addstate(136,"Waipa","WP");
	addstate(136,"Waitakere","WT");
	addstate(136,"Waitaki","WI");
	addstate(136,"Waitomo","Wa");
	addstate(136,"Wellington City","WC");
	addstate(136,"Western Bay of Plenty","WB");
	addstate(136,"Westland","WL");
	addstate(136,"Whakatane","WH");
	addstate(136,"Whanganui","WG");
	addstate(136,"Whangarei","WE");
	// South Africa
	addstate(174,"Eastern Cape","EP");
	addstate(174,"Free State","OFS");
	addstate(174,"Gauteng","GA");
	addstate(174,"Kwazulu-Natal","KZN");
	addstate(174,"Mpumalanga","MP");
	addstate(174,"Northern Cape","NC");
	addstate(174,"Limpopo","LI");
	addstate(174,"North West Province","NWP");
	addstate(174,"Western Cape","WC");
	// UK
	addstate(201,"Aberdeenshire","AB");
	addstate(201,"Angus","AG");
	addstate(201,"Argyll","AR");
	addstate(201,"Avon","AV");
	addstate(201,"Ayrshire","AY");
	addstate(201,"Banffshire","BF");
	addstate(201,"Bedfordshire","Beds");
	addstate(201,"Berkshire","Berks");
	addstate(201,"Buckinghamshire","Bucks");
	addstate(201,"Caithness","CN");
	addstate(201,"Cambridgeshire","Cambs");
	addstate(201,"Ceredigion","CE");
	addstate(201,"Cheshire","CH");
	addstate(201,"Clackmannanshire","CL");
	addstate(201,"Cleveland","CV");
	addstate(201,"Clwyd","CW");
	addstate(201,"County Antrim","Co Antrim");
	addstate(201,"County Armagh","Co Armagh");
	addstate(201,"County Down","Co Down");
	addstate(201,"Durham","Durham");
	addstate(201,"County Fermanagh","Co Fermanagh");
	addstate(201,"County Londonderry","Co Londonderry");
	addstate(201,"County Tyrone","Co Tyrone");
	addstate(201,"Cornwall","CO");
	addstate(201,"Cumbria","CU");
	addstate(201,"Derbyshire","DB");
	addstate(201,"Devon","DV");
	addstate(201,"Dorset","DO");
	addstate(201,"Dumfriesshire","DF");
	addstate(201,"Dunbartonshire","DU");
	addstate(201,"Dyfed","DY");
	addstate(201,"East Lothian","EL");
	addstate(201,"East Sussex","E Sussex");
	addstate(201,"Essex","EX");
	addstate(201,"Fife","FI");
	addstate(201,"Gloucestershire","Glos");
	addstate(201,"Gwent","GW");
	addstate(201,"Gwynedd","GY");
	addstate(201,"Hampshire","Hants");
	addstate(201,"Herefordshire","HE");
	addstate(201,"Hertfordshire","Herts");
	addstate(201,"Inverness-shire","IS");
	addstate(201,"Isle of Mull","IsMu");
	addstate(201,"Shetland","IsSh");
	addstate(201,"Isle of Skye","IsSk");
	addstate(201,"Isle of Wight","IsWi");
	addstate(201,"Isles of Scilly","IsSc");
	addstate(201,"Kent","KE");
	addstate(201,"Kincardineshire","KI");
	addstate(201,"Kinross-shire","KR");
	addstate(201,"Kirkcudbrightshire","KK");
	addstate(201,"Lanarkshire","LK");
	addstate(201,"Lancashire","Lancs");
	addstate(201,"Leicestershire","Leics");
	addstate(201,"Lincolnshire","Lincs");
	addstate(201,"London","LO");
	addstate(201,"Merseyside","ME");
	addstate(201,"Mid Glamorgan","M Glam");
	addstate(201,"Midlothian","MI");
	addstate(201,"Middlesex","Middx");
	addstate(201,"Moray","MO");
	addstate(201,"Nairnshire","NA");
	addstate(201,"Norfolk","NO");
	addstate(201,"North Humberside","N Humberside");
	addstate(201,"North Yorkshire","N Yorkshire");
	addstate(201,"Northamptonshire","Northants");
	addstate(201,"Northumberland","Northd");
	addstate(201,"Nottinghamshire","Notts");
	addstate(201,"Oxfordshire","Oxon");
	addstate(201,"Peebleshire","PE");
	addstate(201,"Perthshire","PR");
	addstate(201,"Powys","PO");
	addstate(201,"Renfrewshire","RE");
	addstate(201,"Ross-shire","RO");
	addstate(201,"Roxburghshire","RX");
	addstate(201,"Selkirkshire","SK");
	addstate(201,"Shropshire","SR");
	addstate(201,"Somerset","SO");
	addstate(201,"South Glamorgan","S Glam");
	addstate(201,"South Humberside","S Humberside");
	addstate(201,"South Yorkshire","S Yorkshire");
	addstate(201,"Staffordshire","Staffs");
	addstate(201,"Stirlingshire","SS");
	addstate(201,"Suffolk","SF");
	addstate(201,"Surrey","SY");
	addstate(201,"Sutherland","SU");
	addstate(201,"Tyne and Wear","Tyne & Wear");
	addstate(201,"Warwickshire","Warks");
	addstate(201,"West Glamorgan","W Glam");
	addstate(201,"West Lothian","WL");
	addstate(201,"West Midlands","W Midlands");
	addstate(201,"West Sussex","W Sussex");
	addstate(201,"West Yorkshire","W Yorkshire");
	addstate(201,"Wigtownshire","WT");
	addstate(201,"Wiltshire","Wilts");
	addstate(201,"Worcestershire","Worcs");
	addstate(201,"Yorkshire","EY");
	addstate(201,"Carmarthenshire","CS");
	addstate(201,"Berwickshire","BS");
	addstate(201,"Anglesey","AN");
	addstate(201,"Pembrokeshire","PK");
	addstate(201,"Flintshire","FS");
	addstate(201,"Rutland","RD");
	addstate(201,"Glamorgan","AA");
	addstate(201,"Cardiff","AA");
	addstate(201,"Bristol","AA");
	addstate(201,"Manchester","AA");
	addstate(201,"Birmingham","AA");
	addstate(201,"Glasgow","AA");
	addstate(201,"Edinburgh","AA");
	
	adddisabledstate(201,"BFPO","FO");
	adddisabledstate(201,"APO/FPO","AO");
	
	adddisabledstate(201,'Orkney','ORK');
	adddisabledstate(201,'Denbighshire','DEN');
	adddisabledstate(201,'Monmouthshire','MON');
	adddisabledstate(201,'Rhondda Cynon Taff','RON');
	adddisabledstate(201,'Channel Islands','CHI');
	adddisabledstate(201,'Isle of Man','ISM');

	// Denmark
	addstate(50,"Bornholm","BH");
	addstate(50,"Falster","FA");
	addstate(50,"Fyn","FY");
	addstate(50,"Jylland","JY");
	addstate(50,"Sjaelland","SJ");
	// France
	addstate(65,"Ain","01");
	addstate(65,"Aisne","02");
	addstate(65,"Allier","03");
	addstate(65,"Alpes de Haute Provence","04");
	addstate(65,"Hautes Alpes","05");
	addstate(65,"Alpes Maritimes","06");
	addstate(65,"Ard&egrave;che","07");
	addstate(65,"Ardennes","08");
	addstate(65,"Ari&egrave;ge","09");
	addstate(65,"Aube","10");
	addstate(65,"Aude","11");
	addstate(65,"Averyon","12");
	addstate(65,"Bouche du Rh&ocirc;ne","13");
	addstate(65,"Calvados","14");
	addstate(65,"Cantal","15");
	addstate(65,"Charente","16");
	addstate(65,"Charente Maritime","17");
	addstate(65,"Cher","18");
	addstate(65,"Corr&egrave;ze","19");
	addstate(65,"Corse du Sud","2a");
	addstate(65,"Haute Corse","2b");
	addstate(65,"C&ocirc;te d'Or","21");
	addstate(65,"C&ocirc;tes d'Armor","22");
	addstate(65,"Creuse","23");
	addstate(65,"Dordogne","24");
	addstate(65,"Doubs","25");
	addstate(65,"Dr&ocirc;me","26");
	addstate(65,"Eure","27");
	addstate(65,"Eure et Loire","28");
	addstate(65,"Finist&egrave;re","29");
	addstate(65,"Gard","30");
	addstate(65,"Haute Garonne","31");
	addstate(65,"Gers","32");
	addstate(65,"Gironde","33");
	addstate(65,"Herault","34");
	addstate(65,"Ille et Vilaine","35");
	addstate(65,"Indre","36");
	addstate(65,"Indre et Loire","37");
	addstate(65,"Is&egrave;re","38");
	addstate(65,"Jura","39");
	addstate(65,"Landes","40");
	addstate(65,"Loir et Cher","41");
	addstate(65,"Loire","42");
	addstate(65,"Haute Loire","43");
	addstate(65,"Loire Atlantique","44");
	addstate(65,"Loiret","45");
	addstate(65,"Lot","46");
	addstate(65,"Lot et Garonne","47");
	addstate(65,"Loz&egrave;re","48");
	addstate(65,"Maine et Loire","49");
	addstate(65,"Manche","50");
	addstate(65,"Marne","51");
	addstate(65,"Haute Marne","52");
	addstate(65,"Mayenne","53");
	addstate(65,"Meurthe et Moselle","54");
	addstate(65,"Meuse","55");
	addstate(65,"Morbihan","56");
	addstate(65,"Moselle","57");
	addstate(65,"Ni&egrave;vre","58");
	addstate(65,"Nord","59");
	addstate(65,"Oise","60");
	addstate(65,"Orne","61");
	addstate(65,"Pas de Calais","62");
	addstate(65,"Puy de D&ocirc;me","63");
	addstate(65,"Pyren&eacute;es Atlantiques","64");
	addstate(65,"Haute Pyren&eacute;es","65");
	addstate(65,"Pyren&eacute;es orientales","66");
	addstate(65,"Bas Rhin","67");
	addstate(65,"Haut Rhin","68");
	addstate(65,"Rh&ocirc;ne","69");
	addstate(65,"Haute Sa&ocirc;ne","70");
	addstate(65,"Sa&ocirc;ne et Loire","71");
	addstate(65,"Sarthe","72");
	addstate(65,"Savoie","73");
	addstate(65,"Haute Savoie","74");
	addstate(65,"Paris","75");
	addstate(65,"Seine Maritime","76");
	addstate(65,"Seine et Marne","77");
	addstate(65,"Yvelines","78");
	addstate(65,"Deux S&egrave;vres","79");
	addstate(65,"Somme","80");
	addstate(65,"Tarn","81");
	addstate(65,"Tarn et Garonne","82");
	addstate(65,"Var","83");
	addstate(65,"Vaucluse","84");
	addstate(65,"Vend&eacute;e","85");
	addstate(65,"Vienne","86");
	addstate(65,"Haute Vienne","87");
	addstate(65,"Vosges","88");
	addstate(65,"Yonne","89");
	addstate(65,"Territoire de Belfort","90");
	addstate(65,"Essonne","91");
	addstate(65,"Hauts de Seine","92");
	addstate(65,"Seine Saint Denis","93");
	addstate(65,"Val de Marne","94");
	addstate(65,"Val d'Oise","95");
	// Germany
	addstate(71,"Baden-W&uuml;rttemberg","01");
	addstate(71,"Bayern","02");
	addstate(71,"Berlin","03");
	addstate(71,"Brandenburg","04");
	addstate(71,"Bremen","05");
	addstate(71,"Hamburg","06");
	addstate(71,"Hessen","07");
	addstate(71,"Mecklenburg-Vorpommern","08");
	addstate(71,"Niedersachsen","09");
	addstate(71,"Nordrhein-Westfalen","10");
	addstate(71,"Rheinland-Pfalz","11");
	addstate(71,"Saarland","12");
	addstate(71,"Sachsen","13");
	addstate(71,"Sachsen Anhalt","14");
	addstate(71,"Schleswig Holstein","15");
	addstate(71,"Th&uuml;ringen","16");
	// Switzerland
	addstate(183,"Aargau","AG");
	addstate(183,"Appenzell Innerrhoden","AI");
	addstate(183,"Appenzell Ausserrhoden","AR");
	addstate(183,"Basel-Stadt","BS");
	addstate(183,"Basel-Landschaft","BL");
	addstate(183,"Bern","BE");
	addstate(183,"Freiburg","FR");
	addstate(183,"Genf","GE");
	addstate(183,"Glarus","GL");
	addstate(183,"Graub&uuml;nden","GR");
	addstate(183,"Jura","JU");
	addstate(183,"Luzern","LU");
	addstate(183,"Neuenburg","NE");
	addstate(183,"Nidwalden","NW");
	addstate(183,"Obwalden","OW");
	addstate(183,"Schaffhausen","SH");
	addstate(183,"Schwyz","SZ");
	addstate(183,"Solothurn","SO");
	addstate(183,"St. Gallen","SG");
	addstate(183,"Thurgau","TG");
	addstate(183,"Tessin","TI");
	addstate(183,"Uri","UR");
	addstate(183,"Wallis","VS");
	addstate(183,"Waadt","VD");
	addstate(183,"Zug","ZG");
	addstate(183,"Z&uuml;rich","ZH");
	// Italy
	addstate(93,"Abruzzo","AL");
	addstate(93,"Basilicata","AK");
	addstate(93,"Calabria","AS");
	addstate(93,"Campania","AZ");
	addstate(93,"Emilia Romagna","AR");
	addstate(93,"Friuli Venezia Giulia","CA");
	addstate(93,"Lazio","CO");
	addstate(93,"Liguria","CT");
	addstate(93,"Lombardia","DE");
	addstate(93,"Marche","DC");
	addstate(93,"Piemonte","FM");
	addstate(93,"Puglia","FL");
	addstate(93,"Sardegna","GA");
	addstate(93,"Sicilia","GU");
	addstate(93,"Toscana","HI");
	addstate(93,"Trentino Alto Adige","ID");
	addstate(93,"Umbria","IL");
	addstate(93,"Valle d'Aosta","IN");
	addstate(93,"Veneto","IA");
	// Portugal
	addstate(153,"Aveiro","AB");
	addstate(153,"Beja","AG");
	addstate(153,"Braga","AR");
	addstate(153,"Braganca","AV");
	addstate(153,"Castelo Branco","AY");
	addstate(153,"Coimbra","BF");
	addstate(153,"Evora","BE");
	addstate(153,"Faro","BK");
	addstate(153,"Guarda","BU");
	addstate(153,"Leiria","CN");
	addstate(153,"Lisboa","CB");
	addstate(153,"Portalegre","CH");
	addstate(153,"Porto","CL");
	addstate(153,"Santarem","CV");
	addstate(153,"Setubal","CW");
	addstate(153,"Viana do Castelo","CAn");
	addstate(153,"Vila Real","CL");
	addstate(153,"Viseu","CL");
	addstate(153,"Madeira","MA");
	addstate(153,"A&ccedil;ores","AC");
	// Spain
	addstate(175,"Alava","VI");
	addstate(175,"Albacete","AB");
	addstate(175,"Alicante","A");
	addstate(175,"Almer&iacute;a","AL");
	addstate(175,"Asturias","O");
	addstate(175,"Avila","AV");
	addstate(175,"Badajoz","BA");
	addstate(175,"Barcelona","B");
	addstate(175,"Burgos","BU");
	addstate(175,"C&aacute;ceres","CC");
	addstate(175,"C&aacute;diz","CA");
	addstate(175,"Cantabria","S");
	addstate(175,"Castell&oacute;n","CS");
	addstate(175,"Ceuta","CE");
	addstate(175,"Ciudad Real","CR");
	addstate(175,"C&oacute;rdoba","CO");
	addstate(175,"Cuenca","CU");
	addstate(175,"Guip&uacute;zcoa","SS");
	addstate(175,"Girona","GI");
	addstate(175,"Granada","GR");
	addstate(175,"Guadalajara","GU");
	addstate(175,"Huelva","H");
	addstate(175,"Huesca","HU");
	addstate(175,"Islas Baleares","IB");
	addstate(175,"Ja&eacute;n","J");
	addstate(175,"La Coru&ntilde;a","C");
	addstate(175,"La Rioja","LO");
	addstate(175,"Las Palmas","GC");
	addstate(175,"Le&oacute;n","LE");
	addstate(175,"L&eacute;rida","LL");
	addstate(175,"Lugo","LU");
	addstate(175,"Madrid","M");
	addstate(175,"M&aacute;laga","MA");
	addstate(175,"Melilla","ML");
	addstate(175,"Murcia","MU");
	addstate(175,"Navarra","NA");
	addstate(175,"Orense","OR");
	addstate(175,"Palencia","P");
	addstate(175,"Pontevedra","PO");
	addstate(175,"Salamanca","SA");
	addstate(175,"Tenerife","TF");
	addstate(175,"Segovia","SG");
	addstate(175,"Sevilla","SE");
	addstate(175,"Soria","SO");
	addstate(175,"Tarragona","T");
	addstate(175,"Teruel","TE");
	addstate(175,"Toledo","TO");
	addstate(175,"Valencia","V");
	addstate(175,"Valladolid","VA");
	addstate(175,"Vizcaya","BI");
	addstate(175,"Zamora","ZA");
	addstate(175,"Zaragoza","Z");

	ect_query("UPDATE states SET stateName2=stateName");
	ect_query("UPDATE states SET stateName3=stateName");

}
// Dumping uspsmethods table
if(checktablecreated('uspsmethods')){
	$sSQL="INSERT INTO uspsmethods (uspsID, uspsMethod, uspsShowAs, uspsUseMethod, uspsFSA, uspsOrder, uspsLocal) VALUES
		(1, 'PRIORITY_MAIL_EXPRESS', 'Express Mail', 0, 0, 0, 1),
		(2, 'PRIORITY_MAIL', 'Priority Mail', 0, 0, 0, 1),
		(3, 'PARCEL_SELECT', 'Parcel Post', 1, 1, 0, 1),
		(14, 'MEDIA_MAIL', 'Media Mail', 0, 0, 0, 1),
		(15, 'BOUND_PRINTED_MATTER', 'Bound Printed Matter', 0, 0, 0, 1),
		(16, 'USPS_GROUND_ADVANTAGE', 'Ground Advantage', 0, 0, 0, 1),
		(17, 'GROUND ADVANTAGE COMMERCIAL', 'Ground Advantage', 0, 0, 0, 1),
		(18, 'Priority Commercial', 'Priority Mail', 0, 0, 0, 1),
		(19, 'Priority Cpp', 'Priority Mail', 0, 0, 0, 1),
		(20, 'Priority Mail Express Commercial', 'Express Mail', 0, 0, 0, 1),
		(21, 'Priority Mail Express CPP', 'Express Mail', 0, 0, 0, 1),
		(22, 'USPS_RETAIL_GROUND', 'Parcel Post', 0, 0, 0, 1),
		(30, '4', 'Global Express Guaranteed', 0, 0, 0, 0),
		(31, '6', 'Global Express Guaranteed', 0, 0, 0, 0),
		(32, '7', 'Global Express Guaranteed', 0, 0, 0, 0),
		(33, 'PRIORITY_MAIL_EXPRESS_INTERNATIONAL', 'Express Mail International', 0, 0, 0, 0),
		(34, '10', 'Express Mail International', 0, 0, 0, 0),
		(35, 'PRIORITY_MAIL_INTERNATIONAL', 'Priority Mail International', 0, 0, 0, 0),
		(36, '8', 'Priority Mail International', 0, 0, 0, 0),
		(37, '9', 'Priority Mail International', 0, 0, 0, 0),
		(38, '13', 'First-Class Mail', 1, 0, 0, 0),
		(39, '14', 'First-Class Mail', 0, 0, 0, 0),
		(40, 'FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE', 'First-Class Mail', 0, 0, 0, 0),
		(41, '11', 'Priority Mail International', 0, 0, 0, 0),
		(42, '16', 'Priority Mail International', 0, 0, 0, 0),
		(43, '17', 'Express Mail International', 0, 0, 0, 0),
		(44, '20', 'Priority Mail International', 0, 0, 0, 0),
		(45, '24', 'Priority Mail International', 0, 0, 0, 0),
		(46, '26', 'Express Mail International', 0, 0, 0, 0),
		(101, '01', 'UPS Next Day Air&reg;', 1, 0, 0, 1),
		(102, '02', 'UPS 2nd Day Air&reg;', 1, 0, 0, 1),
		(103, '03', 'UPS Ground', 1, 1, 0, 1),
		(104, '07', 'UPS Worldwide Express', 1, 0, 0, 1),
		(105, '08', 'UPS Worldwide Expedited', 1, 0, 0, 1),
		(106, '11', 'UPS Standard', 1, 0, 0, 1),
		(107, '12', 'UPS 3 Day Select&reg;', 1, 0, 0, 1),
		(108, '13', 'UPS Next Day Air Saver&reg;', 1, 0, 0, 1),
		(109, '14', 'UPS Next Day Air&reg; Early A.M.&reg;', 1, 0, 0, 1),
		(110, '54', 'UPS Worldwide Express Plus', 1, 0, 0, 1),
		(111, '59', 'UPS 2nd Day Air A.M.&reg;', 1, 0, 0, 1),
		(112, '65', 'UPS Express Saver', 1, 0, 0, 1),
		(201, 'DOM.RP', 'Regular Parcel', 1, 1, 0, 1),
		(202, 'DOM.EP', 'Expedited Parcel', 1, 0, 0, 1),
		(203, 'DOM.XP', 'Xpresspost', 1, 0, 0, 1),
		(204, 'DOM.XP.CERT', 'Xpresspost Certified', 1, 0, 0, 1),
		(205, 'DOM.PC', 'Priority', 1, 0, 0, 1),
		(206, 'DOM.LIB', 'Library Books', 1, 0, 0, 1),
		(207, 'USA.EP', 'Expedited Parcel USA', 1, 0, 0, 1),
		(208, 'USA.PW.ENV', 'Priority Worldwide Envelope USA', 1, 0, 0, 1),
		(210, 'USA.PW.PAK', 'Priority Worldwide pak USA', 1, 0, 0, 0),
		(211, 'USA.PW.PARCEL', 'Priority Worldwide Parcel USA', 1, 0, 0, 0),
		(212, 'USA.SP.AIR', 'Small Packet USA Air', 1, 0, 0, 0),
		(213, 'USA.SP.SURF', 'Small Packet USA Surface', 1, 0, 0, 0),
		(214, 'USA.XP', 'Xpresspost USA', 1, 0, 0, 0),
		(215, 'INT.XP', 'Xpresspost International', 1, 0, 0, 0),
		(216, 'INT.IP.AIR', 'International Parcel Air', 1, 0, 0, 0),
		(217, 'INT.IP.SURF', 'International Parcel Surface', 1, 0, 0, 0),
		(218, 'INT.PW.ENV', 'Priority Worldwide Envelope Int\'l', 1, 0, 0, 0),
		(221, 'INT.PW.PAK', 'Priority Worldwide pak Int\'l', 1, 0, 0, 0),
		(222, 'INT.PW.PARCEL', 'Priority Worldwide parcel Int\'l', 1, 0, 0, 0),
		(223, 'INT.SP.AIR', 'Small Packet International Air', 1, 0, 0, 0),
		(224, 'INT.SP.SURF', 'Small Packet International Surface', 1, 0, 0, 0),
		(225, 'INT.TP', 'Tracked Packet - International', 1, 0, 0, 0),
		(301, 'PRIORITYOVERNIGHT', 'FedEx Priority Overnight&reg;', 1, 0, 0, 1),
		(302, 'STANDARDOVERNIGHT', 'FedEx Standard Overnight&reg;', 1, 0, 0, 1),
		(303, 'FIRSTOVERNIGHT', 'FedEx First Overnight&reg;', 1, 0, 0, 1),
		(304, 'FEDEX2DAY', 'FedEx 2Day&reg;', 1, 0, 0, 1),
		(305, 'FEDEXEXPRESSSAVER', 'FedEx Express Saver&reg;', 1, 0, 0, 1),
		(306, 'INTERNATIONALPRIORITY', 'FedEx International Priority&reg;', 1, 0, 0, 1),
		(307, 'INTERNATIONALECONOMY', 'FedEx International Economy&reg;', 1, 0, 0, 1),
		(308, 'INTERNATIONALFIRST', 'FedEx International Next Flight&reg;', 1, 0, 0, 1),
		(310, 'FEDEX1DAYFREIGHT', 'FedEx 1Day Freight&reg;', 1, 0, 0, 0),
		(311, 'FEDEX2DAYFREIGHT', 'FedEx 2Day Freight&reg;', 1, 0, 0, 0),
		(312, 'FEDEX3DAYFREIGHT', 'FedEx 3Day Freight&reg;', 1, 0, 0, 0),
		(313, 'FEDEXGROUND', 'FedEx Ground&reg;', 1, 1, 0, 0),
		(314, 'GROUNDHOMEDELIVERY', 'FedEx Home Delivery&reg;', 1, 0, 0, 0),
		(315, 'INTERNATIONALPRIORITYFREIGHT', 'FedEx International Priority Freight&reg;', 1, 0, 0, 0),
		(316, 'INTERNATIONALECONOMYFREIGHT', 'FedEx International Economy Freight&reg;', 1, 0, 0, 0),
		(317, 'EUROPEFIRSTINTERNATIONALPRIORITY', 'FedEx Europe First&reg; - Int\'l Priority', 1, 0, 0, 1),
		(401, 'SMARTPOST', 'FedEx SmartPost&reg;', 1, 0, 0, 1),
		(501, '3', 'DHL Easy Shop', 1, 0, 0, 1),
		(502, '4', 'DHL Jetline', 1, 0, 0, 1),
		(503, '8', 'DHL Express Easy', 1, 0, 0, 1),
		(504, 'E', 'DHL Express 9:00', 1, 0, 0, 1),
		(505, 'F', 'DHL Freight Worldwide', 1, 0, 0, 1),
		(506, 'H', 'DHL Economy Select', 1, 0, 0, 1),
		(507, 'J', 'DHL Jumbo Box', 1, 0, 0, 1),
		(508, 'M', 'DHL Express 10:30', 1, 0, 0, 1),
		(509, 'P', 'DHL Express Worldwide', 1, 0, 0, 1),
		(510, 'Q', 'DHL Medical Express', 0, 0, 0, 1),
		(511, 'V', 'DHL Europack', 1, 0, 0, 1),
		(512, 'Y', 'DHL Express 12:00', 1, 0, 0, 1),
		(513, '2', 'DHL Easy Shop', 1, 0, 0, 1),
		(514, '5', 'DHL Sprintline', 1, 0, 0, 1),
		(515, '6', 'DHL Secureline', 1, 0, 0, 1),
		(516, '7', 'DHL Express Easy', 1, 0, 0, 1),
		(517, '9', 'DHL Europack', 1, 0, 0, 1),
		(518, 'B', 'DHL Break Bulk Express', 1, 0, 0, 1),
		(519, 'C', 'DHL Medical Express', 1, 0, 0, 1),
		(520, 'D', 'DHL Express Worldwide', 1, 0, 0, 1),
		(521, 'G', 'DHL Domestic Economy Express', 1, 0, 0, 1),
		(522, 'I', 'DHL Break Bulk Economy', 1, 0, 0, 1),
		(523, 'K', 'DHL Express 9:00', 1, 0, 0, 1),
		(524, 'L', 'DHL Express 10:30', 1, 0, 0, 1),
		(525, 'N', 'DHL Domestic Express', 1, 0, 0, 1),
		(526, 'R', 'DHL Global Mail Business', 1, 0, 0, 1),
		(527, 'S', 'DHL Same Day', 1, 0, 0, 1),
		(528, 'T', 'DHL Express 12:00', 1, 0, 0, 1),
		(529, 'U', 'DHL Express Worldwide', 1, 0, 0, 1),
		(530, 'W', 'DHL Economy Select', 1, 0, 0, 1),
		(531, 'X', 'DHL Express Envelope', 1, 0, 0, 1),
		(601, 'AUS_PARCEL_REGULAR', 'Parcel Post', 1, 1, 0, 1),
		(602, 'AUS_PARCEL_REGULAR_SATCHEL_LARGE', 'Parcel Post', 1, 0, 7, 1),
		(603, 'AUS_PARCEL_EXPRESS', 'Express Post', 1, 0, 9, 1),
		(604, 'AUS_PARCEL_EXPRESS_SATCHEL_LARGE', 'Express Post', 1, 0, 16, 1),
		(605, 'INT_PARCEL_COR_OWN_PACKAGING', 'International Post Courier', 1, 0, 0, 0),
		(606, 'INT_PARCEL_EXP_OWN_PACKAGING', 'International Post Express', 1, 0, 0, 0),
		(608, 'INT_PARCEL_STD_OWN_PACKAGING', 'International Post Standard', 1, 0, 0, 0),
		(611, 'INT_PARCEL_AIR_OWN_PACKAGING', 'International Post Economy', 1, 0, 0, 0),
		(612, 'INT_PARCEL_SEA_OWN_PACKAGING', 'International Post Economy', 1, 0, 0, 0),
		(614, 'INT_LETTER_REG_SMALL', 'International Economy Letter', 0, 0, 0, 0),
		(615, 'INT_LETTER_REG_LARGE', 'International Economy Letter', 0, 0, 0, 0),
		(617, 'AUS_PARCEL_EXPRESS_SATCHEL_SMALL', 'Express Post', 0, 0, 14, 1),
		(618, 'AUS_PARCEL_EXPRESS_SATCHEL_MEDIUM', 'Express Post', 0, 0, 15, 1),
		(619, 'AUS_PARCEL_EXPRESS_SATCHEL_EXTRA_LARGE', 'Express Post', 0, 0, 17, 1),
		(620, 'AUS_PARCEL_REGULAR_PACKAGE_SMALL', 'Parcel Post', 0, 0, 1, 1),
		(621, 'AUS_PARCEL_REGULAR_PACKAGE_MEDIUM', 'Parcel Post', 0, 0, 2, 1),
		(622, 'AUS_PARCEL_REGULAR_PACKAGE_LARGE', 'Parcel Post', 0, 0, 3, 1),
		(630, 'AUS_PARCEL_REGULAR_PACKAGE_EXTRA_LARGE', 'Parcel Post', 0, 0, 4, 1),
		(623, 'AUS_PARCEL_EXPRESS_PACKAGE_SMALL', 'Express Post', 0, 0, 10, 1),
		(624, 'AUS_PARCEL_EXPRESS_PACKAGE_MEDIUM', 'Express Post', 0, 0, 11, 1),
		(625, 'AUS_PARCEL_EXPRESS_PACKAGE_LARGE', 'Express Post', 0, 0, 12, 1),
		(629, 'AUS_PARCEL_EXPRESS_PACKAGE_EXTRA_LARGE', 'Express Post', 0, 0, 13, 1),
		(626, 'AUS_PARCEL_REGULAR_SATCHEL_SMALL', 'Parcel Post', 0, 0, 5, 1),
		(627, 'AUS_PARCEL_REGULAR_SATCHEL_MEDIUM', 'Parcel Post', 0, 0, 6, 1),
		(628, 'AUS_PARCEL_REGULAR_SATCHEL_EXTRA_LARGE', 'Parcel Post', 0, 0, 8, 1),
		(701, '93', 'UPS SurePost', 1, 0, 0, 1);";
	ect_query($sSQL) or print_sql_error('');
}
// Dumping zonecharges table
if(checktablecreated('zonecharges')){
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (1,1,0.2,0.3,0.4)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (2,1,0.5,0.5,0.6)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (3,1,1,0.9,1.0)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (4,1,1.5,1.3,1.4)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (5,1,2,1.5,1.6)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (6,1,5,2,2.1)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (7,1,-1,0.5,0.6)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (8,2,0.2,0.4,0.5)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (9,2,0.5,0.7,0.8)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (10,2,1,1.1,1.2)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (11,2,1.5,1.6,1.7)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (12,2,2,2,2.1)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (13,2,5,3,3.1)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (14,2,-1,0.7,0.8)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (15,3,-1.1,0.8,0.9)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (16,3,0.2,0.5,0.6)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (17,3,0.5,0.8,0.9)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (18,3,1,1.2,1.3)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (19,3,1.5,1.7,1.8)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (20,3,2,2.2,2.3)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (21,3,5,3.2,3.3)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (22,4,-1,1,1.1)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (23,4,1,1.5,1.6)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (24,4,2,2.8,2.9)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (25,4,3,3.8,3.9)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (26,4,4,4.8,4.9)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (27,101,-1,1,1.1)");
	ect_query("INSERT INTO zonecharges (zcID,zcZone,zcWeight,zcRate,zcRate2) VALUES (28,101,1,1,1.1)");
}
if(checktablecreated('countries')){
	ect_query("UPDATE countries SET countryName2=countryName,countryName3=countryName") or print_sql_error('');
}
if(checktablecreated('orderstatus')){
	ect_query("UPDATE orderstatus SET statPublic2=statPublic,statPublic3=statPublic") or print_sql_error('');
}
if(checktablecreated('payprovider')){
	ect_query("UPDATE payprovider SET payProvShow2=payProvShow,payProvShow3=payProvShow") or print_sql_error('');
}

if($haserrors)
	print('<font color="#FF0000"><b>Completed, but with errors !</b></font><br />');
else
	print('<font color="#FF0000"><b>Everything installed successfully !</b></font><br />');

}else{

?>
<form action="createdb.php" method="POST">
<input type="hidden" name="posted" value="1">
<table width="100%">
<tr><td align="center" width="100%">
<p>&nbsp;</p>
<p><?php print "When reporting support issues, please quote your PHP version number which is " . phpversion();?></p>
<?php
$sSQL="SELECT version() AS theversion";
$result = ect_query($sSQL) or ect_error();
$rs = ect_fetch_assoc($result);
print "<p>mySQL Version is " . $rs["theversion"] . "</p>";
ect_free_result($result);
?>
<p>&nbsp;</p>
<p>Please click below to start your installation.</p>
<p>&nbsp;</p>
<p>After performing the installation, please delete this file from your web.</p>
<p>&nbsp;</p>
<p>Normally it is recommended to use the InnoDB database engine, but if you prefer to change this, please specify</p>
<select name="databaseengine" size="1">
<option value="">Use MyISAM Engine</option>
<option value="innodb" selected>Use InnoDB Engine (Recommended)</option>
</select>
<p>&nbsp;</p>
<input style="background:#399908; color:#fff;cursor:pointer;padding:5px 10px;-moz-border-radius:10px;-webkit-border-radius:10px" type="submit" value="Install Ecommerce Plus version <?php print $sVersion?>">
<p>&nbsp;</p>
<p>&nbsp;</p>
</td></tr>
</table>
</form>
<?php
}
?>
</div>
</body>
</html>