--
-- Host: 94.130.188.86    Database: t-spens
-- ------------------------------------------------------

/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */;
/*!50717 PREPARE s FROM @rocksdb_get_is_supported */;
/*!50717 EXECUTE s */;
/*!50717 DEALLOCATE PREPARE s */;
/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */;
/*!50717 EXECUTE s */;
/*!50717 DEALLOCATE PREPARE s */;

--
-- Table structure for table `advance`
--

CREATE TABLE `advance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `PIB` varchar(50) NOT NULL,
  `invoice_num` varchar(50) NOT NULL,
  `datetime` datetime NOT NULL,
  `article_ids` varchar(50) NOT NULL,
  `article_counts` varchar(50) NOT NULL,
  `invoice_type` varchar(20) NOT NULL,
  `previous_advance` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_advance_company` (`PIB`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `advance`
--


--
-- Table structure for table `application_pages`
--

CREATE TABLE `application_pages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT '0',
  `path` varchar(255) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `application_pages`
--

INSERT INTO `application_pages` VALUES (1,'Pocetna','/home'),(2,'Aktivne karte','/active'),(3,'Prosle karte','/passed'),(4,'Neaktivne karte','/nonactive'),(5,'Prodate karte','/sold'),(6,'Karte po kategorijama','/category'),(7,'Karte po tipovima','/type'),(8,'Karte po vrstama','/kind'),(9,'Biletar','/log_card'),(10,'Nacin placanja','/payment_method'),(11,'Monitor','/monitoring'),(12,'Nov citac','/new-reader'),(13,'Nova karta','/new-ticket'),(14,'Nov korisnik','/new-user'),(15,'Dnevni izvestaj','/dailyrep'),(16,'Pretraga po broju karte','/ticket-info'),(17,'Dodela prava','/access'),(18,'Lista citaca','/readers'),(19,'Izmeni podatke o karti','/ticket/edit'),(20,'Izmeni citac','/readers/edit'),(21,'Lista cenovnik','/price-list'),(22,'Izmeni artikal','/price-list/edit'),(23,'Novi artikal','/new-item'),(24,'Obrisi artikal','/price-list/delete'),(25,'Nova kategorija','/new-category'),(26,'Nova vrsta','/new-kind'),(27,'Pretrazi korisnike','/search-users'),(28,'Kupovina','/purchasing'),(29,'Podesavanja mail','/settings'),(30,'Azuriranje baze','/update-database'),(31,'Grupe karata','/template-groups'),(32,'Dogadjaji grupa','/template-group-events'),(33,'Dizajn karte','/ticket-design'),(34,'Kamere','/hik'),(35,'Log fajlovi','/logs'),(36,'Zaposleni','/new-employee'),(37,'Organizacione jedinice','/new-organization-unit'),(38,'Artikli','/new-article'),(39,'Jedinice mere','/new-unit-of-measure'),(40,'Sastojci','/new-ingredient'),(41,'Refundacija','/refund'),(42,'Izvestaji fiskalizacije','/fiscalization-reports'),(43,'Novi tip','/new-type');

--
-- Table structure for table `application_permissions`
--

CREATE TABLE `application_permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `page_id` int(11) NOT NULL,
  `permission` varchar(50) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `user_id` (`user_id`,`page_id`,`permission`) USING BTREE,
  KEY `page_id` (`page_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=213 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `application_permissions`
--

INSERT INTO `application_permissions` VALUES (48,1,1,'view'),(49,1,2,'view'),(50,1,3,'view'),(51,1,4,'view'),(52,1,5,'view'),(53,1,6,'view'),(54,1,7,'view'),(55,1,8,'view'),(56,1,9,'view'),(57,1,10,'view'),(58,1,11,'view'),(59,1,12,'create'),(60,1,13,'create'),(61,1,14,'create'),(62,1,15,'view'),(63,1,16,'view'),(64,1,17,'view'),(65,1,18,'view'),(66,1,19,'edit'),(67,1,20,'edit'),(94,1,21,''),(95,1,22,''),(96,1,23,''),(97,1,24,''),(107,1,26,''),(106,1,25,''),(108,1,27,''),(109,1,28,''),(110,1,29,''),(111,1,30,''),(112,1,31,''),(113,1,32,''),(114,1,33,''),(115,1,34,''),(116,1,35,''),(169,1,36,''),(170,1,37,''),(171,1,38,''),(172,1,39,''),(173,1,40,''),(174,1,41,''),(175,1,42,''),(212,1,43,'');

--
-- Table structure for table `article`
--

CREATE TABLE `article` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `unit_of_measure_id` int(11) NOT NULL,
  `num_portion` int(11) NOT NULL,
  `unit_price` float NOT NULL,
  `active` tinyint(1) NOT NULL,
  `button` int(11) NOT NULL,
  `type` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `unit_of_measure_id` (`unit_of_measure_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `article`
--


--
-- Table structure for table `category`
--

CREATE TABLE `category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `category`
--

INSERT INTO `category` VALUES (1,'ODRASLI'),(2,'DECA');

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

CREATE TABLE `companies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `PIB` varchar(50) NOT NULL,
  `address` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `PIB` (`PIB`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `companies`
--


--
-- Table structure for table `company_devices`
--

CREATE TABLE `company_devices` (
  `mac_addr` varchar(50) NOT NULL DEFAULT '''''',
  `device_type` int(11) DEFAULT NULL,
  `datetime` timestamp NULL DEFAULT NULL,
  `writer` varchar(50) DEFAULT NULL,
  `company` varchar(50) DEFAULT NULL,
  `description` text,
  `pib` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`mac_addr`),
  KEY `company` (`company`),
  KEY `pib` (`pib`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `company_devices`
--


--
-- Table structure for table `configure`
--

CREATE TABLE `configure` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `value` text,
  `description` text,
  `visible` tinyint(1) NOT NULL DEFAULT '0',
  `flag1` tinyint(1) NOT NULL DEFAULT '0',
  `flag2` tinyint(1) NOT NULL DEFAULT '0',
  `flag3` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `configure`
--

INSERT INTO `configure` VALUES (1,'mail_host','mailcluster.loopia.se','SMTP server',1,0,0,0),(2,'mail_username','no-reply@dal.rs','Korisnicko ime',1,0,0,0),(3,'mail_password','fVFoo!M9W7uLh','Lozinka',1,0,0,0),(4,'mail_port','587','Port',1,0,0,0),(5,'current_version','','Trenutna verzija baze, poslednji primenjen update',0,0,0,0),(6,'mode','0','Odredjuje da li ce se koristiti template group funkcionalnost (1), ili ne',0,0,0,0),(7,'count_exit','1','Da li izlaz skida prolaze',0,0,0,0),(8,'days_hik_images','1','Slike sa kamera starije od koliko dana se brisu',1,0,0,0),(9,'fiscalization_mode','2','2-koristi fiskalizaciju, 1-trening mod fiskalizacije',0,0,0,0),(10,'anti_passback_reset','1','1-antipassback radi do ponoci',0,0,0,0),(11,'periods_mode','0','1-koristi se tabela period',0,0,0,0),(12,'camera_mode','0','Da li se koriste kamera i tablice',0,0,0,0),(14,'locker_master_ids','',NULL,0,0,0,0),(15,'locker_trainer_ids','',NULL,0,0,0,0),(16,'locker_lifetime_ids','',NULL,0,0,0,0),(17,'camera_default_ip','','Default IP adresa HikVision kamere',0,0,0,0),(18,'camera_default_user','','Default korisničko ime za kameru',0,0,0,0),(19,'camera_default_pass','','Default lozinka za kameru',0,0,0,0),(20,'camera_default_reader_id','','Default ID čitača koji se koristi za otvaranje rampe',0,0,0,0);

--
-- Table structure for table `current`
--

CREATE TABLE `current` (
  `mac_addr` varchar(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `command` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `result` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT '',
  PRIMARY KEY (`mac_addr`) USING BTREE,
  KEY `mac_addr_index` (`mac_addr`) USING BTREE,
  KEY `command_index` (`command`) USING BTREE,
  KEY `datetime_index` (`datetime`) USING BTREE,
  KEY `result_index` (`result`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `current`
--


--
-- Table structure for table `employee`
--

CREATE TABLE `employee` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serial_num` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `photo` text,
  `jmbg` varchar(13) NOT NULL,
  `active` tinyint(1) NOT NULL,
  `sector` varchar(255) DEFAULT NULL,
  `organization_unit_id` int(11) NOT NULL,
  `workplace` varchar(255) DEFAULT NULL,
  `section` varchar(255) DEFAULT NULL,
  `limit_type` varchar(50) DEFAULT NULL,
  `daily_limit` float DEFAULT NULL,
  `monthly_limit_id` int(11) DEFAULT NULL,
  `credit` float DEFAULT NULL,
  `holiday_name` varchar(255) DEFAULT NULL,
  `holiday_date` date DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `organization_unit_id` (`organization_unit_id`),
  KEY `monthly_limit_id` (`monthly_limit_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `employee`
--


--
-- Table structure for table `group_events`
--

CREATE TABLE `group_events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` varchar(50) NOT NULL,
  `start` datetime NOT NULL,
  `end` datetime NOT NULL,
  `blocked_groups` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `group_events`
--


--
-- Table structure for table `ingredient`
--

CREATE TABLE `ingredient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `amount` float NOT NULL,
  `unit_of_measure_id` int(11) NOT NULL,
  `unit_price` float NOT NULL,
  PRIMARY KEY (`id`),
  KEY `unit_of_measure_id` (`unit_of_measure_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ingredient`
--


--
-- Table structure for table `kind`
--

CREATE TABLE `kind` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `kind_name` varchar(30) DEFAULT NULL,
  `day_no` int(11) NOT NULL DEFAULT '0',
  `entry_no` varchar(50) DEFAULT NULL,
  `daily_no` int(11) NOT NULL DEFAULT '0',
  `time_from` time NOT NULL DEFAULT '00:00:01',
  `time_to` time NOT NULL DEFAULT '23:59:59',
  `type` varchar(15) DEFAULT NULL,
  `templates` varchar(255) DEFAULT NULL,
  `dynamic_time_for_pp` int(11) DEFAULT '0',
  `allowed_days` varchar(20) DEFAULT '1,2,3,4,5,6,7',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `kind`
--

INSERT INTO `kind` VALUES (1,'Dnevna radni dan',1,'1',1,'08:00:00','20:00:00','1','NULL',0,'1,2,3,4,5');

--
-- Table structure for table `license_activations`
--

CREATE TABLE `license_activations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `license_key` varchar(64) NOT NULL,
  `device_id` varchar(64) NOT NULL,
  `activated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `hardware_hash` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `license_key` (`license_key`,`device_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `license_activations`
--


--
-- Table structure for table `licenses`
--

CREATE TABLE `licenses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `license_key` varchar(64) NOT NULL,
  `unlimited` tinyint(1) DEFAULT '0',
  `max_devices` int(11) DEFAULT '1',
  `expiration_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `license_key` (`license_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `licenses`
--


--
-- Table structure for table `lockers_events`
--

CREATE TABLE `lockers_events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `card_serial` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `card_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `locker_id` int(11) DEFAULT NULL,
  `event_type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event_datetime` datetime NOT NULL,
  `reject` int(11) NOT NULL,
  `reader_serial_num` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_card_serial` (`card_serial`),
  KEY `idx_locker_id` (`locker_id`),
  KEY `idx_event_datetime` (`event_datetime`),
  KEY `idx_event_type` (`event_type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `lockers_events`
--


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

CREATE TABLE `messages` (
  `mess_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `short_desc` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `long_desc` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`mess_num`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` VALUES ('0','Success','Success'),('1','Wrong ticket','Karta ne postoji'),('2','Entry number expiration','Ispunjen broj ulaza'),('3','Day number expiration','Ispunjen broj dana'),('4','Wrong time interval','Pogresan vremenski interval'),('5','Exceeded daily passage','Dnevni limit'),('6','Not active','Karta je neaktivna'),('7','Device error','Pogresan citac'),('8','Not valid','Nije uspela validacija karte'),('101','Wrong parameter','Nedostaje parametar'),('10','Blocked group','Grupa je blokirana za ovaj dogadjaj'),('90','Invalid reader','Citac ne postoji ili nije aktivan'),('11','Cooldown','Citac je na cooldown-u'),('12','Not valid','Passback detected'),('13','WS error','Greska sa ws serverom'),('9','Not valid today','Karta ne vazi za danasnji dan'),('00','Success','Success'),('14','Wrong day period','Pogresna smena (period)'),('15','Exceeded period passage','Ispunjen broj prolaza za period');

--
-- Table structure for table `monthly_limit`
--

CREATE TABLE `monthly_limit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `year` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `start` date NOT NULL,
  `end` date NOT NULL,
  `num_working_days` int(11) NOT NULL,
  `limit` float DEFAULT '0',
  `daily_limit` float DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `monthly_limit`
--


--
-- Table structure for table `organization_unit`
--

CREATE TABLE `organization_unit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `special_category` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `organization_unit`
--


--
-- Table structure for table `period`
--

CREATE TABLE `period` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `start` time DEFAULT NULL,
  `end` time DEFAULT NULL,
  `number_of_passes` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `period`
--


--
-- Table structure for table `price_list`
--

CREATE TABLE `price_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `price` varchar(10) NOT NULL,
  `vat` int(11) NOT NULL,
  `type` varchar(30) NOT NULL,
  `kind` varchar(30) NOT NULL,
  `category` varchar(30) NOT NULL,
  `day_no` int(11) NOT NULL DEFAULT '0',
  `entry_no` varchar(50) DEFAULT NULL,
  `daily_no` int(11) NOT NULL DEFAULT '0',
  `time_from` time NOT NULL DEFAULT '00:00:01',
  `time_to` time NOT NULL DEFAULT '23:59:59',
  `category_id` int(11) DEFAULT NULL,
  `type_id` int(11) DEFAULT NULL,
  `log_card` int(5) DEFAULT NULL,
  `templates` varchar(255) DEFAULT NULL,
  `tax_group` varchar(5) DEFAULT '3',
  `discount` int(2) DEFAULT '0',
  `readers` varchar(255) DEFAULT NULL,
  `user_log` int(11) DEFAULT '0',
  `description` varchar(255) DEFAULT NULL,
  `color` int(11) DEFAULT '1',
  `template_id` int(11) DEFAULT NULL,
  `vendor` varchar(50) DEFAULT NULL,
  `allowed_days` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_template` (`template_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `price_list`
--


--
-- Table structure for table `qr_designs`
--

CREATE TABLE `qr_designs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `width` int(11) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `background_color` varchar(50) DEFAULT NULL,
  `font_family` varchar(100) DEFAULT NULL,
  `text_color` varchar(50) DEFAULT NULL,
  `qr_position_x` int(11) DEFAULT NULL,
  `qr_position_y` int(11) DEFAULT NULL,
  `qr_size` int(11) DEFAULT NULL,
  `texts_id` varchar(255) DEFAULT NULL,
  `texts_content` varchar(255) DEFAULT NULL,
  `texts_x` varchar(255) DEFAULT NULL,
  `texts_y` varchar(255) DEFAULT NULL,
  `texts_font_size` varchar(255) DEFAULT NULL,
  `texts_visible` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `qr_designs`
--

INSERT INTO `qr_designs` VALUES (13,300,400,'#ffffff','Arial','#000000',96,238,89,'1,2,3,4,5,6,7,8,9,10,11,12','text1,,category,description,kind,type,price,discount,vat,endDate,text2,text3','10,50,10,10,10,10,10,10,10,10,10,10','10,30,50,70,100,120,140,160,180,200,220,240','14,14,14,14,14,14,14,14,14,14,16,14',',,1,1,1,1,1,1,1,1,,');

--
-- Table structure for table `readers`
--

CREATE TABLE `readers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT '',
  `serial_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `active` int(11) DEFAULT NULL,
  `anti_passback` tinyint(1) DEFAULT '0',
  `access_type` varchar(20) DEFAULT NULL,
  `reader_group` varchar(50) DEFAULT NULL,
  `cooldown` int(11) DEFAULT '0',
  `cooldown_group` varchar(50) DEFAULT NULL,
  `open_duration` int(11) DEFAULT NULL,
  `locker_reader` varchar(2) DEFAULT NULL,
  `barrier_sn` varchar(15) DEFAULT NULL,
  `locker_nums` varchar(255) DEFAULT NULL,
  `no_lockers` int(11) DEFAULT NULL,
  UNIQUE KEY `Index 1` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `readers`
--


--
-- Table structure for table `recipe`
--

CREATE TABLE `recipe` (
  `article_id` int(11) NOT NULL,
  `ingredient_id` int(11) NOT NULL,
  `norm_per_portion` float NOT NULL,
  PRIMARY KEY (`article_id`,`ingredient_id`),
  KEY `ingredient_id` (`ingredient_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `recipe`
--


--
-- Table structure for table `ticket_template_groups`
--

CREATE TABLE `ticket_template_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `color` varchar(7) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ticket_template_groups`
--


--
-- Table structure for table `ticket_users`
--

CREATE TABLE `ticket_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT '0',
  `surname` varchar(50) DEFAULT '0',
  `phone` varchar(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ticket_users`
--


--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `id` int(11) NOT NULL DEFAULT '0',
  `ticket_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `change_time` datetime NOT NULL,
  `create_time` datetime NOT NULL COMMENT 'od kada vazi karta',
  `h_from` time NOT NULL DEFAULT '00:00:00' COMMENT 'od Xh',
  `h_to` time NOT NULL DEFAULT '00:00:00' COMMENT 'do Xh',
  `day_no` int(11) NOT NULL DEFAULT '0' COMMENT 'ukupan broj dana vazenja od trenutka kreiranja',
  `entry_no` varchar(50) NOT NULL DEFAULT '' COMMENT 'ukupan broj dozvoljenih prolaza',
  `daily_no` int(4) NOT NULL DEFAULT '0' COMMENT 'broj dozvoljenih dnevnih prolaza',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'vreme bilo kakve izmene',
  `active` int(11) NOT NULL DEFAULT '1' COMMENT 'aktivna ili je istekla / blokirana',
  `readers` varchar(100) DEFAULT NULL COMMENT 'citaci na kojima karta sme da prodje',
  `sum_daily_passes` int(11) DEFAULT NULL COMMENT 'koliko se prolaza dogodilo danas',
  `sum_total_passes` int(11) DEFAULT NULL COMMENT 'koliko je iskorisceno ukupno prolaza',
  `blocked` int(11) DEFAULT NULL,
  `submitter` varchar(50) DEFAULT NULL,
  `template` varchar(10) DEFAULT NULL,
  `color` int(11) DEFAULT '1',
  `registration` varchar(50) DEFAULT NULL,
  `template_id` int(11) DEFAULT NULL,
  `allowed_days` varchar(20) DEFAULT '1,2,3,4,5,6,7',
  `periods` varchar(100) DEFAULT NULL,
  `periods_flag` tinyint(4) DEFAULT '0',
  `email` varchar(50) DEFAULT NULL,
  `reader_group` varchar(50) DEFAULT NULL,
  KEY `Index 1` (`ticket_id`) USING BTREE,
  KEY `fk_template` (`template_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='- id kartice i prava prolaza';

--
-- Dumping data for table `tickets`
--


--
-- Table structure for table `transaction`
--

CREATE TABLE `transaction` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `datetime` datetime NOT NULL,
  `transaction` varchar(255) NOT NULL,
  `article_id` int(11) NOT NULL,
  `amount` float NOT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_id` (`employee_id`),
  KEY `article_id` (`article_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `transaction`
--


--
-- Table structure for table `type`
--

CREATE TABLE `type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `type`
--

INSERT INTO `type` VALUES (1,'Papirna'),(2,'Plasticna');

--
-- Table structure for table `unit_of_measure`
--

CREATE TABLE `unit_of_measure` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `unit_of_measure`
--

/*!50112 PREPARE s FROM @disable_bulk_load */;
/*!50112 EXECUTE s */;
/*!50112 DEALLOCATE PREPARE s */;


