-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 21, 2026 at 08:29 PM
-- Server version: 8.0.21
-- PHP Version: 7.4.9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `palacinkarnica2026`
--
CREATE DATABASE IF NOT EXISTS `palacinkarnica2026` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `palacinkarnica2026`;

-- --------------------------------------------------------

--
-- Table structure for table `dodaci`
--

DROP TABLE IF EXISTS `dodaci`;
CREATE TABLE IF NOT EXISTS `dodaci` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tip` enum('slana','slatka','prazna','') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `naziv` varchar(100) NOT NULL,
  `na_zalihama` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `dodaci`
--

INSERT INTO `dodaci` (`id`, `tip`, `naziv`, `na_zalihama`) VALUES
(1, 'slana', 'sunka', 1),
(2, 'slana', 'kackavalj', 1),
(3, 'slana', 'kulen', 0),
(4, 'slana', 'pavlaka', 1),
(5, 'slatka', 'eurokrem', 1),
(6, 'slatka', 'nutela', 0),
(7, 'slatka', 'visnja', 1),
(8, 'slatka', 'plazma', 1);

-- --------------------------------------------------------

--
-- Table structure for table `korisnici`
--

DROP TABLE IF EXISTS `korisnici`;
CREATE TABLE IF NOT EXISTS `korisnici` (
  `korisnicko_ime` varchar(50) NOT NULL,
  `lozinka` varchar(50) NOT NULL,
  `ime` varchar(50) NOT NULL,
  `prezime` varchar(50) NOT NULL,
  `email` varchar(70) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `tip` varchar(50) NOT NULL,
  PRIMARY KEY (`korisnicko_ime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `korisnici`
--

INSERT INTO `korisnici` (`korisnicko_ime`, `lozinka`, `ime`, `prezime`, `email`, `tip`) VALUES
('ana', 'ana123', 'Ana', 'Stojanovic', 'anchi@mail.com', 'kupac'),
('jova', 'jova123', 'Jovan', 'Jovanovic', 'jova@mail.com', 'kupac'),
('kaja', 'kaja123', 'Kaja', 'Plavsic', 'kaja@mail.com', 'radnik'),
('mare', 'mare123', 'Marko', 'Markovic', 'mare@mail.com', 'kupac');

-- --------------------------------------------------------

--
-- Table structure for table `narudzbine`
--

DROP TABLE IF EXISTS `narudzbine`;
CREATE TABLE IF NOT EXISTS `narudzbine` (
  `id` int NOT NULL AUTO_INCREMENT,
  `korisnik` varchar(50) NOT NULL,
  `tip` enum('slana','slatka','prazna','') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `dodaci` varchar(250) NOT NULL,
  `pohovana` tinyint(1) NOT NULL,
  `status` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_korisnik` (`korisnik`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `narudzbine`
--

INSERT INTO `narudzbine` (`id`, `korisnik`, `tip`, `dodaci`, `pohovana`, `status`) VALUES
(1, 'ana', 'slana', 'sunka, kulen, kackavalj', 0, 'prihvacena'),
(2, 'ana', 'slana', 'sunka, pavlaka, kackavalj', 1, 'nova'),
(3, 'jova', 'prazna', '/', 0, 'nova'),
(4, 'jova', 'slatka', 'nutela, plazma', 0, 'odbijena'),
(5, 'ana', 'slatka', 'nutela, plazma, visnja', 0, 'nova');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `narudzbine`
--
ALTER TABLE `narudzbine`
  ADD CONSTRAINT `fk_kor_nar` FOREIGN KEY (`korisnik`) REFERENCES `korisnici` (`korisnicko_ime`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
