# $Id: createdb_mysql,v 1.2 2003/09/16 20:31:48 damonp Exp $
#
# Copyright (C) 2002 siliconsys.com <dev@siliconsys.com>
# See LICENSE file in root directory of this installation for
# licensing information.
#

#
# Table structure for table `phpc_catalog`
#

DROP TABLE IF EXISTS phpc_catalog;
CREATE TABLE phpc_catalog (
  product_id smallint(6) NOT NULL auto_increment,
  product_t_stamp bigint(20) NOT NULL default '0',
  product_sku varchar(20) default NULL,
  category_id smallint(6) default NULL,
  product_name varchar(60) NOT NULL default '',
  product_desc text NOT NULL,
  product_color varchar(20) default NULL,
  product_size varchar(20) default NULL,
  product_price decimal(12,2) NOT NULL default '0.00',
  image_path varchar(254) default NULL,
  thumb_path varchar(254) default NULL,
  product_use_tag varchar(10) NOT NULL default 'OPEN',
  PRIMARY KEY  (product_id)
) TYPE=MyISAM;

# --------------------------------------------------------

#
# Table structure for table `phpcatalog_categories`
#

DROP TABLE IF EXISTS phpcatalog_categories;
CREATE TABLE phpcatalog_categories (
  category_id smallint(6) NOT NULL auto_increment,
  parent_id smallint(6) NOT NULL default '0',
  catalog_id smallint(6) NOT NULL default '0',
  category_name varchar(50) default NULL,
  PRIMARY KEY  (category_id,parent_id,catalog_id)
) TYPE=MyISAM;

#
# Dumping data for table `phpcatalog_categories`
#

INSERT INTO phpcatalog_categories VALUES (1, 0, 1, 'Top Category');

# --------------------------------------------------------

#
# Table structure for table `phpcatalog_config`
#

DROP TABLE IF EXISTS phpcatalog_config;
CREATE TABLE `phpcatalog_config` (
  `config_id` int(6) NOT NULL auto_increment,
  `catalog_id` int(4) NOT NULL default '0',
  `config_key` varchar(50) NOT NULL default '',
  `config_value` varchar(254) NOT NULL default '',
  PRIMARY KEY  (`config_id`),
  KEY `catalog_id` (`catalog_id`),
  KEY `config_key` (`config_key`),
  KEY `config_value` (`config_value`)
) TYPE=MyISAM;

#
# Dumping data for table `phpcatalog_config`
#

INSERT INTO `phpcatalog_config` VALUES (1, 1, 'catalog_name', 'catalog');
INSERT INTO `phpcatalog_config` VALUES (2, 1, 'currency_sym', '$');
INSERT INTO `phpcatalog_config` VALUES (3, 1, 'currency_location', 'before');
INSERT INTO `phpcatalog_config` VALUES (4, 1, 'thousand_sep', ',');
INSERT INTO `phpcatalog_config` VALUES (5, 1, 'decimal_sep', '.');
INSERT INTO `phpcatalog_config` VALUES (6, 1, 'num_items_page', '10');
INSERT INTO `phpcatalog_config` VALUES (7, 1, 'num_stats', '5');
INSERT INTO `phpcatalog_config` VALUES (8, 1, 'stats_duration', '14');
INSERT INTO `phpcatalog_config` VALUES (9, 1, 'num_specials', '5');
INSERT INTO `phpcatalog_config` VALUES (10, 1, 'price_on_request', '<a href="mailto:sales@domain.com?subject=Pricing information for PRODUCT_SKU - PRODUCT_NAME">Click here</a> for pricing');

# --------------------------------------------------------

#
# Table structure for table `phpcatalog_help`
#

DROP TABLE IF EXISTS phpcatalog_help;
CREATE TABLE phpcatalog_help (
  help_id tinyint(4) NOT NULL auto_increment,
  help_section varchar(20) NOT NULL default '',
  help_function varchar(20) NOT NULL default '',
  help_text text NOT NULL,
  PRIMARY KEY  (help_id)
) TYPE=MyISAM;

INSERT INTO phpcatalog_help VALUES (1, 'catalog', 'default', '<p>This screen allows the addition of a new catalog item.</p>\r\n');
INSERT INTO phpcatalog_help VALUES (2, 'catalog', 'add', '<p>This screen allows the addition of a new catalog item.</p>\r\n<p>The <b>sku</b> field accepts letters or digits for a stock number for the item.  This may be helpful for internally tracking the catalog items.</p>\r\n<p>The <b>price</b> field accepts a decimal number without a currency symbol for the product price.  The currency symbol and decimal formatting may be changed from the configuration area.</p>\r\n<p>The <b>category</b> field accepts either a selection from the pulldown menu (in which case the text box should be left blank) or a combination of inputs in both the pull-down and the input box.  If both inputs are given, the value in the text box will be created as a subcategory of the category selected with the pull down.  To create a top level category, leave the pull-down at its default value <i>Select a category</i></p>\r\n<p>The <b>image file</b> field allows the uploading of a file to be inserted into the catalog for the catalog detail view.  Click on browse and find the file on the local computer.</p>\r\n<p>The <b>thumbnail generation</b> field turns on/off thumbnail generation for the image file above. To generate a thumbnail and set the corresponding text box to a percentage size.</p>\r\n<p>The <b>thumbnail file</b> field allows the uploading of a file to be inserted into the catalog for the catalog list view.  Click on browse and find the file on the local computer.</p>\r\n<p>The <b>use tag</b> field sets the use tag for this item.  Possible values are <i>OPEN</i>, <i>SPECIAL</i> or <i>SOLD</i>, the default is <i>OPEN</i>. </p>');
INSERT INTO phpcatalog_help VALUES (3, 'catalog', 'edit', '<p>This screen allows the editing of an existing catalog item.</p>\r\n<p>The <b>sku</b> field accepts letters or digits for a stock number for the item.  This may be helpful for internally tracking the catalog items.</p>\r\n<p>The <b>price</b> field accepts a decimal number without a currency symbol for the product price.  The currency symbol and decimal formatting may be changed from the configuration area.</p>\r\n<p>The <b>category</b> field accepts either a selection from the pulldown menu (in which case the text box should be left blank) or a combination of inputs in both the pull-down and the input box.  If both inputs are given, the value in the text box will be created as a subcategory of the category selected with the pull down.  To create a top level category, leave the pull-down at its default value <i>Select a category</i></p>\r\n<p>The <b>image file</b> field allows the uploading of a file to be inserted into the catalog for the catalog detail view.  Click on browse and find the file on the local computer.</p>\r\n<p>The <b>thumbnail generation</b> field turns on/off thumbnail generation for the image file above. To generate a thumbnail and set the corresponding text box to a percentage size. A thumbnail can only be generated by uploading a new image file</p>\r\n<p>The <b>thumbnail file</b> field allows the uploading of a file to be inserted into the catalog for the catalog list view.  Click on browse and find the file on the local computer.</p>\r\n<p>The <b>use tag</b> field sets the use tag for this item.  Possible values are <i>OPEN</i>, <i>SPECIAL</i> or <i>SOLD</i>, the default is <i>OPEN</i>. </p>');
INSERT INTO phpcatalog_help VALUES (4, 'catalog', 'list', '<p>This screen lists the content items by category.</p>\r\n<li>click on the   <img src="../image/icon/edit.png" border="0">   icon to \'edit\' the catalog item\r\n<li>click on the   <img src="../image/icon/delete.png" border="0">   icon to \'delete\' the catalog item\r\n<li>click on the   <img src="../image/icon/view.png" border="0">   icon to \'view\' the catalog item\r\n<p>Items may be sorted by the relevent column by clicking on the column header. Clicking on the same header twice will reverse the sort order on that column.</p>');
INSERT INTO phpcatalog_help VALUES (5, 'config', 'config', '<p>This screen allows the configuration of the catalog variables.</p>\r\n<p>The <b>currency symbol</b> field sets the symbol displayed before any prices.</p>\r\n<p>The <b>thousand separator</b> and <b>decimal separator</b> fields control the way price fields are displayed.  The default setting is for American dollar amounts.</p>\r\n<p>The <b>number of items page</b> field sets the number of items displayed per page in the catalog list view.  If the list exceeds this number the pagination links will appear in the catalog list view.</p>\r\n<p>The <b>number of stats to show</b> field sets the number of items to show in the <i>Top Products</i> box in the catalog list and detail views.  Set this value to \'0\' to disable displaying of the product stats.</p>\r\n<p>The <b>duration of stats</b> field sets the time period for the system to look back when calculating the top products.</p>\r\n<p>The <b>number of specials to show</b> field sets the number of specials to show in the specials box.  Specials may be designated by setting the catalog item\'s <i>use tag</i> to <i>SPECIAL</i>.</p>\r\n<p>The <b>price on request</b> field sets the text to replace a price with if the price field is set to \'0.00\'.  This may be a mailto link or a href link to a price list.  There are several variable fields that may be used in this field: \'PRODUCT_ID\' will be replaced with the product id of the item and \'PRODUCT_NAME\' will be replaced by the name of the product in the catalog detail view.  See the example below:\r\n<blockquote>\r\n<code>\r\n&lt;a href="mailto:dev@siliconsys.com?subject=Info Request for PRODUCT_NAME"&gt;request pricelist&lt;/a&gt;\r\n</code>\r\n</blockquote>\r\n</p>\r\n');
INSERT INTO phpcatalog_help VALUES (6, 'config', 'categories', '<p>This screen lists all categories and allows adding and modifying categories.</p>\r\n<li>click on the   <img src="../image/icon/edit.png" border="0">   icon to \'edit\' the category name\r\n<li>click on the   <img src="../image/icon/delete.png" border="0">   icon to \'delete\' the category. <font color="red">the category must be empty</font>\r\n<li>click on the   <img src="../image/icon/view.png" border="0">   icon to \'add\' a category under the selected category');

# --------------------------------------------------------

#
# Table structure for table `phpcatalog_stats`
#

DROP TABLE IF EXISTS phpcatalog_stats;
CREATE TABLE phpcatalog_stats (
  catalog_id smallint NOT NULL default '0',
  t_stamp bigint(20) NOT NULL default '0',
  product_id smallint NOT NULL default '0',
  KEY catalog_id (catalog_id),
  KEY product_id (product_id),
  KEY t_stamp (t_stamp)
) TYPE=MyISAM;
# --------------------------------------------------------

# end