-- phpMyAdmin SQL Dump
-- version 3.2.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 21, 2010 at 11:36 PM
-- Server version: 5.0.90
-- PHP Version: 5.2.12

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: `ebooking_crm`
--

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

--
-- 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, 82, 40, 64, 63, 56, 'Yes', 1, 'harris319@gmail.com', '', '', '', 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=5 ;

--
-- 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@sgc.com', 2),
(4, 'NAME', 'Name', 'SGC', 3);

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

--
-- 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,
  PRIMARY KEY  (`cs_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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


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

--
-- 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`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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


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

--
-- 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', 2, 'Free gift on your birthday', 'Individual', 0, 0, 89, 0, '', '', 0, 0, 0, 0, 0, '', 'All', 0, 0, 0, 0, 0, '', 3, 2, 'name', 'default', 'Y', '0000-00-00', '2010-02-14 00:58:42', '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(6) 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=3 ;

--
-- 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, 1, 'Now', '2010-02-14 00:58:42', 1),
(2, 1, 2, 'Now', '2010-02-14 01:03:59', 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=10 ;

--
-- 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, 1, 1, 1, 'harris319@gmail.com', 'company', 'sim', '2010-02-14 01:00:06'),
(2, 1, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:00:26'),
(3, 2, 1, 1, 'harris319@gmail.com', 'company', 'sim', '2010-02-14 01:04:15'),
(4, 2, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:04:19'),
(5, 2, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:04:52'),
(6, 2, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:05:45'),
(7, 2, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:06:36'),
(8, 2, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:07:29'),
(9, 2, 1, 1, 'harris319@gmail.com', 'person', 'sim', '2010-02-14 01:09:42');

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

--
-- 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=3 ;

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

INSERT INTO `eb_template` (`ebt_id`, `ebt_name`, `ebt_msg`, `ebt_attach`, `ebt_user`, `ebt_created`) VALUES
(2, 'Birthday', '<img src="/tcrm/UserFiles/Image/dad/birthday1.jpg" width="400" height="384" alt=""/>', '', 'sim', '2010-02-14 00:32:03');

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

--
-- 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=18 ;

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

INSERT INTO `memos` (`mm_id`, `mm_group`, `mm_subject`, `mm_msg`, `mm_attach`, `mm_user`, `mm_status`, `mm_created`) VALUES
(1, '3', 'test', 'sddsdas', '2010'' Jan.doc', 'sim', 'Draft', '2010-02-01 16:17:43'),
(2, '3,75', 'tesffd', 'zxxxzzX', '2010'' Jan.doc', 'sim', 'Sent', '2010-02-01 16:59:46'),
(3, '75', 'xzxzxz', '<p>xzcxccxzc</p>\r\n<p>cxzc</p>\r\n<p>cxcz\r\n<table border="1" cellspacing="1" cellpadding="1" width="200">\r\n    <tbody>\r\n        <tr>\r\n            <td>&nbsp;d</td>\r\n            <td><font size="2">&nbsp;2</font></td>\r\n        </tr>\r\n        <tr>\r\n            <td>&nbsp;</td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n        <tr>\r\n            <td>&nbsp;</td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n    </tbody>\r\n</table>\r\n</p>', '2010'' Jan.doc', 'sim', 'Sent', '2010-02-01 17:00:36'),
(4, '3', 'cxxcxbcbb', '<table border="\\&quot;2\\&quot;" cellspacing="\\&quot;1\\&quot;" cellpadding="\\&quot;1\\&quot;">\r\n    <caption>sdsd</caption>\r\n    <tbody>\r\n        <tr>\r\n            <td>&nbsp;<img src="/tcrm/UserFiles/Image/dad/crm.jpg" width="388" height="307" alt=""/></td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n        <tr>\r\n            <td>&nbsp;</td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n        <tr>\r\n            <td>&nbsp;</td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n    </tbody>\r\n</table>', '2010'' Jan (1).doc', 'sim', 'Sent', '2010-02-01 17:04:02'),
(5, '3', 'z', 'zz', '', 'sim', 'Sent', '2010-02-01 17:32:32'),
(6, '75', 'qq', 'ddd<img src="/tcrm/UserFiles/Image/dad/crm.jpg" width="388" height="307" alt=""/>', '', 'sim', 'Sent', '2010-02-01 17:49:01'),
(7, '75', 'xx', '<table border="1" cellspacing="1" cellpadding="1" width="200">\r\n    <tbody>\r\n        <tr>\r\n            <td>&nbsp;a</td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n        <tr>\r\n            <td>&nbsp;</td>\r\n            <td>&nbsp;s</td>\r\n        </tr>\r\n        <tr>\r\n            <td>&nbsp;s</td>\r\n            <td>&nbsp;</td>\r\n        </tr>\r\n    </tbody>\r\n</table>', '', 'sim', 'Sent', '2010-02-01 17:54:23'),
(8, '3', 'c', 'cxzzccxz', '', 'sim', 'Sent', '2010-02-01 18:15:48'),
(9, '3', 'c', 'cxzzccxz', '', 'sim', 'Sent', '2010-02-01 18:16:51'),
(10, '3', 'c', 'cxzzccxz', '', 'sim', 'Sent', '2010-02-01 18:18:39'),
(11, '3', 'c', 'cxzzccxz', '', 'sim', 'Sent', '2010-02-01 18:21:11'),
(12, '3', 'c', '<p><img src="/tcrm/UserFiles/Image/dad/crm.jpg" width="388" height="307" alt=""/></p>', '', 'sim', 'Sent', '2010-02-01 18:24:38'),
(13, '3', 'c', '<p><img src="/tcrm/UserFiles/Image/dad/crm.jpg" width="388" height="307" alt=""/><img alt="\\&quot;\\&quot;/" src="\\&quot;/tcrm/UserFiles/Image/dad/crm.jpg\\&quot;" width="\\&quot;388\\&quot;" height="\\&quot;307\\&quot;"/></p>', '', 'sim', 'Sent', '2010-02-01 18:27:33'),
(14, '3', 'x', '<img src="/tcrm/UserFiles/Image/dad/crm.jpg" width="388" height="307" alt=""/>', '', 'sim', 'Sent', '2010-02-01 18:29:13'),
(15, '3', 'x', '<p><img src="/tcrm/UserFiles/Image/dad/logout.jpg" width="38" height="30" alt=""/></p>\r\n<p>&nbsp;</p>\r\n<p><img src="/tcrm/UserFiles/Image/dad/crm.jpg" width="388" height="307" alt=""/>vcvvcv<br/>\r\n</p>\r\n<p>cxvxv</p>', '', 'sim', 'Sent', '2010-02-01 18:33:00'),
(16, '3,75', 'test', '<p>Welcome to CRM</p>\r\n<p><img src="/tcrm/UserFiles/Image/dad/crm.jpg" alt=""/></p>', '', 'sim', 'Sent', '2010-02-02 10:36:56'),
(17, '', '', 'asfasgfasg', '', 'admin', 'Sent', '2010-02-04 11:58:26');

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

--
-- 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`),
  KEY `nv_type` (`nv_type`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=94 ;

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

INSERT INTO `newvalue` (`nv_id`, `nv_name`, `nv_type`) VALUES
(1, 'NULL', 'DEFAULT'),
(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'),
(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'),
(19, 'CUSTOMER', 'Type'),
(20, 'DATIN', 'Title'),
(21, 'DATUK', 'Title'),
(22, 'DEFENCE', 'Industry'),
(23, 'DIRECT MAIL', 'Source'),
(24, 'DR', 'Title'),
(25, 'EDUCATION', 'Industry'),
(26, 'EMAIL', 'Preference'),
(27, 'EMPLOYEE', 'Source'),
(28, 'ENGINEERING', 'Industry'),
(29, 'ENTERTAINMENT', 'Industry'),
(30, 'EXISTING CUSTOMER', 'Source'),
(31, 'FAX', 'Preference'),
(32, 'GOOGLE', 'Messager Type'),
(33, 'GOVERNMENT', 'Industry'),
(34, 'HEALTHCARE', 'Industry'),
(35, 'HOME', 'Phone Label'),
(36, 'HOSPITALITY', 'Industry'),
(37, 'HR RECRUITMENT', 'Industry'),
(38, 'I.T.', 'Industry'),
(39, 'INSURANCE', 'Industry'),
(40, 'LEAD', 'Type'),
(41, 'LEGAL', 'Industry'),
(42, 'LOST CUSTOMER', 'Type'),
(43, 'LOST PROSPECT', 'Type'),
(44, 'MADAM', 'Title'),
(45, 'MANUFACTURING', 'Industry'),
(46, 'MARKETING MANAGER', 'Role'),
(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'),
(55, 'OTHER', 'Source'),
(56, 'PARTNER', 'Classification'),
(57, 'PARTNER', 'Source'),
(58, 'PHONE', 'Preference'),
(59, 'POST', 'Preference'),
(60, 'PRESS', 'Classification'),
(61, 'PRIMARY INDUSTRY', 'Industry'),
(62, 'PROSPECT', 'Type'),
(63, 'PUBLIC RELATIONS', 'Source'),
(64, 'REAL ESTATE', 'Industry'),
(65, 'RESELLER', 'Classification'),
(66, 'RETAIL', 'Industry'),
(67, 'SALES MANAGER', 'Role'),
(68, 'SELF GENERATED', 'Source'),
(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'),
(77, 'WEB SITE', 'Source'),
(78, 'WORD OF MOUTH', 'Source'),
(79, 'WORK', 'Phone Label'),
(80, 'YAHOO', 'Messager Type'),
(81, '1 - 3', 'Band'),
(82, '4 - 10', 'Band'),
(83, '11 - 20', 'Band'),
(84, '21 - 50', 'Band'),
(85, '51 - 100', 'Band'),
(86, '> 100', 'Band'),
(87, 'SALES', 'Position'),
(88, 'MALAY', 'Race'),
(89, 'CHINESE', 'Race'),
(90, 'INDIA', 'Race'),
(91, 'OTHERS', 'Race'),
(92, 'SINGLE', 'status'),
(93, 'MARRIED', 'status');

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

--
-- 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,
  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`) VALUES
(1, 3, 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=2 ;

--
-- 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, 93, 'Female', '1996-02-12', '', '0000-00-00', '', 40, 64, 68, 17, 'Yes', 1, 'harris319@gmail.com', 'harris319@hotmail.com', '', '', 1, '', 1, '', 1, '', '', '', '', 1, '', 1, '', '', '', '', '', '', 'Malaysia', '', '', '', '', '', '', '', 'sim');

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

--
-- 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,
  PRIMARY KEY  (`pin_id`),
  UNIQUE KEY `pin_name` (`pin_name`,`pin_type`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

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

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

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

--
-- 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,
  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`) VALUES
('admin', 'e10adc3949ba59abbe56e057f20f883e', 3, '@,Setup', 'admin@sgc.com', ''),
('sim', 'e10adc3949ba59abbe56e057f20f883e', 3, '@,Setup,People,Companies,e-Blaster,SMS,Customer,Memos,Report', 'harris319@gmail.com', 'Sim Vui Sing');

--
-- 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 `person`
--
ALTER TABLE `person`
  ADD CONSTRAINT `person_ibfk_1` FOREIGN KEY (`p_title`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_10` FOREIGN KEY (`p_phone1_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_11` FOREIGN KEY (`p_phone2_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_12` FOREIGN KEY (`p_phone3_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_13` FOREIGN KEY (`p_msg1_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_14` FOREIGN KEY (`p_msg2_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_15` FOREIGN KEY (`p_user`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `person_ibfk_2` FOREIGN KEY (`p_role`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_3` FOREIGN KEY (`p_race`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_4` FOREIGN KEY (`p_status`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_5` FOREIGN KEY (`p_type`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_6` FOREIGN KEY (`p_industry`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_7` FOREIGN KEY (`p_source`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_8` FOREIGN KEY (`p_classification`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_9` FOREIGN KEY (`p_preference`) REFERENCES `newvalue` (`nv_id`);

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