diff --git a/.gitignore b/.gitignore index 07a67e437..b2f6dee54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Please try and keep this file organized by alphabetical order. Single files first, then directories. .env -example.env Homestead.yaml Homestead.json /config/lfm.php diff --git a/DB/demodatabase.sql b/DB/demodatabase.sql index 2c0b011e0..b447c289f 100644 --- a/DB/demodatabase.sql +++ b/DB/demodatabase.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 --- Generation Time: Nov 30, 2016 at 07:01 AM +-- Generation Time: Dec 13, 2016 at 10:36 AM -- Server version: 5.6.17 -- PHP Version: 5.5.12 @@ -17,7 +17,7 @@ SET time_zone = "+00:00"; /*!40101 SET NAMES utf8 */; -- --- Database: `version_1.8` +-- Database: `community` -- -- -------------------------------------------------------- @@ -37,28 +37,6 @@ CREATE TABLE IF NOT EXISTS `api_settings` ( -- -------------------------------------------------------- --- --- Table structure for table `approval` --- - -CREATE TABLE IF NOT EXISTS `approval` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; - --- --- Dumping data for table `approval` --- - -INSERT INTO `approval` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES -(1, 'approval', '0', '2016-11-29 23:28:11', '2016-11-29 23:28:11'); - --- -------------------------------------------------------- - -- -- Table structure for table `banlist` -- @@ -93,7 +71,7 @@ CREATE TABLE IF NOT EXISTS `bar_notifications` ( -- INSERT INTO `bar_notifications` (`id`, `key`, `value`, `created_at`, `updated_at`) VALUES -(1, 'new-version', '', '2016-11-29 23:29:29', '2016-11-29 23:29:29'); +(1, 'new-version', '', '2016-12-13 03:20:32', '2016-12-13 03:20:32'); -- -------------------------------------------------------- @@ -127,19 +105,20 @@ CREATE TABLE IF NOT EXISTS `common_settings` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `common_settings` -- INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`) VALUES -(1, 'ticket_token_time_duration', '1', '', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(2, 'enable_rtl', '', '', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(3, 'user_set_ticket_status', '', '1', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(4, 'send_otp', '', '0', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(5, 'email_mandatory', '', '1', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(6, 'user_priority', '', '0', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'); +(1, 'itil', '', '0', '', NULL, NULL), +(2, 'ticket_token_time_duration', '1', '', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(3, 'enable_rtl', '', '', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(4, 'user_set_ticket_status', '', '1', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(5, 'send_otp', '', '0', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(6, 'email_mandatory', '', '1', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(7, 'user_priority', '', '0', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'); -- -------------------------------------------------------- @@ -180,245 +159,245 @@ CREATE TABLE IF NOT EXISTS `country_code` ( -- INSERT INTO `country_code` (`id`, `iso`, `name`, `nicename`, `iso3`, `numcode`, `phonecode`, `created_at`, `updated_at`) VALUES -(1, 'AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4, 93, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(2, 'AL', 'ALBANIA', 'Albania', 'ALB', 8, 355, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(3, 'DZ', 'ALGERIA', 'Algeria', 'DZA', 12, 213, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(4, 'AS', 'AMERICAN SAMOA', 'American Samoa', 'ASM', 16, 1684, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(5, 'AD', 'ANDORRA', 'Andorra', 'AND', 20, 376, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(6, 'AO', 'ANGOLA', 'Angola', 'AGO', 24, 244, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(7, 'AI', 'ANGUILLA', 'Anguilla', 'AIA', 660, 1264, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(8, 'AQ', 'ANTARCTICA', 'Antarctica', 'NUL', 0, 0, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(9, 'AG', 'ANTIGUA AND BARBUDA', 'Antigua and Barbuda', 'ATG', 28, 1268, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(10, 'AR', 'ARGENTINA', 'Argentina', 'ARG', 32, 54, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(11, 'AM', 'ARMENIA', 'Armenia', 'ARM', 51, 374, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(12, 'AW', 'ARUBA', 'Aruba', 'ABW', 533, 297, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(13, 'AU', 'AUSTRALIA', 'Australia', 'AUS', 36, 61, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(14, 'AT', 'AUSTRIA', 'Austria', 'AUT', 40, 43, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(15, 'AZ', 'AZERBAIJAN', 'Azerbaijan', 'AZE', 31, 994, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(16, 'BS', 'BAHAMAS', 'Bahamas', 'BHS', 44, 1242, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(17, 'BH', 'BAHRAIN', 'Bahrain', 'BHR', 48, 973, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(18, 'BD', 'BANGLADESH', 'Bangladesh', 'BGD', 50, 880, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(19, 'BB', 'BARBADOS', 'Barbados', 'BRB', 52, 1246, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(20, 'BY', 'BELARUS', 'Belarus', 'BLR', 112, 375, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(21, 'BE', 'BELGIUM', 'Belgium', 'BEL', 56, 32, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(22, 'BZ', 'BELIZE', 'Belize', 'BLZ', 84, 501, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(23, 'BJ', 'BENIN', 'Benin', 'BEN', 204, 229, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(24, 'BM', 'BERMUDA', 'Bermuda', 'BMU', 60, 1441, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(25, 'BT', 'BHUTAN', 'Bhutan', 'BTN', 64, 975, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(26, 'BO', 'BOLIVIA', 'Bolivia', 'BOL', 68, 591, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(27, 'BA', 'BOSNIA AND HERZEGOVINA', 'Bosnia and Herzegovina', 'BIH', 70, 387, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(28, 'BW', 'BOTSWANA', 'Botswana', 'BWA', 72, 267, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(29, 'BV', 'BOUVET ISLAND', 'Bouvet Island', 'NUL', 0, 0, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(30, 'BR', 'BRAZIL', 'Brazil', 'BRA', 76, 55, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(31, 'IO', 'BRITISH INDIAN OCEAN TERRITORY', 'British Indian Ocean Territory', 'NUL', 0, 246, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(32, 'BN', 'BRUNEI DARUSSALAM', 'Brunei Darussalam', 'BRN', 96, 673, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(33, 'BG', 'BULGARIA', 'Bulgaria', 'BGR', 100, 359, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(34, 'BF', 'BURKINA FASO', 'Burkina Faso', 'BFA', 854, 226, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(35, 'BI', 'BURUNDI', 'Burundi', 'BDI', 108, 257, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(36, 'KH', 'CAMBODIA', 'Cambodia', 'KHM', 116, 855, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(37, 'CM', 'CAMEROON', 'Cameroon', 'CMR', 120, 237, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(38, 'CA', 'CANADA', 'Canada', 'CAN', 124, 1, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(39, 'CV', 'CAPE VERDE', 'Cape Verde', 'CPV', 132, 238, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(40, 'KY', 'CAYMAN ISLANDS', 'Cayman Islands', 'CYM', 136, 1345, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(41, 'CF', 'CENTRAL AFRICAN REPUBLIC', 'Central African Republic', 'CAF', 140, 236, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(42, 'TD', 'CHAD', 'Chad', 'TCD', 148, 235, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(43, 'CL', 'CHILE', 'Chile', 'CHL', 152, 56, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(44, 'CN', 'CHINA', 'China', 'CHN', 156, 86, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(45, 'CX', 'CHRISTMAS ISLAND', 'Christmas Island', 'NUL', 0, 61, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(46, 'CC', 'COCOS (KEELING) ISLANDS', 'Cocos (Keeling) Islands', 'NUL', 0, 672, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(47, 'CO', 'COLOMBIA', 'Colombia', 'COL', 170, 57, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(48, 'KM', 'COMOROS', 'Comoros', 'COM', 174, 269, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(49, 'CG', 'CONGO', 'Congo', 'COG', 178, 242, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(50, 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'Congo, the Democratic Republic of the', 'COD', 180, 242, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(51, 'CK', 'COOK ISLANDS', 'Cook Islands', 'COK', 184, 682, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(52, 'CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188, 506, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(53, 'CI', 'COTE DIVOIRE', 'Cote DIvoire', 'CIV', 384, 225, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(54, 'HR', 'CROATIA', 'Croatia', 'HRV', 191, 385, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(55, 'CU', 'CUBA', 'Cuba', 'CUB', 192, 53, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(56, 'CY', 'CYPRUS', 'Cyprus', 'CYP', 196, 357, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(57, 'CZ', 'CZECH REPUBLIC', 'Czech Republic', 'CZE', 203, 420, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(58, 'DK', 'DENMARK', 'Denmark', 'DNK', 208, 45, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(59, 'DJ', 'DJIBOUTI', 'Djibouti', 'DJI', 262, 253, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(60, 'DM', 'DOMINICA', 'Dominica', 'DMA', 212, 1767, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(61, 'DO', 'DOMINICAN REPUBLIC', 'Dominican Republic', 'DOM', 214, 1809, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(62, 'EC', 'ECUADOR', 'Ecuador', 'ECU', 218, 593, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(63, 'EG', 'EGYPT', 'Egypt', 'EGY', 818, 20, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(64, 'SV', 'EL SALVADOR', 'El Salvador', 'SLV', 222, 503, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(65, 'GQ', 'EQUATORIAL GUINEA', 'Equatorial Guinea', 'GNQ', 226, 240, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(66, 'ER', 'ERITREA', 'Eritrea', 'ERI', 232, 291, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(67, 'EE', 'ESTONIA', 'Estonia', 'EST', 233, 372, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(68, 'ET', 'ETHIOPIA', 'Ethiopia', 'ETH', 231, 251, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(69, 'FK', 'FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands (Malvinas)', 'FLK', 238, 500, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(70, 'FO', 'FAROE ISLANDS', 'Faroe Islands', 'FRO', 234, 298, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(71, 'FJ', 'FIJI', 'Fiji', 'FJI', 242, 679, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(72, 'FI', 'FINLAND', 'Finland', 'FIN', 246, 358, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(73, 'FR', 'FRANCE', 'France', 'FRA', 250, 33, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(74, 'GF', 'FRENCH GUIANA', 'French Guiana', 'GUF', 254, 594, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(75, 'PF', 'FRENCH POLYNESIA', 'French Polynesia', 'PYF', 258, 689, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(76, 'TF', 'FRENCH SOUTHERN TERRITORIES', 'French Southern Territories', 'NUL', 0, 0, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(77, 'GA', 'GABON', 'Gabon', 'GAB', 266, 241, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(78, 'GM', 'GAMBIA', 'Gambia', 'GMB', 270, 220, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(79, 'GE', 'GEORGIA', 'Georgia', 'GEO', 268, 995, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(80, 'DE', 'GERMANY', 'Germany', 'DEU', 276, 49, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(81, 'GH', 'GHANA', 'Ghana', 'GHA', 288, 233, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(82, 'GI', 'GIBRALTAR', 'Gibraltar', 'GIB', 292, 350, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(83, 'GR', 'GREECE', 'Greece', 'GRC', 300, 30, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(84, 'GL', 'GREENLAND', 'Greenland', 'GRL', 304, 299, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(85, 'GD', 'GRENADA', 'Grenada', 'GRD', 308, 1473, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(86, 'GP', 'GUADELOUPE', 'Guadeloupe', 'GLP', 312, 590, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(87, 'GU', 'GUAM', 'Guam', 'GUM', 316, 1671, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(88, 'GT', 'GUATEMALA', 'Guatemala', 'GTM', 320, 502, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(89, 'GN', 'GUINEA', 'Guinea', 'GIN', 324, 224, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(90, 'GW', 'GUINEA-BISSAU', 'Guinea-Bissau', 'GNB', 624, 245, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(91, 'GY', 'GUYANA', 'Guyana', 'GUY', 328, 592, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(92, 'HT', 'HAITI', 'Haiti', 'HTI', 332, 509, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(93, 'HM', 'HEARD ISLAND AND MCDONALD ISLANDS', 'Heard Island and Mcdonald Islands', 'NUL', 0, 0, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(94, 'VA', 'HOLY SEE (VATICAN CITY STATE)', 'Holy See (Vatican City State)', 'VAT', 336, 39, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(95, 'HN', 'HONDURAS', 'Honduras', 'HND', 340, 504, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(96, 'HK', 'HONG KONG', 'Hong Kong', 'HKG', 344, 852, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(97, 'HU', 'HUNGARY', 'Hungary', 'HUN', 348, 36, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(98, 'IS', 'ICELAND', 'Iceland', 'ISL', 352, 354, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(99, 'IN', 'INDIA', 'India', 'IND', 356, 91, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(100, 'ID', 'INDONESIA', 'Indonesia', 'IDN', 360, 62, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(101, 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 'Iran, Islamic Republic of', 'IRN', 364, 98, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(102, 'IQ', 'IRAQ', 'Iraq', 'IRQ', 368, 964, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(103, 'IE', 'IRELAND', 'Ireland', 'IRL', 372, 353, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(104, 'IL', 'ISRAEL', 'Israel', 'ISR', 376, 972, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(105, 'IT', 'ITALY', 'Italy', 'ITA', 380, 39, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(106, 'JM', 'JAMAICA', 'Jamaica', 'JAM', 388, 1876, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(107, 'JP', 'JAPAN', 'Japan', 'JPN', 392, 81, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(108, 'JO', 'JORDAN', 'Jordan', 'JOR', 400, 962, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(109, 'KZ', 'KAZAKHSTAN', 'Kazakhstan', 'KAZ', 398, 7, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(110, 'KE', 'KENYA', 'Kenya', 'KEN', 404, 254, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(111, 'KI', 'KIRIBATI', 'Kiribati', 'KIR', 296, 686, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(112, 'KP', 'KOREA, DEMOCRATIC PEOPLES REPUBLIC OF', 'Korea, Democratic Peoples Republic of', 'PRK', 408, 850, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(113, 'KR', 'KOREA, REPUBLIC OF', 'Korea, Republic of', 'KOR', 410, 82, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(114, 'KW', 'KUWAIT', 'Kuwait', 'KWT', 414, 965, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(115, 'KG', 'KYRGYZSTAN', 'Kyrgyzstan', 'KGZ', 417, 996, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(116, 'LA', 'LAO PEOPLES DEMOCRATIC REPUBLIC', 'Lao Peoples Democratic Republic', 'LAO', 418, 856, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(117, 'LV', 'LATVIA', 'Latvia', 'LVA', 428, 371, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(118, 'LB', 'LEBANON', 'Lebanon', 'LBN', 422, 961, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(119, 'LS', 'LESOTHO', 'Lesotho', 'LSO', 426, 266, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(120, 'LR', 'LIBERIA', 'Liberia', 'LBR', 430, 231, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(121, 'LY', 'LIBYAN ARAB JAMAHIRIYA', 'Libyan Arab Jamahiriya', 'LBY', 434, 218, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(122, 'LI', 'LIECHTENSTEIN', 'Liechtenstein', 'LIE', 438, 423, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(123, 'LT', 'LITHUANIA', 'Lithuania', 'LTU', 440, 370, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(124, 'LU', 'LUXEMBOURG', 'Luxembourg', 'LUX', 442, 352, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(125, 'MO', 'MACAO', 'Macao', 'MAC', 446, 853, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(126, 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Macedonia, the Former Yugoslav Republic of', 'MKD', 807, 389, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(127, 'MG', 'MADAGASCAR', 'Madagascar', 'MDG', 450, 261, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(128, 'MW', 'MALAWI', 'Malawi', 'MWI', 454, 265, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(129, 'MY', 'MALAYSIA', 'Malaysia', 'MYS', 458, 60, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(130, 'MV', 'MALDIVES', 'Maldives', 'MDV', 462, 960, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(131, 'ML', 'MALI', 'Mali', 'MLI', 466, 223, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(132, 'MT', 'MALTA', 'Malta', 'MLT', 470, 356, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(133, 'MH', 'MARSHALL ISLANDS', 'Marshall Islands', 'MHL', 584, 692, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(134, 'MQ', 'MARTINIQUE', 'Martinique', 'MTQ', 474, 596, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(135, 'MR', 'MAURITANIA', 'Mauritania', 'MRT', 478, 222, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(136, 'MU', 'MAURITIUS', 'Mauritius', 'MUS', 480, 230, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(137, 'YT', 'MAYOTTE', 'Mayotte', 'NUL', 0, 269, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(138, 'MX', 'MEXICO', 'Mexico', 'MEX', 484, 52, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(139, 'FM', 'MICRONESIA, FEDERATED STATES OF', 'Micronesia, Federated States of', 'FSM', 583, 691, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(140, 'MD', 'MOLDOVA, REPUBLIC OF', 'Moldova, Republic of', 'MDA', 498, 373, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(141, 'MC', 'MONACO', 'Monaco', 'MCO', 492, 377, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(142, 'MN', 'MONGOLIA', 'Mongolia', 'MNG', 496, 976, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(143, 'MS', 'MONTSERRAT', 'Montserrat', 'MSR', 500, 1664, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(144, 'MA', 'MOROCCO', 'Morocco', 'MAR', 504, 212, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(145, 'MZ', 'MOZAMBIQUE', 'Mozambique', 'MOZ', 508, 258, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(146, 'MM', 'MYANMAR', 'Myanmar', 'MMR', 104, 95, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(147, 'NA', 'NAMIBIA', 'Namibia', 'NAM', 516, 264, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(148, 'NR', 'NAURU', 'Nauru', 'NRU', 520, 674, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(149, 'NP', 'NEPAL', 'Nepal', 'NPL', 524, 977, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(150, 'NL', 'NETHERLANDS', 'Netherlands', 'NLD', 528, 31, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(151, 'AN', 'NETHERLANDS ANTILLES', 'Netherlands Antilles', 'ANT', 530, 599, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(152, 'NC', 'NEW CALEDONIA', 'New Caledonia', 'NCL', 540, 687, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(153, 'NZ', 'NEW ZEALAND', 'New Zealand', 'NZL', 554, 64, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(154, 'NI', 'NICARAGUA', 'Nicaragua', 'NIC', 558, 505, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(155, 'NE', 'NIGER', 'Niger', 'NER', 562, 227, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(156, 'NG', 'NIGERIA', 'Nigeria', 'NGA', 566, 234, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(157, 'NU', 'NIUE', 'Niue', 'NIU', 570, 683, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(158, 'NF', 'NORFOLK ISLAND', 'Norfolk Island', 'NFK', 574, 672, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(159, 'MP', 'NORTHERN MARIANA ISLANDS', 'Northern Mariana Islands', 'MNP', 580, 1670, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(160, 'NO', 'NORWAY', 'Norway', 'NOR', 578, 47, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(161, 'OM', 'OMAN', 'Oman', 'OMN', 512, 968, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(162, 'PK', 'PAKISTAN', 'Pakistan', 'PAK', 586, 92, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(163, 'PW', 'PALAU', 'Palau', 'PLW', 585, 680, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(164, 'PS', 'PALESTINIAN TERRITORY, OCCUPIED', 'Palestinian Territory, Occupied', 'NUL', 0, 970, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(165, 'PA', 'PANAMA', 'Panama', 'PAN', 591, 507, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(166, 'PG', 'PAPUA NEW GUINEA', 'Papua New Guinea', 'PNG', 598, 675, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(167, 'PY', 'PARAGUAY', 'Paraguay', 'PRY', 600, 595, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(168, 'PE', 'PERU', 'Peru', 'PER', 604, 51, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(169, 'PH', 'PHILIPPINES', 'Philippines', 'PHL', 608, 63, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(170, 'PN', 'PITCAIRN', 'Pitcairn', 'PCN', 612, 0, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(171, 'PL', 'POLAND', 'Poland', 'POL', 616, 48, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(172, 'PT', 'PORTUGAL', 'Portugal', 'PRT', 620, 351, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(173, 'PR', 'PUERTO RICO', 'Puerto Rico', 'PRI', 630, 1787, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(174, 'QA', 'QATAR', 'Qatar', 'QAT', 634, 974, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(175, 'RE', 'REUNION', 'Reunion', 'REU', 638, 262, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(176, 'RO', 'ROMANIA', 'Romania', 'ROM', 642, 40, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 70, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(178, 'RW', 'RWANDA', 'Rwanda', 'RWA', 646, 250, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(179, 'SH', 'SAINT HELENA', 'Saint Helena', 'SHN', 654, 290, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(180, 'KN', 'SAINT KITTS AND NEVIS', 'Saint Kitts and Nevis', 'KNA', 659, 1869, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(181, 'LC', 'SAINT LUCIA', 'Saint Lucia', 'LCA', 662, 1758, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(182, 'PM', 'SAINT PIERRE AND MIQUELON', 'Saint Pierre and Miquelon', 'SPM', 666, 508, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(183, 'VC', 'SAINT VINCENT AND THE GRENADINES', 'Saint Vincent and the Grenadines', 'VCT', 670, 1784, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(184, 'WS', 'SAMOA', 'Samoa', 'WSM', 882, 684, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(185, 'SM', 'SAN MARINO', 'San Marino', 'SMR', 674, 378, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(186, 'ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678, 239, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(187, 'SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682, 966, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(188, 'SN', 'SENEGAL', 'Senegal', 'SEN', 686, 221, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(189, 'CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', 'NUL', 0, 381, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(190, 'SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690, 248, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(191, 'SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694, 232, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(192, 'SG', 'SINGAPORE', 'Singapore', 'SGP', 702, 65, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(193, 'SK', 'SLOVAKIA', 'Slovakia', 'SVK', 703, 421, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(194, 'SI', 'SLOVENIA', 'Slovenia', 'SVN', 705, 386, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(195, 'SB', 'SOLOMON ISLANDS', 'Solomon Islands', 'SLB', 90, 677, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(196, 'SO', 'SOMALIA', 'Somalia', 'SOM', 706, 252, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(197, 'ZA', 'SOUTH AFRICA', 'South Africa', 'ZAF', 710, 27, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(198, 'GS', 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'South Georgia and the South Sandwich Islands', 'NUL', 0, 0, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(199, 'ES', 'SPAIN', 'Spain', 'ESP', 724, 34, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(200, 'LK', 'SRI LANKA', 'Sri Lanka', 'LKA', 144, 94, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(201, 'SD', 'SUDAN', 'Sudan', 'SDN', 736, 249, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(202, 'SR', 'SURINAME', 'Suriname', 'SUR', 740, 597, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(203, 'SJ', 'SVALBARD AND JAN MAYEN', 'Svalbard and Jan Mayen', 'SJM', 744, 47, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(204, 'SZ', 'SWAZILAND', 'Swaziland', 'SWZ', 748, 268, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(205, 'SE', 'SWEDEN', 'Sweden', 'SWE', 752, 46, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(206, 'CH', 'SWITZERLAND', 'Switzerland', 'CHE', 756, 41, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(207, 'SY', 'SYRIAN ARAB REPUBLIC', 'Syrian Arab Republic', 'SYR', 760, 963, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(208, 'TW', 'TAIWAN, PROVINCE OF CHINA', 'Taiwan, Province of China', 'TWN', 158, 886, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(209, 'TJ', 'TAJIKISTAN', 'Tajikistan', 'TJK', 762, 992, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(210, 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 'Tanzania, United Republic of', 'TZA', 834, 255, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(211, 'TH', 'THAILAND', 'Thailand', 'THA', 764, 66, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(212, 'TL', 'TIMOR-LESTE', 'Timor-Leste', 'NUL', 0, 670, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(213, 'TG', 'TOGO', 'Togo', 'TGO', 768, 228, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(214, 'TK', 'TOKELAU', 'Tokelau', 'TKL', 772, 690, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(215, 'TO', 'TONGA', 'Tonga', 'TON', 776, 676, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(216, 'TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780, 1868, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(217, 'TN', 'TUNISIA', 'Tunisia', 'TUN', 788, 216, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(218, 'TR', 'TURKEY', 'Turkey', 'TUR', 792, 90, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(219, 'TM', 'TURKMENISTAN', 'Turkmenistan', 'TKM', 795, 7370, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(220, 'TC', 'TURKS AND CAICOS ISLANDS', 'Turks and Caicos Islands', 'TCA', 796, 1649, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(221, 'TV', 'TUVALU', 'Tuvalu', 'TUV', 798, 688, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(222, 'UG', 'UGANDA', 'Uganda', 'UGA', 800, 256, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(223, 'UA', 'UKRAINE', 'Ukraine', 'UKR', 804, 380, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(224, 'AE', 'UNITED ARAB EMIRATES', 'United Arab Emirates', 'ARE', 784, 971, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(225, 'GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826, 44, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(226, 'US', 'UNITED STATES', 'United States', 'USA', 840, 1, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(227, 'UM', 'UNITED STATES MINOR OUTLYING ISLANDS', 'United States Minor Outlying Islands', 'NUL', 0, 1, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(228, 'UY', 'URUGUAY', 'Uruguay', 'URY', 858, 598, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(229, 'UZ', 'UZBEKISTAN', 'Uzbekistan', 'UZB', 860, 998, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(230, 'VU', 'VANUATU', 'Vanuatu', 'VUT', 548, 678, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(231, 'VE', 'VENEZUELA', 'Venezuela', 'VEN', 862, 58, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(232, 'VN', 'VIET NAM', 'Viet Nam', 'VNM', 704, 84, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(233, 'VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', 92, 1284, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(234, 'VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', 850, 1340, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(235, 'WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', 876, 681, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(236, 'EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732, 212, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(237, 'YE', 'YEMEN', 'Yemen', 'YEM', 887, 967, '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(238, 'ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894, 260, '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(239, 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716, 263, '2016-11-29 23:28:42', '2016-11-29 23:28:42'); +(1, 'AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4, 93, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(2, 'AL', 'ALBANIA', 'Albania', 'ALB', 8, 355, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(3, 'DZ', 'ALGERIA', 'Algeria', 'DZA', 12, 213, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(4, 'AS', 'AMERICAN SAMOA', 'American Samoa', 'ASM', 16, 1684, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(5, 'AD', 'ANDORRA', 'Andorra', 'AND', 20, 376, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(6, 'AO', 'ANGOLA', 'Angola', 'AGO', 24, 244, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(7, 'AI', 'ANGUILLA', 'Anguilla', 'AIA', 660, 1264, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(8, 'AQ', 'ANTARCTICA', 'Antarctica', 'NUL', 0, 0, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(9, 'AG', 'ANTIGUA AND BARBUDA', 'Antigua and Barbuda', 'ATG', 28, 1268, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(10, 'AR', 'ARGENTINA', 'Argentina', 'ARG', 32, 54, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(11, 'AM', 'ARMENIA', 'Armenia', 'ARM', 51, 374, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(12, 'AW', 'ARUBA', 'Aruba', 'ABW', 533, 297, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(13, 'AU', 'AUSTRALIA', 'Australia', 'AUS', 36, 61, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(14, 'AT', 'AUSTRIA', 'Austria', 'AUT', 40, 43, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(15, 'AZ', 'AZERBAIJAN', 'Azerbaijan', 'AZE', 31, 994, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(16, 'BS', 'BAHAMAS', 'Bahamas', 'BHS', 44, 1242, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(17, 'BH', 'BAHRAIN', 'Bahrain', 'BHR', 48, 973, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(18, 'BD', 'BANGLADESH', 'Bangladesh', 'BGD', 50, 880, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(19, 'BB', 'BARBADOS', 'Barbados', 'BRB', 52, 1246, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(20, 'BY', 'BELARUS', 'Belarus', 'BLR', 112, 375, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(21, 'BE', 'BELGIUM', 'Belgium', 'BEL', 56, 32, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(22, 'BZ', 'BELIZE', 'Belize', 'BLZ', 84, 501, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(23, 'BJ', 'BENIN', 'Benin', 'BEN', 204, 229, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(24, 'BM', 'BERMUDA', 'Bermuda', 'BMU', 60, 1441, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(25, 'BT', 'BHUTAN', 'Bhutan', 'BTN', 64, 975, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(26, 'BO', 'BOLIVIA', 'Bolivia', 'BOL', 68, 591, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(27, 'BA', 'BOSNIA AND HERZEGOVINA', 'Bosnia and Herzegovina', 'BIH', 70, 387, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(28, 'BW', 'BOTSWANA', 'Botswana', 'BWA', 72, 267, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(29, 'BV', 'BOUVET ISLAND', 'Bouvet Island', 'NUL', 0, 0, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(30, 'BR', 'BRAZIL', 'Brazil', 'BRA', 76, 55, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(31, 'IO', 'BRITISH INDIAN OCEAN TERRITORY', 'British Indian Ocean Territory', 'NUL', 0, 246, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(32, 'BN', 'BRUNEI DARUSSALAM', 'Brunei Darussalam', 'BRN', 96, 673, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(33, 'BG', 'BULGARIA', 'Bulgaria', 'BGR', 100, 359, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(34, 'BF', 'BURKINA FASO', 'Burkina Faso', 'BFA', 854, 226, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(35, 'BI', 'BURUNDI', 'Burundi', 'BDI', 108, 257, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(36, 'KH', 'CAMBODIA', 'Cambodia', 'KHM', 116, 855, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(37, 'CM', 'CAMEROON', 'Cameroon', 'CMR', 120, 237, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(38, 'CA', 'CANADA', 'Canada', 'CAN', 124, 1, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(39, 'CV', 'CAPE VERDE', 'Cape Verde', 'CPV', 132, 238, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(40, 'KY', 'CAYMAN ISLANDS', 'Cayman Islands', 'CYM', 136, 1345, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(41, 'CF', 'CENTRAL AFRICAN REPUBLIC', 'Central African Republic', 'CAF', 140, 236, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(42, 'TD', 'CHAD', 'Chad', 'TCD', 148, 235, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(43, 'CL', 'CHILE', 'Chile', 'CHL', 152, 56, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(44, 'CN', 'CHINA', 'China', 'CHN', 156, 86, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(45, 'CX', 'CHRISTMAS ISLAND', 'Christmas Island', 'NUL', 0, 61, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(46, 'CC', 'COCOS (KEELING) ISLANDS', 'Cocos (Keeling) Islands', 'NUL', 0, 672, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(47, 'CO', 'COLOMBIA', 'Colombia', 'COL', 170, 57, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(48, 'KM', 'COMOROS', 'Comoros', 'COM', 174, 269, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(49, 'CG', 'CONGO', 'Congo', 'COG', 178, 242, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(50, 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'Congo, the Democratic Republic of the', 'COD', 180, 242, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(51, 'CK', 'COOK ISLANDS', 'Cook Islands', 'COK', 184, 682, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(52, 'CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188, 506, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(53, 'CI', 'COTE DIVOIRE', 'Cote DIvoire', 'CIV', 384, 225, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(54, 'HR', 'CROATIA', 'Croatia', 'HRV', 191, 385, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(55, 'CU', 'CUBA', 'Cuba', 'CUB', 192, 53, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(56, 'CY', 'CYPRUS', 'Cyprus', 'CYP', 196, 357, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(57, 'CZ', 'CZECH REPUBLIC', 'Czech Republic', 'CZE', 203, 420, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(58, 'DK', 'DENMARK', 'Denmark', 'DNK', 208, 45, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(59, 'DJ', 'DJIBOUTI', 'Djibouti', 'DJI', 262, 253, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(60, 'DM', 'DOMINICA', 'Dominica', 'DMA', 212, 1767, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(61, 'DO', 'DOMINICAN REPUBLIC', 'Dominican Republic', 'DOM', 214, 1809, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(62, 'EC', 'ECUADOR', 'Ecuador', 'ECU', 218, 593, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(63, 'EG', 'EGYPT', 'Egypt', 'EGY', 818, 20, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(64, 'SV', 'EL SALVADOR', 'El Salvador', 'SLV', 222, 503, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(65, 'GQ', 'EQUATORIAL GUINEA', 'Equatorial Guinea', 'GNQ', 226, 240, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(66, 'ER', 'ERITREA', 'Eritrea', 'ERI', 232, 291, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(67, 'EE', 'ESTONIA', 'Estonia', 'EST', 233, 372, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(68, 'ET', 'ETHIOPIA', 'Ethiopia', 'ETH', 231, 251, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(69, 'FK', 'FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands (Malvinas)', 'FLK', 238, 500, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(70, 'FO', 'FAROE ISLANDS', 'Faroe Islands', 'FRO', 234, 298, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(71, 'FJ', 'FIJI', 'Fiji', 'FJI', 242, 679, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(72, 'FI', 'FINLAND', 'Finland', 'FIN', 246, 358, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(73, 'FR', 'FRANCE', 'France', 'FRA', 250, 33, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(74, 'GF', 'FRENCH GUIANA', 'French Guiana', 'GUF', 254, 594, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(75, 'PF', 'FRENCH POLYNESIA', 'French Polynesia', 'PYF', 258, 689, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(76, 'TF', 'FRENCH SOUTHERN TERRITORIES', 'French Southern Territories', 'NUL', 0, 0, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(77, 'GA', 'GABON', 'Gabon', 'GAB', 266, 241, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(78, 'GM', 'GAMBIA', 'Gambia', 'GMB', 270, 220, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(79, 'GE', 'GEORGIA', 'Georgia', 'GEO', 268, 995, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(80, 'DE', 'GERMANY', 'Germany', 'DEU', 276, 49, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(81, 'GH', 'GHANA', 'Ghana', 'GHA', 288, 233, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(82, 'GI', 'GIBRALTAR', 'Gibraltar', 'GIB', 292, 350, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(83, 'GR', 'GREECE', 'Greece', 'GRC', 300, 30, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(84, 'GL', 'GREENLAND', 'Greenland', 'GRL', 304, 299, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(85, 'GD', 'GRENADA', 'Grenada', 'GRD', 308, 1473, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(86, 'GP', 'GUADELOUPE', 'Guadeloupe', 'GLP', 312, 590, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(87, 'GU', 'GUAM', 'Guam', 'GUM', 316, 1671, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(88, 'GT', 'GUATEMALA', 'Guatemala', 'GTM', 320, 502, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(89, 'GN', 'GUINEA', 'Guinea', 'GIN', 324, 224, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(90, 'GW', 'GUINEA-BISSAU', 'Guinea-Bissau', 'GNB', 624, 245, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(91, 'GY', 'GUYANA', 'Guyana', 'GUY', 328, 592, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(92, 'HT', 'HAITI', 'Haiti', 'HTI', 332, 509, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(93, 'HM', 'HEARD ISLAND AND MCDONALD ISLANDS', 'Heard Island and Mcdonald Islands', 'NUL', 0, 0, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(94, 'VA', 'HOLY SEE (VATICAN CITY STATE)', 'Holy See (Vatican City State)', 'VAT', 336, 39, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(95, 'HN', 'HONDURAS', 'Honduras', 'HND', 340, 504, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(96, 'HK', 'HONG KONG', 'Hong Kong', 'HKG', 344, 852, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(97, 'HU', 'HUNGARY', 'Hungary', 'HUN', 348, 36, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(98, 'IS', 'ICELAND', 'Iceland', 'ISL', 352, 354, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(99, 'IN', 'INDIA', 'India', 'IND', 356, 91, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(100, 'ID', 'INDONESIA', 'Indonesia', 'IDN', 360, 62, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(101, 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 'Iran, Islamic Republic of', 'IRN', 364, 98, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(102, 'IQ', 'IRAQ', 'Iraq', 'IRQ', 368, 964, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(103, 'IE', 'IRELAND', 'Ireland', 'IRL', 372, 353, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(104, 'IL', 'ISRAEL', 'Israel', 'ISR', 376, 972, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(105, 'IT', 'ITALY', 'Italy', 'ITA', 380, 39, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(106, 'JM', 'JAMAICA', 'Jamaica', 'JAM', 388, 1876, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(107, 'JP', 'JAPAN', 'Japan', 'JPN', 392, 81, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(108, 'JO', 'JORDAN', 'Jordan', 'JOR', 400, 962, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(109, 'KZ', 'KAZAKHSTAN', 'Kazakhstan', 'KAZ', 398, 7, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(110, 'KE', 'KENYA', 'Kenya', 'KEN', 404, 254, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(111, 'KI', 'KIRIBATI', 'Kiribati', 'KIR', 296, 686, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(112, 'KP', 'KOREA, DEMOCRATIC PEOPLES REPUBLIC OF', 'Korea, Democratic Peoples Republic of', 'PRK', 408, 850, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(113, 'KR', 'KOREA, REPUBLIC OF', 'Korea, Republic of', 'KOR', 410, 82, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(114, 'KW', 'KUWAIT', 'Kuwait', 'KWT', 414, 965, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(115, 'KG', 'KYRGYZSTAN', 'Kyrgyzstan', 'KGZ', 417, 996, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(116, 'LA', 'LAO PEOPLES DEMOCRATIC REPUBLIC', 'Lao Peoples Democratic Republic', 'LAO', 418, 856, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(117, 'LV', 'LATVIA', 'Latvia', 'LVA', 428, 371, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(118, 'LB', 'LEBANON', 'Lebanon', 'LBN', 422, 961, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(119, 'LS', 'LESOTHO', 'Lesotho', 'LSO', 426, 266, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(120, 'LR', 'LIBERIA', 'Liberia', 'LBR', 430, 231, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(121, 'LY', 'LIBYAN ARAB JAMAHIRIYA', 'Libyan Arab Jamahiriya', 'LBY', 434, 218, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(122, 'LI', 'LIECHTENSTEIN', 'Liechtenstein', 'LIE', 438, 423, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(123, 'LT', 'LITHUANIA', 'Lithuania', 'LTU', 440, 370, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(124, 'LU', 'LUXEMBOURG', 'Luxembourg', 'LUX', 442, 352, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(125, 'MO', 'MACAO', 'Macao', 'MAC', 446, 853, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(126, 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Macedonia, the Former Yugoslav Republic of', 'MKD', 807, 389, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(127, 'MG', 'MADAGASCAR', 'Madagascar', 'MDG', 450, 261, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(128, 'MW', 'MALAWI', 'Malawi', 'MWI', 454, 265, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(129, 'MY', 'MALAYSIA', 'Malaysia', 'MYS', 458, 60, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(130, 'MV', 'MALDIVES', 'Maldives', 'MDV', 462, 960, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(131, 'ML', 'MALI', 'Mali', 'MLI', 466, 223, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(132, 'MT', 'MALTA', 'Malta', 'MLT', 470, 356, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(133, 'MH', 'MARSHALL ISLANDS', 'Marshall Islands', 'MHL', 584, 692, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(134, 'MQ', 'MARTINIQUE', 'Martinique', 'MTQ', 474, 596, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(135, 'MR', 'MAURITANIA', 'Mauritania', 'MRT', 478, 222, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(136, 'MU', 'MAURITIUS', 'Mauritius', 'MUS', 480, 230, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(137, 'YT', 'MAYOTTE', 'Mayotte', 'NUL', 0, 269, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(138, 'MX', 'MEXICO', 'Mexico', 'MEX', 484, 52, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(139, 'FM', 'MICRONESIA, FEDERATED STATES OF', 'Micronesia, Federated States of', 'FSM', 583, 691, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(140, 'MD', 'MOLDOVA, REPUBLIC OF', 'Moldova, Republic of', 'MDA', 498, 373, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(141, 'MC', 'MONACO', 'Monaco', 'MCO', 492, 377, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(142, 'MN', 'MONGOLIA', 'Mongolia', 'MNG', 496, 976, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(143, 'MS', 'MONTSERRAT', 'Montserrat', 'MSR', 500, 1664, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(144, 'MA', 'MOROCCO', 'Morocco', 'MAR', 504, 212, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(145, 'MZ', 'MOZAMBIQUE', 'Mozambique', 'MOZ', 508, 258, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(146, 'MM', 'MYANMAR', 'Myanmar', 'MMR', 104, 95, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(147, 'NA', 'NAMIBIA', 'Namibia', 'NAM', 516, 264, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(148, 'NR', 'NAURU', 'Nauru', 'NRU', 520, 674, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(149, 'NP', 'NEPAL', 'Nepal', 'NPL', 524, 977, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(150, 'NL', 'NETHERLANDS', 'Netherlands', 'NLD', 528, 31, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(151, 'AN', 'NETHERLANDS ANTILLES', 'Netherlands Antilles', 'ANT', 530, 599, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(152, 'NC', 'NEW CALEDONIA', 'New Caledonia', 'NCL', 540, 687, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(153, 'NZ', 'NEW ZEALAND', 'New Zealand', 'NZL', 554, 64, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(154, 'NI', 'NICARAGUA', 'Nicaragua', 'NIC', 558, 505, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(155, 'NE', 'NIGER', 'Niger', 'NER', 562, 227, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(156, 'NG', 'NIGERIA', 'Nigeria', 'NGA', 566, 234, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(157, 'NU', 'NIUE', 'Niue', 'NIU', 570, 683, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(158, 'NF', 'NORFOLK ISLAND', 'Norfolk Island', 'NFK', 574, 672, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(159, 'MP', 'NORTHERN MARIANA ISLANDS', 'Northern Mariana Islands', 'MNP', 580, 1670, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(160, 'NO', 'NORWAY', 'Norway', 'NOR', 578, 47, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(161, 'OM', 'OMAN', 'Oman', 'OMN', 512, 968, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(162, 'PK', 'PAKISTAN', 'Pakistan', 'PAK', 586, 92, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(163, 'PW', 'PALAU', 'Palau', 'PLW', 585, 680, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(164, 'PS', 'PALESTINIAN TERRITORY, OCCUPIED', 'Palestinian Territory, Occupied', 'NUL', 0, 970, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(165, 'PA', 'PANAMA', 'Panama', 'PAN', 591, 507, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(166, 'PG', 'PAPUA NEW GUINEA', 'Papua New Guinea', 'PNG', 598, 675, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(167, 'PY', 'PARAGUAY', 'Paraguay', 'PRY', 600, 595, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(168, 'PE', 'PERU', 'Peru', 'PER', 604, 51, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(169, 'PH', 'PHILIPPINES', 'Philippines', 'PHL', 608, 63, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(170, 'PN', 'PITCAIRN', 'Pitcairn', 'PCN', 612, 0, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(171, 'PL', 'POLAND', 'Poland', 'POL', 616, 48, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(172, 'PT', 'PORTUGAL', 'Portugal', 'PRT', 620, 351, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(173, 'PR', 'PUERTO RICO', 'Puerto Rico', 'PRI', 630, 1787, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(174, 'QA', 'QATAR', 'Qatar', 'QAT', 634, 974, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(175, 'RE', 'REUNION', 'Reunion', 'REU', 638, 262, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(176, 'RO', 'ROMANIA', 'Romania', 'ROM', 642, 40, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 70, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(178, 'RW', 'RWANDA', 'Rwanda', 'RWA', 646, 250, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(179, 'SH', 'SAINT HELENA', 'Saint Helena', 'SHN', 654, 290, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(180, 'KN', 'SAINT KITTS AND NEVIS', 'Saint Kitts and Nevis', 'KNA', 659, 1869, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(181, 'LC', 'SAINT LUCIA', 'Saint Lucia', 'LCA', 662, 1758, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(182, 'PM', 'SAINT PIERRE AND MIQUELON', 'Saint Pierre and Miquelon', 'SPM', 666, 508, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(183, 'VC', 'SAINT VINCENT AND THE GRENADINES', 'Saint Vincent and the Grenadines', 'VCT', 670, 1784, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(184, 'WS', 'SAMOA', 'Samoa', 'WSM', 882, 684, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(185, 'SM', 'SAN MARINO', 'San Marino', 'SMR', 674, 378, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(186, 'ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678, 239, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(187, 'SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682, 966, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(188, 'SN', 'SENEGAL', 'Senegal', 'SEN', 686, 221, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(189, 'CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', 'NUL', 0, 381, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(190, 'SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690, 248, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(191, 'SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694, 232, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(192, 'SG', 'SINGAPORE', 'Singapore', 'SGP', 702, 65, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(193, 'SK', 'SLOVAKIA', 'Slovakia', 'SVK', 703, 421, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(194, 'SI', 'SLOVENIA', 'Slovenia', 'SVN', 705, 386, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(195, 'SB', 'SOLOMON ISLANDS', 'Solomon Islands', 'SLB', 90, 677, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(196, 'SO', 'SOMALIA', 'Somalia', 'SOM', 706, 252, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(197, 'ZA', 'SOUTH AFRICA', 'South Africa', 'ZAF', 710, 27, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(198, 'GS', 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'South Georgia and the South Sandwich Islands', 'NUL', 0, 0, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(199, 'ES', 'SPAIN', 'Spain', 'ESP', 724, 34, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(200, 'LK', 'SRI LANKA', 'Sri Lanka', 'LKA', 144, 94, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(201, 'SD', 'SUDAN', 'Sudan', 'SDN', 736, 249, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(202, 'SR', 'SURINAME', 'Suriname', 'SUR', 740, 597, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(203, 'SJ', 'SVALBARD AND JAN MAYEN', 'Svalbard and Jan Mayen', 'SJM', 744, 47, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(204, 'SZ', 'SWAZILAND', 'Swaziland', 'SWZ', 748, 268, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(205, 'SE', 'SWEDEN', 'Sweden', 'SWE', 752, 46, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(206, 'CH', 'SWITZERLAND', 'Switzerland', 'CHE', 756, 41, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(207, 'SY', 'SYRIAN ARAB REPUBLIC', 'Syrian Arab Republic', 'SYR', 760, 963, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(208, 'TW', 'TAIWAN, PROVINCE OF CHINA', 'Taiwan, Province of China', 'TWN', 158, 886, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(209, 'TJ', 'TAJIKISTAN', 'Tajikistan', 'TJK', 762, 992, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(210, 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 'Tanzania, United Republic of', 'TZA', 834, 255, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(211, 'TH', 'THAILAND', 'Thailand', 'THA', 764, 66, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(212, 'TL', 'TIMOR-LESTE', 'Timor-Leste', 'NUL', 0, 670, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(213, 'TG', 'TOGO', 'Togo', 'TGO', 768, 228, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(214, 'TK', 'TOKELAU', 'Tokelau', 'TKL', 772, 690, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(215, 'TO', 'TONGA', 'Tonga', 'TON', 776, 676, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(216, 'TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780, 1868, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(217, 'TN', 'TUNISIA', 'Tunisia', 'TUN', 788, 216, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(218, 'TR', 'TURKEY', 'Turkey', 'TUR', 792, 90, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(219, 'TM', 'TURKMENISTAN', 'Turkmenistan', 'TKM', 795, 7370, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(220, 'TC', 'TURKS AND CAICOS ISLANDS', 'Turks and Caicos Islands', 'TCA', 796, 1649, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(221, 'TV', 'TUVALU', 'Tuvalu', 'TUV', 798, 688, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(222, 'UG', 'UGANDA', 'Uganda', 'UGA', 800, 256, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(223, 'UA', 'UKRAINE', 'Ukraine', 'UKR', 804, 380, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(224, 'AE', 'UNITED ARAB EMIRATES', 'United Arab Emirates', 'ARE', 784, 971, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(225, 'GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826, 44, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(226, 'US', 'UNITED STATES', 'United States', 'USA', 840, 1, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(227, 'UM', 'UNITED STATES MINOR OUTLYING ISLANDS', 'United States Minor Outlying Islands', 'NUL', 0, 1, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(228, 'UY', 'URUGUAY', 'Uruguay', 'URY', 858, 598, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(229, 'UZ', 'UZBEKISTAN', 'Uzbekistan', 'UZB', 860, 998, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(230, 'VU', 'VANUATU', 'Vanuatu', 'VUT', 548, 678, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(231, 'VE', 'VENEZUELA', 'Venezuela', 'VEN', 862, 58, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(232, 'VN', 'VIET NAM', 'Viet Nam', 'VNM', 704, 84, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(233, 'VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', 92, 1284, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(234, 'VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', 850, 1340, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(235, 'WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', 876, 681, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(236, 'EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732, 212, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(237, 'YE', 'YEMEN', 'Yemen', 'YEM', 887, 967, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(238, 'ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894, 260, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(239, 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716, 263, '2016-12-13 03:19:47', '2016-12-13 03:19:47'); -- -------------------------------------------------------- @@ -540,9 +519,9 @@ CREATE TABLE IF NOT EXISTS `department` ( -- INSERT INTO `department` (`id`, `name`, `type`, `sla`, `manager`, `ticket_assignment`, `outgoing_email`, `template_set`, `auto_ticket_response`, `auto_message_response`, `auto_response_email`, `recipient`, `group_access`, `department_sign`, `created_at`, `updated_at`) VALUES -(1, 'Support', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-11-29 23:28:15', '2016-11-29 23:28:15'), -(2, 'Sales', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-11-29 23:28:15', '2016-11-29 23:28:15'), -(3, 'Operation', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-11-29 23:28:15', '2016-11-29 23:28:15'); +(1, 'Support', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(2, 'Sales', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-12-13 03:19:28', '2016-12-13 03:19:28'), +(3, 'Operation', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-12-13 03:19:28', '2016-12-13 03:19:28'); -- -------------------------------------------------------- @@ -658,29 +637,6 @@ CREATE TABLE IF NOT EXISTS `field_values` ( -- -------------------------------------------------------- --- --- Table structure for table `followup` --- - -CREATE TABLE IF NOT EXISTS `followup` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `condition` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; - --- --- Dumping data for table `followup` --- - -INSERT INTO `followup` (`id`, `name`, `status`, `condition`, `created_at`, `updated_at`) VALUES -(1, 'followup', '', '', '2016-11-29 23:28:11', '2016-11-29 23:28:11'); - --- -------------------------------------------------------- - -- -- Table structure for table `groups` -- @@ -712,9 +668,9 @@ CREATE TABLE IF NOT EXISTS `groups` ( -- INSERT INTO `groups` (`id`, `name`, `group_status`, `can_create_ticket`, `can_edit_ticket`, `can_post_ticket`, `can_close_ticket`, `can_assign_ticket`, `can_transfer_ticket`, `can_delete_ticket`, `can_ban_email`, `can_manage_canned`, `can_manage_faq`, `can_view_agent_stats`, `department_access`, `admin_notes`, `created_at`, `updated_at`) VALUES -(1, 'Group A', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(2, 'Group B', 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(3, 'Group C', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'); +(1, 'Group A', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(2, 'Group B', 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(3, 'Group C', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'); -- -------------------------------------------------------- @@ -771,9 +727,9 @@ CREATE TABLE IF NOT EXISTS `help_topic` ( -- INSERT INTO `help_topic` (`id`, `topic`, `parent_topic`, `custom_form`, `department`, `ticket_status`, `priority`, `sla_plan`, `thank_page`, `ticket_num_format`, `internal_notes`, `status`, `type`, `auto_assign`, `auto_response`, `created_at`, `updated_at`) VALUES -(1, 'Support query', '', NULL, 1, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-11-29 23:28:15', '2016-11-29 23:28:15'), -(2, 'Sales query', '', NULL, 2, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-11-29 23:28:16', '2016-11-29 23:45:44'), -(3, 'Operational query', '', NULL, 3, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-11-29 23:28:16', '2016-11-29 23:45:54'); +(1, 'Support query', '', NULL, 1, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-12-13 03:19:28', '2016-12-13 03:19:28'), +(2, 'Sales query', '', NULL, 2, 1, 2, 1, '', '1', '', 0, 1, NULL, 0, '2016-12-13 03:19:28', '2016-12-13 03:19:28'), +(3, 'Operational query', '', NULL, 3, 1, 2, 1, '', '1', '', 0, 1, NULL, 0, '2016-12-13 03:19:28', '2016-12-13 03:19:28'); -- -------------------------------------------------------- @@ -792,8 +748,7 @@ CREATE TABLE IF NOT EXISTS `jobs` ( `created_at` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_reserved_reserved_at_index` (`queue`,`reserved`,`reserved_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=17 ; - +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -819,13 +774,13 @@ CREATE TABLE IF NOT EXISTS `kb_article` ( -- INSERT INTO `kb_article` (`id`, `name`, `slug`, `description`, `status`, `type`, `publish_time`, `created_at`, `updated_at`) VALUES -(1, 'DISCLAIMERS', 'disclaimers', '

ABC clothing.com does not promise that the site will be inoffensive, error-free or uninterrupted, or that it will provide specific information from use of the site or any content, search, or link on it. The site and its content are delivered on an “as-is” and “as-available” basis. ABC clothing.com cannot ensure that files you download from the site will be free of viruses or contamination or destructive features.

\r\n\r\n

Thebclothing.com disclaims all warranties, express or implied, including any implied warranties of merchantability and fitness for a particular purpose. ABC clothing.com will not be liable for any damages of any kind arising from the use of this site, including, without limitation, direct, indirect, incidental, and punitive and consequential damages.

\r\n\r\n

ABC clothing.com disclaims any and all liability for the acts, omissions, and conduct of any third-party users, ABC clothing.com users, advertisers, and/or sponsors on the Site, in connection with the Site, or other-wise related to your use of the Site. ABC clothing.com is not responsible for the products, services, actions, or failure to act of any third party in connection with or referenced on the Site. Without limiting the fore-going, you may report the misconduct of users and/or third-party advertisers or service and/or product providers referenced on or included in the Site to ABC clothing.com at Support@abcclothing.com

\r\n\r\n

ABC clothing.com may investigate the claim and take appropriate action, at its sole discretion.

\r\n\r\n

For any query kindly drop mail us on  Support@abcclothing.com.

\r\n', 1, 1, '2016-11-30 05:32:00', '2016-11-30 00:03:45', '2016-11-30 00:03:45'), -(2, 'CUSTOM ORDER', 'custom-order', '

You saw, you liked but couldn’t see your size? We will custom make it for you.

\r\n\r\n

How it works:

\r\n\r\n
  1. You liked something and want to modify a little or have something else on mind, do pen it down and share it with us on Support@abcclothing.com
  2. \r\n
  3. We’ll work out the price depending on how detailed or intricate you want your garment.
  4. \r\n
  5. An advance would be required for any customized orders.
  6. \r\n
  7. Once you’ve placed a deposit, we’ll make you a sketch of the garment.
  8. \r\n
  9. We can complete your order in 15-20 days depending on the workload.
  10. \r\n
  11. We will also share some updates on the garment in case something needs to be changed.
  12. \r\n
  13. We finally ship it to your given address.
  14. \r\n

Note: No returns and refunds.

\r\n', 1, 1, '2016-11-30 05:34:00', '2016-11-30 00:04:57', '2016-11-30 00:04:57'), -(3, 'TROUSER SKIRTS', 'trouser-skirts', '

Paris takes its fashion very, very seriously. So seriously, in fact, that wearing the wrong thing has actually caused a riot.

\r\n\r\n

In 1911, two rival Parisian couture houses launched their "trouser skirts," an innovation in fashion that trod the very fixed line between the genders and seemed to promise greater flexibility for women in general. There were two different versions of the trouser skirt: One was a sort of baggy pant with a very low hanging crotch, described as "a sack with holes made for the legs to go through," not unlike the fashions on high streets today, and the other a pair of the same kind of pants topped with an over-skirt, again, not unlike high street fashions of today. Both versions were launched by models at the opening day of racing season to general revulsion and disgust, but thankfully, no violence.

\r\n\r\n

It wasn''t until the ladies attempted to promenade their future fashions on the boulevards that the fisticuffs started—at the Place de l''Opera, the poor models were attacked by a jeering mob of fashion Philistines, who pulled their hair, trampled their hats, and reduced them to tears. A squad of police officers on bicycles were dispatched to rescue the girls and escort them to safety.

\r\n', 1, 1, '2016-11-30 05:35:00', '2016-11-30 00:05:53', '2016-11-30 00:05:53'), -(4, 'SECURE SHOPPING GUARANTEE', 'secure-shopping-guarantee', '

We accept all major Indian and International Credit/ Debit Cards, and Net Banking with over 40 Banks.

\r\n\r\n

NO Cash on Delivery (as random people order and share false addresses for fun)

\r\n\r\n

Yes, shopping at our e-store is 100% safe. All payment requests are directed to the secured PayU Payment Gateway. This gives you the highest level of protection possible whenever you use credit cards or make other financial or confidential transactions over the Internet.

\r\n\r\n

You can be assured that our e-store offers you the highest standards of security currently available on the net so as to ensure that your shopping experience is private, safe and secure.

\r\n', 1, 1, '2016-11-30 05:36:00', '2016-11-30 00:06:39', '2016-11-30 00:06:39'), -(5, 'PRIVACY POLICY', 'privacy-policy', '

The ABC Clothing collects your basic information to service your requests. This basic information is gathered when you purchase products/Gift card vouchers or when you sign up for e-mail notifications. Information gathered from you includes your name, mailing address, e-mail and phone number. Only when you place an order, your card information is requested and is submitted via the highest level of encryption to make sure of the greatest amount of safety and security. Reason why we gather this information:

\r\n\r\n

To process your order.
\r\nShipping and Customer Service.
\r\nWe also use the information to upgrade our products, customer services, website content and navigation.

\r\n\r\n


Internal Record Keeping.
\r\nWe at The ABC Clothing respect that you do not want your personal information shared with other companies. The information you provide shall, therefore, be only used to process your order and customer support. The ABC Clothing does not share, sell or rent customer information to any other company.

\r\n', 1, 1, '2016-11-30 05:36:00', '2016-11-30 00:07:18', '2016-11-30 00:07:18'), -(6, ' SHIPPING POLICY', 'shipping-policy', '

We ship worldwide. We use FedEx/DTDC for shipping.

\r\n\r\n

Standard Shipping is usually 3-7 Working days for orders within India and 12-15 Working days for International Orders, but usually faster. IF your order doesn’t reach you in time, you may write to us at support@abcclothing.com

\r\n\r\n

International Orders

\r\n\r\n

For international orders, please note, your shipping will be calculated at the time of Check out only, this is a System Generated amount, based on your Zip Code, Region and Order Weight. (Approx Costs Rs.1250-1500 for 500 gms – International Shipment, subject to region)

\r\n\r\n

Tracking

\r\n\r\n

For tracking your order go to the following website, it will require your tracking ID which is sent via mail in your invoice.

\r\n', 1, 1, '2016-11-30 05:37:00', '2016-11-30 00:08:01', '2016-11-30 00:08:01'), -(7, 'RETURN & CANCELLATION', 'return-cancellation', '

Size doesn’t fit you or the Apparel/ Product is damaged/ defective can be returned in its original packing within 7 days of delivery. Once we have verified the damage, defect and/or error, you shall receive a replacement or a full refund for the Product in the original means of payment.

\r\n\r\n


\r\nThe B Clothing reserves the right to refuse a payment on a return of product purchased from www.thebclothing.com if the product is not received in its original condition, or is received damaged or has been used. All products to be returned must be notified to The B Clothing within 7 Days of receipt of your order..

\r\n\r\n


\r\nIn case of International shipments, customers may return any products that they have a size issue with if they are willing to bear the shipping costs. In case of damaged or defective products, International customers would need to send images of the product in its original packaging to support@abcclothing.com to claim a refund. Also, for damages and defects, the customer must notify ABC Clothing within 2 days of receiving the product.

\r\n\r\n


\r\nIn case of any returns that are approved, the purchase amount will be refunded to the customer within 15 business days upon receipt of return package, deducting any applicable return-processing fee.

\r\n\r\n


\r\nThe following mode of refund payments will be used:
\r\n• If online payment, then amount will be refunded online.

\r\n\r\n


\r\nAny requests for cancellation of orders placed should be made immediately by contacting support@abc clothing.com. If the order has been processed or shipped, the applicable order cancellation charges will be applied.

\r\n\r\n

 

\r\n', 1, 1, '2016-11-30 05:38:00', '2016-11-30 00:08:41', '2016-11-30 00:08:41'); +(1, 'DISCLAIMERS', 'disclaimers', '

ABC clothing.com does not promise that the site will be inoffensive, error-free or uninterrupted, or that it will provide specific information from use of the site or any content, search, or link on it. The site and its content are delivered on an “as-is” and “as-available” basis. ABC clothing.com cannot ensure that files you download from the site will be free of viruses or contamination or destructive features.

\r\n\r\n

Thebclothing.com disclaims all warranties, express or implied, including any implied warranties of merchantability and fitness for a particular purpose. ABC clothing.com will not be liable for any damages of any kind arising from the use of this site, including, without limitation, direct, indirect, incidental, and punitive and consequential damages.

\r\n\r\n

ABC clothing.com disclaims any and all liability for the acts, omissions, and conduct of any third-party users, ABC clothing.com users, advertisers, and/or sponsors on the Site, in connection with the Site, or other-wise related to your use of the Site. ABC clothing.com is not responsible for the products, services, actions, or failure to act of any third party in connection with or referenced on the Site. Without limiting the fore-going, you may report the misconduct of users and/or third-party advertisers or service and/or product providers referenced on or included in the Site to ABC clothing.com at Support@abcclothing.com

\r\n\r\n

ABC clothing.com may investigate the claim and take appropriate action, at its sole discretion.

\r\n\r\n

For any query kindly drop mail us on  Support@abcclothing.com.

\r\n', 1, 1, '2016-12-13 08:54:00', '2016-12-13 03:25:28', '2016-12-13 03:25:28'), +(2, 'CUSTOM ORDER', 'custom-order', '

You saw, you liked but couldn’t see your size? We will custom make it for you.

\r\n\r\n

How it works:

\r\n\r\n
  1. You liked something and want to modify a little or have something else on mind, do pen it down and share it with us on Support@abcclothing.com
  2. \r\n
  3. We’ll work out the price depending on how detailed or intricate you want your garment.
  4. \r\n
  5. An advance would be required for any customized orders.
  6. \r\n
  7. Once you’ve placed a deposit, we’ll make you a sketch of the garment.
  8. \r\n
  9. We can complete your order in 15-20 days depending on the workload.
  10. \r\n
  11. We will also share some updates on the garment in case something needs to be changed.
  12. \r\n
  13. We finally ship it to your given address.
  14. \r\n

Note: No returns and refunds.

\r\n', 1, 1, '2016-12-13 08:56:00', '2016-12-13 03:26:24', '2016-12-13 03:26:24'), +(3, 'TROUSER SKIRTS', 'trouser-skirts', '

Paris takes its fashion very, very seriously. So seriously, in fact, that wearing the wrong thing has actually caused a riot.

\r\n\r\n

In 1911, two rival Parisian couture houses launched their "trouser skirts," an innovation in fashion that trod the very fixed line between the genders and seemed to promise greater flexibility for women in general. There were two different versions of the trouser skirt: One was a sort of baggy pant with a very low hanging crotch, described as "a sack with holes made for the legs to go through," not unlike the fashions on high streets today, and the other a pair of the same kind of pants topped with an over-skirt, again, not unlike high street fashions of today. Both versions were launched by models at the opening day of racing season to general revulsion and disgust, but thankfully, no violence.

\r\n\r\n

It wasn''t until the ladies attempted to promenade their future fashions on the boulevards that the fisticuffs started—at the Place de l''Opera, the poor models were attacked by a jeering mob of fashion Philistines, who pulled their hair, trampled their hats, and reduced them to tears. A squad of police officers on bicycles were dispatched to rescue the girls and escort them to safety.

\r\n', 1, 1, '2016-12-13 08:56:00', '2016-12-13 03:27:02', '2016-12-13 03:27:02'), +(4, 'SECURE SHOPPING GUARANTEE', 'secure-shopping-guarantee', '

We accept all major Indian and International Credit/ Debit Cards, and Net Banking with over 40 Banks.

\r\n\r\n

NO Cash on Delivery (as random people order and share false addresses for fun)

\r\n\r\n

Yes, shopping at our e-store is 100% safe. All payment requests are directed to the secured PayU Payment Gateway. This gives you the highest level of protection possible whenever you use credit cards or make other financial or confidential transactions over the Internet.

\r\n\r\n

You can be assured that our e-store offers you the highest standards of security currently available on the net so as to ensure that your shopping experience is private, safe and secure.

\r\n', 1, 1, '2016-12-13 08:57:00', '2016-12-13 03:27:42', '2016-12-13 03:27:42'), +(5, 'PRIVACY POLICY', 'privacy-policy', '

The ABC Clothing collects your basic information to service your requests. This basic information is gathered when you purchase products/Gift card vouchers or when you sign up for e-mail notifications. Information gathered from you includes your name, mailing address, e-mail and phone number. Only when you place an order, your card information is requested and is submitted via the highest level of encryption to make sure of the greatest amount of safety and security. Reason why we gather this information:

\r\n\r\n

To process your order.
\r\nShipping and Customer Service.
\r\nWe also use the information to upgrade our products, customer services, website content and navigation.

\r\n\r\n


Internal Record Keeping.
\r\nWe at The ABC Clothing respect that you do not want your personal information shared with other companies. The information you provide shall, therefore, be only used to process your order and customer support. The ABC Clothing does not share, sell or rent customer information to any other company.

\r\n', 1, 1, '2016-12-13 08:58:00', '2016-12-13 03:28:31', '2016-12-13 03:28:31'), +(6, ' SHIPPING POLICY', 'shipping-policy', '

We ship worldwide. We use FedEx/DTDC for shipping.

\r\n\r\n

Standard Shipping is usually 3-7 Working days for orders within India and 12-15 Working days for International Orders, but usually faster. IF your order doesn’t reach you in time, you may write to us at support@abcclothing.com

\r\n\r\n

International Orders

\r\n\r\n

For international orders, please note, your shipping will be calculated at the time of Check out only, this is a System Generated amount, based on your Zip Code, Region and Order Weight. (Approx Costs Rs.1250-1500 for 500 gms – International Shipment, subject to region)

\r\n\r\n

Tracking

\r\n\r\n

For tracking your order go to the following website, it will require your tracking ID which is sent via mail in your invoice.

\r\n', 1, 1, '2016-12-13 08:58:00', '2016-12-13 03:29:34', '2016-12-13 03:29:34'), +(7, 'RETURN & CANCELLATION', 'return-cancellation', '

Size doesn’t fit you or the Apparel/ Product is damaged/ defective can be returned in its original packing within 7 days of delivery. Once we have verified the damage, defect and/or error, you shall receive a replacement or a full refund for the Product in the original means of payment.

\r\n\r\n


\r\nThe B Clothing reserves the right to refuse a payment on a return of product purchased from www.thebclothing.com if the product is not received in its original condition, or is received damaged or has been used. All products to be returned must be notified to The B Clothing within 7 Days of receipt of your order..

\r\n\r\n


\r\nIn case of International shipments, customers may return any products that they have a size issue with if they are willing to bear the shipping costs. In case of damaged or defective products, International customers would need to send images of the product in its original packaging to support@abcclothing.com to claim a refund. Also, for damages and defects, the customer must notify ABC Clothing within 2 days of receiving the product.

\r\n\r\n


\r\nIn case of any returns that are approved, the purchase amount will be refunded to the customer within 15 business days upon receipt of return package, deducting any applicable return-processing fee.

\r\n\r\n


\r\nThe following mode of refund payments will be used:
\r\n• If online payment, then amount will be refunded online.

\r\n\r\n


\r\nAny requests for cancellation of orders placed should be made immediately by contacting support@abc clothing.com. If the order has been processed or shipped, the applicable order cancellation charges will be applied.

\r\n\r\n

 

\r\n', 1, 1, '2016-12-13 08:59:00', '2016-12-13 03:30:14', '2016-12-13 03:30:14'); -- -------------------------------------------------------- @@ -880,8 +835,8 @@ CREATE TABLE IF NOT EXISTS `kb_category` ( -- INSERT INTO `kb_category` (`id`, `name`, `slug`, `description`, `status`, `parent`, `created_at`, `updated_at`) VALUES -(1, 'Issue Handeling', 'issue-handeling', 'These are the list of error handling issue.', 1, 0, '2016-11-30 00:00:34', '2016-11-30 00:00:34'), -(2, 'Policy', 'policy', 'These are the policies defined by this organization.', 1, 0, '2016-11-30 00:01:29', '2016-11-30 00:01:29'); +(1, 'Issue Handeling', 'issue-handeling', 'These are the list of error handling issue.', 1, 0, '2016-12-13 03:23:54', '2016-12-13 03:23:54'), +(2, 'Policy', 'policy', 'These are the policies defined by this organization.', 1, 0, '2016-12-13 03:24:38', '2016-12-13 03:24:38'); -- -------------------------------------------------------- @@ -940,7 +895,7 @@ CREATE TABLE IF NOT EXISTS `kb_settings` ( -- INSERT INTO `kb_settings` (`id`, `pagination`, `created_at`, `updated_at`) VALUES -(1, 10, '2016-11-29 23:28:20', '2016-11-29 23:28:20'); +(1, 10, '2016-12-13 03:19:32', '2016-12-13 03:19:32'); -- -------------------------------------------------------- @@ -992,7 +947,7 @@ CREATE TABLE IF NOT EXISTS `login_attempts` ( -- INSERT INTO `login_attempts` (`id`, `User`, `IP`, `Attempts`, `LastLogin`, `created_at`, `updated_at`) VALUES -(1, 'demo@admin.com', '::1', '2', '2016-11-30 05:56:00', '2016-11-29 23:28:47', '2016-11-29 23:28:47'); +(1, '', '', '', '0000-00-00 00:00:00', '2016-12-13 03:19:53', '2016-12-13 03:19:53'); -- -------------------------------------------------------- @@ -1013,7 +968,7 @@ CREATE TABLE IF NOT EXISTS `log_notification` ( -- INSERT INTO `log_notification` (`id`, `log`, `created_at`, `updated_at`) VALUES -(1, 'NOT-1', '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 'NOT-1', '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1058,12 +1013,12 @@ CREATE TABLE IF NOT EXISTS `mail_services` ( -- INSERT INTO `mail_services` (`id`, `name`, `short_name`, `created_at`, `updated_at`) VALUES -(1, 'SMTP', 'smtp', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(2, 'Php Mail', 'mail', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(3, 'Send Mail', 'sendmail', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(4, 'Mailgun', 'mailgun', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(5, 'Mandrill', 'mandrill', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(6, 'Log file', 'log', '2016-11-29 23:27:50', '2016-11-29 23:27:50'); +(1, 'SMTP', 'smtp', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(2, 'Php Mail', 'mail', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(3, 'Send Mail', 'sendmail', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(4, 'Mailgun', 'mailgun', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(5, 'Mandrill', 'mandrill', '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(6, 'Log file', 'log', '2016-12-13 03:19:09', '2016-12-13 03:19:09'); -- -------------------------------------------------------- @@ -1178,8 +1133,7 @@ INSERT INTO `migrations` (`migration`, `batch`) VALUES ('2016_08_08_095744_create_social_media_table', 1), ('2016_08_12_104410_create_user_additional_infos_table', 1), ('2016_08_16_104539_alter_ticket_source_table', 1), -('2016_08_31_223407_create_approval_table', 1), -('2016_09_02_165516_create_follow_up_table', 1); +('2016_11_30_122809_alter_attachment_table', 2); -- -------------------------------------------------------- @@ -1195,19 +1149,20 @@ CREATE TABLE IF NOT EXISTS `notifications` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `notifications` -- INSERT INTO `notifications` (`id`, `model_id`, `userid_created`, `type_id`, `created_at`, `updated_at`) VALUES -(1, 1, 2, 3, '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(2, 2, 2, 3, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(3, 3, 3, 3, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(4, 4, 3, 3, '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(5, 5, 3, 3, '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(6, 4, 1, 2, '2016-11-30 00:28:23', '2016-11-30 00:28:23'); +(1, 1, 4, 3, '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(2, 2, 5, 3, '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(3, 3, 6, 3, '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(4, 4, 7, 3, '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(5, 4, 1, 2, '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(6, 5, 7, 3, '2016-12-13 04:02:49', '2016-12-13 04:02:49'), +(7, 6, 5, 3, '2016-12-13 04:03:44', '2016-12-13 04:03:44'); -- -------------------------------------------------------- @@ -1230,9 +1185,9 @@ CREATE TABLE IF NOT EXISTS `notification_types` ( -- INSERT INTO `notification_types` (`id`, `message`, `type`, `icon_class`, `created_at`, `updated_at`) VALUES -(1, 'A new user is registered', 'registration', 'fa fa-user', '2016-11-29 23:27:57', '2016-11-29 23:27:57'), -(2, 'You have a new reply on this ticket', 'reply', 'fa fa-envelope', '2016-11-29 23:27:58', '2016-11-29 23:27:58'), -(3, 'A new ticket has been created', 'new_ticket', 'fa fa-envelope', '2016-11-29 23:27:58', '2016-11-29 23:27:58'); +(1, 'A new user is registered', 'registration', 'fa fa-user', '2016-12-13 03:19:14', '2016-12-13 03:19:14'), +(2, 'You have a new reply on this ticket', 'reply', 'fa fa-envelope', '2016-12-13 03:19:14', '2016-12-13 03:19:14'), +(3, 'A new ticket has been created', 'new_ticket', 'fa fa-envelope', '2016-12-13 03:19:14', '2016-12-13 03:19:14'); -- -------------------------------------------------------- @@ -1305,12 +1260,12 @@ CREATE TABLE IF NOT EXISTS `queue_services` ( -- INSERT INTO `queue_services` (`id`, `name`, `short_name`, `status`, `created_at`, `updated_at`) VALUES -(1, 'Sync', 'sync', 1, '2016-11-29 23:27:51', '2016-11-29 23:27:51'), -(2, 'Database', 'database', 0, '2016-11-29 23:27:51', '2016-11-29 23:27:52'), -(3, 'Beanstalkd', 'beanstalkd', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'), -(4, 'SQS', 'sqs', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'), -(5, 'Iron', 'iron', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'), -(6, 'Redis', 'redis', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'); +(1, 'Sync', 'sync', 1, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(2, 'Database', 'database', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(3, 'Beanstalkd', 'beanstalkd', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(4, 'SQS', 'sqs', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(5, 'Iron', 'iron', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(6, 'Redis', 'redis', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'); -- -------------------------------------------------------- @@ -1336,8 +1291,8 @@ CREATE TABLE IF NOT EXISTS `ratings` ( -- INSERT INTO `ratings` (`id`, `name`, `display_order`, `allow_modification`, `rating_scale`, `rating_area`, `restrict`, `created_at`, `updated_at`) VALUES -(1, 'OverAll Satisfaction', 1, 1, 5, 'Helpdesk Area', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(2, 'Reply Rating', 1, 1, 5, 'Comment Area', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'); +(1, 'OverAll Satisfaction', 1, 1, 5, 'Helpdesk Area', '', '2016-12-13 03:19:53', '2016-12-13 03:19:53'), +(2, 'Reply Rating', 1, 1, 5, 'Comment Area', '', '2016-12-13 03:19:53', '2016-12-13 03:19:53'); -- -------------------------------------------------------- @@ -1403,7 +1358,7 @@ CREATE TABLE IF NOT EXISTS `settings_alert_notice` ( -- INSERT INTO `settings_alert_notice` (`id`, `ticket_status`, `ticket_admin_email`, `ticket_department_manager`, `ticket_department_member`, `ticket_organization_accmanager`, `message_status`, `message_last_responder`, `message_assigned_agent`, `message_department_manager`, `message_organization_accmanager`, `internal_status`, `internal_last_responder`, `internal_assigned_agent`, `internal_department_manager`, `assignment_status`, `assignment_assigned_agent`, `assignment_team_leader`, `assignment_team_member`, `transfer_status`, `transfer_assigned_agent`, `transfer_department_manager`, `transfer_department_member`, `overdue_status`, `overdue_assigned_agent`, `overdue_department_manager`, `overdue_department_member`, `system_error`, `sql_error`, `excessive_failure`, `created_at`, `updated_at`) VALUES -(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1428,7 +1383,7 @@ CREATE TABLE IF NOT EXISTS `settings_auto_response` ( -- INSERT INTO `settings_auto_response` (`id`, `new_ticket`, `agent_new_ticket`, `submitter`, `participants`, `overlimit`, `created_at`, `updated_at`) VALUES -(1, 1, 1, 0, 0, 0, '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 1, 1, 0, 0, 0, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1457,7 +1412,7 @@ CREATE TABLE IF NOT EXISTS `settings_company` ( -- INSERT INTO `settings_company` (`id`, `company_name`, `website`, `phone`, `address`, `landing_page`, `offline_page`, `thank_page`, `logo`, `use_logo`, `created_at`, `updated_at`) VALUES -(1, 'ABC cloth Company', '', '', '', '', '', '', '2530.logo.png', '0', '2016-11-29 23:28:16', '2016-11-30 00:30:47'); +(1, 'ABC Clothing', '', '', '', '', '', '', '', '0', '2016-12-13 03:19:29', '2016-12-13 03:30:41'); -- -------------------------------------------------------- @@ -1489,7 +1444,7 @@ CREATE TABLE IF NOT EXISTS `settings_email` ( -- INSERT INTO `settings_email` (`id`, `template`, `sys_email`, `alert_email`, `admin_email`, `mta`, `email_fetching`, `notification_cron`, `strip`, `separator`, `all_emails`, `email_collaborator`, `attachment`, `created_at`, `updated_at`) VALUES -(1, 'default', NULL, '', '', '', 1, 1, 0, 0, 1, 1, 1, '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 'default', NULL, '', '', '', 1, 1, 0, 0, 1, 1, 1, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1532,7 +1487,7 @@ CREATE TABLE IF NOT EXISTS `settings_security` ( -- INSERT INTO `settings_security` (`id`, `lockout_message`, `backlist_offender`, `backlist_threshold`, `lockout_period`, `days_to_keep_logs`, `created_at`, `updated_at`) VALUES -(1, 'You have been locked out of application due to too many failed login attempts.', 0, 15, 15, 0, '2016-11-29 23:28:42', '2016-11-29 23:28:42'); +(1, 'You have been locked out of application due to too many failed login attempts.', 0, 15, 15, 0, '2016-12-13 03:19:47', '2016-12-13 03:19:47'); -- -------------------------------------------------------- @@ -1574,8 +1529,8 @@ CREATE TABLE IF NOT EXISTS `settings_system` ( -- INSERT INTO `settings_system` (`id`, `status`, `url`, `name`, `department`, `page_size`, `log_level`, `purge_log`, `api_enable`, `api_key_mandatory`, `api_key`, `name_format`, `time_farmat`, `date_format`, `date_time_format`, `day_date_time`, `time_zone`, `content`, `version`, `created_at`, `updated_at`) VALUES -(1, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 32, '', '', '2016-11-29 23:28:16', '2016-11-29 23:28:16'), -(2, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 79, '', '1.0.8.0', '2016-11-29 23:28:47', '2016-11-29 23:28:47'); +(1, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 32, '', '', '2016-12-13 03:19:29', '2016-12-13 03:19:29'), +(2, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 79, '', '1.0.8.0', '2016-12-13 03:19:53', '2016-12-13 03:19:53'); -- -------------------------------------------------------- @@ -1612,7 +1567,7 @@ CREATE TABLE IF NOT EXISTS `settings_ticket` ( -- INSERT INTO `settings_ticket` (`id`, `num_format`, `num_sequence`, `priority`, `sla`, `help_topic`, `max_open_ticket`, `collision_avoid`, `lock_ticket_frequency`, `captcha`, `status`, `claim_response`, `assigned_ticket`, `answered_ticket`, `agent_mask`, `html`, `client_update`, `max_file_size`, `created_at`, `updated_at`) VALUES -(1, '$$$$-####-####', 'sequence', '1', '2', '1', '', '2', '0', '', 1, 0, 0, 0, 0, 0, 0, 0, '2016-11-29 23:28:17', '2016-11-29 23:28:17'); +(1, '$$$$-####-####', 'sequence', '1', '2', '1', '', '2', '0', '', 1, 0, 0, 0, 0, 0, 0, 0, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1638,9 +1593,9 @@ CREATE TABLE IF NOT EXISTS `sla_plan` ( -- INSERT INTO `sla_plan` (`id`, `name`, `grace_period`, `admin_note`, `status`, `transient`, `ticket_overdue`, `created_at`, `updated_at`) VALUES -(1, 'Sla 1', '6 Hours', '', 1, 0, 0, '2016-11-29 23:28:11', '2016-11-29 23:28:11'), -(2, 'Sla 2', '12 Hours', '', 1, 0, 0, '2016-11-29 23:28:11', '2016-11-29 23:28:11'), -(3, 'Sla 3', '24 Hours', '', 1, 0, 0, '2016-11-29 23:28:12', '2016-11-29 23:28:12'); +(1, 'Sla 1', '6 Hours', '', 1, 0, 0, '2016-12-13 03:19:25', '2016-12-13 03:19:25'), +(2, 'Sla 2', '12 Hours', '', 1, 0, 0, '2016-12-13 03:19:25', '2016-12-13 03:19:25'), +(3, 'Sla 3', '24 Hours', '', 1, 0, 0, '2016-12-13 03:19:25', '2016-12-13 03:19:25'); -- -------------------------------------------------------- @@ -1682,9 +1637,9 @@ CREATE TABLE IF NOT EXISTS `teams` ( -- INSERT INTO `teams` (`id`, `name`, `status`, `team_lead`, `assign_alert`, `admin_notes`, `created_at`, `updated_at`) VALUES -(1, 'Level 1 Support', 1, NULL, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(2, 'Level 2 Support', 0, NULL, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(3, 'Developer', 0, NULL, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'); +(1, 'Level 1 Support', 1, NULL, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(2, 'Level 2 Support', 0, NULL, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(3, 'Developer', 0, NULL, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'); -- -------------------------------------------------------- @@ -1701,16 +1656,15 @@ CREATE TABLE IF NOT EXISTS `team_assign_agent` ( PRIMARY KEY (`id`), KEY `team_id` (`team_id`), KEY `agent_id` (`agent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `team_assign_agent` -- INSERT INTO `team_assign_agent` (`id`, `team_id`, `agent_id`, `created_at`, `updated_at`) VALUES -(1, 1, 4, NULL, NULL), -(2, 1, 5, NULL, NULL), -(3, 2, 5, NULL, NULL); +(1, 1, 2, NULL, NULL), +(2, 1, 3, NULL, NULL); -- -------------------------------------------------------- @@ -1755,19 +1709,19 @@ CREATE TABLE IF NOT EXISTS `templates` ( -- INSERT INTO `templates` (`id`, `name`, `variable`, `type`, `subject`, `message`, `description`, `set_id`, `created_at`, `updated_at`) VALUES -(1, 'This template is for sending notice to agent when ticket is assigned to them', '0', 1, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to you by {!!$ticket_assigner!!}
Please check and resppond on the ticket.
Link: {!!$ticket_link!!}

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(2, 'This template is for sending notice to client with ticket link to check ticket without logging in to system', '1', 2, 'Check your Ticket', '
Hello {!!$user!!},

Click the link below to view your requested ticket
{!!$ticket_link_with_number!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(3, 'This template is for sending notice to client when ticket status is changed to close', '0', 3, '', '
Hello,

This message is regarding your ticket ID {!!$ticket_number!!}. We are changing the status of this ticket to "Closed" as the issue appears to be resolved.

Thank you
Kind regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(4, 'This template is for sending notice to client on successful ticket creation', '0', 4, '', '
Hello {!!$user!!}

Thank you for contacting us. This is an automated response confirming the receipt of your ticket. Our team will get back to you as soon as possible. When replying, please make sure that the ticket ID is kept in the subject so that we can track your replies.

Ticket ID: {!!$ticket_number!!} 

{!!$department_sign!!}
You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(5, 'This template is for sending notice to agent on new ticket creation', '0', 5, '', '
Hello {!!$ticket_agent_name!!},

New ticket {!!$ticket_number!!}created 

From
Name: {!!$ticket_client_name!!}   
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(6, 'This template is for sending notice to client on new ticket created by agent in name of client', '0', 6, '', '
{!!$content!!}

{!!$agent_sign!!}

You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(7, 'This template is for sending notice to client on new registration during new ticket creation for un registered clients', '1', 7, 'Registration Confirmation', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Password: {!!$user_password!!}

You can visit the helpdesk to browse articles and contact us at any time: {!!$system_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(8, 'This template is for sending notice to any user about reset password option', '1', 8, 'Reset your Password', 'Hello {!!$user!!},

You asked to reset your password. To do so, please click this link:

{!!$password_reset_link!!}

This will let you change your password to something new. If you didn''t ask for this, don''t worry, we''ll keep your password safe.

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(9, 'This template is for sending notice to client when a reply made to his/her ticket', '0', 9, '', '

{!!$content!!}

{!!$agent_sign!!} 

Ticket Details

Ticket ID: {!!$ticket_number!!}

', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(10, 'This template is for sending notice to agent when ticket reply is made by client on a ticket', '0', 10, '', '
Hello {!!$ticket_agent_name!!},

A reply been made to ticket {!!$ticket_number!!}

From
Name: {!!$ticket_client_name!!}
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(11, 'This template is for sending notice to client about registration confirmation link', '1', 11, 'Verify your email address', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Please click on the below link to activate your account and Login to the system {!!$password_reset_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(12, 'This template is for sending notice to team when ticket is assigned to team', '1', 12, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to your team : {!!$team!!} by {!!$ticket_assigner!!} 

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(13, 'This template is for sending notice to client when password is changed', '1', 13, 'Verify your email address', 'Hello {!!$user!!},

Your password is successfully changed.Your new password is : {!!$user_password!!}

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-11-29 23:28:46', '2016-11-29 23:28:46'); +(1, 'This template is for sending notice to agent when ticket is assigned to them', '0', 1, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to you by {!!$ticket_assigner!!}
Please check and resppond on the ticket.
Link: {!!$ticket_link!!}

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:50', '2016-12-13 03:19:50'), +(2, 'This template is for sending notice to client with ticket link to check ticket without logging in to system', '1', 2, 'Check your Ticket', '
Hello {!!$user!!},

Click the link below to view your requested ticket
{!!$ticket_link_with_number!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:50', '2016-12-13 03:19:50'), +(3, 'This template is for sending notice to client when ticket status is changed to close', '0', 3, '', '
Hello,

This message is regarding your ticket ID {!!$ticket_number!!}. We are changing the status of this ticket to "Closed" as the issue appears to be resolved.

Thank you
Kind regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:50', '2016-12-13 03:19:50'), +(4, 'This template is for sending notice to client on successful ticket creation', '0', 4, '', '
Hello {!!$user!!}

Thank you for contacting us. This is an automated response confirming the receipt of your ticket. Our team will get back to you as soon as possible. When replying, please make sure that the ticket ID is kept in the subject so that we can track your replies.

Ticket ID: {!!$ticket_number!!} 

{!!$department_sign!!}
You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(5, 'This template is for sending notice to agent on new ticket creation', '0', 5, '', '
Hello {!!$ticket_agent_name!!},

New ticket {!!$ticket_number!!}created 

From
Name: {!!$ticket_client_name!!}   
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(6, 'This template is for sending notice to client on new ticket created by agent in name of client', '0', 6, '', '
{!!$content!!}

{!!$agent_sign!!}

You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(7, 'This template is for sending notice to client on new registration during new ticket creation for un registered clients', '1', 7, 'Registration Confirmation', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Password: {!!$user_password!!}

You can visit the helpdesk to browse articles and contact us at any time: {!!$system_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(8, 'This template is for sending notice to any user about reset password option', '1', 8, 'Reset your Password', 'Hello {!!$user!!},

You asked to reset your password. To do so, please click this link:

{!!$password_reset_link!!}

This will let you change your password to something new. If you didn''t ask for this, don''t worry, we''ll keep your password safe.

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(9, 'This template is for sending notice to client when a reply made to his/her ticket', '0', 9, '', '

{!!$content!!}

{!!$agent_sign!!} 

Ticket Details

Ticket ID: {!!$ticket_number!!}

', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(10, 'This template is for sending notice to agent when ticket reply is made by client on a ticket', '0', 10, '', '
Hello {!!$ticket_agent_name!!},

A reply been made to ticket {!!$ticket_number!!}

From
Name: {!!$ticket_client_name!!}
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(11, 'This template is for sending notice to client about registration confirmation link', '1', 11, 'Verify your email address', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Please click on the below link to activate your account and Login to the system {!!$password_reset_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(12, 'This template is for sending notice to team when ticket is assigned to team', '1', 12, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to your team : {!!$team!!} by {!!$ticket_assigner!!} 

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(13, 'This template is for sending notice to client when password is changed', '1', 13, 'Verify your email address', 'Hello {!!$user!!},

Your password is successfully changed.Your new password is : {!!$user_password!!}

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-12-13 03:19:52', '2016-12-13 03:19:52'); -- -------------------------------------------------------- @@ -1789,7 +1743,7 @@ CREATE TABLE IF NOT EXISTS `template_sets` ( -- INSERT INTO `template_sets` (`id`, `name`, `active`, `created_at`, `updated_at`) VALUES -(1, 'default', 1, '2016-11-29 23:28:42', '2016-11-29 23:28:42'); +(1, 'default', 1, '2016-12-13 03:19:47', '2016-12-13 03:19:47'); -- -------------------------------------------------------- @@ -1810,19 +1764,19 @@ CREATE TABLE IF NOT EXISTS `template_types` ( -- INSERT INTO `template_types` (`id`, `name`, `created_at`, `updated_at`) VALUES -(1, 'assign-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(2, 'check-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(3, 'close-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(4, 'create-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(5, 'create-ticket-agent', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(6, 'create-ticket-by-agent', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(7, 'registration-notification', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(8, 'reset-password', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(9, 'ticket-reply', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(10, 'ticket-reply-agent', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(11, 'registration', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(12, 'team_assign_ticket', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(13, 'reset_new_password', '2016-11-29 23:28:43', '2016-11-29 23:28:43'); +(1, 'assign-ticket', '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(2, 'check-ticket', '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(3, 'close-ticket', '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(4, 'create-ticket', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(5, 'create-ticket-agent', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(6, 'create-ticket-by-agent', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(7, 'registration-notification', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(8, 'reset-password', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(9, 'ticket-reply', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(10, 'ticket-reply-agent', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(11, 'registration', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(12, 'team_assign_ticket', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(13, 'reset_new_password', '2016-12-13 03:19:48', '2016-12-13 03:19:48'); -- -------------------------------------------------------- @@ -1875,18 +1829,19 @@ CREATE TABLE IF NOT EXISTS `tickets` ( KEY `status` (`status`), KEY `assigned_to` (`assigned_to`), KEY `source` (`source`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; -- -- Dumping data for table `tickets` -- INSERT INTO `tickets` (`id`, `ticket_number`, `user_id`, `dept_id`, `team_id`, `priority_id`, `sla`, `help_topic_id`, `status`, `rating`, `ratingreply`, `flags`, `ip_address`, `assigned_to`, `lock_by`, `lock_at`, `source`, `isoverdue`, `reopened`, `isanswered`, `html`, `is_deleted`, `closed`, `is_transferred`, `transferred_at`, `reopened_at`, `duedate`, `closed_at`, `last_message_at`, `last_response_at`, `approval`, `follow_up`, `created_at`, `updated_at`) VALUES -(1, 'AAAA-0000-0000', 2, 1, NULL, 1, 1, 1, 1, 0, 0, 0, 0, 4, 0, NULL, 3, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:46:00', NULL, NULL, NULL, 0, 0, '2016-11-30 00:16:00', '2016-11-30 00:29:01'), -(2, 'AAAA-0000-0001', 2, 1, NULL, 1, 1, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:47:29', NULL, NULL, NULL, 0, 0, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(3, 'AAAA-0000-0002', 3, 1, NULL, 1, 1, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:49:15', NULL, NULL, NULL, 0, 0, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(4, 'AAAA-0000-0003', 3, 2, NULL, 1, 1, 2, 1, 0, 0, 0, 0, 1, 0, NULL, 3, 0, 0, 1, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:52:34', NULL, NULL, NULL, 0, 0, '2016-11-30 00:22:34', '2016-11-30 00:28:23'), -(5, 'AAAA-0000-0004', 3, 1, NULL, 1, 1, 1, 5, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 1, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:55:06', NULL, NULL, NULL, 0, 0, '2016-11-30 00:25:06', '2016-11-30 00:26:59'); +(1, 'AAAA-0000-0000', 4, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:15:19', NULL, NULL, NULL, 0, 0, '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(2, 'AAAA-0000-0001', 5, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:20:55', NULL, NULL, NULL, 0, 0, '2016-12-13 03:50:55', '2016-12-13 03:50:56'), +(3, 'AAAA-0000-0002', 6, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, 3, 0, NULL, 1, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:25:55', NULL, NULL, NULL, 0, 0, '2016-12-13 03:55:55', '2016-12-13 04:00:23'), +(4, 'AAAA-0000-0003', 7, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, 1, 0, NULL, 1, 0, 0, 1, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:28:40', NULL, NULL, NULL, 0, 0, '2016-12-13 03:58:40', '2016-12-13 04:01:55'), +(5, 'AAAA-0000-0004', 7, 1, NULL, 1, 1, 1, 5, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 1, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 15:32:48', NULL, NULL, NULL, 0, 0, '2016-12-13 04:02:48', '2016-12-13 04:04:04'), +(6, 'AAAA-0000-0005', 5, 1, NULL, 1, 1, 1, 5, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 1, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 15:33:44', NULL, NULL, NULL, 0, 0, '2016-12-13 04:03:44', '2016-12-13 04:04:04'); -- -------------------------------------------------------- @@ -1904,6 +1859,8 @@ CREATE TABLE IF NOT EXISTS `ticket_attachment` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `file` mediumblob, + `driver` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `thread_id` (`thread_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -1969,10 +1926,10 @@ CREATE TABLE IF NOT EXISTS `ticket_priority` ( -- INSERT INTO `ticket_priority` (`priority_id`, `priority`, `status`, `priority_desc`, `priority_color`, `priority_urgency`, `ispublic`, `is_default`, `created_at`, `updated_at`) VALUES -(1, 'Low', '1', 'Low', '#00a65a', 4, 1, '0', NULL, NULL), +(1, 'Low', '1', 'Low', '#00a65a', 4, 1, '', NULL, NULL), (2, 'Normal', '1', 'Normal', '#00bfef', 3, 1, '1', NULL, NULL), -(3, 'High', '1', 'High', '#f39c11', 2, 1, '0', NULL, NULL), -(4, 'Emergency', '1', 'Emergency', '#dd4b38', 1, 1, '0', NULL, NULL); +(3, 'High', '1', 'High', '#f39c11', 2, 1, '', NULL, NULL), +(4, 'Emergency', '1', 'Emergency', '#dd4b38', 1, 1, '', NULL, NULL); -- -------------------------------------------------------- @@ -2031,13 +1988,13 @@ CREATE TABLE IF NOT EXISTS `ticket_status` ( -- INSERT INTO `ticket_status` (`id`, `name`, `state`, `mode`, `message`, `flags`, `sort`, `email_user`, `icon_class`, `properties`, `created_at`, `updated_at`) VALUES -(1, 'Open', 'open', 3, 'Ticket have been Reopened by', 0, 1, 0, '', 'Open tickets.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(2, 'Resolved', 'closed', 1, 'Ticket have been Resolved by', 0, 2, 0, '', 'Resolved tickets.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(3, 'Closed', 'closed', 3, 'Ticket have been Closed by', 0, 3, 0, '', 'Closed tickets. Tickets will still be accessible on client and staff panels.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(4, 'Archived', 'archived', 3, 'Ticket have been Archived by', 0, 4, 0, '', 'Tickets only adminstratively available but no longer accessible on ticket queues and client panel.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(5, 'Deleted', 'deleted', 3, 'Ticket have been Deleted by', 0, 5, 0, '', 'Tickets queued for deletion. Not accessible on ticket queues.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(6, 'Unverified', 'unverified', 3, 'User account verification required.', 0, 6, 0, '', 'Ticket will be open after user verifies his/her account.', '2016-11-29 23:28:11', '2016-11-29 23:28:11'), -(7, 'Request Approval', 'unverified', 3, 'Approval requested by', 0, 7, 0, '', 'Ticket will be approve after Admin verifies this ticket', '2016-11-29 23:28:11', '2016-11-29 23:28:11'); +(1, 'Open', 'open', 3, 'Ticket have been Reopened by', 0, 1, 0, '', 'Open tickets.', '2016-12-13 03:19:23', '2016-12-13 03:19:23'), +(2, 'Resolved', 'closed', 1, 'Ticket have been Resolved by', 0, 2, 0, '', 'Resolved tickets.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(3, 'Closed', 'closed', 3, 'Ticket have been Closed by', 0, 3, 0, '', 'Closed tickets. Tickets will still be accessible on client and staff panels.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(4, 'Archived', 'archived', 3, 'Ticket have been Archived by', 0, 4, 0, '', 'Tickets only adminstratively available but no longer accessible on ticket queues and client panel.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(5, 'Deleted', 'deleted', 3, 'Ticket have been Deleted by', 0, 5, 0, '', 'Tickets queued for deletion. Not accessible on ticket queues.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(6, 'Unverified', 'unverified', 3, 'User account verification required.', 0, 6, 0, '', 'Ticket will be open after user verifies his/her account.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(7, 'Request Approval', 'unverified', 3, 'Approval requested by', 0, 7, 0, '', 'Ticket will be approve after Admin verifies this ticket', '2016-12-13 03:19:24', '2016-12-13 03:19:24'); -- -------------------------------------------------------- @@ -2064,22 +2021,24 @@ CREATE TABLE IF NOT EXISTS `ticket_thread` ( KEY `ticket_id_2` (`ticket_id`), KEY `user_id` (`user_id`), KEY `source` (`source`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ; -- -- Dumping data for table `ticket_thread` -- INSERT INTO `ticket_thread` (`id`, `ticket_id`, `user_id`, `poster`, `source`, `reply_rating`, `rating_count`, `is_internal`, `title`, `body`, `format`, `ip_address`, `created_at`, `updated_at`) VALUES -(1, 1, 2, 'client', NULL, 0, 0, 0, 'Sizing defects ', 0x506c6561736520636865636b2073697a65206f662073686972742e, '', '', '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(2, 2, 2, 'client', NULL, 0, 0, 0, 'Colour effects', 0x4869207465616d2c3c62723e3c62723e49206d20676f742077726f6e6720636f6c6f7220706c656173652072657475726e206d79206f726465722e3c62723e3c62723e3c62723e3c62723e, '', '', '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(3, 3, 3, 'client', NULL, 0, 0, 0, 'Sewing defects', 0x746869732069732064656665637420636c6f74687320706c6561736520636865636b20616e642073656e64206d6520616761696e2e, '', '', '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(4, 4, 3, 'client', NULL, 0, 0, 0, 'Garment defects', 0x4869207465616d2c3c62723e3c62723e492077616e7420746f2072657475726e206d79206361736820626563617573652069206d206e6f74207361746973667920776974682073616c652e3c62723e3c62723e3c62723e3c62723e3c62723e3c62723e3c62723e, '', '', '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(5, 5, 3, 'client', NULL, 0, 0, 0, 'Return my cash', 0x4869205465616d2c3c62723e3c62723e4920676f742064616d61676520636c6f746820706c656173652072657475726e206d79206361736820415341502e3c62723e3c62723e3c62723e, '', '', '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(6, 5, 1, '', NULL, 0, 0, 1, '', 0x5469636b65742068617665206265656e2044656c657465642062792044656d6f61646d696e20466176656f, '', '', '2016-11-30 00:26:59', '2016-11-30 00:26:59'), -(7, 4, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b65742068617665206265656e2061737369676e656420746f2044656d6f61646d696e20466176656f, '', '', '2016-11-30 00:28:23', '2016-11-30 00:28:23'), -(8, 4, 1, 'support', NULL, 0, 0, 0, '', 0x486920636c616469612c3c62723e3c62723e417320736f6f6e20617320706f737369626c652077652077696c6c2072657475726e20796f757220636173682e3c62723e3c62723e, '', '', '2016-11-30 00:28:23', '2016-11-30 00:28:23'), -(9, 1, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b657420686173206265656e2061737369676e656420746f204a6f686e20706174656c, '', '', '2016-11-30 00:29:01', '2016-11-30 00:29:01'); +(1, 1, 4, 'client', NULL, 0, 0, 0, 'Sewing defects', 0x466f7220657665727920696e647573747279206f7220627573696e6573732c20746f2067657420696e63726561736564200d0a73616c657320616e640d0a626574746572206e616d6520616d6f6e67737420636f6e73756d65727320616e642066656c6c6f7720636f6d70616e69657320697420697320696d706f7274616e7420746f200d0a6d61696e7461696e0d0a61206c6576656c206f66207175616c6974792e20496e20746865206761726d656e7420696e647573747279207175616c69747920636f6e74726f6c206973207072616374696365640d0a2072696768742066726f6d2074686520696e697469616c207374616765206f6620736f757263696e6720726177206d6174657269616c7320746f20746865207374616765206f66200d0a66696e616c2066696e69736865640d0a6761726d656e742e20466f722074657874696c6520616e64206170706172656c20696e6475737472792070726f64756374207175616c6974792069732063616c63756c61746564200d0a696e0d0a7465726d73206f66207175616c69747920616e64207374616e64617264206f66206669627265732c207961726e732c2066616272696320636f6e737472756374696f6e2c200d0a636f6c6f75720d0a666173746e6573732c20737572666163652064657369676e7320616e64207468652066696e616c2066696e6973686564206761726d656e742070726f64756374732e200d0a486f77657665720d0a7175616c697479206578706563746174696f6e7320666f72206578706f7274206172652072656c6174656420746f207468652074797065206f6620637573746f6d6572200d0a7365676d656e74730d0a616e64207468652072657461696c206f75746c6574732e205468657265206172652061206e756d626572206f6620666163746f7273206f6e207768696368207175616c697479200d0a6669746e6573730d0a6f66206761726d656e7420696e64757374727920697320626173656420737563682061732020706572666f726d616e63652c2072656c696162696c6974792c200d0a6475726162696c6974792c0d0a76697375616c20616e6420706572636569766564207175616c697479206f6620746865206761726d656e742e205175616c697479206e6565647320746f20626520646566696e65640d0a20696e0d0a7465726d73206f66206120706172746963756c6172206672616d65776f726b206f6620636f73742e203c62723e, '', '', '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(2, 2, 5, 'client', NULL, 0, 0, 0, 'Delivery not recieved', 0x3c7370616e3e556e666f7274756e6174656c792c206966206120747261636b696e670d0a206e756d6265722073686f77732064656c69766572792c20796f7572206f6e6c79207265636f75727365206973207468726f7567682074686520736869707065722e2020496e200d0a6f7468657220776f7264732c20696620746865205553505320747261636b696e6720736974652073686f77732064656c69766572792c20616e6420796f7520686176656e2774200d0a61637475616c6c792072656365697665642069742c20796f75722070726f626c656d206c69657320776974682074686520555350532c20616e64206e6f7420746865200d0a73656c6c65722e223c62723e3c62723e5468697320686173206e657665722068617070656e656420746f206d652c206275742074686520696465610d0a20746861742074686520627579657220697320736f6d65686f7720726573706f6e7369626c6520666f722074686520636172726965722074686174207468652053454c4c4552200d0a68617320636f6d6d697373696f6e6564206973206c6175676861626c652e205468652073656c6c657220686173206120636f6e747261637475616c2061677265656d656e74200d0a776974682074686520736869707065722c206d616e792074696d65732074686520627579657220646f65736e2774206576656e206861766520746865206f7074696f6e20746f200d0a73706563696679207468652073686970706572207573656420666f722064656c69766572792e20496620746865206974656d204920707572636861736564206e65766572200d0a72656163686573206d7920686f6d653c2f7370616e3e3c62723e, '', '', '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(3, 3, 6, 'client', NULL, 0, 0, 0, 'Colour effects', 0x492068617665206265656e2073656c656374656420666f72206170706f696e746d656e7420746f2074686520496e6469616e20466f7265737420536572766963652e200d0a42757420746865206d65646963616c20626f6172642068617320666f756e64206d6520756e666974206f6e206163636f756e74206f662064656665637469766520636f6c6f7572200d0a766973696f6e2e0d0a0d0a3c703e4163636f7264696e6720746f207468652072756c65732c20224c6f77204772616465202220636f6c6f757220766973696f6e2069732073756666696369656e7420666f72200d0a74686520736572766963652e204920776f756c64206c696b6520746f206b6e6f7720686f7720636f6c6f757220766973696f6e2063616e20626520677261646564206173206c6f770d0a206f7220686967682e20492063616e20636f72726563746c79206964656e74696679203238206f7574206f6620333820497368696861726120706c617465732e20556e646572200d0a6c6f776572206c6967687420696e74656e736974792c20492063616e206964656e74696679206120666577206d6f726520706c617465732e20506c656173652067697665200d0a796f757220636f6d6d656e74206f6e20746869732e20416c736f20706c65617365206c6574206d65206b6e6f772061626f757420746865204564726964676520477265656e200d0a4c616e7465726e207465737420616e642074686520636f6c6f75727320696e20746865206c616e7465726e2e2054686520626f617264206861732063616c6c6564206d6520666f720d0a20612072652d6578616d696e6174696f6e202e20506c6561736520616476697365206d6520686f7720746f20666163652069742e3c2f703e3c62723e, '', '', '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(4, 4, 7, 'client', NULL, 0, 0, 0, 'Garment defects', 0x536f6d65207061727473206f66207061747465726e20617265206d697373696e672c2070726f6261626c7920626563617573650d0a207468650d0a6d61726b657220646964206e6f7420696e636c7564652074686520636f7272656374206e756d626572206f662070617274732e204d697865642070617274732c200d0a70726f6261626c79206265636175736520746865206d61726b6572206973206e6f7420636f72726563746c79206c6162656c65642c20726573756c74696e6720696e2061200d0a6d61727269616765206f662077726f6e672073697a65640d0a70617274732e205061747465726e73206e6f7420666163696e6720696e20636f727265637420646972656374696f6e206f6e206e617070656420666162726963732e204e6f74200d0a616c6c0d0a7061747465726e7320666163696e6720696e2073616d6520646972656374696f6e20286569746865722077617929206f6e2061206f6e652d776179206661627269632e200d0a5061747465726e730d0a6e6f7420616c69676e65642077697468207265737065637420746f207468652066616272696320677261696e2e20506f6f72206c696e6520646566696e6974696f6e2028652e672e0d0a20746f6f0d0a746869636b206368616c6b3b20696e64697374696e63746c79207072696e746564206c696e652c20706572666f7261746564206c6179206e6f7420706f77646572656429200d0a6c656164696e6720746f0d0a696e61636375726174652063757474696e672e20536b696d7079206d61726b696e672c206361757365642062792065697468657220746865206d61726b657220646964206e6f74200d0a757365207468650d0a6f7574736964652065646765206f6620746865207061747465726e3b206f7220746865207061747465726e20776173206d6f766564206f72207377756e67206166746572200d0a7061727469616c0d0a6d61726b696e6720746f2073717565657a6520746865207061747465726e20696e746f206120736d616c6c657220737061636520666f722065636f6e6f6d697a696e6720746865200d0a6661627269632e0d0a4d61726b696e67206261636b2066726f6d206d696e696174757265206d61726b65727320616c736f2063616e2063617573652074726f75626c6520756e6c65737320746865200d0a6d696e6961747572650d0a6d61726b6572206d616b696e6720697320696e207468652068616e6473206f6620657870657269656e636564206f70657261746f72732e20416c7465726e61746976656c79200d0a7468652066756c6c0d0a73697a65207061747465726e206d617920626520686176696e6720776f726e206f75742065646765732e3c62723e, '', '', '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(5, 4, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b657420686173206265656e2061737369676e656420746f2044656d6f2061646d696e, '', '', '2016-12-13 04:00:04', '2016-12-13 04:00:04'), +(6, 3, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b657420686173206265656e2061737369676e656420746f204a6f68616e204d616c686f747261, '', '', '2016-12-13 04:00:23', '2016-12-13 04:00:23'), +(7, 4, 1, 'support', NULL, 0, 0, 0, '', 0x3c703e4869204b757374692c3c2f703e0d0a0d0a3c703e4c6574206d6520636865636b20616e642063616c6c206261636b20796f753c2f703e0d0a0d0a3c703e5468616e6b20596f753c2f703e0d0a, '', '', '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(8, 5, 7, 'client', NULL, 0, 0, 0, 'test ticket', 0x746869732069732074657374207469636b6574202e2e2e63766376637663, '', '', '2016-12-13 04:02:48', '2016-12-13 04:02:48'), +(9, 6, 5, 'client', NULL, 0, 0, 0, 'Mail test ticket', 0x506c6561736520746869732069732074657374207469636b65742e, '', '', '2016-12-13 04:03:44', '2016-12-13 04:03:44'), +(10, 6, 1, '', NULL, 0, 0, 1, '', 0x5469636b65742068617665206265656e2044656c657465642062792044656d6f2061646d696e, '', '', '2016-12-13 04:04:04', '2016-12-13 04:04:04'), +(11, 5, 1, '', NULL, 0, 0, 1, '', 0x5469636b65742068617665206265656e2044656c657465642062792044656d6f2061646d696e, '', '', '2016-12-13 04:04:04', '2016-12-13 04:04:04'); -- -------------------------------------------------------- @@ -2264,6 +2223,7 @@ CREATE TABLE IF NOT EXISTS `users` ( `ban` tinyint(1) NOT NULL, `password` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `active` int(11) NOT NULL, + `is_delete` tinyint(1) NOT NULL DEFAULT '0', `ext` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `country_code` int(11) NOT NULL, `phone_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL, @@ -2290,18 +2250,20 @@ CREATE TABLE IF NOT EXISTS `users` ( UNIQUE KEY `users_mobile_unique` (`mobile`), KEY `assign_group_3` (`assign_group`), KEY `primary_dpt_2` (`primary_dpt`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `users` -- -INSERT INTO `users` (`id`, `user_name`, `first_name`, `last_name`, `gender`, `email`, `ban`, `password`, `active`, `ext`, `country_code`, `phone_number`, `mobile`, `agent_sign`, `account_type`, `account_status`, `assign_group`, `primary_dpt`, `agent_tzone`, `daylight_save`, `limit_access`, `directory_listing`, `vacation_mode`, `company`, `role`, `internal_note`, `profile_pic`, `remember_token`, `created_at`, `updated_at`) VALUES -(1, 'demo@admin.com', 'Demoadmin', 'Faveo', 0, 'demo@admin.com', 0, '$2y$10$ewEDeTT7ax5u6lCcCrJL6OClWB6Eo/6GbeJY8MMrJZCjvsbJI84XS', 1, '', 0, '', NULL, '', '', '', 1, 1, '', '', '', '', '', '', 'admin', '', '', 'oFeQJKpu1OlZveLPEghCRlF925TutWTkj5TNoX5jIzjkVzVYNAHC9TtCP1Kr', '2016-11-29 23:28:47', '2016-11-30 00:31:09'), -(2, 'jalafa', 'Jalafa', 'kk', 0, 'jalafa@gmail.com', 0, '$2y$10$F26IyAQOJIzjBs4p0j5K7ugSDDxT2dRSqbAeC8d0CdCG/pwN64qVq', 1, '', 91, '', '9285631230', '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', NULL, '2016-11-29 23:37:34', '2016-11-29 23:37:34'), -(3, 'cladia', 'Cladia', 'Singh', 0, 'cladia@yahoo.com', 0, '$2y$10$MXupcdivLoWZuNnVeHHTHOQSMF11iXkhY7AvToYiF2/PMutrilJce', 1, '', 91, '', '7865236524', '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', NULL, '2016-11-29 23:39:51', '2016-11-29 23:39:51'), -(4, 'John', 'John', 'patel', 0, 'john@gmail.com', 0, '$2y$10$H5jyw8QbTdu11Rezoe8kUexS5pP6GHIhJUOQRL8jLRriaOAtfSONm', 1, '', 91, '', '6983524178', '', '', '', 1, 1, '79', '', '', '', '', '', 'agent', '', '', NULL, '2016-11-29 23:43:01', '2016-11-29 23:43:02'), -(5, 'Baladdin', 'Baladin', 'khan', 0, 'baladdin@gmail.com', 0, '$2y$10$0iz73EdhcHGKI3H5oQmnZeUXVvqEzCsXpjTuc88ihNmHeJG18xZXG', 1, '', 91, '', '7896325412', '', '', '', 2, 2, '79', '', '', '', '', '', 'agent', '', '', NULL, '2016-11-29 23:45:08', '2016-11-29 23:45:08'); +INSERT INTO `users` (`id`, `user_name`, `first_name`, `last_name`, `gender`, `email`, `ban`, `password`, `active`, `is_delete`, `ext`, `country_code`, `phone_number`, `mobile`, `agent_sign`, `account_type`, `account_status`, `assign_group`, `primary_dpt`, `agent_tzone`, `daylight_save`, `limit_access`, `directory_listing`, `vacation_mode`, `company`, `role`, `internal_note`, `profile_pic`, `remember_token`, `created_at`, `updated_at`) VALUES +(1, 'demo@admin.com', 'Demo', 'admin', 0, 'demo@admin.com', 0, '$2y$10$ZkHOJeJCKFzLtL4yWXZ3suVZlG.fJwD9oUI3nM5FGESmIkQV1hMXC', 1, 0, '', 0, '', NULL, '', '', '', 1, 1, '', '', '', '', '', '', 'admin', '', '', NULL, '2016-12-13 03:19:53', '2016-12-13 03:19:53'), +(2, 'Abhrakasin', 'Abhrakasin', 'KK', 0, 'abhrakasin@gmail.com', 0, '$2y$10$nrMZMd72/HZbnzjBAi0RX.UQrNTtFeZFEK9aq.chDPZZ07rOC/6Ie', 1, 0, '', 0, '', NULL, '', '', '', 1, 1, '79', '', '', '', '', '', 'agent', '', '', NULL, '2016-12-13 03:32:41', '2016-12-13 03:32:42'), +(3, 'Johan', 'Johan', 'Malhotra', 0, 'johan21@gmail.com', 0, '$2y$10$Eq8SHKUEXCkW5vqiWvA0Iu1UJmzZ.e5.Q3hI2tkxey5HZ2Lmbxb1C', 1, 0, '', 0, '', NULL, '', '', '', 2, 2, '7', '', '', '', '', '', 'agent', '', '', NULL, '2016-12-13 03:35:29', '2016-12-13 03:35:30'), +(4, 'fidelm@gmail.com', 'Fidel Martin', '', 0, 'fidelm@gmail.com', 0, '$2y$10$wHupGhJqz2p4rcdS4eq4ZO.NQ65b0JjVsqhJwEEzOCl3vMKwzh9/S', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', 'PXj6d2s7rOqoh53gHdyPbiHOVvBmDoR5CnXg9kl7fRolIC92Y20UnFPSOryw', '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(5, 'joseph2321@gmail.com', 'Joseph Rossignol', '', 0, 'joseph2321@gmail.com', 0, '$2y$10$7eQ0nFxQpQkWaKwUbzTsQ.ufQpRN1rwUGY5ER1KsoXoLd6KbMIHnG', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', 'nv7Z37jhwAVdt87WCVzsqweY6wUbic7ll44FNmygMmwcnErafCrVpnw6Krys', '2016-12-13 03:50:55', '2016-12-13 03:50:55'), +(6, 'ichae1212@gmail.com', 'Ichae Semos', '', 0, 'ichae1212@gmail.com', 0, '$2y$10$aITz4IUuaxb0VHwF2V2CPefwf/Ft0VXpmHDC9feEfNXkW90GdjCFm', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', 'egq0NWPaxEkwkXmV3L0BJ4j4O6aKlgjzNZxea0XpYvCAeVvZLbXsjkKmWyBZ', '2016-12-13 03:55:54', '2016-12-13 03:55:54'), +(7, 'kusti09@yahoo.com', 'Kusti Franti', '', 0, 'kusti09@yahoo.com', 0, '$2y$10$yNHebbyWfr6m1t4srRlYbuj2JN706ZBpyMI.gSJmuY9czJ3OzuQpq', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', '4JPKOO9UUjZ2yX1GI7WYaeljcdyFATmguwNGuUD9chDodCVfJVGBJvbepgOt', '2016-12-13 03:58:40', '2016-12-13 03:58:40'); -- -------------------------------------------------------- @@ -2351,25 +2313,27 @@ CREATE TABLE IF NOT EXISTS `user_notification` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ; -- -- Dumping data for table `user_notification` -- INSERT INTO `user_notification` (`id`, `notification_id`, `user_id`, `is_read`, `created_at`, `updated_at`) VALUES -(1, 1, 4, 0, '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(2, 1, 1, 0, '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(3, 2, 4, 0, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(4, 2, 1, 0, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(5, 3, 4, 0, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(6, 3, 1, 0, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(7, 4, 5, 0, '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(8, 4, 1, 0, '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(9, 5, 4, 0, '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(10, 5, 1, 0, '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(11, 6, 5, 0, '2016-11-30 00:28:23', '2016-11-30 00:28:23'), -(12, 6, 1, 0, '2016-11-30 00:28:23', '2016-11-30 00:28:23'); +(1, 1, 2, 0, '2016-12-13 03:45:20', '2016-12-13 03:45:20'), +(2, 1, 1, 0, '2016-12-13 03:45:20', '2016-12-13 03:45:20'), +(3, 2, 2, 0, '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(4, 2, 1, 0, '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(5, 3, 2, 0, '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(6, 3, 1, 0, '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(7, 4, 2, 0, '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(8, 4, 1, 0, '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(9, 5, 2, 0, '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(10, 5, 1, 0, '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(11, 6, 2, 0, '2016-12-13 04:02:49', '2016-12-13 04:02:49'), +(12, 6, 1, 0, '2016-12-13 04:02:49', '2016-12-13 04:02:49'), +(13, 7, 2, 0, '2016-12-13 04:03:44', '2016-12-13 04:03:44'), +(14, 7, 1, 0, '2016-12-13 04:03:44', '2016-12-13 04:03:44'); -- -------------------------------------------------------- @@ -2391,7 +2355,7 @@ CREATE TABLE IF NOT EXISTS `version_check` ( -- INSERT INTO `version_check` (`id`, `current_version`, `new_version`, `created_at`, `updated_at`) VALUES -(1, '', '', '2016-11-29 23:28:17', '2016-11-29 23:28:17'); +(1, '', '', '2016-12-13 03:19:30', '2016-12-13 03:19:30'); -- -------------------------------------------------------- @@ -2414,26 +2378,26 @@ CREATE TABLE IF NOT EXISTS `widgets` ( -- INSERT INTO `widgets` (`id`, `name`, `title`, `value`, `created_at`, `updated_at`) VALUES -(1, 'footer1', 'Products', '', '2016-11-29 23:28:18', '2016-11-29 23:47:56'), -(2, 'footer2', 'Company', '', '2016-11-29 23:28:18', '2016-11-29 23:48:39'), -(3, 'footer3', 'Find out More', '', '2016-11-29 23:28:18', '2016-11-29 23:49:14'), -(4, 'footer4', 'Contact Us', '
\r\n

BTM Layout, No: #28
9th Cross First Stage BTM Layout Near Water Tank
Bangalore – 560 029
Karnataka – India
Telephone: +91 9999999999
Email:    support@abcclothing.com

\r\n
\r\n \r\n
\r\n
', '2016-11-29 23:28:18', '2016-11-29 23:50:04'), -(5, 'side1', NULL, NULL, '2016-11-29 23:28:18', '2016-11-29 23:28:18'), -(6, 'side2', NULL, NULL, '2016-11-29 23:28:18', '2016-11-29 23:28:18'), -(7, 'linkedin', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(8, 'stumble', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(9, 'google', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(10, 'deviantart', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(11, 'flickr', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(12, 'skype', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(13, 'rss', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(14, 'twitter', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(15, 'facebook', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(16, 'youtube', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(17, 'vimeo', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(18, 'pinterest', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(19, 'dribbble', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(20, 'instagram', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'); +(1, 'footer1', 'Products', '', '2016-12-13 03:19:30', '2016-12-13 03:21:13'), +(2, 'footer2', 'Company', '', '2016-12-13 03:19:30', '2016-12-13 03:21:40'), +(3, 'footer3', 'Find out More', '', '2016-12-13 03:19:30', '2016-12-13 03:22:06'), +(4, 'footer4', 'Contact Us', '
\r\n

BTM Layout, No: #28
9th Cross First Stage BTM Layout Near Water Tank
Bangalore – 560 029
Karnataka – India
Telephone: +91 9999999999
Email:    support@abcclothing.com

', '2016-12-13 03:19:30', '2016-12-13 03:22:34'), +(5, 'side1', NULL, NULL, '2016-12-13 03:19:30', '2016-12-13 03:19:30'), +(6, 'side2', NULL, NULL, '2016-12-13 03:19:30', '2016-12-13 03:19:30'), +(7, 'linkedin', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(8, 'stumble', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(9, 'google', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(10, 'deviantart', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(11, 'flickr', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(12, 'skype', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(13, 'rss', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(14, 'twitter', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(15, 'facebook', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(16, 'youtube', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(17, 'vimeo', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(18, 'pinterest', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(19, 'dribbble', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(20, 'instagram', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'); -- -------------------------------------------------------- @@ -2474,7 +2438,7 @@ CREATE TABLE IF NOT EXISTS `workflow_close` ( -- INSERT INTO `workflow_close` (`id`, `days`, `condition`, `send_email`, `status`, `created_at`, `updated_at`) VALUES -(1, 2, 1, 1, 3, '2016-11-29 23:27:58', '2016-11-29 23:27:58'); +(1, 2, 1, 1, 3, '2016-12-13 03:19:14', '2016-12-13 03:19:14'); -- -------------------------------------------------------- diff --git a/DB/dummy-data.sql b/DB/dummy-data.sql index 2c0b011e0..b447c289f 100644 --- a/DB/dummy-data.sql +++ b/DB/dummy-data.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 --- Generation Time: Nov 30, 2016 at 07:01 AM +-- Generation Time: Dec 13, 2016 at 10:36 AM -- Server version: 5.6.17 -- PHP Version: 5.5.12 @@ -17,7 +17,7 @@ SET time_zone = "+00:00"; /*!40101 SET NAMES utf8 */; -- --- Database: `version_1.8` +-- Database: `community` -- -- -------------------------------------------------------- @@ -37,28 +37,6 @@ CREATE TABLE IF NOT EXISTS `api_settings` ( -- -------------------------------------------------------- --- --- Table structure for table `approval` --- - -CREATE TABLE IF NOT EXISTS `approval` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; - --- --- Dumping data for table `approval` --- - -INSERT INTO `approval` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES -(1, 'approval', '0', '2016-11-29 23:28:11', '2016-11-29 23:28:11'); - --- -------------------------------------------------------- - -- -- Table structure for table `banlist` -- @@ -93,7 +71,7 @@ CREATE TABLE IF NOT EXISTS `bar_notifications` ( -- INSERT INTO `bar_notifications` (`id`, `key`, `value`, `created_at`, `updated_at`) VALUES -(1, 'new-version', '', '2016-11-29 23:29:29', '2016-11-29 23:29:29'); +(1, 'new-version', '', '2016-12-13 03:20:32', '2016-12-13 03:20:32'); -- -------------------------------------------------------- @@ -127,19 +105,20 @@ CREATE TABLE IF NOT EXISTS `common_settings` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `common_settings` -- INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`) VALUES -(1, 'ticket_token_time_duration', '1', '', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(2, 'enable_rtl', '', '', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(3, 'user_set_ticket_status', '', '1', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(4, 'send_otp', '', '0', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(5, 'email_mandatory', '', '1', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(6, 'user_priority', '', '0', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'); +(1, 'itil', '', '0', '', NULL, NULL), +(2, 'ticket_token_time_duration', '1', '', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(3, 'enable_rtl', '', '', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(4, 'user_set_ticket_status', '', '1', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(5, 'send_otp', '', '0', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(6, 'email_mandatory', '', '1', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(7, 'user_priority', '', '0', '', '2016-12-13 03:19:52', '2016-12-13 03:19:52'); -- -------------------------------------------------------- @@ -180,245 +159,245 @@ CREATE TABLE IF NOT EXISTS `country_code` ( -- INSERT INTO `country_code` (`id`, `iso`, `name`, `nicename`, `iso3`, `numcode`, `phonecode`, `created_at`, `updated_at`) VALUES -(1, 'AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4, 93, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(2, 'AL', 'ALBANIA', 'Albania', 'ALB', 8, 355, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(3, 'DZ', 'ALGERIA', 'Algeria', 'DZA', 12, 213, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(4, 'AS', 'AMERICAN SAMOA', 'American Samoa', 'ASM', 16, 1684, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(5, 'AD', 'ANDORRA', 'Andorra', 'AND', 20, 376, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(6, 'AO', 'ANGOLA', 'Angola', 'AGO', 24, 244, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(7, 'AI', 'ANGUILLA', 'Anguilla', 'AIA', 660, 1264, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(8, 'AQ', 'ANTARCTICA', 'Antarctica', 'NUL', 0, 0, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(9, 'AG', 'ANTIGUA AND BARBUDA', 'Antigua and Barbuda', 'ATG', 28, 1268, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(10, 'AR', 'ARGENTINA', 'Argentina', 'ARG', 32, 54, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(11, 'AM', 'ARMENIA', 'Armenia', 'ARM', 51, 374, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(12, 'AW', 'ARUBA', 'Aruba', 'ABW', 533, 297, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(13, 'AU', 'AUSTRALIA', 'Australia', 'AUS', 36, 61, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(14, 'AT', 'AUSTRIA', 'Austria', 'AUT', 40, 43, '2016-11-29 23:28:21', '2016-11-29 23:28:21'), -(15, 'AZ', 'AZERBAIJAN', 'Azerbaijan', 'AZE', 31, 994, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(16, 'BS', 'BAHAMAS', 'Bahamas', 'BHS', 44, 1242, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(17, 'BH', 'BAHRAIN', 'Bahrain', 'BHR', 48, 973, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(18, 'BD', 'BANGLADESH', 'Bangladesh', 'BGD', 50, 880, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(19, 'BB', 'BARBADOS', 'Barbados', 'BRB', 52, 1246, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(20, 'BY', 'BELARUS', 'Belarus', 'BLR', 112, 375, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(21, 'BE', 'BELGIUM', 'Belgium', 'BEL', 56, 32, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(22, 'BZ', 'BELIZE', 'Belize', 'BLZ', 84, 501, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(23, 'BJ', 'BENIN', 'Benin', 'BEN', 204, 229, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(24, 'BM', 'BERMUDA', 'Bermuda', 'BMU', 60, 1441, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(25, 'BT', 'BHUTAN', 'Bhutan', 'BTN', 64, 975, '2016-11-29 23:28:22', '2016-11-29 23:28:22'), -(26, 'BO', 'BOLIVIA', 'Bolivia', 'BOL', 68, 591, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(27, 'BA', 'BOSNIA AND HERZEGOVINA', 'Bosnia and Herzegovina', 'BIH', 70, 387, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(28, 'BW', 'BOTSWANA', 'Botswana', 'BWA', 72, 267, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(29, 'BV', 'BOUVET ISLAND', 'Bouvet Island', 'NUL', 0, 0, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(30, 'BR', 'BRAZIL', 'Brazil', 'BRA', 76, 55, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(31, 'IO', 'BRITISH INDIAN OCEAN TERRITORY', 'British Indian Ocean Territory', 'NUL', 0, 246, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(32, 'BN', 'BRUNEI DARUSSALAM', 'Brunei Darussalam', 'BRN', 96, 673, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(33, 'BG', 'BULGARIA', 'Bulgaria', 'BGR', 100, 359, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(34, 'BF', 'BURKINA FASO', 'Burkina Faso', 'BFA', 854, 226, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(35, 'BI', 'BURUNDI', 'Burundi', 'BDI', 108, 257, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(36, 'KH', 'CAMBODIA', 'Cambodia', 'KHM', 116, 855, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(37, 'CM', 'CAMEROON', 'Cameroon', 'CMR', 120, 237, '2016-11-29 23:28:23', '2016-11-29 23:28:23'), -(38, 'CA', 'CANADA', 'Canada', 'CAN', 124, 1, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(39, 'CV', 'CAPE VERDE', 'Cape Verde', 'CPV', 132, 238, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(40, 'KY', 'CAYMAN ISLANDS', 'Cayman Islands', 'CYM', 136, 1345, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(41, 'CF', 'CENTRAL AFRICAN REPUBLIC', 'Central African Republic', 'CAF', 140, 236, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(42, 'TD', 'CHAD', 'Chad', 'TCD', 148, 235, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(43, 'CL', 'CHILE', 'Chile', 'CHL', 152, 56, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(44, 'CN', 'CHINA', 'China', 'CHN', 156, 86, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(45, 'CX', 'CHRISTMAS ISLAND', 'Christmas Island', 'NUL', 0, 61, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(46, 'CC', 'COCOS (KEELING) ISLANDS', 'Cocos (Keeling) Islands', 'NUL', 0, 672, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(47, 'CO', 'COLOMBIA', 'Colombia', 'COL', 170, 57, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(48, 'KM', 'COMOROS', 'Comoros', 'COM', 174, 269, '2016-11-29 23:28:24', '2016-11-29 23:28:24'), -(49, 'CG', 'CONGO', 'Congo', 'COG', 178, 242, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(50, 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'Congo, the Democratic Republic of the', 'COD', 180, 242, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(51, 'CK', 'COOK ISLANDS', 'Cook Islands', 'COK', 184, 682, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(52, 'CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188, 506, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(53, 'CI', 'COTE DIVOIRE', 'Cote DIvoire', 'CIV', 384, 225, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(54, 'HR', 'CROATIA', 'Croatia', 'HRV', 191, 385, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(55, 'CU', 'CUBA', 'Cuba', 'CUB', 192, 53, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(56, 'CY', 'CYPRUS', 'Cyprus', 'CYP', 196, 357, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(57, 'CZ', 'CZECH REPUBLIC', 'Czech Republic', 'CZE', 203, 420, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(58, 'DK', 'DENMARK', 'Denmark', 'DNK', 208, 45, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(59, 'DJ', 'DJIBOUTI', 'Djibouti', 'DJI', 262, 253, '2016-11-29 23:28:25', '2016-11-29 23:28:25'), -(60, 'DM', 'DOMINICA', 'Dominica', 'DMA', 212, 1767, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(61, 'DO', 'DOMINICAN REPUBLIC', 'Dominican Republic', 'DOM', 214, 1809, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(62, 'EC', 'ECUADOR', 'Ecuador', 'ECU', 218, 593, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(63, 'EG', 'EGYPT', 'Egypt', 'EGY', 818, 20, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(64, 'SV', 'EL SALVADOR', 'El Salvador', 'SLV', 222, 503, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(65, 'GQ', 'EQUATORIAL GUINEA', 'Equatorial Guinea', 'GNQ', 226, 240, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(66, 'ER', 'ERITREA', 'Eritrea', 'ERI', 232, 291, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(67, 'EE', 'ESTONIA', 'Estonia', 'EST', 233, 372, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(68, 'ET', 'ETHIOPIA', 'Ethiopia', 'ETH', 231, 251, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(69, 'FK', 'FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands (Malvinas)', 'FLK', 238, 500, '2016-11-29 23:28:26', '2016-11-29 23:28:26'), -(70, 'FO', 'FAROE ISLANDS', 'Faroe Islands', 'FRO', 234, 298, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(71, 'FJ', 'FIJI', 'Fiji', 'FJI', 242, 679, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(72, 'FI', 'FINLAND', 'Finland', 'FIN', 246, 358, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(73, 'FR', 'FRANCE', 'France', 'FRA', 250, 33, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(74, 'GF', 'FRENCH GUIANA', 'French Guiana', 'GUF', 254, 594, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(75, 'PF', 'FRENCH POLYNESIA', 'French Polynesia', 'PYF', 258, 689, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(76, 'TF', 'FRENCH SOUTHERN TERRITORIES', 'French Southern Territories', 'NUL', 0, 0, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(77, 'GA', 'GABON', 'Gabon', 'GAB', 266, 241, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(78, 'GM', 'GAMBIA', 'Gambia', 'GMB', 270, 220, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(79, 'GE', 'GEORGIA', 'Georgia', 'GEO', 268, 995, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(80, 'DE', 'GERMANY', 'Germany', 'DEU', 276, 49, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(81, 'GH', 'GHANA', 'Ghana', 'GHA', 288, 233, '2016-11-29 23:28:27', '2016-11-29 23:28:27'), -(82, 'GI', 'GIBRALTAR', 'Gibraltar', 'GIB', 292, 350, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(83, 'GR', 'GREECE', 'Greece', 'GRC', 300, 30, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(84, 'GL', 'GREENLAND', 'Greenland', 'GRL', 304, 299, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(85, 'GD', 'GRENADA', 'Grenada', 'GRD', 308, 1473, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(86, 'GP', 'GUADELOUPE', 'Guadeloupe', 'GLP', 312, 590, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(87, 'GU', 'GUAM', 'Guam', 'GUM', 316, 1671, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(88, 'GT', 'GUATEMALA', 'Guatemala', 'GTM', 320, 502, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(89, 'GN', 'GUINEA', 'Guinea', 'GIN', 324, 224, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(90, 'GW', 'GUINEA-BISSAU', 'Guinea-Bissau', 'GNB', 624, 245, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(91, 'GY', 'GUYANA', 'Guyana', 'GUY', 328, 592, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(92, 'HT', 'HAITI', 'Haiti', 'HTI', 332, 509, '2016-11-29 23:28:28', '2016-11-29 23:28:28'), -(93, 'HM', 'HEARD ISLAND AND MCDONALD ISLANDS', 'Heard Island and Mcdonald Islands', 'NUL', 0, 0, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(94, 'VA', 'HOLY SEE (VATICAN CITY STATE)', 'Holy See (Vatican City State)', 'VAT', 336, 39, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(95, 'HN', 'HONDURAS', 'Honduras', 'HND', 340, 504, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(96, 'HK', 'HONG KONG', 'Hong Kong', 'HKG', 344, 852, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(97, 'HU', 'HUNGARY', 'Hungary', 'HUN', 348, 36, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(98, 'IS', 'ICELAND', 'Iceland', 'ISL', 352, 354, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(99, 'IN', 'INDIA', 'India', 'IND', 356, 91, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(100, 'ID', 'INDONESIA', 'Indonesia', 'IDN', 360, 62, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(101, 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 'Iran, Islamic Republic of', 'IRN', 364, 98, '2016-11-29 23:28:29', '2016-11-29 23:28:29'), -(102, 'IQ', 'IRAQ', 'Iraq', 'IRQ', 368, 964, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(103, 'IE', 'IRELAND', 'Ireland', 'IRL', 372, 353, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(104, 'IL', 'ISRAEL', 'Israel', 'ISR', 376, 972, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(105, 'IT', 'ITALY', 'Italy', 'ITA', 380, 39, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(106, 'JM', 'JAMAICA', 'Jamaica', 'JAM', 388, 1876, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(107, 'JP', 'JAPAN', 'Japan', 'JPN', 392, 81, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(108, 'JO', 'JORDAN', 'Jordan', 'JOR', 400, 962, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(109, 'KZ', 'KAZAKHSTAN', 'Kazakhstan', 'KAZ', 398, 7, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(110, 'KE', 'KENYA', 'Kenya', 'KEN', 404, 254, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(111, 'KI', 'KIRIBATI', 'Kiribati', 'KIR', 296, 686, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(112, 'KP', 'KOREA, DEMOCRATIC PEOPLES REPUBLIC OF', 'Korea, Democratic Peoples Republic of', 'PRK', 408, 850, '2016-11-29 23:28:30', '2016-11-29 23:28:30'), -(113, 'KR', 'KOREA, REPUBLIC OF', 'Korea, Republic of', 'KOR', 410, 82, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(114, 'KW', 'KUWAIT', 'Kuwait', 'KWT', 414, 965, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(115, 'KG', 'KYRGYZSTAN', 'Kyrgyzstan', 'KGZ', 417, 996, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(116, 'LA', 'LAO PEOPLES DEMOCRATIC REPUBLIC', 'Lao Peoples Democratic Republic', 'LAO', 418, 856, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(117, 'LV', 'LATVIA', 'Latvia', 'LVA', 428, 371, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(118, 'LB', 'LEBANON', 'Lebanon', 'LBN', 422, 961, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(119, 'LS', 'LESOTHO', 'Lesotho', 'LSO', 426, 266, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(120, 'LR', 'LIBERIA', 'Liberia', 'LBR', 430, 231, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(121, 'LY', 'LIBYAN ARAB JAMAHIRIYA', 'Libyan Arab Jamahiriya', 'LBY', 434, 218, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(122, 'LI', 'LIECHTENSTEIN', 'Liechtenstein', 'LIE', 438, 423, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(123, 'LT', 'LITHUANIA', 'Lithuania', 'LTU', 440, 370, '2016-11-29 23:28:31', '2016-11-29 23:28:31'), -(124, 'LU', 'LUXEMBOURG', 'Luxembourg', 'LUX', 442, 352, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(125, 'MO', 'MACAO', 'Macao', 'MAC', 446, 853, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(126, 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Macedonia, the Former Yugoslav Republic of', 'MKD', 807, 389, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(127, 'MG', 'MADAGASCAR', 'Madagascar', 'MDG', 450, 261, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(128, 'MW', 'MALAWI', 'Malawi', 'MWI', 454, 265, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(129, 'MY', 'MALAYSIA', 'Malaysia', 'MYS', 458, 60, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(130, 'MV', 'MALDIVES', 'Maldives', 'MDV', 462, 960, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(131, 'ML', 'MALI', 'Mali', 'MLI', 466, 223, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(132, 'MT', 'MALTA', 'Malta', 'MLT', 470, 356, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(133, 'MH', 'MARSHALL ISLANDS', 'Marshall Islands', 'MHL', 584, 692, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(134, 'MQ', 'MARTINIQUE', 'Martinique', 'MTQ', 474, 596, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(135, 'MR', 'MAURITANIA', 'Mauritania', 'MRT', 478, 222, '2016-11-29 23:28:32', '2016-11-29 23:28:32'), -(136, 'MU', 'MAURITIUS', 'Mauritius', 'MUS', 480, 230, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(137, 'YT', 'MAYOTTE', 'Mayotte', 'NUL', 0, 269, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(138, 'MX', 'MEXICO', 'Mexico', 'MEX', 484, 52, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(139, 'FM', 'MICRONESIA, FEDERATED STATES OF', 'Micronesia, Federated States of', 'FSM', 583, 691, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(140, 'MD', 'MOLDOVA, REPUBLIC OF', 'Moldova, Republic of', 'MDA', 498, 373, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(141, 'MC', 'MONACO', 'Monaco', 'MCO', 492, 377, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(142, 'MN', 'MONGOLIA', 'Mongolia', 'MNG', 496, 976, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(143, 'MS', 'MONTSERRAT', 'Montserrat', 'MSR', 500, 1664, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(144, 'MA', 'MOROCCO', 'Morocco', 'MAR', 504, 212, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(145, 'MZ', 'MOZAMBIQUE', 'Mozambique', 'MOZ', 508, 258, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(146, 'MM', 'MYANMAR', 'Myanmar', 'MMR', 104, 95, '2016-11-29 23:28:33', '2016-11-29 23:28:33'), -(147, 'NA', 'NAMIBIA', 'Namibia', 'NAM', 516, 264, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(148, 'NR', 'NAURU', 'Nauru', 'NRU', 520, 674, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(149, 'NP', 'NEPAL', 'Nepal', 'NPL', 524, 977, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(150, 'NL', 'NETHERLANDS', 'Netherlands', 'NLD', 528, 31, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(151, 'AN', 'NETHERLANDS ANTILLES', 'Netherlands Antilles', 'ANT', 530, 599, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(152, 'NC', 'NEW CALEDONIA', 'New Caledonia', 'NCL', 540, 687, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(153, 'NZ', 'NEW ZEALAND', 'New Zealand', 'NZL', 554, 64, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(154, 'NI', 'NICARAGUA', 'Nicaragua', 'NIC', 558, 505, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(155, 'NE', 'NIGER', 'Niger', 'NER', 562, 227, '2016-11-29 23:28:34', '2016-11-29 23:28:34'), -(156, 'NG', 'NIGERIA', 'Nigeria', 'NGA', 566, 234, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(157, 'NU', 'NIUE', 'Niue', 'NIU', 570, 683, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(158, 'NF', 'NORFOLK ISLAND', 'Norfolk Island', 'NFK', 574, 672, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(159, 'MP', 'NORTHERN MARIANA ISLANDS', 'Northern Mariana Islands', 'MNP', 580, 1670, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(160, 'NO', 'NORWAY', 'Norway', 'NOR', 578, 47, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(161, 'OM', 'OMAN', 'Oman', 'OMN', 512, 968, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(162, 'PK', 'PAKISTAN', 'Pakistan', 'PAK', 586, 92, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(163, 'PW', 'PALAU', 'Palau', 'PLW', 585, 680, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(164, 'PS', 'PALESTINIAN TERRITORY, OCCUPIED', 'Palestinian Territory, Occupied', 'NUL', 0, 970, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(165, 'PA', 'PANAMA', 'Panama', 'PAN', 591, 507, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(166, 'PG', 'PAPUA NEW GUINEA', 'Papua New Guinea', 'PNG', 598, 675, '2016-11-29 23:28:35', '2016-11-29 23:28:35'), -(167, 'PY', 'PARAGUAY', 'Paraguay', 'PRY', 600, 595, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(168, 'PE', 'PERU', 'Peru', 'PER', 604, 51, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(169, 'PH', 'PHILIPPINES', 'Philippines', 'PHL', 608, 63, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(170, 'PN', 'PITCAIRN', 'Pitcairn', 'PCN', 612, 0, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(171, 'PL', 'POLAND', 'Poland', 'POL', 616, 48, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(172, 'PT', 'PORTUGAL', 'Portugal', 'PRT', 620, 351, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(173, 'PR', 'PUERTO RICO', 'Puerto Rico', 'PRI', 630, 1787, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(174, 'QA', 'QATAR', 'Qatar', 'QAT', 634, 974, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(175, 'RE', 'REUNION', 'Reunion', 'REU', 638, 262, '2016-11-29 23:28:36', '2016-11-29 23:28:36'), -(176, 'RO', 'ROMANIA', 'Romania', 'ROM', 642, 40, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 70, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(178, 'RW', 'RWANDA', 'Rwanda', 'RWA', 646, 250, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(179, 'SH', 'SAINT HELENA', 'Saint Helena', 'SHN', 654, 290, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(180, 'KN', 'SAINT KITTS AND NEVIS', 'Saint Kitts and Nevis', 'KNA', 659, 1869, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(181, 'LC', 'SAINT LUCIA', 'Saint Lucia', 'LCA', 662, 1758, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(182, 'PM', 'SAINT PIERRE AND MIQUELON', 'Saint Pierre and Miquelon', 'SPM', 666, 508, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(183, 'VC', 'SAINT VINCENT AND THE GRENADINES', 'Saint Vincent and the Grenadines', 'VCT', 670, 1784, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(184, 'WS', 'SAMOA', 'Samoa', 'WSM', 882, 684, '2016-11-29 23:28:37', '2016-11-29 23:28:37'), -(185, 'SM', 'SAN MARINO', 'San Marino', 'SMR', 674, 378, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(186, 'ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678, 239, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(187, 'SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682, 966, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(188, 'SN', 'SENEGAL', 'Senegal', 'SEN', 686, 221, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(189, 'CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', 'NUL', 0, 381, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(190, 'SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690, 248, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(191, 'SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694, 232, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(192, 'SG', 'SINGAPORE', 'Singapore', 'SGP', 702, 65, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(193, 'SK', 'SLOVAKIA', 'Slovakia', 'SVK', 703, 421, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(194, 'SI', 'SLOVENIA', 'Slovenia', 'SVN', 705, 386, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(195, 'SB', 'SOLOMON ISLANDS', 'Solomon Islands', 'SLB', 90, 677, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(196, 'SO', 'SOMALIA', 'Somalia', 'SOM', 706, 252, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(197, 'ZA', 'SOUTH AFRICA', 'South Africa', 'ZAF', 710, 27, '2016-11-29 23:28:38', '2016-11-29 23:28:38'), -(198, 'GS', 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'South Georgia and the South Sandwich Islands', 'NUL', 0, 0, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(199, 'ES', 'SPAIN', 'Spain', 'ESP', 724, 34, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(200, 'LK', 'SRI LANKA', 'Sri Lanka', 'LKA', 144, 94, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(201, 'SD', 'SUDAN', 'Sudan', 'SDN', 736, 249, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(202, 'SR', 'SURINAME', 'Suriname', 'SUR', 740, 597, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(203, 'SJ', 'SVALBARD AND JAN MAYEN', 'Svalbard and Jan Mayen', 'SJM', 744, 47, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(204, 'SZ', 'SWAZILAND', 'Swaziland', 'SWZ', 748, 268, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(205, 'SE', 'SWEDEN', 'Sweden', 'SWE', 752, 46, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(206, 'CH', 'SWITZERLAND', 'Switzerland', 'CHE', 756, 41, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(207, 'SY', 'SYRIAN ARAB REPUBLIC', 'Syrian Arab Republic', 'SYR', 760, 963, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(208, 'TW', 'TAIWAN, PROVINCE OF CHINA', 'Taiwan, Province of China', 'TWN', 158, 886, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(209, 'TJ', 'TAJIKISTAN', 'Tajikistan', 'TJK', 762, 992, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(210, 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 'Tanzania, United Republic of', 'TZA', 834, 255, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(211, 'TH', 'THAILAND', 'Thailand', 'THA', 764, 66, '2016-11-29 23:28:39', '2016-11-29 23:28:39'), -(212, 'TL', 'TIMOR-LESTE', 'Timor-Leste', 'NUL', 0, 670, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(213, 'TG', 'TOGO', 'Togo', 'TGO', 768, 228, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(214, 'TK', 'TOKELAU', 'Tokelau', 'TKL', 772, 690, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(215, 'TO', 'TONGA', 'Tonga', 'TON', 776, 676, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(216, 'TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780, 1868, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(217, 'TN', 'TUNISIA', 'Tunisia', 'TUN', 788, 216, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(218, 'TR', 'TURKEY', 'Turkey', 'TUR', 792, 90, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(219, 'TM', 'TURKMENISTAN', 'Turkmenistan', 'TKM', 795, 7370, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(220, 'TC', 'TURKS AND CAICOS ISLANDS', 'Turks and Caicos Islands', 'TCA', 796, 1649, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(221, 'TV', 'TUVALU', 'Tuvalu', 'TUV', 798, 688, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(222, 'UG', 'UGANDA', 'Uganda', 'UGA', 800, 256, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(223, 'UA', 'UKRAINE', 'Ukraine', 'UKR', 804, 380, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(224, 'AE', 'UNITED ARAB EMIRATES', 'United Arab Emirates', 'ARE', 784, 971, '2016-11-29 23:28:40', '2016-11-29 23:28:40'), -(225, 'GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826, 44, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(226, 'US', 'UNITED STATES', 'United States', 'USA', 840, 1, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(227, 'UM', 'UNITED STATES MINOR OUTLYING ISLANDS', 'United States Minor Outlying Islands', 'NUL', 0, 1, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(228, 'UY', 'URUGUAY', 'Uruguay', 'URY', 858, 598, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(229, 'UZ', 'UZBEKISTAN', 'Uzbekistan', 'UZB', 860, 998, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(230, 'VU', 'VANUATU', 'Vanuatu', 'VUT', 548, 678, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(231, 'VE', 'VENEZUELA', 'Venezuela', 'VEN', 862, 58, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(232, 'VN', 'VIET NAM', 'Viet Nam', 'VNM', 704, 84, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(233, 'VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', 92, 1284, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(234, 'VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', 850, 1340, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(235, 'WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', 876, 681, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(236, 'EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732, 212, '2016-11-29 23:28:41', '2016-11-29 23:28:41'), -(237, 'YE', 'YEMEN', 'Yemen', 'YEM', 887, 967, '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(238, 'ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894, 260, '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(239, 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716, 263, '2016-11-29 23:28:42', '2016-11-29 23:28:42'); +(1, 'AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4, 93, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(2, 'AL', 'ALBANIA', 'Albania', 'ALB', 8, 355, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(3, 'DZ', 'ALGERIA', 'Algeria', 'DZA', 12, 213, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(4, 'AS', 'AMERICAN SAMOA', 'American Samoa', 'ASM', 16, 1684, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(5, 'AD', 'ANDORRA', 'Andorra', 'AND', 20, 376, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(6, 'AO', 'ANGOLA', 'Angola', 'AGO', 24, 244, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(7, 'AI', 'ANGUILLA', 'Anguilla', 'AIA', 660, 1264, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(8, 'AQ', 'ANTARCTICA', 'Antarctica', 'NUL', 0, 0, '2016-12-13 03:19:33', '2016-12-13 03:19:33'), +(9, 'AG', 'ANTIGUA AND BARBUDA', 'Antigua and Barbuda', 'ATG', 28, 1268, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(10, 'AR', 'ARGENTINA', 'Argentina', 'ARG', 32, 54, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(11, 'AM', 'ARMENIA', 'Armenia', 'ARM', 51, 374, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(12, 'AW', 'ARUBA', 'Aruba', 'ABW', 533, 297, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(13, 'AU', 'AUSTRALIA', 'Australia', 'AUS', 36, 61, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(14, 'AT', 'AUSTRIA', 'Austria', 'AUT', 40, 43, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(15, 'AZ', 'AZERBAIJAN', 'Azerbaijan', 'AZE', 31, 994, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(16, 'BS', 'BAHAMAS', 'Bahamas', 'BHS', 44, 1242, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(17, 'BH', 'BAHRAIN', 'Bahrain', 'BHR', 48, 973, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(18, 'BD', 'BANGLADESH', 'Bangladesh', 'BGD', 50, 880, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(19, 'BB', 'BARBADOS', 'Barbados', 'BRB', 52, 1246, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(20, 'BY', 'BELARUS', 'Belarus', 'BLR', 112, 375, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(21, 'BE', 'BELGIUM', 'Belgium', 'BEL', 56, 32, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(22, 'BZ', 'BELIZE', 'Belize', 'BLZ', 84, 501, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(23, 'BJ', 'BENIN', 'Benin', 'BEN', 204, 229, '2016-12-13 03:19:34', '2016-12-13 03:19:34'), +(24, 'BM', 'BERMUDA', 'Bermuda', 'BMU', 60, 1441, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(25, 'BT', 'BHUTAN', 'Bhutan', 'BTN', 64, 975, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(26, 'BO', 'BOLIVIA', 'Bolivia', 'BOL', 68, 591, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(27, 'BA', 'BOSNIA AND HERZEGOVINA', 'Bosnia and Herzegovina', 'BIH', 70, 387, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(28, 'BW', 'BOTSWANA', 'Botswana', 'BWA', 72, 267, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(29, 'BV', 'BOUVET ISLAND', 'Bouvet Island', 'NUL', 0, 0, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(30, 'BR', 'BRAZIL', 'Brazil', 'BRA', 76, 55, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(31, 'IO', 'BRITISH INDIAN OCEAN TERRITORY', 'British Indian Ocean Territory', 'NUL', 0, 246, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(32, 'BN', 'BRUNEI DARUSSALAM', 'Brunei Darussalam', 'BRN', 96, 673, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(33, 'BG', 'BULGARIA', 'Bulgaria', 'BGR', 100, 359, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(34, 'BF', 'BURKINA FASO', 'Burkina Faso', 'BFA', 854, 226, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(35, 'BI', 'BURUNDI', 'Burundi', 'BDI', 108, 257, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(36, 'KH', 'CAMBODIA', 'Cambodia', 'KHM', 116, 855, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(37, 'CM', 'CAMEROON', 'Cameroon', 'CMR', 120, 237, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(38, 'CA', 'CANADA', 'Canada', 'CAN', 124, 1, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(39, 'CV', 'CAPE VERDE', 'Cape Verde', 'CPV', 132, 238, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(40, 'KY', 'CAYMAN ISLANDS', 'Cayman Islands', 'CYM', 136, 1345, '2016-12-13 03:19:35', '2016-12-13 03:19:35'), +(41, 'CF', 'CENTRAL AFRICAN REPUBLIC', 'Central African Republic', 'CAF', 140, 236, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(42, 'TD', 'CHAD', 'Chad', 'TCD', 148, 235, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(43, 'CL', 'CHILE', 'Chile', 'CHL', 152, 56, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(44, 'CN', 'CHINA', 'China', 'CHN', 156, 86, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(45, 'CX', 'CHRISTMAS ISLAND', 'Christmas Island', 'NUL', 0, 61, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(46, 'CC', 'COCOS (KEELING) ISLANDS', 'Cocos (Keeling) Islands', 'NUL', 0, 672, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(47, 'CO', 'COLOMBIA', 'Colombia', 'COL', 170, 57, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(48, 'KM', 'COMOROS', 'Comoros', 'COM', 174, 269, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(49, 'CG', 'CONGO', 'Congo', 'COG', 178, 242, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(50, 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'Congo, the Democratic Republic of the', 'COD', 180, 242, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(51, 'CK', 'COOK ISLANDS', 'Cook Islands', 'COK', 184, 682, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(52, 'CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188, 506, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(53, 'CI', 'COTE DIVOIRE', 'Cote DIvoire', 'CIV', 384, 225, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(54, 'HR', 'CROATIA', 'Croatia', 'HRV', 191, 385, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(55, 'CU', 'CUBA', 'Cuba', 'CUB', 192, 53, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(56, 'CY', 'CYPRUS', 'Cyprus', 'CYP', 196, 357, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(57, 'CZ', 'CZECH REPUBLIC', 'Czech Republic', 'CZE', 203, 420, '2016-12-13 03:19:36', '2016-12-13 03:19:36'), +(58, 'DK', 'DENMARK', 'Denmark', 'DNK', 208, 45, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(59, 'DJ', 'DJIBOUTI', 'Djibouti', 'DJI', 262, 253, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(60, 'DM', 'DOMINICA', 'Dominica', 'DMA', 212, 1767, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(61, 'DO', 'DOMINICAN REPUBLIC', 'Dominican Republic', 'DOM', 214, 1809, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(62, 'EC', 'ECUADOR', 'Ecuador', 'ECU', 218, 593, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(63, 'EG', 'EGYPT', 'Egypt', 'EGY', 818, 20, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(64, 'SV', 'EL SALVADOR', 'El Salvador', 'SLV', 222, 503, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(65, 'GQ', 'EQUATORIAL GUINEA', 'Equatorial Guinea', 'GNQ', 226, 240, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(66, 'ER', 'ERITREA', 'Eritrea', 'ERI', 232, 291, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(67, 'EE', 'ESTONIA', 'Estonia', 'EST', 233, 372, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(68, 'ET', 'ETHIOPIA', 'Ethiopia', 'ETH', 231, 251, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(69, 'FK', 'FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands (Malvinas)', 'FLK', 238, 500, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(70, 'FO', 'FAROE ISLANDS', 'Faroe Islands', 'FRO', 234, 298, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(71, 'FJ', 'FIJI', 'Fiji', 'FJI', 242, 679, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(72, 'FI', 'FINLAND', 'Finland', 'FIN', 246, 358, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(73, 'FR', 'FRANCE', 'France', 'FRA', 250, 33, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(74, 'GF', 'FRENCH GUIANA', 'French Guiana', 'GUF', 254, 594, '2016-12-13 03:19:37', '2016-12-13 03:19:37'), +(75, 'PF', 'FRENCH POLYNESIA', 'French Polynesia', 'PYF', 258, 689, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(76, 'TF', 'FRENCH SOUTHERN TERRITORIES', 'French Southern Territories', 'NUL', 0, 0, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(77, 'GA', 'GABON', 'Gabon', 'GAB', 266, 241, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(78, 'GM', 'GAMBIA', 'Gambia', 'GMB', 270, 220, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(79, 'GE', 'GEORGIA', 'Georgia', 'GEO', 268, 995, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(80, 'DE', 'GERMANY', 'Germany', 'DEU', 276, 49, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(81, 'GH', 'GHANA', 'Ghana', 'GHA', 288, 233, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(82, 'GI', 'GIBRALTAR', 'Gibraltar', 'GIB', 292, 350, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(83, 'GR', 'GREECE', 'Greece', 'GRC', 300, 30, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(84, 'GL', 'GREENLAND', 'Greenland', 'GRL', 304, 299, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(85, 'GD', 'GRENADA', 'Grenada', 'GRD', 308, 1473, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(86, 'GP', 'GUADELOUPE', 'Guadeloupe', 'GLP', 312, 590, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(87, 'GU', 'GUAM', 'Guam', 'GUM', 316, 1671, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(88, 'GT', 'GUATEMALA', 'Guatemala', 'GTM', 320, 502, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(89, 'GN', 'GUINEA', 'Guinea', 'GIN', 324, 224, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(90, 'GW', 'GUINEA-BISSAU', 'Guinea-Bissau', 'GNB', 624, 245, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(91, 'GY', 'GUYANA', 'Guyana', 'GUY', 328, 592, '2016-12-13 03:19:38', '2016-12-13 03:19:38'), +(92, 'HT', 'HAITI', 'Haiti', 'HTI', 332, 509, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(93, 'HM', 'HEARD ISLAND AND MCDONALD ISLANDS', 'Heard Island and Mcdonald Islands', 'NUL', 0, 0, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(94, 'VA', 'HOLY SEE (VATICAN CITY STATE)', 'Holy See (Vatican City State)', 'VAT', 336, 39, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(95, 'HN', 'HONDURAS', 'Honduras', 'HND', 340, 504, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(96, 'HK', 'HONG KONG', 'Hong Kong', 'HKG', 344, 852, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(97, 'HU', 'HUNGARY', 'Hungary', 'HUN', 348, 36, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(98, 'IS', 'ICELAND', 'Iceland', 'ISL', 352, 354, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(99, 'IN', 'INDIA', 'India', 'IND', 356, 91, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(100, 'ID', 'INDONESIA', 'Indonesia', 'IDN', 360, 62, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(101, 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 'Iran, Islamic Republic of', 'IRN', 364, 98, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(102, 'IQ', 'IRAQ', 'Iraq', 'IRQ', 368, 964, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(103, 'IE', 'IRELAND', 'Ireland', 'IRL', 372, 353, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(104, 'IL', 'ISRAEL', 'Israel', 'ISR', 376, 972, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(105, 'IT', 'ITALY', 'Italy', 'ITA', 380, 39, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(106, 'JM', 'JAMAICA', 'Jamaica', 'JAM', 388, 1876, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(107, 'JP', 'JAPAN', 'Japan', 'JPN', 392, 81, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(108, 'JO', 'JORDAN', 'Jordan', 'JOR', 400, 962, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(109, 'KZ', 'KAZAKHSTAN', 'Kazakhstan', 'KAZ', 398, 7, '2016-12-13 03:19:39', '2016-12-13 03:19:39'), +(110, 'KE', 'KENYA', 'Kenya', 'KEN', 404, 254, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(111, 'KI', 'KIRIBATI', 'Kiribati', 'KIR', 296, 686, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(112, 'KP', 'KOREA, DEMOCRATIC PEOPLES REPUBLIC OF', 'Korea, Democratic Peoples Republic of', 'PRK', 408, 850, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(113, 'KR', 'KOREA, REPUBLIC OF', 'Korea, Republic of', 'KOR', 410, 82, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(114, 'KW', 'KUWAIT', 'Kuwait', 'KWT', 414, 965, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(115, 'KG', 'KYRGYZSTAN', 'Kyrgyzstan', 'KGZ', 417, 996, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(116, 'LA', 'LAO PEOPLES DEMOCRATIC REPUBLIC', 'Lao Peoples Democratic Republic', 'LAO', 418, 856, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(117, 'LV', 'LATVIA', 'Latvia', 'LVA', 428, 371, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(118, 'LB', 'LEBANON', 'Lebanon', 'LBN', 422, 961, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(119, 'LS', 'LESOTHO', 'Lesotho', 'LSO', 426, 266, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(120, 'LR', 'LIBERIA', 'Liberia', 'LBR', 430, 231, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(121, 'LY', 'LIBYAN ARAB JAMAHIRIYA', 'Libyan Arab Jamahiriya', 'LBY', 434, 218, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(122, 'LI', 'LIECHTENSTEIN', 'Liechtenstein', 'LIE', 438, 423, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(123, 'LT', 'LITHUANIA', 'Lithuania', 'LTU', 440, 370, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(124, 'LU', 'LUXEMBOURG', 'Luxembourg', 'LUX', 442, 352, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(125, 'MO', 'MACAO', 'Macao', 'MAC', 446, 853, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(126, 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Macedonia, the Former Yugoslav Republic of', 'MKD', 807, 389, '2016-12-13 03:19:40', '2016-12-13 03:19:40'), +(127, 'MG', 'MADAGASCAR', 'Madagascar', 'MDG', 450, 261, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(128, 'MW', 'MALAWI', 'Malawi', 'MWI', 454, 265, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(129, 'MY', 'MALAYSIA', 'Malaysia', 'MYS', 458, 60, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(130, 'MV', 'MALDIVES', 'Maldives', 'MDV', 462, 960, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(131, 'ML', 'MALI', 'Mali', 'MLI', 466, 223, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(132, 'MT', 'MALTA', 'Malta', 'MLT', 470, 356, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(133, 'MH', 'MARSHALL ISLANDS', 'Marshall Islands', 'MHL', 584, 692, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(134, 'MQ', 'MARTINIQUE', 'Martinique', 'MTQ', 474, 596, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(135, 'MR', 'MAURITANIA', 'Mauritania', 'MRT', 478, 222, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(136, 'MU', 'MAURITIUS', 'Mauritius', 'MUS', 480, 230, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(137, 'YT', 'MAYOTTE', 'Mayotte', 'NUL', 0, 269, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(138, 'MX', 'MEXICO', 'Mexico', 'MEX', 484, 52, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(139, 'FM', 'MICRONESIA, FEDERATED STATES OF', 'Micronesia, Federated States of', 'FSM', 583, 691, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(140, 'MD', 'MOLDOVA, REPUBLIC OF', 'Moldova, Republic of', 'MDA', 498, 373, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(141, 'MC', 'MONACO', 'Monaco', 'MCO', 492, 377, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(142, 'MN', 'MONGOLIA', 'Mongolia', 'MNG', 496, 976, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(143, 'MS', 'MONTSERRAT', 'Montserrat', 'MSR', 500, 1664, '2016-12-13 03:19:41', '2016-12-13 03:19:41'), +(144, 'MA', 'MOROCCO', 'Morocco', 'MAR', 504, 212, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(145, 'MZ', 'MOZAMBIQUE', 'Mozambique', 'MOZ', 508, 258, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(146, 'MM', 'MYANMAR', 'Myanmar', 'MMR', 104, 95, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(147, 'NA', 'NAMIBIA', 'Namibia', 'NAM', 516, 264, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(148, 'NR', 'NAURU', 'Nauru', 'NRU', 520, 674, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(149, 'NP', 'NEPAL', 'Nepal', 'NPL', 524, 977, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(150, 'NL', 'NETHERLANDS', 'Netherlands', 'NLD', 528, 31, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(151, 'AN', 'NETHERLANDS ANTILLES', 'Netherlands Antilles', 'ANT', 530, 599, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(152, 'NC', 'NEW CALEDONIA', 'New Caledonia', 'NCL', 540, 687, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(153, 'NZ', 'NEW ZEALAND', 'New Zealand', 'NZL', 554, 64, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(154, 'NI', 'NICARAGUA', 'Nicaragua', 'NIC', 558, 505, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(155, 'NE', 'NIGER', 'Niger', 'NER', 562, 227, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(156, 'NG', 'NIGERIA', 'Nigeria', 'NGA', 566, 234, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(157, 'NU', 'NIUE', 'Niue', 'NIU', 570, 683, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(158, 'NF', 'NORFOLK ISLAND', 'Norfolk Island', 'NFK', 574, 672, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(159, 'MP', 'NORTHERN MARIANA ISLANDS', 'Northern Mariana Islands', 'MNP', 580, 1670, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(160, 'NO', 'NORWAY', 'Norway', 'NOR', 578, 47, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(161, 'OM', 'OMAN', 'Oman', 'OMN', 512, 968, '2016-12-13 03:19:42', '2016-12-13 03:19:42'), +(162, 'PK', 'PAKISTAN', 'Pakistan', 'PAK', 586, 92, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(163, 'PW', 'PALAU', 'Palau', 'PLW', 585, 680, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(164, 'PS', 'PALESTINIAN TERRITORY, OCCUPIED', 'Palestinian Territory, Occupied', 'NUL', 0, 970, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(165, 'PA', 'PANAMA', 'Panama', 'PAN', 591, 507, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(166, 'PG', 'PAPUA NEW GUINEA', 'Papua New Guinea', 'PNG', 598, 675, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(167, 'PY', 'PARAGUAY', 'Paraguay', 'PRY', 600, 595, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(168, 'PE', 'PERU', 'Peru', 'PER', 604, 51, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(169, 'PH', 'PHILIPPINES', 'Philippines', 'PHL', 608, 63, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(170, 'PN', 'PITCAIRN', 'Pitcairn', 'PCN', 612, 0, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(171, 'PL', 'POLAND', 'Poland', 'POL', 616, 48, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(172, 'PT', 'PORTUGAL', 'Portugal', 'PRT', 620, 351, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(173, 'PR', 'PUERTO RICO', 'Puerto Rico', 'PRI', 630, 1787, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(174, 'QA', 'QATAR', 'Qatar', 'QAT', 634, 974, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(175, 'RE', 'REUNION', 'Reunion', 'REU', 638, 262, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(176, 'RO', 'ROMANIA', 'Romania', 'ROM', 642, 40, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 70, '2016-12-13 03:19:43', '2016-12-13 03:19:43'), +(178, 'RW', 'RWANDA', 'Rwanda', 'RWA', 646, 250, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(179, 'SH', 'SAINT HELENA', 'Saint Helena', 'SHN', 654, 290, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(180, 'KN', 'SAINT KITTS AND NEVIS', 'Saint Kitts and Nevis', 'KNA', 659, 1869, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(181, 'LC', 'SAINT LUCIA', 'Saint Lucia', 'LCA', 662, 1758, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(182, 'PM', 'SAINT PIERRE AND MIQUELON', 'Saint Pierre and Miquelon', 'SPM', 666, 508, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(183, 'VC', 'SAINT VINCENT AND THE GRENADINES', 'Saint Vincent and the Grenadines', 'VCT', 670, 1784, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(184, 'WS', 'SAMOA', 'Samoa', 'WSM', 882, 684, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(185, 'SM', 'SAN MARINO', 'San Marino', 'SMR', 674, 378, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(186, 'ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678, 239, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(187, 'SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682, 966, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(188, 'SN', 'SENEGAL', 'Senegal', 'SEN', 686, 221, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(189, 'CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', 'NUL', 0, 381, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(190, 'SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690, 248, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(191, 'SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694, 232, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(192, 'SG', 'SINGAPORE', 'Singapore', 'SGP', 702, 65, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(193, 'SK', 'SLOVAKIA', 'Slovakia', 'SVK', 703, 421, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(194, 'SI', 'SLOVENIA', 'Slovenia', 'SVN', 705, 386, '2016-12-13 03:19:44', '2016-12-13 03:19:44'), +(195, 'SB', 'SOLOMON ISLANDS', 'Solomon Islands', 'SLB', 90, 677, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(196, 'SO', 'SOMALIA', 'Somalia', 'SOM', 706, 252, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(197, 'ZA', 'SOUTH AFRICA', 'South Africa', 'ZAF', 710, 27, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(198, 'GS', 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'South Georgia and the South Sandwich Islands', 'NUL', 0, 0, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(199, 'ES', 'SPAIN', 'Spain', 'ESP', 724, 34, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(200, 'LK', 'SRI LANKA', 'Sri Lanka', 'LKA', 144, 94, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(201, 'SD', 'SUDAN', 'Sudan', 'SDN', 736, 249, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(202, 'SR', 'SURINAME', 'Suriname', 'SUR', 740, 597, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(203, 'SJ', 'SVALBARD AND JAN MAYEN', 'Svalbard and Jan Mayen', 'SJM', 744, 47, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(204, 'SZ', 'SWAZILAND', 'Swaziland', 'SWZ', 748, 268, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(205, 'SE', 'SWEDEN', 'Sweden', 'SWE', 752, 46, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(206, 'CH', 'SWITZERLAND', 'Switzerland', 'CHE', 756, 41, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(207, 'SY', 'SYRIAN ARAB REPUBLIC', 'Syrian Arab Republic', 'SYR', 760, 963, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(208, 'TW', 'TAIWAN, PROVINCE OF CHINA', 'Taiwan, Province of China', 'TWN', 158, 886, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(209, 'TJ', 'TAJIKISTAN', 'Tajikistan', 'TJK', 762, 992, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(210, 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 'Tanzania, United Republic of', 'TZA', 834, 255, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(211, 'TH', 'THAILAND', 'Thailand', 'THA', 764, 66, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(212, 'TL', 'TIMOR-LESTE', 'Timor-Leste', 'NUL', 0, 670, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(213, 'TG', 'TOGO', 'Togo', 'TGO', 768, 228, '2016-12-13 03:19:45', '2016-12-13 03:19:45'), +(214, 'TK', 'TOKELAU', 'Tokelau', 'TKL', 772, 690, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(215, 'TO', 'TONGA', 'Tonga', 'TON', 776, 676, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(216, 'TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780, 1868, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(217, 'TN', 'TUNISIA', 'Tunisia', 'TUN', 788, 216, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(218, 'TR', 'TURKEY', 'Turkey', 'TUR', 792, 90, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(219, 'TM', 'TURKMENISTAN', 'Turkmenistan', 'TKM', 795, 7370, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(220, 'TC', 'TURKS AND CAICOS ISLANDS', 'Turks and Caicos Islands', 'TCA', 796, 1649, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(221, 'TV', 'TUVALU', 'Tuvalu', 'TUV', 798, 688, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(222, 'UG', 'UGANDA', 'Uganda', 'UGA', 800, 256, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(223, 'UA', 'UKRAINE', 'Ukraine', 'UKR', 804, 380, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(224, 'AE', 'UNITED ARAB EMIRATES', 'United Arab Emirates', 'ARE', 784, 971, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(225, 'GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826, 44, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(226, 'US', 'UNITED STATES', 'United States', 'USA', 840, 1, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(227, 'UM', 'UNITED STATES MINOR OUTLYING ISLANDS', 'United States Minor Outlying Islands', 'NUL', 0, 1, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(228, 'UY', 'URUGUAY', 'Uruguay', 'URY', 858, 598, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(229, 'UZ', 'UZBEKISTAN', 'Uzbekistan', 'UZB', 860, 998, '2016-12-13 03:19:46', '2016-12-13 03:19:46'), +(230, 'VU', 'VANUATU', 'Vanuatu', 'VUT', 548, 678, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(231, 'VE', 'VENEZUELA', 'Venezuela', 'VEN', 862, 58, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(232, 'VN', 'VIET NAM', 'Viet Nam', 'VNM', 704, 84, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(233, 'VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', 92, 1284, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(234, 'VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', 850, 1340, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(235, 'WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', 876, 681, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(236, 'EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732, 212, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(237, 'YE', 'YEMEN', 'Yemen', 'YEM', 887, 967, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(238, 'ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894, 260, '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(239, 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716, 263, '2016-12-13 03:19:47', '2016-12-13 03:19:47'); -- -------------------------------------------------------- @@ -540,9 +519,9 @@ CREATE TABLE IF NOT EXISTS `department` ( -- INSERT INTO `department` (`id`, `name`, `type`, `sla`, `manager`, `ticket_assignment`, `outgoing_email`, `template_set`, `auto_ticket_response`, `auto_message_response`, `auto_response_email`, `recipient`, `group_access`, `department_sign`, `created_at`, `updated_at`) VALUES -(1, 'Support', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-11-29 23:28:15', '2016-11-29 23:28:15'), -(2, 'Sales', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-11-29 23:28:15', '2016-11-29 23:28:15'), -(3, 'Operation', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-11-29 23:28:15', '2016-11-29 23:28:15'); +(1, 'Support', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(2, 'Sales', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-12-13 03:19:28', '2016-12-13 03:19:28'), +(3, 'Operation', '1', 1, NULL, '', '', '', '', '', '', '', '', '', '2016-12-13 03:19:28', '2016-12-13 03:19:28'); -- -------------------------------------------------------- @@ -658,29 +637,6 @@ CREATE TABLE IF NOT EXISTS `field_values` ( -- -------------------------------------------------------- --- --- Table structure for table `followup` --- - -CREATE TABLE IF NOT EXISTS `followup` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `condition` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; - --- --- Dumping data for table `followup` --- - -INSERT INTO `followup` (`id`, `name`, `status`, `condition`, `created_at`, `updated_at`) VALUES -(1, 'followup', '', '', '2016-11-29 23:28:11', '2016-11-29 23:28:11'); - --- -------------------------------------------------------- - -- -- Table structure for table `groups` -- @@ -712,9 +668,9 @@ CREATE TABLE IF NOT EXISTS `groups` ( -- INSERT INTO `groups` (`id`, `name`, `group_status`, `can_create_ticket`, `can_edit_ticket`, `can_post_ticket`, `can_close_ticket`, `can_assign_ticket`, `can_transfer_ticket`, `can_delete_ticket`, `can_ban_email`, `can_manage_canned`, `can_manage_faq`, `can_view_agent_stats`, `department_access`, `admin_notes`, `created_at`, `updated_at`) VALUES -(1, 'Group A', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(2, 'Group B', 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(3, 'Group C', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'); +(1, 'Group A', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(2, 'Group B', 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(3, 'Group C', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'); -- -------------------------------------------------------- @@ -771,9 +727,9 @@ CREATE TABLE IF NOT EXISTS `help_topic` ( -- INSERT INTO `help_topic` (`id`, `topic`, `parent_topic`, `custom_form`, `department`, `ticket_status`, `priority`, `sla_plan`, `thank_page`, `ticket_num_format`, `internal_notes`, `status`, `type`, `auto_assign`, `auto_response`, `created_at`, `updated_at`) VALUES -(1, 'Support query', '', NULL, 1, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-11-29 23:28:15', '2016-11-29 23:28:15'), -(2, 'Sales query', '', NULL, 2, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-11-29 23:28:16', '2016-11-29 23:45:44'), -(3, 'Operational query', '', NULL, 3, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-11-29 23:28:16', '2016-11-29 23:45:54'); +(1, 'Support query', '', NULL, 1, 1, 2, 1, '', '1', '', 1, 1, NULL, 0, '2016-12-13 03:19:28', '2016-12-13 03:19:28'), +(2, 'Sales query', '', NULL, 2, 1, 2, 1, '', '1', '', 0, 1, NULL, 0, '2016-12-13 03:19:28', '2016-12-13 03:19:28'), +(3, 'Operational query', '', NULL, 3, 1, 2, 1, '', '1', '', 0, 1, NULL, 0, '2016-12-13 03:19:28', '2016-12-13 03:19:28'); -- -------------------------------------------------------- @@ -792,8 +748,7 @@ CREATE TABLE IF NOT EXISTS `jobs` ( `created_at` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_reserved_reserved_at_index` (`queue`,`reserved`,`reserved_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=17 ; - +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -819,13 +774,13 @@ CREATE TABLE IF NOT EXISTS `kb_article` ( -- INSERT INTO `kb_article` (`id`, `name`, `slug`, `description`, `status`, `type`, `publish_time`, `created_at`, `updated_at`) VALUES -(1, 'DISCLAIMERS', 'disclaimers', '

ABC clothing.com does not promise that the site will be inoffensive, error-free or uninterrupted, or that it will provide specific information from use of the site or any content, search, or link on it. The site and its content are delivered on an “as-is” and “as-available” basis. ABC clothing.com cannot ensure that files you download from the site will be free of viruses or contamination or destructive features.

\r\n\r\n

Thebclothing.com disclaims all warranties, express or implied, including any implied warranties of merchantability and fitness for a particular purpose. ABC clothing.com will not be liable for any damages of any kind arising from the use of this site, including, without limitation, direct, indirect, incidental, and punitive and consequential damages.

\r\n\r\n

ABC clothing.com disclaims any and all liability for the acts, omissions, and conduct of any third-party users, ABC clothing.com users, advertisers, and/or sponsors on the Site, in connection with the Site, or other-wise related to your use of the Site. ABC clothing.com is not responsible for the products, services, actions, or failure to act of any third party in connection with or referenced on the Site. Without limiting the fore-going, you may report the misconduct of users and/or third-party advertisers or service and/or product providers referenced on or included in the Site to ABC clothing.com at Support@abcclothing.com

\r\n\r\n

ABC clothing.com may investigate the claim and take appropriate action, at its sole discretion.

\r\n\r\n

For any query kindly drop mail us on  Support@abcclothing.com.

\r\n', 1, 1, '2016-11-30 05:32:00', '2016-11-30 00:03:45', '2016-11-30 00:03:45'), -(2, 'CUSTOM ORDER', 'custom-order', '

You saw, you liked but couldn’t see your size? We will custom make it for you.

\r\n\r\n

How it works:

\r\n\r\n
  1. You liked something and want to modify a little or have something else on mind, do pen it down and share it with us on Support@abcclothing.com
  2. \r\n
  3. We’ll work out the price depending on how detailed or intricate you want your garment.
  4. \r\n
  5. An advance would be required for any customized orders.
  6. \r\n
  7. Once you’ve placed a deposit, we’ll make you a sketch of the garment.
  8. \r\n
  9. We can complete your order in 15-20 days depending on the workload.
  10. \r\n
  11. We will also share some updates on the garment in case something needs to be changed.
  12. \r\n
  13. We finally ship it to your given address.
  14. \r\n

Note: No returns and refunds.

\r\n', 1, 1, '2016-11-30 05:34:00', '2016-11-30 00:04:57', '2016-11-30 00:04:57'), -(3, 'TROUSER SKIRTS', 'trouser-skirts', '

Paris takes its fashion very, very seriously. So seriously, in fact, that wearing the wrong thing has actually caused a riot.

\r\n\r\n

In 1911, two rival Parisian couture houses launched their "trouser skirts," an innovation in fashion that trod the very fixed line between the genders and seemed to promise greater flexibility for women in general. There were two different versions of the trouser skirt: One was a sort of baggy pant with a very low hanging crotch, described as "a sack with holes made for the legs to go through," not unlike the fashions on high streets today, and the other a pair of the same kind of pants topped with an over-skirt, again, not unlike high street fashions of today. Both versions were launched by models at the opening day of racing season to general revulsion and disgust, but thankfully, no violence.

\r\n\r\n

It wasn''t until the ladies attempted to promenade their future fashions on the boulevards that the fisticuffs started—at the Place de l''Opera, the poor models were attacked by a jeering mob of fashion Philistines, who pulled their hair, trampled their hats, and reduced them to tears. A squad of police officers on bicycles were dispatched to rescue the girls and escort them to safety.

\r\n', 1, 1, '2016-11-30 05:35:00', '2016-11-30 00:05:53', '2016-11-30 00:05:53'), -(4, 'SECURE SHOPPING GUARANTEE', 'secure-shopping-guarantee', '

We accept all major Indian and International Credit/ Debit Cards, and Net Banking with over 40 Banks.

\r\n\r\n

NO Cash on Delivery (as random people order and share false addresses for fun)

\r\n\r\n

Yes, shopping at our e-store is 100% safe. All payment requests are directed to the secured PayU Payment Gateway. This gives you the highest level of protection possible whenever you use credit cards or make other financial or confidential transactions over the Internet.

\r\n\r\n

You can be assured that our e-store offers you the highest standards of security currently available on the net so as to ensure that your shopping experience is private, safe and secure.

\r\n', 1, 1, '2016-11-30 05:36:00', '2016-11-30 00:06:39', '2016-11-30 00:06:39'), -(5, 'PRIVACY POLICY', 'privacy-policy', '

The ABC Clothing collects your basic information to service your requests. This basic information is gathered when you purchase products/Gift card vouchers or when you sign up for e-mail notifications. Information gathered from you includes your name, mailing address, e-mail and phone number. Only when you place an order, your card information is requested and is submitted via the highest level of encryption to make sure of the greatest amount of safety and security. Reason why we gather this information:

\r\n\r\n

To process your order.
\r\nShipping and Customer Service.
\r\nWe also use the information to upgrade our products, customer services, website content and navigation.

\r\n\r\n


Internal Record Keeping.
\r\nWe at The ABC Clothing respect that you do not want your personal information shared with other companies. The information you provide shall, therefore, be only used to process your order and customer support. The ABC Clothing does not share, sell or rent customer information to any other company.

\r\n', 1, 1, '2016-11-30 05:36:00', '2016-11-30 00:07:18', '2016-11-30 00:07:18'), -(6, ' SHIPPING POLICY', 'shipping-policy', '

We ship worldwide. We use FedEx/DTDC for shipping.

\r\n\r\n

Standard Shipping is usually 3-7 Working days for orders within India and 12-15 Working days for International Orders, but usually faster. IF your order doesn’t reach you in time, you may write to us at support@abcclothing.com

\r\n\r\n

International Orders

\r\n\r\n

For international orders, please note, your shipping will be calculated at the time of Check out only, this is a System Generated amount, based on your Zip Code, Region and Order Weight. (Approx Costs Rs.1250-1500 for 500 gms – International Shipment, subject to region)

\r\n\r\n

Tracking

\r\n\r\n

For tracking your order go to the following website, it will require your tracking ID which is sent via mail in your invoice.

\r\n', 1, 1, '2016-11-30 05:37:00', '2016-11-30 00:08:01', '2016-11-30 00:08:01'), -(7, 'RETURN & CANCELLATION', 'return-cancellation', '

Size doesn’t fit you or the Apparel/ Product is damaged/ defective can be returned in its original packing within 7 days of delivery. Once we have verified the damage, defect and/or error, you shall receive a replacement or a full refund for the Product in the original means of payment.

\r\n\r\n


\r\nThe B Clothing reserves the right to refuse a payment on a return of product purchased from www.thebclothing.com if the product is not received in its original condition, or is received damaged or has been used. All products to be returned must be notified to The B Clothing within 7 Days of receipt of your order..

\r\n\r\n


\r\nIn case of International shipments, customers may return any products that they have a size issue with if they are willing to bear the shipping costs. In case of damaged or defective products, International customers would need to send images of the product in its original packaging to support@abcclothing.com to claim a refund. Also, for damages and defects, the customer must notify ABC Clothing within 2 days of receiving the product.

\r\n\r\n


\r\nIn case of any returns that are approved, the purchase amount will be refunded to the customer within 15 business days upon receipt of return package, deducting any applicable return-processing fee.

\r\n\r\n


\r\nThe following mode of refund payments will be used:
\r\n• If online payment, then amount will be refunded online.

\r\n\r\n


\r\nAny requests for cancellation of orders placed should be made immediately by contacting support@abc clothing.com. If the order has been processed or shipped, the applicable order cancellation charges will be applied.

\r\n\r\n

 

\r\n', 1, 1, '2016-11-30 05:38:00', '2016-11-30 00:08:41', '2016-11-30 00:08:41'); +(1, 'DISCLAIMERS', 'disclaimers', '

ABC clothing.com does not promise that the site will be inoffensive, error-free or uninterrupted, or that it will provide specific information from use of the site or any content, search, or link on it. The site and its content are delivered on an “as-is” and “as-available” basis. ABC clothing.com cannot ensure that files you download from the site will be free of viruses or contamination or destructive features.

\r\n\r\n

Thebclothing.com disclaims all warranties, express or implied, including any implied warranties of merchantability and fitness for a particular purpose. ABC clothing.com will not be liable for any damages of any kind arising from the use of this site, including, without limitation, direct, indirect, incidental, and punitive and consequential damages.

\r\n\r\n

ABC clothing.com disclaims any and all liability for the acts, omissions, and conduct of any third-party users, ABC clothing.com users, advertisers, and/or sponsors on the Site, in connection with the Site, or other-wise related to your use of the Site. ABC clothing.com is not responsible for the products, services, actions, or failure to act of any third party in connection with or referenced on the Site. Without limiting the fore-going, you may report the misconduct of users and/or third-party advertisers or service and/or product providers referenced on or included in the Site to ABC clothing.com at Support@abcclothing.com

\r\n\r\n

ABC clothing.com may investigate the claim and take appropriate action, at its sole discretion.

\r\n\r\n

For any query kindly drop mail us on  Support@abcclothing.com.

\r\n', 1, 1, '2016-12-13 08:54:00', '2016-12-13 03:25:28', '2016-12-13 03:25:28'), +(2, 'CUSTOM ORDER', 'custom-order', '

You saw, you liked but couldn’t see your size? We will custom make it for you.

\r\n\r\n

How it works:

\r\n\r\n
  1. You liked something and want to modify a little or have something else on mind, do pen it down and share it with us on Support@abcclothing.com
  2. \r\n
  3. We’ll work out the price depending on how detailed or intricate you want your garment.
  4. \r\n
  5. An advance would be required for any customized orders.
  6. \r\n
  7. Once you’ve placed a deposit, we’ll make you a sketch of the garment.
  8. \r\n
  9. We can complete your order in 15-20 days depending on the workload.
  10. \r\n
  11. We will also share some updates on the garment in case something needs to be changed.
  12. \r\n
  13. We finally ship it to your given address.
  14. \r\n

Note: No returns and refunds.

\r\n', 1, 1, '2016-12-13 08:56:00', '2016-12-13 03:26:24', '2016-12-13 03:26:24'), +(3, 'TROUSER SKIRTS', 'trouser-skirts', '

Paris takes its fashion very, very seriously. So seriously, in fact, that wearing the wrong thing has actually caused a riot.

\r\n\r\n

In 1911, two rival Parisian couture houses launched their "trouser skirts," an innovation in fashion that trod the very fixed line between the genders and seemed to promise greater flexibility for women in general. There were two different versions of the trouser skirt: One was a sort of baggy pant with a very low hanging crotch, described as "a sack with holes made for the legs to go through," not unlike the fashions on high streets today, and the other a pair of the same kind of pants topped with an over-skirt, again, not unlike high street fashions of today. Both versions were launched by models at the opening day of racing season to general revulsion and disgust, but thankfully, no violence.

\r\n\r\n

It wasn''t until the ladies attempted to promenade their future fashions on the boulevards that the fisticuffs started—at the Place de l''Opera, the poor models were attacked by a jeering mob of fashion Philistines, who pulled their hair, trampled their hats, and reduced them to tears. A squad of police officers on bicycles were dispatched to rescue the girls and escort them to safety.

\r\n', 1, 1, '2016-12-13 08:56:00', '2016-12-13 03:27:02', '2016-12-13 03:27:02'), +(4, 'SECURE SHOPPING GUARANTEE', 'secure-shopping-guarantee', '

We accept all major Indian and International Credit/ Debit Cards, and Net Banking with over 40 Banks.

\r\n\r\n

NO Cash on Delivery (as random people order and share false addresses for fun)

\r\n\r\n

Yes, shopping at our e-store is 100% safe. All payment requests are directed to the secured PayU Payment Gateway. This gives you the highest level of protection possible whenever you use credit cards or make other financial or confidential transactions over the Internet.

\r\n\r\n

You can be assured that our e-store offers you the highest standards of security currently available on the net so as to ensure that your shopping experience is private, safe and secure.

\r\n', 1, 1, '2016-12-13 08:57:00', '2016-12-13 03:27:42', '2016-12-13 03:27:42'), +(5, 'PRIVACY POLICY', 'privacy-policy', '

The ABC Clothing collects your basic information to service your requests. This basic information is gathered when you purchase products/Gift card vouchers or when you sign up for e-mail notifications. Information gathered from you includes your name, mailing address, e-mail and phone number. Only when you place an order, your card information is requested and is submitted via the highest level of encryption to make sure of the greatest amount of safety and security. Reason why we gather this information:

\r\n\r\n

To process your order.
\r\nShipping and Customer Service.
\r\nWe also use the information to upgrade our products, customer services, website content and navigation.

\r\n\r\n


Internal Record Keeping.
\r\nWe at The ABC Clothing respect that you do not want your personal information shared with other companies. The information you provide shall, therefore, be only used to process your order and customer support. The ABC Clothing does not share, sell or rent customer information to any other company.

\r\n', 1, 1, '2016-12-13 08:58:00', '2016-12-13 03:28:31', '2016-12-13 03:28:31'), +(6, ' SHIPPING POLICY', 'shipping-policy', '

We ship worldwide. We use FedEx/DTDC for shipping.

\r\n\r\n

Standard Shipping is usually 3-7 Working days for orders within India and 12-15 Working days for International Orders, but usually faster. IF your order doesn’t reach you in time, you may write to us at support@abcclothing.com

\r\n\r\n

International Orders

\r\n\r\n

For international orders, please note, your shipping will be calculated at the time of Check out only, this is a System Generated amount, based on your Zip Code, Region and Order Weight. (Approx Costs Rs.1250-1500 for 500 gms – International Shipment, subject to region)

\r\n\r\n

Tracking

\r\n\r\n

For tracking your order go to the following website, it will require your tracking ID which is sent via mail in your invoice.

\r\n', 1, 1, '2016-12-13 08:58:00', '2016-12-13 03:29:34', '2016-12-13 03:29:34'), +(7, 'RETURN & CANCELLATION', 'return-cancellation', '

Size doesn’t fit you or the Apparel/ Product is damaged/ defective can be returned in its original packing within 7 days of delivery. Once we have verified the damage, defect and/or error, you shall receive a replacement or a full refund for the Product in the original means of payment.

\r\n\r\n


\r\nThe B Clothing reserves the right to refuse a payment on a return of product purchased from www.thebclothing.com if the product is not received in its original condition, or is received damaged or has been used. All products to be returned must be notified to The B Clothing within 7 Days of receipt of your order..

\r\n\r\n


\r\nIn case of International shipments, customers may return any products that they have a size issue with if they are willing to bear the shipping costs. In case of damaged or defective products, International customers would need to send images of the product in its original packaging to support@abcclothing.com to claim a refund. Also, for damages and defects, the customer must notify ABC Clothing within 2 days of receiving the product.

\r\n\r\n


\r\nIn case of any returns that are approved, the purchase amount will be refunded to the customer within 15 business days upon receipt of return package, deducting any applicable return-processing fee.

\r\n\r\n


\r\nThe following mode of refund payments will be used:
\r\n• If online payment, then amount will be refunded online.

\r\n\r\n


\r\nAny requests for cancellation of orders placed should be made immediately by contacting support@abc clothing.com. If the order has been processed or shipped, the applicable order cancellation charges will be applied.

\r\n\r\n

 

\r\n', 1, 1, '2016-12-13 08:59:00', '2016-12-13 03:30:14', '2016-12-13 03:30:14'); -- -------------------------------------------------------- @@ -880,8 +835,8 @@ CREATE TABLE IF NOT EXISTS `kb_category` ( -- INSERT INTO `kb_category` (`id`, `name`, `slug`, `description`, `status`, `parent`, `created_at`, `updated_at`) VALUES -(1, 'Issue Handeling', 'issue-handeling', 'These are the list of error handling issue.', 1, 0, '2016-11-30 00:00:34', '2016-11-30 00:00:34'), -(2, 'Policy', 'policy', 'These are the policies defined by this organization.', 1, 0, '2016-11-30 00:01:29', '2016-11-30 00:01:29'); +(1, 'Issue Handeling', 'issue-handeling', 'These are the list of error handling issue.', 1, 0, '2016-12-13 03:23:54', '2016-12-13 03:23:54'), +(2, 'Policy', 'policy', 'These are the policies defined by this organization.', 1, 0, '2016-12-13 03:24:38', '2016-12-13 03:24:38'); -- -------------------------------------------------------- @@ -940,7 +895,7 @@ CREATE TABLE IF NOT EXISTS `kb_settings` ( -- INSERT INTO `kb_settings` (`id`, `pagination`, `created_at`, `updated_at`) VALUES -(1, 10, '2016-11-29 23:28:20', '2016-11-29 23:28:20'); +(1, 10, '2016-12-13 03:19:32', '2016-12-13 03:19:32'); -- -------------------------------------------------------- @@ -992,7 +947,7 @@ CREATE TABLE IF NOT EXISTS `login_attempts` ( -- INSERT INTO `login_attempts` (`id`, `User`, `IP`, `Attempts`, `LastLogin`, `created_at`, `updated_at`) VALUES -(1, 'demo@admin.com', '::1', '2', '2016-11-30 05:56:00', '2016-11-29 23:28:47', '2016-11-29 23:28:47'); +(1, '', '', '', '0000-00-00 00:00:00', '2016-12-13 03:19:53', '2016-12-13 03:19:53'); -- -------------------------------------------------------- @@ -1013,7 +968,7 @@ CREATE TABLE IF NOT EXISTS `log_notification` ( -- INSERT INTO `log_notification` (`id`, `log`, `created_at`, `updated_at`) VALUES -(1, 'NOT-1', '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 'NOT-1', '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1058,12 +1013,12 @@ CREATE TABLE IF NOT EXISTS `mail_services` ( -- INSERT INTO `mail_services` (`id`, `name`, `short_name`, `created_at`, `updated_at`) VALUES -(1, 'SMTP', 'smtp', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(2, 'Php Mail', 'mail', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(3, 'Send Mail', 'sendmail', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(4, 'Mailgun', 'mailgun', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(5, 'Mandrill', 'mandrill', '2016-11-29 23:27:50', '2016-11-29 23:27:50'), -(6, 'Log file', 'log', '2016-11-29 23:27:50', '2016-11-29 23:27:50'); +(1, 'SMTP', 'smtp', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(2, 'Php Mail', 'mail', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(3, 'Send Mail', 'sendmail', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(4, 'Mailgun', 'mailgun', '2016-12-13 03:19:08', '2016-12-13 03:19:08'), +(5, 'Mandrill', 'mandrill', '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(6, 'Log file', 'log', '2016-12-13 03:19:09', '2016-12-13 03:19:09'); -- -------------------------------------------------------- @@ -1178,8 +1133,7 @@ INSERT INTO `migrations` (`migration`, `batch`) VALUES ('2016_08_08_095744_create_social_media_table', 1), ('2016_08_12_104410_create_user_additional_infos_table', 1), ('2016_08_16_104539_alter_ticket_source_table', 1), -('2016_08_31_223407_create_approval_table', 1), -('2016_09_02_165516_create_follow_up_table', 1); +('2016_11_30_122809_alter_attachment_table', 2); -- -------------------------------------------------------- @@ -1195,19 +1149,20 @@ CREATE TABLE IF NOT EXISTS `notifications` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `notifications` -- INSERT INTO `notifications` (`id`, `model_id`, `userid_created`, `type_id`, `created_at`, `updated_at`) VALUES -(1, 1, 2, 3, '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(2, 2, 2, 3, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(3, 3, 3, 3, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(4, 4, 3, 3, '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(5, 5, 3, 3, '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(6, 4, 1, 2, '2016-11-30 00:28:23', '2016-11-30 00:28:23'); +(1, 1, 4, 3, '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(2, 2, 5, 3, '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(3, 3, 6, 3, '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(4, 4, 7, 3, '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(5, 4, 1, 2, '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(6, 5, 7, 3, '2016-12-13 04:02:49', '2016-12-13 04:02:49'), +(7, 6, 5, 3, '2016-12-13 04:03:44', '2016-12-13 04:03:44'); -- -------------------------------------------------------- @@ -1230,9 +1185,9 @@ CREATE TABLE IF NOT EXISTS `notification_types` ( -- INSERT INTO `notification_types` (`id`, `message`, `type`, `icon_class`, `created_at`, `updated_at`) VALUES -(1, 'A new user is registered', 'registration', 'fa fa-user', '2016-11-29 23:27:57', '2016-11-29 23:27:57'), -(2, 'You have a new reply on this ticket', 'reply', 'fa fa-envelope', '2016-11-29 23:27:58', '2016-11-29 23:27:58'), -(3, 'A new ticket has been created', 'new_ticket', 'fa fa-envelope', '2016-11-29 23:27:58', '2016-11-29 23:27:58'); +(1, 'A new user is registered', 'registration', 'fa fa-user', '2016-12-13 03:19:14', '2016-12-13 03:19:14'), +(2, 'You have a new reply on this ticket', 'reply', 'fa fa-envelope', '2016-12-13 03:19:14', '2016-12-13 03:19:14'), +(3, 'A new ticket has been created', 'new_ticket', 'fa fa-envelope', '2016-12-13 03:19:14', '2016-12-13 03:19:14'); -- -------------------------------------------------------- @@ -1305,12 +1260,12 @@ CREATE TABLE IF NOT EXISTS `queue_services` ( -- INSERT INTO `queue_services` (`id`, `name`, `short_name`, `status`, `created_at`, `updated_at`) VALUES -(1, 'Sync', 'sync', 1, '2016-11-29 23:27:51', '2016-11-29 23:27:51'), -(2, 'Database', 'database', 0, '2016-11-29 23:27:51', '2016-11-29 23:27:52'), -(3, 'Beanstalkd', 'beanstalkd', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'), -(4, 'SQS', 'sqs', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'), -(5, 'Iron', 'iron', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'), -(6, 'Redis', 'redis', 0, '2016-11-29 23:27:52', '2016-11-29 23:27:52'); +(1, 'Sync', 'sync', 1, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(2, 'Database', 'database', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(3, 'Beanstalkd', 'beanstalkd', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(4, 'SQS', 'sqs', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(5, 'Iron', 'iron', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'), +(6, 'Redis', 'redis', 0, '2016-12-13 03:19:09', '2016-12-13 03:19:09'); -- -------------------------------------------------------- @@ -1336,8 +1291,8 @@ CREATE TABLE IF NOT EXISTS `ratings` ( -- INSERT INTO `ratings` (`id`, `name`, `display_order`, `allow_modification`, `rating_scale`, `rating_area`, `restrict`, `created_at`, `updated_at`) VALUES -(1, 'OverAll Satisfaction', 1, 1, 5, 'Helpdesk Area', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'), -(2, 'Reply Rating', 1, 1, 5, 'Comment Area', '', '2016-11-29 23:28:46', '2016-11-29 23:28:46'); +(1, 'OverAll Satisfaction', 1, 1, 5, 'Helpdesk Area', '', '2016-12-13 03:19:53', '2016-12-13 03:19:53'), +(2, 'Reply Rating', 1, 1, 5, 'Comment Area', '', '2016-12-13 03:19:53', '2016-12-13 03:19:53'); -- -------------------------------------------------------- @@ -1403,7 +1358,7 @@ CREATE TABLE IF NOT EXISTS `settings_alert_notice` ( -- INSERT INTO `settings_alert_notice` (`id`, `ticket_status`, `ticket_admin_email`, `ticket_department_manager`, `ticket_department_member`, `ticket_organization_accmanager`, `message_status`, `message_last_responder`, `message_assigned_agent`, `message_department_manager`, `message_organization_accmanager`, `internal_status`, `internal_last_responder`, `internal_assigned_agent`, `internal_department_manager`, `assignment_status`, `assignment_assigned_agent`, `assignment_team_leader`, `assignment_team_member`, `transfer_status`, `transfer_assigned_agent`, `transfer_department_manager`, `transfer_department_member`, `overdue_status`, `overdue_assigned_agent`, `overdue_department_manager`, `overdue_department_member`, `system_error`, `sql_error`, `excessive_failure`, `created_at`, `updated_at`) VALUES -(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1428,7 +1383,7 @@ CREATE TABLE IF NOT EXISTS `settings_auto_response` ( -- INSERT INTO `settings_auto_response` (`id`, `new_ticket`, `agent_new_ticket`, `submitter`, `participants`, `overlimit`, `created_at`, `updated_at`) VALUES -(1, 1, 1, 0, 0, 0, '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 1, 1, 0, 0, 0, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1457,7 +1412,7 @@ CREATE TABLE IF NOT EXISTS `settings_company` ( -- INSERT INTO `settings_company` (`id`, `company_name`, `website`, `phone`, `address`, `landing_page`, `offline_page`, `thank_page`, `logo`, `use_logo`, `created_at`, `updated_at`) VALUES -(1, 'ABC cloth Company', '', '', '', '', '', '', '2530.logo.png', '0', '2016-11-29 23:28:16', '2016-11-30 00:30:47'); +(1, 'ABC Clothing', '', '', '', '', '', '', '', '0', '2016-12-13 03:19:29', '2016-12-13 03:30:41'); -- -------------------------------------------------------- @@ -1489,7 +1444,7 @@ CREATE TABLE IF NOT EXISTS `settings_email` ( -- INSERT INTO `settings_email` (`id`, `template`, `sys_email`, `alert_email`, `admin_email`, `mta`, `email_fetching`, `notification_cron`, `strip`, `separator`, `all_emails`, `email_collaborator`, `attachment`, `created_at`, `updated_at`) VALUES -(1, 'default', NULL, '', '', '', 1, 1, 0, 0, 1, 1, 1, '2016-11-29 23:28:16', '2016-11-29 23:28:16'); +(1, 'default', NULL, '', '', '', 1, 1, 0, 0, 1, 1, 1, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1532,7 +1487,7 @@ CREATE TABLE IF NOT EXISTS `settings_security` ( -- INSERT INTO `settings_security` (`id`, `lockout_message`, `backlist_offender`, `backlist_threshold`, `lockout_period`, `days_to_keep_logs`, `created_at`, `updated_at`) VALUES -(1, 'You have been locked out of application due to too many failed login attempts.', 0, 15, 15, 0, '2016-11-29 23:28:42', '2016-11-29 23:28:42'); +(1, 'You have been locked out of application due to too many failed login attempts.', 0, 15, 15, 0, '2016-12-13 03:19:47', '2016-12-13 03:19:47'); -- -------------------------------------------------------- @@ -1574,8 +1529,8 @@ CREATE TABLE IF NOT EXISTS `settings_system` ( -- INSERT INTO `settings_system` (`id`, `status`, `url`, `name`, `department`, `page_size`, `log_level`, `purge_log`, `api_enable`, `api_key_mandatory`, `api_key`, `name_format`, `time_farmat`, `date_format`, `date_time_format`, `day_date_time`, `time_zone`, `content`, `version`, `created_at`, `updated_at`) VALUES -(1, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 32, '', '', '2016-11-29 23:28:16', '2016-11-29 23:28:16'), -(2, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 79, '', '1.0.8.0', '2016-11-29 23:28:47', '2016-11-29 23:28:47'); +(1, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 32, '', '', '2016-12-13 03:19:29', '2016-12-13 03:19:29'), +(2, 1, '', '', '1', '', '', '', 0, 0, '', '', NULL, NULL, 1, '', 79, '', '1.0.8.0', '2016-12-13 03:19:53', '2016-12-13 03:19:53'); -- -------------------------------------------------------- @@ -1612,7 +1567,7 @@ CREATE TABLE IF NOT EXISTS `settings_ticket` ( -- INSERT INTO `settings_ticket` (`id`, `num_format`, `num_sequence`, `priority`, `sla`, `help_topic`, `max_open_ticket`, `collision_avoid`, `lock_ticket_frequency`, `captcha`, `status`, `claim_response`, `assigned_ticket`, `answered_ticket`, `agent_mask`, `html`, `client_update`, `max_file_size`, `created_at`, `updated_at`) VALUES -(1, '$$$$-####-####', 'sequence', '1', '2', '1', '', '2', '0', '', 1, 0, 0, 0, 0, 0, 0, 0, '2016-11-29 23:28:17', '2016-11-29 23:28:17'); +(1, '$$$$-####-####', 'sequence', '1', '2', '1', '', '2', '0', '', 1, 0, 0, 0, 0, 0, 0, 0, '2016-12-13 03:19:29', '2016-12-13 03:19:29'); -- -------------------------------------------------------- @@ -1638,9 +1593,9 @@ CREATE TABLE IF NOT EXISTS `sla_plan` ( -- INSERT INTO `sla_plan` (`id`, `name`, `grace_period`, `admin_note`, `status`, `transient`, `ticket_overdue`, `created_at`, `updated_at`) VALUES -(1, 'Sla 1', '6 Hours', '', 1, 0, 0, '2016-11-29 23:28:11', '2016-11-29 23:28:11'), -(2, 'Sla 2', '12 Hours', '', 1, 0, 0, '2016-11-29 23:28:11', '2016-11-29 23:28:11'), -(3, 'Sla 3', '24 Hours', '', 1, 0, 0, '2016-11-29 23:28:12', '2016-11-29 23:28:12'); +(1, 'Sla 1', '6 Hours', '', 1, 0, 0, '2016-12-13 03:19:25', '2016-12-13 03:19:25'), +(2, 'Sla 2', '12 Hours', '', 1, 0, 0, '2016-12-13 03:19:25', '2016-12-13 03:19:25'), +(3, 'Sla 3', '24 Hours', '', 1, 0, 0, '2016-12-13 03:19:25', '2016-12-13 03:19:25'); -- -------------------------------------------------------- @@ -1682,9 +1637,9 @@ CREATE TABLE IF NOT EXISTS `teams` ( -- INSERT INTO `teams` (`id`, `name`, `status`, `team_lead`, `assign_alert`, `admin_notes`, `created_at`, `updated_at`) VALUES -(1, 'Level 1 Support', 1, NULL, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(2, 'Level 2 Support', 0, NULL, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'), -(3, 'Developer', 0, NULL, 0, '', '2016-11-29 23:28:14', '2016-11-29 23:28:14'); +(1, 'Level 1 Support', 1, NULL, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(2, 'Level 2 Support', 0, NULL, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'), +(3, 'Developer', 0, NULL, 0, '', '2016-12-13 03:19:27', '2016-12-13 03:19:27'); -- -------------------------------------------------------- @@ -1701,16 +1656,15 @@ CREATE TABLE IF NOT EXISTS `team_assign_agent` ( PRIMARY KEY (`id`), KEY `team_id` (`team_id`), KEY `agent_id` (`agent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `team_assign_agent` -- INSERT INTO `team_assign_agent` (`id`, `team_id`, `agent_id`, `created_at`, `updated_at`) VALUES -(1, 1, 4, NULL, NULL), -(2, 1, 5, NULL, NULL), -(3, 2, 5, NULL, NULL); +(1, 1, 2, NULL, NULL), +(2, 1, 3, NULL, NULL); -- -------------------------------------------------------- @@ -1755,19 +1709,19 @@ CREATE TABLE IF NOT EXISTS `templates` ( -- INSERT INTO `templates` (`id`, `name`, `variable`, `type`, `subject`, `message`, `description`, `set_id`, `created_at`, `updated_at`) VALUES -(1, 'This template is for sending notice to agent when ticket is assigned to them', '0', 1, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to you by {!!$ticket_assigner!!}
Please check and resppond on the ticket.
Link: {!!$ticket_link!!}

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(2, 'This template is for sending notice to client with ticket link to check ticket without logging in to system', '1', 2, 'Check your Ticket', '
Hello {!!$user!!},

Click the link below to view your requested ticket
{!!$ticket_link_with_number!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(3, 'This template is for sending notice to client when ticket status is changed to close', '0', 3, '', '
Hello,

This message is regarding your ticket ID {!!$ticket_number!!}. We are changing the status of this ticket to "Closed" as the issue appears to be resolved.

Thank you
Kind regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(4, 'This template is for sending notice to client on successful ticket creation', '0', 4, '', '
Hello {!!$user!!}

Thank you for contacting us. This is an automated response confirming the receipt of your ticket. Our team will get back to you as soon as possible. When replying, please make sure that the ticket ID is kept in the subject so that we can track your replies.

Ticket ID: {!!$ticket_number!!} 

{!!$department_sign!!}
You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(5, 'This template is for sending notice to agent on new ticket creation', '0', 5, '', '
Hello {!!$ticket_agent_name!!},

New ticket {!!$ticket_number!!}created 

From
Name: {!!$ticket_client_name!!}   
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:44', '2016-11-29 23:28:44'), -(6, 'This template is for sending notice to client on new ticket created by agent in name of client', '0', 6, '', '
{!!$content!!}

{!!$agent_sign!!}

You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(7, 'This template is for sending notice to client on new registration during new ticket creation for un registered clients', '1', 7, 'Registration Confirmation', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Password: {!!$user_password!!}

You can visit the helpdesk to browse articles and contact us at any time: {!!$system_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(8, 'This template is for sending notice to any user about reset password option', '1', 8, 'Reset your Password', 'Hello {!!$user!!},

You asked to reset your password. To do so, please click this link:

{!!$password_reset_link!!}

This will let you change your password to something new. If you didn''t ask for this, don''t worry, we''ll keep your password safe.

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(9, 'This template is for sending notice to client when a reply made to his/her ticket', '0', 9, '', '

{!!$content!!}

{!!$agent_sign!!} 

Ticket Details

Ticket ID: {!!$ticket_number!!}

', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(10, 'This template is for sending notice to agent when ticket reply is made by client on a ticket', '0', 10, '', '
Hello {!!$ticket_agent_name!!},

A reply been made to ticket {!!$ticket_number!!}

From
Name: {!!$ticket_client_name!!}
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(11, 'This template is for sending notice to client about registration confirmation link', '1', 11, 'Verify your email address', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Please click on the below link to activate your account and Login to the system {!!$password_reset_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(12, 'This template is for sending notice to team when ticket is assigned to team', '1', 12, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to your team : {!!$team!!} by {!!$ticket_assigner!!} 

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-11-29 23:28:45', '2016-11-29 23:28:45'), -(13, 'This template is for sending notice to client when password is changed', '1', 13, 'Verify your email address', 'Hello {!!$user!!},

Your password is successfully changed.Your new password is : {!!$user_password!!}

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-11-29 23:28:46', '2016-11-29 23:28:46'); +(1, 'This template is for sending notice to agent when ticket is assigned to them', '0', 1, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to you by {!!$ticket_assigner!!}
Please check and resppond on the ticket.
Link: {!!$ticket_link!!}

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:50', '2016-12-13 03:19:50'), +(2, 'This template is for sending notice to client with ticket link to check ticket without logging in to system', '1', 2, 'Check your Ticket', '
Hello {!!$user!!},

Click the link below to view your requested ticket
{!!$ticket_link_with_number!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:50', '2016-12-13 03:19:50'), +(3, 'This template is for sending notice to client when ticket status is changed to close', '0', 3, '', '
Hello,

This message is regarding your ticket ID {!!$ticket_number!!}. We are changing the status of this ticket to "Closed" as the issue appears to be resolved.

Thank you
Kind regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:50', '2016-12-13 03:19:50'), +(4, 'This template is for sending notice to client on successful ticket creation', '0', 4, '', '
Hello {!!$user!!}

Thank you for contacting us. This is an automated response confirming the receipt of your ticket. Our team will get back to you as soon as possible. When replying, please make sure that the ticket ID is kept in the subject so that we can track your replies.

Ticket ID: {!!$ticket_number!!} 

{!!$department_sign!!}
You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(5, 'This template is for sending notice to agent on new ticket creation', '0', 5, '', '
Hello {!!$ticket_agent_name!!},

New ticket {!!$ticket_number!!}created 

From
Name: {!!$ticket_client_name!!}   
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(6, 'This template is for sending notice to client on new ticket created by agent in name of client', '0', 6, '', '
{!!$content!!}

{!!$agent_sign!!}

You can check the status of or update this ticket online at: {!!$system_link!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(7, 'This template is for sending notice to client on new registration during new ticket creation for un registered clients', '1', 7, 'Registration Confirmation', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Password: {!!$user_password!!}

You can visit the helpdesk to browse articles and contact us at any time: {!!$system_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(8, 'This template is for sending notice to any user about reset password option', '1', 8, 'Reset your Password', 'Hello {!!$user!!},

You asked to reset your password. To do so, please click this link:

{!!$password_reset_link!!}

This will let you change your password to something new. If you didn''t ask for this, don''t worry, we''ll keep your password safe.

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(9, 'This template is for sending notice to client when a reply made to his/her ticket', '0', 9, '', '

{!!$content!!}

{!!$agent_sign!!} 

Ticket Details

Ticket ID: {!!$ticket_number!!}

', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(10, 'This template is for sending notice to agent when ticket reply is made by client on a ticket', '0', 10, '', '
Hello {!!$ticket_agent_name!!},

A reply been made to ticket {!!$ticket_number!!}

From
Name: {!!$ticket_client_name!!}
E-mail: {!!$ticket_client_email!!}

{!!$content!!}

Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:51', '2016-12-13 03:19:51'), +(11, 'This template is for sending notice to client about registration confirmation link', '1', 11, 'Verify your email address', '

Hello {!!$user!!}, 

This email is confirmation that you are now registered at our helpdesk.

Registered Email: {!!$email_address!!}

Please click on the below link to activate your account and Login to the system {!!$password_reset_link!!}

Thank You.

Kind Regards,

{!!$system_from!!} 

', '', 1, '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(12, 'This template is for sending notice to team when ticket is assigned to team', '1', 12, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to your team : {!!$team!!} by {!!$ticket_assigner!!} 

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-12-13 03:19:52', '2016-12-13 03:19:52'), +(13, 'This template is for sending notice to client when password is changed', '1', 13, 'Verify your email address', 'Hello {!!$user!!},

Your password is successfully changed.Your new password is : {!!$user_password!!}

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-12-13 03:19:52', '2016-12-13 03:19:52'); -- -------------------------------------------------------- @@ -1789,7 +1743,7 @@ CREATE TABLE IF NOT EXISTS `template_sets` ( -- INSERT INTO `template_sets` (`id`, `name`, `active`, `created_at`, `updated_at`) VALUES -(1, 'default', 1, '2016-11-29 23:28:42', '2016-11-29 23:28:42'); +(1, 'default', 1, '2016-12-13 03:19:47', '2016-12-13 03:19:47'); -- -------------------------------------------------------- @@ -1810,19 +1764,19 @@ CREATE TABLE IF NOT EXISTS `template_types` ( -- INSERT INTO `template_types` (`id`, `name`, `created_at`, `updated_at`) VALUES -(1, 'assign-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(2, 'check-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(3, 'close-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(4, 'create-ticket', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(5, 'create-ticket-agent', '2016-11-29 23:28:42', '2016-11-29 23:28:42'), -(6, 'create-ticket-by-agent', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(7, 'registration-notification', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(8, 'reset-password', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(9, 'ticket-reply', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(10, 'ticket-reply-agent', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(11, 'registration', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(12, 'team_assign_ticket', '2016-11-29 23:28:43', '2016-11-29 23:28:43'), -(13, 'reset_new_password', '2016-11-29 23:28:43', '2016-11-29 23:28:43'); +(1, 'assign-ticket', '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(2, 'check-ticket', '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(3, 'close-ticket', '2016-12-13 03:19:47', '2016-12-13 03:19:47'), +(4, 'create-ticket', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(5, 'create-ticket-agent', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(6, 'create-ticket-by-agent', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(7, 'registration-notification', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(8, 'reset-password', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(9, 'ticket-reply', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(10, 'ticket-reply-agent', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(11, 'registration', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(12, 'team_assign_ticket', '2016-12-13 03:19:48', '2016-12-13 03:19:48'), +(13, 'reset_new_password', '2016-12-13 03:19:48', '2016-12-13 03:19:48'); -- -------------------------------------------------------- @@ -1875,18 +1829,19 @@ CREATE TABLE IF NOT EXISTS `tickets` ( KEY `status` (`status`), KEY `assigned_to` (`assigned_to`), KEY `source` (`source`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; -- -- Dumping data for table `tickets` -- INSERT INTO `tickets` (`id`, `ticket_number`, `user_id`, `dept_id`, `team_id`, `priority_id`, `sla`, `help_topic_id`, `status`, `rating`, `ratingreply`, `flags`, `ip_address`, `assigned_to`, `lock_by`, `lock_at`, `source`, `isoverdue`, `reopened`, `isanswered`, `html`, `is_deleted`, `closed`, `is_transferred`, `transferred_at`, `reopened_at`, `duedate`, `closed_at`, `last_message_at`, `last_response_at`, `approval`, `follow_up`, `created_at`, `updated_at`) VALUES -(1, 'AAAA-0000-0000', 2, 1, NULL, 1, 1, 1, 1, 0, 0, 0, 0, 4, 0, NULL, 3, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:46:00', NULL, NULL, NULL, 0, 0, '2016-11-30 00:16:00', '2016-11-30 00:29:01'), -(2, 'AAAA-0000-0001', 2, 1, NULL, 1, 1, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:47:29', NULL, NULL, NULL, 0, 0, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(3, 'AAAA-0000-0002', 3, 1, NULL, 1, 1, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:49:15', NULL, NULL, NULL, 0, 0, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(4, 'AAAA-0000-0003', 3, 2, NULL, 1, 1, 2, 1, 0, 0, 0, 0, 1, 0, NULL, 3, 0, 0, 1, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:52:34', NULL, NULL, NULL, 0, 0, '2016-11-30 00:22:34', '2016-11-30 00:28:23'), -(5, 'AAAA-0000-0004', 3, 1, NULL, 1, 1, 1, 5, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 1, 0, 0, '0000-00-00 00:00:00', NULL, '2016-11-30 11:55:06', NULL, NULL, NULL, 0, 0, '2016-11-30 00:25:06', '2016-11-30 00:26:59'); +(1, 'AAAA-0000-0000', 4, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:15:19', NULL, NULL, NULL, 0, 0, '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(2, 'AAAA-0000-0001', 5, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:20:55', NULL, NULL, NULL, 0, 0, '2016-12-13 03:50:55', '2016-12-13 03:50:56'), +(3, 'AAAA-0000-0002', 6, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, 3, 0, NULL, 1, 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:25:55', NULL, NULL, NULL, 0, 0, '2016-12-13 03:55:55', '2016-12-13 04:00:23'), +(4, 'AAAA-0000-0003', 7, 1, NULL, 2, 2, 1, 1, 0, 0, 0, 0, 1, 0, NULL, 1, 0, 0, 1, 0, 0, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 21:28:40', NULL, NULL, NULL, 0, 0, '2016-12-13 03:58:40', '2016-12-13 04:01:55'), +(5, 'AAAA-0000-0004', 7, 1, NULL, 1, 1, 1, 5, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 1, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 15:32:48', NULL, NULL, NULL, 0, 0, '2016-12-13 04:02:48', '2016-12-13 04:04:04'), +(6, 'AAAA-0000-0005', 5, 1, NULL, 1, 1, 1, 5, 0, 0, 0, 0, NULL, 0, NULL, 3, 0, 0, 0, 0, 1, 0, 0, '0000-00-00 00:00:00', NULL, '2016-12-13 15:33:44', NULL, NULL, NULL, 0, 0, '2016-12-13 04:03:44', '2016-12-13 04:04:04'); -- -------------------------------------------------------- @@ -1904,6 +1859,8 @@ CREATE TABLE IF NOT EXISTS `ticket_attachment` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `file` mediumblob, + `driver` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `thread_id` (`thread_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -1969,10 +1926,10 @@ CREATE TABLE IF NOT EXISTS `ticket_priority` ( -- INSERT INTO `ticket_priority` (`priority_id`, `priority`, `status`, `priority_desc`, `priority_color`, `priority_urgency`, `ispublic`, `is_default`, `created_at`, `updated_at`) VALUES -(1, 'Low', '1', 'Low', '#00a65a', 4, 1, '0', NULL, NULL), +(1, 'Low', '1', 'Low', '#00a65a', 4, 1, '', NULL, NULL), (2, 'Normal', '1', 'Normal', '#00bfef', 3, 1, '1', NULL, NULL), -(3, 'High', '1', 'High', '#f39c11', 2, 1, '0', NULL, NULL), -(4, 'Emergency', '1', 'Emergency', '#dd4b38', 1, 1, '0', NULL, NULL); +(3, 'High', '1', 'High', '#f39c11', 2, 1, '', NULL, NULL), +(4, 'Emergency', '1', 'Emergency', '#dd4b38', 1, 1, '', NULL, NULL); -- -------------------------------------------------------- @@ -2031,13 +1988,13 @@ CREATE TABLE IF NOT EXISTS `ticket_status` ( -- INSERT INTO `ticket_status` (`id`, `name`, `state`, `mode`, `message`, `flags`, `sort`, `email_user`, `icon_class`, `properties`, `created_at`, `updated_at`) VALUES -(1, 'Open', 'open', 3, 'Ticket have been Reopened by', 0, 1, 0, '', 'Open tickets.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(2, 'Resolved', 'closed', 1, 'Ticket have been Resolved by', 0, 2, 0, '', 'Resolved tickets.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(3, 'Closed', 'closed', 3, 'Ticket have been Closed by', 0, 3, 0, '', 'Closed tickets. Tickets will still be accessible on client and staff panels.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(4, 'Archived', 'archived', 3, 'Ticket have been Archived by', 0, 4, 0, '', 'Tickets only adminstratively available but no longer accessible on ticket queues and client panel.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(5, 'Deleted', 'deleted', 3, 'Ticket have been Deleted by', 0, 5, 0, '', 'Tickets queued for deletion. Not accessible on ticket queues.', '2016-11-29 23:28:10', '2016-11-29 23:28:10'), -(6, 'Unverified', 'unverified', 3, 'User account verification required.', 0, 6, 0, '', 'Ticket will be open after user verifies his/her account.', '2016-11-29 23:28:11', '2016-11-29 23:28:11'), -(7, 'Request Approval', 'unverified', 3, 'Approval requested by', 0, 7, 0, '', 'Ticket will be approve after Admin verifies this ticket', '2016-11-29 23:28:11', '2016-11-29 23:28:11'); +(1, 'Open', 'open', 3, 'Ticket have been Reopened by', 0, 1, 0, '', 'Open tickets.', '2016-12-13 03:19:23', '2016-12-13 03:19:23'), +(2, 'Resolved', 'closed', 1, 'Ticket have been Resolved by', 0, 2, 0, '', 'Resolved tickets.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(3, 'Closed', 'closed', 3, 'Ticket have been Closed by', 0, 3, 0, '', 'Closed tickets. Tickets will still be accessible on client and staff panels.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(4, 'Archived', 'archived', 3, 'Ticket have been Archived by', 0, 4, 0, '', 'Tickets only adminstratively available but no longer accessible on ticket queues and client panel.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(5, 'Deleted', 'deleted', 3, 'Ticket have been Deleted by', 0, 5, 0, '', 'Tickets queued for deletion. Not accessible on ticket queues.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(6, 'Unverified', 'unverified', 3, 'User account verification required.', 0, 6, 0, '', 'Ticket will be open after user verifies his/her account.', '2016-12-13 03:19:24', '2016-12-13 03:19:24'), +(7, 'Request Approval', 'unverified', 3, 'Approval requested by', 0, 7, 0, '', 'Ticket will be approve after Admin verifies this ticket', '2016-12-13 03:19:24', '2016-12-13 03:19:24'); -- -------------------------------------------------------- @@ -2064,22 +2021,24 @@ CREATE TABLE IF NOT EXISTS `ticket_thread` ( KEY `ticket_id_2` (`ticket_id`), KEY `user_id` (`user_id`), KEY `source` (`source`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ; -- -- Dumping data for table `ticket_thread` -- INSERT INTO `ticket_thread` (`id`, `ticket_id`, `user_id`, `poster`, `source`, `reply_rating`, `rating_count`, `is_internal`, `title`, `body`, `format`, `ip_address`, `created_at`, `updated_at`) VALUES -(1, 1, 2, 'client', NULL, 0, 0, 0, 'Sizing defects ', 0x506c6561736520636865636b2073697a65206f662073686972742e, '', '', '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(2, 2, 2, 'client', NULL, 0, 0, 0, 'Colour effects', 0x4869207465616d2c3c62723e3c62723e49206d20676f742077726f6e6720636f6c6f7220706c656173652072657475726e206d79206f726465722e3c62723e3c62723e3c62723e3c62723e, '', '', '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(3, 3, 3, 'client', NULL, 0, 0, 0, 'Sewing defects', 0x746869732069732064656665637420636c6f74687320706c6561736520636865636b20616e642073656e64206d6520616761696e2e, '', '', '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(4, 4, 3, 'client', NULL, 0, 0, 0, 'Garment defects', 0x4869207465616d2c3c62723e3c62723e492077616e7420746f2072657475726e206d79206361736820626563617573652069206d206e6f74207361746973667920776974682073616c652e3c62723e3c62723e3c62723e3c62723e3c62723e3c62723e3c62723e, '', '', '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(5, 5, 3, 'client', NULL, 0, 0, 0, 'Return my cash', 0x4869205465616d2c3c62723e3c62723e4920676f742064616d61676520636c6f746820706c656173652072657475726e206d79206361736820415341502e3c62723e3c62723e3c62723e, '', '', '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(6, 5, 1, '', NULL, 0, 0, 1, '', 0x5469636b65742068617665206265656e2044656c657465642062792044656d6f61646d696e20466176656f, '', '', '2016-11-30 00:26:59', '2016-11-30 00:26:59'), -(7, 4, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b65742068617665206265656e2061737369676e656420746f2044656d6f61646d696e20466176656f, '', '', '2016-11-30 00:28:23', '2016-11-30 00:28:23'), -(8, 4, 1, 'support', NULL, 0, 0, 0, '', 0x486920636c616469612c3c62723e3c62723e417320736f6f6e20617320706f737369626c652077652077696c6c2072657475726e20796f757220636173682e3c62723e3c62723e, '', '', '2016-11-30 00:28:23', '2016-11-30 00:28:23'), -(9, 1, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b657420686173206265656e2061737369676e656420746f204a6f686e20706174656c, '', '', '2016-11-30 00:29:01', '2016-11-30 00:29:01'); +(1, 1, 4, 'client', NULL, 0, 0, 0, 'Sewing defects', 0x466f7220657665727920696e647573747279206f7220627573696e6573732c20746f2067657420696e63726561736564200d0a73616c657320616e640d0a626574746572206e616d6520616d6f6e67737420636f6e73756d65727320616e642066656c6c6f7720636f6d70616e69657320697420697320696d706f7274616e7420746f200d0a6d61696e7461696e0d0a61206c6576656c206f66207175616c6974792e20496e20746865206761726d656e7420696e647573747279207175616c69747920636f6e74726f6c206973207072616374696365640d0a2072696768742066726f6d2074686520696e697469616c207374616765206f6620736f757263696e6720726177206d6174657269616c7320746f20746865207374616765206f66200d0a66696e616c2066696e69736865640d0a6761726d656e742e20466f722074657874696c6520616e64206170706172656c20696e6475737472792070726f64756374207175616c6974792069732063616c63756c61746564200d0a696e0d0a7465726d73206f66207175616c69747920616e64207374616e64617264206f66206669627265732c207961726e732c2066616272696320636f6e737472756374696f6e2c200d0a636f6c6f75720d0a666173746e6573732c20737572666163652064657369676e7320616e64207468652066696e616c2066696e6973686564206761726d656e742070726f64756374732e200d0a486f77657665720d0a7175616c697479206578706563746174696f6e7320666f72206578706f7274206172652072656c6174656420746f207468652074797065206f6620637573746f6d6572200d0a7365676d656e74730d0a616e64207468652072657461696c206f75746c6574732e205468657265206172652061206e756d626572206f6620666163746f7273206f6e207768696368207175616c697479200d0a6669746e6573730d0a6f66206761726d656e7420696e64757374727920697320626173656420737563682061732020706572666f726d616e63652c2072656c696162696c6974792c200d0a6475726162696c6974792c0d0a76697375616c20616e6420706572636569766564207175616c697479206f6620746865206761726d656e742e205175616c697479206e6565647320746f20626520646566696e65640d0a20696e0d0a7465726d73206f66206120706172746963756c6172206672616d65776f726b206f6620636f73742e203c62723e, '', '', '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(2, 2, 5, 'client', NULL, 0, 0, 0, 'Delivery not recieved', 0x3c7370616e3e556e666f7274756e6174656c792c206966206120747261636b696e670d0a206e756d6265722073686f77732064656c69766572792c20796f7572206f6e6c79207265636f75727365206973207468726f7567682074686520736869707065722e2020496e200d0a6f7468657220776f7264732c20696620746865205553505320747261636b696e6720736974652073686f77732064656c69766572792c20616e6420796f7520686176656e2774200d0a61637475616c6c792072656365697665642069742c20796f75722070726f626c656d206c69657320776974682074686520555350532c20616e64206e6f7420746865200d0a73656c6c65722e223c62723e3c62723e5468697320686173206e657665722068617070656e656420746f206d652c206275742074686520696465610d0a20746861742074686520627579657220697320736f6d65686f7720726573706f6e7369626c6520666f722074686520636172726965722074686174207468652053454c4c4552200d0a68617320636f6d6d697373696f6e6564206973206c6175676861626c652e205468652073656c6c657220686173206120636f6e747261637475616c2061677265656d656e74200d0a776974682074686520736869707065722c206d616e792074696d65732074686520627579657220646f65736e2774206576656e206861766520746865206f7074696f6e20746f200d0a73706563696679207468652073686970706572207573656420666f722064656c69766572792e20496620746865206974656d204920707572636861736564206e65766572200d0a72656163686573206d7920686f6d653c2f7370616e3e3c62723e, '', '', '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(3, 3, 6, 'client', NULL, 0, 0, 0, 'Colour effects', 0x492068617665206265656e2073656c656374656420666f72206170706f696e746d656e7420746f2074686520496e6469616e20466f7265737420536572766963652e200d0a42757420746865206d65646963616c20626f6172642068617320666f756e64206d6520756e666974206f6e206163636f756e74206f662064656665637469766520636f6c6f7572200d0a766973696f6e2e0d0a0d0a3c703e4163636f7264696e6720746f207468652072756c65732c20224c6f77204772616465202220636f6c6f757220766973696f6e2069732073756666696369656e7420666f72200d0a74686520736572766963652e204920776f756c64206c696b6520746f206b6e6f7720686f7720636f6c6f757220766973696f6e2063616e20626520677261646564206173206c6f770d0a206f7220686967682e20492063616e20636f72726563746c79206964656e74696679203238206f7574206f6620333820497368696861726120706c617465732e20556e646572200d0a6c6f776572206c6967687420696e74656e736974792c20492063616e206964656e74696679206120666577206d6f726520706c617465732e20506c656173652067697665200d0a796f757220636f6d6d656e74206f6e20746869732e20416c736f20706c65617365206c6574206d65206b6e6f772061626f757420746865204564726964676520477265656e200d0a4c616e7465726e207465737420616e642074686520636f6c6f75727320696e20746865206c616e7465726e2e2054686520626f617264206861732063616c6c6564206d6520666f720d0a20612072652d6578616d696e6174696f6e202e20506c6561736520616476697365206d6520686f7720746f20666163652069742e3c2f703e3c62723e, '', '', '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(4, 4, 7, 'client', NULL, 0, 0, 0, 'Garment defects', 0x536f6d65207061727473206f66207061747465726e20617265206d697373696e672c2070726f6261626c7920626563617573650d0a207468650d0a6d61726b657220646964206e6f7420696e636c7564652074686520636f7272656374206e756d626572206f662070617274732e204d697865642070617274732c200d0a70726f6261626c79206265636175736520746865206d61726b6572206973206e6f7420636f72726563746c79206c6162656c65642c20726573756c74696e6720696e2061200d0a6d61727269616765206f662077726f6e672073697a65640d0a70617274732e205061747465726e73206e6f7420666163696e6720696e20636f727265637420646972656374696f6e206f6e206e617070656420666162726963732e204e6f74200d0a616c6c0d0a7061747465726e7320666163696e6720696e2073616d6520646972656374696f6e20286569746865722077617929206f6e2061206f6e652d776179206661627269632e200d0a5061747465726e730d0a6e6f7420616c69676e65642077697468207265737065637420746f207468652066616272696320677261696e2e20506f6f72206c696e6520646566696e6974696f6e2028652e672e0d0a20746f6f0d0a746869636b206368616c6b3b20696e64697374696e63746c79207072696e746564206c696e652c20706572666f7261746564206c6179206e6f7420706f77646572656429200d0a6c656164696e6720746f0d0a696e61636375726174652063757474696e672e20536b696d7079206d61726b696e672c206361757365642062792065697468657220746865206d61726b657220646964206e6f74200d0a757365207468650d0a6f7574736964652065646765206f6620746865207061747465726e3b206f7220746865207061747465726e20776173206d6f766564206f72207377756e67206166746572200d0a7061727469616c0d0a6d61726b696e6720746f2073717565657a6520746865207061747465726e20696e746f206120736d616c6c657220737061636520666f722065636f6e6f6d697a696e6720746865200d0a6661627269632e0d0a4d61726b696e67206261636b2066726f6d206d696e696174757265206d61726b65727320616c736f2063616e2063617573652074726f75626c6520756e6c65737320746865200d0a6d696e6961747572650d0a6d61726b6572206d616b696e6720697320696e207468652068616e6473206f6620657870657269656e636564206f70657261746f72732e20416c7465726e61746976656c79200d0a7468652066756c6c0d0a73697a65207061747465726e206d617920626520686176696e6720776f726e206f75742065646765732e3c62723e, '', '', '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(5, 4, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b657420686173206265656e2061737369676e656420746f2044656d6f2061646d696e, '', '', '2016-12-13 04:00:04', '2016-12-13 04:00:04'), +(6, 3, 1, '', NULL, 0, 0, 1, '', 0x54686973205469636b657420686173206265656e2061737369676e656420746f204a6f68616e204d616c686f747261, '', '', '2016-12-13 04:00:23', '2016-12-13 04:00:23'), +(7, 4, 1, 'support', NULL, 0, 0, 0, '', 0x3c703e4869204b757374692c3c2f703e0d0a0d0a3c703e4c6574206d6520636865636b20616e642063616c6c206261636b20796f753c2f703e0d0a0d0a3c703e5468616e6b20596f753c2f703e0d0a, '', '', '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(8, 5, 7, 'client', NULL, 0, 0, 0, 'test ticket', 0x746869732069732074657374207469636b6574202e2e2e63766376637663, '', '', '2016-12-13 04:02:48', '2016-12-13 04:02:48'), +(9, 6, 5, 'client', NULL, 0, 0, 0, 'Mail test ticket', 0x506c6561736520746869732069732074657374207469636b65742e, '', '', '2016-12-13 04:03:44', '2016-12-13 04:03:44'), +(10, 6, 1, '', NULL, 0, 0, 1, '', 0x5469636b65742068617665206265656e2044656c657465642062792044656d6f2061646d696e, '', '', '2016-12-13 04:04:04', '2016-12-13 04:04:04'), +(11, 5, 1, '', NULL, 0, 0, 1, '', 0x5469636b65742068617665206265656e2044656c657465642062792044656d6f2061646d696e, '', '', '2016-12-13 04:04:04', '2016-12-13 04:04:04'); -- -------------------------------------------------------- @@ -2264,6 +2223,7 @@ CREATE TABLE IF NOT EXISTS `users` ( `ban` tinyint(1) NOT NULL, `password` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `active` int(11) NOT NULL, + `is_delete` tinyint(1) NOT NULL DEFAULT '0', `ext` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `country_code` int(11) NOT NULL, `phone_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL, @@ -2290,18 +2250,20 @@ CREATE TABLE IF NOT EXISTS `users` ( UNIQUE KEY `users_mobile_unique` (`mobile`), KEY `assign_group_3` (`assign_group`), KEY `primary_dpt_2` (`primary_dpt`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `users` -- -INSERT INTO `users` (`id`, `user_name`, `first_name`, `last_name`, `gender`, `email`, `ban`, `password`, `active`, `ext`, `country_code`, `phone_number`, `mobile`, `agent_sign`, `account_type`, `account_status`, `assign_group`, `primary_dpt`, `agent_tzone`, `daylight_save`, `limit_access`, `directory_listing`, `vacation_mode`, `company`, `role`, `internal_note`, `profile_pic`, `remember_token`, `created_at`, `updated_at`) VALUES -(1, 'demo@admin.com', 'Demoadmin', 'Faveo', 0, 'demo@admin.com', 0, '$2y$10$ewEDeTT7ax5u6lCcCrJL6OClWB6Eo/6GbeJY8MMrJZCjvsbJI84XS', 1, '', 0, '', NULL, '', '', '', 1, 1, '', '', '', '', '', '', 'admin', '', '', 'oFeQJKpu1OlZveLPEghCRlF925TutWTkj5TNoX5jIzjkVzVYNAHC9TtCP1Kr', '2016-11-29 23:28:47', '2016-11-30 00:31:09'), -(2, 'jalafa', 'Jalafa', 'kk', 0, 'jalafa@gmail.com', 0, '$2y$10$F26IyAQOJIzjBs4p0j5K7ugSDDxT2dRSqbAeC8d0CdCG/pwN64qVq', 1, '', 91, '', '9285631230', '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', NULL, '2016-11-29 23:37:34', '2016-11-29 23:37:34'), -(3, 'cladia', 'Cladia', 'Singh', 0, 'cladia@yahoo.com', 0, '$2y$10$MXupcdivLoWZuNnVeHHTHOQSMF11iXkhY7AvToYiF2/PMutrilJce', 1, '', 91, '', '7865236524', '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', NULL, '2016-11-29 23:39:51', '2016-11-29 23:39:51'), -(4, 'John', 'John', 'patel', 0, 'john@gmail.com', 0, '$2y$10$H5jyw8QbTdu11Rezoe8kUexS5pP6GHIhJUOQRL8jLRriaOAtfSONm', 1, '', 91, '', '6983524178', '', '', '', 1, 1, '79', '', '', '', '', '', 'agent', '', '', NULL, '2016-11-29 23:43:01', '2016-11-29 23:43:02'), -(5, 'Baladdin', 'Baladin', 'khan', 0, 'baladdin@gmail.com', 0, '$2y$10$0iz73EdhcHGKI3H5oQmnZeUXVvqEzCsXpjTuc88ihNmHeJG18xZXG', 1, '', 91, '', '7896325412', '', '', '', 2, 2, '79', '', '', '', '', '', 'agent', '', '', NULL, '2016-11-29 23:45:08', '2016-11-29 23:45:08'); +INSERT INTO `users` (`id`, `user_name`, `first_name`, `last_name`, `gender`, `email`, `ban`, `password`, `active`, `is_delete`, `ext`, `country_code`, `phone_number`, `mobile`, `agent_sign`, `account_type`, `account_status`, `assign_group`, `primary_dpt`, `agent_tzone`, `daylight_save`, `limit_access`, `directory_listing`, `vacation_mode`, `company`, `role`, `internal_note`, `profile_pic`, `remember_token`, `created_at`, `updated_at`) VALUES +(1, 'demo@admin.com', 'Demo', 'admin', 0, 'demo@admin.com', 0, '$2y$10$ZkHOJeJCKFzLtL4yWXZ3suVZlG.fJwD9oUI3nM5FGESmIkQV1hMXC', 1, 0, '', 0, '', NULL, '', '', '', 1, 1, '', '', '', '', '', '', 'admin', '', '', NULL, '2016-12-13 03:19:53', '2016-12-13 03:19:53'), +(2, 'Abhrakasin', 'Abhrakasin', 'KK', 0, 'abhrakasin@gmail.com', 0, '$2y$10$nrMZMd72/HZbnzjBAi0RX.UQrNTtFeZFEK9aq.chDPZZ07rOC/6Ie', 1, 0, '', 0, '', NULL, '', '', '', 1, 1, '79', '', '', '', '', '', 'agent', '', '', NULL, '2016-12-13 03:32:41', '2016-12-13 03:32:42'), +(3, 'Johan', 'Johan', 'Malhotra', 0, 'johan21@gmail.com', 0, '$2y$10$Eq8SHKUEXCkW5vqiWvA0Iu1UJmzZ.e5.Q3hI2tkxey5HZ2Lmbxb1C', 1, 0, '', 0, '', NULL, '', '', '', 2, 2, '7', '', '', '', '', '', 'agent', '', '', NULL, '2016-12-13 03:35:29', '2016-12-13 03:35:30'), +(4, 'fidelm@gmail.com', 'Fidel Martin', '', 0, 'fidelm@gmail.com', 0, '$2y$10$wHupGhJqz2p4rcdS4eq4ZO.NQ65b0JjVsqhJwEEzOCl3vMKwzh9/S', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', 'PXj6d2s7rOqoh53gHdyPbiHOVvBmDoR5CnXg9kl7fRolIC92Y20UnFPSOryw', '2016-12-13 03:45:19', '2016-12-13 03:45:19'), +(5, 'joseph2321@gmail.com', 'Joseph Rossignol', '', 0, 'joseph2321@gmail.com', 0, '$2y$10$7eQ0nFxQpQkWaKwUbzTsQ.ufQpRN1rwUGY5ER1KsoXoLd6KbMIHnG', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', 'nv7Z37jhwAVdt87WCVzsqweY6wUbic7ll44FNmygMmwcnErafCrVpnw6Krys', '2016-12-13 03:50:55', '2016-12-13 03:50:55'), +(6, 'ichae1212@gmail.com', 'Ichae Semos', '', 0, 'ichae1212@gmail.com', 0, '$2y$10$aITz4IUuaxb0VHwF2V2CPefwf/Ft0VXpmHDC9feEfNXkW90GdjCFm', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', 'egq0NWPaxEkwkXmV3L0BJ4j4O6aKlgjzNZxea0XpYvCAeVvZLbXsjkKmWyBZ', '2016-12-13 03:55:54', '2016-12-13 03:55:54'), +(7, 'kusti09@yahoo.com', 'Kusti Franti', '', 0, 'kusti09@yahoo.com', 0, '$2y$10$yNHebbyWfr6m1t4srRlYbuj2JN706ZBpyMI.gSJmuY9czJ3OzuQpq', 1, 0, '', 0, '', NULL, '', '', '', NULL, NULL, '', '', '', '', '', '', 'user', '', '', '4JPKOO9UUjZ2yX1GI7WYaeljcdyFATmguwNGuUD9chDodCVfJVGBJvbepgOt', '2016-12-13 03:58:40', '2016-12-13 03:58:40'); -- -------------------------------------------------------- @@ -2351,25 +2313,27 @@ CREATE TABLE IF NOT EXISTS `user_notification` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ; -- -- Dumping data for table `user_notification` -- INSERT INTO `user_notification` (`id`, `notification_id`, `user_id`, `is_read`, `created_at`, `updated_at`) VALUES -(1, 1, 4, 0, '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(2, 1, 1, 0, '2016-11-30 00:16:00', '2016-11-30 00:16:00'), -(3, 2, 4, 0, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(4, 2, 1, 0, '2016-11-30 00:17:29', '2016-11-30 00:17:29'), -(5, 3, 4, 0, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(6, 3, 1, 0, '2016-11-30 00:19:15', '2016-11-30 00:19:15'), -(7, 4, 5, 0, '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(8, 4, 1, 0, '2016-11-30 00:22:34', '2016-11-30 00:22:34'), -(9, 5, 4, 0, '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(10, 5, 1, 0, '2016-11-30 00:25:06', '2016-11-30 00:25:06'), -(11, 6, 5, 0, '2016-11-30 00:28:23', '2016-11-30 00:28:23'), -(12, 6, 1, 0, '2016-11-30 00:28:23', '2016-11-30 00:28:23'); +(1, 1, 2, 0, '2016-12-13 03:45:20', '2016-12-13 03:45:20'), +(2, 1, 1, 0, '2016-12-13 03:45:20', '2016-12-13 03:45:20'), +(3, 2, 2, 0, '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(4, 2, 1, 0, '2016-12-13 03:50:56', '2016-12-13 03:50:56'), +(5, 3, 2, 0, '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(6, 3, 1, 0, '2016-12-13 03:55:55', '2016-12-13 03:55:55'), +(7, 4, 2, 0, '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(8, 4, 1, 0, '2016-12-13 03:58:40', '2016-12-13 03:58:40'), +(9, 5, 2, 0, '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(10, 5, 1, 0, '2016-12-13 04:01:55', '2016-12-13 04:01:55'), +(11, 6, 2, 0, '2016-12-13 04:02:49', '2016-12-13 04:02:49'), +(12, 6, 1, 0, '2016-12-13 04:02:49', '2016-12-13 04:02:49'), +(13, 7, 2, 0, '2016-12-13 04:03:44', '2016-12-13 04:03:44'), +(14, 7, 1, 0, '2016-12-13 04:03:44', '2016-12-13 04:03:44'); -- -------------------------------------------------------- @@ -2391,7 +2355,7 @@ CREATE TABLE IF NOT EXISTS `version_check` ( -- INSERT INTO `version_check` (`id`, `current_version`, `new_version`, `created_at`, `updated_at`) VALUES -(1, '', '', '2016-11-29 23:28:17', '2016-11-29 23:28:17'); +(1, '', '', '2016-12-13 03:19:30', '2016-12-13 03:19:30'); -- -------------------------------------------------------- @@ -2414,26 +2378,26 @@ CREATE TABLE IF NOT EXISTS `widgets` ( -- INSERT INTO `widgets` (`id`, `name`, `title`, `value`, `created_at`, `updated_at`) VALUES -(1, 'footer1', 'Products', '', '2016-11-29 23:28:18', '2016-11-29 23:47:56'), -(2, 'footer2', 'Company', '', '2016-11-29 23:28:18', '2016-11-29 23:48:39'), -(3, 'footer3', 'Find out More', '', '2016-11-29 23:28:18', '2016-11-29 23:49:14'), -(4, 'footer4', 'Contact Us', '
\r\n

BTM Layout, No: #28
9th Cross First Stage BTM Layout Near Water Tank
Bangalore – 560 029
Karnataka – India
Telephone: +91 9999999999
Email:    support@abcclothing.com

\r\n
\r\n \r\n
\r\n
', '2016-11-29 23:28:18', '2016-11-29 23:50:04'), -(5, 'side1', NULL, NULL, '2016-11-29 23:28:18', '2016-11-29 23:28:18'), -(6, 'side2', NULL, NULL, '2016-11-29 23:28:18', '2016-11-29 23:28:18'), -(7, 'linkedin', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(8, 'stumble', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(9, 'google', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(10, 'deviantart', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(11, 'flickr', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(12, 'skype', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(13, 'rss', NULL, NULL, '2016-11-29 23:28:19', '2016-11-29 23:28:19'), -(14, 'twitter', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(15, 'facebook', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(16, 'youtube', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(17, 'vimeo', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(18, 'pinterest', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(19, 'dribbble', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'), -(20, 'instagram', NULL, NULL, '2016-11-29 23:28:20', '2016-11-29 23:28:20'); +(1, 'footer1', 'Products', '', '2016-12-13 03:19:30', '2016-12-13 03:21:13'), +(2, 'footer2', 'Company', '', '2016-12-13 03:19:30', '2016-12-13 03:21:40'), +(3, 'footer3', 'Find out More', '', '2016-12-13 03:19:30', '2016-12-13 03:22:06'), +(4, 'footer4', 'Contact Us', '
\r\n

BTM Layout, No: #28
9th Cross First Stage BTM Layout Near Water Tank
Bangalore – 560 029
Karnataka – India
Telephone: +91 9999999999
Email:    support@abcclothing.com

', '2016-12-13 03:19:30', '2016-12-13 03:22:34'), +(5, 'side1', NULL, NULL, '2016-12-13 03:19:30', '2016-12-13 03:19:30'), +(6, 'side2', NULL, NULL, '2016-12-13 03:19:30', '2016-12-13 03:19:30'), +(7, 'linkedin', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(8, 'stumble', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(9, 'google', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(10, 'deviantart', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(11, 'flickr', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(12, 'skype', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(13, 'rss', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(14, 'twitter', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(15, 'facebook', NULL, NULL, '2016-12-13 03:19:31', '2016-12-13 03:19:31'), +(16, 'youtube', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(17, 'vimeo', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(18, 'pinterest', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(19, 'dribbble', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'), +(20, 'instagram', NULL, NULL, '2016-12-13 03:19:32', '2016-12-13 03:19:32'); -- -------------------------------------------------------- @@ -2474,7 +2438,7 @@ CREATE TABLE IF NOT EXISTS `workflow_close` ( -- INSERT INTO `workflow_close` (`id`, `days`, `condition`, `send_email`, `status`, `created_at`, `updated_at`) VALUES -(1, 2, 1, 1, 3, '2016-11-29 23:27:58', '2016-11-29 23:27:58'); +(1, 2, 1, 1, 3, '2016-12-13 03:19:14', '2016-12-13 03:19:14'); -- -------------------------------------------------------- diff --git a/DB/update from 1.0.7.8 to 1.0.7.9/Updatedatabase.sql b/DB/update from 1.0.7.8 to 1.0.7.9/Updatedatabase.sql index ad331ff4b..27577c020 100644 --- a/DB/update from 1.0.7.8 to 1.0.7.9/Updatedatabase.sql +++ b/DB/update from 1.0.7.8 to 1.0.7.9/Updatedatabase.sql @@ -8,10 +8,6 @@ VALUES (5, 'email_mandatory', '',1,'','2016-06-14 09:07:17','2016-06-14 09:07:17 -- INSERT INTO `ticket_status` (`id`, `name`, `state`, `mode`, `message`, `flags`, `sort`, `email_user`, `icon_class`, `properties`, `created_at`, `updated_at`) -- VALUES (6, 'Unverified', 'unverified', 3, 'User account verification required.', 0, 6, 0, '', 'Ticket will be open after user verifies his/her account.', '2016-06-14 09:07:04', '2016-06-14 09:07:04'); --- --- Alter Table structure for table `users` --- -ALTER TABLE `users` ADD `fcm_token` VARCHAR( 500 ) NULL AFTER `profile_pic`; -- ------------------------------------------------------ diff --git a/DB/update from 1.0.7.9 to 1.0.8.0/Updatedatabase.sql b/DB/update from 1.0.7.9 to 1.0.8.0/Updatedatabase.sql index 4d215f209..02177493a 100644 --- a/DB/update from 1.0.7.9 to 1.0.8.0/Updatedatabase.sql +++ b/DB/update from 1.0.7.9 to 1.0.8.0/Updatedatabase.sql @@ -1,8 +1,8 @@ -- ----------------------------------------------------------- --- +-- -- Table structure for table `conditions` --- +-- DROP TABLE IF EXISTS `conditions`; CREATE TABLE IF NOT EXISTS `conditions` ( @@ -16,9 +16,9 @@ CREATE TABLE IF NOT EXISTS `conditions` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `failed_jobs` --- +-- DROP TABLE IF EXISTS `failed_jobs`; CREATE TABLE IF NOT EXISTS `failed_jobs` ( @@ -32,9 +32,9 @@ CREATE TABLE IF NOT EXISTS `failed_jobs` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `faveo_mails` --- +-- DROP TABLE IF EXISTS `faveo_mails`; CREATE TABLE IF NOT EXISTS `faveo_mails` ( @@ -50,9 +50,9 @@ CREATE TABLE IF NOT EXISTS `faveo_mails` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `faveo_queues` --- +-- DROP TABLE IF EXISTS `faveo_queues`; CREATE TABLE IF NOT EXISTS `faveo_queues` ( @@ -67,9 +67,9 @@ CREATE TABLE IF NOT EXISTS `faveo_queues` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `field_values` --- +-- DROP TABLE IF EXISTS `field_values`; CREATE TABLE IF NOT EXISTS `field_values` ( @@ -86,9 +86,9 @@ CREATE TABLE IF NOT EXISTS `field_values` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `jobs` --- +-- DROP TABLE IF EXISTS `jobs`; CREATE TABLE IF NOT EXISTS `jobs` ( @@ -106,9 +106,9 @@ CREATE TABLE IF NOT EXISTS `jobs` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `mail_services` --- +-- DROP TABLE IF EXISTS `mail_services`; CREATE TABLE IF NOT EXISTS `mail_services` ( @@ -120,9 +120,9 @@ CREATE TABLE IF NOT EXISTS `mail_services` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- +-- -- Dumping data for table `mail_services` --- +-- INSERT INTO `mail_services` (`id`, `name`, `short_name`, `created_at`, `updated_at`) VALUES (1, 'SMTP', 'smtp', '2016-10-09 15:32:44', '2016-10-09 15:32:44'), @@ -134,9 +134,9 @@ INSERT INTO `mail_services` (`id`, `name`, `short_name`, `created_at`, `updated_ -- -------------------------------------------------------- --- +-- -- Table structure for table `queue_services` --- +-- DROP TABLE IF EXISTS `queue_services`; CREATE TABLE IF NOT EXISTS `queue_services` ( @@ -149,9 +149,9 @@ CREATE TABLE IF NOT EXISTS `queue_services` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- +-- -- Dumping data for table `queue_services` --- +-- INSERT INTO `queue_services` (`id`, `name`, `short_name`, `status`, `created_at`, `updated_at`) VALUES (1, 'Sync', 'sync', 1, '2016-10-09 15:32:44', '2016-10-09 16:05:03'), @@ -163,9 +163,9 @@ INSERT INTO `queue_services` (`id`, `name`, `short_name`, `status`, `created_at` -- -------------------------------------------------------- --- +-- -- Table structure for table `social_media` --- +-- DROP TABLE IF EXISTS `social_media`; CREATE TABLE IF NOT EXISTS `social_media` ( @@ -180,9 +180,9 @@ CREATE TABLE IF NOT EXISTS `social_media` ( -- -------------------------------------------------------- --- +-- -- Table structure for table `user_additional_infos` --- +-- DROP TABLE IF EXISTS `user_additional_infos`; CREATE TABLE IF NOT EXISTS `user_additional_infos` ( @@ -196,17 +196,11 @@ CREATE TABLE IF NOT EXISTS `user_additional_infos` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- -------------------------------------------------------------- --- --- Alter Table structure for table `common_settings` --- -INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`) -VALUES (6, 'user_priority', '', '0', '', '2016-10-09 15:32:50', '2016-10-09 15:32:50'); -- -------------------------------------------------------- --- +-- -- Table structure for table `approval` --- +-- DROP TABLE IF EXISTS `approval`; CREATE TABLE IF NOT EXISTS `approval` ( @@ -218,18 +212,18 @@ CREATE TABLE IF NOT EXISTS `approval` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- +-- -- Dumping data for table `approval` --- +-- INSERT INTO `approval` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES (1, 'approval', '0', '2016-10-09 15:32:45', '2016-10-09 15:32:45'); -- -------------------------------------------------------- --- +-- -- Table structure for table `followup` --- +-- DROP TABLE IF EXISTS `followup`; CREATE TABLE IF NOT EXISTS `followup` ( @@ -242,9 +236,9 @@ CREATE TABLE IF NOT EXISTS `followup` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- +-- -- Dumping data for table `followup` --- +-- INSERT INTO `followup` (`id`, `name`, `status`, `condition`, `created_at`, `updated_at`) VALUES (1, 'followup', '', '', '2016-10-09 15:32:45', '2016-10-09 15:32:45'); @@ -253,10 +247,10 @@ INSERT INTO `followup` (`id`, `name`, `status`, `condition`, `created_at`, `upda -- -- Alter ticket_priority table --- +-- ALTER TABLE `ticket_priority` ADD (`status` tinyint(1) DEFAULT 0, `is_default` varchar(30)); --- +-- -- Update ticket_priority table values -- UPDATE `ticket_priority` @@ -282,7 +276,7 @@ WHERE `priority_id` = 4; -- -- Alter `users` table --- +-- ALTER TABLE `users` MODIFY `mobile` VARCHAR(30) DEFAULT NULL; UPDATE `users` SET `mobile` = NULL WHERE `mobile` = ''; ALTER TABLE `users` ADD UNIQUE (`mobile`); @@ -291,24 +285,24 @@ ALTER TABLE `users` ADD UNIQUE (`mobile`); -- -- Insert new values in `template_types` --- +-- INSERT INTO `template_types` (`id`, `name`, `created_at`, `updated_at`) VALUES (12, 'team_assign_ticket', '2016-10-10 01:29:36', '2016-10-10 01:29:36'), (13, 'reset_new_password', '2016-10-10 01:29:36', '2016-10-10 01:29:36'); -- -------------------------------------------------------------------------- --- +-- -- Insert new values in `templates` table --- +-- INSERT INTO `templates` (`id`, `name`, `variable`, `type`, `subject`, `message`, `description`, `set_id`, `created_at`, `updated_at`) VALUES (12, 'This template is for sending notice to team when ticket is assigned to team', '1', 12, '', '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to your team : {!!$team!!} by {!!$ticket_assigner!!} 

Thank You
Kind Regards,
{!!$system_from!!}
', '', 1, '2016-10-10 01:29:38', '2016-10-10 01:29:38'), (13, 'This template is for sending notice to client when password is changed', '1', 13, 'Verify your email address', 'Hello {!!$user!!},

Your password is successfully changed.Your new password is : {!!$user_password!!}

Thank You.

Kind Regards,
{!!$system_from!!}', '', 1, '2016-10-10 01:29:38', '2016-10-10 01:29:38'); -- -------------------------------------------------------------------------- --- +-- -- Alter Table structure for table `ticket_source` --- +-- DROP TABLE IF EXISTS `ticket_source`; CREATE TABLE IF NOT EXISTS `ticket_source` ( @@ -319,9 +313,9 @@ CREATE TABLE IF NOT EXISTS `ticket_source` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- +-- -- Dumping data for table `ticket_source` --- +-- INSERT INTO `ticket_source` (`id`, `name`, `value`, `css_class`) VALUES (1, 'web', 'Web', 'fa fa-internet-explorer'), @@ -333,9 +327,9 @@ INSERT INTO `ticket_source` (`id`, `name`, `value`, `css_class`) VALUES (7, 'chat', 'Chat', 'fa fa-comment'); -- ---------------------------------------------------------------------- --- +-- -- Alter tickets table --- +-- ALTER TABLE `tickets` ADD COLUMN `approval` tinyint(10), diff --git a/DB/update from 1.0.8.0 to 1.9.0/updatedatabase.sql b/DB/update from 1.0.8.0 to 1.9.0/updatedatabase.sql new file mode 100644 index 000000000..53558c5e2 --- /dev/null +++ b/DB/update from 1.0.8.0 to 1.9.0/updatedatabase.sql @@ -0,0 +1,102 @@ +-- +-- Alter users table +-- + +ALTER TABLE `users` ADD `is_delete` BOOLEAN NOT NULL DEFAULT FALSE AFTER `remember_token`; + +-- --------------------------------------------------------------------------------------- + +-- +-- Update table templates +-- +UPDATE `templates` +SET `message` = '
Hello {!!$ticket_agent_name!!},

Ticket No: {!!$ticket_number!!}
Has been assigned to you by {!!$ticket_assigner!!}
Please check and resppond on the ticket.
Link: {!!$ticket_link!!}

Thank You
Kind Regards,
{!!$system_from!!}
' +WHERE `type` = 1; + +-- -------------------------------------------------------------------------------------- + +-- +-- Alter ticket_attechment table +-- +ALTER TABLE `ticket_attachment` ADD `path` VARCHAR(255) NULL DEFAULT NULL AFTER `file`, ADD `driver` VARCHAR(255) NULL DEFAULT NULL AFTER `path`; + +-- -------------------------------------------------------------------------------------- + +-- +-- Update queue services tables +-- +UPDATE `queue_services` SET `status` = 1 Where `name` LIKE 'Sync' OR `short_name` LIKE 'sync'; + +-- ---------------------------------------------------------------------------------------- + +-- +-- Alter ticket priority color +-- +UPDATE `ticket_priority` +SET `priority_color` = '#00a65a' +WHERE `ticket_priority`.`priority` = "Low"; + +UPDATE `ticket_priority` +SET `priority_color` = '#00bfef' +WHERE `ticket_priority`.`priority` = "Normal"; + +UPDATE `ticket_priority` +SET `priority_color` = '#f39c11' +WHERE `ticket_priority`.`priority` = "High"; + +UPDATE `ticket_priority` +SET `priority_color` = '#dd4b38' +WHERE `ticket_priority`.`priority` = "Emergency"; + +-- --------------------------------------------------------------------------------------------- + +-- +-- Table structure for table `common_settings` +-- + +DROP TABLE IF EXISTS `common_settings`; + +CREATE TABLE `common_settings` ( + `id` int(10) UNSIGNED NOT NULL, + `option_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `option_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `optional_field` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Dumping data for table `common_settings` +-- + +INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`) VALUES +(1, 'ticket_token_time_duration', '1', '', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'), +(2, 'enable_rtl', '', '', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'), +(3, 'user_set_ticket_status', '', '1', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'), +(4, 'send_otp', '', '0', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'), +(5, 'email_mandatory', '', '1', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'), +(6, 'user_priority', '', '0', '', '2016-12-13 05:01:02', '2016-12-13 05:10:14'); + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `common_settings` +-- +ALTER TABLE `common_settings` + ADD PRIMARY KEY (`id`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `common_settings` +-- +ALTER TABLE `common_settings` + MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; + +-- ------------------------------------------------------------------------------- + diff --git a/app/Console/Commands/CloseWork.php b/app/Console/Commands/CloseWork.php index c3a0e7c5a..66af8bf7c 100644 --- a/app/Console/Commands/CloseWork.php +++ b/app/Console/Commands/CloseWork.php @@ -2,11 +2,11 @@ namespace App\Console\Commands; -use App\Http\Controllers\Client\helpdesk\UnAuthController; use Illuminate\Console\Command; +use App\Http\Controllers\Client\helpdesk\UnAuthController; + +class CloseWork extends Command { -class CloseWork extends Command -{ /** * The name and signature of the console command. * @@ -26,8 +26,7 @@ class CloseWork extends Command * * @return void */ - public function __construct() - { + public function __construct() { parent::__construct(); } @@ -36,15 +35,15 @@ class CloseWork extends Command * * @return mixed */ - public function handle() - { + public function handle() { if (env('DB_INSTALL') == 1) { $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $controller = new UnAuthController($PhpMailController); $controller->autoCloseTickets(); - loging('ticket-close-workflow', 'Close ticket workflow executed', 'info'); + loging('ticket-close-workflow', 'Close ticket workflow executed','info'); //\Log::info('Close ticket workflow executed'); $this->info('Close ticket workflow executed'); } } + } diff --git a/app/Console/Commands/SendReport.php b/app/Console/Commands/SendReport.php index ede097a70..fdaf343fb 100644 --- a/app/Console/Commands/SendReport.php +++ b/app/Console/Commands/SendReport.php @@ -2,13 +2,13 @@ namespace App\Console\Commands; +use Illuminate\Console\Command; use App\Http\Controllers\Agent\helpdesk\NotificationController; use App\Http\Controllers\Common\PhpMailController; use Exception; -use Illuminate\Console\Command; -class SendReport extends Command -{ +class SendReport extends Command { + /** * The name and signature of the console command. * @@ -28,8 +28,8 @@ class SendReport extends Command * * @return void */ - public function __construct() - { + public function __construct() { + parent::__construct(); } @@ -38,22 +38,21 @@ class SendReport extends Command * * @return mixed */ - public function handle() - { + public function handle() { try { if (env('DB_INSTALL') == 1) { $mail = new PhpMailController(); $mail->setQueue(); $this_report = new NotificationController($mail); $report = $this_report->send_notification(); - + if ($report !== 0) { - loging('sending-mail-report', 'Report has send', 'info'); + loging('sending-mail-report', 'Report has send','info'); //\Log::info("Report has send"); - $this->info('Report has send'); + $this->info("Report has send"); } else { - loging('sending-mail-report', 'Nothing to send', 'info'); - $this->info('Nothing to send'); + loging('sending-mail-report', 'Nothing to send','info'); + $this->info("Nothing to send"); } } } catch (Exception $ex) { @@ -61,4 +60,5 @@ class SendReport extends Command $this->error($ex->getMessage()); } } + } diff --git a/app/Console/Commands/TicketFetch.php b/app/Console/Commands/TicketFetch.php index a90f10129..c0e7788a6 100644 --- a/app/Console/Commands/TicketFetch.php +++ b/app/Console/Commands/TicketFetch.php @@ -2,13 +2,13 @@ namespace App\Console\Commands; -use App\Http\Controllers\Agent\helpdesk\MailController; -use App\Http\Controllers\Agent\helpdesk\TicketWorkflowController; -use Event; use Illuminate\Console\Command; +use App\Http\Controllers\Agent\helpdesk\MailController; +use Event; +use App\Http\Controllers\Agent\helpdesk\TicketWorkflowController; + +class TicketFetch extends Command { -class TicketFetch extends Command -{ /** * The name and signature of the console command. * @@ -28,8 +28,7 @@ class TicketFetch extends Command * * @return void */ - public function __construct() - { + public function __construct() { parent::__construct(); } @@ -38,9 +37,9 @@ class TicketFetch extends Command * * @return mixed */ - public function handle() - { + public function handle() { if (env('DB_INSTALL') == 1) { + $controller = $this->mailController(); $emails = new \App\Model\helpdesk\Email\Emails(); $settings_email = new \App\Model\helpdesk\Settings\Email(); @@ -48,20 +47,19 @@ class TicketFetch extends Command $ticket = new \App\Model\helpdesk\Settings\Ticket(); $controller->readmails($emails, $settings_email, $system, $ticket); Event::fire('ticket.fetch', ['event' => '']); - loging('fetching-ticket', 'Ticket has read', 'info'); + loging('fetching-ticket', 'Ticket has read','info'); //\Log::info('Ticket has read'); $this->info('Ticket has read'); } } - public function mailController() - { + public function mailController() { $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $NotificationController = new \App\Http\Controllers\Common\NotificationController(); $ticket = new \App\Http\Controllers\Agent\helpdesk\TicketController($PhpMailController, $NotificationController); $work = new TicketWorkflowController($ticket); $controller = new MailController($work); - return $controller; } + } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index ad6953cb2..ab579e13d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -2,12 +2,12 @@ namespace App\Console; -use App\Model\MailJob\Condition; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use App\Model\MailJob\Condition; + +class Kernel extends ConsoleKernel { -class Kernel extends ConsoleKernel -{ /** * The Artisan commands provided by your application. * @@ -27,91 +27,85 @@ class Kernel extends ConsoleKernel * * @return void */ - protected function schedule(Schedule $schedule) - { + protected function schedule(Schedule $schedule) { if (env('DB_INSTALL') == 1) { $queue = $this->getCurrentQueue(); - $schedule->command('queue:listen '.$queue, ['--tries' => 1])->everyMinute()->withoutOverlapping(); + $schedule->command('queue:listen '.$queue, ['--tries' => 1])->everyMinute(); $this->execute($schedule, 'fetching'); $this->execute($schedule, 'notification'); $this->execute($schedule, 'work'); - loging('cron', 'executed successfully', 'info'); } } - public function execute($schedule, $task) - { + public function execute($schedule, $task) { $condition = new Condition(); $command = $condition->getConditionValue($task); switch ($task) { - case 'fetching': + case "fetching": $this->getCondition($schedule->command('ticket:fetch'), $command); break; - case 'notification': + case "notification": $this->getCondition($schedule->command('report:send'), $command); break; - case 'work': + case "work": $this->getCondition($schedule->command('ticket:close'), $command); break; } } - public function getCondition($schedule, $command) - { + public function getCondition($schedule, $command) { $condition = $command['condition']; $at = $command['at']; switch ($condition) { - case 'everyMinute': + case "everyMinute": $schedule->everyMinute()->withoutOverlapping(); break; - case 'everyFiveMinutes': + case "everyFiveMinutes": $schedule->everyFiveMinutes()->withoutOverlapping(); break; - case 'everyTenMinutes': + case "everyTenMinutes": $schedule->everyTenMinutes()->withoutOverlapping(); break; - case 'everyThirtyMinutes': + case "everyThirtyMinutes": $schedule->everyThirtyMinutes()->withoutOverlapping(); break; - case 'hourly': + case "hourly": $schedule->hourly()->withoutOverlapping(); break; - case 'daily': + case "daily": $schedule->daily()->withoutOverlapping(); break; - case 'dailyAt': + case "dailyAt": $this->getConditionWithOption($schedule, $condition, $at); break; - case 'weekly': + case "weekly": $schedule->weekly()->withoutOverlapping(); break; - case 'monthly': + case "monthly": $schedule->monthly()->withoutOverlapping(); break; - case 'yearly': + case "yearly": $schedule->yearly()->withoutOverlapping(); break; } } - public function getConditionWithOption($schedule, $command, $at) - { + public function getConditionWithOption($schedule, $command, $at) { switch ($command) { - case 'dailyAt': + case "dailyAt": $schedule->dailyAt($at)->withoutOverlapping(); break; } } - public function getCurrentQueue() - { + public function getCurrentQueue() { $queue = 'database'; $services = new \App\Model\MailJob\QueueService(); $current = $services->where('status', 1)->first(); if ($current) { $queue = $current->short_name; } - return $queue; } + } diff --git a/app/Events/FaveoAfterReply.php b/app/Events/FaveoAfterReply.php index 6ccfa4a1b..3cd2e523b 100644 --- a/app/Events/FaveoAfterReply.php +++ b/app/Events/FaveoAfterReply.php @@ -12,18 +12,20 @@ class FaveoAfterReply extends Event public $para3; public $para4; public $para5; + public $para6; /** * Create a new event instance. * * @return void */ - public function __construct($para1 = '', $para2 = '', $para3 = '', $para4 = '', $para5 = '') + public function __construct($para1 = '', $para2 = '', $para3 = '', $para4 = '', $para5 = '',$para6='') { $this->para1 = $para1; $this->para2 = $para2; $this->para3 = $para3; $this->para4 = $para4; $this->para5 = $para5; + $this->para6 = $para6; } } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index d5b0dc49c..7329c88fc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -1,7 +1,5 @@ common($request, $e); } } - /** * Function to render 500 error page. * @@ -90,14 +83,12 @@ class Handler extends ExceptionHandler { if (config('app.debug') == true) { return parent::render($request, $e); - } elseif ($e instanceof ValidationException) { + }elseif($e instanceof ValidationException){ return parent::render($request, $e); } - return response()->view('errors.500'); //return redirect()->route('error500', []); } - /** * Function to render 404 error page. * @@ -108,23 +99,21 @@ class Handler extends ExceptionHandler */ public function render404($request, $e) { + $seg = $request->segments(); if (in_array('api', $seg)) { return response()->json(['status' => '404']); } if (config('app.debug') == true) { - if ($e->getStatusCode() == '404') { + if($e->getStatusCode() == '404') { return redirect()->route('error404', []); } - return parent::render($request, $e); } - return redirect()->route('error404', []); } - /** - * Function to render database connection failed. + * Function to render database connection failed * * @param type $request * @param type $e @@ -140,10 +129,8 @@ class Handler extends ExceptionHandler if (config('app.debug') == true) { return parent::render($request, $e); } - return redirect()->route('error404', []); } - /** * Common finction to render both types of codes. * @@ -160,7 +147,7 @@ class Handler extends ExceptionHandler case $e instanceof NotFoundHttpException: return $this->render404($request, $e); case $e instanceof PDOException: - if (strpos('1045', $e->getMessage()) == true) { + if(strpos('1045', $e->getMessage()) == true) { return $this->renderDB($request, $e); } else { return $this->render500($request, $e); @@ -174,7 +161,6 @@ class Handler extends ExceptionHandler default: return $this->render500($request, $e); } - return parent::render($request, $e); } -} +} \ No newline at end of file diff --git a/app/FaveoLog/LaravelLogViewer.php b/app/FaveoLog/LaravelLogViewer.php index e635e4a15..9fc18111f 100644 --- a/app/FaveoLog/LaravelLogViewer.php +++ b/app/FaveoLog/LaravelLogViewer.php @@ -8,32 +8,33 @@ use ReflectionClass; use UTC; /** - * Class LaravelLogViewer. + * Class LaravelLogViewer + * @package Rap2hpoutre\LaravelLogViewer */ -class LaravelLogViewer -{ +class LaravelLogViewer { + /** * @var string file */ private static $file; private static $levels_classes = [ - 'debug' => 'info', - 'info' => 'info', - 'notice' => 'info', - 'warning' => 'warning', - 'error' => 'danger', - 'critical' => 'danger', - 'alert' => 'danger', + 'debug' => 'info', + 'info' => 'info', + 'notice' => 'info', + 'warning' => 'warning', + 'error' => 'danger', + 'critical' => 'danger', + 'alert' => 'danger', 'emergency' => 'danger', ]; private static $levels_imgs = [ - 'debug' => 'info', - 'info' => 'info', - 'notice' => 'info', - 'warning' => 'warning', - 'error' => 'warning', - 'critical' => 'warning', - 'alert' => 'warning', + 'debug' => 'info', + 'info' => 'info', + 'notice' => 'info', + 'warning' => 'warning', + 'error' => 'warning', + 'critical' => 'warning', + 'alert' => 'warning', 'emergency' => 'warning', ]; @@ -42,8 +43,7 @@ class LaravelLogViewer /** * @param string $file */ - public static function setFile($file) - { + public static function setFile($file) { $file = self::pathToLogFile($file); if (File::exists($file)) { @@ -51,15 +51,14 @@ class LaravelLogViewer } } - public static function pathToLogFile($file) - { + public static function pathToLogFile($file) { $logsPath = storage_path('logs'); if (File::exists($file)) { // try the absolute path return $file; } - $file = $logsPath.'/'.$file; + $file = $logsPath . '/' . $file; // check if requested file is really in the logs directory if (dirname($file) !== $logsPath) { @@ -72,17 +71,15 @@ class LaravelLogViewer /** * @return string */ - public static function getFileName() - { + public static function getFileName() { return basename(self::$file); } /** * @return array */ - public static function all() - { - $log = []; + public static function all() { + $log = array(); $log_levels = self::getLogLevels(); @@ -96,17 +93,15 @@ class LaravelLogViewer self::$file = $log_file[0]; } - if (File::size(self::$file) > self::MAX_FILE_SIZE) { - return; - } + if (File::size(self::$file) > self::MAX_FILE_SIZE) + return null; $file = File::get(self::$file); preg_match_all($pattern, $file, $headings); - if (!is_array($headings)) { + if (!is_array($headings)) return $log; - } $log_data = preg_split($pattern, $file); @@ -117,38 +112,38 @@ class LaravelLogViewer foreach ($headings as $h) { for ($i = 0, $j = count($h); $i < $j; $i++) { foreach ($log_levels as $level_key => $level_value) { - if (strpos(strtolower($h[$i]), '.'.$level_value)) { - preg_match('/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\].*?(\w+)\.'.$level_key.': (.*?)( in .*?:[0-9]+)?$/', $h[$i], $current); + if (strpos(strtolower($h[$i]), '.' . $level_value)) { - if (!isset($current[3])) { + preg_match('/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\].*?(\w+)\.' . $level_key . ': (.*?)( in .*?:[0-9]+)?$/', $h[$i], $current); + + if (!isset($current[3])) continue; - } $array = explode(':-:-:-', $current[3]); $message = $current[3]; $context = $current[2]; - + if (is_array($array)) { if (array_key_exists(0, $array)) { $message = $array[0]; } if (array_key_exists(1, $array)) { $context = $array[1]; - } else { + }else{ $context = $current[2]; } } //dd($current); - $log[] = [ - 'context' => $context, - 'level' => $level_value, + $log[] = array( + 'context' => $context, + 'level' => $level_value, 'level_class' => self::$levels_classes[$level_value], - 'level_img' => self::$levels_imgs[$level_value], - 'date' => self::date($current[1]), - 'text' => $message, - 'in_file' => isset($current[4]) ? $current[4] : null, - 'stack' => preg_replace("/^\n*/", '', $log_data[$i]), - ]; + 'level_img' => self::$levels_imgs[$level_value], + 'date' => self::date($current[1]), + 'text' => $message, + 'in_file' => isset($current[4]) ? $current[4] : null, + 'stack' => preg_replace("/^\n*/", '', $log_data[$i]) + ); } } } @@ -159,12 +154,10 @@ class LaravelLogViewer /** * @param bool $basename - * * @return array */ - public static function getFiles($basename = false) - { - $files = glob(storage_path().'/logs/*'); + public static function getFiles($basename = false) { + $files = glob(storage_path() . '/logs/*'); $files = array_reverse($files); $files = array_filter($files, 'is_file'); if ($basename && is_array($files)) { @@ -172,24 +165,20 @@ class LaravelLogViewer $files[$k] = basename($file); } } - return array_values($files); } /** * @return array */ - private static function getLogLevels() - { - $class = new ReflectionClass(new LogLevel()); - + private static function getLogLevels() { + $class = new ReflectionClass(new LogLevel); return $class->getConstants(); } - public static function date($utc) - { + public static function date($utc) { $system_date = UTC::usertimezone($utc); - return $system_date; } + } diff --git a/app/FaveoLog/LaravelLogViewerServiceProvider.php b/app/FaveoLog/LaravelLogViewerServiceProvider.php index e55a135a9..dc3e59182 100644 --- a/app/FaveoLog/LaravelLogViewerServiceProvider.php +++ b/app/FaveoLog/LaravelLogViewerServiceProvider.php @@ -4,8 +4,8 @@ namespace App\FaveoLog; use Illuminate\Support\ServiceProvider; -class LaravelLogViewerServiceProvider extends ServiceProvider -{ +class LaravelLogViewerServiceProvider extends ServiceProvider { + /** * Indicates if loading of the provider is deferred. * @@ -18,17 +18,17 @@ class LaravelLogViewerServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { if (method_exists($this, 'package')) { - $this->package('rap2hpoutre/laravel-log-viewer', 'laravel-log-viewer', __DIR__.'/../../'); + $this->package('rap2hpoutre/laravel-log-viewer', 'laravel-log-viewer', __DIR__ . '/../../'); } - $view_path = app_path().DIRECTORY_SEPARATOR.'FaveoLog'.DIRECTORY_SEPARATOR.'views'; - $this->loadViewsFrom($view_path, 'log'); - $lang_path = app_path().DIRECTORY_SEPARATOR.'FaveoLog'.DIRECTORY_SEPARATOR.'lang'; - $this->loadTranslationsFrom($lang_path, 'log'); + $view_path = app_path() . DIRECTORY_SEPARATOR . 'FaveoLog' . DIRECTORY_SEPARATOR . 'views'; + $this->loadViewsFrom($view_path, 'log'); + + $lang_path = app_path() . DIRECTORY_SEPARATOR . 'FaveoLog' . DIRECTORY_SEPARATOR . 'lang'; + $this->loadTranslationsFrom($lang_path, "log"); } /** @@ -36,8 +36,7 @@ class LaravelLogViewerServiceProvider extends ServiceProvider * * @return void */ - public function register() - { + public function register() { // Add routes $routes = app_path('/FaveoLog/routes.php'); if (file_exists($routes)) { @@ -50,8 +49,8 @@ class LaravelLogViewerServiceProvider extends ServiceProvider * * @return array */ - public function provides() - { - return []; + public function provides() { + return array(); } + } diff --git a/app/FaveoLog/controllers/LogViewerController.php b/app/FaveoLog/controllers/LogViewerController.php index 0c1ea8d44..0a605e90c 100644 --- a/app/FaveoLog/controllers/LogViewerController.php +++ b/app/FaveoLog/controllers/LogViewerController.php @@ -1,38 +1,40 @@ $logs, - 'files' => LaravelLogViewer::getFiles(true), - 'current_file' => LaravelLogViewer::getFileName(), + 'logs' => $logs, + 'files' => LaravelLogViewer::getFiles(true), + 'current_file' => LaravelLogViewer::getFileName() ]); } } diff --git a/app/FaveoLog/lang/en/lang.php b/app/FaveoLog/lang/en/lang.php index 8ba309453..b759dc7d3 100644 --- a/app/FaveoLog/lang/en/lang.php +++ b/app/FaveoLog/lang/en/lang.php @@ -1,5 +1,5 @@ 'Logs', + 'logs'=>'Logs', ]; diff --git a/app/FaveoLog/routes.php b/app/FaveoLog/routes.php index 89f37e71d..852948516 100644 --- a/app/FaveoLog/routes.php +++ b/app/FaveoLog/routes.php @@ -4,6 +4,7 @@ Breadcrumbs::register('logs', function ($breadcrumbs) { $breadcrumbs->parent('setting'); $breadcrumbs->push('System Logs', route('logs')); }); -Route::group(['middleware' => ['web', 'auth', 'roles']], function () { +Route::group(['middleware' => ['web', 'auth', 'roles']], function() { Route::get('logs', ['as' => 'logs', 'uses' => 'App\FaveoLog\controllers\LogViewerController@index']); }); + diff --git a/app/FaveoStorage/Controllers/SettingsController.php b/app/FaveoStorage/Controllers/SettingsController.php new file mode 100644 index 000000000..60bf35a9c --- /dev/null +++ b/app/FaveoStorage/Controllers/SettingsController.php @@ -0,0 +1,117 @@ + +
+
+ + + + + +
+

'.Lang::get("storage::lang.storage").'

+
+ '; + } + + public function settings() { + try { + $settings = new CommonSettings(); + $directories = $this->directories(); + $def = $settings->getOptionValue('storage', 'default'); + $ro = $settings->getOptionValue('storage', 'root'); + $default = 'local'; + $root = storage_path('app'); + if ($def) { + $default = $def->option_value; + } + if ($ro) { + $root = $ro->option_value; + } + return view('storage::settings', compact('default', 'root', 'directories')); + } catch (Exception $ex) { + return redirect()->back()->with('fails', $ex->getMessage()); + } + } + + public function postSettings(Request $request) { + try { + $requests = $request->except('_token'); + $this->delete(); + if (count($requests) > 0) { + foreach ($requests as $key => $value) { + if ($value) { + $this->save($key, $value); + } + } + } + return redirect()->back()->with('success', 'Updated'); + } catch (Exception $ex) { + return redirect()->back()->with('fails', $ex->getMessage()); + } + } + + public function delete() { + $settings = CommonSettings::where('option_name', 'storage')->get(); + if ($settings->count() > 0) { + foreach ($settings as $setting) { + $setting->delete(); + } + } + } + + public function save($key, $value) { + CommonSettings::create([ + 'option_name' => 'storage', + 'optional_field' => $key, + 'option_value' => $value, + ]); + } + + public function directories($root = "") { + if ($root == "") { + $root = base_path(); + } + + $iter = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($root, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied" + ); + + $paths = array($root); + foreach ($iter as $path => $dir) { + if ($dir->isDir()) { + $paths[$path] = $path; + } + } + + return $paths; + } + + public function attachment() { + $storage = new StorageController(); + $storage->upload(); + } + + public function activate(){ + $path = "app".DIRECTORY_SEPARATOR."FaveoStorage".DIRECTORY_SEPARATOR."database".DIRECTORY_SEPARATOR."migrations"; + Artisan::call('migrate', [ + '--path' => $path, + '--force'=>true, + ]); + } + +} diff --git a/app/FaveoStorage/Controllers/StorageController.php b/app/FaveoStorage/Controllers/StorageController.php new file mode 100644 index 000000000..0daa41bc3 --- /dev/null +++ b/app/FaveoStorage/Controllers/StorageController.php @@ -0,0 +1,225 @@ +default = $this->defaults(); + $this->driver = $this->driver(); + $this->root = $this->root(); + $this->s3_key = $this->s3Key(); + $this->s3_region = $this->s3Region(); + $this->s3_bucket = $this->s3Bucket(); + $this->rackspace_container = $this->rackspaceContainer(); + $this->rackspace_endpoint = $this->rackspaceEndpoint(); + $this->rackspace_key = $this->rackspaceKey(); + $this->rackspace_region = $this->rackspaceRegion(); + $this->rackspace_url_type = $this->rackspaceUrlType(); + $this->rackspace_username = $this->rackspaceUsername(); + } + + protected function settings($option) { + $settings = new CommonSettings(); + $setting = $settings->getOptionValue('storage', $option); + $value = ""; + if ($setting) { + $value = $setting->option_value; + } + return $value; + } + + public function defaults() { + $default = "local"; + if ($this->settings('default')) { + $default = $this->settings('default'); + } + return $default; + } + + public function driver() { + return $this->settings('default'); + } + + public function root() { + $root = storage_path('app'); + if ($this->settings('root')) { + $root = $this->settings('root'); + } + return $root; + } + + public function s3Key() { + return $this->settings('s3_key'); + } + + public function s3Region() { + return $this->settings('s3_region'); + } + + public function s3Secret() { + return $this->settings('s3_secret'); + } + + public function s3Bucket() { + return $this->settings('s3_bucket'); + } + + public function rackspaceKey() { + return $this->settings('root'); + } + + public function rackspaceRegion() { + return $this->settings('rackspace_region'); + } + + public function rackspaceUsername() { + return $this->settings('rackspace_username'); + } + + public function rackspaceContainer() { + return $this->settings('rackspace_container'); + } + + public function rackspaceEndpoint() { + return $this->settings('rackspace_endpoint'); + } + + public function rackspaceUrlType() { + return $this->settings('rackspace_url_type'); + } + + protected function setFileSystem() { + $config = $this->config(); + //dd($config); + foreach ($config as $key => $con) { + if (is_array($con)) { + foreach ($con as $k => $v) { + Config::set("filesystem.$key.$k", $v); + } + } + Config::set("filesystem.$key", $con); + } + return Config::get('filesystem'); + } + + protected function config() { + return [ + 'default' => $this->default, + 'cloud' => 's3', + 'disks' => $this->disks(), + ]; + } + + protected function disks() { + return [ + "local" => [ + 'driver' => "local", + 'root' => $this->root . '/attachments', + ], + "s3" => [ + 'driver' => "s3", + 'key' => $this->s3_key, + 'secret' => $this->s3_secret, + 'region' => $this->s3_region, + 'bucket' => $this->s3_bucket, + ], + "rackspace" => [ + 'driver' => "rackspace", + 'username' => $this->rackspace_username, + 'key' => $this->rackspace_key, + 'container' => $this->rackspace_container, + 'endpoint' => $this->rackspace_endpoint, + 'region' => $this->rackspace_region, + 'url_type' => $this->rackspace_url_type, + ], + ]; + } + + public function upload($data, $filename, $type, $size, $disposition, $thread_id) { + $upload = new Ticket_attachments(); + $upload->thread_id = $thread_id; + $upload->name = $filename; + $upload->type = $type; + $upload->size = $size; + $upload->poster = $disposition; + $upload->driver = $this->default; + $upload->path = $this->root; + if ($this->default !== "database") { + $this->setFileSystem(); + Storage::disk($this->default)->put($filename, $data); + } else { + $upload->file = $data; + } + if ($data && $size && $disposition) { + $upload->save(); + } + } + + public function saveAttachments($thread_id, $attachments = []) { + if (is_array($attachments) && count($attachments) > 0) { + foreach ($attachments as $attachment) { + $structure = $attachment->getStructure(); + $disposition = 'ATTACHMENT'; + if (isset($structure->disposition)) { + $disposition = $structure->disposition; + } + $filename = str_random(16) . '-' . $attachment->getFileName(); + $type = $attachment->getMimeType(); + $size = $attachment->getSize(); + $data = $attachment->getData(); + $this->upload($data, $filename, $type, $size, $disposition, $thread_id); + $this->updateBody($attachment, $thread_id, $filename); + } + } + } + + public function updateBody($attachment, $thread_id, $filename) { + $structure = $attachment->getStructure(); + $disposition = 'ATTACHMENT'; + if (isset($structure->disposition)) { + $disposition = $structure->disposition; + } + if ($disposition == 'INLINE' || $disposition == 'inline') { + $id = str_replace(">", "", str_replace("<", "", $structure->id)); + $threads = new Ticket_Thread(); + $thread = $threads->find($thread_id); + $body = $thread->body; + $body = str_replace('cid:' . $id, $filename, $body); + $thread->body = $body; + $thread->save(); + } + } + + public function getFile($drive, $name) { + //dd($drive,$name); + if ($drive != "database") { + $this->setFileSystem(); + if(Storage::disk($this->default)->exists($name)){ + return Storage::disk($this->default)->get($name); + } + } + } + +} diff --git a/app/FaveoStorage/StorageServiceProvider.php b/app/FaveoStorage/StorageServiceProvider.php new file mode 100644 index 000000000..4173bb2e6 --- /dev/null +++ b/app/FaveoStorage/StorageServiceProvider.php @@ -0,0 +1,48 @@ +loadViewsFrom($view_path, 'storage'); + + $lang_path = app_path() . DIRECTORY_SEPARATOR . 'FaveoStorage' . DIRECTORY_SEPARATOR . 'lang'; + $this->loadTranslationsFrom($lang_path, "storage"); + + if (isInstall()) { + $controller = new Controllers\SettingsController(); + $controller->activate(); + } + + if (class_exists('Breadcrumbs')) { + require __DIR__ . '/breadcrumbs.php'; + } + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + // Add routes + if (isInstall()) { + $routes = app_path('/FaveoStorage/routes.php'); + if (file_exists($routes)) { + require $routes; + } + } + } + +} diff --git a/app/FaveoStorage/breadcrumbs.php b/app/FaveoStorage/breadcrumbs.php new file mode 100644 index 000000000..9f34fef57 --- /dev/null +++ b/app/FaveoStorage/breadcrumbs.php @@ -0,0 +1,6 @@ +parent('setting'); + $breadcrumbs->push('Storage', route('storage')); +}); \ No newline at end of file diff --git a/app/FaveoStorage/database/migrations/2016_11_30_122809_alter_attachment_table.php b/app/FaveoStorage/database/migrations/2016_11_30_122809_alter_attachment_table.php new file mode 100644 index 000000000..c928072de --- /dev/null +++ b/app/FaveoStorage/database/migrations/2016_11_30_122809_alter_attachment_table.php @@ -0,0 +1,33 @@ +string('driver'); + $table->string('path'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('ticket_attachment', function (Blueprint $table) { + $table->string('driver'); + $table->string('path'); + }); + } +} diff --git a/app/FaveoStorage/lang/en/lang.php b/app/FaveoStorage/lang/en/lang.php new file mode 100644 index 000000000..d049fa795 --- /dev/null +++ b/app/FaveoStorage/lang/en/lang.php @@ -0,0 +1,17 @@ +'Settings', + 'storage'=>'Storage', + 'default'=>'Default', + 'root'=>'Root', + 'region'=>'Region', + 'key'=>'Key', + 'secret'=>'Secret', + 'bucket'=>'Bucket', + 'username'=>'Username', + 'container'=>'Container', + 'endpoint'=>'End Point', + 'url_type'=>'Url Type', +]; + diff --git a/app/FaveoStorage/routes.php b/app/FaveoStorage/routes.php new file mode 100644 index 000000000..25869a26b --- /dev/null +++ b/app/FaveoStorage/routes.php @@ -0,0 +1,16 @@ +settingsIcon(); +}); + + +Route::group(['middleware'=>['web']],function(){ + Route::get('storage',['as'=>'storage','uses'=>'App\FaveoStorage\Controllers\SettingsController@settings']); + Route::post('storage',['as'=>'post.storage','uses'=>'App\FaveoStorage\Controllers\SettingsController@postSettings']); + Route::get('attachment',['as'=>'attach','uses'=>'App\FaveoStorage\Controllers\SettingsController@attachment']); + +}); + + diff --git a/app/FaveoStorage/views/settings.blade.php b/app/FaveoStorage/views/settings.blade.php new file mode 100644 index 000000000..52fb6dda4 --- /dev/null +++ b/app/FaveoStorage/views/settings.blade.php @@ -0,0 +1,139 @@ +@extends('themes.default1.admin.layout.admin') +@section('content') +
+

{{Lang::get('storage::lang.settings')}}

+ +
+
+ +
+

{{Lang::get('storage::lang.storage')}}

+ @if (count($errors) > 0) +
+ Whoops! There were some problems with your input.

+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + + @if(Session::has('success')) +
+ + {{Session::get('success')}} +
+ @endif + + @if(Session::has('fails')) +
+ + {{Lang::get('message.alert')}}! {{Lang::get('message.failed')}}. + + {{Session::get('fails')}} +
+ @endif + {!! Form::open(['url'=>'storage','method'=>'post']) !!} +
+ +
+
+
+ {!! Form::label('default',Lang::get('storage::lang.default')) !!} + {!! Form::select('default',['database'=>'Database','local'=>'Local'],$default,['class'=>'form-control']) !!} +
+ + + + + + + +
+ +
+ + +
+@stop +@section('FooterInclude') + +@stop \ No newline at end of file diff --git a/app/Helper/Finder.php b/app/Helper/Finder.php index 1895f451d..18bfc80cc 100644 --- a/app/Helper/Finder.php +++ b/app/Helper/Finder.php @@ -4,181 +4,156 @@ namespace App\Helper; use App\Model\helpdesk\Agent\Department; use App\Model\helpdesk\Agent\Groups; -use App\Model\helpdesk\Ticket\Ticket_Status; use App\Model\helpdesk\Ticket\TicketStatusType; +use App\Model\helpdesk\Ticket\Ticket_Status; /** *------------------------------------------------------------------ * Class Finder *------------------------------------------------------------------ - * Description: This class is used for defining some common functions + * Description: This class is used for defining some common functions * used in the project. - * + * * @author */ class Finder { - /** - * DEPARTMENT - * This function is used for returning department name with respect to id. - * - * @param $id type int - * @param $custom type array/null - * - * @return type string - */ - public static function department($id, $custom = null) - { - if ($custom == null) { - $department = Department::whereId($id)->select(['name']); - } elseif (isset($custom)) { - $department = Department::whereId($id)->select($custom); - } - - return $department->first()->name; - } - - /** - * GROUP - * This function is used for returning group name with respect to id. - * - * @param $id type int - * @param $custom type array/null - * - * @return type string - */ - public static function group($id, $custom = null) - { - if ($custom == null) { - $group = Groups::whereId($id)->select(['name']); - } elseif (isset($custom)) { - $group = Groups::whereId($id)->select($custom); - } - - return $group->first()->name; - } + + /** + * DEPARTMENT + * This function is used for returning department name with respect to id + * @param $id type int + * @param $custom type array/null + * @return type string + */ + public static function department($id, $custom = null) { + if($custom == null) { + $department = Department::whereId($id)->select(['name']); + } elseif(isset($custom)) { + $department = Department::whereId($id)->select($custom); + } + return $department->first()->name; + } + /** + * GROUP + * This function is used for returning group name with respect to id + * @param $id type int + * @param $custom type array/null + * @return type string + */ + public static function group($id, $custom = null) { + if($custom == null) { + $group = Groups::whereId($id)->select(['name']); + } elseif(isset($custom)) { + $group = Groups::whereId($id)->select($custom); + } + return $group->first()->name; + } + /** * STATUS TYPE - * This function is used for returning status type name with respect to id. - * - * @param $id type int - * @param $custom type array/null - * - * @return type string - */ - public static function statusType($id, $custom = null) - { - if ($custom == null) { - $status_type = TicketStatusType::whereId($id)->select(['name']); - } elseif (isset($custom)) { - $status_type = TicketStatusType::whereId($id)->select($custom); - } + * This function is used for returning status type name with respect to id + * @param $id type int + * @param $custom type array/null + * @return type string + */ + public static function statusType($id, $custom = null) { + if($custom == null) { + $status_type = TicketStatusType::whereId($id)->select(['name']); + } elseif(isset($custom)) { + $status_type = TicketStatusType::whereId($id)->select($custom); + } + return $status_type->first()->name; + } + + /** + * STATUS + * This function is used for returning status name with respect to id + * @param $id type int + * @param $custom type array/null + * @return type string + */ + public static function status($id, $custom = null) { + if($custom == null) { + $status = Ticket_Status::whereId($id)->first(); + } elseif(isset($custom)) { + $status = Ticket_Status::whereId($id)->select($custom); + } + return $status; + } - return $status_type->first()->name; - } - - /** - * STATUS - * This function is used for returning status name with respect to id. - * - * @param $id type int - * @param $custom type array/null - * - * @return type string - */ - public static function status($id, $custom = null) - { - if ($custom == null) { - $status = Ticket_Status::whereId($id)->first(); - } elseif (isset($custom)) { - $status = Ticket_Status::whereId($id)->select($custom); - } - - return $status; - } - - /** - * USER ROLES IN A GROUP FOR STATUS LIST - * This function is used to return roles of users from a given value. - * If the value is 1 the response is client - * If the value is 2 the response is agent - * If the value is 4 the response is admin - * If the value is 1+2 = 3 the response is client, agent - * If the value is 1+4 = 5 the response is client, admin - * If the value is 2+4 = 6 the response is agent, admin - * If the value is 1+2+4 = 7 the response is client, agent, admin. - * - * @param $id type int - * - * @return type string - */ - public static function rolesGroup($id) - { - switch ($id) { + /** + * USER ROLES IN A GROUP FOR STATUS LIST + * This function is used to return roles of users from a given value. + * If the value is 1 the response is client + * If the value is 2 the response is agent + * If the value is 4 the response is admin + * If the value is 1+2 = 3 the response is client, agent + * If the value is 1+4 = 5 the response is client, admin + * If the value is 2+4 = 6 the response is agent, admin + * If the value is 1+2+4 = 7 the response is client, agent, admin + * @param $id type int + * @return type string + */ + public static function rolesGroup($id) { + + switch ($id) { case null: return \Lang::get('lang.none'); case 1: - return 'Client'; + return "Client"; case 2: - return 'Agent'; + return "Agent"; case 4: - return 'Admin'; + return "Admin"; case 3: - return 'Client,Agent'; + return "Client,Agent"; case 5: - return 'Client,Admin'; + return "Client,Admin"; case 6: - return 'Agent,Admin'; + return "Agent,Admin"; case 7: - return 'Client,Agent,Admin'; + return "Client,Agent,Admin"; default: - return 'Undefined!'; + return "Undefined!"; } - } + } /** * ANY TYPE STATUS - * This function is used to return the set of status which are of any type passed in the param. - * + * This function is used to return the set of status which are of any type passed in the param * @param type $id - * * @return type array */ - public static function anyTypeStatus($id) - { - $status_group = Ticket_Status::where('purpose_of_status', '=', $id)->select(['id'])->get(); - foreach ($status_group as $status) { - $status_group2[] = $status->id; - } - - return $status_group2; + public static function anyTypeStatus($id) { + $status_group = Ticket_Status::where('purpose_of_status', '=', $id)->select(['id'])->get(); + foreach($status_group as $status) { + $status_group2[] = $status->id; + } + return $status_group2; } - + /** * RETURNS ALL STATUS - * This function is used to return all the status given in the system. - * + * This function is used to return all the status given in the system * @return type array */ - public static function getAllStatus() - { - $status = Ticket_Status::where('purpose_of_status', '!=', 3)->orwhere('purpose_of_status', '!=', 4)->get(); - - return $status; + public static function getAllStatus() { + $status = Ticket_Status::where('purpose_of_status', '!=', 3)->orwhere('purpose_of_status', '!=', 4)->get(); + return $status; } - + /** - * VARIABLE REPLACEMENT - * This function is used to replace the replaceable variables form a given content for templates. + * VARIABLE REPLACEMENT + * This function is used to replace the replaceable variables form a given content for templates + * */ - public static function replaceTemplateVariables($variables, $data, $contents) - { + public static function replaceTemplateVariables($variables, $data, $contents) { foreach ($variables as $key => $variable) { - $messagebody = str_replace($variables[$key], $data[$key], $contents); - $contents = $messagebody; + $messagebody = str_replace($variables[$key], $data[$key], $contents); + $contents = $messagebody; } - return $contents; } -} +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/MailFetch.php b/app/Http/Controllers/Admin/MailFetch.php index f2c3765c1..97d98b1f6 100644 --- a/app/Http/Controllers/Admin/MailFetch.php +++ b/app/Http/Controllers/Admin/MailFetch.php @@ -1,13 +1,10 @@ serverPath = $serverPath; $this->port = $port; diff --git a/app/Http/Controllers/Admin/helpdesk/AgentController.php b/app/Http/Controllers/Admin/helpdesk/AgentController.php index ea669cfab..968fd78de 100644 --- a/app/Http/Controllers/Admin/helpdesk/AgentController.php +++ b/app/Http/Controllers/Admin/helpdesk/AgentController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\Admin\helpdesk; // controller -use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Controller; +use App\Http\Controllers\Common\PhpMailController; // request use App\Http\Requests\helpdesk\AgentRequest; use App\Http\Requests\helpdesk\AgentUpdate; @@ -79,11 +79,11 @@ class AgentController extends Controller { try { // gte all the teams - $team = $team_all->get(); + $team = $team_all->where('status', '=', 1)->get(); // get all the timezones $timezones = $timezone->get(); // get all the groups - $groups = $group->get(); + $groups = $group->where('group_status', '=', 1)->get(); // get all department $departments = $department->get(); // list all the teams in a single variable @@ -92,7 +92,6 @@ class AgentController extends Controller $phonecode = $code->where('iso', '=', $location->iso_code)->first(); // returns to the page with all the variables and their datas $send_otp = DB::table('common_settings')->select('status')->where('option_name', '=', 'send_otp')->first(); - return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team', 'send_otp'))->with('phonecode', $phonecode->phonecode); } catch (Exception $e) { // returns if try fails with exception meaagse @@ -121,9 +120,10 @@ class AgentController extends Controller } // fixing the user role to agent $user->fill($request->except(['group', 'primary_department', 'agent_time_zone', 'mobile']))->save(); - if ($request->get('mobile')) { + if ($request->get('mobile')) + { $user->mobile = $request->get('mobile'); - } else { + } else{ $user->mobile = null; } $user->assign_group = $request->group; @@ -146,7 +146,7 @@ class AgentController extends Controller // fetch user credentails to send mail $name = $user->first_name; $email = $user->email; - if ($request->input('send_email')) { + if($request->input('send_email')) { try { // send mail on registration $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); @@ -159,7 +159,6 @@ class AgentController extends Controller if ($request->input('active') == '0' || $request->input('active') == 0) { \Event::fire(new \App\Events\LoginEvent($request)); } - return redirect('agents')->with('success', Lang::get('lang.agent_creation_success')); } else { // returns if fails @@ -186,10 +185,10 @@ class AgentController extends Controller $location = GeoIP::getLocation(); $phonecode = $code->where('iso', '=', $location->iso_code)->first(); $user = $user->whereId($id)->first(); - $team = $team->get(); + $team = $team->where('status', '=', 1)->get(); $teams1 = $team->lists('name', 'id'); $timezones = $timezone->get(); - $groups = $group->get(); + $groups = $group->where('group_status', '=', 1)->get(); $departments = $department->get(); $table = $team_assign_agent->where('agent_id', $id)->first(); $teams = $team->lists('id', 'name')->toArray(); @@ -276,6 +275,7 @@ class AgentController extends Controller $user->id; $user->delete(); throw new \Exception($error); + return redirect('agents')->with('success', Lang::get('lang.agent_deleted_sucessfully')); } catch (\Exception $e) { return redirect('agents')->with('fails', $error); diff --git a/app/Http/Controllers/Admin/helpdesk/DepartmentController.php b/app/Http/Controllers/Admin/helpdesk/DepartmentController.php index 200ec5c10..adbc7108d 100644 --- a/app/Http/Controllers/Admin/helpdesk/DepartmentController.php +++ b/app/Http/Controllers/Admin/helpdesk/DepartmentController.php @@ -29,15 +29,14 @@ use Lang; * * @author Ladybird */ -class DepartmentController extends Controller -{ +class DepartmentController extends Controller { + /** * Create a new controller instance. * * @return void */ - public function __construct() - { + public function __construct() { $this->middleware('auth'); $this->middleware('roles'); } @@ -49,11 +48,9 @@ class DepartmentController extends Controller * * @return type Response */ - public function index(Department $department) - { + public function index(Department $department) { try { $departments = $department->get(); - return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments')); } catch (Exception $e) { return view('404'); @@ -73,14 +70,14 @@ class DepartmentController extends Controller * * @return type Response */ - public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group) - { + public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group) { try { - $slas = $sla->get(); + $slas = $sla->where('status', '=', 1) + ->select('grace_period','id')->get(); $user = $user->where('role', '<>', 'user') ->where('active', '=', 1) ->get(); - $emails = $email->get(); + $emails = $email->select('email_name','id')->get(); $templates = $template->get(); $department = $department->get(); $groups = $group->lists('id', 'name'); @@ -99,8 +96,7 @@ class DepartmentController extends Controller * * @return type Response */ - public function store(Department $department, DepartmentRequest $request) - { + public function store(Department $department, DepartmentRequest $request) { try { $department->fill($request->except('group_id', 'manager', 'sla'))->save(); if ($request->sla) { @@ -123,7 +119,6 @@ class DepartmentController extends Controller ->where('id', 1) ->update(['department' => $department->id]); } - return redirect('departments')->with('success', Lang::get('lang.department_created_sucessfully')); } else { return redirect('departments')->with('fails', Lang::get('lang.failed_to_create_department')); @@ -148,24 +143,24 @@ class DepartmentController extends Controller * * @return type Response */ - public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) - { + public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) { try { $sys_department = \DB::table('settings_system') ->select('department') ->where('id', '=', 1) ->first(); - $slas = $sla->get(); + $slas = $sla->where('status', '=', 1) + ->select('grace_period','id')->get(); $user = $user->where('primary_dpt', $id) ->where('active', '=', 1) - ->get(); - $emails = $email->get(); + ->get(); + $emails = $email->select('email_name','id')->get(); $templates = $template->get(); $departments = $department->whereId($id)->first(); - $groups = $group->lists('id', 'name'); + //$groups = $group->lists('id', 'name'); $assign = $group_assign_department->where('department_id', $id)->lists('group_id'); - return view('themes.default1.admin.helpdesk.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'groups', 'sys_department')); + return view('themes.default1.admin.helpdesk.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'sys_department')); } catch (Exception $e) { return redirect('departments')->with('fails', $e->getMessage()); } @@ -181,8 +176,7 @@ class DepartmentController extends Controller * * @return type Response */ - public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) - { + public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) { // dd($id); try { $table = $group_assign_department->where('department_id', $id); @@ -230,10 +224,9 @@ class DepartmentController extends Controller * * @return type Response */ - public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) - { + public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) { // try { - + $system = $system->where('id', '=', '1')->first(); if ($system->department == $id) { return redirect('departments')->with('fails', Lang::get('lang.you_cannot_delete_default_department')); @@ -245,7 +238,7 @@ class DepartmentController extends Controller } else { $text_tickets = 'Ticket'; } - $ticket = '
  • '.$tickets.' '.$text_tickets.Lang::get('lang.have_been_moved_to_default_department').'
  • '; + $ticket = '
  • ' . $tickets . ' ' . $text_tickets . Lang::get('lang.have_been_moved_to_default_department') . '
  • '; } else { $ticket = ''; } @@ -256,7 +249,7 @@ class DepartmentController extends Controller } else { $text_user = 'User'; } - $user = '
  • '.$users.' '.$text_user.Lang::get('lang.have_been_moved_to_default_department').'
  • '; + $user = '
  • ' . $users . ' ' . $text_user . Lang::get('lang.have_been_moved_to_default_department') . '
  • '; } else { $user = ''; } @@ -267,27 +260,28 @@ class DepartmentController extends Controller } else { $text_emails = 'Email'; } - $email = '
  • '.$emails.' System '.$text_emails.Lang::get('lang.have_been_moved_to_default_department').'
  • '; + $email = '
  • ' . $emails . ' System ' . $text_emails . Lang::get('lang.have_been_moved_to_default_department') . '
  • '; } else { $email = ''; } $helptopic = DB::table('help_topic')->where('department', '=', $id)->update(['department' => null], ['status' => '1']); if ($helptopic > 0) { - $helptopic = '
  • '.Lang::get('lang.the_associated_helptopic_has_been_deactivated').'
  • '; + $helptopic = '
  • ' . Lang::get('lang.the_associated_helptopic_has_been_deactivated') . '
  • '; } else { $helptopic = ''; } - $message = $ticket.$user.$email.$helptopic; + $message = $ticket . $user . $email . $helptopic; /* Becouse of foreign key we delete group_assign_department first */ $group_assign_department = $group_assign_department->where('department_id', $id); $group_assign_department->delete(); $departments = $department->whereId($id)->first(); /* Check the function is Success or Fail */ if ($departments->delete() == true) { - return redirect('departments')->with('success', Lang::get('lang.department_deleted_sucessfully').$message); + return redirect('departments')->with('success', Lang::get('lang.department_deleted_sucessfully') . $message); } else { return redirect('departments')->with('fails', Lang::get('lang.department_can_not_delete')); } } } + } diff --git a/app/Http/Controllers/Admin/helpdesk/EmailsController.php b/app/Http/Controllers/Admin/helpdesk/EmailsController.php index 108db2937..2ac96c622 100644 --- a/app/Http/Controllers/Admin/helpdesk/EmailsController.php +++ b/app/Http/Controllers/Admin/helpdesk/EmailsController.php @@ -3,21 +3,21 @@ namespace App\Http\Controllers\Admin\helpdesk; // controllers -use App\Http\Controllers\Admin\MailFetch as Fetch; use App\Http\Controllers\Controller; use App\Http\Requests\helpdesk\EmailsRequest; -// model -use App\Http\Requests\helpdesk\Mail\MailRequest; use App\Model\helpdesk\Agent\Department; +// model use App\Model\helpdesk\Email\Emails; use App\Model\helpdesk\Manage\Help_topic; use App\Model\helpdesk\Settings\Email; use App\Model\helpdesk\Ticket\Ticket_Priority; -// classes use App\Model\helpdesk\Utility\MailboxProtocol; use Crypt; +// classes use Exception; use Lang; +use App\Http\Requests\helpdesk\Mail\MailRequest; +use App\Http\Controllers\Admin\MailFetch as Fetch; /** * ====================================== @@ -27,15 +27,14 @@ use Lang; * * @author Ladybird */ -class EmailsController extends Controller -{ +class EmailsController extends Controller { + /** * Defining constructor variables. * * @return type */ - public function __construct() - { + public function __construct() { $this->middleware('auth'); $this->middleware('roles'); } @@ -47,8 +46,7 @@ class EmailsController extends Controller * * @return type view */ - public function index(Emails $email) - { + public function index(Emails $email) { try { // fetch all the emails from emails table $emails = $email->get(); @@ -69,14 +67,13 @@ class EmailsController extends Controller * * @return type Response */ - public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) - { + public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) { try { // fetch all the departments from the department table $departments = $department->get(); // fetch all the helptopics from the helptopic table $helps = $help->where('status', '=', 1)->get(); - // fetch all the types of active priority from the ticket_priority table + // fetch all the types of priority from the ticket_priority table $priority = $ticket_priority->where('status', '=', 1)->get(); // fetch all the types of mailbox protocols from the mailbox_protocols table $mailbox_protocols = $mailbox_protocol->get(); @@ -99,8 +96,7 @@ class EmailsController extends Controller * * @return int */ - public function validatingEmailSettings(MailRequest $request, $id = '') - { + public function validatingEmailSettings(MailRequest $request, $id = "") { //dd($request->all()); try { $service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode', 'code'); @@ -118,10 +114,8 @@ class EmailsController extends Controller } if ($send == 1 && $fetch == 1) { $this->store($request, $service_request, $id); - return $this->jsonResponse('success', Lang::get('lang.success')); } - return $this->validateEmailError($send, $fetch); } catch (Exception $ex) { $message = $ex->getMessage(); @@ -129,13 +123,11 @@ class EmailsController extends Controller $message = imap_last_error(); } loging('mail-config', $message); - return $this->jsonResponse('fails', $message); } } - public function validateEmailError($out, $in) - { + public function validateEmailError($out, $in) { if ($out !== 1) { return $this->jsonResponse('fails', Lang::get('lang.outgoing_email_connection_failed')); } @@ -144,15 +136,13 @@ class EmailsController extends Controller } } - public function jsonResponse($type, $message) - { + public function jsonResponse($type, $message) { if ($type == 'fails') { $result = ['fails' => $message]; } if ($type == 'success') { $result = ['success' => $message]; } - return response()->json(compact('result')); } @@ -164,10 +154,9 @@ class EmailsController extends Controller * * @return type Redirect */ - public function store($request, $service_request = [], $id = '') - { + public function store($request, $service_request = [], $id = "") { $email = new Emails(); - if ($id !== '') { + if ($id !== "") { $email = $email->find($id); } @@ -219,7 +208,7 @@ class EmailsController extends Controller if ($request->input('fetching_status')) { $this->fetch($email); } - if ($id === '') { + if ($id === "") { // Creating a default system email as the first email is inserted to the system $email_settings = Email::where('id', '=', '1')->first(); $email_settings->sys_email = $email->id; @@ -233,12 +222,31 @@ class EmailsController extends Controller if ($request->input('fetching_status')) { $this->fetch($email); } - return 1; } - public function sendDiagnoEmail($request) - { + public function checkMail($request) { + $mailservice_id = $request->input('sending_protocol'); + $driver = $this->getDriver($mailservice_id); + $username = $request->input('email_address'); + $password = $request->input('password'); + $name = $request->input('email_name'); + $host = $request->input('sending_host'); + $port = $request->input('sending_port'); + $enc = $request->input('sending_encryption'); + $service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode'); + + $this->emailService($driver, $service_request); + $this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port); + $transport = \Swift_SmtpTransport::newInstance($host, $port, $enc); + $transport->setUsername($username); + $transport->setPassword($password); + $mailer = \Swift_Mailer::newInstance($transport); + $mailer->getTransport()->start(); + return 1; + } + + public function sendDiagnoEmail($request) { $mailservice_id = $request->input('sending_protocol'); $driver = $this->getDriver($mailservice_id); $username = $request->input('email_address'); @@ -252,45 +260,41 @@ class EmailsController extends Controller $this->emailService($driver, $service_request); $this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port); $controller = new \App\Http\Controllers\Common\PhpMailController(); - $subject = 'test'; - $data = 'test'; + $subject = "test"; + $data = "test"; //dd(\Config::get('mail'),\Config::get('services')); $send = $controller->laravelMail($username, $name, $subject, $data, [], []); - return $send; } - public function setMailConfig($driver, $username, $name, $password, $enc, $host, $port) - { + public function setMailConfig($driver, $username, $name, $password, $enc, $host, $port) { $configs = [ - 'username' => $username, - 'from' => ['address' => $username, 'name' => $name], - 'password' => $password, + 'username' => $username, + 'from' => ['address' => $username, 'name' => $name,], + 'password' => $password, 'encryption' => $enc, - 'host' => $host, - 'port' => $port, - 'driver' => $driver, + 'host' => $host, + 'port' => $port, + 'driver' => $driver, ]; foreach ($configs as $key => $config) { if (is_array($config)) { foreach ($config as $from) { - \Config::set('mail.'.$key, $config); + \Config::set('mail.' . $key, $config); } } else { - \Config::set('mail.'.$key, $config); + \Config::set('mail.' . $key, $config); } } } - public function getDriver($driver_id) - { - $short = ''; + public function getDriver($driver_id) { + $short = ""; $email_drivers = new \App\Model\MailJob\MailService(); $email_driver = $email_drivers->find($driver_id); if ($email_driver) { $short = $email_driver->short_name; } - return $short; } @@ -306,8 +310,7 @@ class EmailsController extends Controller * * @return type Response */ - public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) - { + public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) { try { $sys_email = \DB::table('settings_email')->select('sys_email')->where('id', '=', 1)->first(); // dd($sys_email); @@ -319,8 +322,8 @@ class EmailsController extends Controller $count = $email->count(); // get all the helptopic $helps = $help->where('status', '=', 1)->get(); - // get all active the priority - $priority = $ticket_priority->where('status', '=', 1)->get(); + // get all the priority + $priority = $ticket_priority->where('status', '=', 1)->get(); // get all the mailbox protocols $mailbox_protocols = $mailbox_protocol->get(); @@ -342,8 +345,7 @@ class EmailsController extends Controller * * @return int */ - public function validatingEmailSettingsUpdate($id, MailRequest $request) - { + public function validatingEmailSettingsUpdate($id, MailRequest $request) { try { return $this->validatingEmailSettings($request, $id); } catch (Exception $ex) { @@ -367,9 +369,9 @@ class EmailsController extends Controller * * @return type Response */ - public function update($id, $request) - { + public function update($id, $request) { try { + if ($request->sys_email == 'on') { $system = \DB::table('settings_email') ->where('id', '=', 1) @@ -395,8 +397,7 @@ class EmailsController extends Controller * * @return type Redirect */ - public function destroy($id, Emails $email) - { + public function destroy($id, Emails $email) { // fetching the details on the basis of the $id passed to the function $default_system_email = Email::where('id', '=', '1')->first(); if ($default_system_email->sys_email) { @@ -410,7 +411,6 @@ class EmailsController extends Controller $emails = $email->whereId($id)->first(); // checking if deleting the email is success or if it's carrying any dependencies $emails->delete(); - return redirect('emails')->with('success', Lang::get('lang.email_deleted_sucessfully')); } catch (Exception $e) { // returns if the try fails @@ -425,8 +425,7 @@ class EmailsController extends Controller * * @return type int */ - public function getImapStream($request) - { + public function getImapStream($request) { $host = $request->input('fetching_host'); $port = $request->input('fetching_port'); $service = $request->input('fetching_protocol'); @@ -436,7 +435,7 @@ class EmailsController extends Controller $password = $request->input('password'); $server = new Fetch($host, $port, $service); //$server->setFlag('novalidate-cert'); - if ($encryption != '') { + if ($encryption != "") { $server->setFlag($encryption); } if (!$validate) { @@ -447,7 +446,6 @@ class EmailsController extends Controller $server->setAuthentication($username, $password); $server->getImapStream(); - return 1; } @@ -458,8 +456,7 @@ class EmailsController extends Controller * * @return type int */ - public function checkImapStream($imap_stream) - { + public function checkImapStream($imap_stream) { $check_imap_stream = imap_check($imap_stream); if ($check_imap_stream) { $imap_stream = 1; @@ -477,8 +474,7 @@ class EmailsController extends Controller * * @return int */ - public function getSmtp($request) - { + public function getSmtp($request) { $sending_status = $request->input('sending_status'); // cheking for the sending protocol if ($request->input('sending_protocol') == 'smtp') { @@ -494,8 +490,8 @@ class EmailsController extends Controller $mail->SMTPAuth = true; // Enable SMTP authentication $mail->SMTPOptions = [ 'ssl' => [ - 'verify_peer' => false, - 'verify_peer_name' => false, + 'verify_peer' => false, + 'verify_peer_name' => false, 'allow_self_signed' => true, ], ]; @@ -527,8 +523,7 @@ class EmailsController extends Controller * * @return type string or null */ - public function departmentValue($dept) - { + public function departmentValue($dept) { if ($dept) { $email_department = $dept; } else { @@ -545,8 +540,7 @@ class EmailsController extends Controller * * @return type string or null */ - public function priorityValue($priority) - { + public function priorityValue($priority) { if ($priority) { $email_priority = $priority; } else { @@ -563,8 +557,7 @@ class EmailsController extends Controller * * @return type string or null */ - public function helpTopicValue($help_topic) - { + public function helpTopicValue($help_topic) { if ($help_topic) { $email_help_topic = $help_topic; } else { @@ -574,20 +567,18 @@ class EmailsController extends Controller return $email_help_topic; } - public function emailService($service, $value = []) - { + public function emailService($service, $value = []) { switch ($service) { - case 'mailgun': + case "mailgun": $this->setServiceConfig($service, $value); - case 'mandrill': + case "mandrill": $this->setServiceConfig($service, $value); - case 'ses': + case "ses": $this->setServiceConfig($service, $value); } } - public function setServiceConfig($service, $value) - { + public function setServiceConfig($service, $value) { //dd($service); if (count($value) > 0) { foreach ($value as $k => $v) { @@ -596,8 +587,7 @@ class EmailsController extends Controller } } - public function saveMailService($emailid, $request, $driver) - { + public function saveMailService($emailid, $request, $driver) { $mail_service = new \App\Model\MailJob\FaveoMail(); $mails = $mail_service->where('email_id', $emailid)->get(); if (count($request) > 0) { @@ -606,17 +596,16 @@ class EmailsController extends Controller } foreach ($request as $key => $value) { $mail_service->create([ - 'drive' => $driver, - 'key' => $key, - 'value' => $value, + 'drive' => $driver, + 'key' => $key, + 'value' => $value, 'email_id' => $emailid, ]); } } } - public function readMails() - { + public function readMails() { $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $NotificationController = new \App\Http\Controllers\Common\NotificationController(); $TicketController = new \App\Http\Controllers\Agent\helpdesk\TicketController($PhpMailController, $NotificationController); @@ -629,8 +618,7 @@ class EmailsController extends Controller $controller->readmails($emails, $settings_email, $system, $ticket); } - public function fetch($email) - { + public function fetch($email) { $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $NotificationController = new \App\Http\Controllers\Common\NotificationController(); $TicketController = new \App\Http\Controllers\Agent\helpdesk\TicketController($PhpMailController, $NotificationController); @@ -639,26 +627,4 @@ class EmailsController extends Controller $controller->fetch($email); } - public function checkMail($request) - { - $mailservice_id = $request->input('sending_protocol'); - $driver = $this->getDriver($mailservice_id); - $username = $request->input('email_address'); - $password = $request->input('password'); - $name = $request->input('email_name'); - $host = $request->input('sending_host'); - $port = $request->input('sending_port'); - $enc = $request->input('sending_encryption'); - $service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode'); - - $this->emailService($driver, $service_request); - $this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port); - $transport = \Swift_SmtpTransport::newInstance($host, $port, $enc); - $transport->setUsername($username); - $transport->setPassword($password); - $mailer = \Swift_Mailer::newInstance($transport); - $mailer->getTransport()->start(); - - return 1; - } } diff --git a/app/Http/Controllers/Admin/helpdesk/EmailsControllerOld.php b/app/Http/Controllers/Admin/helpdesk/EmailsControllerOld.php deleted file mode 100644 index 78f221f52..000000000 --- a/app/Http/Controllers/Admin/helpdesk/EmailsControllerOld.php +++ /dev/null @@ -1,637 +0,0 @@ - - */ -class EmailsControllerOld extends Controller -{ - /** - * Defining constructor variables. - * - * @return type - */ - public function __construct() - { - $this->middleware('auth'); - $this->middleware('roles'); - } - - /** - * Display a listing of the Emails. - * - * @param type Emails $emails - * - * @return type view - */ - public function index(Emails $email) - { - try { - // fetch all the emails from emails table - $emails = $email->get(); - - return view('themes.default1.admin.helpdesk.emails.emails.index', compact('emails')); - } catch (Exception $e) { - return redirect()->back()->with('fails', $e->getMessage()); - } - } - - /** - * Show the form for creating a new resource. - * - * @param type Department $department - * @param type Help_topic $help - * @param type Priority $priority - * @param type MailboxProtocol $mailbox_protocol - * - * @return type Response - */ - public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) - { - try { - // fetch all the departments from the department table - $departments = $department->get(); - // fetch all the helptopics from the helptopic table - $helps = $help->get(); - // fetch all the types of priority from the ticket_priority table - $priority = $ticket_priority->get(); - // fetch all the types of mailbox protocols from the mailbox_protocols table - $mailbox_protocols = $mailbox_protocol->get(); - - $service = new \App\Model\MailJob\MailService(); - $services = $service->lists('name', 'id')->toArray(); - - // return with all the table data - return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'services')); - } catch (Exception $e) { - // return error messages if any - return redirect()->back()->with('fails', $e->getMessage()); - } - } - - /** - * Check for email input validation. - * - * @param EmailsRequest $request - * - * @return int - */ - public function validatingEmailSettings(MailRequest $request, $id = '') - { - $service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode', 'code'); - $service = $request->input('sending_protocol'); - $send = 0; - $imap_check[0] = 0; - if ($request->input('imap_validate') == 'on') { - $validate = '/validate-cert'; - } elseif (!$request->input('imap_validate')) { - $validate = '/novalidate-cert'; - } - if ($request->input('fetching_status') == 'on') { - try { - $imap_check = $this->getImapStream($request, $validate); - } catch (Exception $ex) { - \Log::error($ex->getMessage()); - $result = ['fails' => $ex->getMessage()]; - - return response()->json(compact('result')); - } - if ($imap_check[0] == 0) { - $response = Lang::get('lang.incoming_email_connection_failed_please_check_email_credentials_or_imap_settings'); - } - } else { - $imap_check[0] = 1; - } - if ($request->input('sending_status') == 'on') { - $this->emailService($service, $service_request); - try { - $send = $this->sendDiagnoEmail($request); - } catch (Exception $ex) { - \Log::error($ex->getMessage()); - $result = ['fails' => $ex->getMessage()]; - - return response()->json(compact('result')); - } - if ($send === 0) { - $response = Lang::get('lang.outgoing_email_connection_failed'); - } - } else { - $send = 1; - } - if ($send === 1 && $imap_check[0] === 1) { - $this->store($request, $imap_check, $service_request, $id); - } - - return $this->jsonResponse($send, $imap_check); - } - - public function sendDiagnoEmail($request) - { - try { - $mailservice_id = $request->input('sending_protocol'); - $driver = $this->getDriver($mailservice_id); - $username = $request->input('email_address'); - $password = $request->input('password'); - $name = $request->input('email_name'); - $host = $request->input('sending_host'); - $port = $request->input('sending_port'); - $enc = $request->input('sending_encryption'); - $service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode'); - - $this->emailService($driver, $service_request); - $this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port); - $controller = new \App\Http\Controllers\Common\PhpMailController(); - $to = 'example@ladybirdweb.com'; - $toname = 'test'; - $subject = 'test'; - $data = 'test'; - //dd(\Config::get('mail'),\Config::get('services')); - $send = $controller->laravelMail($to, $toname, $subject, $data, [], []); - } catch (Exception $e) { - \Log::error($e->getMessage()); - //dd($e); - } - - return $send; - } - - public function setMailConfig($driver, $username, $name, $password, $enc, $host, $port) - { - $configs = [ - 'username' => $username, - 'from' => ['address' => $username, 'name' => $name], - 'password' => $password, - 'encryption' => $enc, - 'host' => $host, - 'port' => $port, - 'driver' => $driver, - ]; - foreach ($configs as $key => $config) { - if (is_array($config)) { - foreach ($config as $from) { - \Config::set('mail.'.$key, $config); - } - } else { - \Config::set('mail.'.$key, $config); - } - } - } - - public function getDriver($driver_id) - { - $short = ''; - $email_drivers = new \App\Model\MailJob\MailService(); - $email_driver = $email_drivers->find($driver_id); - if ($email_driver) { - $short = $email_driver->short_name; - } - - return $short; - } - - /** - * Store a newly created resource in storage. - * - * @param type Emails $email - * @param type EmailsRequest $request - * - * @return type Redirect - */ - public function store($request, $imap_check, $service_request = [], $id = '') - { - $email = new Emails(); - if ($id !== '') { - $email = $email->find($id); - } - try { - $email->email_address = $request->email_address; - - $email->email_name = $request->email_name; - $email->fetching_host = $request->fetching_host; - $email->fetching_port = $request->fetching_port; - $email->fetching_protocol = $request->fetching_protocol; - $email->sending_host = $request->sending_host; - $email->sending_port = $request->sending_port; - $email->sending_protocol = $this->getDriver($request->sending_protocol); - $email->sending_encryption = $request->sending_encryption; - - if ($request->smtp_validate == 'on') { - $email->smtp_validate = $request->smtp_validate; - } - - if ($request->input('password')) { - $email->password = Crypt::encrypt($request->input('password')); - } - if ($request->input('fetching_status') == 'on') { - $email->fetching_status = 1; - } else { - $email->fetching_status = 0; - } - if ($request->input('sending_status') == 'on') { - $email->sending_status = 1; - } else { - $email->sending_status = 0; - } - if ($request->input('auto_response') == 'on') { - $email->auto_response = 1; - } else { - $email->auto_response = 0; - } - //dd($email); - if ($imap_check !== null) { - $email->fetching_encryption = $imap_check[0]; - } else { - $email->fetching_encryption = $request->input('fetching_encryption'); - } - - // fetching department value - $email->department = $this->departmentValue($request->input('department')); - // fetching priority value - $email->priority = $this->priorityValue($request->input('priority')); - // fetching helptopic value - $email->help_topic = $this->helpTopicValue($request->input('help_topic')); - // inserting the encrypted value of password - $email->password = Crypt::encrypt($request->input('password')); - $email->save(); // run save - if ($id === '') { - // Creating a default system email as the first email is inserted to the system - $email_settings = Email::where('id', '=', '1')->first(); - $email_settings->sys_email = $email->id; - $email_settings->save(); - } else { - $this->update($id, $request); - } - if (count($service_request) > 0) { - $this->saveMailService($email->id, $service_request, $this->getDriver($request->sending_protocol)); - } - - return 1; - } catch (Exception $e) { - return 0; - } - } - - /** - * Show the form for editing the specified resource. - * - * @param type int $id - * @param type Department $department - * @param type Help_topic $help - * @param type Emails $email - * @param type Priority $priority - * @param type MailboxProtocol $mailbox_protocol - * - * @return type Response - */ - public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) - { - try { - $sys_email = \DB::table('settings_email')->select('sys_email')->where('id', '=', 1)->first(); - // dd($sys_email); - // fetch the selected emails - $emails = $email->whereId($id)->first(); - // get all the departments - $departments = $department->get(); - //get count of emails - $count = $email->count(); - // get all the helptopic - $helps = $help->get(); - // get all the priority - $priority = $ticket_priority->get(); - // get all the mailbox protocols - $mailbox_protocols = $mailbox_protocol->get(); - - $service = new \App\Model\MailJob\MailService(); - $services = $service->lists('name', 'id')->toArray(); - - // return if the execution is succeeded - return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails', 'sys_email', 'services'))->with('count', $count); - } catch (Exception $e) { - // return if try fails - return redirect()->back()->with('fails', $e->getMessage()); - } - } - - /** - * Check for email input validation. - * - * @param EmailsRequest $request - * - * @return int - */ - public function validatingEmailSettingsUpdate($id, MailRequest $request) - { - return $this->validatingEmailSettings($request, $id); - } - - /** - * Update the specified resource in storage. - * - * @param type $id - * @param type Emails $email - * @param type EmailsEditRequest $request - * - * @return type Response - */ - public function update($id, $request) - { - try { - if ($request->sys_email == 'on') { - $system = \DB::table('settings_email') - ->where('id', '=', 1) - ->update(['sys_email' => $id]); - } elseif ($request->input('count') <= 1 && $request->sys_email == null) { - $system = \DB::table('settings_email') - ->where('id', '=', 1) - ->update(['sys_email' => null]); - } - $return = 1; - } catch (Exception $e) { - $return = $e->getMessage(); - } - - return $return; - } - - /** - * Remove the specified resource from storage. - * - * @param type int $id - * @param type Emails $email - * - * @return type Redirect - */ - public function destroy($id, Emails $email) - { - // fetching the details on the basis of the $id passed to the function - $default_system_email = Email::where('id', '=', '1')->first(); - if ($default_system_email->sys_email) { - // checking if the default system email is the passed email - if ($id == $default_system_email->sys_email) { - return redirect('emails')->with('fails', Lang::get('lang.you_cannot_delete_system_default_email')); - } - } - try { - // fetching the database instance of the current email - $emails = $email->whereId($id)->first(); - // checking if deleting the email is success or if it's carrying any dependencies - if ($emails->delete() == true) { - return redirect('emails')->with('success', Lang::get('lang.email_deleted_sucessfully')); - } else { - return redirect('emails')->with('fails', Lang::get('lang.email_can_not_delete')); - } - } catch (Exception $e) { - // returns if the try fails - return redirect()->back()->with('fails', $e->getMessage()); - } - } - - /** - * Create imap connection. - * - * @param type $request - * - * @return type int - */ - public function getImapStream($request, $validate) - { - $fetching_status = $request->input('fetching_status'); - $username = $request->input('email_address'); - $password = $request->input('password'); - $protocol_id = $request->input('mailbox_protocol'); - $fetching_protocol = '/'.$request->input('fetching_protocol'); - $fetching_encryption = '/'.$request->input('fetching_encryption'); - if ($fetching_encryption == '/none') { - $fetching_encryption2 = '/novalidate-cert'; - $mailbox_protocol = $fetching_encryption2; - $host = $request->input('fetching_host'); - $port = $request->input('fetching_port'); - $mailbox = '{'.$host.':'.$port.$fetching_protocol.$mailbox_protocol.'}INBOX'; - } else { - $mailbox_protocol = $fetching_protocol.$fetching_encryption; - $host = $request->input('fetching_host'); - $port = $request->input('fetching_port'); - $mailbox = '{'.$host.':'.$port.$mailbox_protocol.$validate.'}INBOX'; - $mailbox_protocol = $fetching_encryption.$validate; - } - try { - $imap_stream = imap_open($mailbox, $username, $password); - } catch (\Exception $ex) { - \Log::error($ex->getMessage()); - - return $ex->getMessage(); - } - //$imap_stream = imap_open($mailbox, $username, $password); - if ($imap_stream) { - $return = [0 => 1, 1 => $mailbox_protocol]; - } else { - $return = [0 => 0]; - } - - return $return; - } - - /** - * Check connection. - * - * @param type $imap_stream - * - * @return type int - */ - public function checkImapStream($imap_stream) - { - $check_imap_stream = imap_check($imap_stream); - if ($check_imap_stream) { - $imap_stream = 1; - } else { - $imap_stream = 0; - } - - return $imap_stream; - } - - /** - * Get smtp connection. - * - * @param type $request - * - * @return int - */ - public function getSmtp($request) - { - $sending_status = $request->input('sending_status'); - // cheking for the sending protocol - if ($request->input('sending_protocol') == 'smtp') { - $mail = new \PHPMailer(); - $mail->isSMTP(); - $mail->Host = $request->input('sending_host'); // Specify main and backup SMTP servers - //$mail->SMTPAuth = true; // Enable SMTP authentication - $mail->Username = $request->input('email_address'); // SMTP username - $mail->Password = $request->input('password'); // SMTP password - $mail->SMTPSecure = $request->input('sending_encryption'); // Enable TLS encryption, `ssl` also accepted - $mail->Port = $request->input('sending_port'); // TCP port to connect to - if (!$request->input('smtp_validate')) { - $mail->SMTPAuth = true; // Enable SMTP authentication - $mail->SMTPOptions = [ - 'ssl' => [ - 'verify_peer' => false, - 'verify_peer_name' => false, - 'allow_self_signed' => true, - ], - ]; - if ($mail->smtpConnect($mail->SMTPOptions) == true) { - $mail->smtpClose(); - $return = 1; - } else { - $return = 0; - } - } else { - if ($mail->smtpConnect()) { - $mail->smtpClose(); - $return = 1; - } else { - $return = 0; - } - } - } elseif ($request->input('sending_protocol') == 'mail') { - $return = 1; - } - - return $return; - } - - /** - * Checking if department value is null. - * - * @param type $dept - * - * @return type string or null - */ - public function departmentValue($dept) - { - if ($dept) { - $email_department = $dept; - } else { - $email_department = null; - } - - return $email_department; - } - - /** - * Checking if priority value is null. - * - * @param type $priority - * - * @return type string or null - */ - public function priorityValue($priority) - { - if ($priority) { - $email_priority = $priority; - } else { - $email_priority = null; - } - - return $email_priority; - } - - /** - * Checking if helptopic value is null. - * - * @param type $help_topic - * - * @return type string or null - */ - public function helpTopicValue($help_topic) - { - if ($help_topic) { - $email_help_topic = $help_topic; - } else { - $email_help_topic = null; - } - - return $email_help_topic; - } - - public function emailService($service, $value = []) - { - switch ($service) { - case 'mailgun': - $this->setServiceConfig($service, $value); - case 'mandrill': - $this->setServiceConfig($service, $value); - case 'ses': - $this->setServiceConfig($service, $value); - } - } - - public function setServiceConfig($service, $value) - { - //dd($service); - if (count($value) > 0) { - foreach ($value as $k => $v) { - \Config::set("services.$service.$k", $v); - } - } - } - - public function jsonResponse($out, $in) - { - if ($out !== 1) { - $result = ['fails' => Lang::get('lang.outgoing_email_connection_failed')]; - } - if ($in[0] !== 1) { - $result = ['fails' => Lang::get('lang.incoming_email_connection_failed_please_check_email_credentials_or_imap_settings')]; - } - if ($out === 1 && $in[0] === 1) { - $result = ['success' => Lang::get('lang.success')]; - } - - return response()->json(compact('result')); - } - - public function saveMailService($emailid, $request, $driver) - { - $mail_service = new \App\Model\MailJob\FaveoMail(); - $mails = $mail_service->where('email_id', $emailid)->get(); - if (count($request) > 0) { - foreach ($mails as $mail) { - $mail->delete(); - } - foreach ($request as $key => $value) { - $mail_service->create([ - 'drive' => $driver, - 'key' => $key, - 'value' => $value, - 'email_id' => $emailid, - ]); - } - } - } -} diff --git a/app/Http/Controllers/Admin/helpdesk/FormController.php b/app/Http/Controllers/Admin/helpdesk/FormController.php index 27b35d35a..9a6bee349 100644 --- a/app/Http/Controllers/Admin/helpdesk/FormController.php +++ b/app/Http/Controllers/Admin/helpdesk/FormController.php @@ -9,13 +9,13 @@ use App\Model\helpdesk\Form\Fields; use App\Model\helpdesk\Form\Forms; use App\Model\helpdesk\Manage\Help_topic; // Request -use Exception; -// Class -use Form; use Illuminate\Http\Request; +// Class use Input; use Lang; use Redirect; +use Exception; +use Form; /** * FormController @@ -23,13 +23,12 @@ use Redirect; * * @author Ladybird */ -class FormController extends Controller -{ +class FormController extends Controller { + private $fields; private $forms; - public function __construct(Fields $fields, Forms $forms) - { + public function __construct(Fields $fields, Forms $forms) { $this->fields = $fields; $this->forms = $forms; $this->middleware('auth', [ @@ -44,7 +43,7 @@ class FormController extends Controller 'jqueryScript', 'jqueryCheckboxScript', 'jquerySelectScript', - ], + ] ]); } @@ -53,8 +52,7 @@ class FormController extends Controller * * @return type */ - public function home() - { + public function home() { return view('forms.home'); } @@ -65,8 +63,7 @@ class FormController extends Controller * * @return Response */ - public function index(Forms $forms) - { + public function index(Forms $forms) { try { return view('themes.default1.admin.helpdesk.manage.form.index', compact('forms')); } catch (Exception $e) { @@ -79,8 +76,7 @@ class FormController extends Controller * * @return Response */ - public function create() - { + public function create() { try { return view('themes.default1.admin.helpdesk.manage.form.form'); } catch (Exception $e) { @@ -95,15 +91,13 @@ class FormController extends Controller * * @return Response */ - public function show($id) - { + public function show($id) { try { $forms = new Forms(); $form = $forms->find($id); //dd($form); if ($form) { $fields = $form->fields(); - return view('themes.default1.admin.helpdesk.manage.form.preview', compact('form', 'fields')); } throw new Exception("Sorry we can't find your request"); @@ -117,13 +111,12 @@ class FormController extends Controller * * @return Response */ - public function store(Request $request) - { + public function store(Request $request) { $this->validate($request, [ 'formname' => 'required|unique:custom_forms,formname', - 'label.*' => 'required', - 'name.*' => 'required', - 'type.*' => 'required', + 'label.*' => 'required', + 'name.*' => 'required', + 'type.*' => 'required', ]); try { $forms = new Forms(); @@ -138,18 +131,19 @@ class FormController extends Controller $name = str_slug(Input::get('name')[$i], '_'); $field = Fields::create([ 'forms_id' => $forms->id, - 'label' => Input::get('label')[$i], - 'name' => $name, - 'type' => Input::get('type')[$i], + 'label' => Input::get('label')[$i], + 'name' => $name, + 'type' => Input::get('type')[$i], 'required' => $require[$i], ]); $field_id = $field->id; - $this->createValues($field_id, Input::get('value')[$i]); + $this->createValues($field_id, Input::get('value')[$i],null,$name); } } return Redirect::back()->with('success', Lang::get('lang.successfully_created_form')); } catch (Exception $ex) { + dd($ex); return redirect()->back()->with('fails', $ex->getMessage()); } } @@ -164,8 +158,7 @@ class FormController extends Controller * * @return type redirect */ - public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic) - { + public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic) { $fields = $field->where('forms_id', $id)->get(); $help_topics = $help_topic->where('custom_form', '=', $id)->get(); foreach ($help_topics as $help_topic) { @@ -181,8 +174,7 @@ class FormController extends Controller return redirect()->back()->with('success', Lang::get('lang.form_deleted_successfully')); } - public function edit($id) - { + public function edit($id) { try { $forms = new Forms(); $form = $forms->find($id); @@ -195,12 +187,12 @@ class FormController extends Controller } throw new Exception("Sorry we can't find your request"); } catch (Exception $ex) { + return redirect()->back()->with('fails', $ex->getMessage()); } } - public function addChildForm($id) - { + public function addChildForm($id) { try { $forms = new Forms(); $form = $forms->find($id); @@ -213,17 +205,17 @@ class FormController extends Controller } throw new Exception("Sorry we can't find your request"); } catch (Exception $ex) { + return redirect()->back()->with('fails', $ex->getMessage()); } } - public function update($id, Request $request) - { + public function update($id, Request $request) { $this->validate($request, [ - 'formname' => 'required|unique:custom_forms,formname,'.$id, - 'label.*' => 'required', - 'name.*' => 'required', - 'type.*' => 'required', + 'formname' => 'required|unique:custom_forms,formname,' . $id, + 'label.*' => 'required', + 'name.*' => 'required', + 'type.*' => 'required', ]); try { if (!$request->input('formname')) { @@ -232,7 +224,7 @@ class FormController extends Controller $form = new Forms(); $forms = $form->find($id); if (!$forms) { - throw new Exception('Sorry we can not find your request'); + throw new Exception("Sorry we can not find your request"); } $forms->formname = Input::get('formname'); $forms->save(); @@ -249,24 +241,23 @@ class FormController extends Controller $name = str_slug(Input::get('name')[$i], '_'); $field = $field->create([ 'forms_id' => $forms->id, - 'label' => Input::get('label')[$i], - 'name' => $name, - 'type' => Input::get('type')[$i], + 'label' => Input::get('label')[$i], + 'name' => $name, + 'type' => Input::get('type')[$i], 'required' => Input::get('required')[$i], ]); $field_id = $field->id; - $this->createValues($field_id, Input::get('value')[$i]); + $this->createValues($field_id, Input::get('value')[$i],null,$name); } - return redirect()->back()->with('success', 'updated'); } catch (Exception $ex) { + dd($ex); return redirect()->back()->with('fails', $ex->getMessage()); } } - public function renderForm($formid) - { - $html = ''; + public function renderForm($formid) { + $html = ""; $forms = new Forms(); $form = $forms->find($formid); if ($form) { @@ -275,58 +266,54 @@ class FormController extends Controller $html .= self::getForm($field); } } - - return self::requiredStyle().$html; + return self::requiredStyle() . $html; } - public static function getType($type) - { + public static function getType($type) { switch ($type) { - case 'select': - return 'select'; - case 'text': - return 'text'; - case 'email': - return 'email'; - case 'textarea': - return 'textarea'; - case 'select': - return 'select'; - case 'radio': - return 'radio'; - case 'checkbox': - return 'checkbox'; - case 'hidden': - return 'hidden'; - case 'password': - return 'password'; + case "select": + return "select"; + case "text": + return "text"; + case "email": + return "email"; + case "textarea": + return "textarea"; + case "select": + return "select"; + case "radio": + return "radio"; + case "checkbox": + return "checkbox"; + case "hidden": + return "hidden"; + case "password": + return "password"; } } - public static function getAttribute($type) - { + public static function getAttribute($type) { switch ($type) { - case 'select': + case "select": return "null,['class'=>'form-control']"; - case 'text': + case "text": return "['class'=>'form-control']"; - case 'email': + case "email": return "['class'=>'form-control']"; - case 'textarea': + case "textarea": return "['class'=>'form-control']"; - case 'radio': - return ''; - case 'checkbox': - return ''; - case 'hidden': - return ''; - case 'password': + case "radio": + return ""; + case "checkbox": + return ""; + case "hidden": + return ""; + case "password": return "['class'=>'form-control']"; } } - public static function getForm($field) - { + public static function getForm($field) { $required = false; $required_class = self::requiredClass($field->required); if ($field->required === '1') { @@ -335,33 +322,32 @@ class FormController extends Controller $type = $field->type; $field_type = self::getType($type); switch ($field_type) { - case 'select': + case "select": return self::selectForm($field_type, $field, $required, $required_class); - case 'text': - return Form::label($field->label, $field->label, ['class' => $required_class]). - Form::$field_type($field->name, null, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); - case 'email': - return Form::label($field->label, $field->label, ['class' => $required_class]). - Form::$field_type($field->name, null, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); - case 'password': - return Form::label($field->label, $field->label, ['class' => $required_class]). + case "text": + return Form::label($field->label, $field->label, ['class' => $required_class]) . + Form::$field_type($field->name, NULL, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); + case "email": + return Form::label($field->label, $field->label, ['class' => $required_class]) . + Form::$field_type($field->name, NULL, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); + case "password": + return Form::label($field->label, $field->label, ['class' => $required_class]) . Form::$field_type($field->name, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); - case 'textarea': - return Form::label($field->label, $field->label, ['class' => $required_class]). - Form::$field_type($field->name, null, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); - case 'radio': + case "textarea": + return Form::label($field->label, $field->label, ['class' => $required_class]) . + Form::$field_type($field->name, NULL, ['class' => "form-control $field->id", 'id' => $field->id, 'required' => $required]); + case "radio": return self::radioForm($field_type, $field, $required, $required_class); - case 'checkbox': + case "checkbox": return self::checkboxForm($field_type, $field, $required, $required_class); - case 'hidden': - return Form::$field_type($field->name, null, ['id' => $field->id]); + case "hidden": + return Form::$field_type($field->name, NULL, ['id' => $field->id]); } } - public function createValues($fieldid, $values, $childid = null, $key = '') - { + public function createValues($fieldid, $values, $childid = NULL, $key = "") { if ($values) { $values_array = explode(',', $values); $field_values = new \App\Model\helpdesk\Form\FieldValue(); @@ -374,9 +360,9 @@ class FormController extends Controller if (count($values_array) > 0) { foreach ($values_array as $value) { $field_values->create([ - 'field_id' => $fieldid, - 'child_id' => $childid, - 'field_key' => $key, + 'field_id' => $fieldid, + 'child_id' => $childid, + 'field_key' => $key, 'field_value' => str_slug($value, '_'), ]); } @@ -384,8 +370,7 @@ class FormController extends Controller } } - public function addChild($fieldid, Request $request) - { + public function addChild($fieldid, Request $request) { $ids = $request->except('_token'); try { foreach ($ids as $valueid => $formid) { @@ -399,91 +384,86 @@ class FormController extends Controller //} } } - return redirect()->back()->with('success', 'Updated'); } catch (Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); } } - public function renderChild(Request $request) - { + public function renderChild(Request $request) { self::setSession(); - $render = ''; + $render = ""; $value = $request->input('valueid'); $fieldid = $request->input('fieldid'); $field_values = new \App\Model\helpdesk\Form\FieldValue(); $field_value = $field_values->where('field_id', $fieldid)->where('field_value', $value)->first(); - $child = ''; + $child = ""; if ($field_value) { $child = $field_value->child_id; } - if ($child !== '') { + if ($child !== "") { $render = $this->renderForm($child); } return $render; } - public static function jqueryScript($value, $fieldid, $fieldname, $type = '', $index = '') - { - if ($type == 'select') { + public static function jqueryScript($value, $fieldid, $fieldname, $type = "", $index = "") { + if ($type == "select") { return self::jquerySelectScript($fieldid); } - if ($type == 'checkbox') { + if ($type == "checkbox") { return self::jqueryCheckboxScript($fieldid, $index); } - return ''; } - public static function jqueryCheckboxScript($fieldid, $index) - { + public static function jqueryCheckboxScript($fieldid, $index) { $session = self::getSession(); $fields = new Fields(); $field = $fields->find($fieldid); if ($field) { return '"; + } - return "user_name).'''.Lang::get('lang.see-profile2')."'>".ucfirst(str_limit($name, 30)).' '.$color.''; - }) - // ->addColumn('Last Replier', function ($ticket) { - // $TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->where('is_internal', '=', 0)->max('id'); - // $TicketDatarow = Ticket_Thread::where('id', '=', $TicketData)->first(); - // $LastResponse = User::where('id', '=', $TicketDatarow->user_id)->first(); - // if ($LastResponse->role == 'user') { - // $rep = '#F39C12'; - // $username = $LastResponse->user_name; - // } else { - // $rep = '#000'; - // $username = $LastResponse->first_name.' '.$LastResponse->last_name; - // if ($LastResponse->first_name == null || $LastResponse->last_name == null) { - // $username = $LastResponse->user_name; - // } - // } - // return "".ucfirst($username).''; - // }) - ->addColumn('assigned_to', function ($ticket) { - if ($ticket->assigned_to == null) { - return "Unassigned"; - } else { - $assign = DB::table('users')->where('id', '=', $ticket->assigned_to)->first(); - $url = route('user.show', $ticket->assigned_to); - - return "first_name).'''.Lang::get('lang.see-profile2')."'>".ucfirst($assign->first_name).' '.ucfirst($assign->last_name).''; - } - }) - ->addColumn('Last', function ($ticket) { - $TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id'); - $TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first(); - $updated = '--'; - if ($TicketDatarow) { - $updated = $TicketDatarow->updated_at; - } - - return ''.$updated.''.UTC::usertimezone($updated); - }) - ->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority') - ->orderColumns('subject', 'from', 'assigned_to', 'Last Replier', 'ticket_number', 'priority', 'Last') - ->make(); + public function getTooltip(Request $request) { + $ticketid = $request->input('ticketid'); + $ticket = Tickets::find($ticketid); + $firstThread = $ticket->thread()->select('user_id', 'poster', 'body')->first(); + $lastThread = $ticket->thread()->select('user_id', 'poster', 'body')->orderBy('id', 'desc')->first(); + return "" . $firstThread->user->user_name . " (" . $firstThread->poster . ")
    " + . $firstThread->purify() . "

    " + . "" . $lastThread->user->user_name . "(" . $lastThread->poster . ")" + . $lastThread->purify() . "

    "; } //Auto-close tickets - public function autoCloseTickets() - { + public function autoCloseTickets() { $workflow = \App\Model\helpdesk\Workflow\WorkflowClose::whereId(1)->first(); if ($workflow->condition == 1) { @@ -2622,7 +2729,7 @@ class TicketController extends Controller // $sla_plan = Sla_plan::where('id', '=', $overdue->sla)->first(); $ovadate = $overdue->created_at; - $new_date = date_add($ovadate, date_interval_create_from_date_string($workflow->days.' days')).'

    '; + $new_date = date_add($ovadate, date_interval_create_from_date_string($workflow->days . ' days')) . '

    '; if (date('Y-m-d H:i:s') > $new_date) { $i++; $overdue->status = 3; @@ -2642,22 +2749,20 @@ class TicketController extends Controller // } } } else { + } } /** * @category function to chech if user verifcaition required for creating tickets or not - * * @param null - * * @return int 0/1 */ - public function checkUserVerificationStatus() - { + public function checkUserVerificationStatus() { $status = CommonSettings::select('status') ->where('option_name', '=', 'send_otp') ->first(); - if ($status->status == 0 || $status->status == '0') { + if ($status->status == 0 || $status->status == "0") { return 1; } else { return 0; @@ -2665,17 +2770,14 @@ class TicketController extends Controller } /** - * This function is used for auto filling in new ticket. - * + * This function is used for auto filling in new ticket * @return type view */ - public function autofill() - { + public function autofill() { return view('themes.default1.agent.helpdesk.ticket.getautocomplete'); } - public function pdfThread($threadid) - { + public function pdfThread($threadid) { try { $threads = new Ticket_Thread(); $thread = $threads->leftJoin('tickets', 'ticket_thread.ticket_id', '=', 'tickets.id') @@ -2691,80 +2793,64 @@ class TicketController extends Controller $ticket = Tickets::where('id', $thread->ticket_id)->first(); $html = view('themes.default1.agent.helpdesk.ticket.thread-pdf', compact('thread', 'system', 'company', 'ticket'))->render(); $html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'); - return PDF::load($html1)->show(); } catch (Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); } } - public static function getSourceByname($name) - { + public static function getSourceByname($name) { $sources = new Ticket_source(); $source = $sources->where('name', $name)->first(); - return $source; } - public static function getSourceById($sourceid) - { + public static function getSourceById($sourceid) { $sources = new Ticket_source(); $source = $sources->where('id', $sourceid)->first(); - return $source; } - public static function getSourceCssClass($sourceid) - { - $css = 'fa fa-comment'; + public static function getSourceCssClass($sourceid) { + $css = "fa fa-comment"; $source = self::getSourceById($sourceid); if ($source) { $css = $source->css_class; } - return $css; } - public function getSystemDefaultHelpTopic() - { + public function getSystemDefaultHelpTopic() { $ticket_settings = new \App\Model\helpdesk\Settings\Ticket(); $ticket_setting = $ticket_settings->find(1); $help_topicid = $ticket_setting->help_topic; - return $help_topicid; } - public function getSystemDefaultSla() - { + public function getSystemDefaultSla() { $ticket_settings = new \App\Model\helpdesk\Settings\Ticket(); $ticket_setting = $ticket_settings->find(1); $sla = $ticket_setting->sla; - return $sla; } - public function getSystemDefaultPriority() - { + public function getSystemDefaultPriority() { $ticket_settings = new \App\Model\helpdesk\Settings\Ticket(); $ticket_setting = $ticket_settings->find(1); $priority = $ticket_setting->priority; - return $priority; } - public function getSystemDefaultDepartment() - { + public function getSystemDefaultDepartment() { $systems = new \App\Model\helpdesk\Settings\System(); $system = $systems->find(1); $department = $system->department; - return $department; } - public function findTicketFromTicketCreateUser($result = []) - { + public function findTicketFromTicketCreateUser($result = []) { $ticket_number = $this->checkArray('0', $result); - if ($ticket_number !== '') { + if ($ticket_number !== "") { $tickets = new \App\Model\helpdesk\Ticket\Tickets(); $ticket = $tickets->where('ticket_number', $ticket_number)->first(); if ($ticket) { @@ -2773,36 +2859,29 @@ class TicketController extends Controller } } - public function findUserFromTicketCreateUserId($result = []) - { + public function findUserFromTicketCreateUserId($result = []) { $ticket = $this->findTicketFromTicketCreateUser($result); if ($ticket) { $userid = $ticket->user_id; - return $userid; } } - public function checkArray($key, $array) - { - $value = ''; + public function checkArray($key, $array) { + $value = ""; if (array_key_exists($key, $array)) { $value = $array[$key]; } - return $value; } - public function getAdmin() - { + public function getAdmin() { $users = new \App\User(); $admin = $users->where('role', 'admin')->first(); - return $admin; } - public function attachmentSeperateOld($attach) - { + public function attachmentSeperateOld($attach) { $attacment = []; if ($attach != null) { $size = count($attach); @@ -2815,12 +2894,10 @@ class TicketController extends Controller $attacment[$i]['mime'] = $mime; } } - return $attacment; } - public function attachmentSeperate($thread_id) - { + public function attachmentSeperate($thread_id) { if ($thread_id) { $array = []; $attachment = new Ticket_attachments(); @@ -2832,9 +2909,77 @@ class TicketController extends Controller $array[$key]['mime'] = $attach->type; $array[$key]['mode'] = 'data'; } - return $array; } } } + + /** + * + * @return type + */ + public function followupTicketList() { + try { + $table = \Datatable::table() + ->addColumn( + "", Lang::get('lang.subject'), Lang::get('lang.ticket_id'), Lang::get('lang.priority'), Lang::get('lang.from'), Lang::get('lang.assigned_to'), Lang::get('lang.last_activity'), Lang::get('lang.created-at')) + ->noScript(); + return view('themes.default1.agent.helpdesk.followup.followup', compact('table')); + } catch (Exception $e) { + return Redirect()->back()->with('fails', $e->getMessage()); + } + } + + public static function getSubject($subject) { + //$subject = $this->attributes['title']; + $array = imap_mime_header_decode($subject); + $title = ""; + if (is_array($array) && count($array) > 0) { + foreach ($array as $text) { + $title .= $text->text; + } + return wordwrap($title, 70, "
    \n"); + } + return wordwrap($subject, 70, "
    \n"); + } + + public function replyContent($content) { + preg_match_all('/]+>/i', $content, $result); + $url = []; + $encode = []; + $img = array(); + foreach ($result as $key=>$img_tag) { + //dd($img_tag); + preg_match_all('/(src)=("[^"]*")/i', $img_tag[$key], $img[$key]); + } + for($i=0;$idivideUrl($img[$i][2][0]); + } + + return str_replace($url, $encode, $content); + + } + + + public function divideUrl($url){ + $baseurl = url('/'); + $trim = str_replace($baseurl,"",$url); + $trim = str_replace('"','',$trim); + $trim = substr_replace($trim,"",0,1); + $path = public_path($trim); + return $this->fileContent($path); + } + + public function fileContent($path){ + $exist = \File::exists($path); + $base64 = ""; + if($exist){ + $content = \File::get($path); + $type = \File::extension($path); + $base64 = 'data:image/' . $type . ';base64,' . base64_encode($content); + } + return $base64; + } + } diff --git a/app/Http/Controllers/Agent/helpdesk/TicketWorkflowController.php b/app/Http/Controllers/Agent/helpdesk/TicketWorkflowController.php index 0e7ab2eb8..fe6c1ae85 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketWorkflowController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketWorkflowController.php @@ -166,7 +166,7 @@ class TicketWorkflowController extends Controller } } } - + //dd($form_data); if ($ticket_settings_details['reject'] == true) { return ['0' => false, '1' => false]; @@ -287,7 +287,7 @@ class TicketWorkflowController extends Controller */ public function checkStarts($statement, $to_check) { - if (substr($to_check, 0, strlen($statement)) == $statement) { + if (substr($to_check, 0, strlen($statement)) == $statement) { return true; } else { return false; @@ -305,7 +305,7 @@ class TicketWorkflowController extends Controller public function checkEnds($statement, $to_check) { $to_check = strip_tags($to_check); - if (substr($to_check, -strlen($statement)) == $statement) { + if (substr($to_check, -strlen($statement)) == $statement) { return true; } else { return false; @@ -352,7 +352,6 @@ class TicketWorkflowController extends Controller $ticket_settings_details = $this->changeStatus($workflow_action, $ticket_settings_details); } } - return $ticket_settings_details; } diff --git a/app/Http/Controllers/Agent/helpdesk/UserController.php b/app/Http/Controllers/Agent/helpdesk/UserController.php index c291fb4ee..b98e5fe07 100644 --- a/app/Http/Controllers/Agent/helpdesk/UserController.php +++ b/app/Http/Controllers/Agent/helpdesk/UserController.php @@ -3,46 +3,49 @@ namespace App\Http\Controllers\Agent\helpdesk; // controllers -use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Controller; +use App\Http\Controllers\Common\PhpMailController; // requests /* Include Sys_user Model */ -use App\Http\Requests\helpdesk\ChangepasswordRequest; -/* For validation include Sys_userRequest in create */ -use App\Http\Requests\helpdesk\OtpVerifyRequest; -/* For validation include Sys_userUpdate in update */ use App\Http\Requests\helpdesk\ProfilePassword; -/* include guest_note model */ +/* For validation include Sys_userRequest in create */ use App\Http\Requests\helpdesk\ProfileRequest; +/* For validation include Sys_userUpdate in update */ use App\Http\Requests\helpdesk\Sys_userRequest; -// change password request +/* include guest_note model */ use App\Http\Requests\helpdesk\Sys_userUpdate; +use App\Http\Requests\helpdesk\OtpVerifyRequest; +// change password request +use App\Http\Requests\helpdesk\ChangepasswordRequest; // models -use App\Model\helpdesk\Agent\Assign_team_agent; use App\Model\helpdesk\Agent_panel\Organization; use App\Model\helpdesk\Agent_panel\User_org; -use App\Model\helpdesk\Notification\Notification; -use App\Model\helpdesk\Notification\UserNotification; use App\Model\helpdesk\Settings\CommonSettings; -use App\Model\helpdesk\Settings\Email; -use App\Model\helpdesk\Ticket\Ticket_attachments; -use App\Model\helpdesk\Ticket\Ticket_Collaborator; -use App\Model\helpdesk\Ticket\Ticket_Thread; -use App\Model\helpdesk\Ticket\Tickets; use App\Model\helpdesk\Utility\CountryCode; use App\Model\helpdesk\Utility\Otp; +use App\Model\helpdesk\Email\Emails; +use App\Model\helpdesk\Settings\Email; +use App\Model\helpdesk\Ticket\Tickets; +use App\Model\helpdesk\Agent\Assign_team_agent; +use App\Model\helpdesk\Ticket\Ticket_Thread; +use App\Model\helpdesk\Notification\UserNotification; +use App\Model\helpdesk\Notification\Notification; +use App\Model\helpdesk\Ticket\Ticket_Collaborator; +use App\Model\helpdesk\Agent\Teams; +use App\Model\helpdesk\Ticket\Ticket_attachments; + use App\User; // classes use Auth; -use DateTime; -use DB; use Exception; use GeoIP; use Hash; -use Illuminate\Http\Request; use Input; use Lang; use Redirect; +use Illuminate\Http\Request; +use DateTime; +use DB; /** * UserController @@ -50,8 +53,8 @@ use Redirect; * * @author Ladybird */ -class UserController extends Controller -{ +class UserController extends Controller { + /** * Create a new controller instance. * constructor to check @@ -61,8 +64,7 @@ class UserController extends Controller * * @return void */ - public function __construct(PhpMailController $PhpMailController) - { + public function __construct(PhpMailController $PhpMailController) { $this->PhpMailController = $PhpMailController; // checking authentication $this->middleware('auth'); @@ -77,25 +79,64 @@ class UserController extends Controller * * @return type view */ - public function index() - { + public function index() { try { /* get all values in Sys_user */ - return view('themes.default1.agent.helpdesk.user.index'); + + $table = \ Datatable::table() + ->addColumn(Lang::get('lang.name'), + Lang::get('lang.email'), + Lang::get('lang.phone'), + Lang::get('lang.status'), + Lang::get('lang.ban'), + Lang::get('lang.last_login'), + Lang::get('lang.role'), + Lang::get('lang.action')) // these are the column headings to be shown + ->noScript(); + return view('themes.default1.agent.helpdesk.user.index',compact('table')); } catch (Exception $e) { return redirect()->back()->with('fails', $e->getMessage()); } } + public function deletedUser() { + try { + // dd('here'); + /* get all values in Sys_user */ + return view('themes.default1.agent.helpdesk.user.deleteduser'); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->getMessage()); + } + } + + + /** * This function is used to display the list of users using chumper datatables. * * @return datatable */ - public function user_list() - { + public function user_list(Request $request) { + + $type = $request->input('profiletype'); + +if($type=="active"){ + +$users=User::where('role', "!=", "admin")->where('is_delete','=',0)->get(); +} +else{ + $users=User::where('role', "!=", "admin")->where('is_delete','=',1)->get(); + +} + + + + + + // displaying list of users with chumper datatables - return \Datatable::collection(User::where('role', '!=', 'admin')->get()) + // return \Datatable::collection(User::where('role', "!=", "admin")->get()) + return \Datatable::collection($users) /* searchable column username and email */ ->searchColumns('user_name', 'email', 'phone') /* order column username and email */ @@ -103,22 +144,21 @@ class UserController extends Controller /* column username */ ->addColumn('user_name', function ($model) { if ($model->first_name) { - $string = strip_tags($model->first_name.' '.$model->last_name); + $string = strip_tags($model->first_name . ' ' . $model->last_name); } else { $string = strip_tags($model->user_name); } - if (strlen($string) > 20) { + if (strlen($string) > 30) { // truncate string - $stringCut = mb_substr($string, 0, 20, 'UTF-8'); + $stringCut = mb_substr($string, 0, 30, 'UTF-8').'...'; } else { $stringCut = $string; } - - return $stringCut; + return "id) . "' title='".$string."''>".$stringCut.""; }) /* column email */ ->addColumn('email', function ($model) { - $email = "id)."'>".$model->email.''; + $email = "id) . "'>" . $model->email . ''; return $email; }) @@ -126,13 +166,13 @@ class UserController extends Controller ->addColumn('phone', function ($model) { $phone = ''; if ($model->phone_number) { - $phone = $model->ext.' '.$model->phone_number; + $phone = $model->ext . ' ' . $model->phone_number; } $mobile = ''; if ($model->mobile) { $mobile = $model->mobile; } - $phone = $phone.'   '.$mobile; + $phone = $phone . '   ' . $mobile; return $phone; }) @@ -167,30 +207,60 @@ class UserController extends Controller /* column Role */ ->addColumn('role', function ($model) { $role = $model->role; - return $role; }) /* column actions */ ->addColumn('Actions', function ($model) { - return ''.\Lang::get('lang.edit').'  '.\Lang::get('lang.view').''; + if($model->is_delete==0){ + return '' . \Lang::get('lang.edit') . '  ' . \Lang::get('lang.view') . ''; + } + else{ + + + if(Auth::user()->role == 'admin'){ + // @if(Auth::user()->role == 'admin') + + return '' . \Lang::get('lang.view') . ''; + } + + if(Auth::user()->role == 'agent'){ + // @if(Auth::user()->role == 'admin') + if($model->role=="user"){ + return '' . \Lang::get('lang.view') . ''; + } + } + + + } + }) ->make(); } + public function restoreUser($id) + { + // dd($id); + // $delete_all = Input::get('delete_all'); + $users = User::where('id', '=', $id)->first(); + $users->is_delete=0; + $users->active=1; + $users->ban=0; + $users->save(); + return redirect('user')->with('success', Lang::get('lang.user_restore_successfully')); + } + /** * Show the form for creating a new users. * * @return type view */ - public function create(CountryCode $code) - { + public function create(CountryCode $code) { try { $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); $email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first(); $location = GeoIP::getLocation(); $phonecode = $code->where('iso', '=', $location->iso_code)->first(); $org = Organization::lists('name', 'id')->toArray(); - return view('themes.default1.agent.helpdesk.user.create', compact('org', 'settings', 'email_mandatory'))->with('phonecode', $phonecode->phonecode); } catch (Exception $e) { return redirect()->back()->with('fails', $e->errorInfo[2]); @@ -205,11 +275,9 @@ class UserController extends Controller * * @return type redirect */ - public function store(User $user, Sys_userRequest $request) - { + public function store(User $user, Sys_userRequest $request) { /* insert the input request to sys_user table */ /* Check whether function success or not */ - if ($request->input('email') != '') { $user->email = $request->input('email'); } else { @@ -242,9 +310,9 @@ class UserController extends Controller } // save user credentails if ($user->save() == true) { - if ($request->input('org_id') != '') { + if ($request->input('org_id') != "") { $orgid = $request->input('org_id'); - $this->storeUserOrgRelation($user->id, $orgid); + $this->storeUserOrgRelation($user->id, $orgid); } // fetch user credentails to send mail $name = $user->first_name; @@ -264,7 +332,6 @@ class UserController extends Controller if (($request->input('active') == '0' || $request->input('active') == 0) || ($email_mandatory->status == '0') || $email_mandatory->status == 0) { \Event::fire(new \App\Events\LoginEvent($request)); } - return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully')); } // $user->save(); @@ -277,18 +344,17 @@ class UserController extends Controller } /** - * Random Password Genetor for users. + * Random Password Genetor for users * * @param type int $id * @param type User $user * * @return type view */ - public function randomPassword() - { + public function randomPassword() { try { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*(){}[]'; - $pass = []; //remember to declare $pass as an array + $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < 10; $i++) { $n = rand(0, $alphaLength); @@ -303,15 +369,14 @@ class UserController extends Controller } /** - * Random Password Genetor for users. + * Random Password Genetor for users * * @param type int $id * @param type User $user * * @return type view */ - public function randomPostPassword($id, ChangepasswordRequest $request) - { + public function randomPostPassword($id, ChangepasswordRequest $request) { try { $changepassword = $request->change_password; $user = User::whereId($id)->first(); @@ -326,25 +391,24 @@ class UserController extends Controller return redirect('user')->with('success', Lang::get('lang.password_change_successfully')); } catch (Exception $e) { + return redirect('user')->with('fails', $e->getMessage()); } } /** - * @param type $id + * + * @param type $id * @param Request $request - * * @return type */ - public function changeRoleAdmin($id, Request $request) - { + public function changeRoleAdmin($id, Request $request) { try { $user = User::whereId($id)->first(); $user->role = 'admin'; $user->assign_group = $request->group; $user->primary_dpt = $request->primary_department; $user->save(); - return redirect('user')->with('success', Lang::get('lang.role_change_successfully')); } catch (Exception $e) { /* redirect to Index page with Fails Message */ @@ -353,14 +417,14 @@ class UserController extends Controller } /** - * @param type $id + * + * @param type $id * @param Request $request - * * @return type */ - public function changeRoleAgent($id, Request $request) - { + public function changeRoleAgent($id, Request $request) { try { + $user = User::whereId($id)->first(); $user->role = 'agent'; $user->assign_group = $request->group; @@ -375,22 +439,22 @@ class UserController extends Controller } /** + * * @param type $id - * * @return type */ - public function changeRoleUser($id) - { + public function changeRoleUser($id) { try { $ticket = Tickets::where('assigned_to', '=', $id)->where('status', '=', '1')->get(); if ($ticket) { - $ticket = Tickets::where('assigned_to', '=', $id)->update(['assigned_to' => null]); + + $ticket = Tickets::where('assigned_to', '=', $id)->update(array("assigned_to" => NULL)); } $user = User::whereId($id)->first(); $user->role = 'user'; - $user->assign_group = null; - $user->primary_dpt = null; - $user->remember_token = null; + $user->assign_group = NULL; + $user->primary_dpt = NULL; + $user->remember_token = NULL; $user->save(); return redirect('user')->with('success', Lang::get('lang.role_change_successfully')); @@ -402,85 +466,54 @@ class UserController extends Controller } /** + * * @param type $id - * * @return type */ public function deleteAgent($id) { // try { - $delete_all = Input::get('delete_all'); + $delete_all = Input::get('delete_all'); + + + + $delete_all = Input::get('delete_all'); $users = User::where('id', '=', $id)->first(); - if ($users->role == 'user') { - if ($delete_all == null || $delete_all == 1) { - $tickets = Tickets::where('user_id', '=', $id)->get(); - if (count($tickets) > 0) { - foreach ($tickets as $ticket) { - $notification = Notification::select('id')->where('model_id', '=', $ticket->id)->get(); - foreach ($notification as $id) { - $user_notification = UserNotification::where( - 'notification_id', '=', $id->id); - $user_notification->delete(); - } - $notification = Notification::select('id')->where('model_id', '=', $ticket->id); - $notification->delete(); - $thread = Ticket_Thread::where('ticket_id', '=', $ticket->id)->get(); - foreach ($thread as $th_id) { - // echo $th_id->id." "; - $attachment = Ticket_attachments::where('thread_id', '=', $th_id->id)->get(); - if (count($attachment)) { - foreach ($attachment as $a_id) { - Ticket_attachments::where('id', '=', $a_id->id) - ->delete(); - } - // echo "
    "; - } - $thread = Ticket_Thread::find($th_id->id); -// dd($thread); - $thread->delete(); - } - $collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket->id)->get(); - if (count($collaborators)) { - foreach ($collaborators as $collab_id) { - echo $collab_id->id; - $collab = Ticket_Collaborator::where('id', '=', $collab_id->id) - ->delete(); - } - } - $tickets = Tickets::find($ticket->id); - $tickets->delete(); - } - } - $organization = User_org::where('user_id', '=', $users->id)->delete(); - $user = User::where('id', '=', $users->id) - ->delete(); + if ($users->role == 'user') { + + $users = User::where('id', '=', $id)->first(); + $users->is_delete=1; + $users->active=0; + $users->ban=1; + $users->save(); return redirect('user')->with('success', Lang::get('lang.user_delete_successfully')); } - } + // } + if ($users->role == 'agent') { if ($delete_all == null) { $UserEmail = Input::get('assign_to'); $assign_to = explode('_', $UserEmail); - $ticket = Tickets::where('assigned_to', '=', $id)->where('status', '=', '1')->get(); + $ticket = Tickets::where('assigned_to', '=', $id)->get(); if ($assign_to[0] == 'user') { if ($users->id == $assign_to[1]) { return redirect('user')->with('warning', Lang::get('lang.select_another_agent')); } - $user_detail = User::where('id', '=', $assign_to[1])->first(); - $assignee = $user_detail->first_name.' '.$user_detail->last_name; - $ticket_logic1 = Tickets::where('assigned_to', '=', $id) - ->update(['assigned_to' => $assign_to[1]]); - if ($ticket_logic2 = Tickets::where('user_id', '=', $id)->get()) { - $ticket_logic2 = Tickets::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); - } - if ($ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->get()) { - $ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); - } - if ($ticket_logic4 = User_org::where('user_id', '=', $id)->get()) { - $ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); - } + // $user_detail = User::where('id', '=', $assign_to[1])->first(); + // $assignee = $user_detail->first_name.' '.$user_detail->last_name; + // $ticket_logic1 = Tickets::where('assigned_to', '=', $id) + // ->update(['assigned_to' => $assign_to[1]]); + // if ($ticket_logic2 = Tickets::where('user_id', '=', $id)->get()) { + // $ticket_logic2 = Tickets::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); + // } + // if ($ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->get()) { + // $ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); + // } + // if ($ticket_logic4 = User_org::where('user_id', '=', $id)->get()) { + // $ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); + // } // $thread2 = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first(); // $thread2->body = 'This Ticket have been Reassigned to' .' '. $assignee; @@ -488,40 +521,81 @@ class UserController extends Controller // UserNotification::where('notification_id', '=', $ticket->id)->delete(); // $users = User::where('id', '=', $id)->get(); // $organization = User_org::where('user_id', '=', $id)->delete(); - Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]); + // Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]); + $tickets = Tickets::where('assigned_to', '=', $id)->get(); + + +foreach ($tickets as $ticket ) { + # code... + + $ticket->assigned_to = $assign_to[1]; + $user_detail = User::where('id', '=', $assign_to[1])->first(); + $assignee = $user_detail->first_name . ' ' . $user_detail->last_name; + $ticket_number = $ticket->ticket_number; + $ticket->save(); + + + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket->id; + $thread->user_id = Auth::user()->id; + $thread->is_internal = 1; + $thread->body = 'This Ticket has been assigned to ' . $assignee; + $thread->save(); + } $user = User::find($id); - $user->delete(); + $users->is_delete=1; + $users->active=0; + $users->ban=1; + $users->save(); + return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully_and_ticket_assign_to_another_agent')); } - if (User_org::where('user_id', '=', $id)) { - DB::table('user_assign_organization')->where('user_id', '=', $id)->delete(); - } + + + // if (User_org::where('user_id', '=', $id)) { + // DB::table('user_assign_organization')->where('user_id', '=', $id)->delete(); + // } $user = User::find($id); - $user->delete(); + $users->is_delete=1; + $users->active=0; + $users->ban=1; + $users->save(); return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully')); } elseif ($delete_all == 1) { - if ($ticket = Tickets::where('user_id', '=', $id)->first()) { - $ticket_assign = $ticket->assigned_to; - Ticket_Thread::where('ticket_id', '=', $ticket->id)->delete(); - if ($ticket->user_id = $id) { - Tickets::where('user_id', '=', $id)->delete(); - } - if ($ticket_assign) { - UserNotification::where('notification_id', '=', $ticket_assign)->delete(); - } - UserNotification::where('notification_id', '=', $ticket->id)->delete(); - $users = User::where('id', '=', $id)->get(); + + if ($delete_all) { + // dd('here'); + $tickets = Tickets::where('assigned_to', '=', $id)->get(); + // dd($tickets); + foreach ($tickets as $ticket ) { + $ticket->assigned_to = NULL; + $ticket_number = $ticket->ticket_number; + $ticket->save(); + + + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket->id; + $thread->user_id = Auth::user()->id; + $thread->is_internal = 1; + $thread->body = 'This Ticket has been unassigned '; + $thread->save(); + } + // $users = User::where('id', '=', $id)->get(); $user = User::find($id); - $user->delete(); + $users->is_delete=1; + $users->active=0; + $users->save(); return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully')); } else { - Assign_team_agent::where('agent_id', '=', $id)->delete(); - User_org::where('user_id', '=', $id)->delete(); + // Assign_team_agent::where('agent_id', '=', $id)->delete(); + // User_org::where('user_id', '=', $id)->delete(); $user = User::find($id); - $user->delete(); + $users->is_delete=1; + $users->active=0; + $users->save(); return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully')); } @@ -542,11 +616,10 @@ class UserController extends Controller * * @return type view */ - public function show($id) - { + public function show($id) { try { - $users = User::where('id', '=', $id)->first(); - if (count($users) > 0) { + $users = User::where('id','=', $id)->first(); + if (count($users)>0) { return view('themes.default1.agent.helpdesk.user.show', compact('users')); } else { return redirect()->back()->with('fails', Lang::get('lang.user-not-found')); @@ -564,9 +637,11 @@ class UserController extends Controller * * @return type Response */ - public function edit($id, CountryCode $code) - { + public function edit($id, CountryCode $code) { try { + + + // dd('here'); $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); $email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first(); @@ -575,9 +650,14 @@ class UserController extends Controller $users = $user->whereId($id)->first(); $location = GeoIP::getLocation(); $phonecode = $code->where('iso', '=', $location->iso_code)->first(); - $org = Organization::lists('name', 'id')->toArray(); + $orgs = Organization::all(); + // dd($org); + $organization_id=User_org::where('user_id','=',$id)->lists('org_id')->first(); - return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'org', '$settings', '$email_mandatory'))->with('phonecode', $phonecode->phonecode); + // $org_name=Organization::where('id','=',$org_id)->lists('name')->first(); + // dd($org_name); + + return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'orgs', '$settings', '$email_mandatory','organization_id'))->with('phonecode', $phonecode->phonecode); } catch (Exception $e) { return redirect()->back()->with('fails', $e->getMessage()); } @@ -592,9 +672,8 @@ class UserController extends Controller * * @return type Response */ - public function update($id, Sys_userUpdate $request) - { - // dd($request); + public function update($id, Sys_userUpdate $request) { + $user = new User(); /* select the field where id = $id(request Id) */ $users = $user->whereId($id)->first(); @@ -614,9 +693,10 @@ class UserController extends Controller $users->mobile = ($request->input('mobile') == '') ? null : $request->input('mobile'); $users->fill($request->except('mobile')); $users->save(); - if ($request->input('org_id') != '') { + if ($request->input('org_id') != "") { $orgid = $request->input('org_id'); - $this->storeUserOrgRelation($users->id, $orgid); + + $this->storeUserOrgRelation($id, $orgid); } /* redirect to Index page with Success Message */ return redirect('user')->with('success', Lang::get('lang.User-profile-Updated-Successfully')); @@ -631,8 +711,7 @@ class UserController extends Controller * * @return type view */ - public function getProfile() - { + public function getProfile() { $user = Auth::user(); try { return view('themes.default1.agent.helpdesk.user.profile', compact('user')); @@ -646,8 +725,7 @@ class UserController extends Controller * * @return type view */ - public function getProfileedit(CountryCode $code) - { + public function getProfileedit(CountryCode $code) { $user = Auth::user(); $location = GeoIP::getLocation(); $phonecode = $code->where('iso', '=', $location->iso_code)->first(); @@ -656,7 +734,7 @@ class UserController extends Controller try { return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user')) ->with(['phonecode' => $phonecode->phonecode, - 'verify' => $status, ]); + 'verify' => $status]); } catch (Exception $e) { return redirect()->back()->with('fails', $e->getMessage()); } @@ -670,8 +748,7 @@ class UserController extends Controller * * @return type Redirect */ - public function postProfileedit(ProfileRequest $request) - { + public function postProfileedit(ProfileRequest $request) { try { // geet authenticated user details $user = Auth::user(); @@ -681,14 +758,14 @@ class UserController extends Controller $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get(); if (!count($code)) { return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); - } + } $user->country_code = $request->country_code; } $user->fill($request->except('profile_pic', 'mobile')); $user->gender = $request->input('gender'); $user->save(); if (Input::file('profile_pic')) { - // fetching picture name + // fetching picture name $name = Input::file('profile_pic')->getClientOriginalName(); // fetching upload destination path $destinationPath = 'uploads/profilepic'; @@ -705,10 +782,11 @@ class UserController extends Controller $user->mobile = null; } if ($user->save()) { - return Redirect::route('profile')->with('success', Lang::get('lang.Profile-Updated-sucessfully')); + return Redirect::route('profile')->with('success', Lang::get('lang.Profile-Updated-sucessfully')); } else { return Redirect::route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully')); } + } catch (Exception $e) { return Redirect::route('profile')->with('fails', $e->getMessage()); } @@ -734,7 +812,7 @@ class UserController extends Controller return redirect('profile-edit')->with('success1', Lang::get('lang.password_updated_sucessfully')); } catch (Exception $e) { - return redirect('profile-edit')->with('fails1', $e->getMessage()); + return redirect('profile-edit')->with('fails', $e->getMessage()); } } else { return redirect('profile-edit')->with('fails1', Lang::get('lang.password_was_not_updated_incorrect_old_password')); @@ -748,56 +826,49 @@ class UserController extends Controller * * @return type boolean */ - public function UserAssignOrg($id) - { + public function UserAssignOrg($id) { $org_name = Input::get('org'); - if ($org_name) { - $org = Organization::where('name', '=', $org_name)->lists('id')->first(); - if ($org) { - $user_org = new User_org(); - $user_org->org_id = $org; - $user_org->user_id = $id; - $user_org->save(); + - return 1; - } else { - return 0; +if ($org_name) { + $org = Organization::where('name', '=', $org_name)->lists('id')->first(); + if ($org) { + $user_org = new User_org(); + $user_org->org_id = $org; + $user_org->user_id = $id; + $user_org->save(); + + return 1; + } else { + return 0; } - } else { - return 2; + } else { + return 2; } - } + } - /** - * Assigning an user to an organization. - * - * @param type $id - * - * @return type boolean - */ - public function UsereditAssignOrg($id) - { - $org_name = Input::get('org'); + public function UsereditAssignOrg($id) + { + $org_name = Input::get('org'); + + if ($org_name) { + $org = Organization::where('name', '=', $org_name)->lists('id')->first(); + if ($org) { + $user_org = User_org::where('user_id', '=', $id)->first(); + $user_org->org_id = $org; + $user_org->user_id = $id; + $user_org->save(); - if ($org_name) { - $org = Organization::where('name', '=', $org_name)->lists('id')->first(); - if ($org) { - $user_org = User_org::where('user_id', '=', $id)->first(); - $user_org->org_id = $org; - $user_org->user_id = $id; - $user_org->save(); - - return 1; - } else { - return 0; + return 1; + } else { + return 0; } - } else { - return 2; + } else { + return 2; } - } + } - public function orgAssignUser($id) - { + public function orgAssignUser($id) { $org = Input::get('org'); $user_org = new User_org(); $user_org->org_id = $id; @@ -807,8 +878,7 @@ class UserController extends Controller return 1; } - public function removeUserOrg($id) - { + public function removeUserOrg($id) { $user_org = User_org::where('org_id', '=', $id)->first(); $user_org->delete(); @@ -822,8 +892,7 @@ class UserController extends Controller * * @return type */ - public function User_Create_Org($id) - { + public function User_Create_Org($id) { // checking if the entered value for website is available in database if (Input::get('website') != null) { // checking website @@ -866,8 +935,7 @@ class UserController extends Controller * * @return string */ - public function generateRandomString($length = 10) - { + public function generateRandomString($length = 10) { // list of supported characters $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; // character length checked @@ -882,8 +950,7 @@ class UserController extends Controller return $randomString; } - public function storeUserOrgRelation($userid, $orgid) - { + public function storeUserOrgRelation($userid, $orgid) { $org_relations = new User_org(); $org_relation = $org_relations->where('user_id', $userid)->first(); if ($org_relation) { @@ -891,12 +958,11 @@ class UserController extends Controller } $org_relations->create([ 'user_id' => $userid, - 'org_id' => $orgid, + 'org_id' => $orgid, ]); } - public function getExportUser() - { + public function getExportUser() { try { return view('themes.default1.agent.helpdesk.user.export'); } catch (Exception $ex) { @@ -904,34 +970,30 @@ class UserController extends Controller } } - public function exportUser(Request $request) - { + public function exportUser(Request $request) { try { $date = $request->input('date'); $date = str_replace(' ', '', $date); $date_array = explode(':', $date); - $first = $date_array[0].' 00:00:00'; - $second = $date_array[1].' 23:59:59'; + $first = $date_array[0] . " 00:00:00"; + $second = $date_array[1] . " 23:59:59"; $first_date = $this->convertDate($first); $second_date = $this->convertDate($second); $users = $this->getUsers($first_date, $second_date); $excel_controller = new \App\Http\Controllers\Common\ExcelController(); - $filename = 'users'.$date; + $filename = "users" . $date; $excel_controller->export($filename, $users); } catch (Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); } } - public function convertDate($date) - { + public function convertDate($date) { $converted_date = date('Y-m-d H:i:s', strtotime($date)); - return $converted_date; } - public function getUsers($first, $last) - { + public function getUsers($first, $last) { $user = new User(); $users = $user->leftJoin('user_assign_organization', 'users.id', '=', 'user_assign_organization.user_id') ->leftJoin('organization', 'user_assign_organization.org_id', '=', 'organization.id') @@ -941,42 +1003,37 @@ class UserController extends Controller ->select('users.user_name as Username', 'users.email as Email', 'users.first_name as Fisrtname', 'users.last_name as Lastname', 'organization.name as Organization') ->get() ->toArray(); - return $users; } - public function resendOTP(OtpVerifyRequest $request) - { + public function resendOTP(OtpVerifyRequest $request) { if (\Schema::hasTable('sms')) { $sms = DB::table('sms')->get(); if (count($sms) > 0) { \Event::fire(new \App\Events\LoginEvent($request)); - return 1; } } else { - return 'Plugin has not been setup successfully.'; + return "Plugin has not been setup successfully."; } } - public function verifyOTP() - { + public function verifyOTP() { // dd(Input::all()); // $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email'))->first(); $otp = Otp::select('otp', 'updated_at')->where('user_id', '=', Input::get('u_id')) ->first(); if ($otp != null) { $otp_length = strlen(Input::get('otp')); - if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) { + if (($otp_length == 6 && !preg_match("/[a-z]/i", Input::get('otp')))) { $otp2 = Hash::make(Input::get('otp')); - $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); - $date2 = date('Y-m-d h:i:sa'); + $date1 = date_format($otp->updated_at, "Y-m-d h:i:sa"); + $date2 = date("Y-m-d h:i:sa"); $time1 = new DateTime($date2); $time2 = new DateTime($date1); $interval = $time1->diff($time2); if ($interval->i > 10 || $interval->h > 0) { $message = Lang::get('lang.otp-expired'); - return $message; } else { if (Hash::check(Input::get('otp'), $otp->otp)) { @@ -988,34 +1045,26 @@ class UserController extends Controller return 1; } else { $message = Lang::get('lang.otp-not-matched'); - return $message; } } } else { $message = Lang::get('lang.otp-invalid'); - return $message; } } else { $message = Lang::get('lang.otp-not-matched'); - return $message; } } /** - * @category function to get user details and show in select field - * - * @param null - * - * @return data */ public function getAgentDetails() { $users = User::where('role', '<>', 'user')->where('active', '=', 1)->get(); foreach ($users as $user) { - echo "'; + echo "'; } } } diff --git a/app/Http/Controllers/Agent/kb/ArticleController.php b/app/Http/Controllers/Agent/kb/ArticleController.php index cc61d8b74..d718c2c55 100644 --- a/app/Http/Controllers/Agent/kb/ArticleController.php +++ b/app/Http/Controllers/Agent/kb/ArticleController.php @@ -65,7 +65,7 @@ class ArticleController extends Controller $article = new Article(); $articles = $article ->select('id', 'name', 'description', 'publish_time', 'slug') - ->orderBy('publish_time', 'desc') + ->orderBy('publish_time','desc') ->get(); // returns chumper datatable return Datatable::Collection($articles) diff --git a/app/Http/Controllers/Agent/kb/CategoryController.php b/app/Http/Controllers/Agent/kb/CategoryController.php index 87f54e767..ca426d87f 100644 --- a/app/Http/Controllers/Agent/kb/CategoryController.php +++ b/app/Http/Controllers/Agent/kb/CategoryController.php @@ -77,7 +77,6 @@ class CategoryController extends Controller /* add column name */ ->addColumn('name', function ($model) { $string = strip_tags($model->name); - return str_limit($string, 20); }) /* add column Created */ @@ -121,7 +120,7 @@ class CategoryController extends Controller public function create(Category $category) { /* Get the all attributes in the category model */ - $category = $category->lists('name', 'id')->toArray(); + $category = $category->lists('name','id')->toArray(); /* get the view page to create new category with all attributes of category model */ try { @@ -148,7 +147,6 @@ class CategoryController extends Controller // send success message to index page try { $category->fill($request->input())->save(); - return Redirect::back()->with('success', Lang::get('lang.category_inserted_successfully')); } catch (Exception $e) { return Redirect::back()->with('fails', Lang::get('lang.category_not_inserted').'
  • '.$e->getMessage().'
  • '); @@ -167,9 +165,9 @@ class CategoryController extends Controller { /* get the atributes of the category model whose id == $id */ $category = Category::whereId($id)->first(); - $categories = Category::lists('name', 'id')->toArray(); + $categories = Category::lists('name','id')->toArray(); /* get the Edit page the selected category via id */ - return view('themes.default1.agent.kb.category.edit', compact('category', 'categories')); + return view('themes.default1.agent.kb.category.edit', compact('category','categories')); } /** @@ -193,7 +191,6 @@ class CategoryController extends Controller try { $category->slug = $slug; $category->fill($request->input())->save(); - return redirect('category')->with('success', Lang::get('lang.category_updated_successfully')); } catch (Exception $e) { //redirect to index with fails message diff --git a/app/Http/Controllers/Agent/kb/SettingsController.php b/app/Http/Controllers/Agent/kb/SettingsController.php index 4293949cf..4e7c2d9ef 100644 --- a/app/Http/Controllers/Agent/kb/SettingsController.php +++ b/app/Http/Controllers/Agent/kb/SettingsController.php @@ -144,13 +144,11 @@ class SettingsController extends Controller $name = "

    $model->name


    "; $email = "

    $model->email


    "; $website = "

    $model->website


    "; - return $name.$email.$website; }) - + ->addColumn('comment', function ($model) { - $created = TicketController::usertimezone(date($model->created_at)); - + $created = TicketController::usertimezone(date($model->created_at)); return $model->comment."

    $created

    "; }) ->addColumn('status', function ($model) { @@ -161,7 +159,7 @@ class SettingsController extends Controller return '

    '.\Lang::get('lang.not_published'); } }) - + ->addColumn('Actions', function ($model) { return '

    '; }) diff --git a/app/Http/Controllers/Api/v1/ApiController.php b/app/Http/Controllers/Api/v1/ApiController.php index 1724013cd..949693d2d 100644 --- a/app/Http/Controllers/Api/v1/ApiController.php +++ b/app/Http/Controllers/Api/v1/ApiController.php @@ -2,10 +2,9 @@ namespace App\Http\Controllers\Api\v1; -use App\Http\Controllers\Agent\helpdesk\TicketController as CoreTicketController; use App\Http\Controllers\Controller; -//use Illuminate\Support\Facades\Request as Value; use App\Http\Requests\helpdesk\TicketRequest; +//use Illuminate\Support\Facades\Request as Value; use App\Model\helpdesk\Agent\Department; use App\Model\helpdesk\Agent\Teams; use App\Model\helpdesk\Manage\Help_topic; @@ -21,6 +20,7 @@ use Exception; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; +use App\Http\Controllers\Agent\helpdesk\TicketController as CoreTicketController; /** * ----------------------------------------------------------------------------- @@ -34,8 +34,8 @@ use Illuminate\Support\Collection; * * @version v1 */ -class ApiController extends Controller -{ +class ApiController extends Controller { + public $user; public $request; public $ticket; @@ -55,8 +55,7 @@ class ApiController extends Controller /** * @param Request $request */ - public function __construct(Request $request) - { + public function __construct(Request $request) { $this->request = $request; $this->middleware('jwt.auth'); @@ -65,7 +64,9 @@ class ApiController extends Controller $user = \JWTAuth::parseToken()->authenticate(); $this->user = $user; } catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) { + } catch (\Tymon\JWTAuth\Exceptions\JWTException $e) { + } $ticket = new TicketController(); @@ -120,8 +121,7 @@ class ApiController extends Controller * * @return json */ - public function createTicket(\App\Http\Requests\helpdesk\CreateTicketRequest $request, \App\Model\helpdesk\Utility\CountryCode $code) - { + public function createTicket(\App\Http\Requests\helpdesk\CreateTicketRequest $request, \App\Model\helpdesk\Utility\CountryCode $code) { try { $user_id = $this->request->input('user_id'); @@ -148,7 +148,7 @@ class ApiController extends Controller $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $NotificationController = new \App\Http\Controllers\Common\NotificationController(); $core = new CoreTicketController($PhpMailController, $NotificationController); - $response = $core->post_newticket($request, $code, true); + $response = $core->post_newticket($request, $code,true); //$response = $this->ticket->createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach); //return $response; /* @@ -179,12 +179,11 @@ class ApiController extends Controller * * @return json */ - public function ticketReply() - { + public function ticketReply() { //dd($this->request->all()); try { $v = \Validator::make($this->request->all(), [ - 'ticket_ID' => 'required|exists:tickets,id', + 'ticket_ID' => 'required|exists:tickets,id', 'reply_content' => 'required', ]); if ($v->fails()) { @@ -194,7 +193,9 @@ class ApiController extends Controller } $attach = $this->request->input('attachments'); $result = $this->ticket->reply($this->thread, $this->request, $this->attach, $attach); - + $result = $result->join('users','ticket_thread.user_id','=','users.id') + ->select('ticket_thread.*','users.first_name as first_name') + ->first(); return response()->json(compact('result')); } catch (\Exception $e) { $error = $e->getMessage(); @@ -214,15 +215,14 @@ class ApiController extends Controller * * @return json */ - public function editTicket() - { + public function editTicket() { try { $v = \Validator::make($this->request->all(), [ - 'ticket_id' => 'required|exists:tickets,id', - 'subject' => 'required', - 'sla_plan' => 'required|exists:sla_plan,id', - 'help_topic' => 'required|exists:help_topic,id', - 'ticket_source' => 'required|exists:ticket_source,id', + 'ticket_id' => 'required|exists:tickets,id', + 'subject' => 'required', + 'sla_plan' => 'required|exists:sla_plan,id', + 'help_topic' => 'required|exists:help_topic,id', + 'ticket_source' => 'required|exists:ticket_source,id', 'ticket_priority' => 'required|exists:ticket_priority,priority_id', ]); if ($v->fails()) { @@ -252,8 +252,7 @@ class ApiController extends Controller * * @return json */ - public function deleteTicket() - { + public function deleteTicket() { try { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required|exists:tickets,id', @@ -286,16 +285,15 @@ class ApiController extends Controller * * @return json */ - public function openedTickets() - { + public function openedTickets() { try { // $result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); $result = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $join->on('users.id', '=', 'tickets.user_id') ->where('isanswered', '=', 0)->where('status', '=', 1)->whereNull('assigned_to'); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -331,17 +329,16 @@ class ApiController extends Controller * * @return json */ - public function unassignedTickets() - { + public function unassignedTickets() { try { //dd('sdhjbc'); // $result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); $user = \JWTAuth::parseToken()->authenticate(); $unassigned = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $join->on('users.id', '=', 'tickets.user_id') ->whereNull('assigned_to')->where('status', '=', 1); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -352,7 +349,7 @@ class ApiController extends Controller ->whereNotNull('title'); }) ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') - ->where(function ($query) use ($user) { + ->where(function($query) use($user) { if ($user->role != 'admin') { $query->where('tickets.dept_id', '=', $user->primary_dpt); } @@ -382,16 +379,15 @@ class ApiController extends Controller * * @return json */ - public function closeTickets() - { + public function closeTickets() { try { // $result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); $user = \JWTAuth::parseToken()->authenticate(); $result = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 3)->orWhere('status', '=', 2); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -402,7 +398,7 @@ class ApiController extends Controller ->whereNotNull('title'); }) ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') - ->where(function ($query) use ($user) { + ->where(function($query) use($user) { if ($user->role != 'admin') { $query->where('tickets.dept_id', '=', $user->primary_dpt); } @@ -432,8 +428,7 @@ class ApiController extends Controller * * @return json */ - public function getAgents() - { + public function getAgents() { try { $result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get(); @@ -456,8 +451,7 @@ class ApiController extends Controller * * @return json */ - public function getTeams() - { + public function getTeams() { try { $result = $this->team->get(); @@ -480,12 +474,11 @@ class ApiController extends Controller * * @return json */ - public function assignTicket() - { + public function assignTicket() { try { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required', - 'user' => 'required', + 'user' => 'required', ]); if ($v->fails()) { $error = $v->errors(); @@ -519,8 +512,7 @@ class ApiController extends Controller * * @return json */ - public function getCustomers() - { + public function getCustomers() { try { $v = \Validator::make($this->request->all(), [ 'search' => 'required', @@ -531,7 +523,7 @@ class ApiController extends Controller return response()->json(compact('error')); } $search = $this->request->input('search'); - $result = $this->faveoUser->where('first_name', 'like', '%'.$search.'%')->orWhere('last_name', 'like', '%'.$search.'%')->orWhere('user_name', 'like', '%'.$search.'%')->orWhere('email', 'like', '%'.$search.'%')->get(); + $result = $this->faveoUser->where('first_name', 'like', '%' . $search . '%')->orWhere('last_name', 'like', '%' . $search . '%')->orWhere('user_name', 'like', '%' . $search . '%')->orWhere('email', 'like', '%' . $search . '%')->get(); return response()->json(compact('result')) ->header('X-Header-One', 'Header Value'); @@ -554,8 +546,7 @@ class ApiController extends Controller * * @return json */ - public function getCustomersWith() - { + public function getCustomersWith() { try { $users = $this->user ->leftJoin('user_assign_organization', 'user_assign_organization.user_id', '=', 'users.id') @@ -586,8 +577,7 @@ class ApiController extends Controller * * @return json */ - public function getCustomer() - { + public function getCustomer() { try { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required', @@ -619,8 +609,7 @@ class ApiController extends Controller * * @return json */ - public function searchTicket() - { + public function searchTicket() { try { $v = \Validator::make($this->request->all(), [ 'search' => 'required', @@ -631,7 +620,7 @@ class ApiController extends Controller return response()->json(compact('error')); } $search = $this->request->input('search'); - $result = $this->thread->select('ticket_id')->where('title', 'like', '%'.$search.'%')->orWhere('body', 'like', '%'.$search.'%')->get(); + $result = $this->thread->select('ticket_id')->where('title', 'like', '%' . $search . '%')->orWhere('body', 'like', '%' . $search . '%')->get(); return response()->json(compact('result')); } catch (Exception $e) { @@ -652,8 +641,7 @@ class ApiController extends Controller * * @return json */ - public function ticketThreads() - { + public function ticketThreads() { try { $v = \Validator::make($this->request->all(), [ 'id' => 'required', @@ -690,8 +678,7 @@ class ApiController extends Controller * * @return json */ - public function checkUrl() - { + public function checkUrl() { //dd($this->request); try { $v = \Validator::make($this->request->all(), [ @@ -708,7 +695,7 @@ class ApiController extends Controller $url = str_finish($url, '/'); } - $url = $url.'/api/v1/helpdesk/check-url?api_key='.$this->request->input('api_key').'&token='.\Config::get('app.token'); + $url = $url . '/api/v1/helpdesk/check-url?api_key=' . $this->request->input('api_key') . '&token=' . \Config::get('app.token'); $result = $this->CallGetApi($url); //dd($result); return response()->json(compact('result')); @@ -728,8 +715,7 @@ class ApiController extends Controller * * @return string */ - public function urlResult() - { + public function urlResult() { return 'success'; } @@ -740,8 +726,7 @@ class ApiController extends Controller * * @return type int|string|json */ - public function callGetApi($url) - { + public function callGetApi($url) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, $url); @@ -750,7 +735,7 @@ class ApiController extends Controller $response = curl_exec($curl); if (curl_errno($curl)) { - echo 'error:'.curl_error($curl); + echo 'error:' . curl_error($curl); } return $response; @@ -765,8 +750,7 @@ class ApiController extends Controller * * @return type int|string|json */ - public function callPostApi($url, $data) - { + public function callPostApi($url, $data) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, $url); @@ -776,7 +760,7 @@ class ApiController extends Controller $response = curl_exec($curl); if (curl_errno($curl)) { - echo 'error:'.curl_error($curl); + echo 'error:' . curl_error($curl); } return $response; @@ -788,8 +772,7 @@ class ApiController extends Controller * * @return type | json */ - public function generateApiKey() - { + public function generateApiKey() { try { $set = $this->setting->where('id', '1')->first(); //dd($set); @@ -823,8 +806,7 @@ class ApiController extends Controller * * @return json */ - public function getHelpTopic() - { + public function getHelpTopic() { try { $result = $this->helptopic->get(); @@ -847,8 +829,7 @@ class ApiController extends Controller * * @return json */ - public function getSlaPlan() - { + public function getSlaPlan() { try { $result = $this->slaPlan->get(); @@ -871,8 +852,7 @@ class ApiController extends Controller * * @return json */ - public function getPriority() - { + public function getPriority() { try { $result = $this->priority->get(); @@ -895,8 +875,7 @@ class ApiController extends Controller * * @return json */ - public function getDepartment() - { + public function getDepartment() { try { $result = $this->department->get(); @@ -919,8 +898,7 @@ class ApiController extends Controller * * @return type json */ - public function getTickets() - { + public function getTickets() { try { $tickets = $this->model->orderBy('created_at', 'desc')->paginate(10); $tickets->toJson(); @@ -944,14 +922,13 @@ class ApiController extends Controller * * @return type json */ - public function inbox() - { + public function inbox() { try { $user = \JWTAuth::parseToken()->authenticate(); $inbox = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 1); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -962,7 +939,7 @@ class ApiController extends Controller ->whereNotNull('ticket_thread.title'); }) ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'ticket_thread.title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name', 'department.id as department_id', 'users.primary_dpt as user_dpt') - ->where(function ($query) use ($user) { + ->where(function($query) use($user) { if ($user->role != 'admin') { $query->where('tickets.dept_id', '=', $user->primary_dpt); } @@ -972,7 +949,6 @@ class ApiController extends Controller ->distinct() ->paginate(10) ->toJson(); - return $inbox; } catch (\Exception $ex) { $error = $ex->getMessage(); @@ -992,13 +968,12 @@ class ApiController extends Controller * * @return type json */ - public function internalNote() - { + public function internalNote() { try { $v = \Validator::make($this->request->all(), [ - 'userid' => 'required|exists:users,id', + 'userid' => 'required|exists:users,id', 'ticketid' => 'required|exists:tickets,id', - 'body' => 'required', + 'body' => 'required', ]); if ($v->fails()) { $error = $v->errors(); @@ -1025,14 +1000,13 @@ class ApiController extends Controller } } - public function getTrash() - { + public function getTrash() { try { $user = \JWTAuth::parseToken()->authenticate(); $trash = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 5); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -1043,7 +1017,7 @@ class ApiController extends Controller ->whereNotNull('title'); }) ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') - ->where(function ($query) use ($user) { + ->where(function($query) use($user) { if ($user->role != 'admin') { $query->where('tickets.dept_id', '=', $user->primary_dpt); } @@ -1068,8 +1042,7 @@ class ApiController extends Controller } } - public function getMyTicketsAgent() - { + public function getMyTicketsAgent() { try { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required|exists:users,id', @@ -1087,10 +1060,10 @@ class ApiController extends Controller } //$user = \JWTAuth::parseToken()->authenticate(); $result = $this->user->join('tickets', function ($join) use ($id) { - $join->on('users.id', '=', 'tickets.assigned_to') + $join->on('users.id', '=', 'tickets.assigned_to') ->where('status', '=', 1); //->where('user_id', '=', $id); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -1127,8 +1100,7 @@ class ApiController extends Controller } } - public function getMyTicketsUser() - { + public function getMyTicketsUser() { try { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required|exists:users,id', @@ -1145,9 +1117,9 @@ class ApiController extends Controller return response()->json(compact('error')); } $result = $this->user->join('tickets', function ($join) use ($id) { - $join->on('users.id', '=', 'tickets.user_id') + $join->on('users.id', '=', 'tickets.user_id') ->where('user_id', '=', $id); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') @@ -1179,8 +1151,7 @@ class ApiController extends Controller } } - public function getTicketById() - { + public function getTicketById() { try { $v = \Validator::make($this->request->all(), [ 'id' => 'required|exists:tickets,id', @@ -1192,7 +1163,7 @@ class ApiController extends Controller } $id = $this->request->input('id'); if (!$this->model->where('id', $id)->first()) { - $error = 'There is no Ticket as ticket id: '.$id; + $error = 'There is no Ticket as ticket id: ' . $id; return response()->json(compact('error')); } @@ -1200,10 +1171,45 @@ class ApiController extends Controller $join->on('users.id', '=', 'tickets.user_id') ->where('tickets.id', '=', $id); }); - $response = $this->differenciateHelpTopic($query); + + + $response = $this->differenciateHelpTopic($query) + ->leftJoin('department','tickets.dept_id','=',"department.id") + ->leftJoin('ticket_priority','tickets.priority_id','=','ticket_priority.priority_id') + ->leftJoin('ticket_status','tickets.status','=','ticket_status.id') + ->leftJoin('sla_plan','tickets.sla','=','sla_plan.id') + ->leftJoin('ticket_source','tickets.source','=','ticket_source.id'); //$select = 'users.email','users.user_name','users.first_name','users.last_name','tickets.id','ticket_number','num_sequence','user_id','priority_id','sla','max_open_ticket','captcha','status','lock_by','lock_at','source','isoverdue','reopened','isanswered','is_deleted', 'closed','is_transfer','transfer_at','reopened_at','duedate','closed_at','last_message_at'; - $result = $response->addSelect('users.email', 'users.user_name', 'users.first_name', 'users.last_name', 'tickets.id', 'ticket_number', 'user_id', 'priority_id', 'sla', 'status', 'lock_by', 'lock_at', 'source', 'isoverdue', 'reopened', 'isanswered', 'is_deleted', 'closed', 'reopened_at', 'duedate', 'closed_at', 'tickets.created_at', 'tickets.updated_at')->first(); + $result = $response->addSelect( + 'users.email', + 'users.user_name', + 'users.first_name', + 'users.last_name', + 'tickets.id', + 'ticket_number', + 'user_id', + 'ticket_priority.priority_id', + 'ticket_priority.priority as priority_name', + 'department.name as dept_name', + 'ticket_status.name as status_name', + 'sla_plan.name as sla_name', + 'ticket_source.name as source_name', + 'sla_plan.id as sla', + 'ticket_status.id as status', + 'lock_by', + 'lock_at', + 'ticket_source.id as source', + 'isoverdue', + 'reopened', + 'isanswered', + 'is_deleted', + 'closed', + 'reopened_at', + 'duedate', + 'closed_at', + 'tickets.created_at', + 'tickets.updated_at')->first(); return response()->json(compact('result')); } catch (\Exception $e) { @@ -1219,8 +1225,7 @@ class ApiController extends Controller } } - public function createPagination($array, $perPage) - { + public function createPagination($array, $perPage) { try { //Get current page form url e.g. &page=6 $currentPage = LengthAwarePaginator::resolveCurrentPage(); @@ -1248,8 +1253,7 @@ class ApiController extends Controller } } - public function collaboratorSearch() - { + public function collaboratorSearch() { $this->validate($this->request, ['term' => 'required']); try { $emails = $this->ticket->autosearch(); @@ -1259,7 +1263,7 @@ class ApiController extends Controller foreach ($emails as $key => $email) { $user_model = $user->where('email', $email)->first(); //return $user_model; - $users[$key]['name'] = $user_model->first_name.' '.$user_model->last_name; + $users[$key]['name'] = $user_model->first_name . ' ' . $user_model->last_name; $users[$key]['email'] = $email; $users[$key]['avatar'] = $this->avatarUrl($email); } @@ -1276,13 +1280,12 @@ class ApiController extends Controller } } - public function avatarUrl($email) - { + public function avatarUrl($email) { try { $user = new User(); $user = $user->where('email', $email)->first(); if ($user->profile_pic) { - $url = url('uploads/profilepic/'.$user->profile_pic); + $url = url('uploads/profilepic/' . $user->profile_pic); } else { $url = \Gravatar::src($email); } @@ -1294,11 +1297,10 @@ class ApiController extends Controller } } - public function addCollaboratorForTicket() - { + public function addCollaboratorForTicket() { try { $v = \Validator::make(\Input::get(), [ - 'email' => 'required|email|unique:users', + 'email' => 'required|email|unique:users', 'ticket_id' => 'required', ] ); @@ -1325,8 +1327,7 @@ class ApiController extends Controller } } - public function getCollaboratorForTicket() - { + public function getCollaboratorForTicket() { try { $v = \Validator::make(\Input::get(), [ 'ticket_id' => 'required', @@ -1355,12 +1356,11 @@ class ApiController extends Controller } } - public function deleteCollaborator() - { + public function deleteCollaborator() { try { $v = \Validator::make(\Input::get(), [ 'ticketid' => 'required', - 'email' => 'required', + 'email' => 'required', ] ); if ($v->fails()) { @@ -1380,8 +1380,7 @@ class ApiController extends Controller } } - public function dependency() - { + public function dependency() { try { $department = $this->department->select('name', 'id')->get()->toArray(); $sla = $this->slaPlan->select('name', 'id')->get()->toArray(); @@ -1392,7 +1391,7 @@ class ApiController extends Controller $status = \DB::table('ticket_status')->select('name', 'id')->get(); $source = \DB::table('ticket_source')->select('name', 'id')->get(); $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, - 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source, ]; + 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source,]; return response()->json(compact('result')); } catch (\Exception $e) { @@ -1404,8 +1403,7 @@ class ApiController extends Controller } } - public function differenciateHelpTopic($query) - { + public function differenciateHelpTopic($query) { $ticket = $query->first(); $check = 'department'; if ($ticket) { @@ -1419,16 +1417,16 @@ class ApiController extends Controller return $query->select('tickets.dept_id'); } } + return $query; } - public function getSystem($check, $query) - { + public function getSystem($check, $query) { switch ($check) { case 'department': return $query->select('tickets.dept_id'); case 'helpTopic': return $query->select('tickets.help_topic_id'); - default: + default : return $query->select('tickets.dept_id'); } } @@ -1440,11 +1438,10 @@ class ApiController extends Controller * * @return type json */ - public function register(Request $request) - { + public function register(Request $request) { try { $v = \Validator::make($request->all(), [ - 'email' => 'required|email|unique:users', + 'email' => 'required|email|unique:users', 'password' => 'required|min:6', ]); if ($v->fails()) { @@ -1458,7 +1455,7 @@ class ApiController extends Controller $password = \Hash::make($request->input('password')); $role = $request->input('role'); if ($auth->role == 'agent') { - $role = 'user'; + $role = "user"; } $user = new User(); $user->password = $password; @@ -1466,7 +1463,6 @@ class ApiController extends Controller $user->email = $email; $user->role = $role; $user->save(); - return response()->json(compact('user')); } catch (\Exception $e) { $error = $e->getMessage(); @@ -1474,4 +1470,5 @@ class ApiController extends Controller return response()->json(compact('error')); } } + } diff --git a/app/Http/Controllers/Api/v1/InstallerApiController.php b/app/Http/Controllers/Api/v1/InstallerApiController.php index a4d82c4b2..60855d60b 100644 --- a/app/Http/Controllers/Api/v1/InstallerApiController.php +++ b/app/Http/Controllers/Api/v1/InstallerApiController.php @@ -98,7 +98,7 @@ class InstallerApiController extends Controller $ENV['QUEUE_DRIVER'] = 'sync'; $config = ''; - + foreach ($ENV as $key => $val) { $config .= "{$key}={$val}\n"; } diff --git a/app/Http/Controllers/Api/v1/TestController.php b/app/Http/Controllers/Api/v1/TestController.php deleted file mode 100644 index ab961cad1..000000000 --- a/app/Http/Controllers/Api/v1/TestController.php +++ /dev/null @@ -1,491 +0,0 @@ -server = 'http://'.$_SERVER['HTTP_HOST'].$server['path'].'/'; - } - - public static function callGetApi($url) - { - //dd($url); - $curl = curl_init($url); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_HEADER, 0); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($curl); - - if (curl_errno($curl)) { - echo 'error:'.curl_error($curl); - } - - return $response; - curl_close($curl); - } - - public static function callPostApi($url, $data) - { - //dd($url); - $curl = curl_init($url); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_HEADER, 0); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $data); - $response = curl_exec($curl); - - if (curl_errno($curl)) { - echo 'error:'.curl_error($curl); - } - - return $response; - curl_close($curl); - } - - public function ticketReply() - { - - //$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png'); - - $data = [ - - 'ticket_ID' => '1', - 'reply_content' => 'reply for the ticket id', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', -// 'attachments' => [ -// [ -// 'name' => 'ladybird', -// 'size' => '26398', -// 'type' => 'png', -// 'file' => $file, -// ], -// [ -// 'name' => 'ladybird', -// 'size' => '26398', -// 'type' => 'png', -// 'file' => $file, -// ] -// ], - ]; - $data = http_build_query($data, '', '&'); - - $url = $this->server.'helpdesk/reply?token='.\Config::get('app.token'); - - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function createTicket() - { - - //$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png'); - - $data = [ - 'user_id' => 1, - 'subject' => 'Api create via faveo api', - 'body' => 'Test me when call api', - 'helptopic' => '1', - 'sla' => '1', - 'priority' => '1', - 'headers' => [0 => 'vijaycodename47@gmail.com'], - 'dept' => '1', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - /* if attachment */ -// 'attachments' => [ -// [ -// 'name' => 'ladybird', -// 'size' => '26398', -// 'type' => 'png', -// 'file' => $file, -// ], -// [ -// 'name' => 'ladybird', -// 'size' => '26398', -// 'type' => 'png', -// 'file' => $file, -// ] -// ], - ]; - $data = http_build_query($data, '', '&'); - - $url = $this->server.'helpdesk/create?token='.\Config::get('app.token'); - - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function generateToken() - { - $data = [ - //'email'=>'vijaycodename47@gmail.com', - 'username' => 'vijay', - 'password' => 'manjapra', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - - $data = http_build_query($data, '', '&'); - - $url = $this->server.'authenticate'; - //dd($url); - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function createUser() - { - $data = [ - 'email' => 'vijaycodename@gmail.com', - 'password' => 'manjapra', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - - $data = http_build_query($data, '', '&'); - $url = $this->server.'register'; - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function getAuthUser() - { - $url = $this->server.'authenticate/user?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function editTicket() - { - $data = [ - 'ticket_id' => '13', - 'subject' => 'Api editing ticket via faveo api', - 'sla_plan' => '2', - 'help_topic' => '2', - 'ticket_source' => '2', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - 'ticket_priority' => '2', - ]; - - $data = http_build_query($data, '', '&'); - $url = $this->server.'helpdesk/edit?token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function deleteTicket() - { - $data = [ - 'ticket_id' => [11], - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - - $data = http_build_query($data, '', '&'); - $url = $this->server.'helpdesk/delete?token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function openedTickets() - { - $url = $this->server.'helpdesk/open?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function unassignedTickets() - { - //dd('dsdf'); - $url = $this->server.'helpdesk/unassigned?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - //dd($respose); - return $respose; - } - - public function closeTickets() - { - $url = $this->server.'helpdesk/closed?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getAgents() - { - $url = $this->server.'helpdesk/agents?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getTeams() - { - $url = $this->server.'helpdesk/teams?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function assignTicket() - { - $data = [ - 'ticket_id' => 1, - 'user' => 'vijay.sebastian@ladybirdweb.com', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($data, '', '&'); - $url = $this->server.'helpdesk/assign?token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function getCustomers() - { - $search = [ - 'search' => 'vij', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($search, '', '&'); - $url = $this->server.'helpdesk/customers?token='.\Config::get('app.token'); - $url = $url.'&'.$data; - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getCustomer() - { - $search = [ - 'user_id' => '1', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($search, '', '&'); - $url = $this->server.'helpdesk/customer?token='.\Config::get('app.token'); - $url = $url.'&'.$data; - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getSearch() - { - $search = [ - 'search' => 'api', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($search, '', '&'); - $url = $this->server.'helpdesk/ticket-search?token='.\Config::get('app.token'); - $url = $url.'&'.$data; - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function ticketThreads() - { - $search = [ - 'id' => '1', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($search, '', '&'); - $url = $this->server.'helpdesk/ticket-thread?token='.\Config::get('app.token'); - $url = $url.'&'.$data; - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function url() - { - $search = [ - 'url' => 'http://localhost/faveo-helpdesk-github/public/', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($search, '', '&'); - $url = $this->server.'helpdesk/url?token='.\Config::get('app.token'); - $url = $url.'&'.$data; - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function generateApiKey() - { - $url = $this->server.'helpdesk/api_key?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getHelpTopic() - { - $url = $this->server.'helpdesk/help-topic?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getSlaPlan() - { - $url = $this->server.'helpdesk/sla-plan?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getPriority() - { - $url = $this->server.'helpdesk/priority?api_key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getDepartment() - { - $url = $this->server.'helpdesk/department?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function getTickets() - { - $url = $this->server.'helpdesk/tickets?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function inbox() - { - $url = $this->server.'helpdesk/inbox?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function internalNote() - { - $data = [ - 'ticketid' => '1', - 'userid' => 1, - 'body' => 'Testing the api internal note', - 'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN', - ]; - $data = http_build_query($data, '', '&'); - $url = $this->server.'helpdesk/internal-note?token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callPostApi($url, $data); - - return $respose; - } - - public function trash() - { - $url = $this->server.'helpdesk/trash?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } - - public function myTickets() - { - try { - $url = $this->server.'helpdesk/my-tickets?user_id=1&api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } catch (\Exception $e) { - $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); - - return response()->json(compact('error', 'file', 'line')); - } - } - - public function getTicketById() - { - try { - $url = $this->server.'helpdesk/my-tickets?id=1&api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - - return $respose; - } catch (\Exception $e) { - $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); - - return response()->json(compact('error', 'file', 'line')); - } - } - - public function getCustomersWith() - { - try { - //dd($this->server); - $url = $this->server.'helpdesk/customers-custom?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token'); - $_this = new self(); - $respose = $_this->callGetApi($url); - dd($respose); - - return $respose; - } catch (\Exception $e) { - $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); - - return response()->json(compact('error', 'file', 'line')); - } - } -} diff --git a/app/Http/Controllers/Api/v1/TokenAuthController.php b/app/Http/Controllers/Api/v1/TokenAuthController.php index 23a56dedb..c1974518e 100644 --- a/app/Http/Controllers/Api/v1/TokenAuthController.php +++ b/app/Http/Controllers/Api/v1/TokenAuthController.php @@ -50,7 +50,7 @@ class TokenAuthController extends Controller //$credentials = $request->only('email', 'password'); try { - if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active' => 1])) { + if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password,'active'=>1])) { return response()->json(['error' => 'invalid_credentials', 'status_code' => 401]); } } catch (JWTException $e) { diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 78ad006e2..7d8093bba 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -3,29 +3,31 @@ namespace App\Http\Controllers\Auth; // controllers -use App\Http\Controllers\Admin\helpdesk\SocialMedia\SocialMediaController; use App\Http\Controllers\Common\PhpMailController; -// requests +use App\Http\Controllers\Common\SettingsController; use App\Http\Controllers\Controller; +// requests use App\Http\Requests\helpdesk\LoginRequest; -use App\Http\Requests\helpdesk\OtpVerifyRequest; use App\Http\Requests\helpdesk\RegisterRequest; -use App\Model\helpdesk\Settings\CommonSettings; -use App\Model\helpdesk\Settings\Plugin; +use App\Http\Requests\helpdesk\OtpVerifyRequest; use App\Model\helpdesk\Settings\Security; +use App\Model\helpdesk\Settings\CommonSettings; use App\Model\helpdesk\Ticket\Ticket_Thread; -// classes use App\Model\helpdesk\Ticket\Tickets; -use App\Model\helpdesk\Utility\Otp; +use App\Model\helpdesk\Settings\Plugin; + +// classes use App\User; +use App\Model\helpdesk\Utility\Otp; use Auth; -use DateTime; use DB; use Hash; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; -use Input; use Lang; +use DateTime; +use Input; use Socialite; +use App\Http\Controllers\Admin\helpdesk\SocialMedia\SocialMediaController; /** * --------------------------------------------------- @@ -37,8 +39,8 @@ use Socialite; * * @author Ladybird */ -class AuthController extends Controller -{ +class AuthController extends Controller { + use AuthenticatesAndRegistersUsers; /* to redirect after login */ @@ -59,15 +61,14 @@ class AuthController extends Controller * * @return void */ - public function __construct(PhpMailController $PhpMailController, SocialMediaController $social) - { + public function __construct(PhpMailController $PhpMailController, SocialMediaController $social) { $this->PhpMailController = $PhpMailController; $social->configService(); $this->middleware('guest', ['except' => ['getLogout', 'verifyOTP', 'redirectToProvider']]); } - public function redirectToProvider($provider, $redirect = '') - { + public function redirectToProvider($provider, $redirect = '') { + if ($redirect !== '') { $this->setSession($provider, $redirect); } @@ -77,8 +78,7 @@ class AuthController extends Controller return $s; } - public function handleProviderCallback($provider) - { + public function handleProviderCallback($provider) { try { //notice we are not doing any validation, you should do it $this->changeRedirect(); @@ -91,24 +91,25 @@ class AuthController extends Controller if ($user->nickname) { $username = $user->nickname; } - if (!$first_name) { + if(!$first_name){ $first_name = $username; } $data = [ 'first_name' => $first_name, - 'email' => $user->getEmail(), - 'user_name' => $username, - 'role' => 'user', - 'active' => 1, + 'email' => $user->getEmail(), + 'user_name' => $username, + 'role' => 'user', + 'active' => 1, ]; - $user = User::where('email', $data['email'])->first(); - if (!$user) { - $user = User::where('user_name', $data['user_name'])->first(); + $user = User::where('email',$data['email'])->first(); + if(!$user){ + $user = User::where('user_name',$data['user_name'])->first(); } - if (!$user) { - $user = User::firstOrCreate($data); + if(!$user){ + $user = User::firstOrCreate($data); } Auth::login($user); + } //after login redirecting to home page return redirect('/'); @@ -122,8 +123,7 @@ class AuthController extends Controller * * @return type Response */ - public function getRegister(CommonSettings $settings) - { + public function getRegister(CommonSettings $settings) { // Event for login $settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first(); $email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first(); @@ -148,63 +148,59 @@ class AuthController extends Controller * * @return type Response */ - public function postRegister(User $user, RegisterRequest $request) - { + public function postRegister(User $user, RegisterRequest $request) { try { - $request_array = $request->input(); - $password = Hash::make($request->input('password')); - $user->password = $password; - $name = $request->input('full_name'); - $user->first_name = $name; - if ($request_array['email'] == '') { - $user->email = null; - } else { - $user->email = $request->input('email'); - } - if ($request_array['mobile'] == '') { - $user->mobile = null; - } else { - $user->mobile = $request->input('mobile'); - } - if ($request_array['code'] == '') { - $user->country_code = 0; - } else { - $user->country_code = $request->input('code'); - } - if ($request_array['email'] != '') { - $user->user_name = $request->input('email'); - } else { - $user->user_name = $request->input('mobile'); - } - $user->role = 'user'; - $code = str_random(60); - $user->remember_token = $code; - $user->save(); - $message12 = ''; - $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); - // Event for login - \Event::fire(new \App\Events\LoginEvent($request)); - if ($request_array['email'] != '') { - $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/'.$code)]); - } + $request_array = $request->input(); + $password = Hash::make($request->input('password')); + $user->password = $password; + $name = $request->input('full_name'); + $user->first_name = $name; + if ($request_array['email'] == '') { + $user->email = null; + } else { + $user->email = $request->input('email'); + } + if ($request_array['mobile'] == '') { + $user->mobile = null; + } else { + $user->mobile = $request->input('mobile'); + } + if ($request_array['code'] == '') { + $user->country_code = 0; + } else { + $user->country_code = $request->input('code'); + } + if ($request_array['email'] != '') { + $user->user_name = $request->input('email'); + } else { + $user->user_name = $request->input('mobile'); + } + $user->role = 'user'; + $code = str_random(60); + $user->remember_token = $code; + $user->save(); + $message12 = ''; + $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); + $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); + // Event for login + \Event::fire(new \App\Events\LoginEvent($request)); + $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]); if ($settings->status == 1 || $settings->status == '1') { - if (count($sms) > 0) { - if ($sms->status == 1 || $sms->status == '1') { + if(count($sms) > 0) { + if($sms->status == 1 || $sms->status == '1') { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_and_moble'); } else { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup'); } } else { - $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup'); + $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail'); } } else { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail'); } - - return redirect('home')->with('success', $message12); + return redirect('home')->with('success', $message12); } catch (\Exception $e) { - return redirect()->back()->with('fails', $e->getMessage()); + return redirect()->back()->with('fails', $e->getMessage()); } } @@ -215,15 +211,13 @@ class AuthController extends Controller * * @return type redirect */ - public function accountActivate($token) - { + public function accountActivate($token) { $user = User::where('remember_token', '=', $token)->first(); if ($user) { $user->active = 1; $user->remember_token = null; $user->save(); $this->openTicketAfterVerification($user->id); - return redirect('/auth/login')->with('status', 'Acount activated. Login to start'); } else { return redirect('/auth/login')->with('fails', 'Invalid Token'); @@ -238,8 +232,7 @@ class AuthController extends Controller * * @return type Response */ - public function getMail($token, User $user) - { + public function getMail($token, User $user) { $user = $user->where('remember_token', $token)->where('active', 0)->first(); if ($user) { $user->active = 1; @@ -256,10 +249,9 @@ class AuthController extends Controller * * @return type Response */ - public function getLogin() - { + public function getLogin() { $directory = base_path(); - if (file_exists($directory.DIRECTORY_SEPARATOR.'.env')) { + if (file_exists($directory . DIRECTORY_SEPARATOR . '.env')) { if (Auth::user()) { if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') { return \Redirect::route('dashboard'); @@ -296,7 +288,7 @@ class AuthController extends Controller } $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; $result = $this->confirmIPAddress($value, $usernameinput); - + // If attempts > 3 and time < 30 minutes $security = Security::whereId('1')->first(); if ($result == 1) { @@ -309,15 +301,15 @@ class AuthController extends Controller return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.not-registered'), + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), + ])->with(['error' => Lang::get('lang.not-registered'), 'referer' => $referer, ]); } //if user exists $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - + if ($settings->status == '1' || $settings->status == 1) { // check for otp verification setting // setting is enabled $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); @@ -328,7 +320,7 @@ class AuthController extends Controller if (!$check_active->active) { //check account is active or not // account is not active show verify otp window if ($check_active->mobile) { //check user has mobile or not - // user has mobile number return verify OTP screen + // user has mobile number return verify OTP screen return \Redirect::route('otp-verification') ->withInput($request->input()) ->with(['values' => $request->input(), @@ -337,7 +329,7 @@ class AuthController extends Controller 'number' => $check_active->mobile, 'code' => $check_active->country_code, ]); } else { - goto a; //attenmpt login (be careful while using goto statements) + goto a; //attenmpt login (be careful while using goto statements) } } else { goto a; //attenmpt login (be careful while using goto statements) @@ -392,15 +384,14 @@ class AuthController extends Controller if ($request->input('referer')) { return \Redirect::route($request->input('referer')); } - return \Redirect::route('/'); } else { return redirect()->intended($this->redirectPath()); } } + } } - return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ @@ -418,8 +409,7 @@ class AuthController extends Controller * * @return type Response */ - public function addLoginAttempt($value, $field) - { + public function addLoginAttempt($value, $field) { $result = DB::table('login_attempts')->where('IP', '=', $value)->first(); $data = $result; $security = Security::whereId('1')->first(); @@ -427,15 +417,15 @@ class AuthController extends Controller if ($data) { $attempts = $data->Attempts + 1; if ($attempts == $apt) { - // $result = DB::select('UPDATE login_attempts SET Attempts='.$attempts.", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'"); - $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts, 'LastLogin' => date('Y-m-d H:i:s')]); +// $result = DB::select('UPDATE login_attempts SET Attempts='.$attempts.", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'"); + $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts, 'LastLogin' => Date('Y-m-d H:i:s')]); } else { $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts]); // $result = DB::select("UPDATE login_attempts SET Attempts=".$attempts." WHERE IP = '$value' OR User = '$field'"); } } else { - // $result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())"); - $result = DB::table('login_attempts')->update(['Attempts' => 1, 'User' => $field, 'IP' => $value, 'LastLogin' => date('Y-m-d H:i:s')]); +// $result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())"); + $result = DB::table('login_attempts')->update(['Attempts' => 1, 'User' => $field, 'IP' => $value, 'LastLogin' => Date('Y-m-d H:i:s')]); } } @@ -446,8 +436,7 @@ class AuthController extends Controller * * @return type Response */ - public function clearLoginAttempts($value, $field) - { + public function clearLoginAttempts($value, $field) { $data = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['attempts' => '0']); return $data; @@ -460,14 +449,13 @@ class AuthController extends Controller * * @return type Response */ - public function confirmIPAddress($value, $field) - { + public function confirmIPAddress($value, $field) { $security = Security::whereId('1')->first(); $time = $security->lockout_period; $max_attempts = $security->backlist_threshold; $table = 'login_attempts'; - $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL '.$time.' MINUTE)>NOW() then 1 else 0 end) as Denied '. - ' FROM '.$table." WHERE IP = '$value' OR User = '$field'"); + $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL ' . $time . ' MINUTE)>NOW() then 1 else 0 end) as Denied ' . + ' FROM ' . $table . " WHERE IP = '$value' OR User = '$field'"); $data = $result; //Verify that at least one login attempt is in database if (!$data) { @@ -478,7 +466,6 @@ class AuthController extends Controller return 1; } else { $this->clearLoginAttempts($value, $field); - return 0; } } @@ -491,20 +478,16 @@ class AuthController extends Controller * * @return type string */ - protected function getFailedLoginMessage() - { + protected function getFailedLoginMessage() { return Lang::get('lang.this_field_do_not_match_our_records'); } /** *@category function to show verify OTP page - * *@param null - * *@return response|view */ - public function getVerifyOTP() - { + public function getVerifyOTP() { if (\Session::has('values')) { return view('auth.otp-verify'); } else { @@ -514,13 +497,10 @@ class AuthController extends Controller /** *@category function to verify OTP - * *@param $request - * *@return int|string */ - public function verifyOTP(LoginRequest $request) - { + public function verifyOTP(LoginRequest $request) { $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email')) ->orWhere('user_name', '=', $request->input('email'))->first(); $otp_length = strlen($request->input('otp')); @@ -530,10 +510,10 @@ class AuthController extends Controller $otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id) ->first(); if ($otp != null) { - if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) { + if (($otp_length == 6 && !preg_match("/[a-z]/i", $request->input('otp')))) { $otp2 = Hash::make($request->input('otp')); - $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); - $date2 = date('Y-m-d h:i:sa'); + $date1 = date_format($otp->updated_at, "Y-m-d h:i:sa"); + $date2 = date("Y-m-d h:i:sa"); $time1 = new DateTime($date2); $time2 = new DateTime($date1); $interval = $time1->diff($time2); @@ -546,7 +526,6 @@ class AuthController extends Controller User::where('id', '=', $user->id) ->update(['active' => 1]); $this->openTicketAfterVerification($user->id); - return $this->postLogin($request); } else { $message = Lang::get('lang.otp-not-matched'); @@ -559,46 +538,37 @@ class AuthController extends Controller $message = Lang::get('lang.otp-not-matched'); } } - return \Redirect::route('otp-verification') ->withInput($request->input()) ->with(['values' => $request->input(), - 'number' => $user->mobile, - 'name' => $user->user_name, - 'fails' => $message, ]); + 'number' => $user->mobile, + 'name' => $user->user_name, + 'fails' => $message]); } - public function resendOTP(OtpVerifyRequest $request) - { + public function resendOTP(OtpVerifyRequest $request) { if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) { $message = Lang::get('lang.opt-can-not-be-verified'); - return $message; } else { - $sms = DB::table('sms')->get(); + $sms =DB::table('sms')->get(); if (count($sms) > 0) { \Event::fire(new \App\Events\LoginEvent($request)); - return 1; } else { $message = Lang::get('lang.opt-can-not-be-verified'); - return $message; - } + } } } /** * @category function to change ticket status when user verifies his account - * * @param int $id => user_id - * * @return null - * * @author manish.verma@ladybirdweb.com */ - public function openTicketAfterVerification($id) - { + public function openTicketAfterVerification($id) { // dd($id); $ticket = Tickets::select('id') ->where(['user_id' => $id, 'status' => 6]) @@ -609,23 +579,23 @@ class AuthController extends Controller foreach ($ticket as $value) { $ticket_id = $value->id; Ticket_Thread::where('ticket_id', '=', $ticket_id) - ->update(['updated_at' => date('Y-m-d H:i:s')]); + ->update(["updated_at" => date('Y-m-d H:i:s')]); } } } - public function changeRedirect() - { + + public function changeRedirect() { $provider = \Session::get('provider'); - $url = \Session::get($provider.'redirect'); + $url = \Session::get($provider . 'redirect'); \Config::set("services.$provider.redirect", $url); } - public function setSession($provider, $redirect) - { + public function setSession($provider, $redirect) { $url = url($redirect); \Session::set('provider', $provider); - \Session::set($provider.'redirect', $url); + \Session::set($provider . 'redirect', $url); $this->changeRedirect(); } + } diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 2a3e580f7..900265f78 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth; // controllers use App\Http\Controllers\Common\PhpMailController; +use App\Http\Controllers\Common\SettingsController; use App\Http\Controllers\Controller; // request use App\User; @@ -50,9 +51,10 @@ class PasswordController extends Controller */ public function postEmail(Request $request) { + try{ $date = date('Y-m-d H:i:s'); $this->validate($request, ['email' => 'required']); - \Event::fire('reset.password', []); + \Event::fire('reset.password',array()); $user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first(); if (isset($user)) { $user1 = $user->email; @@ -66,9 +68,9 @@ class PasswordController extends Controller } else { $create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]); } - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->first_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/'.$code)], true); + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->first_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/'.$code)],true); if ($user->mobile != '' && $user->mobile != null) { - if ($user->first_name) { + if($user->first_name) { $name = $user->first_name; } else { $name = $user->user_name; @@ -77,25 +79,27 @@ class PasswordController extends Controller 'url' => url('password/reset/'.$code), 'name' => $name, 'mobile' => $user->mobile, - 'code' => $user->country_code, ]; - \Event::fire('reset.password2', [$value]); + 'code' => $user->country_code]; + \Event::fire('reset.password2',array($value)); } - return redirect()->back()->with('status', Lang::get('lang.we_have_e-mailed_your_password_reset_link')); } else { return redirect()->back()->with('fails', Lang::get("lang.we_can't_find_a_user_with_that_e-mail_address")); } + } catch (\Exception $e) { + return redirect()->back()->with('fails', $e->getMessage()); + } } /** * Reset the given user's password. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function reset(Request $request) { + $this->validate( $request, $this->getResetValidationRules(), @@ -107,25 +111,26 @@ class PasswordController extends Controller $email = $credentials['email']; $password = $credentials['password']; $token = $credentials['token']; - $response = 'fails'; - $password_tokens = \DB::table('password_resets')->where('email', '=', $email)->first(); - if ($password_tokens) { - if ($password_tokens->token == $token) { + $response = "fails"; + $password_tokens = \DB::table('password_resets')->where('email','=',$email)->first(); + if($password_tokens){ + if($password_tokens->token == $token){ $users = new User(); - $user = $users->where('email', $email)->first(); - if ($user) { + $user = $users->where('email',$email)->first(); + if($user){ $user->password = \Hash::make($password); $user->save(); - $response = 'success'; + $response = "success"; } else { - $response = 'fails'; + $response = "fails"; } } } - if ($response == 'success') { + if ($response == "success") { return redirect('/auth/login')->with('status', Lang::get('lang.password-reset-successfully')); } else { return redirect('/home')->with('fails', Lang::get('lang.password-can-not-reset')); } } + } diff --git a/app/Http/Controllers/Client/helpdesk/FormController.php b/app/Http/Controllers/Client/helpdesk/FormController.php index 15de23f29..8f387aa07 100644 --- a/app/Http/Controllers/Client/helpdesk/FormController.php +++ b/app/Http/Controllers/Client/helpdesk/FormController.php @@ -11,14 +11,15 @@ use App\Model\helpdesk\Agent\Department; // models use App\Model\helpdesk\Form\Fields; use App\Model\helpdesk\Manage\Help_topic; -use App\Model\helpdesk\Settings\CommonSettings; + use App\Model\helpdesk\Settings\System; use App\Model\helpdesk\Settings\Ticket; +use App\Model\helpdesk\Settings\CommonSettings; use App\Model\helpdesk\Ticket\Ticket_attachments; -use App\Model\helpdesk\Ticket\Ticket_Priority; use App\Model\helpdesk\Ticket\Ticket_source; use App\Model\helpdesk\Ticket\Ticket_Thread; use App\Model\helpdesk\Ticket\Tickets; +use App\Model\helpdesk\Ticket\Ticket_Priority; use App\Model\helpdesk\Utility\CountryCode; use App\User; use Exception; @@ -35,16 +36,15 @@ use Redirect; * * @author Ladybird */ -class FormController extends Controller -{ +class FormController extends Controller { + /** * Create a new controller instance. * Constructor to check. * * @return void */ - public function __construct(TicketWorkflowController $TicketWorkflowController) - { + public function __construct(TicketWorkflowController $TicketWorkflowController) { $this->middleware('board'); // creating a TicketController instance $this->TicketWorkflowController = $TicketWorkflowController; @@ -57,31 +57,29 @@ class FormController extends Controller * * @return type */ - public function getForm(Help_topic $topic, CountryCode $code) - { + public function getForm(Help_topic $topic, CountryCode $code) { if (\Config::get('database.install') == '%0%') { return \Redirect::route('licence'); } $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - $email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first(); + $email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first(); if (!\Auth::check() && ($settings->status == 1 || $settings->status == '1')) { - return redirect('auth/login')->with(['login_require' => 'Please login to your account for submitting a ticket', 'referer' => 'form']); + return redirect('auth/login')->with(['login_require'=> 'Please login to your account for submitting a ticket', 'referer' => 'form']); } - $location = GeoIP::getLocation(); - $phonecode = $code->where('iso', '=', $location->iso_code)->first(); - if (System::first()->status == 1) { - $topics = $topic->get(); - $codes = $code->get(); - if ($phonecode->phonecode) { - $phonecode = $phonecode->phonecode; + $location = GeoIP::getLocation(); + $phonecode = $code->where('iso', '=', $location->iso_code)->first(); + if (System::first()->status == 1) { + $topics = $topic->get(); + $codes = $code->get(); + if ($phonecode->phonecode) { + $phonecode = $phonecode->phonecode; + } else { + $phonecode = ""; + } + return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'email_mandatory'))->with('phonecode', $phonecode); } else { - $phonecode = ''; + return \Redirect::route('home'); } - - return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'email_mandatory'))->with('phonecode', $phonecode); - } else { - return \Redirect::route('home'); - } } /** @@ -92,43 +90,43 @@ class FormController extends Controller * * @return type string */ - public function postForm($id, Help_topic $topic) - { + public function postForm($id, Help_topic $topic) { if ($id != 0) { $helptopic = $topic->where('id', '=', $id)->first(); $custom_form = $helptopic->custom_form; $values = Fields::where('forms_id', '=', $custom_form)->get(); if (!$values) { + } if ($values) { foreach ($values as $form_data) { - if ($form_data->type == 'select') { + if ($form_data->type == "select") { $form_fields = explode(',', $form_data->value); - $var = ''; + $var = ""; foreach ($form_fields as $form_field) { - $var .= ''; + $var .= ''; } - echo '
    '; - } elseif ($form_data->type == 'radio') { + echo '
    '; + } elseif ($form_data->type == "radio") { $type2 = $form_data->value; $vals = explode(',', $type2); - echo '

    '; + echo '

    '; foreach ($vals as $val) { - echo ' '.$form_data->value.'       '; + echo ' ' . $form_data->value . '       '; } - echo '
    '; - } elseif ($form_data->type == 'textarea') { + echo "
    "; + } elseif ($form_data->type == "textarea") { $type3 = $form_data->value; - echo '

    '; - } elseif ($form_data->type == 'checkbox') { + echo '

    '; + } elseif ($form_data->type == "checkbox") { $type4 = $form_data->value; $checks = explode(',', $type4); - echo '

    '; + echo '

    '; foreach ($checks as $check) { - echo '  '.$check; + echo '  ' . $check; } } else { - echo '
    '; + echo '
    '; } } echo '

    '; @@ -144,16 +142,15 @@ class FormController extends Controller * @param type Request $request * @param type User $user */ - public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code) - { - $form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token', 'mobile', 'Code', 'priority'); + public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code) { + $form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token','mobile','Code', 'priority'); $name = $request->input('Name'); $phone = $request->input('Phone'); if ($request->input('Email')) { - if ($request->input('Email')) { + if($request->input('Email')) { $email = $request->input('Email'); } else { - $email = null; + $email = null; } } else { $email = null; @@ -168,18 +165,18 @@ class FormController extends Controller } $status = $ticket_settings->first()->status; $helptopic = $request->input('helptopic'); - $helpTopicObj = Help_topic::where('id', '=', $helptopic); - if ($helpTopicObj->exists() && ($helpTopicObj->value('status') == 1)) { + $helpTopicObj = Help_topic::where('id','=', $helptopic); + if($helpTopicObj->exists() && ($helpTopicObj->value('status')==1)){ $department = $helpTopicObj->value('department'); - } else { - $defaultHelpTopicID = Ticket::where('id', '=', '1')->first()->help_topic; - $department = Help_topic::where('id', '=', $defaultHelpTopicID)->value('department'); + }else{ + $defaultHelpTopicID = Ticket::where('id', '=', '1')->first()->help_topic; + $department = Help_topic::where('id','=', $defaultHelpTopicID)->value('department'); } $sla = $ticket_settings->first()->sla; - + // $priority = $ticket_settings->first()->priority; - $default_priority = Ticket_Priority::where('is_default', '=', 1)->first(); - $user_priority = CommonSettings::select('status')->where('option_name', '=', 'user_priority')->first(); + $default_priority = Ticket_Priority::where('is_default','=',1)->first(); + $user_priority = CommonSettings::where('option_name','=','user_priority')->first(); if (!($request->input('priority'))) { $priority = $default_priority->priority_id; } else { @@ -196,8 +193,8 @@ class FormController extends Controller $geoipcode = $code->where('iso', '=', $location->iso_code)->first(); if ($phonecode == null) { $data = [ - 'fails' => Lang::get('lang.country-code-required-error'), - 'phonecode' => $geoipcode->phonecode, + 'fails' => Lang::get('lang.country-code-required-error'), + 'phonecode' => $geoipcode->phonecode, 'country_code_error' => 1, ]; @@ -206,8 +203,8 @@ class FormController extends Controller $code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get(); if (!count($code)) { $data = [ - 'fails' => Lang::get('lang.incorrect-country-code-error'), - 'phonecode' => $geoipcode->phonecode, + 'fails' => Lang::get('lang.incorrect-country-code-error'), + 'phonecode' => $geoipcode->phonecode, 'country_code_error' => 1, ]; @@ -233,7 +230,7 @@ class FormController extends Controller } } // dd($result); - return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is').' '.$result[0].'. '.Lang::get('lang.Please-save-this-for-future-reference')); + return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is') . ' ' . $result[0] . '. ' . Lang::get('lang.Please-save-this-for-future-reference')); } else { return Redirect::back()->withInput($request->except('password'))->with('fails', Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken')); } @@ -247,14 +244,14 @@ class FormController extends Controller * * @return type view */ - public function post_ticket_reply($id, Request $request) - { + public function post_ticket_reply($id, Request $request) { + try { if ($comment != null) { $tickets = Tickets::where('id', '=', $id)->first(); $thread = Ticket_Thread::where('ticket_id', '=', $tickets->id)->first(); - $subject = $thread->title.'[#'.$tickets->ticket_number.']'; + $subject = $thread->title . '[#' . $tickets->ticket_number . ']'; $body = $request->input('comment'); $user_cred = User::where('id', '=', $tickets->user_id)->first(); @@ -288,14 +285,13 @@ class FormController extends Controller } } - public function getCustomForm(Request $request) - { - $html = ''; + public function getCustomForm(Request $request) { + $html = ""; $helptopic_id = $request->input('helptopic'); $helptopics = new Help_topic(); $helptopic = $helptopics->find($helptopic_id); if (!$helptopic) { - throw new Exception('We can not find your request'); + throw new Exception("We can not find your request"); } $custom_form = $helptopic->custom_form; if ($custom_form) { @@ -304,7 +300,7 @@ class FormController extends Controller $form_controller = new \App\Http\Controllers\Admin\helpdesk\FormController($fields, $forms); $html = $form_controller->renderForm($custom_form); } - return $html; } + } diff --git a/app/Http/Controllers/Client/helpdesk/GuestController.php b/app/Http/Controllers/Client/helpdesk/GuestController.php index 0b1281d8d..37229d43c 100644 --- a/app/Http/Controllers/Client/helpdesk/GuestController.php +++ b/app/Http/Controllers/Client/helpdesk/GuestController.php @@ -6,30 +6,30 @@ namespace App\Http\Controllers\Client\helpdesk; use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Controller; // requests -use App\Http\Requests\helpdesk\OtpVerifyRequest; use App\Http\Requests\helpdesk\ProfilePassword; use App\Http\Requests\helpdesk\ProfileRequest; use App\Http\Requests\helpdesk\TicketRequest; -// models use App\Model\helpdesk\Manage\Help_topic; -use App\Model\helpdesk\Settings\CommonSettings; +// models use App\Model\helpdesk\Settings\Company; use App\Model\helpdesk\Settings\System; use App\Model\helpdesk\Ticket\Ticket_Thread; use App\Model\helpdesk\Ticket\Tickets; use App\Model\helpdesk\Utility\CountryCode; +use App\Model\helpdesk\Settings\CommonSettings; +use App\Http\Requests\helpdesk\OtpVerifyRequest; use App\Model\helpdesk\Utility\Otp; use App\User; use Auth; // classes -use DateTime; -use DB; use Exception; use GeoIP; use Hash; use Illuminate\Http\Request; use Input; use Lang; +use DateTime; +use DB; use Socialite; /** @@ -37,15 +37,14 @@ use Socialite; * * @author Ladybird */ -class GuestController extends Controller -{ +class GuestController extends Controller { + /** * Create a new controller instance. * * @return type void */ - public function __construct(PhpMailController $PhpMailController) - { + public function __construct(PhpMailController $PhpMailController) { $this->middleware('board'); $this->PhpMailController = $PhpMailController; // checking authentication @@ -57,17 +56,15 @@ class GuestController extends Controller * * @return type Response */ - public function getProfile(CountryCode $code) - { + public function getProfile(CountryCode $code) { $user = Auth::user(); $location = GeoIP::getLocation(); $phonecode = $code->where('iso', '=', $location->iso_code)->first(); $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); $status = $settings->status; - return view('themes.default1.client.helpdesk.profile', compact('user')) ->with(['phonecode' => $phonecode->phonecode, - 'verify' => $status, ]); + 'verify' => $status]); } /** @@ -78,8 +75,7 @@ class GuestController extends Controller * * @return type Response */ - public function postProfile(ProfileRequest $request) - { + public function postProfile(ProfileRequest $request) { try { // geet authenticated user details $user = Auth::user(); @@ -89,14 +85,14 @@ class GuestController extends Controller $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get(); if (!count($code)) { return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); - } + } $user->country_code = $request->country_code; } $user->fill($request->except('profile_pic', 'mobile')); $user->gender = $request->input('gender'); $user->save(); if (Input::file('profile_pic')) { - // fetching picture name + // fetching picture name $name = Input::file('profile_pic')->getClientOriginalName(); // fetching upload destination path $destinationPath = 'uploads/profilepic'; @@ -113,10 +109,11 @@ class GuestController extends Controller $user->mobile = null; } if ($user->save()) { - return redirect()->back()->with('success', Lang::get('lang.Profile-Updated-sucessfully')); + return redirect()->back()->with('success', Lang::get('lang.Profile-Updated-sucessfully')); } else { return redirect()->back()->route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully')); } + } catch (Exception $e) { return redirect()->back()->route('profile')->with('fails', $e->getMessage()); } @@ -124,10 +121,8 @@ class GuestController extends Controller /** *@category fucntion to check if mobile number is unqique or not - * *@param string $mobile - * - *@return bool true(if mobile exists in users table)/false (if mobile does not exist in user table) + *@return boolean true(if mobile exists in users table)/false (if mobile does not exist in user table) */ public function checkMobile($mobile) { @@ -139,7 +134,6 @@ class GuestController extends Controller return true; } } - return false; } @@ -150,8 +144,7 @@ class GuestController extends Controller * * @return type Response */ - public function getTicket(Help_topic $topic) - { + public function getTicket(Help_topic $topic) { $topics = $topic->get(); return view('themes.default1.client.helpdesk.tickets.form', compact('topics')); @@ -164,8 +157,7 @@ class GuestController extends Controller * * @return type */ - public function getForm(Help_topic $topic) - { + public function getForm(Help_topic $topic) { if (\Config::get('database.install') == '%0%') { return \Redirect::route('licence'); } @@ -187,8 +179,7 @@ class GuestController extends Controller * * @return type Response */ - public function getMyticket() - { + public function getMyticket() { return view('themes.default1.client.helpdesk.mytickets'); } @@ -201,8 +192,7 @@ class GuestController extends Controller * * @return type Response */ - public function thread(Ticket_Thread $thread, Tickets $tickets, User $user) - { + public function thread(Ticket_Thread $thread, Tickets $tickets, User $user) { $user_id = Auth::user()->id; //dd($user_id); /* get the ticket's id == ticket_id of thread */ @@ -219,8 +209,8 @@ class GuestController extends Controller * * @return */ - public function ticketEdit() - { + public function ticketEdit() { + } /** @@ -231,8 +221,7 @@ class GuestController extends Controller * * @return type Response */ - public function postProfilePassword(ProfilePassword $request) - { + public function postProfilePassword(ProfilePassword $request) { $user = Auth::user(); //echo $user->password; if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { @@ -257,8 +246,7 @@ class GuestController extends Controller * * @return type Response */ - public function reply(Ticket_Thread $thread, TicketRequest $request) - { + public function reply(Ticket_Thread $thread, TicketRequest $request) { $thread->ticket_id = $request->input('ticket_ID'); $thread->title = $request->input('To'); $thread->user_id = Auth::user()->id; @@ -269,7 +257,7 @@ class GuestController extends Controller $tickets = Tickets::where('id', '=', $ticket_id)->first(); $thread = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first(); - return Redirect('thread/'.$ticket_id); + return Redirect('thread/' . $ticket_id); } /** @@ -280,8 +268,7 @@ class GuestController extends Controller * * @return type response */ - public function getCheckTicket(Tickets $ticket, User $user) - { + public function getCheckTicket(Tickets $ticket, User $user) { return view('themes.default1.client.helpdesk.guest-user.newticket', compact('ticket')); } @@ -295,10 +282,9 @@ class GuestController extends Controller * * @return type Response */ - public function PostCheckTicket(Request $request) - { + public function PostCheckTicket(Request $request) { $validator = \Validator::make($request->all(), [ - 'email' => 'required|email', + 'email' => 'required|email', 'ticket_number' => 'required', ]); if ($validator->fails()) { @@ -318,7 +304,7 @@ class GuestController extends Controller if ($user->role == 'user') { $username = $user->first_name; } else { - $username = $user->first_name.' '.$user->last_name; + $username = $user->first_name . ' ' . $user->last_name; } if ($user->email != $Email) { return \Redirect::route('form')->with('fails', Lang::get("lang.email_didn't_match_with_ticket_number")); @@ -329,7 +315,7 @@ class GuestController extends Controller $company = $this->company(); $this->PhpMailController->sendmail( - $from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user->email], $message = ['subject' => 'Ticket link Request ['.$Ticket_number.']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => \URL::route('check_ticket', $code)] + $from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user->email], $message = ['subject' => 'Ticket link Request [' . $Ticket_number . ']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => \URL::route('check_ticket', $code)] ); return \Redirect::back() @@ -345,12 +331,10 @@ class GuestController extends Controller * * @return type */ - public function get_ticket_email($id, CommonSettings $common_settings) - { + public function get_ticket_email($id, CommonSettings $common_settings) { $common_setting = $common_settings->select('status') ->where('option_name', '=', 'user_set_ticket_status') ->first(); - return view('themes.default1.client.helpdesk.ckeckticket', compact('id', 'common_setting')); } @@ -361,8 +345,7 @@ class GuestController extends Controller * * @return type */ - public function getTicketStat(Tickets $ticket) - { + public function getTicketStat(Tickets $ticket) { return view('themes.default1.client.helpdesk.ckeckticket', compact('ticket')); } @@ -371,8 +354,7 @@ class GuestController extends Controller * * @return type */ - public function company() - { + public function company() { $company = Company::Where('id', '=', '1')->first(); if ($company->company_name == null) { $company = 'Support Center'; @@ -389,11 +371,10 @@ class GuestController extends Controller $sms = DB::table('sms')->get(); if (count($sms) > 0) { \Event::fire(new \App\Events\LoginEvent($request)); - return 1; } } else { - return 'Plugin has not been setup successfully.'; + return "Plugin has not been setup successfully."; } } @@ -405,19 +386,18 @@ class GuestController extends Controller ->first(); if ($otp != null) { $otp_length = strlen(Input::get('otp')); - if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) { + if(($otp_length == 6 && !preg_match("/[a-z]/i", Input::get('otp'))) ) { $otp2 = Hash::make(Input::get('otp')); - $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); - $date2 = date('Y-m-d h:i:sa'); + $date1 = date_format($otp->updated_at, "Y-m-d h:i:sa"); + $date2 = date("Y-m-d h:i:sa"); $time1 = new DateTime($date2); $time2 = new DateTime($date1); $interval = $time1->diff($time2); - if ($interval->i > 10 || $interval->h > 0) { + if($interval->i >10 || $interval->h >0){ $message = Lang::get('lang.otp-expired'); - return $message; } else { - if (Hash::check(Input::get('otp'), $otp->otp)) { + if (Hash::check(Input::get('otp'), $otp->otp)){ Otp::where('user_id', '=', Input::get('u_id')) ->update(['otp' => '']); // User::where('id', '=', $user->id) @@ -426,24 +406,20 @@ class GuestController extends Controller return 1; } else { $message = Lang::get('lang.otp-not-matched'); - return $message; } } } else { $message = Lang::get('lang.otp-invalid'); - return $message; } } else { $message = Lang::get('lang.otp-not-matched'); - return $message; } } - public function sync() - { + public function sync() { try { $provider = $this->getProvider(); $this->changeRedirect(); @@ -455,67 +431,56 @@ class GuestController extends Controller $user['email'] = $users->email; $user['username'] = $users->nickname; $user['avatar'] = $users->avatar; - return redirect('client-profile')->with('success', 'Additional informations fetched'); } catch (Exception $ex) { dd($ex); - return redirect('client-profile')->with('fails', $ex->getMessage()); } } - public function getProvider() - { + public function getProvider() { $provider = \Session::get('provider'); - return $provider; } - public function changeRedirect() - { + public function changeRedirect() { $provider = \Session::get('provider'); - $url = \Session::get($provider.'redirect'); + $url = \Session::get($provider . 'redirect'); \Config::set("services.$provider.redirect", $url); } - public function forgetSession() - { + public function forgetSession() { $provider = $this->getProvider(); \Session::forget('provider'); - \Session::forget($provider.'redirect'); + \Session::forget($provider . 'redirect'); } - public function checkArray($key, $array) - { - $value = ''; + public function checkArray($key, $array) { + $value = ""; if (array_key_exists($key, $array)) { $value = $array[$key]; } - return $value; } - public function updateUser($user = []) - { + public function updateUser($user = []) { $userid = \Auth::user()->id; $useremail = \Auth::user()->email; $email = $this->checkArray('email', $user); //$user['email']; - if ($email !== '' && $email !== $useremail) { - throw new Exception('Sorry! your current email and '.ucfirst($user['provider']).' email is different so system can not sync'); + if ($email !== "" && $email !== $useremail) { + throw new Exception("Sorry! your current email and " . ucfirst($user['provider']) . " email is different so system can not sync"); } $this->update($userid, $user); } - public function update($userid, $user, $provider) - { + public function update($userid, $user, $provider) { $email = $this->checkArray('email', $user); $this->deleteUser($userid, $user, $provider); $this->insertAdditional($userid, $provider, $user); $this->changeEmail($email); } - public function deleteUser($userid, $user, $provider) - { + public function deleteUser($userid, $user, $provider) { $info = new \App\UserAdditionalInfo(); $infos = $info->where('owner', $userid)->where('service', $provider)->get(); if ($infos->count() > 0 && count($user) > 0) { @@ -527,27 +492,27 @@ class GuestController extends Controller } } - public function insertAdditional($id, $provider, $user = []) - { + public function insertAdditional($id, $provider, $user = []) { $info = new \App\UserAdditionalInfo(); if (count($user) > 0) { foreach ($user as $key => $value) { + $info->create([ - 'owner' => $id, + 'owner' => $id, 'service' => $provider, - 'key' => $key, - 'value' => $value, + 'key' => $key, + 'value' => $value, ]); } } } - public function changeEmail($email) - { + public function changeEmail($email) { $user = \Auth::user(); if ($user && $email && !$user->email) { $user->email = $email; $user->save(); } } + } diff --git a/app/Http/Controllers/Client/helpdesk/UnAuthController.php b/app/Http/Controllers/Client/helpdesk/UnAuthController.php index 5af44b5df..95a9fb45c 100644 --- a/app/Http/Controllers/Client/helpdesk/UnAuthController.php +++ b/app/Http/Controllers/Client/helpdesk/UnAuthController.php @@ -9,9 +9,9 @@ use App\Http\Controllers\Controller; use App\Model\helpdesk\Email\Emails; // models use App\Model\helpdesk\Settings\CommonSettings; -use App\Model\helpdesk\Settings\Followup; use App\Model\helpdesk\Ticket\Ticket_Status; use App\Model\helpdesk\Ticket\Ticket_Thread; +use App\Model\helpdesk\Settings\Followup; use App\Model\helpdesk\Ticket\Tickets; use App\Model\helpdesk\Ticket\TicketToken; use App\User; @@ -320,10 +320,9 @@ class UnAuthController extends Controller /** *@category function to change system's language - * - *@param string $lang //desired language's iso code - * + *@param string $lang //desired language's iso code *@return response + * */ public static function changeLanguage($lang) { @@ -342,55 +341,54 @@ class UnAuthController extends Controller // dd() } else { return false; - } - + } return true; } // Follow up tickets public function followup() - { - $followup = Followup::whereId('1')->first(); - $condition = $followup->condition; + { + $followup=Followup::whereId('1')->first(); + $condition=$followup->condition; // dd($condition); switch ($condition) { - case 'everyMinute': - $followup_set = ' + 1 minute'; + case "everyMinute": + $followup_set= ' + 1 minute'; break; - case 'everyFiveMinutes': - $followup_set = ' + 5 minute'; + case "everyFiveMinutes": + $followup_set= ' + 5 minute'; break; - case 'everyTenMinutes': - $followup_set = ' + 10 minute'; + case "everyTenMinutes": + $followup_set= ' + 10 minute'; break; - case 'everyThirtyMinutes': - $followup_set = ' + 30 minute'; + case "everyThirtyMinutes": + $followup_set=' + 30 minute'; break; - case 'hourly': - $followup_set = ' + 1 hours'; + case "hourly": + $followup_set=' + 1 hours'; break; - case 'daily': - $followup_set = ' + 1 day'; + case "daily": + $followup_set=' + 1 day'; break; - case 'weekly': - $followup_set = ' + 7 day'; + case "weekly": + $followup_set=' + 7 day'; break; - case 'monthly': - $followup_set = ' + 30 day'; + case "monthly": + $followup_set=' + 30 day'; break; - case 'yearly': - $followup_set = ' + 365 day'; + case "yearly": + $followup_set=' + 365 day'; break; } - if ($followup->status = 1) { - $tickets = Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get(); + if($followup->status=1){ + $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get(); // dd( $tickets); // $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->pluck('id'); // dd( $tickets); // $id=1; - foreach ($tickets as $ticket) { + foreach($tickets as $ticket) { // $id=1; // $id++; // $ticket=Tickets::where('status', '!=', 5)->get(); @@ -398,20 +396,27 @@ class UnAuthController extends Controller // dd($ticket); // if($ticket != null){ // dd('here'); - $ck = date('Y-m-d H:i:s', strtotime($ticket->updated_at.$followup_set)); + $ck=date('Y-m-d H:i:s', strtotime($ticket->updated_at . $followup_set)); // dd($ck); - $current_time = date('Y-m-d H:i:s'); - if ($current_time > $ck) { - $ticket->follow_up = 1; + $current_time=date('Y-m-d H:i:s'); + if($current_time>$ck){ + + $ticket->follow_up=1; $ticket->save(); // Tickets::where('id', '=',$id) // ->update(['follow_up' => 1]); - + // } - } - // if($id=2) - // {dd($ticket);} + } - } + // if($id=2) + // {dd($ticket);} + } + } + + } + + } + diff --git a/app/Http/Controllers/Client/kb/UserController.php b/app/Http/Controllers/Client/kb/UserController.php index e514f486c..0cac42f8b 100644 --- a/app/Http/Controllers/Client/kb/UserController.php +++ b/app/Http/Controllers/Client/kb/UserController.php @@ -24,10 +24,9 @@ use Lang; use Mail; use Redirect; -class UserController extends Controller -{ - public function __construct() - { +class UserController extends Controller { + + public function __construct() { $this->middleware('board'); } @@ -36,20 +35,18 @@ class UserController extends Controller * * @return response */ - public function getArticle(Article $article, Category $category, Settings $settings) - { + public function getArticle(Article $article, Category $category, Settings $settings) { $setting = $settings->first(); $pagination = $setting->pagination; if (!Auth::check() || \Auth::user()->role == 'user') { $article = $article->where('status', '1'); } $article = $article->where('type', '1'); - $article = $article->orderBy('publish_time', 'desc'); + $article = $article->orderBy('publish_time','desc'); $article = $article->paginate($pagination); - + $article->setPath('article-list'); $categorys = $category->get(); - return view('themes.default1.client.kb.article-list.articles', compact('time', 'categorys', 'article')); } @@ -62,8 +59,7 @@ class UserController extends Controller * * @return string excerpt */ - public static function getExcerpt($str, $startPos = 0, $maxLength = 50) - { + public static function getExcerpt($str, $startPos = 0, $maxLength = 50) { if (strlen($str) > $maxLength) { $excerpt = substr($str, $startPos, $maxLength - 3); $lastSpace = strrpos($excerpt, ' '); @@ -86,14 +82,13 @@ class UserController extends Controller * * @return type view */ - public function search(SearchRequest $request, Category $category, Article $article, Settings $settings) - { + public function search(SearchRequest $request, Category $category, Article $article, Settings $settings) { $settings = $settings->first(); $pagination = $settings->pagination; $search = $request->input('s'); - $result = $article->where('name', 'LIKE', '%'.$search.'%') - ->orWhere('slug', 'LIKE', '%'.$search.'%') - ->orWhere('description', 'LIKE', '%'.$search.'%') + $result = $article->where('name', 'LIKE', '%' . $search . '%') + ->orWhere('slug', 'LIKE', '%' . $search . '%') + ->orWhere('description', 'LIKE', '%' . $search . '%') ->paginate($pagination); $result->setPath('search?s='.$search); $categorys = $category->get(); @@ -106,16 +101,15 @@ class UserController extends Controller * * @return response */ - public function show($slug, Article $article, Category $category) - { + public function show($slug, Article $article, Category $category) { //ArticleController::timezone(); $tz = \App\Model\helpdesk\Settings\System::where('id', '1')->first()->time_zone; $tz = \App\Model\helpdesk\Utility\Timezones::where('id', $tz)->first()->name; date_default_timezone_set($tz); $date = \Carbon\Carbon::now()->toDateTimeString(); $arti = $article->where('slug', $slug); - - if (!Auth::check() || \Auth::user()->role == 'user') { + + if (!Auth::check()|| \Auth::user()->role == 'user') { $arti = $arti->where('status', '1'); $arti = $arti->where('publish_time', '<', $date); } @@ -131,8 +125,7 @@ class UserController extends Controller } } - public function getCategory($slug, Article $article, Category $category, Relationship $relation) - { + public function getCategory($slug, Article $article, Category $category, Relationship $relation) { /* get the article_id where category_id == current category */ $catid = $category->where('slug', $slug)->first(); if (!$catid) { @@ -148,8 +141,7 @@ class UserController extends Controller return view('themes.default1.client.kb.article-list.category', compact('all', 'id', 'categorys', 'article_id')); } - public function home(Article $article, Category $category, Relationship $relation) - { + public function home(Article $article, Category $category, Relationship $relation) { if (Config::get('database.install') == '%0%') { return redirect('step1'); } else { @@ -161,8 +153,7 @@ class UserController extends Controller } } - public function Faq(Faq $faq, Category $category) - { + public function Faq(Faq $faq, Category $category) { $faq = $faq->where('id', '1')->first(); $categorys = $category->get(); @@ -174,8 +165,7 @@ class UserController extends Controller * * @return response */ - public function contact(Category $category, Settings $settings) - { + public function contact(Category $category, Settings $settings) { $settings = $settings->whereId('1')->first(); $categorys = $category->get(); @@ -187,8 +177,7 @@ class UserController extends Controller * * @return response */ - public function postContact(ContactRequest $request, Contact $contact) - { + public function postContact(ContactRequest $request, Contact $contact) { $this->port(); $this->host(); $this->encryption(); @@ -206,8 +195,8 @@ class UserController extends Controller //echo $message; //echo $contact->email; $mail = Mail::send('themes.default1.client.kb.article-list.contact-details', ['name' => $name, 'email' => $email, 'subject' => $subject, 'details' => $details], function ($message) use ($contact) { - $message->to($contact->email, $contact->name)->subject('Contact'); - }); + $message->to($contact->email, $contact->name)->subject('Contact'); + }); if ($mail) { return redirect('contact')->with('success', Lang::get('lang.your_details_send_to_system')); } else { @@ -215,8 +204,7 @@ class UserController extends Controller } } - public function contactDetails() - { + public function contactDetails() { return view('themes.default1.client.kb.article-list.contact-details'); } @@ -230,11 +218,10 @@ class UserController extends Controller * * @return type response */ - public function postComment($slug, Article $article, CommentRequest $request, Comment $comment) - { + public function postComment($slug, Article $article, CommentRequest $request, Comment $comment) { $article = $article->where('slug', $slug)->first(); - if (!$article) { - return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed')); + if(!$article){ + return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed')); } $id = $article->id; $comment->article_id = $id; @@ -245,49 +232,42 @@ class UserController extends Controller } } - public function getPage($name, Page $page) - { + public function getPage($name, Page $page) { $page = $page->where('slug', $name)->first(); - if ($page) { + if($page){ return view('themes.default1.client.kb.article-list.pages', compact('page')); - } else { + }else{ return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed')); } } - public static function port() - { + public static function port() { $setting = Settings::whereId('1')->first(); Config::set('mail.port', $setting->port); } - public static function host() - { + public static function host() { $setting = Settings::whereId('1')->first(); Config::set('mail.host', $setting->host); } - public static function encryption() - { + public static function encryption() { $setting = Settings::whereId('1')->first(); Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]); } - public static function email() - { + public static function email() { $setting = Settings::whereId('1')->first(); Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]); //dd(Config::get('mail')); } - public static function password() - { + public static function password() { $setting = Settings::whereId('1')->first(); Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]); } - public function getCategoryList(Article $article, Category $category, Relationship $relation) - { + public function getCategoryList(Article $article, Category $category, Relationship $relation) { //$categorys = $category->get(); $categorys = $category->get(); // $categorys->setPath('home'); @@ -309,15 +289,13 @@ class UserController extends Controller // //return substr($date, 0, -6); // } - public function clientProfile() - { + public function clientProfile() { $user = Auth::user(); return view('themes.default1.client.kb.article-list.profile', compact('user')); } - public function postClientProfile($id, ProfileRequest $request) - { + public function postClientProfile($id, ProfileRequest $request) { $user = Auth::user(); $user->gender = $request->input('gender'); $user->save(); @@ -336,7 +314,7 @@ class UserController extends Controller //$extension = Input::file('profile_pic')->getClientOriginalExtension(); $name = Input::file('profile_pic')->getClientOriginalName(); $destinationPath = 'lb-faveo/dist/img'; - $fileName = rand(0000, 9999).'.'.$name; + $fileName = rand(0000, 9999) . '.' . $name; //echo $fileName; Input::file('profile_pic')->move($destinationPath, $fileName); $user->profile_pic = $fileName; @@ -350,8 +328,7 @@ class UserController extends Controller } } - public function postClientProfilePassword($id, ProfilePassword $request) - { + public function postClientProfilePassword($id, ProfilePassword $request) { $user = Auth::user(); //echo $user->password; if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { @@ -363,4 +340,5 @@ class UserController extends Controller return redirect()->back()->with('fails', Lang::get('lang.password_was_not_updated')); } } + } diff --git a/app/Http/Controllers/Common/ExcelController.php b/app/Http/Controllers/Common/ExcelController.php index 215c8e993..0c92296ef 100644 --- a/app/Http/Controllers/Common/ExcelController.php +++ b/app/Http/Controllers/Common/ExcelController.php @@ -2,21 +2,23 @@ namespace App\Http\Controllers\Common; +use Illuminate\Http\Request; +use App\Http\Requests; use App\Http\Controllers\Controller; use Excel; use Exception; -class ExcelController extends Controller -{ - public function export($filename, $data) - { - if (count($data) == 0) { +class ExcelController extends Controller { + + public function export($filename, $data) { + if(count($data)==0){ throw new Exception('No data'); } - Excel::create($filename, function ($excel) use ($data) { - $excel->sheet('sheet', function ($sheet) use ($data) { + Excel::create($filename, function($excel) use($data){ + $excel->sheet('sheet', function($sheet) use($data) { $sheet->fromArray($data); }); })->export('xls'); } + } diff --git a/app/Http/Controllers/Common/FileuploadController.php b/app/Http/Controllers/Common/FileuploadController.php index e1b57a815..935dd4251 100644 --- a/app/Http/Controllers/Common/FileuploadController.php +++ b/app/Http/Controllers/Common/FileuploadController.php @@ -4,10 +4,9 @@ namespace App\Http\Controllers\Common; use App\Http\Controllers\Controller; -class FileuploadController extends Controller -{ - public function __construct() - { +class FileuploadController extends Controller { + + public function __construct() { // checking authentication $this->middleware('auth'); // checking if role is agent @@ -16,8 +15,7 @@ class FileuploadController extends Controller // Returns a file size limit in bytes based on the PHP upload_max_filesize // and post_max_size - public function file_upload_max_size() - { + function file_upload_max_size() { static $max_size = -1; if ($max_size < 0) { @@ -33,13 +31,11 @@ class FileuploadController extends Controller $max_size_in_actual = ini_get('upload_max_filesize'); } } - return ['0' => $max_size_in_bytes, '1' => $max_size_in_actual]; // return $max_size_in_bytes; } - public function parse_size($size) - { + function parse_size($size) { $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. if ($unit) { @@ -49,4 +45,5 @@ class FileuploadController extends Controller return round($size); } } + } diff --git a/app/Http/Controllers/Common/NotificationController.php b/app/Http/Controllers/Common/NotificationController.php index c3669bff0..41167da8d 100644 --- a/app/Http/Controllers/Common/NotificationController.php +++ b/app/Http/Controllers/Common/NotificationController.php @@ -4,32 +4,33 @@ namespace App\Http\Controllers\Common; use App\Http\Controllers\Controller; use App\Model\helpdesk\Notification\Notification; -use App\Model\helpdesk\Notification\NotificationType; use App\Model\helpdesk\Notification\UserNotification; use App\Model\helpdesk\Ticket\Tickets; +use App\Model\helpdesk\Ticket\Ticket_Thread; use App\User; +use App\Model\helpdesk\Notification\NotificationType; + +class NotificationController extends Controller { -class NotificationController extends Controller -{ /** - ********************************************* + * ******************************************** * Class Notification Controller - ********************************************* + * ******************************************** * This controller is used to generate in app notification - * under the folling occurrence + * under the folling occurrence * 1. Ticket Creation * 2. Ticket Reply - * 3. User Creation. - * + * 3. User Creation + * * @author Ladybird */ public $user; /** - * Constructor. + * Constructor */ - public function __construct() - { + public function __construct() { + $user = new User(); $this->user = $user; // checking authentication @@ -40,7 +41,6 @@ class NotificationController extends Controller /** * This function is used to create in app notifications. - * * @param type $model_id * @param type $userid_created * @param type $type_id @@ -68,62 +68,49 @@ class NotificationController extends Controller } /** - * This function is to mark all ticket to read status. - * + * This function is to mark all ticket to read status * @param type $id - * * @return int */ - public function markAllRead($id) - { + public function markAllRead($id) { $markasread = UserNotification::where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get(); foreach ($markasread as $mark) { $mark->is_read = '1'; $mark->save(); } - return 1; } /** - * This function to mark read. - * + * This function to mark read * @param type $id - * * @return int */ - public function markRead($id) - { + public function markRead($id) { $markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get(); foreach ($markasread as $mark) { $mark->is_read = '1'; $mark->save(); } - return 1; } /** - * function to show all the notifications. - * + * function to show all the notifications * @return type */ - public function show() - { + public function show() { $notifications = $this->getNotifications(); - + //dd($notifications); return view('notifications-all', compact('notifications')); } /** - * function to delete notifications. - * + * function to delete notifications * @param type $id - * * @return int */ - public function delete($id) - { + public function delete($id) { $markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->get(); foreach ($markasread as $mark) { $mark->delete(); @@ -132,25 +119,36 @@ class NotificationController extends Controller return 1; } + public function deleteAll() { + try{ + $notifications = new Notification(); + if ($notifications->count()>0) { + foreach ($notifications->get() as $notification) { + $notification->delete(); + } + } + $notifications->dummyDelete(); + return redirect()->back()->with('success', 'deleted'); + } catch (\Exception $ex){ + return redirect()->back()->with('fails',$ex->getMessage()); + } + } + /** * get the page to list the notifications. - * * @return response */ - public static function getNotifications() - { - $notifications = UserNotification::join('notifications', 'user_notification.notification_id', '=', 'notifications.id') - ->join('notification_types', 'notifications.type_id', '=', 'notification_types.id') - ->where('user_notification.user_id', '=', \Auth::user()->id) - ->select('notification_types.id as id', 'notifications.id as notification_id', - 'user_notification.user_id as user_id', 'user_notification.is_read as is_read', - 'user_notification.created_at as created_at', 'user_notification.updated_at as updated_at', 'notifications.model_id as model_id', - 'notifications.userid_created as userid_created', - 'notifications.type_id as type_id', 'notification_types.message as message', - 'notification_types.type as type', 'notification_types.icon_class as icon_class') - ->orderBy('user_notification.created_at', 'desc') - ->paginate(10); - + public static function getNotifications() { + $notifications = UserNotification::with([ + 'notification.type' => function($query) { + $query->select('id', 'message', 'type'); + }, 'users' => function($query) { + $query->select('id', 'email', 'profile_pic'); + }, 'notification.model' => function($query) { + $query->select('id', 'ticket_number'); + }, + ]); return $notifications; } + } diff --git a/app/Http/Controllers/Common/PhpMailController.php b/app/Http/Controllers/Common/PhpMailController.php index 84a2b821c..84e4f730b 100644 --- a/app/Http/Controllers/Common/PhpMailController.php +++ b/app/Http/Controllers/Common/PhpMailController.php @@ -10,16 +10,14 @@ use App\Model\helpdesk\Settings\Company; use App\Model\helpdesk\Settings\Email; use App\User; use Auth; +use Mail; use Exception; use Lang; -use Mail; -class PhpMailController extends Controller -{ - public function fetch_smtp_details($id) - { +class PhpMailController extends Controller { + + public function fetch_smtp_details($id) { $emails = Emails::where('id', '=', $id)->first(); - return $emails; } @@ -28,8 +26,7 @@ class PhpMailController extends Controller * * @return type */ - public function company() - { + public function company() { $company = Company::Where('id', '=', '1')->first(); if ($company->company_name == null) { $company = 'Support Center'; @@ -48,32 +45,27 @@ class PhpMailController extends Controller * * @return type integer */ - public function mailfrom($reg, $dept_id) - { - $email = Email::where('id', '=', '1')->first(); - if ($reg == 1) { - return $email->sys_email; - } elseif ($dept_id > 0) { - $department = Department::where('id', '=', $dept_id)->first(); - if ($department->outgoing_email) { - return $department->outgoing_email; - } else { - return $email->sys_email; - } + public function mailfrom($reg, $dept_id) { + $email_id = ""; + $emails = Emails::where('department', '=', $dept_id)->first(); + + $email = Email::find(1); + if ($emails && $emails->sending_status) { + $email_id = $emails->id; + } else { + $email_id = $email->sys_email; } + return $email_id; } - public function sendmail($from, $to, $message, $template_variables) - { + public function sendmail($from, $to, $message, $template_variables) { $this->setQueue(); $job = new \App\Jobs\SendEmail($from, $to, $message, $template_variables); - $dispatch = $this->dispatch($job); - - return $dispatch; + $this->dispatch($job); } - public function sendEmail($from, $to, $message, $template_variables) - { + public function sendEmail($from, $to, $message, $template_variables) { + $from_address = $this->fetch_smtp_details($from); if ($from_address == null) { throw new Exception(Lang::get('lang.system-email-not-configured')); @@ -104,11 +96,11 @@ class PhpMailController extends Controller $ticket_link_with_number = $this->checkElement('ticket_link_with_number', $template_variables); $system_from = $this->checkElement('system_from', $template_variables); - if ($system_from === '') { + if ($system_from === "") { $system_from = $this->company(); } $system_link = $this->checkElement('system_link', $template_variables); - if ($system_link === '') { + if ($system_link === "") { $system_link = \Config::get('app.url'); } $ticket_link = $this->checkElement('ticket_link', $template_variables); @@ -121,6 +113,7 @@ class PhpMailController extends Controller $email_address = $this->checkElement('email_address', $template_variables); $user = $this->checkElement('user', $template_variables); + $status = \DB::table('settings_email')->first(); $template = TemplateType::where('name', '=', $template_type)->first(); @@ -134,7 +127,7 @@ class PhpMailController extends Controller if ($template_data->subject) { $subject = $template_data->subject; if ($ticket_number != null) { - $subject = $subject.' [#'.$ticket_number.']'; + $subject = $subject . ' [#' . $ticket_number . ']'; } } else { $subject = $message['subject']; @@ -147,6 +140,7 @@ class PhpMailController extends Controller $subject = null; } + $variables = ['{!!$user!!}', '{!!$agent!!}', '{!!$ticket_number!!}', '{!!$content!!}', '{!!$from!!}', '{!!$ticket_agent_name!!}', '{!!$ticket_client_name!!}', '{!!$ticket_client_email!!}', '{!!$ticket_body!!}', '{!!$ticket_assigner!!}', '{!!$ticket_link_with_number!!}', '{!!$system_error!!}', '{!!$agent_sign!!}', '{!!$department_sign!!}', '{!!$password_reset_link!!}', '{!!$email_address!!}', '{!!$user_password!!}', '{!!$system_from!!}', '{!!$system_link!!}', '{!!$ticket_link!!}']; $data = [$user, $agent, $ticket_number, $content, $from, $ticket_agent_name, $ticket_client_name, $ticket_client_email, $ticket_body, $ticket_assigner, $ticket_link_with_number, $system_error, $agent_sign, $department_sign, $password_reset_link, $email_address, $user_password, $system_from, $system_link, $ticket_link]; @@ -156,20 +150,20 @@ class PhpMailController extends Controller $contents = $messagebody; } + if ($template_type == 'ticket-reply-agent') { $line = '---Reply above this line---

    '; - $content = $line.$messagebody; + $content = $line . $messagebody; } else { $content = $messagebody; } } $send = $this->laravelMail($recipants, $recipantname, $subject, $content, $cc, $attachment); - return $send; } - public function setMailConfig($from_address) - { + public function setMailConfig($from_address) { + $username = $from_address->email_address; $fromname = $from_address->email_name; $password = $from_address->password; @@ -186,94 +180,88 @@ class PhpMailController extends Controller $port = ''; } $configs = [ - 'username' => $username, - 'from' => ['address' => $username, 'name' => $fromname], - 'password' => $password, + 'username' => $username, + 'from' => ['address' => $username, 'name' => $fromname,], + 'password' => $password, 'encryption' => $smtpsecure, - 'host' => $host, - 'port' => $port, - 'driver' => $protocol, + 'host' => $host, + 'port' => $port, + 'driver' => $protocol, ]; foreach ($configs as $key => $config) { if (is_array($config)) { foreach ($config as $from) { - \Config::set('mail.'.$key, $config); + \Config::set('mail.' . $key, $config); } } else { - \Config::set('mail.'.$key, $config); + \Config::set('mail.' . $key, $config); } } } - public function setServices($emailid, $protocol) - { + public function setServices($emailid, $protocol) { $service = new \App\Model\MailJob\FaveoMail(); $services = $service->where('email_id', $emailid)->lists('value', 'key')->toArray(); $controller = new \App\Http\Controllers\Admin\helpdesk\EmailsController(); $controller->setServiceConfig($protocol, $services); } - public function checkElement($element, $array) - { - $value = ''; + public function checkElement($element, $array) { + $value = ""; if (is_array($array)) { - if (array_key_exists($element, $array)) { + if (key_exists($element, $array)) { $value = $array[$element]; } } - return $value; } - public function laravelMail($to, $toname, $subject, $data, $cc, $attach) - { + public function laravelMail($to, $toname, $subject, $data, $cc, $attach) { //dd($to, $toname, $subject, $data, $cc, $attach); //dd(\Config::get('mail')); //dd($attach); $mail = Mail::send('emails.mail', ['data' => $data], function ($m) use ($to, $subject, $toname, $cc, $attach) { - $m->to($to, $toname)->subject($subject); + $m->to($to, $toname)->subject($subject); - if ($cc != null) { - foreach ($cc as $collaborator) { - //mail to collaborators + if ($cc != null) { + foreach ($cc as $collaborator) { + //mail to collaborators $collab_user_id = $collaborator->user_id; - $user_id_collab = User::where('id', '=', $collab_user_id)->first(); - $collab_email = $user_id_collab->email; - $m->cc($collab_email); - } - } + $user_id_collab = User::where('id', '=', $collab_user_id)->first(); + $collab_email = $user_id_collab->email; + $m->cc($collab_email); + } + } // $mail->addBCC($bc); $size = count($attach); - if ($size > 0) { - for ($i = 0; $i < $size; $i++) { - if (is_array($attach) && array_key_exists($i, $attach)) { - $mode = 'normal'; - if (is_array($attach[$i]) && array_key_exists('mode', $attach[$i])) { - $mode = $attach[$i]['mode']; + if ($size > 0) { + for ($i = 0; $i < $size; $i++) { + if (is_array($attach) && array_key_exists($i, $attach)) { + $mode = 'normal'; + if (is_array($attach[$i]) && array_key_exists('mode', $attach[$i])) { + $mode = $attach[$i]['mode']; + } + $file = $attach[$i]['file_path']; + $name = $attach[$i]['file_name']; + $mime = $attach[$i]['mime']; + $this->attachmentMode($m, $file, $name, $mime, $mode); + } } - $file = $attach[$i]['file_path']; - $name = $attach[$i]['file_name']; - $mime = $attach[$i]['mime']; - $this->attachmentMode($m, $file, $name, $mime, $mode); } - } - } - }); + }); if (is_object($mail) || (is_object($mail) && $mail->getStatusCode() == 200)) { $mail = 1; } - return $mail; } - public function setQueue() - { + public function setQueue() { $short = 'database'; $field = [ 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'table' => 'jobs', + 'queue' => 'default', 'expire' => 60, ]; $queue = new \App\Model\MailJob\QueueService(); @@ -286,20 +274,18 @@ class PhpMailController extends Controller $this->setQueueConfig($short, $field); } - public function setQueueConfig($short, $field) - { + public function setQueueConfig($short, $field) { \Config::set('queue.default', $short); foreach ($field as $key => $value) { \Config::set("queue.connections.$short.$key", $value); } } - public function attachmentMode($message, $file, $name, $mime, $mode) - { + public function attachmentMode($message, $file, $name, $mime, $mode) { if ($mode == 'data') { return $message->attachData(base64_decode($file, true), $name, ['mime' => $mime]); } - return $message->attach($file, ['as' => $name, 'mime' => $mime]); } + } diff --git a/app/Http/Controllers/Common/SettingsController.php b/app/Http/Controllers/Common/SettingsController.php index d801018ec..efe29229a 100644 --- a/app/Http/Controllers/Common/SettingsController.php +++ b/app/Http/Controllers/Common/SettingsController.php @@ -11,6 +11,7 @@ use App\Model\helpdesk\Email\Smtp; // models use App\Model\helpdesk\Settings\Plugin; use App\Model\helpdesk\Theme\Widgets; +use App\Model\helpdesk\Utility\Version_Check; use Config; // classes use Crypt; @@ -26,15 +27,14 @@ use Lang; * *************************** * Controller to keep smtp details and fetch where ever needed. */ -class SettingsController extends Controller -{ +class SettingsController extends Controller { + /** * Create a new controller instance. * * @return type void */ - public function __construct() - { + public function __construct() { $this->middleware('auth'); $this->middleware('roles'); } @@ -44,8 +44,7 @@ class SettingsController extends Controller * * @return response */ - public function widgets() - { + public function widgets() { return view('themes.default1.admin.helpdesk.theme.widgets'); } @@ -54,8 +53,7 @@ class SettingsController extends Controller * * @return response */ - public function list_widget() - { + public function list_widget() { return \Datatable::collection(Widgets::where('id', '<', '7')->get()) ->searchColumns('name') ->orderColumns('name', 'title', 'value') @@ -69,33 +67,33 @@ class SettingsController extends Controller return $model->value; }) ->addColumn('Actions', function ($model) { - return ''.\Lang::get('lang.edit').' - +@stop +@section('FooterInclude') + + + +@stop \ No newline at end of file diff --git a/resources/views/themes/default1/admin/helpdesk/label/edit.blade.php b/resources/views/themes/default1/admin/helpdesk/label/edit.blade.php new file mode 100644 index 000000000..e41ecfcd7 --- /dev/null +++ b/resources/views/themes/default1/admin/helpdesk/label/edit.blade.php @@ -0,0 +1,142 @@ +@extends('themes.default1.admin.layout.admin') + +@section('Tickets') +active +@stop + +@section('manage-bar') +active +@stop + +@section('labels') +class="active" +@stop + +@section('HeadInclude') +@stop + +@section('PageHeader') +

    Labels

    +@stop + + +@section('breadcrumbs') + +@stop + + +@section('content') + +@if(Session::has('success')) +
    + + + {{Session::get('success')}} +
    +@endif +@if(Session::has('fails')) +
    + + {{Session::get('fails')}} +
    +@endif +@if(Session::has('errors')) +

    +
    + + {!! Lang::get('lang.alert') !!}! + +
    + @if($errors->first('title')) +
  • {!! $errors->first('title', ':message') !!}
  • + @endif + @if($errors->first('color')) +
  • {!! $errors->first('color', ':message') !!}
  • + @endif + @if($errors->first('order')) +
  • {!! $errors->first('order', ':message') !!}
  • + @endif +
    + @endif +@if(Session::has('warn')) +
    + + {{Session::get('warn')}} +
    +@endif +
    + +
    +
    + {!! $label->titleWithColor() !!} +
    + {!! Form::model($label,['url'=>'labels/'.$label->id,'method'=>'patch', 'id' => 'label-form']) !!} +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    {!! Form::label('title','Title') !!} * +
    + {!! Form::text('title',null,['class'=>'form-control']) !!} +
    +
    {!! Form::label('color','Color') !!} * +
    + {!! Form::text('color', null,['class'=>'form-control my-colorpicker1 colorpicker-element']) !!} +
    +
    {!! Form::label('order','Order') !!} * +
    + {!! Form::input('number', 'order', null, array('class' => 'form-control')) !!} +
    +
    {!! Form::label('status','Status') !!}

    {!! Form::checkbox('status') !!} {!!Lang::get('lang.enable')!!}

    +
    + +
    +@stop +@section('FooterInclude') + + + +@stop \ No newline at end of file diff --git a/resources/views/themes/default1/admin/helpdesk/label/index.blade.php b/resources/views/themes/default1/admin/helpdesk/label/index.blade.php new file mode 100644 index 000000000..d6b0950a7 --- /dev/null +++ b/resources/views/themes/default1/admin/helpdesk/label/index.blade.php @@ -0,0 +1,69 @@ +@extends('themes.default1.admin.layout.admin') + +@section('Tickets') +active +@stop + +@section('manage-bar') +active +@stop + +@section('labels') +class="active" +@stop + +@section('HeadInclude') +@stop + +@section('PageHeader') +

    Labels

    +@stop + + +@section('breadcrumbs') + +@stop + + +@section('content') + +@if(Session::has('success')) +
    + + + {{Session::get('success')}} +
    +@endif +@if(Session::has('fails')) +
    + + {{Session::get('fails')}} +
    +@endif +@if(Session::has('warn')) +
    + + {{Session::get('warn')}} +
    +@endif +
    +
    +
    + Labels + + +
    +   New Label + +
    +
    + {!! + Datatable::table() + ->addColumn('Title','Order','Status','Action') + ->setUrl(url('labels-ajax')) + ->render() + !!} +
    +
    +@stop \ No newline at end of file diff --git a/resources/views/themes/default1/admin/helpdesk/manage/form/add-child.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/form/add-child.blade.php index 281163364..b1c7c460b 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/form/add-child.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/form/add-child.blade.php @@ -8,7 +8,7 @@ active active @stop -@section('form') +@section('forms') class="active" @stop diff --git a/resources/views/themes/default1/admin/helpdesk/manage/form/index.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/form/index.blade.php index 3a5e4f07b..b9a244cd3 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/form/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/form/index.blade.php @@ -40,7 +40,7 @@ class="active"
    {!! Lang::get('lang.forms') !!}
    - +
    diff --git a/resources/views/themes/default1/admin/helpdesk/manage/helptopic/index.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/helptopic/index.blade.php index a3b71c95c..d8a286016 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/helptopic/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/helptopic/index.blade.php @@ -31,7 +31,7 @@ class="active"
    diff --git a/resources/views/themes/default1/admin/helpdesk/manage/sla/index.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/sla/index.blade.php index f00a6b534..a9caa469a 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/sla/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/sla/index.blade.php @@ -32,7 +32,7 @@ class="active"
    -

    {{Lang::get('lang.SLA_plan')}}

    {{Lang::get('lang.create_SLA')}}
    +

    {{Lang::get('lang.SLA_plan')}}

     {{Lang::get('lang.create_SLA')}}
    diff --git a/resources/views/themes/default1/admin/helpdesk/manage/ticket_priority/index.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/ticket_priority/index.blade.php index 9f4c47e8a..e23190b21 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/ticket_priority/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/ticket_priority/index.blade.php @@ -49,18 +49,17 @@ class="active" - - -
    +
    {!! Lang::get('lang.current') !!}{!! Lang::get('lang.user_priority_status') !!} +
    @@ -89,10 +88,10 @@ class="active"
    - + diff --git a/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php index 0e50479f4..68d424de4 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php @@ -1,6 +1,6 @@ @extends('themes.default1.admin.layout.admin') -@section('Settings') +@section('Tickets') active @stop diff --git a/resources/views/themes/default1/admin/helpdesk/settings/responder.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/responder.blade.php index 860370f92..6e8f7cb81 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/responder.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/responder.blade.php @@ -1,10 +1,10 @@ @extends('themes.default1.admin.layout.admin') -@section('Settings') +@section('Tickets') active @stop -@section('settings-bar') +@section('tickets-bar') active @stop diff --git a/resources/views/themes/default1/admin/helpdesk/settings/social-media/index.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/social-media/index.blade.php index d5850c086..239c37137 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/social-media/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/social-media/index.blade.php @@ -1,14 +1,14 @@ @extends('themes.default1.admin.layout.admin') - + @section('Settings') -class="active" +active @stop @section('settings-bar') active @stop -@section('access') +@section('social-login') class="active" @stop @@ -62,7 +62,6 @@ class="active"
    -
    diff --git a/resources/views/themes/default1/admin/helpdesk/settings/social-media/settings.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/social-media/settings.blade.php index cc1659fed..75750208d 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/social-media/settings.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/social-media/settings.blade.php @@ -1,14 +1,14 @@ @extends('themes.default1.admin.layout.admin') - + @section('Settings') -class="active" +active @stop @section('settings-bar') active @stop -@section('access') +@section('social-login') class="active" @stop diff --git a/resources/views/themes/default1/admin/helpdesk/settings/status-edit.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/status-edit.blade.php index d94517291..c4d0b54fb 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/status-edit.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/status-edit.blade.php @@ -1,6 +1,6 @@ @extends('themes.default1.admin.layout.admin') -@section('Settings') +@section('Tickets') active @stop @@ -12,6 +12,12 @@ class="active"

    {!! Lang::get('lang.status_settings') !!}

    @stop +@section('breadcrumbs') + +@stop + + @section('content') {!! Form::model($status,['route'=>['statuss.update', $status->id],'method'=>'PATCH','files' => true]) !!}
    diff --git a/resources/views/themes/default1/admin/helpdesk/settings/status.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/status.blade.php index 3c1ac2f2e..af437eb08 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/status.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/status.blade.php @@ -1,6 +1,6 @@ @extends('themes.default1.admin.layout.admin') -@section('Settings') +@section('Tickets') active @stop @@ -12,6 +12,11 @@ class="active"

    {!! Lang::get('lang.settings') !!}

    @stop +@section('breadcrumbs') + +@stop + @section('content')
    diff --git a/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php index 430fef457..721ff7458 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php @@ -177,6 +177,7 @@ class="active"
    +
    + + + + + + + + + + @foreach($departments as $department) + id)->where('status', '=', 1)->count(); + $resolve = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $department->id)->where('status', '=', 2)->count(); + $close = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $department->id)->where('status', '=', 3)->count(); + $delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id', '=', $department->id)->where('status', '=', 5)->count(); + ?> + + + + + + + + @endforeach +
    {!! Lang::get('lang.department') !!}{!! Lang::get('lang.opened') !!}{!! Lang::get('lang.resolved') !!}{!! Lang::get('lang.closed') !!}{!! Lang::get('lang.deleted') !!}
    {!! $department->name !!}{!! $open !!}{!! $resolve !!}{!! $close !!}{!! $delete !!}
    +
    + +
    + +
    + + + + + +@stop \ No newline at end of file diff --git a/resources/views/themes/default1/agent/helpdesk/dept-ticket/closed.blade.php b/resources/views/themes/default1/agent/helpdesk/dept-ticket/closed.blade.php deleted file mode 100644 index d36ea36ea..000000000 --- a/resources/views/themes/default1/agent/helpdesk/dept-ticket/closed.blade.php +++ /dev/null @@ -1,448 +0,0 @@ -@extends('themes.default1.agent.layout.agent') - -@section('Tickets') -class="active" -@stop - -@section('ticket-bar') -active -@stop - -@section('inbox') -class="active" -@stop - -@section('PageHeader') -

    {{Lang::get('lang.tickets')}}

    -@stop - -@section('content') -first(); - if(Auth::user()->role == 'agent') { - $tickets = App\Model\helpdesk\Ticket\Tickets::where('status','=','2')->where('status','=','3')->where('dept_id','=',$dept->id)->orderBy('id', 'DESC')->paginate(20); - } else { - $tickets = App\Model\helpdesk\Ticket\Tickets::where('status','=','2')->where('status','=','3')->where('dept_id','=',$dept->id)->orderBy('id', 'DESC')->paginate(20); - } -?> - -
    -
    -

    {!! $dept->name !!} / {!! Lang::get('lang.closed') !!}

    {!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!} -
    -
    - -
    -
    -
    -
    - @if(Session::has('success')) -
    - - Success - - {{Session::get('success')}} -
    - @endif - - @if(Session::has('fails')) -
    - - Fail! - - {{Session::get('fails')}} -
    - @endif - {!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!} -
    - - - - -
    -

    -

    - - - {!! Datatable::table() - ->addColumn( - "", - Lang::get('lang.subject'), - Lang::get('lang.ticket_id'), - Lang::get('lang.priority'), - Lang::get('lang.from'), - Lang::get('lang.assigned_to'), - Lang::get('lang.last_activity')) - ->setUrl(route('get.dept.close', $dept->id)) - - ->setOrder(array(6=>'desc')) - ->setClass('table table-hover table-bordered table-striped') - ->setCallbacks("fnRowCallback",'function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - var str = aData[3]; - if(str.search("#000") == -1) { - $("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #F3F3F3"}); - $("td", nRow).mouseenter(function(){ - $("td", nRow).css({"background-color":"#DEDFE0", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"}); - }); - $("td", nRow).mouseleave(function(){ - $("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd","border-right":"solid 0.5px #F3F3F3"}); - }); - } else { - $("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"}); - $("td", nRow).mouseenter(function(){ - $("td", nRow).css({"background-color":"#DEDFE0", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"}); - }); - $("td", nRow).mouseleave(function(){ - $("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"}); - }); - } - }') - ->render();!!} - -
    - {!! Form::close() !!} -
    -
    - - - - - - - - - - - -@stop \ No newline at end of file diff --git a/resources/views/themes/default1/agent/helpdesk/dept-ticket/inprogress.blade.php b/resources/views/themes/default1/agent/helpdesk/dept-ticket/inprogress.blade.php deleted file mode 100644 index 51833b9e9..000000000 --- a/resources/views/themes/default1/agent/helpdesk/dept-ticket/inprogress.blade.php +++ /dev/null @@ -1,533 +0,0 @@ -@extends('themes.default1.agent.layout.agent') - -@section('Tickets') -class="active" -@stop - -@section('ticket-bar') -active -@stop - -@section('inbox') -class="active" -@stop - -@section('PageHeader') -

    {{Lang::get('lang.tickets')}}

    -@stop - -@section('content') - -first(); -if (Auth::user()->role == 'agent') { - $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', '1')->where('assigned_to', '>', 0) - ->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count(); -} else { - $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', '1')->where('assigned_to', '>', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count(); -} -?> - -
    -
    -

    {!! $dept->name !!} / {!! Lang::get('lang.assigned') !!}

    {!! $tickets !!} {!! Lang::get('lang.tickets') !!} -
    -
    - -
    -
    -
    -
    - @if(Session::has('success')) -
    - - Success - - {{Session::get('success')}} -
    - @endif - - @if(Session::has('fails')) -
    - - Fail! - - {{Session::get('fails')}} -
    - @endif - {!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!} -
    - - - - - - -
    -

    -

    - - - {!! Datatable::table() - ->addColumn( - "", - Lang::get('lang.subject'), - Lang::get('lang.ticket_id'), - Lang::get('lang.priority'), - Lang::get('lang.from'), - Lang::get('lang.assigned_to'), - Lang::get('lang.last_activity')) - ->setUrl(route('get.dept.inprocess', $dept->id)) - - ->setOrder(array(6=>'desc')) - ->setClass('table table-hover table-bordered table-striped') - ->setCallbacks("fnRowCallback",'function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - var str = aData[3]; - if(str.search("#000") == -1) { - $("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #F3F3F3"}); - $("td", nRow).mouseenter(function(){ - $("td", nRow).css({"background-color":"#DEDFE0", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"}); - }); - $("td", nRow).mouseleave(function(){ - $("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd","border-right":"solid 0.5px #F3F3F3"}); - }); - } else { - $("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"}); - $("td", nRow).mouseenter(function(){ - $("td", nRow).css({"background-color":"#DEDFE0", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"}); - }); - $("td", nRow).mouseleave(function(){ - $("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"}); - }); - } - }') - ->render();!!} - -
    - {!! Form::close() !!} -
    -
    - - - - - - - - - - - - -@stop \ No newline at end of file diff --git a/resources/views/themes/default1/agent/helpdesk/dept-ticket/open.blade.php b/resources/views/themes/default1/agent/helpdesk/dept-ticket/tickets.blade.php similarity index 50% rename from resources/views/themes/default1/agent/helpdesk/dept-ticket/open.blade.php rename to resources/views/themes/default1/agent/helpdesk/dept-ticket/tickets.blade.php index d719ae067..14fb6a50d 100644 --- a/resources/views/themes/default1/agent/helpdesk/dept-ticket/open.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/dept-ticket/tickets.blade.php @@ -14,33 +14,54 @@ class="active" @section('PageHeader')

    {{Lang::get('lang.tickets')}}

    + @stop - @section('content') first(); -if (Auth::user()->role == 'admin') { - $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->count(); +if (Auth::user()->role == 'agent') { + $dept = App\Model\helpdesk\Agent\Department::select('id', 'name')->where('id', '=', Auth::user()->primary_dpt)->first(); + $tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20); + $dept_name = $dept->name; } else { - $dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first(); - $tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->count(); + $dept_name = \Request::segments()[1]; + $tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->paginate(20); } ?>
    -
    -

    {!! $dept->name !!} / {!! Lang::get('lang.open') !!} {!! $tickets !!} {!! Lang::get('lang.tickets') !!}

    -
    -
    -
    -
    +
    +

    {!! $dept_name !!} / {!! $status !!}

    {!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}
    -
    + +
    @if(Session::has('success'))
    - - Success + {{Session::get('success')}}
    @@ -48,130 +69,100 @@ if (Auth::user()->role == 'admin') { @if(Session::has('fails'))
    - - Fail! + {!! Lang::get('lang.alert') !!}! {{Session::get('fails')}}
    @endif - {!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!} -
    - - - - - - -
    -

    -

    - - - {!! Datatable::table() - ->addColumn( - "", - Lang::get('lang.subject'), - Lang::get('lang.ticket_id'), - Lang::get('lang.priority'), - Lang::get('lang.from'), - Lang::get('lang.assigned_to'), - Lang::get('lang.last_activity')) - ->setUrl(route('get.dept.open', $dept->id)) - - ->setOrder(array(6=>'desc')) - ->setClass('table table-hover table-bordered table-striped') - ->setCallbacks("fnRowCallback",'function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - var str = aData[3]; - if(str.search("#000") == -1) { - $("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #F3F3F3"}); - $("td", nRow).mouseenter(function(){ - $("td", nRow).css({"background-color":"#DEDFE0", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"}); - }); - $("td", nRow).mouseleave(function(){ - $("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd","border-right":"solid 0.5px #F3F3F3"}); - }); - } else { - $("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"}); - $("td", nRow).mouseenter(function(){ - $("td", nRow).css({"background-color":"#DEDFE0", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"}); - }); - $("td", nRow).mouseleave(function(){ - $("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"}); - }); - } - }') - ->render();!!} + + {!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!} + + + + {{-- --}} + + @if(Auth::user()->role == 'admin') + + @endif + + + + +
    + + {!!$table->render('vendor.Chumper.template')!!} + + +
    {!! Form::close() !!}
    -