-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 18, 2022 at 02:14 PM
-- Server version: 5.7.19
-- PHP Version: 7.1.9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
SET @@global.time_zone='+00:00';
SET @@session.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: `azil2022`
--
CREATE DATABASE IF NOT EXISTS `azil2022` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `azil2022`;

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

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

DROP TABLE IF EXISTS `korisnici`;
CREATE TABLE IF NOT EXISTS `korisnici` (
  `korisnicko_ime` varchar(45) COLLATE utf8_bin NOT NULL,
  `lozinka` varchar(45) COLLATE utf8_bin NOT NULL,
  `ime` varchar(45) COLLATE utf8_bin NOT NULL,
  `prezime` varchar(45) COLLATE utf8_bin NOT NULL,
  `tip` varchar(45) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`korisnicko_ime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

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

INSERT INTO `korisnici` (`korisnicko_ime`, `lozinka`, `ime`, `prezime`, `tip`) VALUES
('ana', 'ana123', 'Ana', 'Jovic', 'clan'),
('jova', 'jova123', 'Jovan', 'Petrovic', 'clan'),
('maja', 'maja123', 'Maja', 'Maksimovic', 'clan'),
('mika', 'mika123', 'Mirko', 'Adamovic', 'radnik'),
('pera', 'pera123', 'Petar', 'Nikolic', 'radnik');

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

--
-- Table structure for table `zahtevi`
--

DROP TABLE IF EXISTS `zahtevi`;
CREATE TABLE IF NOT EXISTS `zahtevi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `korisnik` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `zivotinja` int(11) NOT NULL,
  `porodica` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `prostor` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `status` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_korisnik_zahtev` (`korisnik`),
  KEY `fk_zivotinja_zahtev` (`zivotinja`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `zahtevi`
--

INSERT INTO `zahtevi` (`id`, `korisnik`, `zivotinja`, `porodica`, `prostor`, `status`) VALUES
(1, 'ana', 9, 'porodica', 'kuca', 'prihvacen'),
(2, 'ana', 10, 'porodica', 'kuca', 'nov'),
(3, 'ana', 6, 'porodica', 'kuca', 'nov');

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

--
-- Table structure for table `zivotinje`
--

DROP TABLE IF EXISTS `zivotinje`;
CREATE TABLE IF NOT EXISTS `zivotinje` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `naziv` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `opis` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `godine` decimal(10,2) NOT NULL,
  `udomljen` tinyint(4) NOT NULL DEFAULT '0',
  `dodat` date NOT NULL DEFAULT '2022-06-18',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `zivotinje`
--

INSERT INTO `zivotinje` (`id`, `naziv`, `opis`, `godine`, `udomljen`, `dodat`) VALUES
(1, 'snaucer Mrki', 'zivahan, umiljat', '0.50', 0, '2022-06-15'),
(2, 'labrador Zuca', 'dobar, poslusan, super za decu', '5.33', 1, '2022-06-17'),
(3, 'Cici ruskinja', 'ruska plava macka, zutih ociju, voli da se mazi', '4.00', 0, '2022-06-17'),
(4, 'macor Paja', 'mesanac, kratkog krzna sa prugicama', '2.50', 1, '2022-06-14'),
(5, 'Zuti', 'mesanac (labrador i jazavicar), voli da se izlezava na suncu', '0.70', 0, '2022-06-17'),
(6, 'maca Mica', 'kaliko maca, jos uvek uci kako da hoda', '0.20', 0, '2022-06-17'),
(7, 'frenci Zak', 'mali crni francuski buldog; balavi, ali ga je lako zavoleti', '6.80', 0, '2022-06-12'),
(8, 'macor Sima', 'kod nas je dosao povredjene sapice, sredili smo je i sada mu treba neko da ga mazi i pazi', '4.70', 0, '2022-06-13'),
(9, 'Han Solo', 'nemacki ovcar, pun energije i potpuno blesav', '2.00', 1, '2022-06-17'),
(10, 'dzek Dzek', 'mesanac dzek rasela, pitom i miran, voli cebad vise od svega', '9.50', 0, '2022-06-16');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `zahtevi`
--
ALTER TABLE `zahtevi`
  ADD CONSTRAINT `fk_korisnik_zahtev` FOREIGN KEY (`korisnik`) REFERENCES `korisnici` (`korisnicko_ime`),
  ADD CONSTRAINT `fk_zivotinja_zahtev` FOREIGN KEY (`zivotinja`) REFERENCES `zivotinje` (`id`);
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 */;
