CREATE TABLE Shop_Categories (
  ID mediumint(9) NOT NULL auto_increment,
  Category tinytext NOT NULL,
  Parent tinytext NOT NULL,
  Image tinytext NOT NULL,
  Description text NOT NULL,
  MetaDescription text NOT NULL,
  Keywords text NOT NULL,
  Active enum('Yes','No') NOT NULL default 'Yes',
  HeaderImage tinytext NOT NULL,
  ListImage tinytext NOT NULL,
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Check (
  ID int(11) NOT NULL auto_increment, 
  IP varchar(25) NOT NULL default '', 
  CheckVar varchar(32) NOT NULL default '', 
  DateTime timestamp(14) NOT NULL, 
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Items (
  ID mediumint(9) NOT NULL auto_increment,
  Catalog tinytext NOT NULL,
  Item tinytext NOT NULL,
  Description text NOT NULL,
  SmImage tinytext NOT NULL,
  LgImage tinytext NOT NULL,
  Category1 tinytext NOT NULL,
  Category2 tinytext NOT NULL,
  Category3 tinytext NOT NULL,
  Units decimal(5,2) NOT NULL default '0.00',
  RegPrice decimal(8,2) NOT NULL default '0.00',
  SalePrice decimal(8,2) NOT NULL default '0.00',
  OutOfStock enum('Yes','No') NOT NULL default 'No',
  Active enum('Yes','No') NOT NULL default 'Yes',
  Inventory mediumint(9) default NULL,
  Keywords text NOT NULL,
  Category4 tinytext NOT NULL,
  Category5 tinytext NOT NULL,
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Options (
  ID mediumint(9) NOT NULL auto_increment,
  ItemID mediumint(9) NOT NULL default '0',
  OptionNum tinyint(4) NOT NULL default '0',
  Name tinytext NOT NULL,
  Type tinytext NOT NULL,
  Attributes text NOT NULL,
  Active enum('Yes','No') NOT NULL default 'Yes',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Defaults (
  ID tinyint(4) NOT NULL auto_increment,
  ProductID int(11) NOT NULL default '0',
  OptionID int(11) NOT NULL default '0',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Inventory (
  ID mediumint(9) NOT NULL auto_increment,
  ProductID mediumint(9) NOT NULL default '0',
  Attribute tinytext NOT NULL,
  Quantity varchar(4) NOT NULL default '',
  PRIMARY KEY  (ID)
);

CREATE TABLE Shop_Prices (
  ID tinyint(4) NOT NULL auto_increment,
  StartPrice decimal(8,2) NOT NULL default '0.00',
  EndPrice decimal(8,2) NOT NULL default '0.00',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Related (
  ID mediumint(9) NOT NULL auto_increment,
  ProductID mediumint(9) NOT NULL default '0',
  RelatedID mediumint(9) NOT NULL default '0',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Sales (
  ID mediumint(9) NOT NULL auto_increment,
  Quantity decimal(5,2) NOT NULL default '0.00',
  Item tinytext NOT NULL,
  Price decimal(8,2) NOT NULL default '0.00',
  Units decimal(5,2) NOT NULL default '0.00',
  DateSold date NOT NULL default '0000-00-00',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

CREATE TABLE Shop_Vars (
  ID tinyint(4) NOT NULL default '1',
  SiteName tinytext NOT NULL,
  URL tinytext NOT NULL,
  CatalogPage tinytext NOT NULL,
  AdminEmail tinytext NOT NULL,
  Keywords text NOT NULL,
  Description text NOT NULL,
  MalsCart tinytext NOT NULL,
  Currency tinytext NOT NULL,
  FontStyle tinytext NOT NULL,
  OrderButton tinytext NOT NULL,
  SearchButton tinytext NOT NULL,
  ProductLine tinytext NOT NULL,
  AllProductLink enum('Yes','No') NOT NULL default 'Yes',
  ItemColumns enum('1','2','3','4','5','6') NOT NULL default '1',
  ItemRows tinyint(4) NOT NULL default '3',
  NavBar tinytext NOT NULL,
  OptionNumber tinyint(4) NOT NULL default '3',
  ProductColor tinytext NOT NULL,
  ViewCartColor tinytext NOT NULL,
  CategoryColor tinytext NOT NULL,
  OrderOfProduct tinytext NOT NULL,
  InitialPage enum('inc/howtoshop.php','inc/new.php','custom.htm') NOT NULL default 'inc/howtoshop.php',
  ShowOOS enum('Yes','No') NOT NULL default 'Yes',
  OpenSet tinytext NOT NULL,
  ViewCartButton tinytext NOT NULL,
  PageNumbers enum('Yes','No') NOT NULL default 'Yes',
  AdvSearch enum('Yes','No') NOT NULL default 'Yes',
  EmailLink enum('Yes','No') NOT NULL default 'Yes',
  LimitedQty tinytext NOT NULL,
  SaleProductLink enum('Yes','No') NOT NULL default 'Yes',
  NewProductLink enum('Yes','No') NOT NULL default 'Yes',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

INSERT INTO Shop_Vars VALUES (1, 'Catalog', '', 'catalog.php', 'youremail', '', '', 'malseid', '$', 'Arial', '', '', '#000000', 'Yes', '1', 5, 'Vertical Display', 3, '#000000', '#000000', '#000000', 'Item', 'inc/howtoshop.php', 'Yes', '', '', 'Yes', 'Yes', 'Yes', 'Limited quantities for this item.', 'Yes', 'Yes');

CREATE TABLE Shop_Vars2 (
  ID tinyint(4) NOT NULL auto_increment,
  ImageHeight char(3) NOT NULL default '100',
  ImageWidth char(3) NOT NULL default '100',
  InventoryLimit varchar(4) NOT NULL default '9999',
  InventoryCheck enum('Yes','No') NOT NULL default 'Yes',
  AdminLinks varchar(5) NOT NULL default 'small',
  ThumbnailDir varchar(30) NOT NULL default 'images',
  LgImageDir varchar(30) NOT NULL default 'images',
  CatImageDir varchar(30) NOT NULL default 'images',
  ImageDir varchar(30) NOT NULL default 'images',
  SmFontSize char(1) NOT NULL default '1',
  FontSize char(1) NOT NULL default '2',
  LgFontSize char(1) NOT NULL default '3',
  PageExt varchar(4) NOT NULL default 'php',
  RelatedMsg tinytext NOT NULL,
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);

INSERT INTO Shop_Vars2 VALUES (1, '100', '100', '9999', 'Yes', 'small', 'images', 'images', 'images', 'images', '1', '2', '3', 'php', 'Customers who ordered this product also bought:');

CREATE TABLE Shop_Wholesale (
  ID mediumint(9) NOT NULL auto_increment,
  Company tinytext NOT NULL,
  Email tinytext NOT NULL,
  Contact text NOT NULL,
  Password tinytext NOT NULL,
  Discount decimal(4,2) NOT NULL default '0.00',
  Active enum('Yes','No') NOT NULL default 'Yes',
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID),
  KEY ID_2 (ID)
);
