-- ================================================================
--
-- @version $Id: structure.sql 2020-02-01 12:12:05 gewa $
-- @package Freelance Manager
-- @copyright 2020. wojoscripts.com
--
-- ================================================================
-- Database Content
-- ================================================================

--
-- Table structure for table `activity`
--

DROP TABLE IF EXISTS `activity`;
CREATE TABLE IF NOT EXISTS `activity` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `invoice_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `estimate_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `note_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `task_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `message_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `type` varchar(30) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `comment` varchar(250) DEFAULT NULL,
  `userid` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `username` varchar(50) DEFAULT NULL,
  `fullname` varchar(100) DEFAULT NULL,
  `groups` varchar(30) DEFAULT NULL,
  `ip` varbinary(32) DEFAULT NULL,
  `is_activity` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_uid` (`uid`),
  KEY `idx_company_id` (`company_id`),
  KEY `idx_project_id` (`project_id`),
  KEY `idx_invoice_id` (`invoice_id`),
  KEY `idx_note_id` (`note_id`),
  KEY `idx_task_id` (`task_id`),
  KEY `idx_message_id` (`message_id`),
  KEY `idx_estimate_id` (`estimate_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `calendars`
--

DROP TABLE IF EXISTS `calendars`;
CREATE TABLE IF NOT EXISTS `calendars` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_by_email` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `position` int(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `calendar_events`
--

DROP TABLE IF EXISTS `calendar_events`;
CREATE TABLE IF NOT EXISTS `calendar_events` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `calendar_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `starts_on` date DEFAULT NULL,
  `starts_on_time` time DEFAULT NULL,
  `ends_on` date DEFAULT NULL,
  `ends_on_time` time DEFAULT NULL,
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_by_email` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `comment` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `position` int(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_calendar_id` (`calendar_id`),
  KEY `idx_user_id` (`created_by_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `calendar_users`
--

DROP TABLE IF EXISTS `calendar_users`;
CREATE TABLE IF NOT EXISTS `calendar_users` (
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `calendar_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `is_visible` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  PRIMARY KEY (`user_id`,`calendar_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `companies`
--

DROP TABLE IF EXISTS `companies`;
CREATE TABLE IF NOT EXISTS `companies` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8 NOT NULL,
  `email` varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  `website` varchar(150) CHARACTER SET utf8 DEFAULT NULL,
  `phone` varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  `address` varchar(150) CHARACTER SET utf8 DEFAULT NULL,
  `city` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
  `state` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(120) CHARACTER SET utf8 DEFAULT NULL,
  `zip` varchar(14) CHARACTER SET utf8 DEFAULT NULL,
  `vat` varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  `currency` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL,
  `jobtypes` blob,
  `logo` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `note` tinytext COLLATE utf8_unicode_ci,
  `owner` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1= active, 2=trash, 3=archive',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `countries`
--

DROP TABLE IF EXISTS `countries`;
CREATE TABLE IF NOT EXISTS `countries` (
  `id` int(3) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(200) DEFAULT NULL,
  `iso_alpha2` varchar(2) DEFAULT NULL,
  `iso_alpha3` varchar(3) DEFAULT NULL,
  `iso_numeric` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `currency_code` char(3) DEFAULT NULL,
  `currency_name` varchar(32) DEFAULT NULL,
  `currrency_symbol` varchar(3) DEFAULT NULL,
  `sorting` smallint(4) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `countries`
--

INSERT INTO `countries` (`id`, `name`, `iso_alpha2`, `iso_alpha3`, `iso_numeric`, `currency_code`, `currency_name`, `currrency_symbol`, `sorting`) VALUES
(1, 'Afghanistan', 'AF', 'AFG', 4, 'AFN', 'Afghani', '؋', 0),
(2, 'Albania', 'AL', 'ALB', 8, 'ALL', 'Lek', 'Lek', 0),
(3, 'Algeria', 'DZ', 'DZA', 12, 'DZD', 'Dinar', '', 0),
(4, 'American Samoa', 'AS', 'ASM', 16, 'USD', 'Dollar', '$', 0),
(5, 'Andorra', 'AD', 'AND', 20, 'EUR', 'Euro', '€', 0),
(6, 'Angola', 'AO', 'AGO', 24, 'AOA', 'Kwanza', 'Kz', 0),
(7, 'Anguilla', 'AI', 'AIA', 660, 'XCD', 'Dollar', '$', 0),
(9, 'Antigua and Barbuda', 'AG', 'ATG', 28, 'XCD', 'Dollar', '$', 0),
(10, 'Argentina', 'AR', 'ARG', 32, 'ARS', 'Peso', '$', 0),
(11, 'Armenia', 'AM', 'ARM', 51, 'AMD', 'Dram', '', 0),
(12, 'Aruba', 'AW', 'ABW', 533, 'AWG', 'Guilder', 'ƒ', 0),
(13, 'Australia', 'AU', 'AUS', 36, 'AUD', 'Dollar', '$', 0),
(14, 'Austria', 'AT', 'AUT', 40, 'EUR', 'Euro', '€', 0),
(15, 'Azerbaijan', 'AZ', 'AZE', 31, 'AZN', 'Manat', 'ман', 0),
(16, 'Bahamas', 'BS', 'BHS', 44, 'BSD', 'Dollar', '$', 0),
(17, 'Bahrain', 'BH', 'BHR', 48, 'BHD', 'Dinar', '', 0),
(18, 'Bangladesh', 'BD', 'BGD', 50, 'BDT', 'Taka', '', 0),
(19, 'Barbados', 'BB', 'BRB', 52, 'BBD', 'Dollar', '$', 0),
(20, 'Belarus', 'BY', 'BLR', 112, 'BYR', 'Ruble', 'p.', 0),
(21, 'Belgium', 'BE', 'BEL', 56, 'EUR', 'Euro', '€', 0),
(22, 'Belize', 'BZ', 'BLZ', 84, 'BZD', 'Dollar', 'BZ$', 0),
(23, 'Benin', 'BJ', 'BEN', 204, 'XOF', 'Franc', '', 0),
(24, 'Bermuda', 'BM', 'BMU', 60, 'BMD', 'Dollar', '$', 0),
(25, 'Bhutan', 'BT', 'BTN', 64, 'BTN', 'Ngultrum', '', 0),
(26, 'Bolivia', 'BO', 'BOL', 68, 'BOB', 'Boliviano', '$b', 0),
(27, 'Bosnia and Herzegovina', 'BA', 'BIH', 70, 'BAM', 'Marka', 'KM', 0),
(28, 'Botswana', 'BW', 'BWA', 72, 'BWP', 'Pula', 'P', 0),
(29, 'Bouvet Island', 'BV', 'BVT', 74, 'NOK', 'Krone', 'kr', 0),
(30, 'Brazil', 'BR', 'BRA', 76, 'BRL', 'Real', 'R$', 0),
(31, 'British Indian Ocean Territory', 'IO', 'IOT', 86, 'USD', 'Dollar', '$', 0),
(32, 'British Virgin Islands', 'VG', 'VGB', 92, 'USD', 'Dollar', '$', 0),
(33, 'Brunei', 'BN', 'BRN', 96, 'BND', 'Dollar', '$', 0),
(34, 'Bulgaria', 'BG', 'BGR', 100, 'BGN', 'Lev', 'лв', 0),
(35, 'Burkina Faso', 'BF', 'BFA', 854, 'XOF', 'Franc', '', 0),
(36, 'Burundi', 'BI', 'BDI', 108, 'BIF', 'Franc', '', 0),
(37, 'Cambodia', 'KH', 'KHM', 116, 'KHR', 'Riels', '៛', 0),
(38, 'Cameroon', 'CM', 'CMR', 120, 'XAF', 'Franc', 'FCF', 0),
(39, 'Canada', 'CA', 'CAN', 124, 'CAD', 'Dollar', '$', 999),
(40, 'Cape Verde', 'CV', 'CPV', 132, 'CVE', 'Escudo', '', 0),
(41, 'Cayman Islands', 'KY', 'CYM', 136, 'KYD', 'Dollar', '$', 0),
(42, 'Central African Republic', 'CF', 'CAF', 140, 'XAF', 'Franc', 'FCF', 0),
(43, 'Chad', 'TD', 'TCD', 148, 'XAF', 'Franc', '', 0),
(44, 'Chile', 'CL', 'CHL', 152, 'CLP', 'Peso', '', 0),
(45, 'China', 'CN', 'CHN', 156, 'CNY', 'Yuan Renminbi', '¥', 0),
(46, 'Christmas Island', 'CX', 'CXR', 162, 'AUD', 'Dollar', '$', 0),
(47, 'Cocos Islands', 'CC', 'CCK', 166, 'AUD', 'Dollar', '$', 0),
(48, 'Colombia', 'CO', 'COL', 170, 'COP', 'Peso', '$', 0),
(49, 'Comoros', 'KM', 'COM', 174, 'KMF', 'Franc', '', 0),
(50, 'Cook Islands', 'CK', 'COK', 184, 'NZD', 'Dollar', '$', 0),
(51, 'Costa Rica', 'CR', 'CRI', 188, 'CRC', 'Colon', '₡', 0),
(52, 'Croatia', 'HR', 'HRV', 191, 'HRK', 'Kuna', 'kn', 0),
(53, 'Cuba', 'CU', 'CUB', 192, 'CUP', 'Peso', '₱', 0),
(54, 'Cyprus', 'CY', 'CYP', 196, 'CYP', 'Pound', '', 0),
(55, 'Czech Republic', 'CZ', 'CZE', 203, 'CZK', 'Koruna', 'Kč', 0),
(56, 'Democratic Republic of the Congo', 'CD', 'COD', 180, 'CDF', 'Franc', '', 0),
(57, 'Denmark', 'DK', 'DNK', 208, 'DKK', 'Krone', 'kr', 0),
(58, 'Djibouti', 'DJ', 'DJI', 262, 'DJF', 'Franc', '', 0),
(59, 'Dominica', 'DM', 'DMA', 212, 'XCD', 'Dollar', '$', 0),
(60, 'Dominican Republic', 'DO', 'DOM', 214, 'DOP', 'Peso', 'RD$', 0),
(61, 'East Timor', 'TL', 'TLS', 626, 'USD', 'Dollar', '$', 0),
(62, 'Ecuador', 'EC', 'ECU', 218, 'USD', 'Dollar', '$', 0),
(63, 'Egypt', 'EG', 'EGY', 818, 'EGP', 'Pound', '£', 0),
(64, 'El Salvador', 'SV', 'SLV', 222, 'SVC', 'Colone', '$', 0),
(65, 'Equatorial Guinea', 'GQ', 'GNQ', 226, 'XAF', 'Franc', 'FCF', 0),
(66, 'Eritrea', 'ER', 'ERI', 232, 'ERN', 'Nakfa', 'Nfk', 0),
(67, 'Estonia', 'EE', 'EST', 233, 'EEK', 'Kroon', 'kr', 0),
(68, 'Ethiopia', 'ET', 'ETH', 231, 'ETB', 'Birr', '', 0),
(69, 'Falkland Islands', 'FK', 'FLK', 238, 'FKP', 'Pound', '£', 0),
(70, 'Faroe Islands', 'FO', 'FRO', 234, 'DKK', 'Krone', 'kr', 0),
(71, 'Fiji', 'FJ', 'FJI', 242, 'FJD', 'Dollar', '$', 0),
(72, 'Finland', 'FI', 'FIN', 246, 'EUR', 'Euro', '€', 0),
(73, 'France', 'FR', 'FRA', 250, 'EUR', 'Euro', '€', 0),
(74, 'French Guiana', 'GF', 'GUF', 254, 'EUR', 'Euro', '€', 0),
(75, 'French Polynesia', 'PF', 'PYF', 258, 'XPF', 'Franc', '', 0),
(76, 'French Southern Territories', 'TF', 'ATF', 260, 'EUR', 'Euro  ', '€', 0),
(77, 'Gabon', 'GA', 'GAB', 266, 'XAF', 'Franc', 'FCF', 0),
(78, 'Gambia', 'GM', 'GMB', 270, 'GMD', 'Dalasi', 'D', 0),
(79, 'Georgia', 'GE', 'GEO', 268, 'GEL', 'Lari', '', 0),
(80, 'Germany', 'DE', 'DEU', 276, 'EUR', 'Euro', '€', 0),
(81, 'Ghana', 'GH', 'GHA', 288, 'GHC', 'Cedi', '¢', 0),
(82, 'Gibraltar', 'GI', 'GIB', 292, 'GIP', 'Pound', '£', 0),
(83, 'Greece', 'GR', 'GRC', 300, 'EUR', 'Euro', '€', 0),
(84, 'Greenland', 'GL', 'GRL', 304, 'DKK', 'Krone', 'kr', 0),
(85, 'Grenada', 'GD', 'GRD', 308, 'XCD', 'Dollar', '$', 0),
(86, 'Guadeloupe', 'GP', 'GLP', 312, 'EUR', 'Euro', '€', 0),
(87, 'Guam', 'GU', 'GUM', 316, 'USD', 'Dollar', '$', 0),
(88, 'Guatemala', 'GT', 'GTM', 320, 'GTQ', 'Quetzal', 'Q', 0),
(89, 'Guinea', 'GN', 'GIN', 324, 'GNF', 'Franc', '', 0),
(90, 'Guinea-Bissau', 'GW', 'GNB', 624, 'XOF', 'Franc', '', 0),
(91, 'Guyana', 'GY', 'GUY', 328, 'GYD', 'Dollar', '$', 0),
(92, 'Haiti', 'HT', 'HTI', 332, 'HTG', 'Gourde', 'G', 0),
(93, 'Heard Island and McDonald Islands', 'HM', 'HMD', 334, 'AUD', 'Dollar', '$', 0),
(94, 'Honduras', 'HN', 'HND', 340, 'HNL', 'Lempira', 'L', 0),
(95, 'Hong Kong', 'HK', 'HKG', 344, 'HKD', 'Dollar', '$', 0),
(96, 'Hungary', 'HU', 'HUN', 348, 'HUF', 'Forint', 'Ft', 0),
(97, 'Iceland', 'IS', 'ISL', 352, 'ISK', 'Krona', 'kr', 0),
(98, 'India', 'IN', 'IND', 356, 'INR', 'Rupee', '₹', 0),
(99, 'Indonesia', 'ID', 'IDN', 360, 'IDR', 'Rupiah', 'Rp', 0),
(100, 'Iran', 'IR', 'IRN', 364, 'IRR', 'Rial', '﷼', 0),
(101, 'Iraq', 'IQ', 'IRQ', 368, 'IQD', 'Dinar', '', 0),
(102, 'Ireland', 'IE', 'IRL', 372, 'EUR', 'Euro', '€', 0),
(103, 'Israel', 'IL', 'ISR', 376, 'ILS', 'Shekel', '₪', 0),
(104, 'Italy', 'IT', 'ITA', 380, 'EUR', 'Euro', '€', 0),
(105, 'Ivory Coast', 'CI', 'CIV', 384, 'XOF', 'Franc', '', 0),
(106, 'Jamaica', 'JM', 'JAM', 388, 'JMD', 'Dollar', '$', 0),
(107, 'Japan', 'JP', 'JPN', 392, 'JPY', 'Yen', '¥', 0),
(108, 'Jordan', 'JO', 'JOR', 400, 'JOD', 'Dinar', '', 0),
(109, 'Kazakhstan', 'KZ', 'KAZ', 398, 'KZT', 'Tenge', 'лв', 0),
(110, 'Kenya', 'KE', 'KEN', 404, 'KES', 'Shilling', '', 0),
(111, 'Kiribati', 'KI', 'KIR', 296, 'AUD', 'Dollar', '$', 0),
(112, 'Kuwait', 'KW', 'KWT', 414, 'KWD', 'Dinar', '', 0),
(113, 'Kyrgyzstan', 'KG', 'KGZ', 417, 'KGS', 'Som', 'лв', 0),
(114, 'Laos', 'LA', 'LAO', 418, 'LAK', 'Kip', '₭', 0),
(115, 'Latvia', 'LV', 'LVA', 428, 'LVL', 'Lat', 'Ls', 0),
(116, 'Lebanon', 'LB', 'LBN', 422, 'LBP', 'Pound', '£', 0),
(117, 'Lesotho', 'LS', 'LSO', 426, 'LSL', 'Loti', 'L', 0),
(118, 'Liberia', 'LR', 'LBR', 430, 'LRD', 'Dollar', '$', 0),
(119, 'Libya', 'LY', 'LBY', 434, 'LYD', 'Dinar', '', 0),
(120, 'Liechtenstein', 'LI', 'LIE', 438, 'CHF', 'Franc', 'CHF', 0),
(121, 'Lithuania', 'LT', 'LTU', 440, 'LTL', 'Litas', 'Lt', 0),
(122, 'Luxembourg', 'LU', 'LUX', 442, 'EUR', 'Euro', '€', 0),
(123, 'Macao', 'MO', 'MAC', 446, 'MOP', 'Pataca', 'MOP', 0),
(124, 'Macedonia', 'MK', 'MKD', 807, 'MKD', 'Denar', 'ден', 0),
(125, 'Madagascar', 'MG', 'MDG', 450, 'MGA', 'Ariary', '', 0),
(126, 'Malawi', 'MW', 'MWI', 454, 'MWK', 'Kwacha', 'MK', 0),
(127, 'Malaysia', 'MY', 'MYS', 458, 'MYR', 'Ringgit', 'RM', 0),
(128, 'Maldives', 'MV', 'MDV', 462, 'MVR', 'Rufiyaa', 'Rf', 0),
(129, 'Mali', 'ML', 'MLI', 466, 'XOF', 'Franc', '', 0),
(130, 'Malta', 'MT', 'MLT', 470, 'MTL', 'Lira', '', 0),
(131, 'Marshall Islands', 'MH', 'MHL', 584, 'USD', 'Dollar', '$', 0),
(132, 'Martinique', 'MQ', 'MTQ', 474, 'EUR', 'Euro', '€', 0),
(133, 'Mauritania', 'MR', 'MRT', 478, 'MRO', 'Ouguiya', 'UM', 0),
(134, 'Mauritius', 'MU', 'MUS', 480, 'MUR', 'Rupee', '₨', 0),
(135, 'Mayotte', 'YT', 'MYT', 175, 'EUR', 'Euro', '€', 0),
(136, 'Mexico', 'MX', 'MEX', 484, 'MXN', 'Peso', '$', 0),
(137, 'Micronesia', 'FM', 'FSM', 583, 'USD', 'Dollar', '$', 0),
(138, 'Moldova', 'MD', 'MDA', 498, 'MDL', 'Leu', '', 0),
(139, 'Monaco', 'MC', 'MCO', 492, 'EUR', 'Euro', '€', 0),
(140, 'Mongolia', 'MN', 'MNG', 496, 'MNT', 'Tugrik', '₮', 0),
(141, 'Montserrat', 'MS', 'MSR', 500, 'XCD', 'Dollar', '$', 0),
(142, 'Morocco', 'MA', 'MAR', 504, 'MAD', 'Dirham', '', 0),
(143, 'Mozambique', 'MZ', 'MOZ', 508, 'MZN', 'Meticail', 'MT', 0),
(144, 'Myanmar', 'MM', 'MMR', 104, 'MMK', 'Kyat', 'K', 0),
(145, 'Namibia', 'NA', 'NAM', 516, 'NAD', 'Dollar', '$', 0),
(146, 'Nauru', 'NR', 'NRU', 520, 'AUD', 'Dollar', '$', 0),
(147, 'Nepal', 'NP', 'NPL', 524, 'NPR', 'Rupee', '₨', 0),
(148, 'Netherlands', 'NL', 'NLD', 528, 'EUR', 'Euro', '€', 0),
(149, 'Netherlands Antilles', 'AN', 'ANT', 530, 'ANG', 'Guilder', 'ƒ', 0),
(150, 'New Caledonia', 'NC', 'NCL', 540, 'XPF', 'Franc', '', 0),
(151, 'New Zealand', 'NZ', 'NZL', 554, 'NZD', 'Dollar', '$', 0),
(152, 'Nicaragua', 'NI', 'NIC', 558, 'NIO', 'Cordoba', 'C$', 0),
(153, 'Niger', 'NE', 'NER', 562, 'XOF', 'Franc', '', 0),
(154, 'Nigeria', 'NG', 'NGA', 566, 'NGN', 'Naira', '₦', 0),
(155, 'Niue', 'NU', 'NIU', 570, 'NZD', 'Dollar', '$', 0),
(156, 'Norfolk Island', 'NF', 'NFK', 574, 'AUD', 'Dollar', '$', 0),
(157, 'North Korea', 'KP', 'PRK', 408, 'KPW', 'Won', '₩', 0),
(158, 'Northern Mariana Islands', 'MP', 'MNP', 580, 'USD', 'Dollar', '$', 0),
(159, 'Norway', 'NO', 'NOR', 578, 'NOK', 'Krone', 'kr', 0),
(160, 'Oman', 'OM', 'OMN', 512, 'OMR', 'Rial', '﷼', 0),
(161, 'Pakistan', 'PK', 'PAK', 586, 'PKR', 'Rupee', '₨', 0),
(162, 'Palau', 'PW', 'PLW', 585, 'USD', 'Dollar', '$', 0),
(163, 'Palestinian Territory', 'PS', 'PSE', 275, 'ILS', 'Shekel', '₪', 0),
(164, 'Panama', 'PA', 'PAN', 591, 'PAB', 'Balboa', 'B/.', 0),
(165, 'Papua New Guinea', 'PG', 'PNG', 598, 'PGK', 'Kina', '', 0),
(166, 'Paraguay', 'PY', 'PRY', 600, 'PYG', 'Guarani', 'Gs', 0),
(167, 'Peru', 'PE', 'PER', 604, 'PEN', 'Sol', 'S/.', 0),
(168, 'Philippines', 'PH', 'PHL', 608, 'PHP', 'Peso', 'Php', 0),
(169, 'Pitcairn', 'PN', 'PCN', 612, 'NZD', 'Dollar', '$', 0),
(170, 'Poland', 'PL', 'POL', 616, 'PLN', 'Zloty', 'zł', 0),
(171, 'Portugal', 'PT', 'PRT', 620, 'EUR', 'Euro', '€', 0),
(172, 'Puerto Rico', 'PR', 'PRI', 630, 'USD', 'Dollar', '$', 0),
(173, 'Qatar', 'QA', 'QAT', 634, 'QAR', 'Rial', '﷼', 0),
(174, 'Republic of the Congo', 'CG', 'COG', 178, 'XAF', 'Franc', 'FCF', 0),
(175, 'Reunion', 'RE', 'REU', 638, 'EUR', 'Euro', '€', 0),
(176, 'Romania', 'RO', 'ROU', 642, 'RON', 'Leu', 'lei', 0),
(177, 'Russia', 'RU', 'RUS', 643, 'RUB', 'Ruble', 'руб', 0),
(178, 'Rwanda', 'RW', 'RWA', 646, 'RWF', 'Franc', '', 0),
(179, 'Saint Helena', 'SH', 'SHN', 654, 'SHP', 'Pound', '£', 0),
(180, 'Saint Kitts and Nevis', 'KN', 'KNA', 659, 'XCD', 'Dollar', '$', 0),
(181, 'Saint Lucia', 'LC', 'LCA', 662, 'XCD', 'Dollar', '$', 0),
(182, 'Saint Pierre and Miquelon', 'PM', 'SPM', 666, 'EUR', 'Euro', '€', 0),
(183, 'Saint Vincent and the Grenadines', 'VC', 'VCT', 670, 'XCD', 'Dollar', '$', 0),
(184, 'Samoa', 'WS', 'WSM', 882, 'WST', 'Tala', 'WS$', 0),
(185, 'San Marino', 'SM', 'SMR', 674, 'EUR', 'Euro', '€', 0),
(186, 'Sao Tome and Principe', 'ST', 'STP', 678, 'STD', 'Dobra', 'Db', 0),
(187, 'Saudi Arabia', 'SA', 'SAU', 682, 'SAR', 'Rial', '﷼', 0),
(188, 'Senegal', 'SN', 'SEN', 686, 'XOF', 'Franc', '', 0),
(189, 'Serbia', 'RS', 'SRB', 891, 'RSD', 'Dinar', 'Дин', 0),
(190, 'Seychelles', 'SC', 'SYC', 690, 'SCR', 'Rupee', '₨', 0),
(191, 'Sierra Leone', 'SL', 'SLE', 694, 'SLL', 'Leone', 'Le', 0),
(192, 'Singapore', 'SG', 'SGP', 702, 'SGD', 'Dollar', '$', 0),
(193, 'Slovakia', 'SK', 'SVK', 703, 'SKK', 'Koruna', 'Sk', 0),
(194, 'Slovenia', 'SI', 'SVN', 705, 'EUR', 'Euro', '€', 0),
(195, 'Solomon Islands', 'SB', 'SLB', 90, 'SBD', 'Dollar', '$', 0),
(196, 'Somalia', 'SO', 'SOM', 706, 'SOS', 'Shilling', 'S', 0),
(197, 'South Africa', 'ZA', 'ZAF', 710, 'ZAR', 'Rand', 'R', 0),
(198, 'South Georgia and the South Sandwich Islands', 'GS', 'SGS', 239, 'GBP', 'Pound', '£', 0),
(199, 'South Korea', 'KR', 'KOR', 410, 'KRW', 'Won', '₩', 0),
(200, 'Spain', 'ES', 'ESP', 724, 'EUR', 'Euro', '€', 0),
(201, 'Sri Lanka', 'LK', 'LKA', 144, 'LKR', 'Rupee', '₨', 0),
(202, 'Sudan', 'SD', 'SDN', 736, 'SDD', 'Dinar', '', 0),
(203, 'Suriname', 'SR', 'SUR', 740, 'SRD', 'Dollar', '$', 0),
(204, 'Svalbard and Jan Mayen', 'SJ', 'SJM', 744, 'NOK', 'Krone', 'kr', 0),
(205, 'Swaziland', 'SZ', 'SWZ', 748, 'SZL', 'Lilangeni', '', 0),
(206, 'Sweden', 'SE', 'SWE', 752, 'SEK', 'Krona', 'kr', 0),
(207, 'Switzerland', 'CH', 'CHE', 756, 'CHF', 'Franc', 'CHF', 0),
(208, 'Syria', 'SY', 'SYR', 760, 'SYP', 'Pound', '£', 0),
(209, 'Taiwan', 'TW', 'TWN', 158, 'TWD', 'Dollar', 'NT$', 0),
(210, 'Tajikistan', 'TJ', 'TJK', 762, 'TJS', 'Somoni', '', 0),
(211, 'Tanzania', 'TZ', 'TZA', 834, 'TZS', 'Shilling', '', 0),
(212, 'Thailand', 'TH', 'THA', 764, 'THB', 'Baht', '฿', 0),
(213, 'Togo', 'TG', 'TGO', 768, 'XOF', 'Franc', '', 0),
(214, 'Tokelau', 'TK', 'TKL', 772, 'NZD', 'Dollar', '$', 0),
(215, 'Tonga', 'TO', 'TON', 776, 'TOP', 'Pa\'anga', 'T$', 0),
(216, 'Trinidad and Tobago', 'TT', 'TTO', 780, 'TTD', 'Dollar', 'TT$', 0),
(217, 'Tunisia', 'TN', 'TUN', 788, 'TND', 'Dinar', '', 0),
(218, 'Turkey', 'TR', 'TUR', 792, 'TRY', 'Lira', 'YTL', 0),
(219, 'Turkmenistan', 'TM', 'TKM', 795, 'TMM', 'Manat', 'm', 0),
(220, 'Turks and Caicos Islands', 'TC', 'TCA', 796, 'USD', 'Dollar', '$', 0),
(221, 'Tuvalu', 'TV', 'TUV', 798, 'AUD', 'Dollar', '$', 0),
(222, 'U.S. Virgin Islands', 'VI', 'VIR', 850, 'USD', 'Dollar', '$', 0),
(223, 'Uganda', 'UG', 'UGA', 800, 'UGX', 'Shilling', '', 0),
(224, 'Ukraine', 'UA', 'UKR', 804, 'UAH', 'Hryvnia', '₴', 0),
(225, 'United Arab Emirates', 'AE', 'ARE', 784, 'AED', 'Dirham', '', 0),
(226, 'United Kingdom', 'GB', 'GBR', 826, 'GBP', 'Pound', '£', 0),
(227, 'United States', 'US', 'USA', 840, 'USD', 'Dollar', '$', 0),
(228, 'United States Minor Outlying Islands', 'UM', 'UMI', 581, 'USD', 'Dollar ', '$', 0),
(229, 'Uruguay', 'UY', 'URY', 858, 'UYU', 'Peso', '$U', 0),
(230, 'Uzbekistan', 'UZ', 'UZB', 860, 'UZS', 'Som', 'лв', 0),
(231, 'Vanuatu', 'VU', 'VUT', 548, 'VUV', 'Vatu', 'Vt', 0),
(232, 'Vatican', 'VA', 'VAT', 336, 'EUR', 'Euro', '€', 0),
(233, 'Venezuela', 'VE', 'VEN', 862, 'VEF', 'Bolivar', 'Bs', 0),
(234, 'Vietnam', 'VN', 'VNM', 704, 'VND', 'Dong', '₫', 0),
(235, 'Wallis and Futuna', 'WF', 'WLF', 876, 'XPF', 'Franc', '', 0),
(236, 'Western Sahara', 'EH', 'ESH', 732, 'MAD', 'Dirham', '', 0),
(237, 'Yemen', 'YE', 'YEM', 887, 'YER', 'Rial', '﷼', 0),
(238, 'Zambia', 'ZM', 'ZMB', 894, 'ZMK', 'Kwacha', 'ZK', 0),
(239, 'Zimbabwe', 'ZW', 'ZWE', 716, 'ZWD', 'Dollar', 'Z$', 0);

--
-- Table structure for table `email_templates`
--

DROP TABLE IF EXISTS `email_templates`;
CREATE TABLE IF NOT EXISTS `email_templates` (
  `id` int(5) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `subject` varchar(150) NOT NULL,
  `help` tinytext,
  `body` text NOT NULL,
  `type` enum('news','mailer') DEFAULT 'mailer',
  `typeid` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `email_templates`
--

INSERT  INTO `email_templates`(`id`,`name`,`subject`,`help`,`body`,`type`,`typeid`) values (1,'Forgot Password','Password Reset','This template is used for retrieving lost admin password','<div style=\"background-color:#F2F2F2;margin:0 auto;padding:60px;font-family: Helvetica, Arial, sans-serif; font-size: 16px; color: #404040\"> \r\n  <div style=\"border-radius: 6px 6px 6px 6px;box-shadow: 0 16px 24px 0 #DFDFDF;\">\r\n    <div style=\"background-color:#35B8E8;text-align:center;margin-top:32px;border-radius: 6px 6px 0 0;\"><img src=\"[SITEURL]/assets/images/header.png\" alt=\"header\"></div>\r\n    <div style=\"background-color:#ffffff;padding:48px;text-align:center;border-radius: 0 0 6px 6px;\">\r\n      <h1 style=\"font-weight:100;margin-bottom:32px\">New Password Request!</h1>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\"> Hey [NAME], it seems that you or someone requested a new password for you.</p>\r\n      <p style=\"margin:0;padding:5px;color:#7B7B7B\"> We have generated a new password, as requested.</p>\r\n      <div style=\"padding:30px 0px 0px 0px\">\r\n        <a target=\"_blank\" href=\"[LINK]\" style=\"text-decoration: none;border-radius: 6px 6px 6px 6px;display:inline-block;background-color:#4CAF50;padding:14px 30px 14px 30px;color:#ffffff;font-weight:500;font-size:18px\">Go to password reset page </a>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div style=\"padding:48px;text-align:center\">\r\n    <p style=\"margin-bottom:32px;font-size:20px;color:##272822\"><em>Stay in touch</em></p>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[FB]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/twitter.png\" alt=\"\"></a>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[TW]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/facebook.png\" alt=\"\"></a>\r\n    <a href=\"mailto:[CEMAIL]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/email.png\" alt=\"\"></a>\r\n    <div style=\"font-size:12px;color:#6E6E6E;margin-top:24px\">\r\n      <p style=\"margin:0;padding:4px\"> This email is sent to you directly from [COMPANY]</p>\r\n      <p style=\"margin:0\"> The information above is gathered from the user input. ©[DATE] <a href=\"[SITEURL]\">[COMPANY]</a>\r\n        . All rights reserved.</p>\r\n    </div>\r\n      [LOGO]\r\n  </div>\r\n</div>','mailer','passReset');
INSERT  INTO `email_templates`(`id`,`name`,`subject`,`help`,`body`,`type`,`typeid`) values (2,'Project Invitation','You\'ve been invited to join a new project.','This template is used to notify user about new project assignment.','<div style=\"background-color:#F2F2F2;margin:0 auto;padding:60px;font-family: Helvetica, Arial, sans-serif; font-size: 16px; color: #404040\">  <div style=\"border-radius: 6px 6px 6px 6px;box-shadow: 0 1px 2px 0 #DFDFDF;\">\r\n    <div style=\"background-color:#35B8E8;text-align:center;margin-top:32px;border-radius: 6px 6px 0 0;\"><img src=\"[SITEURL]/assets/images/header.png\" alt=\"header\"></div>\r\n    <div style=\"background-color:#ffffff;padding:48px;text-align:center;border-radius: 0 0 6px 6px;\">\r\n      <h1 style=\"font-weight:100;margin-bottom:32px\">New project assignment from [COMPANY]</h1>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\"> [SNAME] added you to the project(s) [PROJECT]</p>\r\n      <div style=\"padding:30px 0px 0px 0px\">\r\n        <a target=\"_blank\" href=\"[LINK]\" style=\"text-decoration: none;border-radius: 6px 6px 6px 6px;display:inline-block;background-color:#4CAF50;padding:14px 30px 14px 30px;color:#ffffff;font-weight:500;font-size:18px\">Get Started </a>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div style=\"padding:48px;text-align:center\">\r\n    <p style=\"margin-bottom:32px;font-size:20px;color:##272822\"><em>Stay in touch</em></p>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[FB]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/twitter.png\" alt=\"\"></a>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[TW]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/facebook.png\" alt=\"\"></a>\r\n    <a href=\"mailto:[CEMAIL]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/email.png\" alt=\"\"></a>\r\n    <div style=\"font-size:12px;color:#6E6E6E;margin-top:24px\">\r\n      <p style=\"margin:0;padding:4px\"> This email is sent to you directly from [COMPANY]</p>\r\n      <p style=\"margin:0\"> The information above is gathered from the user input. ©[DATE] <a href=\"[SITEURL]\">[COMPANY]</a>\r\n        . All rights reserved.</p>\r\n    </div>\r\n [LOGO]\r\n  </div>\r\n</div>','mailer','projectInvite');
INSERT  INTO `email_templates`(`id`,`name`,`subject`,`help`,`body`,`type`,`typeid`) values (3,'User Invitation','You\'ve been invited to [COMPANY]','This template is used to invite user to join.','<div style=\"background-color:#F2F2F2;margin:0 auto;padding:60px;font-family: Helvetica, Arial, sans-serif; font-size: 16px; color: #404040\">\r\n  <div style=\"border-radius: 6px 6px 6px 6px;box-shadow: 0 1px 2px 0 #DFDFDF;\">\r\n    <div style=\"background-color:#35B8E8;text-align:center;margin-top:32px;border-radius: 6px 6px 0 0;\"><img src=\"[SITEURL]/assets/images/header.png\" alt=\"header\"></div>\r\n    <div style=\"background-color:#ffffff;padding:48px;text-align:center;border-radius: 0 0 6px 6px;\">\r\n      <h1 style=\"font-weight:100;margin-bottom:32px\">New project assignment from [COMPANY]</h1>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\"> You\'ve just been invited to join [COMPANY]!</p>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\">To activate your account, please visit the link below.</p>\r\n      <div style=\"padding:30px 0px 0px 0px\">\r\n        <a target=\"_blank\" href=\"[LOGINURL]\" style=\"text-decoration: none;border-radius: 6px 6px 6px 6px;display:inline-block;background-color:#4CAF50;padding:14px 30px 14px 30px;color:#ffffff;font-weight:500;font-size:18px\">Get Started </a>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div style=\"padding:48px;text-align:center\">\r\n    <p style=\"margin-bottom:32px;font-size:20px;color:##272822\"><em>Stay in touch</em></p>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[FB]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/twitter.png\" alt=\"\"></a>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[TW]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/facebook.png\" alt=\"\"></a>\r\n    <a href=\"mailto:[CEMAIL]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/email.png\" alt=\"\"></a>\r\n    <div style=\"font-size:12px;color:#6E6E6E;margin-top:24px\">\r\n      <p style=\"margin:0;padding:4px\"> This email is sent to you directly from [COMPANY]</p>\r\n      <p style=\"margin:0\"> The information above is gathered from the user input. ©[DATE] <a href=\"[SITEURL]\">[COMPANY]</a>\r\n        . All rights reserved.</p>\r\n    </div>\r\n    [LOGO]\r\n  </div>\r\n</div>','mailer','userInvite');
INSERT  INTO `email_templates`(`id`,`name`,`subject`,`help`,`body`,`type`,`typeid`) values (4,'Invoice Message','New invoice from [COMPANY]','This template is used to send invoice to client','<div style=\"background-color:#F2F2F2;margin:0 auto;padding:60px;font-family: Helvetica, Arial, sans-serif; font-size: 16px; color: #404040\"> \r\n  <div style=\"border-radius: 6px 6px 6px 6px;box-shadow: 0 1px 2px 0 #DFDFDF;\">\r\n    <div style=\"background-color:#35B8E8;text-align:center;margin-top:32px;border-radius: 6px 6px 0 0;\"><img src=\"[SITEURL]/assets/images/header.png\" alt=\"header\"></div>\r\n    <div style=\"background-color:#ffffff;padding:48px;text-align:center;border-radius: 0 0 6px 6px;\">\r\n      <h1 style=\"font-weight:100;margin-bottom:32px\">New invoice from [COMPANY]</h1>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\">To view the invoice details, open the attached PDF.</p>\r\n      <div style=\"padding:30px 0px 0px 0px\">\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Invoice</strong>: [INVID]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Client</strong>: [CLIENT]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Amount</strong>: [AMOUNT]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Due Date</strong>: [DUEDATE]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Message</strong>: [MESSAGE]</p>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div style=\"padding:48px;text-align:center\">\r\n    <p style=\"margin-bottom:32px;font-size:20px;color:##272822\"><em>Stay in touch</em></p>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[FB]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/twitter.png\" alt=\"\"></a>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[TW]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/facebook.png\" alt=\"\"></a>\r\n    <a href=\"mailto:[CEMAIL]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/email.png\" alt=\"\"></a>\r\n    <div style=\"font-size:12px;color:#6E6E6E;margin-top:24px\">\r\n      <p style=\"margin:0;padding:4px\"> This email is sent to you directly from [COMPANY]</p>\r\n      <p style=\"margin:0\"> The information above is gathered from the user input. ©[DATE] <a href=\"[SITEURL]\">[COMPANY]</a>\r\n        . All rights reserved.</p>\r\n    </div> [LOGO]\r\n\r\n  </div>\r\n</div>','mailer','invoiceMessage');
INSERT  INTO `email_templates`(`id`,`name`,`subject`,`help`,`body`,`type`,`typeid`) values (5,'Estimate Message','New estimate from [COMPANY]','This template is used to send estimate to client','<div style=\"background-color:#F2F2F2;margin:0 auto;padding:60px;font-family: Helvetica, Arial, sans-serif; font-size: 16px; color: #404040\"> [LOGO]\r\n  <div style=\"border-radius: 6px 6px 6px 6px;box-shadow: 0 1px 2px 0 #DFDFDF;\">\r\n    <div style=\"background-color:#35B8E8;text-align:center;margin-top:32px;border-radius: 6px 6px 0 0;\"><img src=\"[SITEURL]/assets/images/header.png\" alt=\"header\"></div>\r\n    <div style=\"background-color:#ffffff;padding:48px;text-align:center;border-radius: 0 0 6px 6px;\">\r\n      <h1 style=\"font-weight:100;margin-bottom:32px\">New estimate from [COMPANY]</h1>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\">To view the estimate details, open the attached PDF.</p>\r\n      <div style=\"padding:30px 0px 0px 0px\">\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Estimate</strong>: [TITLE]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Client</strong>: [CLIENT]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Amount</strong>: [AMOUNT]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Message</strong>: [MESSAGE]</p>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div style=\"padding:48px;text-align:center\">\r\n    <p style=\"margin-bottom:32px;font-size:20px;color:##272822\"><em>Stay in touch</em></p>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[FB]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/twitter.png\" alt=\"\"></a>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[TW]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/facebook.png\" alt=\"\"></a>\r\n    <a href=\"mailto:[CEMAIL]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/email.png\" alt=\"\"></a>\r\n    <div style=\"font-size:12px;color:#6E6E6E;margin-top:24px\">\r\n      <p style=\"margin:0;padding:4px\"> This email is sent to you directly from [COMPANY]</p>\r\n      <p style=\"margin:0\"> The information above is gathered from the user input. ©[DATE] <a href=\"[SITEURL]\">[COMPANY]</a>\r\n        . All rights reserved.</p>\r\n    </div>\r\n  </div>\r\n</div>','mailer','estimateMessage');
INSERT  INTO `email_templates`(`id`,`name`,`subject`,`help`,`body`,`type`,`typeid`) values (6,'Transaction Completed','Payment Completed','This template is used to notify administrator on successful payment transaction','<div style=\"background-color:#F2F2F2;margin:0 auto;padding:60px;font-family: Helvetica, Arial, sans-serif; font-size: 16px; color: #404040\"> [LOGO]\r\n  <div style=\"border-radius: 6px 6px 6px 6px;box-shadow: 0 1px 2px 0 #DFDFDF;\">\r\n    <div style=\"background-color:#35B8E8;text-align:center;margin-top:32px;border-radius: 6px 6px 0 0;\"><img src=\"[SITEURL]/assets/images/header.png\" alt=\"header\"></div>\r\n    <div style=\"background-color:#ffffff;padding:48px;text-align:center;border-radius: 0 0 6px 6px;\">\r\n      <h1 style=\"font-weight:100;margin-bottom:32px\">Hello Admin</h1>\r\n      <p style=\"margin:0;padding:3px;color:#7B7B7B\">You have received new payment following: </p>\r\n      <div style=\"padding:30px 0px 0px 0px;text-align:left\">\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Name:</strong> [NAME]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Invoice:</strong> [ITEMNAME]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Price:</strong> [PRICE]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Status:</strong> [STATUS]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>Processor:</strong> [PP]</p>\r\n        <p style=\"margin:0;padding:3px;color:#7B7B7B\"><strong>IP:</strong> [IP]</p>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div style=\"padding:48px;text-align:center\">\r\n    <p style=\"margin-bottom:32px;font-size:20px;color:##272822\"><em>Stay in touch</em></p>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[FB]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/twitter.png\" alt=\"\"></a>\r\n    <a target=\"_blank\" href=\"http://facebook.com/[TW]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/facebook.png\" alt=\"\"></a>\r\n    <a href=\"mailto:[CEMAIL]\" style=\"display:inline-block;margin: 0px 5px 0px 5px;\"><img src=\"[SITEURL]/assets/images/email.png\" alt=\"\"></a>\r\n    <div style=\"font-size:12px;color:#6E6E6E;margin-top:24px\">\r\n      <p style=\"margin:0;padding:4px\"> This email is sent to you directly from [COMPANY]</p>\r\n      <p style=\"margin:0\"> The information above is gathered from the user input. ©[DATE] <a href=\"[SITEURL]\">[COMPANY]</a>\r\n        . All rights reserved.</p>\r\n    </div>\r\n  </div>\r\n</div>','mailer','payComplete');

--
-- Table structure for table `estimate`
--

DROP TABLE IF EXISTS `estimate`;
CREATE TABLE IF NOT EXISTS `estimate` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `title` varchar(60) DEFAULT NULL,
  `company_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `company_name` varchar(60) DEFAULT NULL,
  `company_address` text,
  `currency` varchar(6) DEFAULT NULL,
  `country` varchar(3) DEFAULT NULL,
  `subtotal` decimal(13,2) UNSIGNED DEFAULT '0.00',
  `tax` decimal(13,2) UNSIGNED DEFAULT '0.00',
  `total` decimal(13,2) UNSIGNED DEFAULT '0.00',
  `balance_due` decimal(13,2) UNSIGNED DEFAULT '0.00',
  `paid_amount` decimal(13,2) UNSIGNED DEFAULT '0.00',
  `discount` decimal(6,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `items` blob,
  `issued_by` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `sent_on` datetime DEFAULT '1970-01-02 00:00:00',
  `note` tinytext,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0 = draft, 1 = sent, 2= lost, 3=won',
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_company` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `expenses`
--

DROP TABLE IF EXISTS `expenses`;
CREATE TABLE IF NOT EXISTS `expenses` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `title` varchar(80) DEFAULT NULL,
  `description` varchar(150) DEFAULT NULL,
  `amount` decimal(13,3) NOT NULL DEFAULT '0.000',
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user_id` int(11) UNSIGNED NOT NULL,
  `category_id` int(11) UNSIGNED NOT NULL,
  `task_id` int(11) UNSIGNED NOT NULL,
  `is_billable` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `invoiced` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` datetime DEFAULT '1970-01-02 00:00:00',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `idx_project` (`project_id`),
  KEY `idx_task` (`task_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_category` (`category_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `expenses_categories`
--

DROP TABLE IF EXISTS `expenses_categories`;
CREATE TABLE IF NOT EXISTS `expenses_categories` (
  `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(60) DEFAULT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `expenses_categories`
--

INSERT INTO `expenses_categories` (`id`, `name`, `active`) VALUES
(1, 'General', 1),
(2, 'Premium', 0);

--
-- Table structure for table `files`
--

DROP TABLE IF EXISTS `files`;
CREATE TABLE IF NOT EXISTS `files` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `caption` varchar(50) DEFAULT NULL,
  `parent` varchar(60) DEFAULT NULL,
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `task_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `comment_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `note_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` varchar(80) DEFAULT NULL,
  `fsize` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `fext` varchar(4) DEFAULT NULL,
  `mime` varchar(50) DEFAULT NULL,
  `token` varchar(16) DEFAULT NULL,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `is_hidden` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_project_id` (`project_id`),
  KEY `idx_task_id` (`task_id`),
  KEY `idx_comment_id` (`comment_id`),
  KEY `idx_note_id` (`note_id`),
  KEY `idx_user_id` (`created_by_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `files_temp`
--

DROP TABLE IF EXISTS `files_temp`;
CREATE TABLE IF NOT EXISTS `files_temp` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `caption` varchar(50) DEFAULT NULL,
  `parent` varchar(60) DEFAULT NULL,
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `task_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `comment_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `note_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` varchar(80) DEFAULT NULL,
  `fsize` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `fext` varchar(4) DEFAULT NULL,
  `mime` varchar(50) DEFAULT NULL,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_project_id` (`project_id`),
  KEY `idx_task_id` (`task_id`),
  KEY `idx_comment_id` (`comment_id`),
  KEY `idx_note_id` (`note_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `gateways`
--

DROP TABLE IF EXISTS `gateways`;
CREATE TABLE IF NOT EXISTS `gateways` (
  `id` tinyint(2) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `displayname` varchar(200) NOT NULL,
  `dir` varchar(200) NOT NULL,
  `live` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `extra_txt` varchar(200) DEFAULT NULL,
  `extra_txt2` varchar(200) DEFAULT NULL,
  `extra_txt3` varchar(200) DEFAULT NULL,
  `extra` varchar(200) DEFAULT NULL,
  `extra2` varchar(200) DEFAULT NULL,
  `extra3` varchar(200) DEFAULT NULL,
  `info` text,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `gateways`
--

INSERT INTO `gateways` (`id`, `name`, `displayname`, `dir`, `live`, `extra_txt`, `extra_txt2`, `extra_txt3`, `extra`, `extra2`, `extra3`, `info`, `active`) VALUES
(1, 'paypal', 'PayPal', 'paypal', 0, 'Paypal Email Address', 'Currency Code', 'Not in Use', 'paypal@address.com', 'CAD', '', '', 1),
(2, 'stripe', 'Stripe', 'stripe', 1, 'Secret Key', 'Currency Code', 'Publishable Key', '', 'CAD', '', '', 1);

--
-- Table structure for table `invoice`
--

DROP TABLE IF EXISTS `invoice`;
CREATE TABLE IF NOT EXISTS `invoice` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `custom_id` varchar(8) DEFAULT NULL,
  `title` varchar(60) DEFAULT NULL,
  `company_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `company_name` varchar(60) DEFAULT NULL,
  `company_address` text,
  `reference` varchar(30) DEFAULT NULL,
  `currency` varchar(6) DEFAULT NULL,
  `country` varchar(3) DEFAULT NULL,
  `subtotal` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `tax` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `total` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `balance_due` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `paid_amount` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `discount` decimal(6,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `issued_by` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `sent_on` datetime NOT NULL DEFAULT '1970-01-02 00:00:00',
  `due_date` datetime NOT NULL DEFAULT '1970-01-02 00:00:00',
  `note` tinytext,
  `comment` tinytext,
  `pstatus` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0 = not paid, 1= partail paid, 2= fully paid, 3= overdue',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0 = unsent, 1 = sent, 2= archive, 3=trash',
  `reminder` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0 = no reminder, 1= yes reminder',
  `recurring` tinyint(1) UNSIGNED DEFAULT '0',
  `recurring_p` varchar(10) DEFAULT NULL COMMENT 'frequency',
  `recurring_t` smallint(2) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'time',
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_company` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `invoice_access`
--

DROP TABLE IF EXISTS `invoice_access`;
CREATE TABLE IF NOT EXISTS `invoice_access` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user` varchar(60) DEFAULT NULL,
  `ip` varchar(46) DEFAULT NULL,
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_invid` (`invoice_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `invoice_entries`
--

DROP TABLE IF EXISTS `invoice_entries`;
CREATE TABLE IF NOT EXISTS `invoice_entries` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `amount` decimal(13,3) UNSIGNED NOT NULL DEFAULT '0.000',
  `quantity` decimal(13,3) UNSIGNED NOT NULL DEFAULT '1.000',
  `tax_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `tax_amount` decimal(6,3) UNSIGNED NOT NULL DEFAULT '0.000',
  `tax_name` varchar(20) DEFAULT NULL,
  `description` varchar(120) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_invid` (`invoice_id`),
  KEY `ind_tax_id` (`tax_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `job_types`
--

DROP TABLE IF EXISTS `job_types`;
CREATE TABLE IF NOT EXISTS `job_types` (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `hrate` decimal(13,2) NOT NULL DEFAULT '0.00',
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `job_types`
--

INSERT INTO `job_types` (`id`, `name`, `hrate`, `active`) VALUES
(1, 'General', '100.00', 1),
(2, 'Promo', '75.00', 0),
(3, 'Special', '50.00', 0);

--
-- Table structure for table `messages`
--

DROP TABLE IF EXISTS `messages`;
CREATE TABLE IF NOT EXISTS `messages` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(60) DEFAULT NULL,
  `type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `parent_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by_email` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `updated_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `updated_by_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by_email` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_hidden` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `is_converted` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1=active, 2=trash',
  PRIMARY KEY (`id`),
  KEY `idx_type_id` (`type_id`),
  KEY `idx_created_by` (`created_by_id`),
  KEY `idx_updated_by` (`updated_by_id`),
  KEY `idx_parent_id` (`parent_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `notes`
--

DROP TABLE IF EXISTS `notes`;
CREATE TABLE IF NOT EXISTS `notes` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `body` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_by_email` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `updated_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `updated_by_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `updated_by_email` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_hidden` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `color` varchar(7) DEFAULT NULL,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1 = active',
  `position` int(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_project_id` (`project_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `notifications`
--

DROP TABLE IF EXISTS `notifications`;
CREATE TABLE IF NOT EXISTS `notifications` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` varchar(20) DEFAULT NULL,
  `type_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `parent_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '1=viewed',
  PRIMARY KEY (`id`),
  KEY `idx_type_id` (`type_id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_parent_id` (`parent_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `payments`
--

DROP TABLE IF EXISTS `payments`;
CREATE TABLE IF NOT EXISTS `payments` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `txn_id` varchar(40) DEFAULT NULL,
  `invoice_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `form_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `company_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user` varchar(60) NOT NULL,
  `email` varchar(60) DEFAULT NULL,
  `amount` decimal(13,3) UNSIGNED NOT NULL DEFAULT '0.000',
  `tax` decimal(6,3) UNSIGNED NOT NULL DEFAULT '0.000',
  `discount` decimal(6,3) UNSIGNED NOT NULL DEFAULT '0.000',
  `currency` varchar(6) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `pp` varchar(40) DEFAULT NULL,
  `ip` varchar(46) DEFAULT NULL,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `privileges`
--

DROP TABLE IF EXISTS `privileges`;
CREATE TABLE IF NOT EXISTS `privileges` (
  `id` smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(20) NOT NULL,
  `name` varchar(200) NOT NULL,
  `description` text,
  `mode` varchar(8) NOT NULL,
  `type` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `privileges`
--

INSERT INTO `privileges` (`id`, `code`, `name`, `description`, `mode`, `type`) VALUES
(1, 'manage_teams', 'Manage Teams', 'Permission to add/edit/delete team section', 'manage', 'Teams'),
(2, 'invite_people', 'Invite People', 'Permission to invite people', 'add', 'People'),
(3, 'manage_people', 'Manage People', 'Permission to manage people', 'manage', 'People'),
(4, 'manage_companies', 'Manage Companies', 'Permission to manage companies', 'manage', 'Company'),
(5, 'add_invoice', 'Create Invoice', 'Permission to create a new invoices', 'add', 'Invoice'),
(6, 'edit_invoice', 'Edit Invoice', 'Permission to edit an existing invoices.', 'edit', 'Invoice'),
(7, 'manage_invoices', 'Manage Invoices', 'Permission to manage invoices.', 'manage', 'Invoice'),
(8, 'manage_estimates', 'Manage Estimates', 'Permission to manage estimates', 'manage', 'Esitmate'),
(9, 'manage_language', 'Manage Language', 'Permission to edit language phrases', 'manage', 'Language'),
(10, 'manage_etemplates', 'Mange Email Templates', 'Permission to edit email templates', 'edit', 'Etemplates');

--
-- Table structure for table `projects`
--

DROP TABLE IF EXISTS `projects`;
CREATE TABLE IF NOT EXISTS `projects` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(80) DEFAULT NULL,
  `description` varchar(120) DEFAULT NULL,
  `company_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `company_name` varchar(120) DEFAULT NULL,
  `category_id` smallint(4) UNSIGNED NOT NULL DEFAULT '0',
  `label_id` smallint(4) UNSIGNED NOT NULL DEFAULT '0',
  `currency` varchar(3) DEFAULT NULL,
  `country` varchar(3) DEFAULT NULL,
  `leader_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `leader_name` varchar(60) DEFAULT NULL,
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(60) DEFAULT NULL,
  `jobtypes` blob,
  `budget` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `expenses` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `completed` datetime DEFAULT NULL,
  `completed_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `completed_by_name` varchar(60) DEFAULT NULL,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1= active, 2=trash, 3=archive, 4= completed',
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_company` (`company_id`),
  KEY `idx_category` (`category_id`),
  KEY `idx_label` (`label_id`),
  KEY `idx_leader` (`leader_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `project_categories`
--

DROP TABLE IF EXISTS `project_categories`;
CREATE TABLE IF NOT EXISTS `project_categories` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `project_categories`
--

INSERT INTO `project_categories` (`id`, `name`) VALUES
(1, 'General');

--
-- Table structure for table `project_labels`
--

DROP TABLE IF EXISTS `project_labels`;
CREATE TABLE IF NOT EXISTS `project_labels` (
  `id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT NULL,
  `color` varchar(7) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `project_labels`
--

INSERT INTO `project_labels` (`id`, `name`, `color`) VALUES
(1, 'NEW', '#2ECC71'),
(2, 'IN PROGRESS', '#3498DB'),
(3, 'CANCELED', '#E74C3C'),
(4, 'PAUSED', '#F39C12');

--
-- Table structure for table `project_users`
--

DROP TABLE IF EXISTS `project_users`;
CREATE TABLE IF NOT EXISTS `project_users` (
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`user_id`,`project_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_project` (`project_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
CREATE TABLE IF NOT EXISTS `roles` (
  `id` smallint(4) UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(10) NOT NULL,
  `icon` varchar(20) DEFAULT NULL,
  `name` varchar(30) NOT NULL,
  `description` varchar(200) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `code`, `icon`, `name`, `description`) VALUES
(1, 'owner', 'badge', 'Site Owner', 'Site Owner is the owner of the site, has all privileges and could not be removed.'),
(2, 'staff', 'trophy', 'Staff Member', 'The \"Staff\" members will have access only to projects, clients, tasks and other related items assigned to them.'),
(3, 'editor', 'note', 'Editor', 'The \"Editor\" is required to assist the Staff Members, has different privileges and may be created by Site Owner.');

--
-- Table structure for table `role_privileges`
--

DROP TABLE IF EXISTS `role_privileges`;
CREATE TABLE IF NOT EXISTS `role_privileges` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `rid` int(6) UNSIGNED NOT NULL DEFAULT '0',
  `pid` int(6) UNSIGNED NOT NULL DEFAULT '0',
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `idx` (`rid`,`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `role_privileges`
--

INSERT INTO `role_privileges` (`id`, `rid`, `pid`, `active`) VALUES
(1, 1, 1, 1),
(2, 2, 1, 1),
(3, 3, 1, 1),
(4, 1, 2, 1),
(5, 2, 2, 1),
(6, 3, 2, 0),
(7, 1, 3, 1),
(8, 2, 3, 1),
(9, 3, 3, 0),
(10, 1, 4, 1),
(11, 2, 4, 1),
(12, 3, 4, 0),
(13, 1, 5, 1),
(14, 2, 5, 0),
(15, 3, 5, 0),
(16, 1, 6, 1),
(17, 2, 6, 0),
(18, 3, 6, 0),
(19, 1, 7, 1),
(20, 2, 7, 0),
(21, 3, 7, 0),
(22, 1, 8, 1),
(23, 2, 8, 0),
(24, 3, 8, 0),
(25, 1, 9, 1),
(26, 2, 9, 1),
(27, 3, 9, 1),
(28, 1, 10, 1),
(29, 2, 10, 1),
(30, 3, 10, 1);

--
-- Table structure for table `settings`
--

DROP TABLE IF EXISTS `settings`;
CREATE TABLE IF NOT EXISTS `settings` (
  `id` tinyint(1) UNSIGNED NOT NULL,
  `company` varchar(75) NOT NULL,
  `site_dir` varchar(50) DEFAULT NULL,
  `site_email` varchar(100) NOT NULL,
  `logo` varchar(60) DEFAULT NULL,
  `short_date` varchar(20) NOT NULL,
  `long_date` varchar(25) NOT NULL,
  `time_format` varchar(15) DEFAULT NULL,
  `dtz` varchar(200) NOT NULL,
  `lang` varchar(2) NOT NULL DEFAULT 'en',
  `weekstart` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `locale` varchar(100) DEFAULT NULL,
  `theme` varchar(30) DEFAULT NULL,
  `offline` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `offline_msg` text,
  `offline_d` date DEFAULT '1970-01-01',
  `offline_t` time DEFAULT NULL,
  `perpage` varchar(3) NOT NULL DEFAULT '10',
  `tax` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `sbackup` varchar(50) DEFAULT NULL,
  `currency` varchar(4) DEFAULT NULL,
  `eucookie` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `pagesize` varchar(10) NOT NULL DEFAULT 'LETTER',
  `job_types` blob,
  `prjlabels` blob,
  `prjcats` blob,
  `tasklabels` blob,
  `expcats` blob,
  `invoice_number` varchar(10) DEFAULT NULL,
  `invoice_info` text,
  `invoice_view` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0=list, 1=grid',
  `overdue` varchar(3) DEFAULT '2D',
  `project_view` tinyint(1) UNSIGNED DEFAULT '0' COMMENT '0=list, 1=grid',
  `file_ext` varchar(120) NOT NULL DEFAULT 'png,jpg,jpeg,bmp',
  `file_size` int(11) UNSIGNED NOT NULL DEFAULT '20971520',
  `social_media` blob,
  `mapapi` varchar(120) DEFAULT NULL,
  `privacy` text,
  `mailer` enum('PHP','SMTP','SMAIL') NOT NULL DEFAULT 'PHP',
  `smtp_host` varchar(100) DEFAULT NULL,
  `smtp_user` varchar(50) DEFAULT NULL,
  `smtp_pass` varchar(50) DEFAULT NULL,
  `smtp_port` smallint(3) UNSIGNED DEFAULT NULL,
  `sendmail` varchar(60) DEFAULT NULL,
  `is_ssl` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `wojon` varchar(50) DEFAULT NULL,
  `wojov` decimal(4,2) DEFAULT '1.00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `company`, `site_dir`, `site_email`, `logo`, `short_date`, `long_date`, `time_format`, `dtz`, `lang`, `weekstart`, `locale`, `theme`, `offline`, `offline_msg`, `offline_d`, `offline_t`, `perpage`, `tax`, `sbackup`, `currency`, `eucookie`, `pagesize`, `job_types`, `prjlabels`, `prjcats`, `tasklabels`, `expcats`, `invoice_number`, `invoice_info`, `invoice_view`, `overdue`, `project_view`, `file_ext`, `file_size`, `social_media`, `mapapi`, `privacy`, `mailer`, `smtp_host`, `smtp_user`, `smtp_pass`, `smtp_port`, `sendmail`, `is_ssl`, `wojon`, `wojov`) VALUES
(1, 'Freelance Manager', '', 'info@mail.com', 'logo.svg', 'dd MMM yyyy', 'MMMM dd, yyyy hh:mm a', 'HH:mm', 'America/Toronto', 'en', 0, 'en_CA', 'master', 0, 'Message about site being offline...', '1970-01-01', '00:00:00', '15', 1, '14-Jul-2014_23-23-44.sql', 'CAD', 0, 'LETTER', 0x5b7b226964223a312c226e616d65223a2247656e6572616c222c226872617465223a223130302e3030222c22616374697665223a317d2c7b226964223a322c226e616d65223a2250726f6d6f222c226872617465223a2237352e3030222c22616374697665223a307d2c7b226964223a332c226e616d65223a225370656369616c222c226872617465223a2235302e3030222c22616374697665223a307d2c7b226964223a342c226e616d65223a225370656369616c2032222c226872617465223a2232302e3030222c22616374697665223a307d5d, 0x5b7b226964223a312c226e616d65223a224e4557222c22636f6c6f72223a2223324543433731227d2c7b226964223a322c226e616d65223a22494e2050524f4752455353222c22636f6c6f72223a2223333439384442227d2c7b226964223a332c226e616d65223a2243414e43454c4544222c22636f6c6f72223a2223453734433343227d2c7b226964223a342c226e616d65223a22504155534544222c22636f6c6f72223a2223463339433132227d5d, 0x5b7b226964223a312c226e616d65223a2247656e6572616c227d5d, 0x5b7b226964223a312c226e616d65223a224e4557222c22636f6c6f72223a2223324543433731227d2c7b226964223a322c226e616d65223a22434f4e4649524d4544222c22636f6c6f72223a2223666639383030227d2c7b226964223a332c226e616d65223a22574f524b5320464f52204d45222c22636f6c6f72223a2223386263333461227d2c7b226964223a342c226e616d65223a224455504c4943415445222c22636f6c6f72223a2223303039363838227d2c7b226964223a352c226e616d65223a22574f4e5420464958222c22636f6c6f72223a2223636464633339227d2c7b226964223a362c226e616d65223a2241535349474e4544222c22636f6c6f72223a2223666635373232227d2c7b226964223a372c226e616d65223a22424c4f434b4544222c22636f6c6f72223a2223666663313037227d2c7b226964223a382c226e616d65223a22494e2050524f4752455353222c22636f6c6f72223a2223396136356333227d2c7b226964223a392c226e616d65223a224649584544222c22636f6c6f72223a2223303361396634227d2c7b226964223a31302c226e616d65223a2252454f50454e4544222c22636f6c6f72223a2223666635373232227d2c7b226964223a31312c226e616d65223a225645524946494544222c22636f6c6f72223a2223303361396634227d5d, 0x5b7b226964223a312c226e616d65223a2247656e6572616c227d2c7b226964223a322c226e616d65223a225370656369616c227d2c7b226964223a332c226e616d65223a22535020436c69656e7473227d5d, 'WOJO-1000', 'Additional company related info...', 0, '3D', 0, 'png,jpg,jpeg,bmp,zip,pdf,doc,docx,txt', 20971520, 0x7b2266616365626f6f6b223a2266616365626f6f6b5f70616765222c2274776974746572223a22747769747465725f70616765227d, 'AIzaSyAbflOjxx-oxzmV35LCHFb7NeBBs7wQDbA', '<p>Last updated: October 20. 2017</p>\r\n<p>My Company (\"us\", \"we\", or \"our\") operates http://www.mysite.com  (the\r\n  \"Site\"). This page informs you of our policies regarding the\r\n  collection, use and disclosure of Personal Information we receive from users of\r\n  the Site.</p>\r\n<p>We use your Personal Information only for providing and\r\n  improving the Site. By using the Site, you agree to the collection and use of\r\n  information in accordance with this policy.<br><br></p>\r\n<p><strong>Information\r\n  Collection And Use</strong></p>\r\n<p>While using our Site, we may ask you to provide us with\r\n  certain personally identifiable information that can be used to contact or\r\n  identify you. Personally identifiable information may include, but is not\r\n  limited to your name (\"Personal Information\").<br><br><br></p>\r\n<p><strong>Log Data</strong></p>\r\n<p>Like many site operators, we collect information that your\r\n  browser sends whenever you visit our Site (\"Log Data\").</p>\r\n<p>This Log Data may include information such as your\r\n  computer\'s Internet Protocol (\"IP\") address, browser type, browser\r\n  version, the pages of our Site that you visit, the time and date of your visit,\r\n  the time spent on those pages and other statistics.</p>\r\n<p>In addition, we may use third party services such as Google\r\n  Analytics that collect, monitor and analyze this …<br><br><br></p>\r\n<p><strong>Communications</strong></p>\r\n<p>We may use your Personal Information to contact you with\r\n  newsletters, marketing or promotional materials and other information that ...<br><br><br></p>\r\n<p><strong>Cookies</strong></p>\r\n<p>Cookies are files with small amount of data, which may\r\n  include an anonymous unique identifier. Cookies are sent to your browser from a\r\n  web site and stored on your computer\'s hard drive.</p>\r\n<p>Like many sites, we use \"cookies\" to collect\r\n  information. You can instruct your browser to refuse all cookies or to indicate\r\n  when a cookie is being sent. However, if you do not accept cookies, you may not\r\n  be able to use some portions of our Site.<br><br><br></p>\r\n<p><strong>Security</strong></p>\r\n<p>The security of your Personal Information is important to\r\n  us, but remember that no method of transmission over the Internet, or method of\r\n  electronic storage, is 100% secure. While we strive to use commercially\r\n  acceptable means to protect your Personal Information, we cannot guarantee its\r\n  absolute security.<br><br><br></p>\r\n<p><strong>Changes To This\r\n  Privacy Policy</strong></p>\r\n<p>This Privacy Policy is effective as of (October 20. 2017) and will remain in effect except\r\n  with respect to any changes in its provisions in the future, which will be in\r\n  effect immediately after being posted on this page.</p>\r\n<p>We reserve the right to update or change our Privacy Policy\r\n  at any time and you should check this Privacy Policy periodically. Your\r\n  continued use of the Service after we post any modifications to the Privacy\r\n  Policy on this page will constitute your acknowledgment of the modifications\r\n  and your consent to abide and be bound by the modified Privacy Policy.</p>\r\n<p>If we make any material changes to this Privacy Policy, we\r\n  will notify you either through the email address you have provided us, or by\r\n  placing a prominent notice on our website.<br><br><br></p>\r\n', 'PHP', '', '', '', 465, '/usr/sbin/sendmail -t -i', 1, '1.00', '4.00');

--
-- Table structure for table `subsribers`
--

DROP TABLE IF EXISTS `subsribers`;
CREATE TABLE IF NOT EXISTS `subsribers` (
  `task_id` int(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'task',
  `message_id` int(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'message',
  `note_id` int(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'note',
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'user',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0= unread 1 = red',
  PRIMARY KEY (`task_id`,`message_id`,`note_id`,`user_id`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tasks`
--

DROP TABLE IF EXISTS `tasks`;
CREATE TABLE IF NOT EXISTS `tasks` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `task_list_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` varchar(100) DEFAULT NULL,
  `body` text,
  `assigned_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_name` varchar(100) DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `updated_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `updated_by_name` varchar(100) DEFAULT NULL,
  `due_on` date DEFAULT NULL,
  `completed` datetime DEFAULT NULL,
  `completed_by_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `completed_by_name` varchar(100) DEFAULT NULL,
  `job_id` int(6) UNSIGNED NOT NULL DEFAULT '0',
  `job_hours` decimal(12,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `labels` blob,
  `is_hidden` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `is_priority` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `sorting` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '1=active, 2=trash, 3=archive',
  PRIMARY KEY (`id`),
  KEY `idx_project_id` (`project_id`),
  KEY `idx_task_list_id` (`task_list_id`),
  KEY `idx_job_id` (`job_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `task_labels`
--

DROP TABLE IF EXISTS `task_labels`;
CREATE TABLE IF NOT EXISTS `task_labels` (
  `id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT NULL,
  `color` varchar(7) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `task_labels`
--

INSERT INTO `task_labels` (`id`, `name`, `color`) VALUES
(1, 'NEW', '#2ECC71'),
(2, 'CONFIRMED', '#ff9800'),
(3, 'WORKS FOR ME', '#8bc34a'),
(4, 'DUPLICATE', '#009688'),
(5, 'WONT FIX', '#cddc39'),
(6, 'ASSIGNED', '#ff5722'),
(7, 'BLOCKED', '#ffc107'),
(8, 'IN PROGRESS', '#9a65c3'),
(9, 'FIXED', '#03a9f4'),
(10, 'REOPENED', '#ff5722'),
(11, 'VERIFIED', '#03a9f4');

--
-- Table structure for table `task_labels_assigned`
--

DROP TABLE IF EXISTS `task_labels_assigned`;
CREATE TABLE IF NOT EXISTS `task_labels_assigned` (
  `label_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `task_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`label_id`,`task_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `task_lists`
--

DROP TABLE IF EXISTS `task_lists`;
CREATE TABLE IF NOT EXISTS `task_lists` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` varchar(100) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=active, 2=trash',
  `sorting` int(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_project_id` (`project_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `taxes`
--

DROP TABLE IF EXISTS `taxes`;
CREATE TABLE IF NOT EXISTS `taxes` (
  `id` tinyint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `amount` decimal(13,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `teams`
--

DROP TABLE IF EXISTS `teams`;
CREATE TABLE IF NOT EXISTS `teams` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(40) DEFAULT NULL,
  `color` varchar(7) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `teams_users`
--

DROP TABLE IF EXISTS `teams_users`;
CREATE TABLE IF NOT EXISTS `teams_users` (
  `team_id` int(11) UNSIGNED NOT NULL,
  `user_id` int(11) UNSIGNED NOT NULL,
  PRIMARY KEY (`team_id`,`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `timerecord`
--

DROP TABLE IF EXISTS `timerecord`;
CREATE TABLE IF NOT EXISTS `timerecord` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `title` varchar(60) DEFAULT NULL,
  `description` varchar(120) DEFAULT NULL,
  `project_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `task_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `job_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `hours` decimal(6,2) UNSIGNED NOT NULL DEFAULT '0.00',
  `amount` decimal(13,3) UNSIGNED NOT NULL DEFAULT '0.000',
  `is_billable` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `invoiced` tinyint(1) NOT NULL DEFAULT '0',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` datetime DEFAULT '1970-01-02 00:00:00',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1=active, 2=trash',
  PRIMARY KEY (`id`),
  KEY `idx_project` (`project_id`),
  KEY `idx_task` (`task_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_job` (`job_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `trash`
--

DROP TABLE IF EXISTS `trash`;
CREATE TABLE IF NOT EXISTS `trash` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` varchar(15) DEFAULT NULL,
  `dataset` blob,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `company` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `username` varchar(32) DEFAULT NULL,
  `fname` varchar(32) DEFAULT NULL,
  `lname` varchar(32) DEFAULT NULL,
  `avatar` varchar(60) DEFAULT NULL,
  `bday` date DEFAULT NULL,
  `country` varchar(2) DEFAULT NULL,
  `email` varchar(70) DEFAULT NULL,
  `url` varchar(150) DEFAULT NULL,
  `salt` varchar(25) DEFAULT NULL,
  `hash` varchar(70) DEFAULT NULL,
  `token` varchar(12) DEFAULT '0',
  `lastlogin` datetime DEFAULT NULL,
  `lastip` varbinary(16) DEFAULT '000.000.000.000',
  `about` text,
  `userlevel` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `type` varchar(20) NOT NULL DEFAULT 'member',
  `invite_by` varchar(40) DEFAULT NULL,
  `invite_on` datetime DEFAULT NULL,
  `invite_token` varchar(32) DEFAULT NULL,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '1= active, 2=trash, 3=archive, 4=pending',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `active` enum('y','n','b','t') NOT NULL DEFAULT 'n',
  PRIMARY KEY (`id`),
  KEY `idx_country` (`country`),
  KEY `idx_status` (`active`),
  KEY `idx_company` (`company`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
