-- phpMyAdmin SQL Dump
-- version 3.1.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 02, 2010 at 09:52 AM
-- Server version: 5.1.33
-- PHP Version: 5.2.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `touchcrm`
--

-- --------------------------------------------------------

--
-- Table structure for table `company`
--

CREATE TABLE IF NOT EXISTS `company` (
  `c_id` int(11) NOT NULL AUTO_INCREMENT,
  `c_name` varchar(50) NOT NULL,
  `c_person` int(11) NOT NULL,
  `c_band` int(11) NOT NULL,
  `c_type` int(11) NOT NULL,
  `c_industry` int(11) NOT NULL,
  `c_source` int(11) NOT NULL,
  `c_classification` int(11) NOT NULL,
  `c_active` char(30) NOT NULL DEFAULT 'No',
  `c_preference` int(11) NOT NULL,
  `c_email1` varchar(50) NOT NULL,
  `c_email2` varchar(50) NOT NULL,
  `c_email3` varchar(50) NOT NULL,
  `c_phone1` varchar(20) NOT NULL,
  `c_phone1_label` int(11) NOT NULL,
  `c_phone2` varchar(20) NOT NULL,
  `c_phone2_label` int(11) NOT NULL,
  `c_phone3` varchar(20) NOT NULL,
  `c_phone3_label` int(11) NOT NULL,
  `c_fax` varchar(20) NOT NULL,
  `c_url1` varchar(50) NOT NULL,
  `c_url2` varchar(50) NOT NULL,
  `c_msg1` varchar(50) NOT NULL,
  `c_msg1_label` int(11) NOT NULL,
  `c_msg2` varchar(50) NOT NULL,
  `c_msg2_label` int(11) NOT NULL,
  `c_addr1` varchar(50) NOT NULL,
  `c_addr2` varchar(50) NOT NULL,
  `c_addr3` varchar(50) NOT NULL,
  `c_city` varchar(50) NOT NULL,
  `c_state` varchar(50) NOT NULL,
  `c_zip` varchar(20) NOT NULL,
  `c_country` varchar(100) NOT NULL,
  `c_paddr1` varchar(50) NOT NULL,
  `c_paddr2` varchar(50) NOT NULL,
  `c_paddr3` varchar(50) NOT NULL,
  `c_pcity` varchar(50) NOT NULL,
  `c_pstate` varchar(50) NOT NULL,
  `c_pzip` varchar(20) NOT NULL,
  `c_pcountry` varchar(100) NOT NULL,
  `c_user` varchar(20) NOT NULL,
  PRIMARY KEY (`c_id`),
  UNIQUE KEY `c_name` (`c_name`,`c_type`,`c_industry`),
  KEY `c_type` (`c_type`),
  KEY `c_industry` (`c_industry`),
  KEY `c_source` (`c_source`),
  KEY `c_classification` (`c_classification`),
  KEY `c_preference` (`c_preference`),
  KEY `c_phone1_label` (`c_phone1_label`),
  KEY `c_phone2_label` (`c_phone2_label`),
  KEY `c_phone3_label` (`c_phone3_label`),
  KEY `c_msg1_label` (`c_msg1_label`),
  KEY `c_msg2_label` (`c_msg2_label`),
  KEY `c_user` (`c_user`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `company`
--

INSERT INTO `company` (`c_id`, `c_name`, `c_person`, `c_band`, `c_type`, `c_industry`, `c_source`, `c_classification`, `c_active`, `c_preference`, `c_email1`, `c_email2`, `c_email3`, `c_phone1`, `c_phone1_label`, `c_phone2`, `c_phone2_label`, `c_phone3`, `c_phone3_label`, `c_fax`, `c_url1`, `c_url2`, `c_msg1`, `c_msg1_label`, `c_msg2`, `c_msg2_label`, `c_addr1`, `c_addr2`, `c_addr3`, `c_city`, `c_state`, `c_zip`, `c_country`, `c_paddr1`, `c_paddr2`, `c_paddr3`, `c_pcity`, `c_pstate`, `c_pzip`, `c_pcountry`, `c_user`) VALUES
(1, 'eGen Online Solution', 0, 81, 40, 48, 11, 18, 'Yes', 1, '', '', '', '', 1, '', 1, '', 1, '', '', '', '', 1, '', 1, '', '', '', '', '', '', 'Malaysia', '', '', '', '', '', '', '', 'sim');

-- --------------------------------------------------------

--
-- Table structure for table `configuration`
--

CREATE TABLE IF NOT EXISTS `configuration` (
  `configuration_id` int(10) NOT NULL AUTO_INCREMENT,
  `configuration_key` varchar(30) NOT NULL,
  `configuration_name` varchar(60) NOT NULL,
  `configuration_value` varchar(50) NOT NULL,
  `configuration_sort` int(3) NOT NULL,
  PRIMARY KEY (`configuration_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

--
-- Dumping data for table `configuration`
--

INSERT INTO `configuration` (`configuration_id`, `configuration_key`, `configuration_name`, `configuration_value`, `configuration_sort`) VALUES
(1, 'TITLE', 'WebSite Name', 'Touch Customer Relationship Management', 1),
(2, 'EMAIL', 'Email', 'master@nutritionm.com', 2),
(4, 'NAME', 'Name', 'SGC', 3),
(5, 'SMS_USER', 'SMS Username', 'mickk_lau', 4),
(6, 'SMS_PWD', 'SMS Password', 'a196619', 5),
(7, 'SMS_API', 'SMS Server', 'http://www.bulksms2u.com/websmsapi/ISendSMS.aspx?', 6),
(8, 'SMS_SENDER', 'SMS Sender', 'SGC', 7);

-- --------------------------------------------------------

--
-- Table structure for table `cs_case`
--

CREATE TABLE IF NOT EXISTS `cs_case` (
  `cs_id` int(11) NOT NULL AUTO_INCREMENT,
  `cs_customer` int(11) NOT NULL,
  `cs_type` varchar(10) NOT NULL,
  `cs_stamp` int(11) NOT NULL,
  `cs_title` varchar(50) NOT NULL,
  `cs_user` varchar(10) NOT NULL,
  `cs_ebopen` int(11) NOT NULL,
  `cs_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`cs_id`),
  KEY `cs_stamp` (`cs_stamp`),
  KEY `cs_user` (`cs_user`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `cs_case`
--

INSERT INTO `cs_case` (`cs_id`, `cs_customer`, `cs_type`, `cs_stamp`, `cs_title`, `cs_user`, `cs_ebopen`, `cs_created`) VALUES
(1, 1, 'person', 4, 'Happy Birthday', 'sim', 2, '2010-02-22 09:38:18'),
(3, 1, 'person', 6, 'sa', 'sim', 0, '2010-02-22 09:40:16');

-- --------------------------------------------------------

--
-- Table structure for table `cs_caselist`
--

CREATE TABLE IF NOT EXISTS `cs_caselist` (
  `csl_id` int(11) NOT NULL AUTO_INCREMENT,
  `csl_stamp` int(11) NOT NULL,
  `csl_detail` text,
  `csl_status` varchar(20) NOT NULL,
  `csl_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`csl_id`),
  KEY `csl_stamp` (`csl_stamp`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `cs_caselist`
--

INSERT INTO `cs_caselist` (`csl_id`, `csl_stamp`, `csl_detail`, `csl_status`, `csl_created`) VALUES
(3, 6, 'ss', 'Pending', '2010-02-22 09:40:16'),
(4, 6, 'ddasdad', 'Follow Up', '2010-02-22 09:56:17'),
(5, 6, 'asklflf\r\nasfdlflf\r\nmaslfasdfd', 'Closed', '2010-02-22 13:22:38'),
(7, 4, 'xcczcc', 'Pending', '2010-02-22 14:21:04');

-- --------------------------------------------------------

--
-- Table structure for table `eb_alert`
--

CREATE TABLE IF NOT EXISTS `eb_alert` (
  `eba_id` int(11) NOT NULL AUTO_INCREMENT,
  `eba_name` varchar(50) NOT NULL,
  `eba_template` int(11) NOT NULL,
  `eba_subject` varchar(50) NOT NULL,
  `eba_pselect` varchar(20) NOT NULL,
  `eba_title` int(11) NOT NULL,
  `eba_role` int(11) NOT NULL,
  `eba_race` int(11) NOT NULL,
  `eba_status` int(11) NOT NULL,
  `eba_gender` varchar(50) NOT NULL,
  `eba_ageformula` char(2) NOT NULL,
  `eba_age` int(2) NOT NULL,
  `eba_type` int(11) NOT NULL,
  `eba_industry` int(11) NOT NULL,
  `eba_source` int(11) NOT NULL,
  `eba_classification` int(11) NOT NULL,
  `eba_country` varchar(100) NOT NULL,
  `eba_cselect` varchar(20) NOT NULL,
  `eba_cband` int(11) NOT NULL,
  `eba_ctype` int(11) NOT NULL,
  `eba_cindustry` int(11) NOT NULL,
  `eba_csource` int(11) NOT NULL,
  `eba_cclassification` int(11) NOT NULL,
  `eba_ccountry` varchar(100) NOT NULL,
  `eba_dob` int(3) NOT NULL,
  `eba_spdob` int(3) NOT NULL,
  `eba_pdear` varchar(7) NOT NULL,
  `eba_cdear` varchar(7) NOT NULL,
  `eba_responder` char(1) NOT NULL DEFAULT 'N',
  `eba_senddate` date NOT NULL,
  `eba_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `eba_user` varchar(20) NOT NULL,
  PRIMARY KEY (`eba_id`),
  KEY `eba_template` (`eba_template`),
  KEY `eba_user` (`eba_user`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `eb_alert`
--

INSERT INTO `eb_alert` (`eba_id`, `eba_name`, `eba_template`, `eba_subject`, `eba_pselect`, `eba_title`, `eba_role`, `eba_race`, `eba_status`, `eba_gender`, `eba_ageformula`, `eba_age`, `eba_type`, `eba_industry`, `eba_source`, `eba_classification`, `eba_country`, `eba_cselect`, `eba_cband`, `eba_ctype`, `eba_cindustry`, `eba_csource`, `eba_cclassification`, `eba_ccountry`, `eba_dob`, `eba_spdob`, `eba_pdear`, `eba_cdear`, `eba_responder`, `eba_senddate`, `eba_created`, `eba_user`) VALUES
(1, 'Happy Birthday', 1, 'Free gift for you', 'All', 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, '', 'All', 0, 0, 0, 0, 0, '', 99, 0, 'name', 'name', 'Y', '0000-00-00', '2010-02-21 23:49:00', 'sim');

-- --------------------------------------------------------

--
-- Table structure for table `eb_alertsent`
--

CREATE TABLE IF NOT EXISTS `eb_alertsent` (
  `ebas_id` int(11) NOT NULL AUTO_INCREMENT,
  `ebas_alert` int(11) NOT NULL,
  `ebas_stamp` int(11) NOT NULL,
  `ebas_type` varchar(50) NOT NULL,
  `ebas_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ebas_record` int(8) NOT NULL,
  PRIMARY KEY (`ebas_id`),
  KEY `ebas_alert` (`ebas_alert`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `eb_alertsent`
--

INSERT INTO `eb_alertsent` (`ebas_id`, `ebas_alert`, `ebas_stamp`, `ebas_type`, `ebas_created`, `ebas_record`) VALUES
(1, 1, 0, 'dob', '2010-02-21 23:57:56', 1);

-- --------------------------------------------------------

--
-- Table structure for table `eb_open`
--

CREATE TABLE IF NOT EXISTS `eb_open` (
  `ebo_id` int(11) NOT NULL AUTO_INCREMENT,
  `ebo_stamp` int(11) NOT NULL,
  `ebo_alert` int(11) NOT NULL,
  `ebo_recipient` int(11) NOT NULL,
  `ebo_email` varchar(50) NOT NULL,
  `ebo_type` varchar(10) NOT NULL,
  `ebo_user` varchar(10) NOT NULL,
  `ebo_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ebo_id`),
  KEY `ebo_alert` (`ebo_alert`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `eb_open`
--

INSERT INTO `eb_open` (`ebo_id`, `ebo_stamp`, `ebo_alert`, `ebo_recipient`, `ebo_email`, `ebo_type`, `ebo_user`, `ebo_created`) VALUES
(1, 0, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-21 23:58:31'),
(2, 0, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-21 23:59:07'),
(3, 0, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-22 00:07:34');

-- --------------------------------------------------------

--
-- Table structure for table `eb_template`
--

CREATE TABLE IF NOT EXISTS `eb_template` (
  `ebt_id` int(11) NOT NULL AUTO_INCREMENT,
  `ebt_name` varchar(100) NOT NULL,
  `ebt_msg` text NOT NULL,
  `ebt_attach` varchar(100) NOT NULL,
  `ebt_user` varchar(20) NOT NULL,
  `ebt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ebt_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `eb_template`
--

INSERT INTO `eb_template` (`ebt_id`, `ebt_name`, `ebt_msg`, `ebt_attach`, `ebt_user`, `ebt_created`) VALUES
(1, 'Happy Birthday', '<img src="/tcrm/UserFiles/Image/test/birthday1.jpg" width="400" height="384" alt=""/>', '', 'sim', '2010-02-21 23:47:06');

-- --------------------------------------------------------

--
-- Table structure for table `email_notification`
--

CREATE TABLE IF NOT EXISTS `email_notification` (
  `en_id` int(10) NOT NULL AUTO_INCREMENT,
  `en_name` varchar(30) NOT NULL,
  `en_subject` varchar(100) NOT NULL,
  `en_message` text NOT NULL,
  PRIMARY KEY (`en_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

--
-- Dumping data for table `email_notification`
--

INSERT INTO `email_notification` (`en_id`, `en_name`, `en_subject`, `en_message`) VALUES
(1, 'NEWMEMBER', 'Welcom to MLM ', 'Dear {name},\r\n\r\nWe welcome your to join our .....\r\n\r\nAccount Information\r\nMember ID : $formno\r\nLogin username : {username}\r\nLogin Password : {pwd}\r\n'),
(2, 'FORGOTPWD', 'Your login password have been reset ', 'Dear Valued Customer,\r\n\r\nYou have requested for your login password to be re-sent to you.\r\n\r\nYour login password is {newpwd}\r\n\r\nThank you\r\n\r\nMLM Administrator'),
(3, 'APPLY_EWALLET', 'Application for payout ', 'Dear {name},\r\n\r\nYour application for withdrawal amount RM {withdraw} for {wtype}.\r\n\r\nIt will few days to process and email notification will send to you.\r\n\r\nRegards,\r\n\r\nAdmin\r\n\r\n\r\n'),
(4, 'PAYOUT_ACCEPT', 'Your payout is accepted', 'Dear {name},\r\n\r\nYour withdrawal {amt} is approved, \r\n\r\n\r\nregards\r\n\r\nAdmin\r\n\r\n\r\n\r\n'),
(5, 'PAYOUT_REJECT', 'Your payout is rejected', 'Dear {name},\r\n\r\nYour withdrawal {amt} is rejected. \r\n\r\n\r\nregards\r\n\r\nAdmin\r\n'),
(6, 'BONUS_RETURN', 'Your have bonus return !', 'Dear {name},\r\n\r\nYour bonus return {amt} is added in e-wallet.  \r\n\r\n\r\nregards\r\n\r\nAdmin\r\n'),
(7, 'ENTRY_APPADMIN', 'Your entry is approved by admin', 'Dear {name},\r\n\r\nYour entry for {qty} unit is approved.\r\n\r\nregards\r\n\r\nAdmin\r\n'),
(8, 'ENTRY_APPMEMBER', 'Please locate your entry ', 'Dear {name},\r\n\r\nYour have a entry for {qty} unit is waiting you to locate.\r\n\r\nregards\r\n\r\nAdmin\r\n');

-- --------------------------------------------------------

--
-- Table structure for table `log`
--

CREATE TABLE IF NOT EXISTS `log` (
  `l_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `l_user` varchar(20) NOT NULL,
  `l_desc` varchar(100) NOT NULL,
  `l_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`l_id`),
  KEY `l_user` (`l_user`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;

--
-- Dumping data for table `log`
--

INSERT INTO `log` (`l_id`, `l_user`, `l_desc`, `l_created`) VALUES
(1, 'sim', 'System Login', '2010-03-01 17:35:25'),
(2, '', 'System Logout', '2010-03-01 17:37:22'),
(3, 'sim', 'System Login', '2010-03-01 17:37:29'),
(4, '', 'System Logout', '2010-03-01 22:51:49'),
(5, 'sim', 'System Login', '2010-03-01 22:51:57'),
(6, '', 'System Logout', '2010-03-01 22:52:03'),
(7, 'admin', 'System Login', '2010-03-01 22:52:10'),
(8, '', 'System Logout', '2010-03-01 22:52:36'),
(9, 'admin', 'System Login', '2010-03-01 22:52:43'),
(10, '', 'System Logout', '2010-03-01 22:53:20'),
(11, 'sim', 'System Login', '2010-03-01 22:53:25'),
(12, 'sim', 'System Login', '2010-03-02 08:55:34'),
(13, '', 'System Logout', '2010-03-02 08:56:28'),
(14, 'sim', 'System Login', '2010-03-02 08:56:37'),
(15, '', 'System Logout', '2010-03-02 09:38:59'),
(16, 'sim', 'System Login', '2010-03-02 09:39:04'),
(17, 'sim', 'System Logout', '2010-03-02 09:39:52'),
(18, 'sim', 'System Login', '2010-03-02 09:39:58'),
(19, 'sim', 'System Logout', '2010-03-02 09:40:10'),
(20, 'sim', 'System Login', '2010-03-02 09:40:16');

-- --------------------------------------------------------

--
-- Table structure for table `memos`
--

CREATE TABLE IF NOT EXISTS `memos` (
  `mm_id` int(11) NOT NULL AUTO_INCREMENT,
  `mm_group` varchar(100) NOT NULL,
  `mm_subject` varchar(50) NOT NULL,
  `mm_msg` text NOT NULL,
  `mm_attach` varchar(100) NOT NULL,
  `mm_user` varchar(20) NOT NULL,
  `mm_status` varchar(7) NOT NULL,
  `mm_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`mm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `memos`
--


-- --------------------------------------------------------

--
-- Table structure for table `newvalue`
--

CREATE TABLE IF NOT EXISTS `newvalue` (
  `nv_id` int(11) NOT NULL AUTO_INCREMENT,
  `nv_name` varchar(50) NOT NULL,
  `nv_type` varchar(30) NOT NULL,
  PRIMARY KEY (`nv_id`),
  UNIQUE KEY `nv_name_2` (`nv_name`,`nv_type`),
  KEY `nv_type` (`nv_type`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=95 ;

--
-- Dumping data for table `newvalue`
--

INSERT INTO `newvalue` (`nv_id`, `nv_name`, `nv_type`) VALUES
(81, '1 - 3', 'Band'),
(83, '11 - 20', 'Band'),
(84, '21 - 50', 'Band'),
(82, '4 - 10', 'Band'),
(85, '51 - 100', 'Band'),
(86, '> 100', 'Band'),
(2, 'ADMINISTRATION', 'Industry'),
(3, 'Administrator', 'Position'),
(4, 'ADVERTISING', 'Industry'),
(5, 'AOL', 'Messager Type'),
(6, 'BANKING', 'Industry'),
(7, 'BIOTECHNOLOGY', 'Industry'),
(8, 'CALL CENTRE', 'Industry'),
(9, 'CEO', 'Role'),
(10, 'CFO', 'Role'),
(88, 'CHINESE', 'Race'),
(11, 'COLD CALL', 'Source'),
(12, 'COMMUNITY', 'Industry'),
(13, 'COMPETITOR', 'Classification'),
(14, 'CONFERENCE', 'Source'),
(15, 'CONSTRUCTION', 'Industry'),
(16, 'CONSULTING', 'Industry'),
(17, 'CONTRACTOR/EMPLOYEE', 'Classification'),
(18, 'CUSTOMER', 'Classification'),
(20, 'DATIN', 'Title'),
(21, 'DATUK', 'Title'),
(22, 'DEFENCE', 'Industry'),
(23, 'DIRECT MAIL', 'Source'),
(24, 'DR', 'Title'),
(25, 'EDUCATION', 'Industry'),
(26, 'EMAIL', 'Preference'),
(62, 'EMAIL ENQUIRIES', 'Type'),
(27, 'EMPLOYEE', 'Source'),
(28, 'ENGINEERING', 'Industry'),
(29, 'ENTERTAINMENT', 'Industry'),
(43, 'EXHIBITION', 'Type'),
(30, 'EXISTING CUSTOMER', 'Source'),
(31, 'FAX', 'Preference'),
(32, 'GOOGLE', 'Messager Type'),
(33, 'GOVERNMENT', 'Industry'),
(19, 'GPT INVESTOR', 'Type'),
(34, 'HEALTHCARE', 'Industry'),
(35, 'HOME', 'Phone Label'),
(36, 'HOSPITALITY', 'Industry'),
(37, 'HR RECRUITMENT', 'Industry'),
(38, 'I.T.', 'Industry'),
(89, 'INDIA', 'Race'),
(39, 'INSURANCE', 'Industry'),
(40, 'IVC MEMBERS', 'Type'),
(41, 'LEGAL', 'Industry'),
(44, 'MADAM', 'Title'),
(87, 'MALAY', 'Race'),
(93, 'MANAGER', 'Position'),
(45, 'MANUFACTURING', 'Industry'),
(46, 'MARKETING MANAGER', 'Role'),
(92, 'MARRIED', 'status'),
(47, 'MEDIA', 'Industry'),
(48, 'MINERALS', 'Industry'),
(49, 'MOBILE', 'Phone Label'),
(50, 'MR', 'Title'),
(51, 'MRS', 'Title'),
(52, 'MS', 'Title'),
(53, 'MSN', 'Messager Type'),
(54, 'NOT FOR PROFIT', 'Industry'),
(1, 'NULL', 'DEFAULT'),
(55, 'OTHER', 'Source'),
(90, 'OTHERS', 'Race'),
(56, 'PARTNER', 'Classification'),
(57, 'PARTNER', 'Source'),
(58, 'PHONE', 'Preference'),
(59, 'POST', 'Preference'),
(60, 'PRESS', 'Classification'),
(61, 'PRIMARY INDUSTRY', 'Industry'),
(63, 'PUBLIC RELATIONS', 'Source'),
(64, 'REAL ESTATE', 'Industry'),
(94, 'REFERRAL', 'Type'),
(65, 'RESELLER', 'Classification'),
(66, 'RETAIL', 'Industry'),
(67, 'SALES MANAGER', 'Role'),
(68, 'SELF GENERATED', 'Source'),
(91, 'SINGLE', 'status'),
(69, 'SPORT', 'Industry'),
(70, 'SUPPLIER', 'Classification'),
(71, 'TELECOMMUNICATIONS', 'Industry'),
(72, 'TOURISM', 'Industry'),
(73, 'TRADE SHOW', 'Source'),
(74, 'TRANSPORT', 'Industry'),
(75, 'USER', 'Position'),
(76, 'UTILITIES', 'Industry'),
(42, 'WALK-IN ', 'Type'),
(77, 'WEB SITE', 'Source'),
(78, 'WORD OF MOUTH', 'Source'),
(79, 'WORK', 'Phone Label'),
(80, 'YAHOO', 'Messager Type');

-- --------------------------------------------------------

--
-- Table structure for table `nextid`
--

CREATE TABLE IF NOT EXISTS `nextid` (
  `n_id` int(11) NOT NULL AUTO_INCREMENT,
  `n_eb` int(11) NOT NULL DEFAULT '1',
  `case_id` int(11) NOT NULL,
  `n_sms` int(11) NOT NULL,
  PRIMARY KEY (`n_id`),
  KEY `n_dealer` (`n_eb`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `nextid`
--

INSERT INTO `nextid` (`n_id`, `n_eb`, `case_id`, `n_sms`) VALUES
(1, 1, 7, 1);

-- --------------------------------------------------------

--
-- Table structure for table `person`
--

CREATE TABLE IF NOT EXISTS `person` (
  `p_id` int(11) NOT NULL AUTO_INCREMENT,
  `p_name` varchar(50) NOT NULL,
  `p_title` int(11) NOT NULL,
  `p_company` int(11) NOT NULL,
  `p_job` varchar(50) NOT NULL,
  `p_role` int(11) NOT NULL,
  `p_race` int(11) NOT NULL,
  `p_status` int(11) NOT NULL,
  `p_gender` varchar(50) NOT NULL,
  `p_dob` date NOT NULL,
  `p_spouse` varchar(50) NOT NULL,
  `p_spdob` date NOT NULL,
  `p_spphone` varchar(20) NOT NULL,
  `p_type` int(11) NOT NULL,
  `p_industry` int(11) NOT NULL,
  `p_source` int(11) NOT NULL,
  `p_classification` int(11) NOT NULL,
  `p_active` char(30) NOT NULL DEFAULT 'No',
  `p_preference` int(11) NOT NULL,
  `p_email1` varchar(50) NOT NULL,
  `p_email2` varchar(50) NOT NULL,
  `p_email3` varchar(50) NOT NULL,
  `p_phone1` varchar(20) NOT NULL,
  `p_phone1_label` int(11) NOT NULL,
  `p_phone2` varchar(20) NOT NULL,
  `p_phone2_label` int(11) NOT NULL,
  `p_phone3` varchar(20) NOT NULL,
  `p_phone3_label` int(11) NOT NULL,
  `p_fax` varchar(20) NOT NULL,
  `p_url1` varchar(50) NOT NULL,
  `p_url2` varchar(50) NOT NULL,
  `p_msg1` varchar(50) NOT NULL,
  `p_msg1_label` int(11) NOT NULL,
  `p_msg2` varchar(50) NOT NULL,
  `p_msg2_label` int(11) NOT NULL,
  `p_addr1` varchar(50) NOT NULL,
  `p_addr2` varchar(50) NOT NULL,
  `p_addr3` varchar(50) NOT NULL,
  `p_city` varchar(50) NOT NULL,
  `p_state` varchar(50) NOT NULL,
  `p_zip` varchar(20) NOT NULL,
  `p_country` varchar(100) NOT NULL,
  `p_paddr1` varchar(50) NOT NULL,
  `p_paddr2` varchar(50) NOT NULL,
  `p_paddr3` varchar(50) NOT NULL,
  `p_pcity` varchar(50) NOT NULL,
  `p_pstate` varchar(50) NOT NULL,
  `p_pzip` varchar(20) NOT NULL,
  `p_pcountry` varchar(100) NOT NULL,
  `p_user` varchar(20) NOT NULL,
  PRIMARY KEY (`p_id`),
  UNIQUE KEY `p_name` (`p_name`,`p_dob`),
  KEY `p_title` (`p_title`),
  KEY `p_role` (`p_role`),
  KEY `p_race` (`p_race`),
  KEY `p_status` (`p_status`),
  KEY `p_type` (`p_type`),
  KEY `p_industry` (`p_industry`),
  KEY `p_source` (`p_source`),
  KEY `p_classification` (`p_classification`),
  KEY `p_preference` (`p_preference`),
  KEY `p_phone1_label` (`p_phone1_label`),
  KEY `p_phone2_label` (`p_phone2_label`),
  KEY `p_phone3_label` (`p_phone3_label`),
  KEY `p_msg1_label` (`p_msg1_label`),
  KEY `p_msg2_label` (`p_msg2_label`),
  KEY `p_user` (`p_user`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `person`
--

INSERT INTO `person` (`p_id`, `p_name`, `p_title`, `p_company`, `p_job`, `p_role`, `p_race`, `p_status`, `p_gender`, `p_dob`, `p_spouse`, `p_spdob`, `p_spphone`, `p_type`, `p_industry`, `p_source`, `p_classification`, `p_active`, `p_preference`, `p_email1`, `p_email2`, `p_email3`, `p_phone1`, `p_phone1_label`, `p_phone2`, `p_phone2_label`, `p_phone3`, `p_phone3_label`, `p_fax`, `p_url1`, `p_url2`, `p_msg1`, `p_msg1_label`, `p_msg2`, `p_msg2_label`, `p_addr1`, `p_addr2`, `p_addr3`, `p_city`, `p_state`, `p_zip`, `p_country`, `p_paddr1`, `p_paddr2`, `p_paddr3`, `p_pcity`, `p_pstate`, `p_pzip`, `p_pcountry`, `p_user`) VALUES
(1, 'Lim Suk Ling', 51, 0, 'Admin', 67, 89, 1, 'Female', '1996-02-21', '', '0000-00-00', '', 40, 64, 68, 17, 'Yes', 1, 'harris319@gmail.com', 'harris319@hotmail.com', '', '', 1, '', 1, '', 1, '', '', '', '', 1, '', 1, '', '', '', '', '', '', 'Malaysia', '', '', '', '', '', '', '', 'sim'),
(2, 'Harris', 21, 0, 'Manager', 9, 89, 92, 'Male', '1962-03-20', 'Tang', '1963-03-21', '3434324', 40, 69, 68, 60, 'No', 31, 'rrf', 'fdf', 'fds', '3312', 1, '', 1, '', 1, '', '', '', '', 1, '', 1, 'ddsda', 'dasdsasfg', 'ggsd', 'gdsf', 'fdsfsd', 'fsd', 'Malaysia', 'sdf', 'fsdfs', 'fsdfsdfds', 'fsdf', 'fd', '54543', 'Botswana', 'sim'),
(3, 'Jacky', 24, 0, '', 1, 87, 1, 'Female', '0000-00-00', '', '0000-00-00', '', 19, 1, 1, 1, 'Yes', 1, '', '', '', '', 1, '', 1, '', 1, '', '', '', '', 1, '', 1, '', '', '', '', '', '', 'Malaysia', '', '', '', '', '', '', '', 'admin');

-- --------------------------------------------------------

--
-- Table structure for table `pinmenu`
--

CREATE TABLE IF NOT EXISTS `pinmenu` (
  `pin_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pin_name` varchar(50) NOT NULL,
  `pin_search` varchar(150) NOT NULL,
  `pin_type` varchar(20) NOT NULL,
  `pin_user` varchar(20) NOT NULL,
  PRIMARY KEY (`pin_id`),
  UNIQUE KEY `pin_name` (`pin_name`,`pin_type`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;

--
-- Dumping data for table `pinmenu`
--

INSERT INTO `pinmenu` (`pin_id`, `pin_name`, `pin_search`, `pin_type`, `pin_user`) VALUES
(2, 'CEO', 'sType=Name&sReferral=&role=9&type=&industry=&country=', 'person', '0'),
(3, 'LEAD', 'sType=Name&sReferral=&role=&type=40&industry=&country=', 'person', '0'),
(11, 'PRESS', 'sType=Name&sReferral=&classification=60&type=&industry=&country=', 'company', '0'),
(12, 'TEST', 'sType=Name&sReferral=&role=&type=&industry=&country=', 'person', 'sim');

-- --------------------------------------------------------

--
-- Table structure for table `sms_alert`
--

CREATE TABLE IF NOT EXISTS `sms_alert` (
  `smsa_id` int(11) NOT NULL AUTO_INCREMENT,
  `smsa_name` varchar(50) NOT NULL,
  `smsa_template` int(11) NOT NULL,
  `smsa_pselect` varchar(20) NOT NULL,
  `smsa_title` int(11) NOT NULL,
  `smsa_role` int(11) NOT NULL,
  `smsa_race` int(11) NOT NULL,
  `smsa_status` int(11) NOT NULL,
  `smsa_gender` varchar(50) NOT NULL,
  `smsa_ageformula` char(2) NOT NULL,
  `smsa_age` int(2) NOT NULL,
  `smsa_type` int(11) NOT NULL,
  `smsa_industry` int(11) NOT NULL,
  `smsa_source` int(11) NOT NULL,
  `smsa_classification` int(11) NOT NULL,
  `smsa_country` varchar(100) NOT NULL,
  `smsa_cselect` varchar(20) NOT NULL,
  `smsa_cband` int(11) NOT NULL,
  `smsa_ctype` int(11) NOT NULL,
  `smsa_cindustry` int(11) NOT NULL,
  `smsa_csource` int(11) NOT NULL,
  `smsa_cclassification` int(11) NOT NULL,
  `smsa_ccountry` varchar(100) NOT NULL,
  `smsa_dob` int(3) NOT NULL,
  `smsa_spdob` int(3) NOT NULL,
  `smsa_pdear` varchar(7) NOT NULL,
  `smsa_cdear` varchar(7) NOT NULL,
  `smsa_senddate` date NOT NULL,
  `smsa_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `smsa_user` varchar(20) NOT NULL,
  PRIMARY KEY (`smsa_id`),
  KEY `smsa_template` (`smsa_template`),
  KEY `smsa_user` (`smsa_user`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `sms_alert`
--

INSERT INTO `sms_alert` (`smsa_id`, `smsa_name`, `smsa_template`, `smsa_pselect`, `smsa_title`, `smsa_role`, `smsa_race`, `smsa_status`, `smsa_gender`, `smsa_ageformula`, `smsa_age`, `smsa_type`, `smsa_industry`, `smsa_source`, `smsa_classification`, `smsa_country`, `smsa_cselect`, `smsa_cband`, `smsa_ctype`, `smsa_cindustry`, `smsa_csource`, `smsa_cclassification`, `smsa_ccountry`, `smsa_dob`, `smsa_spdob`, `smsa_pdear`, `smsa_cdear`, `smsa_senddate`, `smsa_created`, `smsa_user`) VALUES
(1, 'New house', 1, 'Individual', 0, 0, 0, 0, '', '<', 24, 0, 0, 0, 0, '', 'All', 0, 0, 0, 0, 0, '', 0, 0, 'name', 'name', '2010-03-22', '2010-02-22 15:55:11', 'sim');

-- --------------------------------------------------------

--
-- Table structure for table `sms_alertsent`
--

CREATE TABLE IF NOT EXISTS `sms_alertsent` (
  `smsas_id` int(11) NOT NULL AUTO_INCREMENT,
  `smsas_alert` int(11) NOT NULL,
  `smsas_stamp` int(11) NOT NULL,
  `smsas_type` varchar(50) NOT NULL,
  `smsas_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `smsas_record` int(8) NOT NULL,
  PRIMARY KEY (`smsas_id`),
  KEY `smsas_alert` (`smsas_alert`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `sms_alertsent`
--


-- --------------------------------------------------------

--
-- Table structure for table `sms_template`
--

CREATE TABLE IF NOT EXISTS `sms_template` (
  `smst_id` int(11) NOT NULL AUTO_INCREMENT,
  `smst_name` varchar(100) NOT NULL,
  `smst_msg` text NOT NULL,
  `smst_user` varchar(20) NOT NULL,
  `smst_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`smst_id`),
  KEY `smst_user` (`smst_user`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `sms_template`
--

INSERT INTO `sms_template` (`smst_id`, `smst_name`, `smst_msg`, `smst_user`, `smst_created`) VALUES
(1, 'Promotion', 'Promotion on ..cffff', 'sim', '2010-02-22 15:10:58');

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (
  `id` varchar(20) NOT NULL,
  `pwd` varchar(100) NOT NULL,
  `position` int(11) NOT NULL,
  `access` varchar(255) NOT NULL,
  `email` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `oldpwd` varchar(30) NOT NULL,
  `active` char(3) NOT NULL DEFAULT 'No',
  `permission` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `position` (`position`),
  KEY `access` (`access`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`id`, `pwd`, `position`, `access`, `email`, `name`, `oldpwd`, `active`, `permission`) VALUES
('admin', 'e10adc3949ba59abbe56e057f20f883e', 3, '@,Setup,People,Companies,e-Blaster,SMS,Customer,Memos,Report', 'harris319@gmail.com', 'admin', '', 'Yes', '@,'),
('sim', 'e10adc3949ba59abbe56e057f20f883e', 3, '@,Setup,People,Companies,e-Blaster,SMS,Customer,Memos,Report', 'harris319@gmail.com', 'Sim vui sing', '123456', 'Yes', '@,');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `company`
--
ALTER TABLE `company`
  ADD CONSTRAINT `company_ibfk_1` FOREIGN KEY (`c_type`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_10` FOREIGN KEY (`c_msg2_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_11` FOREIGN KEY (`c_user`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `company_ibfk_2` FOREIGN KEY (`c_industry`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_3` FOREIGN KEY (`c_source`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_4` FOREIGN KEY (`c_classification`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_5` FOREIGN KEY (`c_preference`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_6` FOREIGN KEY (`c_phone1_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_7` FOREIGN KEY (`c_phone2_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_8` FOREIGN KEY (`c_phone3_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `company_ibfk_9` FOREIGN KEY (`c_msg1_label`) REFERENCES `newvalue` (`nv_id`);

--
-- Constraints for table `eb_alert`
--
ALTER TABLE `eb_alert`
  ADD CONSTRAINT `eb_alert_ibfk_1` FOREIGN KEY (`eba_template`) REFERENCES `eb_template` (`ebt_id`),
  ADD CONSTRAINT `eb_alert_ibfk_2` FOREIGN KEY (`eba_user`) REFERENCES `user` (`id`);

--
-- Constraints for table `eb_alertsent`
--
ALTER TABLE `eb_alertsent`
  ADD CONSTRAINT `eb_alertsent_ibfk_1` FOREIGN KEY (`ebas_alert`) REFERENCES `eb_alert` (`eba_id`);

--
-- Constraints for table `eb_open`
--
ALTER TABLE `eb_open`
  ADD CONSTRAINT `eb_open_ibfk_1` FOREIGN KEY (`ebo_alert`) REFERENCES `eb_alert` (`eba_id`);

--
-- Constraints for table `sms_alert`
--
ALTER TABLE `sms_alert`
  ADD CONSTRAINT `sms_alert_ibfk_1` FOREIGN KEY (`smsa_template`) REFERENCES `sms_template` (`smst_id`),
  ADD CONSTRAINT `sms_alert_ibfk_2` FOREIGN KEY (`smsa_user`) REFERENCES `user` (`id`);

--
-- Constraints for table `sms_alertsent`
--
ALTER TABLE `sms_alertsent`
  ADD CONSTRAINT `sms_alertsent_ibfk_1` FOREIGN KEY (`smsas_alert`) REFERENCES `sms_alert` (`smsa_id`);

--
-- Constraints for table `sms_template`
--
ALTER TABLE `sms_template`
  ADD CONSTRAINT `sms_template_ibfk_1` FOREIGN KEY (`smst_user`) REFERENCES `user` (`id`);

--
-- Constraints for table `user`
--
ALTER TABLE `user`
  ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`position`) REFERENCES `newvalue` (`nv_id`);
