-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 20, 2010 at 09:44 AM
-- Server version: 5.1.36
-- PHP Version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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: `auto`
--

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

--
-- Table structure for table `auto_boja`
--

DROP TABLE IF EXISTS `auto_boja`;
CREATE TABLE IF NOT EXISTS `auto_boja` (
  `id_boje` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_boje` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_boje`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;

--
-- Dumping data for table `auto_boja`
--

INSERT INTO `auto_boja` (`id_boje`, `naziv_boje`) VALUES
(1, 'crvena'),
(2, 'plava'),
(3, 'zelena'),
(4, 'crna');

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

--
-- Table structure for table `auto_dodatna_oprema`
--

DROP TABLE IF EXISTS `auto_dodatna_oprema`;
CREATE TABLE IF NOT EXISTS `auto_dodatna_oprema` (
  `id_dodatka` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_dodatka` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_dodatka`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ;

--
-- Dumping data for table `auto_dodatna_oprema`
--

INSERT INTO `auto_dodatna_oprema` (`id_dodatka`, `naziv_dodatka`) VALUES
(1, 'abs'),
(2, 'klima'),
(3, 'vazdušni jastuk'),
(4, 'alarm'),
(5, 'aluminijumske felne'),
(6, 'cd plejer'),
(7, 'centralno zaključavanje'),
(8, 'tempomat'),
(9, 'elektronski retrovizori'),
(10, 'servo');

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

--
-- Table structure for table `auto_karakteristike`
--

DROP TABLE IF EXISTS `auto_karakteristike`;
CREATE TABLE IF NOT EXISTS `auto_karakteristike` (
  `id_karakteristike` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_karakteristike` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_karakteristike`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;

--
-- Dumping data for table `auto_karakteristike`
--

INSERT INTO `auto_karakteristike` (`id_karakteristike`, `naziv_karakteristike`) VALUES
(1, 'nov'),
(2, 'garažiran'),
(3, 'održavan(servisna kljiga)'),
(4, 'popravljen'),
(5, 'udaran'),
(6, 'havarisan');

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

--
-- Table structure for table `auto_marke`
--

DROP TABLE IF EXISTS `auto_marke`;
CREATE TABLE IF NOT EXISTS `auto_marke` (
  `id_marke` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_marke` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_marke`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ;

--
-- Dumping data for table `auto_marke`
--

INSERT INTO `auto_marke` (`id_marke`, `naziv_marke`) VALUES
(1, 'Audi'),
(2, 'BMW'),
(3, 'Ferrari'),
(4, 'Fiat'),
(5, 'Ford'),
(6, 'Mercedes Benz'),
(7, 'Opel'),
(8, 'Peugeot'),
(9, 'Renault'),
(10, 'Zastava');

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

--
-- Table structure for table `auto_modeli`
--

DROP TABLE IF EXISTS `auto_modeli`;
CREATE TABLE IF NOT EXISTS `auto_modeli` (
  `id_modela` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `id_marke` int(11) NOT NULL,
  `naziv_modela` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_modela`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13 ;

--
-- Dumping data for table `auto_modeli`
--

INSERT INTO `auto_modeli` (`id_modela`, `id_marke`, `naziv_modela`) VALUES
(1, 8, '207'),
(2, 8, '307'),
(3, 8, '407'),
(4, 8, '607'),
(5, 8, '807'),
(6, 6, 'A class'),
(7, 6, 'B class'),
(8, 6, 'C class'),
(9, 6, 'E class'),
(10, 6, 'S class'),
(11, 1, 'A3'),
(12, 1, 'A4');

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

--
-- Table structure for table `auto_oglas`
--

DROP TABLE IF EXISTS `auto_oglas`;
CREATE TABLE IF NOT EXISTS `auto_oglas` (
  `id_oglasa` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `id_modela` bigint(20) unsigned NOT NULL,
  `id_tipa` int(11) NOT NULL,
  `id_tipa_prenosa` int(11) NOT NULL,
  `cena` float NOT NULL DEFAULT '0',
  `kilometraza` float NOT NULL DEFAULT '0',
  `godiste` int(11) NOT NULL,
  `id_boje` int(11) NOT NULL,
  `id_tipa_goriva` int(11) NOT NULL,
  `komentar` text COLLATE utf8_unicode_ci NOT NULL,
  `datum_postavljanja` int(11) NOT NULL DEFAULT '0',
  `datum_vazenja` int(11) NOT NULL DEFAULT '0',
  `aktiv` tinyint(4) NOT NULL DEFAULT '0',
  `delete` tinyint(4) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`id_oglasa`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `auto_oglas`
--

INSERT INTO `auto_oglas` (`id_oglasa`, `id_modela`, `id_tipa`, `id_tipa_prenosa`, `cena`, `kilometraza`, `godiste`, `id_boje`, `id_tipa_goriva`, `komentar`, `datum_postavljanja`, `datum_vazenja`, `aktiv`, `delete`, `user_id`) VALUES
(1, 3, 1, 1, 10000, 100000, 2006, 2, 1, 'Neki komentar', 20100616, 20100620, 1, 0, 1),
(2, 6, 1, 1, 5000, 51000, 2003, 1, 1, 'Novi komentar', 20100619, 20100703, 0, 0, 2);

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

--
-- Table structure for table `auto_oglas_karakteristike`
--

DROP TABLE IF EXISTS `auto_oglas_karakteristike`;
CREATE TABLE IF NOT EXISTS `auto_oglas_karakteristike` (
  `id_oglasa` bigint(20) NOT NULL,
  `id_karakteristike` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `auto_oglas_karakteristike`
--

INSERT INTO `auto_oglas_karakteristike` (`id_oglasa`, `id_karakteristike`) VALUES
(2, 3),
(1, 3),
(1, 2),
(2, 2);

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

--
-- Table structure for table `auto_oglas_oprema`
--

DROP TABLE IF EXISTS `auto_oglas_oprema`;
CREATE TABLE IF NOT EXISTS `auto_oglas_oprema` (
  `id_oglasa` bigint(20) unsigned NOT NULL,
  `id_dodatka` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `auto_oglas_oprema`
--

INSERT INTO `auto_oglas_oprema` (`id_oglasa`, `id_dodatka`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(2, 10),
(2, 3),
(2, 2),
(2, 1);

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

--
-- Table structure for table `auto_oglas_slike`
--

DROP TABLE IF EXISTS `auto_oglas_slike`;
CREATE TABLE IF NOT EXISTS `auto_oglas_slike` (
  `id_oglasa` bigint(20) unsigned NOT NULL,
  `url` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `auto_oglas_slike`
--

INSERT INTO `auto_oglas_slike` (`id_oglasa`, `url`) VALUES
(1, 'http://www.robotech-universe.com/svasta/auto/auto.png'),
(2, 'http://www.robotech-universe.com/svasta/auto/auto.png'),
(1, 'http://www.robotech-universe.com/svasta/auto/auto.png');

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

--
-- Table structure for table `auto_tipovi`
--

DROP TABLE IF EXISTS `auto_tipovi`;
CREATE TABLE IF NOT EXISTS `auto_tipovi` (
  `id_tipa` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_tipa` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_tipa`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;

--
-- Dumping data for table `auto_tipovi`
--

INSERT INTO `auto_tipovi` (`id_tipa`, `naziv_tipa`) VALUES
(1, 'limuzina'),
(2, 'kupe'),
(3, 'karavan'),
(4, 'džip'),
(5, 'crossover'),
(6, '');

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

--
-- Table structure for table `auto_tipovi_goriva`
--

DROP TABLE IF EXISTS `auto_tipovi_goriva`;
CREATE TABLE IF NOT EXISTS `auto_tipovi_goriva` (
  `id_tipa_goriva` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_tipa_goriva` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_tipa_goriva`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;

--
-- Dumping data for table `auto_tipovi_goriva`
--

INSERT INTO `auto_tipovi_goriva` (`id_tipa_goriva`, `naziv_tipa_goriva`) VALUES
(1, 'dizel'),
(2, 'benzin'),
(3, 'gas'),
(4, 'hibrid');

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

--
-- Table structure for table `auto_tipovi_prenosa`
--

DROP TABLE IF EXISTS `auto_tipovi_prenosa`;
CREATE TABLE IF NOT EXISTS `auto_tipovi_prenosa` (
  `id_tipa_prenosa` int(11) NOT NULL AUTO_INCREMENT,
  `naziv_tipa_prenosa` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_tipa_prenosa`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `auto_tipovi_prenosa`
--

INSERT INTO `auto_tipovi_prenosa` (`id_tipa_prenosa`, `naziv_tipa_prenosa`) VALUES
(1, 'manuelni'),
(2, 'automatski');

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

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
  `user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `username` text COLLATE utf8_unicode_ci NOT NULL,
  `password` text COLLATE utf8_unicode_ci NOT NULL,
  `type_of_user` tinyint(4) NOT NULL,
  `ime` text COLLATE utf8_unicode_ci NOT NULL,
  `email` text COLLATE utf8_unicode_ci NOT NULL,
  `telefon` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`user_id`, `username`, `password`, `type_of_user`, `ime`, `email`, `telefon`) VALUES
(1, 'root', 'root', 1, 'Root', 'root@root.com', '545465454564'),
(2, 'ivan', 'ivan', 0, 'Ivan Herceg', 'hercegyu@gmail.com', '+381658352495');

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

--
-- Table structure for table `user_zahtevi`
--

DROP TABLE IF EXISTS `user_zahtevi`;
CREATE TABLE IF NOT EXISTS `user_zahtevi` (
  `id_zahteva` int(11) NOT NULL AUTO_INCREMENT,
  `username` text COLLATE utf8_unicode_ci NOT NULL,
  `password` text COLLATE utf8_unicode_ci NOT NULL,
  `ime` text COLLATE utf8_unicode_ci NOT NULL,
  `email` text COLLATE utf8_unicode_ci NOT NULL,
  `telefon` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_zahteva`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

--
-- Dumping data for table `user_zahtevi`
--

INSERT INTO `user_zahtevi` (`id_zahteva`, `username`, `password`, `ime`, `email`, `telefon`) VALUES
(1, 'pera', 'pera', 'Pera Peric', 'peric@gmail.com', '+3816555588866');

