ALTER TABLE affiliate_plan ADD COLUMN spiff_threshold int;
ALTER TABLE affiliate_plan ADD COLUMN spiff_amount decimal(12,2);

# update 01/04/07

ALTER TABLE instant_pop ADD COLUMN name VARCHAR(50) AFTER org;
UPDATE instant_pop SET name='Holidays' WHERE name IS NULL;

# update 01/07/07

ALTER TABLE visit ADD COLUMN atom_type tinyint;
ALTER TABLE visit ADD COLUMN atom int(11);
ALTER TABLE visit ADD INDEX (atom_type, atom);

ALTER TABLE email_template ADD COLUMN client_type varchar(50) DEFAULT '0';
ALTER TABLE email_template ADD COLUMN headline text after subject;
ALTER TABLE email_design ADD COLUMN logo_color varchar(7);

DELETE FROM part WHERE org=3 AND part_id='email_subscribe';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_subscribe', "<h1>Email Specials</h1><p>Join our email newsletter for great specials and our latest events! We'll only use your email address with your permission, and take your privacy seriously.<p>");
DELETE FROM part WHERE org=3 AND part_id='email_verify';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_verify', "<h1>Thanks for joining!</h1><p>You're now in the know Ñ you'll be in on the latest and greatest before everyone else!</p>");
DELETE FROM part WHERE org=3 AND part_id='email_confirm';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_confirm', "<h1>Almost done!</h1><p>Thanks for subscribing to our great email newsletter. We're big believers in your privacy, so we've just sent you an email to confirm your subscription.</p><p></p><p>Please click on the link in the email. Otherwise, you'll miss out on the great tips, specials and gift giving ideas in our newsletter.</p><p>You may need to check your junk folder for the confirmation email.</p>");
DELETE FROM part WHERE org=3 AND part_id='email_notsub';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_notsub', "<h1>Not found...</h1><p>I didn't find your email address on our list.</p>");
DELETE FROM part WHERE org=3 AND part_id='email_unsub';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_unsub', "<h1>Unsubscribe</h1><p>We're sorry to see you go, but all you need to do is enter your email address to be removed from our email newsletter.</p>");
DELETE FROM part WHERE org=3 AND part_id='email_removed';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_removed', "<h1>Done!</h1><p>Your email address has been removed from out list. Thanks for your time with us!</p>");

ALTER TABLE help_topic ADD COLUMN title varchar(100) after topic;
UPDATE help_topic SET title='Clients' WHERE topic='client';
UPDATE help_topic SET title='Gift Certificate Transactions' WHERE topic='gift_tran';
UPDATE help_topic SET title='Add Value to Gift Certificate' WHERE topic='gift_tranadd_value';
UPDATE help_topic SET title='Gift Certificate Value Adjustment' WHERE topic='gift_tranadj';
UPDATE help_topic SET title='Redeem Gift Certificate' WHERE topic='gift_tranredeem';
UPDATE help_topic SET title='Void Gift Certificate' WHERE topic='gift_tranvoid';
UPDATE help_topic SET title='Organization Settings' WHERE topic='org';
UPDATE help_topic SET title='Search Tips' WHERE topic='search';
UPDATE help_topic SET title='Service or Package' WHERE topic='service_header';
UPDATE help_topic SET title='Events' WHERE topic='event';
UPDATE help_topic SET title='Gift Certificates' WHERE topic='gift';
UPDATE help_topic SET title='Gift Certificate Types' WHERE topic='gift_type';
UPDATE help_topic SET title='Professionals' WHERE topic='prof';
UPDATE help_topic SET title='Apponitment Requests' WHERE topic='request';
UPDATE help_topic SET title='Logo' WHERE topic='org_logo';
UPDATE help_topic SET title='Adding Links to Your Website' WHERE topic='linked';
UPDATE help_topic SET title='PayPal' WHERE topic='paypal';
UPDATE help_topic SET title='Basics' WHERE topic='org_basic';
UPDATE help_topic SET title='Authorize.Net' WHERE topic='authnet';
UPDATE help_topic SET title='Manual Credit Card Processing' WHERE topic='manCCprocessing';
UPDATE help_topic SET title='Overview of Taxation' WHERE topic='taxation';
UPDATE help_topic SET title='Contact SpaBoom' WHERE topic='contact';
UPDATE help_topic SET title='Billing' WHERE topic='org_billing';
UPDATE help_topic SET title='Services' WHERE topic='service';
UPDATE help_topic SET title='Credit Card' WHERE topic='org_tran';
UPDATE help_topic SET title='Gift Certificate Designs' WHERE topic='gift_design';
UPDATE help_topic SET title='Creating Your Own Custom Gift Certificate Designs' WHERE topic='CustGCDesign';
UPDATE help_topic SET title='Custom Gift Certificate Design Requirements' WHERE topic='CustGCDesignReq';
UPDATE help_topic SET title='Edit Color' WHERE topic='color';
UPDATE help_topic SET title='Templates' WHERE topic='admin_org';
UPDATE help_topic SET title='Email Template for Instant Gift functionality is Ready' WHERE topic='email_template_linke';
UPDATE help_topic SET title='Email Template for Examples of SpaBoom Templates for Dynamic Website' WHERE topic='dynamic_website_temp';
UPDATE help_topic SET title='Email Template for How to Integrate SpaBook using Web Services' WHERE topic='embedded_integration';
UPDATE help_topic SET title='Accounts' WHERE topic='accts';
UPDATE help_topic SET title='Website' WHERE topic='website_linked';
UPDATE help_topic SET title='Website: Experts Only' WHERE topic='linked_html';
UPDATE help_topic SET title='Custom CSS' WHERE topic='linked_css';
UPDATE help_topic SET title='Page Redirects' WHERE topic='page_redirect';
UPDATE help_topic SET title='Website Referrer' WHERE topic='referrer';
UPDATE help_topic SET title='Website Keywords' WHERE topic='keyword';
UPDATE help_topic SET title='Website Landing Pages' WHERE topic='landing';
UPDATE help_topic SET title='Email Template for Some Quick Tips on Improving Your Online Marketing' WHERE topic='improving_your_onlin';
UPDATE help_topic SET title='Email Template for Your SpaBoom account has been cancelled' WHERE topic='account_has_been_can';
UPDATE help_topic SET title='Overview' WHERE topic='toc';
UPDATE help_topic SET title='Setup' WHERE topic='setup';
UPDATE help_topic SET title='Gift Certificate Numbering' WHERE topic='gc_numbering';
UPDATE help_topic SET title='Help Index' WHERE topic='index';
UPDATE help_topic SET title='How to void a Gift Certificate in SpaBoom' WHERE topic='VoidGC';
UPDATE help_topic SET title='How to enter your service menu into your SpaBoom account' WHERE topic='EnterServiceMenu';

ALTER TABLE gift ADD COLUMN millennium_transaction int;
ALTER TABLE org ADD COLUMN harms_millennium tinyint NOT NULL DEFAULT 0;
CREATE TABLE `org_parm` (
  `org_parm` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `type` varchar(50) NOT NULL default '',
  `parm` varchar(50) NOT NULL default '',
  `value` varchar(100) default NULL,
  PRIMARY KEY  (`org_parm`),
  KEY `org_parm_idx` (`org`,`type`,`parm`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE email_design MODIFY logo_color varchar(20);
ALTER TABLE email_design DROP COLUMN color;
ALTER TABLE email_template ADD COLUMN narrative text AFTER headline;
ALTER TABLE email_template ADD COLUMN editor tinyint DEFAULT 0;
UPDATE email_template SET editor = 1 WHERE body != '';
RENAME TABLE email_template TO email_marketing;
ALTER TABLE email_marketing CHANGE email_template email_marketing int NOT NULL auto_increment;
ALTER TABLE email_marketing DROP COLUMN color_selection;
ALTER TABLE email_marketing ADD COLUMN org_type varchar(50) NOT NULL DEFAULT 'ALL' AFTER client_type;
ALTER TABLE email_marketing ADD COLUMN hide tinyint NOT NULL DEFAULT 0 AFTER email_cycle;
ALTER TABLE org ADD COLUMN email_marketing_opt_in tinyint NOT NULL DEFAULT 1;

CREATE TABLE `email_color` (
  `email_color` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `bg_dark` varchar(7) default NULL,
  `bg` varchar(7) default NULL,
  `fg` varchar(7) default NULL,
  `fg_light` varchar(7) default NULL,
  `highlight_1` varchar(7) default NULL,
  PRIMARY KEY  (`email_color`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

# update 01/24/07

INSERT INTO `email_design` (`email_design`, `name`, `design`, `design_css`, `logo_color`) VALUES (4, 'Newsletter', '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r\n<html>\r\n<head>\r\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">\r\n</head>\r\n<body bgcolor={bg}>\r\n{css}\r\n<table width="100%" cellpadding="0" cellspacing="0">\r\n<tr>\r\n<td valign="top" align="center">\r\n<table width="530" cellpadding="0" cellspacing="0">\r\n<tr>\r\n<td bgcolor="{bg_dark}" class="header"><h1><font="{font}">{headline}</font></h1></td>\r\n<td bgcolor="{bg_dark}" align="right" valign="top" class="header_logo">{logo_link}</td>\r\n</tr>\r\n<tr>\r\n<td class="content" bgcolor="{fg_light}" colspan="2">\r\n{body}\r\n</div>\r\n<br>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style="border-top: 1px solid {bg_dark};" valign="middle" align="center" colspan="2">\r\n<p class="footer">\r\n{privacy_policy}<br>\r\n{unsubscribe_link}<br>\r\n{company} {address}, {city}, {state} {postal} {phone_1}\r\n</p>\r\n</td>\r\n</tr>\r\n</table>\r\n</td>\r\n</tr>\r\n</table>\r\n</body>\r\n</html>\r\n', 'body \r\n{\r\n  font-size: 12px; \r\n  color: <highlight_1>; \r\n  font-family: <font>;\r\n}\r\n\r\n.header \r\n{\r\n  padding: 10px;\r\n  color: <fg_light>; \r\n  font-weight: bold; \r\n  background: <bg_dark>;\r\n}\r\n\r\n.header_logo\r\n{\r\n  padding: 15px 10px 10px 0;\r\n}\r\n\r\n.footer \r\n{\r\n  font-size: 11px; \r\n  color: <highlight_1>;\r\n  padding-top: 10px;\r\n}\r\n\r\n.content\r\n{\r\n  padding: 10px;\r\n}\r\n\r\n.event\r\n{\r\n  color: #ED9532;\r\n}\r\n\r\n', 'bg_dark');

DELETE FROM part WHERE org=3 AND part_id='email_confirm';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_confirm', "<h1>Almost done!</h1><p>Thanks for subscribing to our great email newsletter. We're big believers in your privacy, so we've just sent you an email to confirm your subscription.</p><p></p><p>Please click on the link in the email. Otherwise, you'll miss out on the great tips, specials and gift giving ideas in our newsletter.</p><p>You may need to check your junk folder for the confirmation email.</p>");

INSERT INTO `email_marketing` (`default_email`, `type`, `id`, `org`, `active`, `name`, `subject`, `headline`, `narrative`, `body`, `send_on`, `email_cycle`, `hide`, `show_event`, `email_design`, `client_type`, `org_type`, `editor`) VALUES (NULL, 1, 'subscribe', 3, 1, 'Email newsletter confirmation', 'Quick confirmation from {short_name}', 'Thanks for joining!', 'Just one more quick step! Please click on the link below to complete your subscription to our email newsletter: \r\n\r\n{verify_link(''Click to confirm'')} \r\n\r\nWe''ll send you only the occasional email, but it will be well worth it: special promotions and great last-minute gift giving solutions!', 'Just one more quick step! Please click on the link below to complete your subscription to our email newsletter: <br />\r\n<br />\r\n{verify_link(''Click to confirm'')} <br />\r\n<br />\r\nWe''ll send you only the occasional email, but it will be well worth it: special promotions and great last-minute gift giving solutions!', NULL, 0, 0, 0, 4, '0', 'ALL', 0);

DELETE FROM part WHERE org=3 AND part_id='email_verify';
INSERT INTO part (org, part_id, content) VALUES (3, 'email_verify', "<h1>Thanks for joining!</h1><p>You're now in the know &mdash; you'll be in on the latest and greatest before everyone else!</p>");

ALTER TABLE email_marketing ADD COLUMN photo int;
ALTER TABLE email_marketing ADD COLUMN photo_filename varchar(100);

# update

ALTER TABLE `client_address` CHANGE `website` `website` VARCHAR( 70 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE org ADD column dir_point int DEFAULT 0 NOT NULL;

# update 02/07/07

ALTER TABLE event ADD COLUMN id varchar(16) AFTER event_type;
delete from part where part_id='client_wish_c' and org = 3;
INSERT INTO part VALUES (NULL,3,'client_wish_c','<h1 class=\'event\'>Your wish list is off in cyberspace!</h1><p>If you don\'t think that was enough, you can always put in more email addresses, and do it again!</p>');
INSERT INTO part VALUES (NULL,3,'client_wish_h','<h1>Your Spa Wish List!</h1>');
INSERT INTO part VALUES (NULL,3,'client_wish_s','<p>Make all of your spa dreams come true! Choose from our <a href=\'menu\'>menu of services</a> to start your wish list.</p><p>You can even add anything you want to your wish list, from <a href=\'spa-wish-list?1=w\' title=\'You can add to your wish list anything on the Internet!\'>anywhere on the web!</a></p><p>When you\'re ready, ship off that little hint email to that special someone (or someones!)</p>');
INSERT INTO part VALUES (NULL,3,'client_wish_l','<p>Add more to your wish list from our <a href=\'menu\'>menu of services</a> or <a href=\'spa-wish-list?1=w\' title=\'You can add to your wish list anything on the Internet!\'>anywhere on the web</a>. When you\'re ready, ship off that little email below to give a little nudge!</p>');
INSERT INTO part VALUES (NULL,3,'client_wish_l2','<h2>The Little Email Hint</h2><p>It\'s time for the nudge! Just drop in some email addresses and hit Send!</p>');
INSERT INTO part VALUES (NULL,3,'client_wish_w','<p>What\'s out there on the web that you want? Go find it (using File, New Window or New Tab is the easiest way) and then copy and paste the website address right here! Enter a quick description for your wish list, and you\'re done!</p>');
INSERT INTO part VALUES (NULL,3,'share_h','<h1>Share with a friend!</h1><p>Do your best friends need to know about your favorite spa? Pop in some email addresses below and hit Send to share the love!');
INSERT INTO part VALUES (NULL,3,'share_c','<h1 class=\'event\'>Your email has been sent!</h1><p>Anyone else need to know? You can do it again!</p>');
ALTER TABLE client_log ADD INDEX (ip, activity, page, date);
ALTER TABLE org ADD COLUMN email_marketing_limit int DEFAULT 20000 NOT NULL;

INSERT INTO `email_marketing` (`default_email`, `type`, `id`, `org`, `active`, `name`, `subject`, `headline`, `narrative`, `body`, `send_on`, `email_cycle`, `hide`, `show_event`, `email_design`, `client_type`, `org_type`, `editor`, `photo`, `photo_filename`) VALUES
(NULL, 1, 'client_wish', 3, 1, 'Wish List', 'Wish List', '{subject}', '{wish_list}\r\n\r\n{company_link}\r\n\r\n{short_name} has a fast and easy way to buy {instant_gc_link(''Instant Gift Certificates'')}. Design your gift certificate, and then email or print it immediately! ', '{wish_list}<br />\r\n<br />\r\n{company_link}<br />\r\n<br />\r\n{short_name} has a fast and easy way to buy {instant_gc_link(''Instant Gift Certificates'')}. Design your gift certificate, and then email or print it immediately! ', NULL, 0, 0, 0, 4, '0', 'ALL', 0, 0, ''),
(NULL, 1, 'share', 3, 1, 'Share with a friend', 'Share with a friend', '{subject}', '{share}\r\n\r\n{company_link}\r\n\r\n{short_name} has a fast and easy way to buy {instant_gc_link(''Instant Gift Certificates'')}. Design your gift certificate, and then email or print it immediately! ', '{share}<br />\r\n<br />\r\n{company_link}<br />\r\n<br />\r\n{short_name} has a fast and easy way to buy {instant_gc_link(''Instant Gift Certificates'')}. Design your gift certificate, and then email or print it immediately! ', NULL, 0, 0, 0, 4, '0', 'ALL', 0, 0, '');

ALTER TABLE `template` ADD `no_sidebar_css` TEXT NULL AFTER `content` ;

update template set no_sidebar_css = "
#sidebar
{
	display: none;
}

#content
{
	margin: 0 !important;
}

#main_1
{
  background: url(template/content.gif) 130px 0px repeat-y;
}

#main_4
{
  background: url(template/bottom_right_2.gif) bottom right no-repeat;
}

#content_in_end
{
  position: absolute;
  top: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background: url(template/top_right_2.gif) top right no-repeat;
}" where template = 34;

update template set no_sidebar_css = "
#sidebar
{
	display: none;
}

#content
{
	margin: 0 !important;
}

#main_1
{
  background: url(template/content.gif) 130px 0px repeat-y;
}" where template = 35;

# update 02/26/07

ALTER TABLE `client` CHANGE `email` `email` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `client_address` CHANGE `email` `email` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `prof` CHANGE `email` `email` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `prof_alias` CHANGE `email_alias` `email_alias` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

# update 03/08/07

UPDATE visit, gift, org_client SET referrer_host = 'spaemergency.com' where
gift.org_client = org_client.org_client AND org_client.org = visit.org AND gift.vuid = visit.vuid and
referrer_host = '' and directory > '';

# update 04/02/07

ALTER TABLE template ADD COLUMN home_page varchar(50) NOT NULL DEFAULT 'home';
UPDATE template SET home_page='about' WHERE template=27;

CREATE TABLE `page_photo` (
  `page_photo` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `page_id` varchar(50) NOT NULL default '',
  `id` int(11) NOT NULL default '0',
  `photo` int(11) NOT NULL default '0',
  PRIMARY KEY  (`page_photo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `page_custom_css` (
  `page_custom_css` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `page_id` varchar(50) NOT NULL default '',
  `template` int(11) NOT NULL default '0',
  `custom_css` text NOT NULL,
  PRIMARY KEY  (`page_custom_css`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `visit` ADD `bot` TINYINT( 1 ) NOT NULL;
update visit set bot = 1 where inet_ntoa(ip) IN ('72.30.61.72', '128.194.135.94');
update visit set bot = 1 where substr(inet_ntoa(ip),1,10) = '65.55.212.';
update visit set bot = 1 where substr(inet_ntoa(ip),1,10) = '207.46.98.';
update visit set bot = 1 where substr(inet_ntoa(ip),1,10) = '66.249.65.';

# update 04/13/07

CREATE TABLE `brand` (
`brand` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`org` INT( 11 ) NOT NULL ,
INDEX ( `org` )
) ENGINE = innodb;
ALTER TABLE `brand` ADD `id` VARCHAR( 16 ) NOT NULL AFTER `brand` ;
ALTER TABLE `brand` ADD UNIQUE (
`id`
);
INSERT INTO `brand` ( `brand` , `id` , `org` )
VALUES (
NULL , 'BOOMTIME', '409'
), (
NULL , 'SPABOOM', '13'
);
ALTER TABLE `brand` ADD `inactive` TINYINT( 1 ) NOT NULL DEFAULT '0';
ALTER TABLE `org_type` ADD `org` INT( 11 ) NOT NULL AFTER `org_type` ;
ALTER TABLE `org_type` ADD INDEX ( `org` );
update org_type set org = 13;
ALTER TABLE `org_type` ADD CONSTRAINT FOREIGN KEY (`org`) REFERENCES `org` (`org`);
ALTER TABLE `brand` DROP `id`;
update prof set org = 977 where org = 13;
update org set short_name = 'SpaBoom Defaults', id='spaboomdefault' where org = 3;
update org set short_name = 'Super Admin', org_status = 12, id = 'admin' where org = 977;

INSERT INTO org_type (org, name, url_prefix) VALUES (409, 'Restaurant', 'restaurant');
INSERT INTO org_type (org, name, url_prefix) VALUES (409, 'Salon', 'salon'), (409, 'Spa', 'spa'), (409, 'Massage therapist', 'massage');

ALTER TABLE website ADD COLUMN previous_site_template int AFTER site_template;
ALTER TABLE website ADD COLUMN previous_color int AFTER color;

ALTER TABLE `brand` ADD `brand_email_marketing` TINYINT( 1 ) NOT NULL DEFAULT '0';
UPDATE brand SET brand_email_marketing = 1 WHERE org = 13;
ALTER TABLE `brand` ADD `default_org` INT( 11 ) NULL ;
ALTER TABLE `brand` ADD INDEX ( `default_org` ) ;
ALTER TABLE `brand` ADD CONSTRAINT FOREIGN KEY (`default_org`) REFERENCES `org` (`org`);
UPDATE brand SET default_org = 3 WHERE org = 13;
UPDATE org SET short_name = 'BoomTime Defaults', org_status = 12, id='boomtimedefault' WHERE org = 967;
UPDATE brand SET default_org = 967 WHERE org = 409;
delete from email_marketing where org = 967;

# Serene (Template #21), page_id home, version 0
UPDATE page SET content='<h1>Welcome to {short_name}!</h1>
<div boomtime="photo_right" id="anchor_2" max_width="150"></div>
<p>Peruse our <a href="menu" title="Our menu of services">Services Menu</a> of therapeutic massage, spa body treatments, skin care and spa packages.<br>
<br>
You can <a href="schedule"Ê title="Request an appointment online, right now!">Request an appointment</a>, purchase an <a href="gift"Ê title="Design your gift certificate, preview it, and then send or print it immediately. ItÕs fast and easy!">Instant Gift Certificate</a>
or <a href="contact"Ê title="Contact information and map">Contact Us</a> for more information. <br>
</p>' WHERE template=21 AND page_id='home' AND version=0;

#Squared
UPDATE PAGE SET content='<h1>Welcome to {short_name}!</h1>
<p>Peruse our <a href="/menu">Services Menu</a> of therapeutic massage, spa body treatments, skin care and spa packages.</p>
<div boomtime="photo_left" id="photo_2" max_width="160"><img src="https://fuse.spaboom.com/img/place_holder.jpg" height="125" width="160" class="photo_left"></div>
<p>You can <a href="schedule">Request an appointment</a>, purchase an <a href="gift">Instant Gift Certificate</a>
or <a href="contact">Contact Us</a> for more information. <br>
</p>' WHERE template=35 AND page_id='home' AND version = 0;

# Seasons (Template #26), page_id home, version 0
UPDATE page SET content='<h1>Welcome to {short_name}!</h1>
<div boomtime="photo_right" id="anchor_2" max_width="150"></div>
<p>Peruse our <a href="menu">Services Menu</a> of therapeutic massage, spa body treatments, skin care and spa packages.<br>
<br>
You can <a href="schedule">Request an appointment</a>, purchase an <a href="gift">Instant Gift Certificate</a>
or <a href="contact">Contact Us</a> for more information. <br>
</p>', custom_css=' #content
{
  background: url(none) 0px 0px no-repeat;
}
#photo_css_content {position:absolute; left:275px; top:160px;}' WHERE template=26 AND page_id='home' AND version=0;
#Seasons (Template #26), page_id header, version 0
UPDATE page SET content='<div boomtime="photo_left" id="photo_css_content" max_width="535" fade="1"></div>
<div id="header_left">
        <div boomtime="left" id="header_logo">
                <a href="/" title="Return to the opening page">
                        <img src="template/header_logo.jpg" border="0">
                </a>
        </div>
</div>
<div id="header_right">
        <div boomtime="left" id="contact_us">
                <a href="contact" title="E-mail, map and address information">Contact us</a><br>{address}<br>
{phone}<br>
{email}<br>
</div>
<div boomtime="right" id="part_tagline">{part(\'tagline\')}</div>
</div>
<div class="cleaner">&nbsp;</div>
<div boomtime="left" id="nav_edit">{nav()}</div>' WHERE template=26 AND page_id='header' AND version=0;

# Boxy (Template #27), page_id about, version 0
UPDATE page SET content='<h1>Welcome to {short_name}!</h1>
<div boomtime="photo_right" id="anchor_2" max_width="150"></div>
<p>Peruse our <a href="menu">Services Menu</a> of therapeutic massage, spa body treatments, skin care and spa packages.<br>
<br>
You can <a href="schedule">Request an appointment</a>, purchase an <a href="gift">Instant Gift Certificate</a>
or <a href="contact">Contact Us</a> for more information. <br>
</p>' WHERE template=27 AND page_id='about' AND version=0;

# Rounded (Template #34), page_id home, version 0
UPDATE page SET content='<h1>Welcome to {short_name}!</h1>
<p>Peruse our <a href="/menu">Services Menu</a> of therapeutic massage, spa body treatments, skin care and spa packages.</p>
<div boomtime="photo_left" id="photo_main_1" max_width="150" round_top_left="10-fg" round_top_right="10-fg" round_bottom_right="10-fg" round_bottom_left="10-fg"><img src="https://fuse.spaboom.com/img/place_holder.jpg" height="125" width="150" class="photo_left"></div>
<p>You can <a href="schedule">Request an appointment</a>, purchase an <a href="gift">Instant Gift Certificate</a>
or <a href="contact">Contact Us</a> for more information. <br>
</p> ' WHERE template=34 AND page_id='home' AND version=0;

# Squared (Template #35), page_id home, version 0
UPDATE page SET content='<h1>Welcome to {short_name}!</h1>
<p>Peruse our <a href="/menu">Services Menu</a> of therapeutic massage, spa body treatments, skin care and spa packages.</p>
<div boomtime="photo_left" id="photo_2" max_width="150"><img src="https://fuse.spaboom.com/img/place_holder.jpg" height="125" width="150" class="photo_left"></div>
<p>You can <a href="schedule">Request an appointment</a>, purchase an <a href="gift">Instant Gift Certificate</a>
or <a href="contact">Contact Us</a> for more information. <br>
</p>' WHERE template=35 AND page_id='home' AND version=0;

# update 04/22/07

update visit set bot = 1 where substr(inet_ntoa(ip),1,11) = '209.67.114.';
update visit set bot = 1 where substr(inet_ntoa(ip),1,8) = '64.14.3.';

# update 05/17/07

ALTER TABLE  `affiliate` ADD  `api_enabled` TINYINT( 1 ) NOT NULL DEFAULT  '0';
ALTER TABLE  `affiliate` ADD  `api_pass` VARCHAR( 32 ) NULL ;
ALTER TABLE  `affiliate` ADD  `brand` INT NULL ;
ALTER TABLE  `affiliate` ADD  `client_type` INT NULL ;
ALTER TABLE `affiliate` ADD `signup_ping` VARCHAR(180) NULL;
ALTER TABLE `affiliate` ADD `signup_page` VARCHAR(40) NULL;
ALTER TABLE  `affiliate` ADD INDEX ( `brand` );
ALTER TABLE  `affiliate` ADD INDEX ( `client_type` ) ;
ALTER TABLE  `affiliate` ADD FOREIGN KEY ( `brand` ) REFERENCES  `brand` ( `brand` );
ALTER TABLE  `affiliate` ADD FOREIGN KEY ( `client_type` ) REFERENCES  `client_type` (`client_type` );

CREATE TABLE `affiliate_org` (
  `affiliate_org` int(11) NOT NULL auto_increment,
  `affiliate` int(11) NOT NULL default '0',
  `org` int(11) default NULL,
  `account_uuid` varchar(32) default NULL,
  `account_domain` varchar(70) default NULL,
  `account_id` varchar(32) default NULL,
  `account_property` varchar(32) default NULL,
  `org_client` int(11) default NULL,
  `login_prof` int(11) default NULL,
  `token` varchar(32) default NULL,
  `token_expires` timestamp NULL default NULL,
  `hash` varchar(32) default NULL,
  PRIMARY KEY  (`affiliate_org`),
  KEY `affiliate` (`affiliate`),
  KEY `org` (`org`),
  KEY `account_uuid` (`account_uuid`),
  KEY `account_domain` (`account_domain`),
  KEY `org_client` (`org_client`),
  KEY `login_token` (`token`),
  KEY `login_prof` (`login_prof`)
);

ALTER TABLE `affiliate_org`
  ADD FOREIGN KEY (`affiliate`) REFERENCES `affiliate` (`affiliate`),
  ADD FOREIGN KEY (`org`) REFERENCES `org` (`org`),
  ADD FOREIGN KEY (`org_client`) REFERENCES `org_client` (`org_client`),
  ADD FOREIGN KEY (`login_prof`) REFERENCES `prof` (`prof`);

ALTER TABLE help_topic ADD COLUMN brand_org int AFTER topic;
ALTER TABLE help_topic ADD FOREIGN KEY (brand_org) REFERENCES org (org);
UPDATE help_topic SET content=replace(content,'SpaBoom', '{brand}') WHERE topic != 'paypal';

# update 05/24/07

ALTER TABLE task ADD COLUMN brand_org int AFTER task;
ALTER TABLE task ADD FOREIGN KEY (brand_org) REFERENCES org (org);
UPDATE task SET brand_org = 13;

INSERT INTO task (task, brand_org, type, sort, content) VALUES (9, 409, 5, 1, "<?=help_link('adding_links', 'Add Instant Gift Certificate links on your website', 1) ?> so you can start selling online now!");
INSERT INTO task (task, brand_org, type, sort, content) VALUES (10, 409, 5, 2, "Change the look of your Instant Gift Certificate page by <?=help_link('website_mimic', 'Mimicking Your Website', 1) ?>.");
INSERT INTO task (task, brand_org, type, sort, content) VALUES (11, 409, 1, 3, "Answer a few more questions and check your setup information in <a id='a_setting' href='org_basic.php' title='Company name, address and basic settings'>Basics</a>.");
INSERT INTO task (task, brand_org, type, sort, content) VALUES (12, 409, 1, 4, "Customize your <a href='org_logo.php' id='a_org_logo' title='Go to Logo to create an Instant Logo or upload one'>Logo</a> for gift certificates and emails.");
INSERT INTO task (task, brand_org, type, sort, content) VALUES (13, 409, 1, 5, "Add anyone who needs access to your system in <a id='a_professional' href='prof.php' title='Manage system access and service providers'>Professionals</a> (you can also change your password here, if desired).");

INSERT INTO task (task, brand_org, type, sort, content) VALUES (14, 409, 3, 1, "<?=help_link('linked', 'Add links to your website', 1) ?> so you can start selling online now!");
INSERT INTO task (task, brand_org, type, sort, content) VALUES (15, 409, 3, 2, "Change the look of your Instant Gift Certificate page in <a id='a_website' href='website_linked.php' title='Settings for your linked website pages'>Website</a>.");
INSERT INTO task (task, brand_org, type, sort, content) VALUES (16, 409, 4, 1, "Choose the theme for your <a id='a_website' href='website_edit.php' title='Change your Dynamic Website'>Website</a>.");

UPDATE task SET sort = 0.5 WHERE task = 11;

UPDATE help_topic SET content=REPLACE(content, '<a href="https://fuse.boomtime.com/help.php?', '<a id=help href="https://fuse.boomtime.com/help.php?') WHERE content LIKE '%<a href="https://fuse.boomtime.com/help.php?%';
UPDATE help_topic SET content=REPLACE(content, '<a href="https://fuse.spaboom.com/help.php?', '<a id=help href="https://fuse.spaboom.com/help.php?') WHERE content LIKE '%<a href="https://fuse.spaboom.com/help.php?%';

# update 05/30/07

ALTER TABLE `org_type` ADD `hide` TINYINT( 1 ) NOT NULL DEFAULT '0';

# update 06/04/07

ALTER TABLE `affiliate_org` ADD COLUMN `account_cp` varchar(180) DEFAULT NULL AFTER `account_property`;

# update 06/08/07

UPDATE task SET content = "Change the look of your Instant Gift Certificate page by {download_api} and <?=help_link('website_mimic', 'Mimicking Your Website', 1) ?>." WHERE task = 10;
UPDATE task SET content = "Customize your <a href='org_logo.php' id='a_org_logo' title='Go to Logo to create an Instant Logo or upload one'>Logo</a> for Instant Gift Certificates and emails." WHERE task = 12;

ALTER TABLE `client_wish` ADD INDEX ( `uuid` );

# update 06/10/07

ALTER TABLE `affiliate_plan` ADD COLUMN `percent_signup` float AFTER `percent_directory`;
CREATE TABLE `billing_signup_tran` (
  `billing_signup_tran` int(11) NOT NULL auto_increment,
  `cc_num` varchar(4) NOT NULL default '',
  `cc_type` tinyint(1) NOT NULL default 0,
  `cc_exp_mo` varchar(2) NOT NULL default '',
  `cc_exp_year` varchar(4) NOT NULL default '',
  `cc_name` varchar(100) NOT NULL default '',
  `entered_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `amount` decimal(12,2) NOT NULL default '0.00',
  `type` tinyint(1) NOT NULL default '0',
  `status` tinyint(1) NOT NULL default '0',
  `processing` tinyint(1) NOT NULL default '0',
  `approval` varchar(20) default NULL,
  `invoice` varchar(20) default NULL,
  `note` text,
  `trans_id` varchar(20) default NULL,
  `reason_code` int(11) default NULL,
  `avs_code` char(1) default NULL,
  `card_code` char(1) default NULL,
  `cavv_code` char(1) default NULL,
  `md5_matched` tinyint(1) NOT NULL default '0',
  `correlation_id` varchar(41) default NULL,
  PRIMARY KEY  (`billing_signup_tran`)
);

# update 06/12/07

ALTER TABLE org ADD COLUMN dunning INT;
CREATE TABLE `dunning` (
  `dunning` int(11) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL default '',
  `arrears_days` int(11) NOT NULL default '0',
  `min_amount` decimal(12,2) NOT NULL default '0.00',
  PRIMARY KEY  (`dunning`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `dunning` VALUES (1,'Standard',30,'1.00');

CREATE TABLE `dunning_step` (
  `dunning_step` int(11) NOT NULL auto_increment,
  `dunning` int(11) NOT NULL default '0',
  `step` int(11) NOT NULL default '0',
  `days` int(11) NOT NULL default '0',
  `action` int(11) NOT NULL default '0',
  `email_marketing` varchar(50) default NULL,
  `escalation` int(11) default NULL,
  PRIMARY KEY  (`dunning_step`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `dunning_step` VALUES (1,1,1,31,1,'dunning1',0);

INSERT INTO `email_marketing` (default_email, type, id, org, active, name, subject, headline, narrative, body, send_on, email_cycle, hide, show_event, email_design, client_type, org_type, editor, photo, photo_filename) VALUES (0,1,'dunning1',13,1,'Dunning Level 1','Dunning 1','Dunning 1','Hi!\r\n \r\nWe ran our monthly billing cycle for your invoice that is currently due. Unfortunately, your credit card on file with us came back as \"{decline_reason}\" and therefore could not be processed.\r\n{decline_msg}\r\nWarmest Regards,\r\nSpaBoom Client Services','Hi!<br />\r\n <br />\r\nWe ran our monthly billing cycle for your invoice that is currently due. Unfortunately, your credit card on file with us came back as &quot;{decline_reason}&quot; and therefore could not be processed.<br />\r\n{decline_msg}<br />\r\nWarmest Regards,<br />\r\nSpaBoom Client Services',NULL,0,0,0,4,'0','ALL',0,0,'');
INSERT INTO `email_marketing` (default_email, type, id, org, active, name, subject, headline, narrative, body, send_on, email_cycle, hide, show_event, email_design, client_type, org_type, editor, photo, photo_filename) VALUES (0,1,'cs_dunning_note',13,1,'C/S Dunning Notification','dunning notification','Dunning Notification','Please note that this org is in dunning.\r\n\r\nCompany: {company}\r\nDays in arrears: {arrears_days}\r\nAmount in arrears: ${billing_amount}\r\nDecline Reason: {decline_reason}\r\n','Please note that this org is in dunning.<br />\r\n<br />\r\nCompany: {company}<br />\r\nDays in arrears: {arrears_days}<br />\r\nAmount in arrears: ${billing_amount}<br />\r\nDecline Reason: {decline_reason}<br />\r\n',NULL,0,0,0,3,'0','ALL',0,0,'');
INSERT INTO `email_marketing` (default_email, type, id, org, active, name, subject, headline, narrative, body, send_on, email_cycle, hide, show_event, email_design, client_type, org_type, editor, photo, photo_filename) VALUES (0,1,'expiringcc',13,1,'Expiring Credit Cards','Your Credit Card is about to expire','Your credit card is about to expire','Hi! \r\n\r\nIn recently reviewing our billing records, we noticed that your credit card on file with us is about to expire. Please don\'t forget to update your billing information to keep your account up to date and current with us. \r\n\r\nTo update your information just take these easy steps: \r\n\r\n1. Log into your SpaBoom account from www.spaboom.com\r\n2. Click on the Setup Tab\r\n3. Click on Billing (look on the left side of the page for the little credit card icon)\r\n4. Update your credit card info there. Where it asks for billing address - it means what address your credit card statement goes to. If that is your business address, simply check the box. \r\n5. Click on \"Save\" when done.\r\n\r\nIf you have any questions, you can reach us Monday - Friday, 7AM -\r\n5:30PM Mountain time. Thank you for your help & have a lovely rest of\r\nyour day!\r\n\r\nSpaBoom Billing Team','Hi! <br />\r\n<br />\r\nIn recently reviewing our billing records, we noticed that your credit card on file with us is about to expire. Please don\'t forget to update your billing information to keep your account up to date and current with us. <br />\r\n<br />\r\nTo update your information just take these easy steps: <br />\r\n<br />\r\n1. Log into your SpaBoom account from www.spaboom.com<br />\r\n2. Click on the Setup Tab<br />\r\n3. Click on Billing (look on the left side of the page for the little credit card icon)<br />\r\n4. Update your credit card info there. Where it asks for billing address - it means what address your credit card statement goes to. If that is your business address, simply check the box. <br />\r\n5. Click on &quot;Save&quot; when done.<br />\r\n<br />\r\nIf you have any questions, you can reach us Monday - Friday, 7AM -<br />\r\n5:30PM Mountain time. Thank you for your help &amp; have a lovely rest of<br />\r\nyour day!<br />\r\n<br />\r\nSpaBoom Billing Team',NULL,0,0,0,3,'0','ALL',0,0,'');

CREATE TABLE `dunning_org` (
  `dunning_org` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `dunning` int(11) NOT NULL default '0',
  `step` int(11) NOT NULL default '0',
  `exception_expire_date` datetime default NULL,
  `action_date` datetime default NULL,
  PRIMARY KEY  (`dunning_org`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

# update 06/18/07

CREATE TABLE `slideshow` (
  `slideshow` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `page_id` varchar(50) NOT NULL default '',
  `id` varchar(50) NOT NULL default '',
  `active` int(11) NOT NULL default '0',
  `effect` int(11) NOT NULL default '0',
  `show_thumbnail` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`slideshow`),
  KEY `org` (`org`),
  CONSTRAINT `slideshow_ibfk_1` FOREIGN KEY (`org`) REFERENCES `org` (`org`)
);
CREATE TABLE `slideshow_photo` (
  `slideshow_photo` int(11) NOT NULL auto_increment,
  `slideshow` int(11) NOT NULL default '0',
  `photo` int(11) NOT NULL default '0',
  `photo_src` varchar(100) NOT NULL default '',
  `photo_thumb` varchar(100) NOT NULL default '',
  `sort` decimal(12,8) NOT NULL default '0.00000000',
  PRIMARY KEY  (`slideshow_photo`),
  KEY `slideshow` (`slideshow`),
  KEY `photo` (`photo`),
  CONSTRAINT `slideshow_photo_ibfk_2` FOREIGN KEY (`photo`) REFERENCES `photo` (`photo`),
  CONSTRAINT `slideshow_photo_ibfk_1` FOREIGN KEY (`slideshow`) REFERENCES `slideshow` (`slideshow`)
);

ALTER TABLE affiliate_tran ADD COLUMN original_atom INT AFTER tran_date;
UPDATE affiliate_tran SET original_atom = atom;
ALTER TABLE proc_reason ADD COLUMN msg text;

ALTER TABLE page ADD COLUMN include_slideshow tinyint DEFAULT 0 AFTER include_sidebar_2;

INSERT INTO affiliate_org (affiliate, org) SELECT DISTINCT affiliate, atom AS org FROM affiliate_tran WHERE type = 2 AND atom IN (SELECT org FROM org WHERE org = atom) AND atom NOT IN (SELECT org FROM affiliate_org WHERE org = atom);
ALTER TABLE org DROP FOREIGN KEY org_ibfk_9;
ALTER TABLE org DROP COLUMN affiliate_tran;
DELETE FROM affiliate_tran WHERE type=2 AND original_amount=0 AND amount=0 AND paid=0;
ALTER TABLE affiliate_org ADD COLUMN locked tinyint NOT NULL DEFAULT 0;
UPDATE affiliate_org SET locked=1 WHERE affiliate IN (SELECT DISTINCT affiliate FROM affiliate_tran WHERE paid <> 0);

# update 06/22/07

ALTER TABLE affiliate_org modify affiliate int;

# update 07/16/07

CREATE TABLE `review` (
  `review` int(11) NOT NULL auto_increment,
  `org_client` int(11) NOT NULL default '0',
  `review_text` text NOT NULL,
  `review_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `rating` int(11) default NULL,
  PRIMARY KEY  (`review`),
  KEY `org_client` (`org_client`),
  CONSTRAINT `review_ibfk_1` FOREIGN KEY (`org_client`) REFERENCES `org_client` (`org_client`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE org ADD gift_design_opt_in tinyint NOT NULL DEFAULT 1 AFTER email_marketing_opt_in;

# DROP TABLE `promo`;
CREATE TABLE `promo` (
  `promo` int(11) NOT NULL auto_increment,
  `brand` int(11) NOT NULL default '0',
  `code` varchar(16) NOT NULL default '',
  `signup_fee` int(11) default NULL,
  `website_fee` int(11) default NULL,
  `directory_fee` int(11) default NULL,
  `good_thru` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`promo`),
	UNIQUE KEY `brand_2` (`brand`,`code`),
  KEY `code` (`code`),
  KEY `brand` (`brand`)
) ENGINE=InnoDB;
ALTER TABLE `promo`ADD CONSTRAINT `promo_ibfk_1` FOREIGN KEY (`brand`) REFERENCES `brand` (`brand`);
INSERT INTO  `promo` (`promo`, `brand`, `code`, `signup_fee`, `website_fee`, `directory_fee`, `good_thru`) VALUES
	(NULL, 1, '', 77, 277, NULL, '2007-07-07'),
	(NULL, 2, '', 77, 277, NULL, '2007-07-07'),
	(NULL, 1, 'EXPIRED', 77, 277, NULL, '2007-07-07'),
	(NULL, 2, 'EXPIRED', 77, 277, NULL, '2007-07-07'),
	(NULL, 1, 'ENDURANCE', 0, NULL, NULL, '2010-10-10'),
	(NULL, 2, 'YGLABS', 0, 199, NULL, '2007-10-25'),
	(NULL, 2, 'ALPHA11', 0, 199, NULL, '2007-10-25'),
	(NULL, 2, 'ALPHA94', 49, 249, NULL, '2007-10-25'),
	(NULL, 2, 'ALPHA91', 19, 219, NULL, '2007-10-25');

ALTER TABLE  `brand` ADD `signup_fee` INT NOT NULL DEFAULT  '0';
ALTER TABLE  `brand` ADD  `website_fee` INT NOT NULL DEFAULT  '0';
ALTER TABLE  `brand` ADD  `directory_fee` INT NOT NULL DEFAULT  '0';
UPDATE  `brand` SET  `signup_fee` =  99, `website_fee` =  299 WHERE `brand`.`brand` = 2;
UPDATE  `brand` SET  `signup_fee` =  99 WHERE `brand`.`brand` = 1;

# update 09/30/07

ALTER TABLE gift ADD millennium_status varchar(32);
CREATE TABLE `gift_api` (
  `gift_api` int(11) NOT NULL auto_increment,
  `gift` int(11) NOT NULL default '0',
  `org` int(11) NOT NULL default '0',
  `attempts` int(11) NOT NULL default '0',
  `last_attempt` datetime default NULL,
  `last_status` varchar(32) default NULL,
  `entered_date` datetime default NULL,
  PRIMARY KEY  (`gift_api`),
  KEY `org` (`org`),
  KEY `gift` (`gift`),
  CONSTRAINT `gift_api_ibfk_1` FOREIGN KEY (`org`) REFERENCES `org` (`org`),
  CONSTRAINT `gift_api_ibfk_2` FOREIGN KEY (`gift`) REFERENCES `gift` (`gift`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

# update 10/08/07

UPDATE `promo` SET brand = 1, code = '', signup_fee = NULL, website_fee = NULL, directory_fee = NULL, good_thru = '0000-00-00' WHERE promo = 1;
UPDATE `promo` SET brand = 2, code = '', signup_fee = NULL, website_fee = NULL, directory_fee = NULL, good_thru = '0000-00-00' WHERE promo = 2;
UPDATE `promo` SET brand = 1, code = '__SOLO__', signup_fee = NULL, website_fee = NULL, directory_fee = NULL, good_thru = '0000-00-00' WHERE promo = 3;
UPDATE `promo` SET brand = 2, code = '__SOLO__', signup_fee = 19, website_fee = 149, directory_fee = NULL, good_thru = '0000-00-00' WHERE promo = 4;
ALTER TABLE  `org_type` ADD  `is_solo` TINYINT( 1 ) NOT NULL DEFAULT  '0';
UPDATE `org_type` SET `is_solo` =  '1' WHERE `org_type` = 8 LIMIT 1;
UPDATE `org_type` SET `is_solo` =  '1' WHERE `org_type` = 4 LIMIT 1;

# update 10/08/07

ALTER TABLE  `page` ADD  `sitemap` TINYINT( 1 ) NOT NULL DEFAULT  '1';

# update 10/18/07

ALTER TABLE org_parm CHANGE COLUMN value value varchar(500);

# update 10/23/07

CREATE TABLE `org_partner` (
  `org_partner` int(11) NOT NULL auto_increment,
  `org` int(11) NOT NULL default '0',
  `partner` varchar(16) NOT NULL default '',
  `added_date` datetime default NULL,
  PRIMARY KEY  (`org_partner`),
  KEY `org` (`org`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

# update 10/27/07

ALTER TABLE visit ADD COLUMN captcha_code varchar(16);

# update 11/16/07

ALTER TABLE  `org` ADD  `check_value` TINYINT( 1 ) NOT NULL DEFAULT  '0' AFTER  `retail_gift` ;

# update 11/26/07

