DELETE FROM  Objekt;
DELETE FROM  Vo_Izgradba;
DELETE FROM  Gotov;
DELETE FROM  Nadzor;
DELETE FROM  Podizveduvac;
DELETE FROM  Rabotnik;
DELETE FROM  Dobavuvac;
DELETE FROM  Nabavka;
DELETE FROM  Korisnik;
DELETE FROM  Sopstvenik;
DELETE FROM  Raboti_Na;
DELETE FROM  Raboti_Za;
DELETE FROM  Nadgleduva;
DELETE FROM  Pobaruva;
DELETE FROM  Nameneta_Za;
DELETE FROM  Odobruva;
DELETE FROM  Oddrzuva;
DELETE FROM  Ispolnuva;
ALTER TABLE Korisnik AUTO_INCREMENT = 1;  

-- Insert data into Korisnik
INSERT INTO Korisnik (Username, Password, Privilegii) VALUES
('admin', 'Nectar7-Awry2-Tapioca6-Cycle4-Yapping9', 0),
('upravitel', 'Nectar7-Awry2-Tapioca6-Cycle4-Yapping9', 0),
('mile', 'Poncho6-Geologist6-Dropkick6-Haiku8-Blabber4', 1),
('sasha', 'passwordabc', 1),
('vlatko', '19781212vlatkovlatko', 1),
('magi', 'hudawlsd8987897', 1),
('akvaterm', 'passworq-pwefh-awddef', 2),
('betaelektrik', 'cnqe0w9uhcvaosudhjbcvoq', 2),
('dzidarprom', '0q823794tygrhfbaku', 2),
('fasadaplus', '123123pasvord', 2),
('primakrov', 'passworddef', 2),
('dvornikenz', 'asdasdasd123123', 2),
('rolokraft', '131313kuchemache', 2),
('megaenterier', 'testtest123123', 2),
('fullconstruct', 'bsjFvS235Fhk', 2);

-- Insert data into Sopstvenik
INSERT INTO Sopstvenik (UID) VALUES
(1);

-- Insert data into Nadzor
INSERT INTO Nadzor (Nadzor_Ime, Plata, Kvalifikacii, Firma, UID) VALUES
('Mile Kolevski', 50000, 'Civil Engineer', 'Domashen', 2),
('Sasha Ketic', 60000, 'Structural Engineer', 'ArchiCore', 3),
('Vlatko Senkov', 55000, 'Project Manager', 'BuildCorp', 4),
('Magdalena Filipova', 58000, 'Architect', 'DesignWorks', 5);

-- Insert data into Podizveduvac
INSERT INTO Podizveduvac (Podizveduvac_Ime, Struka, Br_vraboteni, Saatnica, UID) VALUES
('Akva Term', 'Plumbing', 3, 320.0, 7),
('Beta Elektrik', 'Electrical', 2, 360.0, 8),
('Dzidar Prom', 'Construction', 5, 240.0, 9),
('Fasada Plus', 'Construction', 4, 320.0, 10),
('Prima Krov', 'Roofing', 3, 280.0, 11),
('Dvornik Enzinering', 'Landscaping', 2, 200.0, 12),
('RoloKraft', 'Doors/Windows', 2, 280.0, 13),
('Mega Enterier', 'Interior', 4, 320.0, 14),
('FullConstruct', 'Hybrid', 7, 360.0, 15);

-- Insert data into Rabotnik
INSERT INTO Rabotnik (Maticen_br, Ime, Seniornost) VALUES
(1508198501234, 'Aleksandar', 'Senior'),
(2307199005678, 'Dimitar', 'Associate'),
(0502198802345, 'Stefan', 'Assistant'),
(1803199204567, 'Vladimir', 'Senior'),
(1012199707890, 'Nikola', 'Assistant'),
(0708198501234, 'Petar', 'Associate'),
(2203199105678, 'Igor', 'Senior'),
(0304198902345, 'Goran', 'Assistant'),
(2606199504567, 'Filip', 'Associate'),
(1207199307890, 'Mihail', 'Assistant'),
(0405198501234, 'Marko', 'Senior'),
(2306198805678, 'Dragan', 'Assistant'),
(0902199202345, 'Dejan', 'Associate'),
(1508199404567, 'Zoran', 'Senior'),
(2104199107890, 'Nenad', 'Assistant'),
(1905198701234, 'Slavko', 'Associate'),
(0802198905678, 'Milan', 'Senior'),
(2403199502345, 'Bojan', 'Assistant'),
(1706199304567, 'Mladen', 'Associate'),
(0110199107890, 'Saša', 'Assistant'),
(2601199201234, 'Arben', 'Senior'),
(1406199405678, 'Adnan', 'Associate'),
(2003199702345, 'Besnik', 'Assistant'),
(0507199004567, 'Elvir', 'Senior'),
(0704199307890, 'Agron', 'Assistant'),
(1011199101234, 'Lirim', 'Associate'),
(1806199505678, 'Alban', 'Senior'),
(3008199602345, 'Fatmir', 'Assistant'),
(1705199104567, 'Ilir', 'Associate'),
(2202199007890, 'Gazmend', 'Assistant'),
(2409198801234, 'Kristijan', 'Assistant'),
(0212199005678, 'Tome', 'Associate');

-- Insert data into Dobavuvac
INSERT INTO Dobavuvac (Dobavuvac_Ime, Klasa, Tip, Poteklo) VALUES
('MegaPlast', 'A', 'Materijal', 'Domestic'),
('GlobalSupplies', 'B', 'Oprema', 'International'),
('MetroMaterial', 'A', 'Materijal', 'Domestic'),
('UrbanTools', 'C', 'Alat', 'International'),
('CraftEquip', 'B', 'Materijal', 'International');

-- Insert data into Nabavka
INSERT INTO Nabavka (Nabavka_ID, Datum, Cena, Kolicina, Predmet) VALUES
(1, '2024-01-01', 1000.0, 50, 'Cement'),
(2, '2024-01-02', 500.0, 20, 'Steel Rods'),
(3, '2024-01-03', 300.0, 100, 'Brick'),
(4, '2024-01-04', 200.0, 10, 'Paint'),
(5, '2024-01-05', 400.0, 30, 'Wood'),
(6, '2024-01-06', 300.0, 100, 'Brick'),
(7, '2024-01-07', 800.0, 40, 'Cement'),
(8, '2024-01-08', 600.0, 25, 'Steel Rods'),
(9, '2024-01-09', 450.0, 15, 'Tiles'),
(10, '2024-01-10', 200.0, 10, 'Paint'),
(11, '2024-01-11', 350.0, 20, 'Wood'),
(12, '2024-01-12', 700.0, 35, 'Cement'),
(13, '2024-01-13', 250.0, 50, 'Brick'),
(14, '2024-01-14', 150.0, 8, 'Paint'),
(15, '2024-01-15', 500.0, 25, 'Steel Rods'),
(16, '2024-01-16', 400.0, 20, 'Plaster'),
(17, '2024-01-17', 1000.0, 30, 'Ceramics'),
(18, '2024-01-18', 300.0, 15, 'Tiles'),
(19, '2024-01-19', 200.0, 10, 'Paint'),
(20, '2024-01-20', 400.0, 50, 'Brick'),
(21, '2024-01-21', 350.0, 25, 'Cement'),
(22, '2024-01-22', 300.0, 15, 'Wood'),
(23, '2024-01-23', 600.0, 30, 'Steel Rods'),
(24, '2024-01-24', 250.0, 12, 'Tiles'),
(25, '2024-01-25', 500.0, 50, 'Brick'),
(26, '2024-01-26', 150.0, 8, 'Paint'),
(27, '2024-01-27', 700.0, 40, 'Cement'),
(28, '2024-01-28', 400.0, 20, 'Plaster'),
(29, '2024-01-29', 1000.0, 25, 'Fire Extinguishers'),
(30, '2024-01-29', 1000.0, 25, 'General Tools'),
(31, '2024-01-30', 450.0, 30, 'Safety Equipment');


-- Insert data into Objekt
INSERT INTO Objekt (Objekt_ID, Tip, Adresa) VALUES
(1, 'Commercial', 'Ulica ulicovska br. 6 Skopje'),
(2, 'Commercial', 'Ulica 23 br. 4 Skopje'),
(3, 'Commercial', 'Ulica Ruzveltova br. 8 Valandovo'),
(4, 'Mixed-Use', 'Ulica 4 br. 7 Veles'),
(5, 'Commercial', 'Ulica 17 br 2 Shtip');

-- Insert data into Vo_Izgradba
INSERT INTO Vo_Izgradba (Objekt_ID, Budzet) VALUES
(1, 500000.0),
(3, 750000.0);

-- Insert data into Gotov
INSERT INTO Gotov (Objekt_ID) VALUES
(2),
(4),
(5);

-- Insert data into Raboti_Na
INSERT INTO Raboti_Na (Objekt_ID, UID_p, Od_vreme, Do_vreme) VALUES
(1, 7, '2024-01-01', '2024-01-15'),  -- Akva Term
(1, 8, '2024-01-03', '2024-01-17'),  -- Beta Elektrik
(1, 9, '2024-01-05', '2024-01-12'),  -- Dzidar Prom
(1, 10, '2024-01-07', '2024-01-14'), -- Fasada Plus
(1, 11, '2024-01-01', '2024-01-13'), -- Prima Krov
(1, 12, '2024-01-04', '2024-01-19'), -- Dvornik Enzinering
(1, 13, '2024-01-05', '2024-01-21'), -- RoloKraft
(1, 14, '2024-01-02', '2024-01-16'), -- Mega Enterier
(1, 15, '2024-01-06', '2024-01-22'), -- FullConstruct
(2, 7, '2024-01-07', '2024-01-20'),  -- Akva Term
(2, 8, '2024-01-03', '2024-01-14'),  -- Beta Elektrik
(2, 9, '2024-01-10', '2024-01-27'),  -- Dzidar Prom
(2, 10, '2024-01-02', '2024-01-16'), -- Fasada Plus
(2, 11, '2024-01-01', '2024-01-13'), -- Prima Krov
(2, 12, '2024-01-04', '2024-01-19'), -- Dvornik Enzinering
(2, 13, '2024-01-03', '2024-01-10'), -- RoloKraft
(2, 14, '2024-01-05', '2024-01-12'), -- Mega Enterier
(2, 15, '2024-01-06', '2024-01-20'); -- FullConstruct

-- Insert data into Raboti_Za
INSERT INTO Raboti_Za (Maticen_br, UID_p) VALUES
(1508198501234, 7),  -- Akva Term
(2307199005678, 7),  -- Akva Term
(0502198802345, 7),  -- Akva Term
(1803199204567, 8),  -- Beta Elektrik
(1012199707890, 8),  -- Beta Elektrik
(0708198501234, 9),  -- Dzidar Prom
(2203199105678, 9),  -- Dzidar Prom
(0304198902345, 9),  -- Dzidar Prom
(2606199504567, 9),  -- Dzidar Prom
(1207199307890, 9),  -- Dzidar Prom
(0405198501234, 10), -- Fasada Plus
(2306198805678, 10), -- Fasada Plus
(0902199202345, 10), -- Fasada Plus
(1508199404567, 10), -- Fasada Plus
(2104199107890, 11), -- Prima Krov
(1905198701234, 11), -- Prima Krov
(0802198905678, 11), -- Prima Krov
(2403199502345, 12), -- Dvornik Enzinering
(1706199304567, 12), -- Dvornik Enzinering
(0110199107890, 13), -- RoloKraft
(2601199201234, 13), -- RoloKraft
(1406199405678, 14), -- Mega Enterier
(2003199702345, 14), -- Mega Enterier
(0507199004567, 14), -- Mega Enterier
(0704199307890, 14), -- Mega Enterier
(1011199101234, 15), -- FullConstruct
(1806199505678, 15), -- FullConstruct
(3008199602345, 15), -- FullConstruct
(1705199104567, 15), -- FullConstruct
(2202199007890, 15), -- FullConstruct
(2409198801234, 15), -- FullConstruct
(0212199005678, 15); -- FullConstruct

-- Insert data into Nadgleduva
INSERT INTO Nadgleduva (Objekt_ID, UID_n) VALUES
(1, 3),  -- Sasha Ketic
(3, 5);  -- Magdalena Filipova

-- Insert data into Pobaruva
INSERT INTO Pobaruva (Nabavka_ID, UID_p) VALUES
(1, 7),  -- Akva Term
(2, 8),  -- Beta Elektrik
(3, 9),  -- Dzidar Prom
(4, 10), -- Fasada Plus
(5, 11), -- Prima Krov
(6, 7),  -- Akva Term
(7, 8),  -- Beta Elektrik
(8, 9),  -- Dzidar Prom
(9, 10), -- Fasada Plus
(10, 11), -- Prima Krov
(11, 7),  -- Akva Term
(12, 8),  -- Beta Elektrik
(13, 9),  -- Dzidar Prom
(14, 10), -- Fasada Plus
(15, 11), -- Prima Krov
(16, 7),  -- Akva Term
(17, 8),  -- Beta Elektrik
(18, 9),  -- Dzidar Prom
(19, 10), -- Fasada Plus
(20, 11), -- Prima Krov
(21, 7),  -- Akva Term
(22, 8),  -- Beta Elektrik
(23, 9),  -- Dzidar Prom
(24, 10), -- Fasada Plus
(25, 11), -- Prima Krov
(26, 7),  -- Akva Term
(27, 8),  -- Beta Elektrik
(28, 9),  -- Dzidar Prom
(29, 10), -- Fasada Plus
(30, 11), -- Prima Krov
(31, 15); -- FullConstruct

-- Insert data into Odobruva
INSERT INTO Odobruva (Nabavka_ID, UID_n) VALUES
(1, 3),  -- Sasha Ketic
(2, 5),  -- Magdalena Filipova
(3, 5),  -- Magdalena Filipova
(4, 3),  -- Sasha Ketic
(5, 5),  -- Magdalena Filipova
(6, 5),  -- Magdalena Filipova
(7, 5),  -- Magdalena Filipova
(8, 5),  -- Magdalena Filipova
(9, 3),  -- Sasha Ketic
(10, 3), -- Sasha Ketic
(11, 5),  -- Magdalena Filipova
(12, 5),  -- Magdalena Filipova
(13, 5),  -- Magdalena Filipova
(14, 5),  -- Magdalena Filipova
(15, 5),  -- Magdalena Filipova
(16, 3),  -- Sasha Ketic
(17, 3),  -- Sasha Ketic
(18, 5),  -- Magdalena Filipova
(19, 3),  -- Sasha Ketic
(20, 5),  -- Magdalena Filipova
(21, 5),  -- Magdalena Filipova
(22, 5),  -- Magdalena Filipova
(23, 5),  -- Magdalena Filipova
(24, 3),  -- Sasha Ketic
(25, 5),  -- Magdalena Filipova
(26, 5),  -- Magdalena Filipova
(27, 3),  -- Sasha Ketic
(28, 3),  -- Sasha Ketic
(29, 3),  -- Sasha Ketic
(30, 3),  -- Sasha Ketic
(31, 5);  -- Magdalena Filipova

-- Insert data into Nameneta_Za
INSERT INTO Nameneta_Za (Nabavka_ID, Objekt_ID) VALUES
(1, '3'),
(2, '1'),
(3, '1'),
(4, '1'),
(5, '3'),
(6, '3'),
(7, '3'),
(8, '3'),
(9, '1'),
(10, '1'),
(11, '3'),
(12, '3'),
(13, '3'),
(14, '3'),
(15, '3'),
(16, '1'),
(17, '1'),
(18, '3'),
(19, '1'),
(20, '3'),
(21, '3'),
(22, '3'),
(23, '3'),
(24, '1'),
(25, '3'),
(26, '3'),
(27, '1'),
(28, '1'),
(29, '1'),
(30, '1'),
(31, '3');

-- Insert data into Ispolnuva
INSERT INTO Ispolnuva (Nabavka_ID, Dobavuvac_Ime) VALUES
(1, 'GlobalSupplies'),
(2, 'MegaPlast'),
(3, 'GlobalSupplies'),
(4, 'UrbanTools'),
(5, 'MegaPlast'),
(6, 'UrbanTools'),
(7, 'CraftEquip'),
(8, 'CraftEquip'),
(9, 'UrbanTools'),
(10, 'GlobalSupplies'),
(11, 'CraftEquip'),
(12, 'GlobalSupplies'),
(13, 'UrbanTools'),
(14, 'MegaPlast'),
(15, 'GlobalSupplies'),
(16, 'UrbanTools'),
(17, 'UrbanTools'),
(18, 'GlobalSupplies'),
(19, 'MetroMaterial'),
(20, 'CraftEquip'),
(21, 'GlobalSupplies'),
(22, 'MetroMaterial'),
(23, 'MetroMaterial'),
(24, 'GlobalSupplies'),
(25, 'CraftEquip'),
(26, 'MetroMaterial'),
(27, 'MegaPlast'),
(28, 'GlobalSupplies'),
(29, 'GlobalSupplies'),
(30, 'MetroMaterial'),
(31, 'UrbanTools');

-- Insert data into Oddrzuva
INSERT INTO Oddrzuva (Objekt_ID, UID_p, Od_vreme, Do_vreme) VALUES
(2, 15, '2020-01-01', '2020-01-08'), -- FullConstruct
(4, 15, '2020-02-01', '2020-02-08'), -- FullConstruct
(4, 7,  '2020-03-01', '2020-03-08'), -- Akva Term
(5, 15, '2020-08-01', '2020-08-08'); -- FullConstruct

-- Enable foreign key checks
