-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 22, 2015 at 10:42 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.3

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- Database: `parkingservis`
--
CREATE DATABASE `parkingservis` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `parkingservis`;

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

--
-- Table structure for table `kazna`
--

CREATE TABLE IF NOT EXISTS `kazna` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `registracija` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `zona` int(11) NOT NULL,
  `ulica` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `vreme_kazne` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `id_kontrolor` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_kontrolor` (`id_kontrolor`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;

--
-- Dumping data for table `kazna`
--

INSERT INTO `kazna` (`id`, `registracija`, `zona`, `ulica`, `vreme_kazne`, `id_kontrolor`) VALUES
(1, 'BG396VG', 1, 'Dositejeva', '2015-08-20 09:56:20', 'drasko'),
(2, 'KG321NN', 2, 'Ruzveltova', '2015-08-23 07:38:35', 'drasko'),
(3, 'VA111VA', 2, 'Krunska', '2015-08-22 13:09:16', 'ana'),
(4, 'BG033BK', 3, 'Cvijiceva', '2015-08-18 18:13:13', 'bosko'),
(5, 'NI099BB', 2, 'Kralja Milutina', '2015-08-22 11:35:00', 'sanja'),
(6, 'JA666MI', 3, 'Milana Rakica', '2015-08-23 06:50:22', 'kosta');

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

--
-- Table structure for table `korisnik`
--

CREATE TABLE IF NOT EXISTS `korisnik` (
  `korisnickoime` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `lozinka` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `ime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `telefon` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`korisnickoime`),
  KEY `korisnickoime` (`korisnickoime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `korisnik`
--

INSERT INTO `korisnik` (`korisnickoime`, `lozinka`, `ime`, `telefon`, `email`) VALUES
('ana', 'sifra123', 'Aleksandra Marjanovic', '0112345678', 'aleksandra.marjanovic@etf.rs'),
('bosko', 'sifra123', 'Bosko Nikolic', '0113218392', 'nbosko@etf.rs'),
('drasko', 'sifra123', 'Drazen Draskovic', '0113218389', 'drazen.draskovic@etf.rs'),
('kosta', 'sifra123', 'Kosta Jovanovic', '0113218234', 'kosta.jovanovic@etf.rs'),
('nemanja', 'sifra123', 'Nemanja Kojic', '0112345678', 'nemanja.kojic@etf.rs'),
('sanja', 'sifra123', 'Sanja Vujnovic', '0641234567', 'sanja.vujnovic@etf.rs');

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

--
-- Table structure for table `parkingkarta`
--

CREATE TABLE IF NOT EXISTS `parkingkarta` (
  `id_karta` int(11) NOT NULL AUTO_INCREMENT,
  `mobilni` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `registracija` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `vreme_od` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `zona` int(11) NOT NULL,
  PRIMARY KEY (`id_karta`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ;

--
-- Dumping data for table `parkingkarta`
--

INSERT INTO `parkingkarta` (`id_karta`, `mobilni`, `registracija`, `vreme_od`, `zona`) VALUES
(1, '0641233321', 'BG396VG', '2015-08-20 08:33:00', 1),
(2, '063333444', 'SD035JD', '2015-08-22 16:43:20', 2),
(3, '0601122233', 'KG321NN', '2015-08-23 06:00:00', 2),
(4, '0653218389', 'BG031DR', '2015-08-23 09:03:00', 3),
(5, '0642202255', 'BG390AS', '2015-08-23 10:08:30', 3),
(6, '0651122333', 'CA235AS', '2015-08-23 09:40:45', 1),
(9, '0641233321', 'BG396VG', '2015-08-19 10:25:00', 2),
(10, '0641233321', 'BG396VG', '2015-08-19 11:25:00', 2),
(11, '0641515155', 'BG396VG', '2015-08-15 15:19:30', 1),
(12, '0641515155', 'BG396VG', '2015-08-16 14:12:25', 3),
(13, '0693344555', 'BG396VG', '2015-08-19 08:46:43', 1),
(14, '0641233321', 'BG396VG', '2015-08-22 17:59:45', 3);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `kazna`
--
ALTER TABLE `kazna`
  ADD CONSTRAINT `kazna_ibfk_1` FOREIGN KEY (`id_kontrolor`) REFERENCES `korisnik` (`korisnickoime`) ON DELETE CASCADE ON UPDATE CASCADE;

/*!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 */;