Database Schema

From PhpCOIN Documentation

Jump to: navigation, search

The database in phpCOIN is pretty simple.


Contents

Users

The whole purpose of phpCOIN is for tracking and working with customers, so naturally we need some tables dealing with the system users.

Administrators

Naturally a website needs one or more users who are needed to change site content. The "admins" table fulfills this purpose, with "webmaster" being the default administrator.

CREATE TABLE phpcoin_admins (
  `admin_id` smallint(6) NOT NULL auto_increment,
  `admin_user_name` varchar(30) NOT NULL default ,
  `admin_user_pword` varchar(100) NOT NULL default ,
  `admin_name_first` varchar(20) NOT NULL default 'none',
  `admin_name_last` varchar(20) NOT NULL default 'none',
  `admin_email` varchar(50) NOT NULL default 'none',
  `admin_perms` int(11) NOT NULL default 0,
  PRIMARY KEY (admin_id),
  UNIQUE KEY `user_name` (admin_user_name)
) TYPE=MyISAM COMMENT='Site Admins Table';

Clients

The entire reason for being is clients. The main client record looks like this.

CREATE TABLE phpcoin_clients (
  cl_id int(11) NOT NULL default 0,
  cl_join_ts varchar(10) default NULL,
  cl_status varchar(20) NOT NULL default 'pending',
  cl_company varchar(50) NOT NULL default ,
  cl_name_first varchar(20) NOT NULL default ,
  cl_name_last varchar(20) NOT NULL default ,
  cl_addr_01 varchar(50) NOT NULL default ,
  cl_addr_02 varchar(50) NOT NULL default ,
  cl_city varchar(50) NOT NULL default ,
  cl_state_prov varchar(50) NOT NULL default ,
  cl_country varchar(50) NOT NULL default ,
  cl_zip_code varchar(12) NOT NULL default ,
  cl_phone varchar(20) NOT NULL default ,
  cl_email varchar(50) NOT NULL default ,
  cl_user_name varchar(20) NOT NULL default ,
  cl_user_pword varchar(100) NOT NULL default ,
  cl_notes text NOT NULL,
  cl_groups int(11) NOT NULL default 0,
  PRIMARY KEY (cl_id)
) TYPE=MyISAM COMMENT='Site Clients Module Table';

Here is how we track additional emails for a client.

CREATE TABLE phpcoin_clients_contacts (
  contacts_id int(11) NOT NULL auto_increment,
  contacts_cl_id int(11) NOT NULL default 0,
  contacts_name_first varchar(20) NOT NULL default ,
  contacts_name_last varchar(20) NOT NULL default ,
  contacts_email varchar(50) NOT NULL default ,
  UNIQUE KEY contacts_id (contacts_id),
  KEY contacts_cl_id (contacts_cl_id)
) TYPE=MyISAM AUTO_INCREMENT=1;


Site Content

Every website needs something to display to the users, and phpCOIN is no exception.

Articles

Articles can be used as technical manuals, general interest articles, or categorized news listings ~ the possibilities are endless.

CREATE TABLE phpcoin_articles (
  id int(9) NOT NULL auto_increment,
  subject varchar(50) NOT NULL default ,
  topic_id int(11) NOT NULL default 1,
  cat_id int(11) NOT NULL default 1,
  time_stamp varchar(10) default NULL,
  entry mediumtext NOT NULL,
  followup_cnt int(9) NOT NULL default 0,
  auto_nl2br tinyint(1) NOT NULL default 1,
  PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Site Articles Module Table';

Pages

Pages can be used for tutorials or similar functiosn becaus they allow home/Prev/Next links. phpCOIN uses them to store extremely long system messages.

CREATE TABLE phpcoin_pages (
  id int(9) NOT NULL auto_increment,
  subject varchar(50) NOT NULL default ,
  topic_id int(11) NOT NULL default 1,
  cat_id int(11) NOT NULL default 1,
  time_stamp varchar(10) default NULL,
  pages_title varchar(50) default NULL,
  pages_code longtext NOT NULL,
  pages_block_it tinyint(1) NOT NULL default 0,
  pages_status tinyint(1) NOT NULL default 0,
  pages_admin tinyint(1) NOT NULL default 0,
  pages_link_menu tinyint(1) NOT NULL default 0,
  pages_link_prev int(11) NOT NULL default 0,
  pages_link_home int(11) NOT NULL default 0,
  pages_link_next int(11) NOT NULL default 0,
  PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Site Pages Module Table';

Categories and Topics

Categories and Topics are used to divide Articles and Pages into useful groupings.

CREATE TABLE phpcoin_categories (
  cat_id int(11) NOT NULL auto_increment,
  cat_pos smallint(6) NOT NULL default 0,
  cat_name varchar(50) NOT NULL default ,
  cat_desc varchar(50) NOT NULL default ,
  cat_icon smallint(6) NOT NULL default 1,
  PRIMARY KEY (cat_id), KEY cat_id (cat_id)
) TYPE=MyISAM COMMENT='Site Categories Table';

CREATE TABLE `phpcoin_topics` (
  `topic_id` mediumint(9) NOT NULL auto_increment,
  `topic_pos` smallint(6) NOT NULL default '0',
  `topic_name` varchar(50) NOT NULL default ,
  `topic_desc` varchar(50) NOT NULL default ,
  `topic_icon` smallint(6) NOT NULL default '1',
  PRIMARY KEY  (`topic_id`)
) TYPE=MyISAM COMMENT='Site Topics Table';

SiteInfo

SiteInfo is the main website content that is shown to users, such as the index page, "about us", and more.

CREATE TABLE phpcoin_site_info (
  si_id int(11) NOT NULL auto_increment,
  si_group varchar(32) default NULL,
  si_name varchar(32) default NULL,
  si_seq_no int(11) default NULL,
  si_desc varchar(50) default NULL,
  si_block_it tinyint(1) NOT NULL default 0,
  si_title varchar(50) default NULL,
  si_code longtext,
  si_status tinyint(1) NOT NULL default 0,
  si_footer_menu tinyint(1) NOT NULL default 1,
  PRIMARY KEY (si_id)
) TYPE=MyISAM COMMENT='Site SiteInfo Table';

FAQ System

The FAQ sysetm is composed of two tables: FAQ Topics (FAQ) and Questions and Answers (FAQ QA)

CREATE TABLE phpcoin_faq (
  faq_id int(9) NOT NULL auto_increment,
  faq_position int(9) NOT NULL default 1,
  faq_time_stamp_mod varchar(10) default NULL,
  faq_status tinyint(1) NOT NULL default 0,
  faq_admin tinyint(1) NOT NULL default 0,
  faq_user tinyint(1) NOT NULL default 0,
  faq_title varchar(50) NOT NULL default ,
  faq_descrip mediumtext NOT NULL, PRIMARY KEY (faq_id)
) TYPE=MyISAM COMMENT='Site FAQ Module Table';

CREATE TABLE phpcoin_faq_qa (
  faqqa_id int(9) NOT NULL auto_increment,
  faqqa_faq_id int(11) NOT NULL default 0,
  faqqa_position int(9) NOT NULL default 1,
  faqqa_time_stamp_mod varchar(10) default NULL,
  faqqa_status tinyint(1) NOT NULL default 0,
  faqqa_question varchar(255) NOT NULL default ,
  faqqa_answer mediumtext NOT NULL,
  faqqa_auto_nl2br tinyint(1) NOT NULL default 1,
  PRIMARY KEY (faqqa_id)
) TYPE=MyISAM COMMENT='Site FAQ Module QA Table';

Icons

This table was intended to hold icons to match up with the topics and catgories, but was never implemented

CREATE TABLE phpcoin_icons (
  icon_id smallint(6) NOT NULL auto_increment,
  icon_name varchar(32) NOT NULL default ,
  icon_desc varchar(50) NOT NULL default ,
  icon_filename varchar(32) NOT NULL default 'default.gif',
  PRIMARY KEY (icon_id)
) TYPE=MyISAM COMMENT='Site Icons Table';


System Configuration

phpCOIN has a variety of tables that hold various configuration information.

Banned IP

Sometimes you just do not want a specific user to be able to access your website

CREATE TABLE phpcoin_banned (
  banned_ip varchar(15) NOT NULL default 
) TYPE=MyISAM COMMENT='Site Banned IP Address Table';

Components

The components table tells phpCOIN how to handle columns, page title, access restrictions, etc. for a certain type of output, or even a specific output page within a type.

CREATE TABLE phpcoin_components (
  comp_id mediumint(9) NOT NULL auto_increment,
  comp_type varchar(20) NOT NULL default ,
  comp_name varchar(20) NOT NULL default ,
  comp_mod varchar(20) NOT NULL default ,
  comp_desc varchar(50) NOT NULL default ,
  comp_ptitle varchar(50) NOT NULL default ,
  comp_col_num tinyint(1) NOT NULL default 3,
  comp_isadmin tinyint(1) NOT NULL default 0,
  comp_isuser tinyint(1) NOT NULL default 0,
  comp_status tinyint(1) NOT NULL default 1,
  PRIMARY KEY (comp_id),
  KEY comp_id (comp_id)
) TYPE=MyISAM COMMENT='Site Components Table';

Side Menus

Side menus are controlled by two tables. Menu blocks is the "wrapper" for a block and is basically the grouping for the menu items. Menu block contents is the actual menu items.

CREATE TABLE phpcoin_menu_blocks (
  block_id smallint(6) NOT NULL auto_increment,
  block_pos smallint(6) NOT NULL default 0,
  block_title varchar(30) NOT NULL default ,
  block_status tinyint(1) NOT NULL default 0,
  block_admin tinyint(1) NOT NULL default 0,
  block_user tinyint(1) NOT NULL default 0,
  block_col char(1) NOT NULL default 'L',
  PRIMARY KEY (block_id),
  UNIQUE KEY block_id (block_id)
) TYPE=MyISAM COMMENT='Site Menu Blocks Table';

CREATE TABLE phpcoin_menu_blocks_items (
  block_id smallint(6) NOT NULL default 0,
  item_id smallint(6) NOT NULL default 0,
  item_text varchar(30) NOT NULL default ,
  item_url varchar(100) NOT NULL default ,
  item_target tinyint(1) NOT NULL default 0,
  item_type tinyint(1) NOT NULL default 0,
  item_status tinyint(1) NOT NULL default 1,
  item_admin tinyint(1) NOT NULL default 0,
  item_user tinyint(1) NOT NULL default 0,
  PRIMARY KEY (block_id,item_id)
) TYPE=MyISAM COMMENT='Site Menu Blocks Items Table';

Parameters

This is the main configuration table, with hundreds of options for controlling how phpCOIN operates.

CREATE TABLE phpcoin_parameters (
  parm_id int(11) NOT NULL auto_increment,
  parm_group varchar(10) NOT NULL default 'common',
  parm_group_sub varchar(10) NOT NULL default 'undefined',
  parm_type char(1) NOT NULL default 'S',
  parm_name varchar(50) NOT NULL default ,
  parm_desc varchar(50) NOT NULL default ,
  parm_value varchar(100) NOT NULL default ,
  parm_notes text NOT NULL,
  PRIMARY KEY (parm_id),
  UNIQUE KEY `parm_name` (`parm_name`)
) TYPE=MyISAM COMMENT='Site Parameters Table';

Site Email Addresses

This table holds generic addresses that most businesses would have, such as sales, orders, support, etc., and their corresponding actual email addresses.

CREATE TABLE phpcoin_mail_contacts (
  mc_id int(11) NOT NULL auto_increment,
  mc_name varchar(30) NOT NULL default ,
  mc_email varchar(50) NOT NULL default ,
  mc_status tinyint(1) NOT NULL default 1,
  PRIMARY KEY (mc_id)
) TYPE=MyISAM COMMENT='Site Mail Contacts Table';

Automated Reminders

phpCOIN can automatically nag customers who are overdue.

CREATE TABLE phpcoin_reminders (
  overdue_id int(11) NOT NULL auto_increment,
  overdue_title varchar(50) NOT NULL default ,
  overdue_active char(1) NOT NULL default 1,
  overdue_days tinyint(4) NOT NULL default 10,
  overdue_subject varchar(150) NOT NULL default ,
  overdue_template text NOT NULL,
  overdue_cc_support tinyint(1) NOT NULL default 0,
  UNIQUE KEY overdue_id (overdue_id)
) TYPE=MyISAM;

Email Templates

Most of the emails sent by phpCOIN are appended as content to one of the email templates, thereby allowing you to modify the content of the message to suit your needs.

CREATE TABLE phpcoin_mail_templates (
  mt_id int(11) NOT NULL auto_increment,
  mt_name varchar(50) NOT NULL default ,
  mt_text text NOT NULL,
  PRIMARY KEY (mt_id)
) TYPE=MyISAM COMMENT='Site eMail Templates Table';

phpCOIN Version

This table is how phpCOIN is able to determine whether or not to auto-redirect to the setup page, and if so whether you are installing or upgrading.

CREATE TABLE phpcoin_versions (
  v_id smallint(6) NOT NULL auto_increment,
  v_ts varchar(10) NOT NULL default ,
  v_ver varchar(8) NOT NULL default ,
  v_type varchar(10) NOT NULL default 'Install',
  PRIMARY KEY (v_id)
) TYPE=MyISAM COMMENT='Package Versions Table';

User Tracking

phpCOIN needs to track users as they progress through the site, so it knows whetehr they are a guest, user, admin, and more. The contents of this table are temporary.

CREATE TABLE phpcoin_sessions (
  s_id varchar(36) NOT NULL default ,
  s_time_init int(11) NOT NULL default 0,
  s_time_last int(11) NOT NULL default 0,
  s_ip varchar(16) NOT NULL default '000.000.000.000',
  s_is_admin tinyint(1) NOT NULL default 0,
  s_is_user tinyint(1) NOT NULL default 0,
  s_time_last_contact int(11) NOT NULL default 0,
  s_time_last_order int(11) NOT NULL default 0,
  PRIMARY KEY (s_id)
) TYPE=MyISAM COMMENT='Site Sessions Table';


Domains

If you are using phpCOIN to manage a web-hosting business, then you need to be ab;ele to track domains. The server info table holds information about the servers that your hosting business uses.

CREATE TABLE phpcoin_server_info (
  si_id smallint(6) NOT NULL auto_increment,
  si_name varchar(20) NOT NULL default ,
  si_ip varchar(15) NOT NULL default '000.000.000.000',
  si_ns_01 varchar(50) NOT NULL default ,
  si_ns_01_ip varchar(15) NOT NULL default '000.000.000.000',
  si_ns_02 varchar(50) NOT NULL default ,
  si_ns_02_ip varchar(15) NOT NULL default '000.000.000.000',
  si_cp_url varchar(50) NOT NULL default ,
  si_cp_url_port int(11) NOT NULL default 0,
  PRIMARY KEY (si_id)
) TYPE=MyISAM COMMENT='Site Server Info Table';

The actual domains that you host are contained in this table.

CREATE TABLE phpcoin_domains (
  dom_id int(11) NOT NULL auto_increment,
  dom_cl_id int(11) NOT NULL default 0,
  dom_domain varchar(50) NOT NULL default ,
  dom_status tinyint(2) NOT NULL default 0,
  dom_type tinyint(2) NOT NULL default 0,
  dom_registrar varchar(32) NOT NULL default ,
  dom_ts_expiration varchar(10) NOT NULL default ,
  dom_sa_expiration varchar(10) NOT NULL default ,
  dom_si_id int(11) NOT NULL default 0,
  dom_ip varchar(16) NOT NULL default ,
  dom_path varchar(255) NOT NULL default ,
  dom_path_temp varchar(255) NOT NULL default ,
  dom_url_cp varchar(100) NOT NULL default ,
  dom_user_name_cp varchar(30) NOT NULL default ,
  dom_user_pword_cp varchar(30) NOT NULL default ,
  dom_user_name_ftp varchar(30) NOT NULL default ,
  dom_user_pword_ftp varchar(30) NOT NULL default ,
  dom_allow_domains smallint(6) NOT NULL default 0,
  dom_allow_subdomains smallint(6) NOT NULL default 0,
  dom_allow_disk_space_mb int(11) NOT NULL default 0,
  dom_allow_traffic_mb int(11) NOT NULL default 0,
  dom_allow_mailboxes smallint(6) NOT NULL default 0,
  dom_allow_databases smallint(6) NOT NULL default 0,
  dom_enable_www_prefix tinyint(1) NOT NULL default 0,
  dom_enable_wu_scripting tinyint(1) NOT NULL default 0,
  dom_enable_webmail tinyint(1) NOT NULL default 0,
  dom_enable_frontpage tinyint(1) NOT NULL default 0,
  dom_enable_fromtpage_ssl tinyint(1) NOT NULL default 0,
  dom_enable_ssi tinyint(1) NOT NULL default 0,
  dom_enable_php tinyint(1) NOT NULL default 0,
  dom_enable_cgi tinyint(1) NOT NULL default 0,
  dom_enable_mod_perl tinyint(1) NOT NULL default 0,
  dom_enable_asp tinyint(1) NOT NULL default 0,
  dom_enable_ssl tinyint(1) NOT NULL default 0,
  dom_enable_stats tinyint(1) NOT NULL default 0,
  dom_enable_err_docs tinyint(1) NOT NULL default 0,
  dom_notes text NOT NULL,
  PRIMARY KEY (dom_id)
) TYPE=MyISAM COMMENT='Site Domains Module Table';

When hosting, you need to be able to determine if a domain name is available, and also if you will host that particular TLD.

CREATE TABLE phpcoin_whois (
  whois_id int(11) NOT NULL auto_increment,
  whois_server varchar(100) NOT NULL default ,
  whois_nomatch varchar(40) NOT NULL default ,
  whois_value varchar(20) NOT NULL default ,
  whois_display varchar(25) NOT NULL default ,
  whois_include tinyint(1) NOT NULL default 1,
  whois_prod_id int(11) NOT NULL default 0,
  whois_notes text,
  UNIQUE KEY whois_id (whois_id)
) TYPE=MyISAM;


Customer Support Requests

Customer support traqcking is hanlded via the helpdesk (ticket) table, with the helpdesk_msgs table containing susequent mesages for each ticket.

CREATE TABLE phpcoin_helpdesk (
  hd_tt_id int(11) NOT NULL default 0,
  hd_tt_cl_id int(11) NOT NULL default 0,
  hd_tt_cl_email varchar(50) NOT NULL default ,
  hd_tt_time_stamp varchar(10) default NULL,
  hd_tt_priority varchar(20) NOT NULL default ,
  hd_tt_category varchar(20) NOT NULL default ,
  hd_tt_subject varchar(50) NOT NULL default ,
  hd_tt_message text NOT NULL,
  hd_tt_cd_id int(11) NOT NULL default 0,
  hd_tt_url varchar(50) NOT NULL default ,
  hd_tt_status varchar(20) NOT NULL default ,
  hd_tt_closed int(1) NOT NULL default 0,
  hd_tt_rating int(1) NOT NULL default 0,
  PRIMARY KEY  (hd_tt_id)
) TYPE=MyISAM COMMENT='Site HelpDesk Module Table';

CREATE TABLE phpcoin_helpdesk_msgs (
  hdi_tt_id int(11) NOT NULL default 0,
  hdi_tt_time_stamp varchar(10) default NULL,
  hdi_tt_cl_id int(11) NOT NULL default 0,
  hdi_tt_ad_id int(11) NOT NULL default 0,
  hdi_tt_message text NOT NULL)
) TYPE=MyISAM COMMENT='Site HelpDesk Module Messages Table';


Invoices

While Orders can be for only one item, an invoice can be for multiple items so more than one table is needed for invoice tracking. Invoices are tracked through the invoices table, with items for each invoice in the invcoices_items table. The invoices_trans table is a summary of invoices and payments.

CREATE TABLE phpcoin_invoices (
  invc_id int(11) NOT NULL default 0,
  invc_status varchar(20) NOT NULL default 'draft',
  invc_deliv_method varchar(10) NOT NULL default ,
  invc_delivered tinyint(1) NOT NULL default 0,
  invc_cl_id int(11) NOT NULL default 0,
  invc_total_cost decimal(10,2) NOT NULL default '0.00',
  invc_total_paid decimal(10,2) NOT NULL default '0.00',
  invc_subtotal_cost decimal(10,2) NOT NULL default '0.00',
  invc_tax_01_percent decimal(5,3) NOT NULL default '0.00',
  invc_tax_01_amount decimal(10,2) NOT NULL default '0.00',
  invc_tax_02_percent decimal(5,3) NOT NULL default '0.00',
  invc_tax_02_amount decimal(10,2) NOT NULL default '0.00',
  invc_tax_autocalc tinyint(1) NOT NULL default 1,
  invc_ts varchar(10) default NULL,
  invc_ts_due varchar(10) default NULL,
  invc_ts_paid varchar(10) default NULL,
  invc_bill_cycle tinyint(1) NOT NULL default 1,
  invc_recurring tinyint(1) NOT NULL default 0,
  invc_recurr_proc tinyint(4) NOT NULL default 0,
  invc_last_nag_id int(11) NOT NULL default 0,                        // added in phpCOIN v1.2.6
  invc_pay_link text NOT NULL,
  invc_terms text NOT NULL,
  PRIMARY KEY (invc_id)
) TYPE=MyISAM COMMENT='Site Invoices Module Table';

CREATE TABLE phpcoin_invoices_items (
  ii_invc_id int(11) NOT NULL default 0,
  ii_item_no smallint(4) NOT NULL default 0,
  ii_item_name varchar(30) NOT NULL default ,
  ii_item_desc varchar(75) NOT NULL default ,
  ii_item_cost decimal(10,2) NOT NULL default '0.00',
  ii_apply_tax_01 tinyint(1) NOT NULL default 1,
  ii_apply_tax_02 tinyint(1) NOT NULL default 1,
  ii_calc_tax_02_pb tinyint(1) NOT NULL default 0,
  PRIMARY KEY (ii_invc_id,ii_item_no)
) TYPE=MyISAM COMMENT='Site Invoices Module Items Table';

CREATE TABLE phpcoin_invoices_trans (
  it_id bigint(11) NOT NULL auto_increment,
  it_ts varchar(10) default NULL,
  it_invc_id int(11) NOT NULL default 0,
  it_type tinyint(2) NOT NULL default 0,
  it_origin tinyint(2) NOT NULL default 0,
  it_desc varchar(50) NOT NULL default ,
  it_amount decimal(10,2) NOT NULL default '0.00',
  PRIMARY KEY (it_id)
) TYPE=MyISAM COMMENT='Site Invoices Module Transactions Table';

Email Handling

phpCOIN has several tables dealing with email. The mail archive is a copy of messages sent and received through phpCOIN. The mail queue is designed to handle email processing when a large number of messages must be procesed, so that phpCOIN does not time-out while waiting. It is not yet implemented in phpCOIN v1.x

CREATE TABLE phpcoin_mail_archive (
  ma_id bigint(11) NOT NULL auto_increment,
  ma_time_stamp varchar(10) default NULL,
  ma_fld_from varchar(100) NOT NULL default ,
  ma_fld_recip varchar(100) NOT NULL default ,
  ma_fld_cc varchar(100) NOT NULL default ,
  ma_fld_bcc varchar(100) NOT NULL default ,
  ma_fld_subject varchar(100) NOT NULL default ,
  ma_fld_message text NOT NULL,
  PRIMARY KEY (ma_id)
) TYPE=MyISAM COMMENT='Site eMail Archive Table';

CREATE TABLE phpcoin_mail_queue (
  mq_id bigint(11) NOT NULL default 0,
  mq_time_stamp varchar(10) default NULL,
  mq_fld_from varchar(100) NOT NULL default ,
  mq_fld_recip varchar(100) NOT NULL default ,
  mq_fld_cc varchar(100) NOT NULL default ,
  mq_fld_bcc varchar(100) NOT NULL default ,
  mq_fld_subject varchar(100) NOT NULL default ,
  mq_fld_message text NOT NULL,
  mq_sent_flag tinyint(1) NOT NULL default 0,
  PRIMARY KEY (mq_id)
) TYPE=MyISAM COMMENT='Site eMail Queue Table';


Orders

In phpCOIN an order can be for only one item, so only one table is needed to track it. A seperate sessions table of temporary order data is maintained during the ordering process, and is cleared out at regular intervals.

CREATE TABLE phpcoin_orders (
  ord_id int(11) NOT NULL default 0,
  ord_ts varchar(10) default NULL,
  ord_ip varchar(16) NOT NULL default '000.000.000.000',
  ord_status varchar(20) NOT NULL default 'pending',
  ord_cl_id int(11) NOT NULL default 0,
  ord_company varchar(50) NOT NULL default ,
  ord_name_first varchar(20) NOT NULL default ,
  ord_name_last varchar(20) NOT NULL default ,
  ord_addr_01 varchar(50) NOT NULL default ,
  ord_addr_02 varchar(50) NOT NULL default ,
  ord_city varchar(50) NOT NULL default ,
  ord_state_prov varchar(50) NOT NULL default ,
  ord_country varchar(50) NOT NULL default ,
  ord_zip_code varchar(12) NOT NULL default ,
  ord_phone varchar(20) NOT NULL default ,
  ord_email varchar(50) NOT NULL default ,
  ord_domain varchar(50) NOT NULL default ,
  ord_domain_action tinyint(1) NOT NULL default 0,
  ord_user_name varchar(20) NOT NULL default ,
  ord_user_pword varchar(50) NOT NULL default ,
  ord_vendor_id smallint(6) NOT NULL default 1,
  ord_prod_id smallint(6) NOT NULL default 0,
  ord_unit_cost decimal(10,2) NOT NULL default '0.00',
  ord_accept_tos tinyint(1) NOT NULL default 0,
  ord_accept_aup tinyint(1) NOT NULL default 0,
  ord_referred_by varchar(50) NOT NULL default ,
  ord_comments text NOT NULL,
  ord_optfld_01 varchar(50) NOT NULL default ,
  ord_optfld_02 varchar(50) NOT NULL default ,
  ord_optfld_03 varchar(50) NOT NULL default ,
  ord_optfld_04 varchar(50) NOT NULL default ,
  ord_optfld_05 varchar(50) NOT NULL default ,
  ord_invc_id int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (ord_id)
) TYPE=MyISAM COMMENT='Site Orders Module Table';

CREATE TABLE phpcoin_orders_sessions (
  os_s_id varchar(36) NOT NULL default ,
  os_s_time_init int(11) NOT NULL default 0,
  os_s_time_last int(11) NOT NULL default 0,
  os_s_ip varchar(16) NOT NULL default '000.000.000.000',
  os_ord_processed tinyint(1) NOT NULL default 0,
  os_ord_ret_processed tinyint(1) NOT NULL default 0,
  os_ord_id int(11) NOT NULL default 0,
  os_ord_ts varchar(10) default NULL,
  os_ord_status varchar(20) NOT NULL default 'pending',
  os_ord_cl_id int(11) NOT NULL default 0,
  os_ord_company varchar(50) NOT NULL default ,
  os_ord_name_first varchar(20) NOT NULL default ,
  os_ord_name_last varchar(20) NOT NULL default ,
  os_ord_addr_01 varchar(50) NOT NULL default ,
  os_ord_addr_02 varchar(50) NOT NULL default ,
  os_ord_city varchar(50) NOT NULL default ,
  os_ord_state_prov varchar(50) NOT NULL default ,
  os_ord_country varchar(50) NOT NULL default ,
  os_ord_zip_code varchar(12) NOT NULL default ,
  os_ord_phone varchar(20) NOT NULL default ,
  os_ord_email varchar(50) NOT NULL default ,
  os_ord_domain varchar(50) NOT NULL default ,
  os_ord_domain_action tinyint(1) NOT NULL default 0,
  os_ord_user_name varchar(20) NOT NULL default ,
  os_ord_user_pword varchar(50) NOT NULL default ,
  os_ord_vendor_id smallint(6) NOT NULL default 1,
  os_ord_prod_id smallint(6) NOT NULL default 0,
  os_ord_unit_cost decimal(10,2) NOT NULL default '0.00',
  os_ord_accept_tos tinyint(1) NOT NULL default 0,
  os_ord_accept_aup tinyint(1) NOT NULL default 0,
  os_ord_referred_by varchar(50) NOT NULL default ,
  os_ord_comments text NOT NULL,
  os_ord_optfld_01 varchar(50) NOT NULL default ,
  os_ord_optfld_02 varchar(50) NOT NULL default ,
  os_ord_optfld_03 varchar(50) NOT NULL default ,
  os_ord_optfld_04 varchar(50) NOT NULL default ,
  os_ord_optfld_05 varchar(50) NOT NULL default ,
  os_ord_cbflag tinyint(1) NOT NULL default 0,
  os_ord_cbpaid tinyint(1) NOT NULL default 0,
  os_cor_flag tinyint(1) NOT NULL default 0,
  os_cor_type varchar(32) NOT NULL default ,
  os_cor_opt_bill_cycle varchar(32) NOT NULL default ,
  os_cor_opt_payment varchar(32) NOT NULL default ,
  os_cor_disk smallint(6) NOT NULL default 0,
  os_cor_disk_units char(3) NOT NULL default 'Mb',
  os_cor_traffic smallint(6) NOT NULL default 0,
  os_cor_traffic_units char(3) NOT NULL default 'Gb',
  os_cor_dbs smallint(6) NOT NULL default 0,
  os_cor_mailboxes smallint(6) NOT NULL default 0,
  os_cor_unique_ip tinyint(1) NOT NULL default 0,
  os_cor_shop_cart tinyint(1) NOT NULL default 0,
  os_cor_sec_cert tinyint(1) NOT NULL default 0,
  os_cor_site_pages tinyint(4) NOT NULL default 0,
  os_cor_comments text NOT NULL,
  os_cor_optfld_01 varchar(50) NOT NULL default ,
  os_cor_optfld_02 varchar(50) NOT NULL default ,
  os_cor_optfld_03 varchar(50) NOT NULL default ,
  os_cor_optfld_04 varchar(50) NOT NULL default ,
  os_cor_optfld_05 varchar(50) NOT NULL default ,
  PRIMARY KEY (os_s_id)
) TYPE=MyISAM COMMENT='Site Orders Module Sessions Table';


Products

A table to hold data on the products or services that you sell.

CREATE TABLE phpcoinproducts (
  prod_id smallint(6) NOT NULL auto_increment,
  prod_status tinyint(1) NOT NULL default 1,
  prod_name varchar(20) NOT NULL default ,
  prod_desc varchar(75) NOT NULL default ,
  prod_unit_cost decimal(10,2) NOT NULL default '0.00',
  prod_client_scope int(11) NOT NULL default 0,
  prod_apply_tax_01 tinyint(1) NOT NULL default 1,
  prod_apply_tax_02 tinyint(1) NOT NULL default 1,
  prod_calc_tax_02_pb tinyint(1) NOT NULL default 0,
  prod_dom_type tinyint(2) NOT NULL default 0,
  prod_allow_domains smallint(6) NOT NULL default 0,
  prod_allow_subdomains smallint(6) NOT NULL default 0,
  prod_allow_disk_space_mb int(11) NOT NULL default 0,
  prod_allow_traffic_mb int(11) NOT NULL default 0,
  prod_allow_mailboxes smallint(6) NOT NULL default 0,
  prod_allow_databases smallint(6) NOT NULL default 0,
  prod_cg_01 tinyint(1) NOT NULL default 0,
  prod_cg_02 tinyint(1) NOT NULL default 0,
  prod_cg_03 tinyint(1) NOT NULL default 0,
  prod_cg_04 tinyint(1) NOT NULL default 0,
  prod_cg_05 tinyint(1) NOT NULL default 0,
  prod_cg_06 tinyint(1) NOT NULL default 0,
  prod_cg_07 tinyint(1) NOT NULL default 0,
  prod_cg_08 tinyint(1) NOT NULL default 0,
  PRIMARY KEY (prod_id)
) TYPE=MyISAM COMMENT='Site Products Table';


Payment Methods

The vendors table holds generic information about each payment method that you will accept. The vendord_prods (PayLinks) table holds specific information for each vendor/product combination.

CREATE TABLE phpcoinvendors (
  vendor_id smallint(6) NOT NULL auto_increment,
  vendor_status tinyint(1) NOT NULL default 0,
  vendor_name varchar(20) NOT NULL default ,
  vendor_buy_parm varchar(30) NOT NULL default 'buy',
  vendor_buy_parm_val varchar(10) NOT NULL default '1',
  vendor_url varchar(50) NOT NULL default ,
  vendor_use_ipn tinyint(1) NOT NULL default 0,
  vendor_notes text NOT NULL,
  PRIMARY KEY (vendor_id)
) TYPE=MyISAM COMMENT='Site Vendors Table';
CREATE TABLE phpcoin_vendors_prods (
  vprod_id smallint(6) NOT NULL auto_increment,
  vprod_vendor_id smallint(6) NOT NULL default 0,
  vprod_prod_id smallint(6) NOT NULL default 0,
  vprod_desc varchar(50) NOT NULL default ,
  vprod_order_link text NOT NULL,
  PRIMARY KEY (vprod_id)
) TYPE=MyISAM COMMENT='Site Vendor Products Table';


Downloads

A table to hold details of files that you make available for download, such as utilities, software, manuals, etc.

CREATE TABLE phpcoin_downloads (
  `dload_id` int(11) NOT NULL auto_increment,
  `dload_group` varchar(50) NOT NULL default ,
  `dload_name` varchar(50) NOT NULL default ,
  `dload_desc` text NOT NULL,
  `dload_count` int(11) NOT NULL default '0',
  `dload_date_str` varchar(10) NOT NULL default 'yyyy-mm-dd',
  `dload_avail` int(1) NOT NULL default '0',
  `dload_filename` varchar(50) NOT NULL default ,
  `dload_filesize` varchar(8) NOT NULL default ,
  `dload_contributor` varchar(255) NOT NULL default ,
  PRIMARY KEY  (`dload_id`)
) TYPE=MyISAM COMMENT='Downloads Table';
Personal tools

Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com