-- phpMyAdmin SQL Dump
-- version 3.1.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 28, 2010 at 11:15 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=5 ;

--
-- 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, 'psss', 7, 81, 40, 47, 23, 56, 'Yes', 59, '', '', '', '', 49, '', 79, '', 49, '', '', '', '', 5, '', 53, '', '', '', '', '', '', 'Netherlands Antilles', '', '', '', '', '', '', 'Brazil', 'sim'),
(3, 'dd', 0, 83, 40, 45, 11, 56, 'No', 59, '', '', '', '', 49, '', 79, '', 49, '', '', '', '', 5, '', 53, '', '', '', '', '', '', 'Netherlands Antilles', '', '', '', '', '', '', 'Brazil', 'sim'),
(4, 'dsf', 7, 83, 19, 61, 78, 13, 'No', 59, '', '', '', '', 49, '', 79, '', 49, '', '', '', '', 5, '', 53, '', '', '', '', '', '', 'Netherlands Antilles', '', '', '', '', '', '', 'Brazil', '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@nutritionm.com', 2),
(4, 'GLDEALER', 'Dealer GL for SQL ', '300', 3);

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

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

--
-- 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'),
(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'),
(1, 'NULL', 'DEFAULT'),
(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');

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

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

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

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

INSERT INTO `nextid` (`n_id`, `n_dealer`, `n_invoice`, `n_year`) VALUES
(1, 1, 10021, 2010);

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

--
-- 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_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_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=9 ;

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

INSERT INTO `person` (`p_id`, `p_name`, `p_title`, `p_company`, `p_job`, `p_role`, `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
(6, 'xzxcc', 21, 1, 'xzXw', 10, 'Male', '1965-01-19', 's', '2010-01-27', '2222', 19, 54, 68, 18, 'Yes', 31, 'deed', 'fsdfs', 'sada', '323', 35, '53', 49, '4232', 79, '55435', 'gfdgdf', 'dfgfd', 'gdfg', 5, 'hfgh', 80, 'gdg', 'fdgdf', 'gdfgd', 'dfgg', 'dfdg', '44', 'Benin', 'gdfg', 'gdf', 'gdfg', 'dfg', 'gdf', 'gdfg', 'Benin', 'admin'),
(7, 'sim vui sing', 50, 0, 'programmer', 46, 'Female', '1961-01-21', 'asdsad', '1966-02-24', 'ewewq', 19, 71, 73, 56, 'Yes', 26, 'dsada', 'fdsf', 'gdfgd', '4234', 35, '6757', 49, '123', 79, '312', 'dfsdsf', 'fsfsdf', 'ewrwe', 5, 'hdhh', 32, 'gfhjvgjh', 'fdf', 'kjgk', 'bgg', 'jhgjgj', 'mvmbb', 'Malaysia', 'cdf', 'sasd', 'dsfds', 'asd', 'dasd', 'fdf', 'Botswana', 'sim'),
(8, 'fdsfs', 21, 0, 'sada', 67, 'Male', '1966-02-25', '', '0000-00-00', '', 40, 54, 14, 13, 'No', 1, '', '', '', '', 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,
  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`) VALUES
('admin', 'e10adc3949ba59abbe56e057f20f883e', 2, '@,Setup'),
('sim', 'e10adc3949ba59abbe56e057f20f883e', 3, '@,Setup,People,Companies,e-Blaster,SMS,Customer,Memos,Report');

--
-- 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 `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_phone3_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_11` FOREIGN KEY (`p_msg1_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_12` FOREIGN KEY (`p_msg2_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_13` 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_type`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_4` FOREIGN KEY (`p_industry`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_5` FOREIGN KEY (`p_source`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_6` FOREIGN KEY (`p_classification`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_7` FOREIGN KEY (`p_preference`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_8` FOREIGN KEY (`p_phone1_label`) REFERENCES `newvalue` (`nv_id`),
  ADD CONSTRAINT `person_ibfk_9` FOREIGN KEY (`p_phone2_label`) REFERENCES `newvalue` (`nv_id`);

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