--
-- Host: localhost    Database: kontakti_db
-- ------------------------------------------------------


--
-- Table structure for table `kontakt_osobe`
--

CREATE TABLE `kontakt_osobe` (
  `id` int NOT NULL AUTO_INCREMENT,
  `naziv` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefon` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `organizacija_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_kontakt_organizacija` (`organizacija_id`),
  CONSTRAINT `fk_kontakt_organizacija` FOREIGN KEY (`organizacija_id`) REFERENCES `organizacije` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kontakt_osobe`
--

INSERT INTO `kontakt_osobe` VALUES (1,'Tarik Jusupović','063/952-078',NULL),(3,'testna osoba','061/853-452',NULL),(5,'test7','06285285216',1),(6,'kakanj','065456789',3),(7,'rrr','062555',3),(8,'jooj','065/458-996',1);

--
-- Table structure for table `log_aktivnosti`
--

CREATE TABLE `log_aktivnosti` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `akcija` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vrijeme` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ip_adresa` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `browser` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `log_aktivnosti`
--

INSERT INTO `log_aktivnosti` VALUES (1,1,'Prijava u sistem','2026-02-25 20:50:51','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(2,1,'Dodao organizaciju: RMU Kakanj','2026-02-25 21:16:38','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(3,1,'Dodao kontakt osobu: test7','2026-02-25 21:24:55','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(4,1,'Inline izmjena sigurnog glasa ID: 5','2026-02-25 21:25:49','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(5,1,'Obrisao organizaciju ID: 2','2026-02-25 21:35:39','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(6,1,'Brza potvrda ID 8','2026-02-25 21:40:12','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(7,1,'Promijenjen status potvrde za osobu ID 8','2026-02-25 21:40:43','77.78.225.170','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(8,1,'Prijava u sistem','2026-02-26 05:58:20','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(9,1,'Dodao sigurni glas: Hamdija Lipovaća','2026-02-26 05:59:29','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(10,1,'Dodao organizaciju: BEZ ORGANIZACIJE','2026-02-26 06:00:16','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(11,1,'Inline izmjena sigurnog glasa ID: 7','2026-02-26 06:00:30','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(12,4,'Prijava u sistem','2026-02-26 06:02:22','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(13,1,'Prijava u sistem','2026-02-26 06:22:51','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(14,1,'Prijava u sistem','2026-02-26 07:41:56','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(15,1,'Prijava u sistem','2026-02-26 10:17:26','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(16,1,'Prijava u sistem','2026-02-26 13:10:31','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(17,1,'Prijava u sistem','2026-02-26 15:42:52','77.239.16.63','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36 EdgA/144.0.0.0'),(18,1,'Prijava u sistem','2026-02-26 20:50:40','77.239.16.63','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(19,1,'Prijava u sistem','2026-02-27 07:53:54','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(20,1,'Brza potvrda ID 9','2026-02-27 08:15:04','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(21,1,'Promijenjen status potvrde za osobu ID 9','2026-02-27 08:15:14','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(22,1,'Dodao kontakt osobu: kakanj','2026-02-27 08:30:18','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(23,1,'Izmjena kontakt osobe ID: 5','2026-02-27 08:39:30','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(24,1,'Dodao kontakt osobu: rrr','2026-02-27 08:40:01','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(25,1,'Dodao kontakt osobu: jooj','2026-02-27 08:51:11','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(26,1,'Dodao kontakt osobu: Hadmo','2026-02-27 08:55:18','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(27,1,'Izmjena kontakt osobe ID: 5','2026-02-27 08:55:31','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(28,1,'Dodao kontakt osobu: 55','2026-02-27 08:59:20','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(29,1,'Izmjena kontakt osobe ID: 10','2026-02-27 08:59:29','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(30,1,'Izmjena kontakt osobe ID: 9','2026-02-27 08:59:44','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(31,1,'Inline izmjena sigurnog glasa ID: 5','2026-02-27 09:05:34','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(32,1,'Inline izmjena sigurnog glasa ID: 1','2026-02-27 09:07:25','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(33,1,'Kreiran backup baze: backup_2026-02-27_09-31-38.sql','2026-02-27 09:31:38','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(34,1,'Obrisao kontakt osobu ID: 10','2026-02-27 09:32:07','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0'),(35,1,'Obrisao kontakt osobu ID: 9','2026-02-27 09:32:10','195.222.39.202','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0');

--
-- Table structure for table `logs`
--

CREATE TABLE `logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `logs`
--


--
-- Table structure for table `organizacije`
--

CREATE TABLE `organizacije` (
  `id` int NOT NULL AUTO_INCREMENT,
  `organizacija` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `organizacije`
--

INSERT INTO `organizacije` VALUES (1,'RMU Kakanj'),(3,'BEZ ORGANIZACIJE');

--
-- Table structure for table `osobe`
--

CREATE TABLE `osobe` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ime` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `prezime` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `adresa` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefon` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kontakt_osoba_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `potvrdjen` tinyint(1) DEFAULT '0',
  `organizacija_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kontakt_osoba_id` (`kontakt_osoba_id`),
  KEY `idx_telefon` (`telefon`),
  KEY `idx_ime_prezime` (`ime`,`prezime`),
  KEY `fk_organizacija` (`organizacija_id`),
  CONSTRAINT `fk_organizacija` FOREIGN KEY (`organizacija_id`) REFERENCES `organizacije` (`id`) ON DELETE SET NULL,
  CONSTRAINT `osobe_ibfk_1` FOREIGN KEY (`kontakt_osoba_id`) REFERENCES `kontakt_osobe` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `osobe`
--

INSERT INTO `osobe` VALUES (1,'Tarik','Jusupović','Almira Hasagića bb','062/555-888',1,'2026-02-24 15:22:27',0,NULL),(5,'test1','test','test','062/544-58889',5,'2026-02-24 21:31:19',0,NULL),(7,'Adi','Kubat','Kakanj','062/544-5888',5,'2026-02-25 06:23:29',0,NULL),(8,'Azra','Delibašić','Kakanj','062/555-888',1,'2026-02-25 09:33:06',0,NULL),(9,'Hamdija','Lipovaća','Zenica','062/555-444',5,'2026-02-26 05:59:29',0,NULL);

--
-- Table structure for table `sistemske_opcije`
--

CREATE TABLE `sistemske_opcije` (
  `id` int NOT NULL AUTO_INCREMENT,
  `opcija` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vrijednost` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `opcija` (`opcija`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sistemske_opcije`
--

INSERT INTO `sistemske_opcije` VALUES (1,'organizacije_modul',1),(2,'duplikati_modul',1),(3,'evidencija_modul',1),(4,'brisanje_osoba',1),(5,'prikaz_potvrdjenih_dashboard',0);


