diff --git a/digital_atlas.sql b/digital_atlas.sql index 9a88544..9424451 100644 --- a/digital_atlas.sql +++ b/digital_atlas.sql @@ -1,13 +1,15 @@ -- phpMyAdmin SQL Dump --- version 4.5.4.1deb2ubuntu2 --- http://www.phpmyadmin.net +-- version 4.7.0 +-- https://www.phpmyadmin.net/ -- --- Gostitelj: localhost --- Čas nastanka: 12. avg 2017 ob 12.57 --- Različica strežnika: 5.7.19-0ubuntu0.16.04.1 --- Različica PHP: 7.0.22-0ubuntu0.16.04.1 +-- Gostitelj: 127.0.0.1 +-- Čas nastanka: 01. avg 2018 ob 20.14 +-- Različica strežnika: 10.1.22-MariaDB +-- Različica PHP: 7.1.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; SET time_zone = "+00:00"; @@ -19,8 +21,6 @@ SET time_zone = "+00:00"; -- -- Zbirka podatkov: `digital_atlas` -- -CREATE DATABASE IF NOT EXISTS `digital_atlas` DEFAULT CHARACTER SET utf8 COLLATE utf8_slovenian_ci; -USE `digital_atlas`; -- -------------------------------------------------------- @@ -31,7 +31,7 @@ USE `digital_atlas`; CREATE TABLE `dialects` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_slovenian_ci NOT NULL, - `type` tinyint(4) NOT NULL COMMENT '/1-skupina, 2-narecje, 3-podnarecje', + `type` tinyint(4) NOT NULL COMMENT '/1-skupina, 2-narecje,3-podnarecje', `id_parent` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; @@ -107,11 +107,115 @@ INSERT INTO `dialects` (`id`, `name`, `type`, `id_parent`) VALUES CREATE TABLE `lexems` ( `id` int(11) NOT NULL, `title` varchar(255) COLLATE utf8_slovenian_ci NOT NULL, - `icon` varchar(500) COLLATE utf8_slovenian_ci NOT NULL, + `icon1` varchar(500) COLLATE utf8_slovenian_ci NOT NULL, `id_word` int(11) NOT NULL, - `icon_color` varchar(255) COLLATE utf8_slovenian_ci NOT NULL + `icon_color1` varchar(255) COLLATE utf8_slovenian_ci NOT NULL, + `icon_size1` varchar(10) COLLATE utf8_slovenian_ci NOT NULL, + `icon2` varchar(500) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon_color2` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon_size2` varchar(10) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon3` varchar(500) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon_color3` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon_size3` varchar(10) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon4` varchar(500) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon_color4` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL, + `icon_size4` varchar(10) COLLATE utf8_slovenian_ci DEFAULT NULL, + `star` tinyint(4) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; +-- +-- Odloži podatke za tabelo `lexems` +-- + +INSERT INTO `lexems` (`id`, `title`, `icon1`, `id_word`, `icon_color1`, `icon_size1`, `icon2`, `icon_color2`, `icon_size2`, `icon3`, `icon_color3`, `icon_size3`, `icon4`, `icon_color4`, `icon_size4`, `star`) VALUES +(10, 'kelder', '倁', 19, '#c00000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(11, 'hram', '嘁', 19, '#ffc000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(12, 'pivníca', '币', 19, '#0000cc', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(13, 'klet', '樁', 19, '#006600', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(14, 'špajz', '刁', 18, '#002060', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(15, 'špajza', '倁', 18, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(16, 'špajzvelb', '刦', 18, '#002060', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(17, 'kamúra', '嘁', 18, '#660066', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(18, 'štenge', '倁', 19, '#0080ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(19, 'štege', '刁', 20, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(20, 'stube', '币', 20, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(21, 'škale', '嘁', 20, '#ffc000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(22, 'stranišče', '樁', 21, '#006600', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(23, 'sekret', '倁', 21, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(24, 'cekret', '刁', 21, '#0070c0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(25, 'hajzelj', '嘁', 21, '#c00000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(26, 'lajben', '币', 21, '#663300', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(27, 'kandot', '态', 21, '#660066', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(28, 'veža', '樁', 22, '#006600', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(29, 'lopa', '倁', 22, '#0000cc', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(30, 'priklet', '嘁', 22, '#006600', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(31, 'predklet', '威', 22, '#3d3d3d', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(32, 'sala, šala', '币', 22, '#660066', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(33, 'štenge', '倁', 20, '#c00000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(34, 'pivníca, klet', '币樁', 19, '#0000cc', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(46, 'sekret na štrbunk', '冰', 21, '#0000cc', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(48, 'kejder', '刁', 19, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(49, 'šankret', '吁', 21, '#0070c0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(50, 'lojpa', '刁', 22, '#333399', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(52, 'ponva', '嘁', 41, '#b99a3a', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(55, 'sadje', '▼', 45, '#ff8000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(56, 'sadunak', '倁', 44, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(59, 'blina', '倁', 56, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(60, 'divjak', '倁', 50, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(61, 'cvet', '倁', 62, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(62, 'Jabuku les', '倁', 57, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(63, 'jabuk', '倁', 43, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(64, 'jablana', '倁', 49, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(65, 'pecl', '倁', 46, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(66, 'ugrizek', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(67, 'japka', '倁', 43, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(68, 'japko', '倁', 43, '#ffff00', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(69, 'jobuka', '倁', 43, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(70, 'haubka', '倁', 43, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(72, 'japku', '倁', 43, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(73, 'japk', '倁', 43, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(74, 'sadni vrt', '倁', 44, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(75, 'jabuka', '倁', 43, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(76, 'jaboka', '倁', 43, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(77, 'jablan', '倁', 49, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(78, 'jabvana', '倁', 49, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(79, 'jabuk', '倁', 49, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(80, 'jabuka', '倁', 49, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(81, 'japk', '倁', 49, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(82, 'japka', '倁', 49, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(83, 'jobuka', '倁', 49, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(84, 'abjietk', '倘', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(86, 'abribek', '倘', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(88, 'grižli', '傂', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(89, 'obgrizek', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(90, 'objetk', '倢', 66, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(91, 'obresk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(92, 'obriešk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(93, 'obrišk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(94, 'ogludek', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(95, 'ogrisk', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(96, 'ogrizek', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(97, 'ogrizok', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(98, 'štingel', '入', 66, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(99, 'uaglieuk', '嘁', 66, '#000080', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(100, 'ubrezek', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(101, 'ugrisk', '倁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(102, 'vabidk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(103, 'vagrizek', '倢', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(104, 'zgrijsk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(105, 'zgrijzek', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(106, 'zgrijžek', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(107, 'zgrizek', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(108, 'zribek', '嘁', 66, '#0000ff', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(111, 'oglodek', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(112, 'objetk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(114, 'objetk', '倁', 66, '#000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(115, 'češpla', '倘', 54, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(116, 'ugrizek', '倘', 66, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(117, 'črnušnica', '嘁', 52, '#ff0000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0), +(122, 'AATEST', '倘', 41, '#800040', 'small', '傂', '#008000', 'small', '傂', '#00ff00', 'normal', '傂', '#ff0000', 'small', 0), +(123, 'nov', '倁', 41, '#0080ff', 'normal', '傂', '#00ff00', 'normal', '傂', '#ff8080', 'normal', '傂', '#800000', 'normal', 1); + -- -------------------------------------------------------- -- @@ -122,6 +226,7 @@ CREATE TABLE `locations` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_slovenian_ci NOT NULL DEFAULT '', `short_name` varchar(50) COLLATE utf8_slovenian_ci NOT NULL DEFAULT '', + `id_subject` int(11) NOT NULL, `lat` decimal(10,6) NOT NULL, `long` decimal(10,6) NOT NULL, `id_dialect` int(11) NOT NULL, @@ -129,6 +234,14 @@ CREATE TABLE `locations` ( `id_subsubdialect` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; +-- +-- Odloži podatke za tabelo `locations` +-- + +INSERT INTO `locations` (`id`, `name`, `short_name`, `id_subject`, `lat`, `long`, `id_dialect`, `id_subdialect`, `id_subsubdialect`) VALUES +(1, 'rokometas77', 'L', 11, '46.400000', '13.559000', 12, 14, 15), +(3, 'rokometas77a', 'UTa', 11, '46.338004', '13.551377', 12, 16, NULL); + -- -------------------------------------------------------- -- @@ -136,22 +249,18 @@ CREATE TABLE `locations` ( -- CREATE TABLE `subjects` ( - `id` int(1) NOT NULL, + `id` int(11) NOT NULL, `title` varchar(255) COLLATE utf8_slovenian_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; --- -------------------------------------------------------- - -- --- Struktura tabele `subject_locations` +-- Odloži podatke za tabelo `subjects` -- -CREATE TABLE `subject_locations` ( - `id` int(11) NOT NULL, - `id_subject` int(11) DEFAULT NULL, - `id_location` int(11) NOT NULL, - `checked` tinyint(4) NOT NULL DEFAULT '1' -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; +INSERT INTO `subjects` (`id`, `title`) VALUES +(1, 'Stara kmečka hiša'), +(11, 'Posoda'), +(12, 'Sadje'); -- -------------------------------------------------------- @@ -168,6 +277,14 @@ CREATE TABLE `transcriptions` ( `trans_text` text COLLATE utf8_slovenian_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; +-- +-- Odloži podatke za tabelo `transcriptions` +-- + +INSERT INTO `transcriptions` (`id`, `phonetic_writing`, `audio`, `id_lexem`, `id_location`, `trans_text`) VALUES +(2, 'tetett', '', 122, 3, ''), +(3, 'NOV', '', 123, 1, ''); + -- -------------------------------------------------------- -- @@ -188,7 +305,10 @@ CREATE TABLE `users` ( -- INSERT INTO `users` (`id`, `username`, `name`, `lastname`, `password_hash`, `sess_expiration`) VALUES -(1, 'admin', 'Admin', '', '$2y$10$bvfsnL9h3A5Dt6IaRT.m7eh/4GXmSgA/5s6wBUHJYrGgBtjDVoxYq', 60); +(1, 'admin', 'Admin', '', '$2y$10$MrlyWB6bT1CL4andhON1eu3y2QGBgi4Evkw0HiDJQ9ioMFdxbjO.K', 60), +(7, 'gsajn', 'Gregor', 'Šajn', '$2y$10$Nun729Yuts/U2FHH3zU8fuu1lanVfJj5oiMuhNREqm7XEXfjZLktK', 60), +(8, 'alenka', 'Alenka', 'K.', '$2y$10$FeAHVPb1SOAB1r7EJ2fZReMZtQ.Kgb0b1akGrLmMa7YRqLf96yXfG', 60), +(9, 'vera', 'Vera', 'Smole', '$2y$10$U5LOzVGG2fL3Ypa6uW3imurb3NtZxlI310nW91Y6Zwxg4tpfohu6S', 60); -- -------------------------------------------------------- @@ -204,6 +324,40 @@ CREATE TABLE `words` ( `id_subject` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; +-- +-- Odloži podatke za tabelo `words` +-- + +INSERT INTO `words` (`id`, `title`, `image`, `comment`, `id_subject`) VALUES +(18, 'Shramba', 'images/words/shramba_1502874394.jpg', '', 1), +(19, 'Klet', 'images/words/klet_1502874370.png', '', 1), +(20, 'Stopnice', 'images/words/stopnice_1502874412.jpg', '', 1), +(21, 'Stranišče', 'images/words/stranie_1502874434.png', '', 1), +(22, 'Veža', 'images/words/vea_1502874450.jpg', '', 1), +(41, 'ponev', '', '', 11), +(43, 'Jabolko', 'images/words/jabolko_1505494082.jpg', '', 12), +(44, 'Sadovnjak', 'images/words/sadovnjak_1505501703.jpg', '', 12), +(45, 'Sadje', 'images/words/sadje_1505501672.jpg', '', 12), +(46, 'Pecelj', '', '', 12), +(47, 'Muha', '', '', 12), +(49, 'Jablana', 'images/words/jablana_1505501803.jpg', '', 12), +(50, 'Divje jabolko', '', '', 12), +(51, 'Hruška', 'images/words/hruka_1505502767.jpg', '', 12), +(52, 'Divja hruška', 'images/words/divjahruka_1505501910.jpg', '', 12), +(54, 'Sliva', 'images/words/sliva_1505503123.jpg', '', 12), +(55, 'Peška', '', '', 12), +(56, 'Belina', '', '', 12), +(57, 'Les jabolk', '', '', 12), +(58, 'Veje jabolk', '', '', 12), +(59, 'Mlada jablana', '', '', 12), +(60, 'Črvivo jabolko', '', '', 12), +(61, 'Žganje iz jabolk', '', '', 12), +(62, 'Metilni alkohol (cvet)', '', '', 12), +(63, 'Mošt', '', '', 12), +(64, 'Preša', '', '', 12), +(65, 'Krhelj', '', '', 12), +(66, 'Ogrizek', 'images/words/ogrizek_1506300467.jpg', '', 12); + -- -- Indeksi zavrženih tabel -- @@ -229,7 +383,8 @@ ALTER TABLE `locations` ADD PRIMARY KEY (`id`), ADD KEY `FK_locations_dialects` (`id_dialect`), ADD KEY `FK_locations_dialects_2` (`id_subdialect`), - ADD KEY `FK_locations_dialects_3` (`id_subsubdialect`); + ADD KEY `FK_locations_dialects_3` (`id_subsubdialect`), + ADD KEY `id_subject` (`id_subject`); -- -- Indeksi tabele `subjects` @@ -237,14 +392,6 @@ ALTER TABLE `locations` ALTER TABLE `subjects` ADD PRIMARY KEY (`id`); --- --- Indeksi tabele `subject_locations` --- -ALTER TABLE `subject_locations` - ADD PRIMARY KEY (`id`), - ADD KEY `FK_subject_locations_locations` (`id_location`), - ADD KEY `FK_subject_locations_subjects` (`id_subject`); - -- -- Indeksi tabele `transcriptions` -- @@ -252,7 +399,7 @@ ALTER TABLE `transcriptions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id_location_uniq` (`id_location`,`id_lexem`), ADD KEY `id_word` (`id_lexem`), - ADD KEY `id_location` (`id_location`); + ADD KEY `id_location` (`id_location`) USING BTREE; -- -- Indeksi tabele `users` @@ -280,37 +427,32 @@ ALTER TABLE `dialects` -- AUTO_INCREMENT tabele `lexems` -- ALTER TABLE `lexems` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=124; -- -- AUTO_INCREMENT tabele `locations` -- ALTER TABLE `locations` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT tabele `subjects` -- ALTER TABLE `subjects` - MODIFY `id` int(1) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; --- --- AUTO_INCREMENT tabele `subject_locations` --- -ALTER TABLE `subject_locations` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT tabele `transcriptions` -- ALTER TABLE `transcriptions` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT tabele `users` -- ALTER TABLE `users` - MODIFY `id` int(1) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + MODIFY `id` int(1) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT tabele `words` -- ALTER TABLE `words` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67; -- -- Omejitve tabel za povzetek stanja -- @@ -333,27 +475,22 @@ ALTER TABLE `lexems` ALTER TABLE `locations` ADD CONSTRAINT `FK_locations_dialects` FOREIGN KEY (`id_dialect`) REFERENCES `dialects` (`id`), ADD CONSTRAINT `FK_locations_dialects_2` FOREIGN KEY (`id_subdialect`) REFERENCES `dialects` (`id`), - ADD CONSTRAINT `FK_locations_dialects_3` FOREIGN KEY (`id_subsubdialect`) REFERENCES `dialects` (`id`); - --- --- Omejitve za tabelo `subject_locations` --- -ALTER TABLE `subject_locations` - ADD CONSTRAINT `FK_subject_locations_locations` FOREIGN KEY (`id_location`) REFERENCES `locations` (`id`), - ADD CONSTRAINT `FK_subject_locations_subjects` FOREIGN KEY (`id_subject`) REFERENCES `subjects` (`id`) ON DELETE SET NULL ON UPDATE SET NULL; + ADD CONSTRAINT `FK_locations_dialects_3` FOREIGN KEY (`id_subsubdialect`) REFERENCES `dialects` (`id`), + ADD CONSTRAINT `locations_ibfk_1` FOREIGN KEY (`id_subject`) REFERENCES `subjects` (`id`); -- -- Omejitve za tabelo `transcriptions` -- ALTER TABLE `transcriptions` - ADD CONSTRAINT `FK_transcriptions_leksems` FOREIGN KEY (`id_lexem`) REFERENCES `lexems` (`id`), - ADD CONSTRAINT `FK_transcriptions_locations` FOREIGN KEY (`id_location`) REFERENCES `locations` (`id`); + ADD CONSTRAINT `transcriptions_ibfk_1` FOREIGN KEY (`id_location`) REFERENCES `locations` (`id`), + ADD CONSTRAINT `transcriptions_ibfk_2` FOREIGN KEY (`id_lexem`) REFERENCES `lexems` (`id`); -- -- Omejitve za tabelo `words` -- ALTER TABLE `words` ADD CONSTRAINT `FK_words_subjects` FOREIGN KEY (`id_subject`) REFERENCES `subjects` (`id`); +COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/sna/application/config/database.php b/sna/application/config/database.php index 461d9b0..b4cd9a8 100644 --- a/sna/application/config/database.php +++ b/sna/application/config/database.php @@ -76,8 +76,8 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', - 'username' => 'my-username', - 'password' => 'my-passwd', + 'username' => 'nermin', + 'password' => '', 'database' => 'digital_atlas', 'dbdriver' => 'mysqli', 'dbprefix' => '', diff --git a/sna/application/controllers/Admin.php b/sna/application/controllers/Admin.php index c583328..a627a52 100644 --- a/sna/application/controllers/Admin.php +++ b/sna/application/controllers/Admin.php @@ -335,7 +335,7 @@ class Admin extends CI_Controller { if(!isset($data['errfields'])) { //delete possible subject_locations - $this->db->select('*'); + /*$this->db->select('*'); $this->db->from('subject_locations'); $this->db->where('id_subject',$id_subject); $subject_locations=$this->db->get()->result_array(); @@ -344,7 +344,7 @@ class Admin extends CI_Controller { { $this->db->where('id',$entry['id']); $this->db->delete('subject_locations'); - } + }*/ //remove subject $this->db->where('id',$id_subject); @@ -445,7 +445,7 @@ class Admin extends CI_Controller { $image_upload_ok = 0; } //tip datoteke - if($image_file_type != "jpg" && $image_file_type != "png" && $image_file_type != "jpeg" + if($image_file_type != "jpg" && $image_file_type != "png" && $image_file_type != "jpeg" && $image_file_type != "PNG" && $image_file_type != "JPEG" && $image_file_type != "JPG" && $image_file_type != "GIF" && $image_file_type != "gif" ) { $data['errfields']['image_format']='Izbrana slika ni ustreznega slikovnega formata! Dovoljeni so jpg, png, jpeg in gif formati.'; $image_upload_ok = 0; @@ -632,8 +632,8 @@ class Admin extends CI_Controller { $image_upload_ok = 0; } //tip datoteke - if($image_file_type != "jpg" && $image_file_type != "png" && $image_file_type != "jpeg" - && $image_file_type != "gif" ) { + if($image_file_type != "jpg" && $image_file_type != "png" && $image_file_type != "jpeg" && $image_file_type != "PNG" && $image_file_type != "JPEG" && $image_file_type != "JPG" && $image_file_type != "GIF" + && $image_file_type != "gif" ) { $data['errfields']['image_format']='Izbrana slika ni ustreznega slikovnega formata! Dovoljeni so jpg, png, jpeg in gif formati.'; $image_upload_ok = 0; } @@ -1240,9 +1240,12 @@ class Admin extends CI_Controller { $data['subsubdialects']=array(0=>'Izberite podnarečje')+$this->admin_model->subsubdialects($location['id_subdialect'],'options'); $data['subjects']=$this->admin_model->subjects(); + $data['subjects']=array(0=>'Izberite temo')+$this->home_model->subjects('select'); $data['errfields']=$this->session->flashdata('errfields'); + //var_dump($data); + if($location) { $data['location']=$location; @@ -1257,6 +1260,7 @@ class Admin extends CI_Controller { 'id_dialect'=>0, 'id_subdialect'=>0, 'id_subsubdialect'=>0, + 'id_subject'=>'' ); } @@ -1272,9 +1276,9 @@ class Admin extends CI_Controller { $id_dialect=$this->input->post('dialects',true); $id_subdialect=$this->input->post('subdialects',true); $id_subsubdialect=$this->input->post('subsubdialects',true); + $id_subject=$this->input->post('subject',true); $save_close=$this->input->post('save_close',true); - $subjects=$this->input->post('subjects',true); //save post to session $data=array( @@ -1285,6 +1289,7 @@ class Admin extends CI_Controller { 'id_dialect'=>$id_dialect, 'id_subdialect'=>$id_subdialect, 'id_subsubdialect'=>$id_subsubdialect, + 'id_subject'=>$id_subject ); $this->session->set_flashdata('add_location',$data); @@ -1293,20 +1298,25 @@ class Admin extends CI_Controller { { $data['errfields']['name']='Ime kraja je prazno!'; } - elseif($this->admin_model->location_exists('name',$name)) + elseif($this->admin_model->location_exists('name',$name, $id_subject)) { - $data['errfields']['name']='Ime kraja že obstaja!'; + $data['errfields']['name']='Ime kraja za to temo že obstaja!'; } if(!$short_name) { $data['errfields']['short_name']='Kratek naziv kraja je prazen!'; } - elseif($this->admin_model->location_short_name_exists($short_name)) + elseif($this->admin_model->location_short_name_exists($short_name, $id_subject)) { - $data['errfields']['short_name']='Kratek naziv kraja kraja že obstaja!'; + $data['errfields']['short_name']='Kratek naziv kraja za to temo že obstaja!'; } + if(!$id_subject) + { + $data['errfields']['no_subject']="Izberite temo!"; + } + if(!$lat) { $data['errfields']['lat']='Zemljepisna širina (lat) je prazna!'; @@ -1341,13 +1351,7 @@ class Admin extends CI_Controller { $data['errfields']['long']='Zemljepisna dolžina (long) mora biti številska vrednost!'; } } - if($lat and $long) - { - if($this->admin_model->coordinates_exists($lat,$long,$id_location)) - { - $data['errfields']['coordinates']='Na teh koordinatah že obstaja kraj!'; - } - } + if(!$id_dialect) { @@ -1358,6 +1362,14 @@ class Admin extends CI_Controller { $data['errfields']['id_subdialect']='Izberite narečje!'; } + if($lat and $long) + { + if($this->admin_model->coordinates_exists($lat,$long,$id_location, $id_subject)) + { + $data['errfields']['coordinates']='Na teh koordinatah za to temo že obstaja kraj!'; + } + } + if(!isset($data['errfields'])) { if($data['id_subsubdialect']==0) @@ -1369,14 +1381,14 @@ class Admin extends CI_Controller { //add possible subject_locations - foreach($subjects as $key=>$id_subject) + foreach($id_subjects as $key=>$id_subject) { $db_data=array( 'id_location'=>$id_location, 'id_subject'=>$id_subject, 'checked'=>1, ); - $this->db->insert('subject_locations',$db_data); + //$this->db->insert('subject_locations',$db_data); } $data['status']='ok'; @@ -1424,7 +1436,7 @@ class Admin extends CI_Controller { $data['subjects']=$this->admin_model->subjects(); - $data['subject_locations']=$this->admin_model->subject_locations($id_location); + //$data['subject_locations']=$this->admin_model->subject_locations($id_location); $data['errfields']=$this->session->flashdata('errfields'); @@ -1453,6 +1465,7 @@ class Admin extends CI_Controller { $id_dialect=$this->input->post('dialects',true); $id_subdialect=$this->input->post('subdialects',true); $id_subsubdialect=$this->input->post('subsubdialects',true); + $id_subject=$this->input->post('subject',true); $save_close=$this->input->post('save_close',true); $subjects=$this->input->post('subjects',true); @@ -1461,10 +1474,7 @@ class Admin extends CI_Controller { { $data['errfields']['name']='Ime kraja je prazno!'; } - elseif($this->admin_model->location_exists('name',$name,$id_location)) - { - $data['errfields']['name']='Ime kraja že obstaja!'; - } + if(!$short_name) { @@ -1511,18 +1521,19 @@ class Admin extends CI_Controller { $data['errfields']['long']='Zemljepisna dolžina (long) mora biti številska vrednost!'; } } - if($lat and $long) - { - if($this->admin_model->coordinates_exists($lat,$long,$id_location)) - { - $data['errfields']['coordinates']='Na teh koordinatah že obstaja kraj!'; - } - } + + if($lat and $long) + { + if($this->admin_model->coordinates_exists($lat,$long,$id_location, $id_subject)) + { + $data['errfields']['coordinates']='Na teh koordinatah za to temo že obstaja kraj!'; + } + } if(!isset($data['errfields'])) { //get all - $this->db->select('*'); + /*$this->db->select('*'); $this->db->from('subject_locations'); $this->db->where('id_location',$id_location); $subject_locations=$this->db->get()->result_array(); @@ -1565,7 +1576,7 @@ class Admin extends CI_Controller { { $this->db->where('id',$id); $this->db->delete('subject_locations'); - } + }*/ $db_data=array( @@ -1576,6 +1587,7 @@ class Admin extends CI_Controller { 'id_dialect'=>$id_dialect, 'id_subdialect'=>$id_subdialect, 'id_subsubdialect'=>$id_subsubdialect?$id_subsubdialect:NULL, + 'id_subject'=>$id_subject ); //update @@ -1690,6 +1702,7 @@ class Admin extends CI_Controller { redirect($this->url.'edit_user/'.$id_user); } + function edit_user() { $this->check_user(); @@ -1806,9 +1819,9 @@ class Admin extends CI_Controller { { $this->check_user(); - $id_user=$this->uri->segment(3); + $id_user=(int)$this->input->post('id_user',true); - if($id_user!=1) + if($id_user) { //remove subject $this->db->where('id',$id_user); @@ -1818,11 +1831,14 @@ class Admin extends CI_Controller { $_SESSION['status']=$data['status']; - redirect($this->url.'users/'); + $data['status']='ok'; + + echo json_encode($data); + } else { - $_SESSION['errfields']='Tega uporabnika ni mogoče izbrisati (admin)!'; + $_SESSION['errfields']='Tega uporabnika ni mogoče izbrisati!'; redirect($this->url.'/edit_user/'.$id_user); } @@ -1884,8 +1900,19 @@ class Admin extends CI_Controller { 'title' => '', 'id_word'=>0, 'id_subject'=>0, - 'icon'=>'', - 'icon_color'=>'', + 'icon1'=>'', + 'icon2'=>'', + 'icon3'=>'', + 'icon4'=>'', + 'icon_color1'=>'', + 'icon_color2'=>'', + 'icon_color3'=>'', + 'icon_color4'=>'', + 'icon_size1'=>'', + 'icon_size2'=>'', + 'icon_size3'=>'', + 'icon_size4'=>'', + 'star'=>0, ); } @@ -1897,17 +1924,41 @@ class Admin extends CI_Controller { $id_word=$this->input->post('words',true); $id_subject=$this->input->post('subjects',true); $title=$this->input->post('title',true); - $icon=$this->input->post('icon',true); - $icon_color=$this->input->post('icon_color',true); - $save_close=$this->input->post('save_close',true); + $icon1=$this->input->post('icon1',true); + $icon_color1=$this->input->post('icon_color1',true); + $icon_size1=$this->input->post('icon_size1',true); + $icon2=$this->input->post('icon2',true); + $icon_color2=$this->input->post('icon_color2',true); + $icon_size2=$this->input->post('icon_size2',true); + $icon3=$this->input->post('icon3',true); + $icon_color3=$this->input->post('icon_color3',true); + $icon_size3=$this->input->post('icon_size3',true); + $icon4=$this->input->post('icon4',true); + $icon_color4=$this->input->post('icon_color4',true); + $icon_size4=$this->input->post('icon_size4',true); + $star=$this->input->post('star',true); + $save_close=$this->input->post('save_close',true); + + $star = $star === 'on' ? 1 : 0; //save post to session $data=array( 'title'=>$title, 'id_word'=>$id_word, 'id_subject'=>$id_subject, - 'icon'=>$icon, - 'icon_color'=>$icon_color, + 'icon1'=>$icon1, + 'icon_color1'=>$icon_color1, + 'icon_size1'=>$icon_size1, + 'icon2'=>$icon2, + 'icon_color2'=>$icon_color2, + 'icon_size2'=>$icon_size2, + 'icon3'=>$icon3, + 'icon_color3'=>$icon_color3, + 'icon_size3'=>$icon_size3, + 'icon4'=>$icon4, + 'icon_color4'=>$icon_color4, + 'icon_size4'=>$icon_size4, + 'star'=>$star ); $this->session->set_flashdata('add_lexem',$data); @@ -1924,18 +1975,18 @@ class Admin extends CI_Controller { $data['errfields']['no_word']="Izberite besedo!"; } - if(!$icon) + if(!$icon1) { $data['errfields']['no_icon']="Simbol leksema je prazen!"; } else { - $icon=preg_replace('/\s+/', '', $icon); + $icon1=preg_replace('/\s+/', '', $icon1); } - if(!$icon_color) + if(!$icon_color1) { - $icon_color="#000000"; + $icon_color1="#000000"; } if(!isset($data['errfields'])) @@ -1966,7 +2017,7 @@ class Admin extends CI_Controller { redirect($this->url.'edit_lexem/'.$id_lexem); } - + //var_dump($data); } else { @@ -1974,6 +2025,7 @@ class Admin extends CI_Controller { $this->session->set_flashdata('errfields',$data['errfields']); redirect($this->url.'add_lexem/'); + var_dump($data); } } @@ -2013,11 +2065,25 @@ class Admin extends CI_Controller { function post_edit_lexem() { $id=$this->input->post('id',true); - $id_word=$this->input->post('words',true); - $title=$this->input->post('title',true); - $icon=$this->input->post('icon',true); - $icon_color=$this->input->post('icon_color',true); - $save_close=$this->input->post('save_close',true); + $id_word=$this->input->post('words',true); + $id_subject=$this->input->post('subjects',true); + $title=$this->input->post('title',true); + $icon1=$this->input->post('icon1',true); + $icon_color1=$this->input->post('icon_color1',true); + $icon_size1=$this->input->post('icon_size1',true); + $icon2=$this->input->post('icon2',true); + $icon_color2=$this->input->post('icon_color2',true); + $icon_size2=$this->input->post('icon_size2',true); + $icon3=$this->input->post('icon3',true); + $icon_color3=$this->input->post('icon_color3',true); + $icon_size3=$this->input->post('icon_size3',true); + $icon4=$this->input->post('icon4',true); + $icon_color4=$this->input->post('icon_color4',true); + $icon_size4=$this->input->post('icon_size4',true); + $star=$this->input->post('star',true); + $save_close=$this->input->post('save_close',true); + + $star = $star === 'on' ? 1 : 0; //check if(!$title) @@ -2030,18 +2096,18 @@ class Admin extends CI_Controller { $data['errfields']['no_word']="Izberite besedo!"; } - if(!$icon) + if(!$icon1) { $data['errfields']['no_icon']="Simbol leksema je prazen!"; } else { - $icon=preg_replace('/\s+/', '', $icon); + $icon1=preg_replace('/\s+/', '', $icon1); } - if(!$icon_color) + if(!$icon_color1) { - $icon_color="#000000"; + $icon_color1="#000000"; } if(!isset($data['errfields'])) @@ -2055,10 +2121,21 @@ class Admin extends CI_Controller { if(!isset($data['errfields'])) { $db_data=array( - 'title'=>$title, - 'id_word'=>$id_word, - 'icon'=>$icon, - 'icon_color'=>$icon_color, + 'title'=>$title, + 'id_word'=>$id_word, + 'icon1'=>$icon1, + 'icon_color1'=>$icon_color1, + 'icon_size1'=>$icon_size1, + 'icon2'=>$icon2, + 'icon_color2'=>$icon_color2, + 'icon_size2'=>$icon_size2, + 'icon3'=>$icon3, + 'icon_color3'=>$icon_color3, + 'icon_size3'=>$icon_size3, + 'icon4'=>$icon4, + 'icon_color4'=>$icon_color4, + 'icon_size4'=>$icon_size4, + 'star'=>$star ); $this->db->where('id',$id); @@ -2558,7 +2635,7 @@ class Admin extends CI_Controller { if(!isset($data['errfields'])) { //delete possible subject_locations - $this->db->select('*'); + /*$this->db->select('*'); $this->db->from('subject_locations'); $this->db->where('id_location',$id_location); $subject_locations=$this->db->get()->result_array(); @@ -2567,7 +2644,7 @@ class Admin extends CI_Controller { { $this->db->where('id',$entry['id']); $this->db->delete('subject_locations'); - } + }*/ //remove location $this->db->where('id',$id_location); diff --git a/sna/application/controllers/Home.php b/sna/application/controllers/Home.php index 57227b0..c050822 100644 --- a/sna/application/controllers/Home.php +++ b/sna/application/controllers/Home.php @@ -65,7 +65,10 @@ class Home extends CI_Controller { $result=$this->home_model->words_trascriptions($id_word,$id_subject); $data['words_transcriptions']=$result['transcriptions']; + //echo json_encode($result['odgovor']); + //return; $data['word']=$this->home_model->word($id_word); + $data['legend']=$result['legend']; $data['transcriptions_count']=$this->home_model->transcriptions_count($id_word); diff --git a/sna/application/models/Admin_model.php b/sna/application/models/Admin_model.php index 8af231b..9b0ada5 100644 --- a/sna/application/models/Admin_model.php +++ b/sna/application/models/Admin_model.php @@ -119,6 +119,7 @@ Class Admin_model extends CI_Model { t1.*, t2.name, t3.title AS lexem_title, + t3.star AS lexem_star, t4.title AS word_title, t5.title AS subject_title, '); @@ -198,11 +199,11 @@ Class Admin_model extends CI_Model { function locations($id_subject) { $this->db->select('t2.*'); - $this->db->from('subject_locations AS t1'); - $this->db->join('locations AS t2','t2.id=t1.id_location'); + $this->db->from('subjects AS t1'); + $this->db->join('locations AS t2','t1.id=t2.id_subject'); if($id_subject) { - $this->db->where('t1.id_subject',$id_subject); + $this->db->where('t2.id_subject',$id_subject); } $this->db->order_by('t2.name','ASC'); @@ -222,8 +223,9 @@ Class Admin_model extends CI_Model { function locations_all() { - $this->db->select('*'); - $this->db->from('locations'); + $this->db->select('t1.*, t2.title'); + $this->db->from('locations AS t1'); + $this->db->join('subjects AS t2', 't1.id_subject=t2.id'); $this->db->order_by('name','ASC'); $result=$this->db->get()->result_array(); @@ -453,10 +455,12 @@ Class Admin_model extends CI_Model { return $exists; } - function location_exists($field,$parameter,$id=0) + function location_exists($field,$parameter, $id_subject, $id=0) { + $this->db->select('name'); $this->db->from('locations'); $this->db->where($field,$parameter); + $this->db->where('id_subject', $id_subject); if($id) { $this->db->where('id!=',$id); @@ -467,10 +471,11 @@ Class Admin_model extends CI_Model { return $exists; } - function location_short_name_exists($short_name,$id=0) + function location_short_name_exists($short_name, $id_subject, $id=0) { $this->db->select('short_name'); $this->db->from('locations'); + $this->db->where('id_subject',$id_subject); $this->db->where('short_name',$short_name); if($id) { @@ -491,11 +496,12 @@ Class Admin_model extends CI_Model { return $identical; } - function coordinates_exists($lat,$long,$id=0) + function coordinates_exists($lat,$long,$id=0, $id_subject) { $this->db->from('locations'); $this->db->where('lat',$lat); $this->db->where('long',$long); + $this->db->where('id_subject',$id_subject); if($id) { $this->db->where('id!=',$id); diff --git a/sna/application/models/Home_model.php b/sna/application/models/Home_model.php index 3a41ff6..d69f621 100644 --- a/sna/application/models/Home_model.php +++ b/sna/application/models/Home_model.php @@ -93,14 +93,16 @@ Class Home_model extends CI_Model { t4.name AS subdialect_title, t5.name AS subsubdialect_title, '); - $this->db->from('subject_locations AS t1'); - $this->db->join('locations AS t2','t1.id_location=t2.id'); + $this->db->from('subjects AS t1'); + $this->db->join('locations AS t2','t1.id=t2.id_subject'); $this->db->join('dialects AS t3','t2.id_dialect=t3.id'); $this->db->join('dialects AS t4','t2.id_subdialect=t4.id'); $this->db->join('dialects AS t5','t2.id_subsubdialect=t5.id','LEFT'); - $this->db->where('t1.id_subject',$id_subject); + $this->db->where('t2.id_subject',$id_subject); $locations=$this->db->get()->result_array(); + + foreach($locations as $i=>$location) { $pixels=$this->convert_to_pixels($location['lat'],$location['long']); @@ -119,10 +121,7 @@ Class Home_model extends CI_Model { $this->db->select(' t1.*, - t2.title, - t2.icon, - t2.id_word, - t2.icon_color, + t2.*, '); $this->db->from('transcriptions AS t1'); $this->db->join('lexems AS t2','t1.id_lexem=t2.id'); @@ -130,9 +129,14 @@ Class Home_model extends CI_Model { $this->db->where('t1.id_location',$location['id']); $transcription=$this->db->get()->row_array(); + //return array('odgovor'=>$locations); + if($transcription) { - $result[$i]['pin']=$transcription['icon']; + $result[$i]['pin1']=$transcription['icon1']; + $result[$i]['pin2']=$transcription['icon2']; + $result[$i]['pin3']=$transcription['icon3']; + $result[$i]['pin4']=$transcription['icon4']; $result[$i]['id']=$transcription['id']; $result[$i]['title']=$transcription['title']; $result[$i]['phonetic_writing']=$transcription['phonetic_writing']; @@ -140,8 +144,22 @@ Class Home_model extends CI_Model { $result[$i]['id_word']=$transcription['id_word']; $result[$i]['id_location']=$transcription['id_location']; $result[$i]['trans_text']=$transcription['trans_text']; - $result[$i]['icon']=$transcription['icon']; - $result[$i]['icon_color']=$transcription['icon_color']; + $result[$i]['icon1']=$transcription['icon1']; + $result[$i]['icon_color1']=$transcription['icon_color1']; + $transcription['icon_size1'] == 'small' ? $result[$i]['icon_size1']= '12' : $result[$i]['icon_size1']= '18'; + + $result[$i]['icon2']=$transcription['icon2']; + $result[$i]['icon_color2']=$transcription['icon_color2']; + $transcription['icon_size2'] == 'small' ? $result[$i]['icon_size2']= '12' : $result[$i]['icon_size2']= '18'; + $result[$i]['icon3']=$transcription['icon3']; + $result[$i]['icon_color3']=$transcription['icon_color3']; + $transcription['icon_size3'] == 'small' ? $result[$i]['icon_size3']= '12' : $result[$i]['icon_size3']= '18'; + $result[$i]['icon4']=$transcription['icon4']; + $result[$i]['icon_color4']=$transcription['icon_color4']; + $transcription['icon_size4'] == 'small' ? $result[$i]['icon_size4']= '12' : $result[$i]['icon_size4']= '18'; + $result[$i]['star']=$transcription['star']; + + //return array('odgovor'=>$result); //only allowed chars $code_title = preg_replace('/[^a-zA-Z0-9]/','', $transcription['title']); @@ -149,11 +167,22 @@ Class Home_model extends CI_Model { if(!array_key_exists($transcription['title'],$used)) { - if($transcription['icon']) + if($transcription['icon1']) { $used[$transcription['title']]=array( - 'icon'=>$transcription['icon'], - 'icon_color'=>$transcription['icon_color'], + 'icon1'=>$transcription['icon1'], + 'icon_color1'=>$transcription['icon_color1'], + 'icon_size1'=>$transcription['icon_size1'], + 'icon2'=>$transcription['icon2'], + 'icon_color2'=>$transcription['icon_color2'], + 'icon_size2'=>$transcription['icon_size2'], + 'icon3'=>$transcription['icon3'], + 'icon_color3'=>$transcription['icon_color3'], + 'icon_size3'=>$transcription['icon_size3'], + 'icon4'=>$transcription['icon4'], + 'icon_color4'=>$transcription['icon_color4'], + 'icon_size4'=>$transcription['icon_size4'], + 'star'=>$transcription['star'], 'code_title'=>$code_title, ); } @@ -161,21 +190,32 @@ Class Home_model extends CI_Model { } else { - $result[$i]['pin']="no_title"; + //return array('odgovor'=>'no transcription'); + $result[$i]['pin1']="no_title"; $result[$i]['title']='no_title'; $result[$i]['code_title']='no_title'; } } //add no title for the last $used['no_title']=array( - 'icon'=>'/', - 'icon_color'=>"#000000", + 'icon1'=>'/', + 'icon_color1'=>"#000000", + 'icon_size1'=>"normal", + 'icon2'=>'', + 'icon_color2'=>"#000000", + 'icon_size2'=>"normal", + 'icon3'=>'', + 'icon_color3'=>"#000000", + 'icon_size3'=>"normal", + 'icon4'=>'', + 'icon_color4'=>"#000000", + 'icon_size4'=>"normal", 'code_title'=>'no_title' ); $data=array( 'legend'=>$used, - 'transcriptions'=>$result, + 'transcriptions'=>$result ); return $data; diff --git a/sna/application/views/admin/add_location_view.php b/sna/application/views/admin/add_location_view.php index 922dfa1..e54ace4 100644 --- a/sna/application/views/admin/add_location_view.php +++ b/sna/application/views/admin/add_location_view.php @@ -73,6 +73,19 @@ Slovenski narečni atlas / Slovenian dialectal atlas +
+ +
+ +
+
@@ -124,21 +137,6 @@ Slovenski narečni atlas / Slovenian dialectal atlas
-
- -
- $subject) - { - ?> -
- -
- -
-

@@ -222,4 +220,6 @@ function ajax_update_subsubdialects() } + + \ No newline at end of file diff --git a/sna/application/views/admin/edit_location_view.php b/sna/application/views/admin/edit_location_view.php index d64f3ae..edf4b5b 100644 --- a/sna/application/views/admin/edit_location_view.php +++ b/sna/application/views/admin/edit_location_view.php @@ -87,6 +87,19 @@ Slovenski narečni atlas / Slovenian dialectal atlas
+
+ +
+ +
+
@@ -138,22 +151,6 @@ Slovenski narečni atlas / Slovenian dialectal atlas
- -
- -
- $subject) - { - ?> -
- > -
- -
-

diff --git a/sna/application/views/admin/edit_subject_view.php b/sna/application/views/admin/edit_subject_view.php index 8ae2cca..a97915b 100644 --- a/sna/application/views/admin/edit_subject_view.php +++ b/sna/application/views/admin/edit_subject_view.php @@ -148,7 +148,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas } ?> - + - Odstrani + Odstrani @@ -134,10 +134,36 @@ $('.close').click(function() { $('#alert_ok').fadeOut(500); }); -$('.confirm').click(function() { - return window.confirm("Izbriši uporabnika?"); -}); - +function user_delete(id_user) +{ + $.ajax({ + type: "POST", + url: "url?>user_delete", + cache: false, + data:{ + id_user:id_user + }, + dataType: "json", + success: function(data){ + if(data.status==='ok') + { + //remove row + window.location.replace('/sna/admin/users'); + } + else + { + var errors=''; + $.each(data.errfields, function(i, error){ + errors+=error+'\n'; + }); + status('error',errors); + } + }, + error: function(e){ + alert('Uporabnika ni bilo mogoče izbrisati!'); + } + }); +} \ No newline at end of file diff --git a/sna/application/views/admin/lexem_add_view.php b/sna/application/views/admin/lexem_add_view.php index 1158952..e6660b2 100644 --- a/sna/application/views/admin/lexem_add_view.php +++ b/sna/application/views/admin/lexem_add_view.php @@ -64,7 +64,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
- $subject) { @@ -77,7 +77,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
- $word) { @@ -90,21 +90,70 @@ Slovenski narečni atlas / Slovenian dialectal atlas
- -
-
-
- -
- -
-
-
- -
- +
+
+ +
+ +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+

@@ -155,4 +204,5 @@ function ajax_update_words() }); } + \ No newline at end of file diff --git a/sna/application/views/admin/lexem_edit_view.php b/sna/application/views/admin/lexem_edit_view.php index 0a9c7f4..6d529b7 100644 --- a/sna/application/views/admin/lexem_edit_view.php +++ b/sna/application/views/admin/lexem_edit_view.php @@ -76,59 +76,105 @@ Slovenski narečni atlas / Slovenian dialectal atlas
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- - -
+ +
+ +
- - -
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+
+ + +
+
+
diff --git a/sna/application/views/admin/lexems_list_view.php b/sna/application/views/admin/lexems_list_view.php index b7d7989..7be854e 100644 --- a/sna/application/views/admin/lexems_list_view.php +++ b/sna/application/views/admin/lexems_list_view.php @@ -37,10 +37,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas ?> . - + () - - + + - Št. - Kraj + Št. + Kraj Kratica + Tema Zemljepisna širina (lat) Zemljepisna dolžina (long) Odstrani @@ -86,9 +87,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas . + - + . - + - +

Uporabniki

- - -
@@ -64,6 +50,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas Uporabniško ime Ime Priimek + Odstrani @@ -72,11 +59,16 @@ Slovenski narečni atlas / Slovenian dialectal atlas foreach($users as $i=>$user) { ?> - + . + + + + Prijavljen uporabnik + url?>user_delete", + cache: false, + data:{ + id_user:id_user + }, + dataType: "json", + success: function(data){ + if(data.status==='ok') + { + //remove row + $('#row-'+id_user).remove(); + } + else + { + var errors=''; + $.each(data.errfields, function(i, error){ + errors+=error+'\n'; + }); + status('error',errors); + } + }, + error: function(e){ + alert('Uporabnika ni bilo mogoče izbrisati!'); + } + }); +} + \ No newline at end of file diff --git a/sna/application/views/home/index_view.php b/sna/application/views/home/index_view.php index 8fb7298..b005437 100644 --- a/sna/application/views/home/index_view.php +++ b/sna/application/views/home/index_view.php @@ -20,16 +20,16 @@ Slovenski narečni atlas / Slovenian dialectal atlas ?> -
+
-
+

Slovenski narečni atlas

-
+
-
+
$word) @@ -58,9 +58,9 @@ Slovenski narečni atlas / Slovenian dialectal atlas
-
+
-
+
- -
+
+ +
+ load->view('home/legend_view.php'); + ?> +
@@ -122,6 +127,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas ?>
+