Added responsive map and main page design, re-arranged entities in database, edited admin functionalities.

This commit is contained in:
Nermin 2018-08-01 20:22:56 +02:00
parent ff33d1503f
commit b199e0534e
19 changed files with 828 additions and 299 deletions

View File

@ -1,13 +1,15 @@
-- phpMyAdmin SQL Dump -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2 -- version 4.7.0
-- http://www.phpmyadmin.net -- https://www.phpmyadmin.net/
-- --
-- Gostitelj: localhost -- Gostitelj: 127.0.0.1
-- Čas nastanka: 12. avg 2017 ob 12.57 -- Čas nastanka: 01. avg 2018 ob 20.14
-- Različica strežnika: 5.7.19-0ubuntu0.16.04.1 -- Različica strežnika: 10.1.22-MariaDB
-- Različica PHP: 7.0.22-0ubuntu0.16.04.1 -- Različica PHP: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"; SET time_zone = "+00:00";
@ -19,8 +21,6 @@ SET time_zone = "+00:00";
-- --
-- Zbirka podatkov: `digital_atlas` -- Zbirka podatkov: `digital_atlas`
-- --
CREATE DATABASE IF NOT EXISTS `digital_atlas` DEFAULT CHARACTER SET utf8 COLLATE utf8_slovenian_ci;
USE `digital_atlas`;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -107,11 +107,115 @@ INSERT INTO `dialects` (`id`, `name`, `type`, `id_parent`) VALUES
CREATE TABLE `lexems` ( CREATE TABLE `lexems` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8_slovenian_ci 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, `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; ) 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, `id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8_slovenian_ci NOT NULL DEFAULT '', `name` varchar(255) COLLATE utf8_slovenian_ci NOT NULL DEFAULT '',
`short_name` varchar(50) 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, `lat` decimal(10,6) NOT NULL,
`long` decimal(10,6) NOT NULL, `long` decimal(10,6) NOT NULL,
`id_dialect` int(11) NOT NULL, `id_dialect` int(11) NOT NULL,
@ -129,6 +234,14 @@ CREATE TABLE `locations` (
`id_subsubdialect` int(11) DEFAULT NULL `id_subsubdialect` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; ) 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` ( CREATE TABLE `subjects` (
`id` int(1) NOT NULL, `id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8_slovenian_ci NOT NULL `title` varchar(255) COLLATE utf8_slovenian_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci;
-- --------------------------------------------------------
-- --
-- Struktura tabele `subject_locations` -- Odloži podatke za tabelo `subjects`
-- --
CREATE TABLE `subject_locations` ( INSERT INTO `subjects` (`id`, `title`) VALUES
`id` int(11) NOT NULL, (1, 'Stara kmečka hiša'),
`id_subject` int(11) DEFAULT NULL, (11, 'Posoda'),
`id_location` int(11) NOT NULL, (12, 'Sadje');
`checked` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -168,6 +277,14 @@ CREATE TABLE `transcriptions` (
`trans_text` text COLLATE utf8_slovenian_ci NOT NULL `trans_text` text COLLATE utf8_slovenian_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; ) 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 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 `id_subject` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci; ) 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 -- Indeksi zavrženih tabel
-- --
@ -229,7 +383,8 @@ ALTER TABLE `locations`
ADD PRIMARY KEY (`id`), ADD PRIMARY KEY (`id`),
ADD KEY `FK_locations_dialects` (`id_dialect`), ADD KEY `FK_locations_dialects` (`id_dialect`),
ADD KEY `FK_locations_dialects_2` (`id_subdialect`), 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` -- Indeksi tabele `subjects`
@ -237,14 +392,6 @@ ALTER TABLE `locations`
ALTER TABLE `subjects` ALTER TABLE `subjects`
ADD PRIMARY KEY (`id`); 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` -- Indeksi tabele `transcriptions`
-- --
@ -252,7 +399,7 @@ ALTER TABLE `transcriptions`
ADD PRIMARY KEY (`id`), ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id_location_uniq` (`id_location`,`id_lexem`), ADD UNIQUE KEY `id_location_uniq` (`id_location`,`id_lexem`),
ADD KEY `id_word` (`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` -- Indeksi tabele `users`
@ -280,37 +427,32 @@ ALTER TABLE `dialects`
-- AUTO_INCREMENT tabele `lexems` -- AUTO_INCREMENT tabele `lexems`
-- --
ALTER TABLE `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` -- AUTO_INCREMENT tabele `locations`
-- --
ALTER TABLE `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` -- AUTO_INCREMENT tabele `subjects`
-- --
ALTER TABLE `subjects` ALTER TABLE `subjects`
MODIFY `id` int(1) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT tabele `subject_locations`
--
ALTER TABLE `subject_locations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
-- --
-- AUTO_INCREMENT tabele `transcriptions` -- AUTO_INCREMENT tabele `transcriptions`
-- --
ALTER TABLE `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` -- AUTO_INCREMENT tabele `users`
-- --
ALTER TABLE `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` -- AUTO_INCREMENT tabele `words`
-- --
ALTER TABLE `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 -- Omejitve tabel za povzetek stanja
-- --
@ -333,27 +475,22 @@ ALTER TABLE `lexems`
ALTER TABLE `locations` ALTER TABLE `locations`
ADD CONSTRAINT `FK_locations_dialects` FOREIGN KEY (`id_dialect`) REFERENCES `dialects` (`id`), 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_2` FOREIGN KEY (`id_subdialect`) REFERENCES `dialects` (`id`),
ADD CONSTRAINT `FK_locations_dialects_3` FOREIGN KEY (`id_subsubdialect`) REFERENCES `dialects` (`id`); 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 `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;
-- --
-- Omejitve za tabelo `transcriptions` -- Omejitve za tabelo `transcriptions`
-- --
ALTER TABLE `transcriptions` ALTER TABLE `transcriptions`
ADD CONSTRAINT `FK_transcriptions_leksems` FOREIGN KEY (`id_lexem`) REFERENCES `lexems` (`id`), ADD CONSTRAINT `transcriptions_ibfk_1` FOREIGN KEY (`id_location`) REFERENCES `locations` (`id`),
ADD CONSTRAINT `FK_transcriptions_locations` FOREIGN KEY (`id_location`) REFERENCES `locations` (`id`); ADD CONSTRAINT `transcriptions_ibfk_2` FOREIGN KEY (`id_lexem`) REFERENCES `lexems` (`id`);
-- --
-- Omejitve za tabelo `words` -- Omejitve za tabelo `words`
-- --
ALTER TABLE `words` ALTER TABLE `words`
ADD CONSTRAINT `FK_words_subjects` FOREIGN KEY (`id_subject`) REFERENCES `subjects` (`id`); 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_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

View File

@ -76,8 +76,8 @@ $query_builder = TRUE;
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'localhost', 'hostname' => 'localhost',
'username' => 'my-username', 'username' => 'nermin',
'password' => 'my-passwd', 'password' => '',
'database' => 'digital_atlas', 'database' => 'digital_atlas',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',

View File

@ -335,7 +335,7 @@ class Admin extends CI_Controller {
if(!isset($data['errfields'])) if(!isset($data['errfields']))
{ {
//delete possible subject_locations //delete possible subject_locations
$this->db->select('*'); /*$this->db->select('*');
$this->db->from('subject_locations'); $this->db->from('subject_locations');
$this->db->where('id_subject',$id_subject); $this->db->where('id_subject',$id_subject);
$subject_locations=$this->db->get()->result_array(); $subject_locations=$this->db->get()->result_array();
@ -344,7 +344,7 @@ class Admin extends CI_Controller {
{ {
$this->db->where('id',$entry['id']); $this->db->where('id',$entry['id']);
$this->db->delete('subject_locations'); $this->db->delete('subject_locations');
} }*/
//remove subject //remove subject
$this->db->where('id',$id_subject); $this->db->where('id',$id_subject);
@ -445,7 +445,7 @@ class Admin extends CI_Controller {
$image_upload_ok = 0; $image_upload_ok = 0;
} }
//tip datoteke //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" ) { && $image_file_type != "gif" ) {
$data['errfields']['image_format']='Izbrana slika ni ustreznega slikovnega formata! Dovoljeni so jpg, png, jpeg in gif formati.'; $data['errfields']['image_format']='Izbrana slika ni ustreznega slikovnega formata! Dovoljeni so jpg, png, jpeg in gif formati.';
$image_upload_ok = 0; $image_upload_ok = 0;
@ -632,7 +632,7 @@ class Admin extends CI_Controller {
$image_upload_ok = 0; $image_upload_ok = 0;
} }
//tip datoteke //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" ) { && $image_file_type != "gif" ) {
$data['errfields']['image_format']='Izbrana slika ni ustreznega slikovnega formata! Dovoljeni so jpg, png, jpeg in gif formati.'; $data['errfields']['image_format']='Izbrana slika ni ustreznega slikovnega formata! Dovoljeni so jpg, png, jpeg in gif formati.';
$image_upload_ok = 0; $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['subsubdialects']=array(0=>'Izberite podnarečje')+$this->admin_model->subsubdialects($location['id_subdialect'],'options');
$data['subjects']=$this->admin_model->subjects(); $data['subjects']=$this->admin_model->subjects();
$data['subjects']=array(0=>'Izberite temo')+$this->home_model->subjects('select');
$data['errfields']=$this->session->flashdata('errfields'); $data['errfields']=$this->session->flashdata('errfields');
//var_dump($data);
if($location) if($location)
{ {
$data['location']=$location; $data['location']=$location;
@ -1257,6 +1260,7 @@ class Admin extends CI_Controller {
'id_dialect'=>0, 'id_dialect'=>0,
'id_subdialect'=>0, 'id_subdialect'=>0,
'id_subsubdialect'=>0, 'id_subsubdialect'=>0,
'id_subject'=>''
); );
} }
@ -1272,9 +1276,9 @@ class Admin extends CI_Controller {
$id_dialect=$this->input->post('dialects',true); $id_dialect=$this->input->post('dialects',true);
$id_subdialect=$this->input->post('subdialects',true); $id_subdialect=$this->input->post('subdialects',true);
$id_subsubdialect=$this->input->post('subsubdialects',true); $id_subsubdialect=$this->input->post('subsubdialects',true);
$id_subject=$this->input->post('subject',true);
$save_close=$this->input->post('save_close',true); $save_close=$this->input->post('save_close',true);
$subjects=$this->input->post('subjects',true);
//save post to session //save post to session
$data=array( $data=array(
@ -1285,6 +1289,7 @@ class Admin extends CI_Controller {
'id_dialect'=>$id_dialect, 'id_dialect'=>$id_dialect,
'id_subdialect'=>$id_subdialect, 'id_subdialect'=>$id_subdialect,
'id_subsubdialect'=>$id_subsubdialect, 'id_subsubdialect'=>$id_subsubdialect,
'id_subject'=>$id_subject
); );
$this->session->set_flashdata('add_location',$data); $this->session->set_flashdata('add_location',$data);
@ -1293,18 +1298,23 @@ class Admin extends CI_Controller {
{ {
$data['errfields']['name']='Ime kraja je prazno!'; $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) if(!$short_name)
{ {
$data['errfields']['short_name']='Kratek naziv kraja je prazen!'; $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) if(!$lat)
@ -1341,13 +1351,7 @@ class Admin extends CI_Controller {
$data['errfields']['long']='Zemljepisna dolžina (long) mora biti številska vrednost!'; $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) if(!$id_dialect)
{ {
@ -1358,6 +1362,14 @@ class Admin extends CI_Controller {
$data['errfields']['id_subdialect']='Izberite narečje!'; $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(!isset($data['errfields']))
{ {
if($data['id_subsubdialect']==0) if($data['id_subsubdialect']==0)
@ -1369,14 +1381,14 @@ class Admin extends CI_Controller {
//add possible subject_locations //add possible subject_locations
foreach($subjects as $key=>$id_subject) foreach($id_subjects as $key=>$id_subject)
{ {
$db_data=array( $db_data=array(
'id_location'=>$id_location, 'id_location'=>$id_location,
'id_subject'=>$id_subject, 'id_subject'=>$id_subject,
'checked'=>1, 'checked'=>1,
); );
$this->db->insert('subject_locations',$db_data); //$this->db->insert('subject_locations',$db_data);
} }
$data['status']='ok'; $data['status']='ok';
@ -1424,7 +1436,7 @@ class Admin extends CI_Controller {
$data['subjects']=$this->admin_model->subjects(); $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'); $data['errfields']=$this->session->flashdata('errfields');
@ -1453,6 +1465,7 @@ class Admin extends CI_Controller {
$id_dialect=$this->input->post('dialects',true); $id_dialect=$this->input->post('dialects',true);
$id_subdialect=$this->input->post('subdialects',true); $id_subdialect=$this->input->post('subdialects',true);
$id_subsubdialect=$this->input->post('subsubdialects',true); $id_subsubdialect=$this->input->post('subsubdialects',true);
$id_subject=$this->input->post('subject',true);
$save_close=$this->input->post('save_close',true); $save_close=$this->input->post('save_close',true);
$subjects=$this->input->post('subjects',true); $subjects=$this->input->post('subjects',true);
@ -1461,10 +1474,7 @@ class Admin extends CI_Controller {
{ {
$data['errfields']['name']='Ime kraja je prazno!'; $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) if(!$short_name)
{ {
@ -1511,18 +1521,19 @@ class Admin extends CI_Controller {
$data['errfields']['long']='Zemljepisna dolžina (long) mora biti številska vrednost!'; $data['errfields']['long']='Zemljepisna dolžina (long) mora biti številska vrednost!';
} }
} }
if($lat and $long) if($lat and $long)
{ {
if($this->admin_model->coordinates_exists($lat,$long,$id_location)) if($this->admin_model->coordinates_exists($lat,$long,$id_location, $id_subject))
{ {
$data['errfields']['coordinates']='Na teh koordinatah že obstaja kraj!'; $data['errfields']['coordinates']='Na teh koordinatah za to temo že obstaja kraj!';
} }
} }
if(!isset($data['errfields'])) if(!isset($data['errfields']))
{ {
//get all //get all
$this->db->select('*'); /*$this->db->select('*');
$this->db->from('subject_locations'); $this->db->from('subject_locations');
$this->db->where('id_location',$id_location); $this->db->where('id_location',$id_location);
$subject_locations=$this->db->get()->result_array(); $subject_locations=$this->db->get()->result_array();
@ -1565,7 +1576,7 @@ class Admin extends CI_Controller {
{ {
$this->db->where('id',$id); $this->db->where('id',$id);
$this->db->delete('subject_locations'); $this->db->delete('subject_locations');
} }*/
$db_data=array( $db_data=array(
@ -1576,6 +1587,7 @@ class Admin extends CI_Controller {
'id_dialect'=>$id_dialect, 'id_dialect'=>$id_dialect,
'id_subdialect'=>$id_subdialect, 'id_subdialect'=>$id_subdialect,
'id_subsubdialect'=>$id_subsubdialect?$id_subsubdialect:NULL, 'id_subsubdialect'=>$id_subsubdialect?$id_subsubdialect:NULL,
'id_subject'=>$id_subject
); );
//update //update
@ -1690,6 +1702,7 @@ class Admin extends CI_Controller {
redirect($this->url.'edit_user/'.$id_user); redirect($this->url.'edit_user/'.$id_user);
} }
function edit_user() function edit_user()
{ {
$this->check_user(); $this->check_user();
@ -1806,9 +1819,9 @@ class Admin extends CI_Controller {
{ {
$this->check_user(); $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 //remove subject
$this->db->where('id',$id_user); $this->db->where('id',$id_user);
@ -1818,11 +1831,14 @@ class Admin extends CI_Controller {
$_SESSION['status']=$data['status']; $_SESSION['status']=$data['status'];
redirect($this->url.'users/'); $data['status']='ok';
echo json_encode($data);
} }
else 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); redirect($this->url.'/edit_user/'.$id_user);
} }
@ -1884,8 +1900,19 @@ class Admin extends CI_Controller {
'title' => '', 'title' => '',
'id_word'=>0, 'id_word'=>0,
'id_subject'=>0, 'id_subject'=>0,
'icon'=>'', 'icon1'=>'',
'icon_color'=>'', '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_word=$this->input->post('words',true);
$id_subject=$this->input->post('subjects',true); $id_subject=$this->input->post('subjects',true);
$title=$this->input->post('title',true); $title=$this->input->post('title',true);
$icon=$this->input->post('icon',true); $icon1=$this->input->post('icon1',true);
$icon_color=$this->input->post('icon_color',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); $save_close=$this->input->post('save_close',true);
$star = $star === 'on' ? 1 : 0;
//save post to session //save post to session
$data=array( $data=array(
'title'=>$title, 'title'=>$title,
'id_word'=>$id_word, 'id_word'=>$id_word,
'id_subject'=>$id_subject, 'id_subject'=>$id_subject,
'icon'=>$icon, 'icon1'=>$icon1,
'icon_color'=>$icon_color, '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); $this->session->set_flashdata('add_lexem',$data);
@ -1924,18 +1975,18 @@ class Admin extends CI_Controller {
$data['errfields']['no_word']="Izberite besedo!"; $data['errfields']['no_word']="Izberite besedo!";
} }
if(!$icon) if(!$icon1)
{ {
$data['errfields']['no_icon']="Simbol leksema je prazen!"; $data['errfields']['no_icon']="Simbol leksema je prazen!";
} }
else 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'])) if(!isset($data['errfields']))
@ -1966,7 +2017,7 @@ class Admin extends CI_Controller {
redirect($this->url.'edit_lexem/'.$id_lexem); redirect($this->url.'edit_lexem/'.$id_lexem);
} }
//var_dump($data);
} }
else else
{ {
@ -1974,6 +2025,7 @@ class Admin extends CI_Controller {
$this->session->set_flashdata('errfields',$data['errfields']); $this->session->set_flashdata('errfields',$data['errfields']);
redirect($this->url.'add_lexem/'); redirect($this->url.'add_lexem/');
var_dump($data);
} }
} }
@ -2014,11 +2066,25 @@ class Admin extends CI_Controller {
{ {
$id=$this->input->post('id',true); $id=$this->input->post('id',true);
$id_word=$this->input->post('words',true); $id_word=$this->input->post('words',true);
$id_subject=$this->input->post('subjects',true);
$title=$this->input->post('title',true); $title=$this->input->post('title',true);
$icon=$this->input->post('icon',true); $icon1=$this->input->post('icon1',true);
$icon_color=$this->input->post('icon_color',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); $save_close=$this->input->post('save_close',true);
$star = $star === 'on' ? 1 : 0;
//check //check
if(!$title) if(!$title)
{ {
@ -2030,18 +2096,18 @@ class Admin extends CI_Controller {
$data['errfields']['no_word']="Izberite besedo!"; $data['errfields']['no_word']="Izberite besedo!";
} }
if(!$icon) if(!$icon1)
{ {
$data['errfields']['no_icon']="Simbol leksema je prazen!"; $data['errfields']['no_icon']="Simbol leksema je prazen!";
} }
else 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'])) if(!isset($data['errfields']))
@ -2057,8 +2123,19 @@ class Admin extends CI_Controller {
$db_data=array( $db_data=array(
'title'=>$title, 'title'=>$title,
'id_word'=>$id_word, 'id_word'=>$id_word,
'icon'=>$icon, 'icon1'=>$icon1,
'icon_color'=>$icon_color, '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); $this->db->where('id',$id);
@ -2558,7 +2635,7 @@ class Admin extends CI_Controller {
if(!isset($data['errfields'])) if(!isset($data['errfields']))
{ {
//delete possible subject_locations //delete possible subject_locations
$this->db->select('*'); /*$this->db->select('*');
$this->db->from('subject_locations'); $this->db->from('subject_locations');
$this->db->where('id_location',$id_location); $this->db->where('id_location',$id_location);
$subject_locations=$this->db->get()->result_array(); $subject_locations=$this->db->get()->result_array();
@ -2567,7 +2644,7 @@ class Admin extends CI_Controller {
{ {
$this->db->where('id',$entry['id']); $this->db->where('id',$entry['id']);
$this->db->delete('subject_locations'); $this->db->delete('subject_locations');
} }*/
//remove location //remove location
$this->db->where('id',$id_location); $this->db->where('id',$id_location);

View File

@ -65,7 +65,10 @@ class Home extends CI_Controller {
$result=$this->home_model->words_trascriptions($id_word,$id_subject); $result=$this->home_model->words_trascriptions($id_word,$id_subject);
$data['words_transcriptions']=$result['transcriptions']; $data['words_transcriptions']=$result['transcriptions'];
//echo json_encode($result['odgovor']);
//return;
$data['word']=$this->home_model->word($id_word); $data['word']=$this->home_model->word($id_word);
$data['legend']=$result['legend']; $data['legend']=$result['legend'];
$data['transcriptions_count']=$this->home_model->transcriptions_count($id_word); $data['transcriptions_count']=$this->home_model->transcriptions_count($id_word);

View File

@ -119,6 +119,7 @@ Class Admin_model extends CI_Model {
t1.*, t1.*,
t2.name, t2.name,
t3.title AS lexem_title, t3.title AS lexem_title,
t3.star AS lexem_star,
t4.title AS word_title, t4.title AS word_title,
t5.title AS subject_title, t5.title AS subject_title,
'); ');
@ -198,11 +199,11 @@ Class Admin_model extends CI_Model {
function locations($id_subject) function locations($id_subject)
{ {
$this->db->select('t2.*'); $this->db->select('t2.*');
$this->db->from('subject_locations AS t1'); $this->db->from('subjects AS t1');
$this->db->join('locations AS t2','t2.id=t1.id_location'); $this->db->join('locations AS t2','t1.id=t2.id_subject');
if($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'); $this->db->order_by('t2.name','ASC');
@ -222,8 +223,9 @@ Class Admin_model extends CI_Model {
function locations_all() function locations_all()
{ {
$this->db->select('*'); $this->db->select('t1.*, t2.title');
$this->db->from('locations'); $this->db->from('locations AS t1');
$this->db->join('subjects AS t2', 't1.id_subject=t2.id');
$this->db->order_by('name','ASC'); $this->db->order_by('name','ASC');
$result=$this->db->get()->result_array(); $result=$this->db->get()->result_array();
@ -453,10 +455,12 @@ Class Admin_model extends CI_Model {
return $exists; 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->from('locations');
$this->db->where($field,$parameter); $this->db->where($field,$parameter);
$this->db->where('id_subject', $id_subject);
if($id) if($id)
{ {
$this->db->where('id!=',$id); $this->db->where('id!=',$id);
@ -467,10 +471,11 @@ Class Admin_model extends CI_Model {
return $exists; 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->select('short_name');
$this->db->from('locations'); $this->db->from('locations');
$this->db->where('id_subject',$id_subject);
$this->db->where('short_name',$short_name); $this->db->where('short_name',$short_name);
if($id) if($id)
{ {
@ -491,11 +496,12 @@ Class Admin_model extends CI_Model {
return $identical; return $identical;
} }
function coordinates_exists($lat,$long,$id=0) function coordinates_exists($lat,$long,$id=0, $id_subject)
{ {
$this->db->from('locations'); $this->db->from('locations');
$this->db->where('lat',$lat); $this->db->where('lat',$lat);
$this->db->where('long',$long); $this->db->where('long',$long);
$this->db->where('id_subject',$id_subject);
if($id) if($id)
{ {
$this->db->where('id!=',$id); $this->db->where('id!=',$id);

View File

@ -93,14 +93,16 @@ Class Home_model extends CI_Model {
t4.name AS subdialect_title, t4.name AS subdialect_title,
t5.name AS subsubdialect_title, t5.name AS subsubdialect_title,
'); ');
$this->db->from('subject_locations AS t1'); $this->db->from('subjects AS t1');
$this->db->join('locations AS t2','t1.id_location=t2.id'); $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 t3','t2.id_dialect=t3.id');
$this->db->join('dialects AS t4','t2.id_subdialect=t4.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->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(); $locations=$this->db->get()->result_array();
foreach($locations as $i=>$location) foreach($locations as $i=>$location)
{ {
$pixels=$this->convert_to_pixels($location['lat'],$location['long']); $pixels=$this->convert_to_pixels($location['lat'],$location['long']);
@ -119,10 +121,7 @@ Class Home_model extends CI_Model {
$this->db->select(' $this->db->select('
t1.*, t1.*,
t2.title, t2.*,
t2.icon,
t2.id_word,
t2.icon_color,
'); ');
$this->db->from('transcriptions AS t1'); $this->db->from('transcriptions AS t1');
$this->db->join('lexems AS t2','t1.id_lexem=t2.id'); $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']); $this->db->where('t1.id_location',$location['id']);
$transcription=$this->db->get()->row_array(); $transcription=$this->db->get()->row_array();
//return array('odgovor'=>$locations);
if($transcription) 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]['id']=$transcription['id'];
$result[$i]['title']=$transcription['title']; $result[$i]['title']=$transcription['title'];
$result[$i]['phonetic_writing']=$transcription['phonetic_writing']; $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_word']=$transcription['id_word'];
$result[$i]['id_location']=$transcription['id_location']; $result[$i]['id_location']=$transcription['id_location'];
$result[$i]['trans_text']=$transcription['trans_text']; $result[$i]['trans_text']=$transcription['trans_text'];
$result[$i]['icon']=$transcription['icon']; $result[$i]['icon1']=$transcription['icon1'];
$result[$i]['icon_color']=$transcription['icon_color']; $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 //only allowed chars
$code_title = preg_replace('/[^a-zA-Z0-9]/','', $transcription['title']); $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(!array_key_exists($transcription['title'],$used))
{ {
if($transcription['icon']) if($transcription['icon1'])
{ {
$used[$transcription['title']]=array( $used[$transcription['title']]=array(
'icon'=>$transcription['icon'], 'icon1'=>$transcription['icon1'],
'icon_color'=>$transcription['icon_color'], '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, 'code_title'=>$code_title,
); );
} }
@ -161,21 +190,32 @@ Class Home_model extends CI_Model {
} }
else else
{ {
$result[$i]['pin']="no_title"; //return array('odgovor'=>'no transcription');
$result[$i]['pin1']="no_title";
$result[$i]['title']='no_title'; $result[$i]['title']='no_title';
$result[$i]['code_title']='no_title'; $result[$i]['code_title']='no_title';
} }
} }
//add no title for the last //add no title for the last
$used['no_title']=array( $used['no_title']=array(
'icon'=>'/', 'icon1'=>'/',
'icon_color'=>"#000000", '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' 'code_title'=>'no_title'
); );
$data=array( $data=array(
'legend'=>$used, 'legend'=>$used,
'transcriptions'=>$result, 'transcriptions'=>$result
); );
return $data; return $data;

View File

@ -73,6 +73,19 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<input type="text" class="form-control input-md" value="<?=$location['short_name']?>" id="short_name" name="short_name"> <input type="text" class="form-control input-md" value="<?=$location['short_name']?>" id="short_name" name="short_name">
</div> </div>
</div> </div>
<div class="form-group">
<label for="subjects" class="col-sm-2 control-label">Tema<span class="text-danger">*</span></label>
<div class="col-sm-10">
<select class="form-control" style="width:315px;" id="subject" name="subject">
<?
foreach($subjects as $id=>$subject)
{
?><option value="<?=$id?>" <?=$id==$location['id_subject']?'selected="selected"':''?>><?=$subject?></option><?
}
?>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label for="short_name" class="col-sm-2 control-label">Zemljepisna širina (lat)<span class="text-danger">*</span></label> <label for="short_name" class="col-sm-2 control-label">Zemljepisna širina (lat)<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -124,21 +137,6 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label for="subsubdialects" class="col-sm-2 control-label">Vsebovana v temah</label>
<div class="col-sm-10" style="padding-top:10px;">
<?
foreach($subjects as $id=>$subject)
{
?>
<div>
<input type="checkbox" name="subjects[]" value="<?=$id?>"> <?=$subject?>
</div>
<?
}
?>
</div>
</div>
<br> <br>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">
@ -222,4 +220,6 @@ function ajax_update_subsubdialects()
} }
</script> </script>

View File

@ -87,6 +87,19 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<input type="text" class="form-control input-md" value="<?=$location['short_name']?>" id="short_name" name="short_name"> <input type="text" class="form-control input-md" value="<?=$location['short_name']?>" id="short_name" name="short_name">
</div> </div>
</div> </div>
<div class="form-group">
<label for="subjects" class="col-sm-2 control-label">Tema<span class="text-danger">*</span></label>
<div class="col-sm-10">
<select class="form-control" style="width:315px;" id="subject" name="subject">
<?
foreach($subjects as $id=>$subject)
{
?><option value="<?=$id?>" <?=$id==$location['id_subject']?'selected="selected"':''?>><?=$subject?></option><?
}
?>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label for="short_name" class="col-sm-2 control-label">Zemljepisna širina (lat)<span class="text-danger">*</span></label> <label for="short_name" class="col-sm-2 control-label">Zemljepisna širina (lat)<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -138,22 +151,6 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label for="subsubdialects" class="col-sm-2 control-label">Vsebovana v temah</label>
<div class="col-sm-10" style="padding-top:10px;">
<?
foreach($subjects as $id=>$subject)
{
?>
<div>
<input type="checkbox" name="subjects[]" value="<?=$id?>" <?=(isset($subject_locations[$id]))?'checked':''?>> <?=$subject?>
</div>
<?
}
?>
</div>
</div>
<br> <br>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">

View File

@ -148,7 +148,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
} }
?> ?>
</td> </td>
<td class="text-center"><span class="glyphicon glyphicon-remove text-danger" onclick="if(confirm('Izbriši besedo?')){ajax_word_delete(<?=$word['id']?>)};event.stopPropagation();"></span></td> <td class="text-center"><span class="glyphicon glyphicon-hover glyphicon-remove text-danger" onclick="if(confirm('Izbriši besedo <?php echo $word['title'] ?>?')){ajax_word_delete(<?=$word['id']?>)};event.stopPropagation();"></span></td>
</tr> </tr>
<? <?
} }

View File

@ -43,7 +43,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
if($user['id']!=1) if($user['id']!=1)
{ {
?> ?>
<a class="btn btn-danger confirm" href="<?=$this->url?>user_delete/<?=$user['id']?>" title="Odstrani uporabnika">Odstrani</a> <a class="btn btn-danger confirm" onclick="if(confirm('Izbriši uporabnika <?php echo $user['username'] ?>?')){user_delete(<?=$user['id']?>)};event.stopPropagation();" title="Odstrani uporabnika">Odstrani</a>
<? <?
} }
?> ?>
@ -134,10 +134,36 @@ $('.close').click(function() {
$('#alert_ok').fadeOut(500); $('#alert_ok').fadeOut(500);
}); });
$('.confirm').click(function() { function user_delete(id_user)
return window.confirm("Izbriši uporabnika?"); {
$.ajax({
type: "POST",
url: "<?=$this->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!');
}
});
}
</script> </script>

View File

@ -64,7 +64,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group"> <div class="form-group">
<label for="subjects" class="col-sm-2 control-label">Tema</label> <label for="subjects" class="col-sm-2 control-label">Tema</label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" style="width:300px;" id="subjects" name="subjects" onchange="ajax_update_words();"> <select class="form-control" style="width:315px;" id="subjects" name="subjects" onchange="ajax_update_words();">
<? <?
foreach($subjects as $id=>$subject) foreach($subjects as $id=>$subject)
{ {
@ -77,7 +77,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group"> <div class="form-group">
<label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label> <label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" style="width:300px;" name="words" id="words"> <select class="form-control" style="width:315px;" name="words" id="words">
<? <?
foreach($words as $id=>$word) foreach($words as $id=>$word)
{ {
@ -90,19 +90,68 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group"> <div class="form-group">
<label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label> <label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:300px;"> <input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:315px;">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="icon" class="col-sm-2 control-label">Simbol leksema<span class="text-danger">*</span></label> <label for="star" class="col-sm-2 control-label">Leksem ima simbol * (zvezdica)</label>
<div class="col-sm-2">
<label class="switch">
<input type="checkbox" <? if($lexem['star'] === '1' || $lexem['star'] === 1) echo 'checked'?> id="star" name="star">
<span class="slider round"></span>
</label>
</div>
</div>
<div id="div1" class="form-group form-inline">
<label for="icon1" class="col-sm-2 control-label">Prvi simbol leksema<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon']?>" id="icon" name="icon" style="width:100px;"> <input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon1']?>" id="icon1" name="icon1" style="margin-right: 10px; width:100px;">
<label for="icon_color1" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color1" id="icon_color1" value="<?=$lexem['icon_color1']?>" type="color"/>
<label for="icon_size1" control-label">Velikost</label>
<select class="dropdown" name="icon_size1" id="icon_size1" title="Izberite velikost">
<option selected id="normal1" value="normal">Normalna</option>
<option <? if($lexem['icon_size1'] === 'small') echo 'selected' ?> id="small1" value="small">Majhna</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div id="div2" class="form-group form-inline">
<label for="title" class="col-sm-2 control-label">Barva simbola leksema</label> <label for="icon2" class="col-sm-2 control-label">Drugi simbol leksema</label>
<div class="col-sm-10" style="padding-top:5px;"> <div class="col-sm-10">
<input name="icon_color" id="icon_color" value="<?=$lexem['icon_color']?>" type="color"/> <input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon2']?>" id="icon2" name="icon2" style="margin-right: 10px; width:100px;">
<label for="icon_color2" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color2" id="icon_color2" value="<?=$lexem['icon_color2']?>" type="color"/>
<label for="icon_size2" control-label">Velikost</label>
<select class="dropdown" name="icon_size2" id="icon_size2" title="Izberite velikost">
<option selected id="normal2" value="normal">Normalna</option>
<option <? if($lexem['icon_size2'] === 'small') echo 'selected' ?> id="small2" value="small">Majhna</option>
</select>
</div>
</div>
<div id="div3" class="form-group form-inline">
<label for="icon3" class="col-sm-2 control-label">Tretji simbol leksema</label>
<div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon3']?>" id="icon3" name="icon3" style="margin-right: 10px; width:100px;">
<label for="title" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color3" id="icon_color3" value="<?=$lexem['icon_color3']?>" type="color"/>
<label for="title" control-label">Velikost</label>
<select class="dropdown" name="icon_size3" id="icon_size3" title="Izberite velikost">
<option selected id="normal3" value="normal">Normalna</option>
<option <? if($lexem['icon_size3'] === 'small') echo 'selected' ?> id="small3" value="small">Majhna</option>
</select>
</div>
</div>
<div id="div4" class="form-group form-inline ">
<label for="icon4" class="col-sm-2 control-label">Četrti simbol leksema</label>
<div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon4']?>" id="icon4" name="icon4" style="margin-right: 10px; width:100px;">
<label for="title" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color4" id="icon_color4" value="<?=$lexem['icon_color4']?>" type="color"/>
<label for="title" control-label">Velikost</label>
<select class="dropdown" name="icon_size4" id="icon_size4" title="Izberite velikost">
<option selected id="normal4" value="normal">Normalna</option>
<option <? if($lexem['icon_size4'] === 'small') echo 'selected' ?> id="small4" value="small">Majhna</option>
</select>
</div> </div>
</div> </div>
<br> <div class="form-group"> <br> <div class="form-group">
@ -155,4 +204,5 @@ function ajax_update_words()
}); });
} }
</script> </script>

View File

@ -78,7 +78,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group"> <div class="form-group">
<label for="subjects" class="col-sm-2 control-label">Tema</label> <label for="subjects" class="col-sm-2 control-label">Tema</label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" style="width:300px;" id="subjects" name="subjects" onchange="ajax_update_words();"> <select class="form-control" style="width:315px;" id="subjects" name="subjects" onchange="ajax_update_words();">
<? <?
foreach($subjects as $id=>$subject) foreach($subjects as $id=>$subject)
{ {
@ -91,7 +91,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group"> <div class="form-group">
<label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label> <label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" style="width:300px;" name="words" id="words"> <select class="form-control" style="width:315px;" name="words" id="words">
<? <?
foreach($words as $id=>$word) foreach($words as $id=>$word)
{ {
@ -104,30 +104,76 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group"> <div class="form-group">
<label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label> <label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:300px;"> <input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:315px;">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="icon" class="col-sm-2 control-label">Simbol leksema<span class="text-danger">*</span></label> <label for="star" class="col-sm-2 control-label">Leksem ima simbol * (zvezdica)</label>
<div class="col-sm-2">
<label class="switch">
<input type="checkbox" <? if($lexem['star'] === '1' || $lexem['star'] === 1) echo 'checked'?> id="star" name="star">
<span class="slider round"></span>
</label>
</div>
</div>
<div id="div1" class="form-group form-inline">
<label for="icon1" class="col-sm-2 control-label">Prvi simbol leksema<span class="text-danger">*</span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon']?>" id="icon" name="icon" style="width:100px;"> <input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon1']?>" id="icon1" name="icon1" style="margin-right: 10px; width:100px;">
<label for="icon_color1" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color1" id="icon_color1" value="<?=$lexem['icon_color1']?>" type="color"/>
<label for="icon_size1" control-label">Velikost</label>
<select class="dropdown" name="icon_size1" id="icon_size1" title="Izberite velikost">
<option selected id="normal1" value="normal">Normalna</option>
<option <? if($lexem['icon_size1'] === 'small') echo 'selected' ?> id="small1" value="small">Majhna</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div id="div2" class="form-group form-inline">
<label for="title" class="col-sm-2 control-label">Barva simbola leksema</label> <label for="icon2" class="col-sm-2 control-label">Drugi simbol leksema</label>
<div class="col-sm-10" style="padding-top:5px;"> <div class="col-sm-10">
<input name="icon_color" id="icon_color" value="<?=$lexem['icon_color']?>" type="color"/> <input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon2']?>" id="icon2" name="icon2" style="margin-right: 10px; width:100px;">
<label for="icon_color2" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color2" id="icon_color2" value="<?=$lexem['icon_color2']?>" type="color"/>
<label for="icon_size2" control-label">Velikost</label>
<select class="dropdown" name="icon_size2" id="icon_size2" title="Izberite velikost">
<option selected id="normal2" value="normal">Normalna</option>
<option <? if($lexem['icon_size2'] === 'small') echo 'selected' ?> id="small2" value="small">Majhna</option>
</select>
</div> </div>
</div> </div>
<br> <div id="div3" class="form-group form-inline">
<div class="form-group"> <label for="icon3" class="col-sm-2 control-label">Tretji simbol leksema</label>
<div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon3']?>" id="icon3" name="icon3" style="margin-right: 10px; width:100px;">
<label for="title" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color3" id="icon_color3" value="<?=$lexem['icon_color3']?>" type="color"/>
<label for="title" control-label">Velikost</label>
<select class="dropdown" name="icon_size3" id="icon_size3" title="Izberite velikost">
<option selected id="normal3" value="normal">Normalna</option>
<option <? if($lexem['icon_size3'] === 'small') echo 'selected' ?> id="small3" value="small">Majhna</option>
</select>
</div>
</div>
<div id="div4" class="form-group form-inline ">
<label for="icon4" class="col-sm-2 control-label">Četrti simbol leksema</label>
<div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon4']?>" id="icon4" name="icon4" style="margin-right: 10px; width:100px;">
<label for="title" control-label">Barva</label>
<input style="margin-right: 10px;" name="icon_color4" id="icon_color4" value="<?=$lexem['icon_color4']?>" type="color"/>
<label for="title" control-label">Velikost</label>
<select class="dropdown" name="icon_size4" id="icon_size4" title="Izberite velikost">
<option selected id="normal4" value="normal">Normalna</option>
<option <? if($lexem['icon_size4'] === 'small') echo 'selected' ?> id="small4" value="small">Majhna</option>
</select>
</div>
</div>
<br> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success button-medium">Shrani</button> <button type="submit" class="btn btn-success button-medium">Shrani</button>
<button type="submit" class="btn btn-default button-medium" name=save_close>Shrani in zapri</button> <button type="submit" class="btn btn-default button-medium" name=save_close>Shrani in zapri</button>
</div> </div>
</div> </div>
</form> </form>
<br> <br>
</div> </div>

View File

@ -37,10 +37,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?> ?>
<tr id="row-<?=$lexem['id']?>" onclick="window.document.location='<?=$this->url?>edit_lexem/<?=$lexem['id']?>'"> <tr id="row-<?=$lexem['id']?>" onclick="window.document.location='<?=$this->url?>edit_lexem/<?=$lexem['id']?>'">
<td><?=$i+1?>.</td> <td><?=$i+1?>.</td>
<td><?=$lexem['title']?></td> <td><?=$lexem['star'] === '1' ? $lexem['title'] . '*' : $lexem['title']?></td>
<td><?=$lexem['word_title']?> (<?=$lexem['subject_title']?>)</td> <td><?=$lexem['word_title']?> (<?=$lexem['subject_title']?>)</td>
<td class="SIMBola text-center"><span style="color:<?=$lexem['icon_color']?>"><?=$lexem['icon']?></span></td> <td class="SIMBola text-center"><span style="color:<?=$lexem['icon_color1']?>; font-size: <?= $lexem['icon_size1'] && $lexem['icon_size1'] === 'normal' ? '17px' : '13px'?>"><?=$lexem['icon1']?></span><span style="color:<?=$lexem['icon_color2']?>; font-size: <?= $lexem['icon_size2'] && $lexem['icon_size2'] === 'normal' ? '17px' : '13px'?>"><?=$lexem['icon2'] && $lexem['icon2']!== 0 ? $lexem['icon2'] : ''?></span><span style="color:<?=$lexem['icon_color3']?>; font-size: <?= $lexem['icon_size3'] && $lexem['icon_size3'] === 'normal' ? '17px' : '13px'?>"><?=$lexem['icon3'] && $lexem['icon3']!== 0 ? $lexem['icon3'] : ''?></span><span style="color:<?=$lexem['icon_color4']?>; font-size: <?= $lexem['icon_size4'] && $lexem['icon_size4'] === 'normal' ? '17px' : '13px'?>"><?=$lexem['icon4'] && $lexem['icon4']!== 0 ? $lexem['icon4'] : ''?></span></td>
<td class="text-center"><span class="glyphicon glyphicon-remove text-danger" onclick="if(confirm('Izbriši leksem?')){ajax_lexem_delete(<?=$lexem['id']?>)};event.stopPropagation();"></span></td> <td class="text-center"><span class="glyphicon glyphicon-hover glyphicon-remove text-danger" onclick="if(confirm('Izbriši leksem <?php echo $lexem['title'] ?>?')){ajax_lexem_delete(<?=$lexem['id']?>)};event.stopPropagation();"></span></td>
</tr> </tr>
<? <?
} }

View File

@ -69,9 +69,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<table class="table table-hover table-striped" id="search_locations-table"> <table class="table table-hover table-striped" id="search_locations-table">
<thead> <thead>
<tr id="locations_header"> <tr id="locations_header">
<th width="10%">Št.</th> <th width="7%">Št.</th>
<th width="24%">Kraj</th> <th width="18%">Kraj</th>
<th width="10%">Kratica</th> <th width="10%">Kratica</th>
<th width="9%">Tema</th>
<th width="23%" class="text-center">Zemljepisna širina (lat)</th> <th width="23%" class="text-center">Zemljepisna širina (lat)</th>
<th width="23%" class="text-center">Zemljepisna dolžina (long)</th> <th width="23%" class="text-center">Zemljepisna dolžina (long)</th>
<th class="text-center">Odstrani</th> <th class="text-center">Odstrani</th>
@ -86,9 +87,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<td><?=$i+1?>.</td> <td><?=$i+1?>.</td>
<td><?=$location['name']?></td> <td><?=$location['name']?></td>
<td><?=$location['short_name']?></td> <td><?=$location['short_name']?></td>
<td><?=$location['title']?></td>
<td class="text-center"><?=number_format($location['lat'],2)?></td> <td class="text-center"><?=number_format($location['lat'],2)?></td>
<td class="text-center"><?=number_format($location['long'],2)?></td> <td class="text-center"><?=number_format($location['long'],2)?></td>
<td class="text-center"><span class="glyphicon glyphicon-remove text-danger" onclick="if(confirm('Izbriši lokacijo?')){ajax_location_delete(<?=$location['id']?>)};event.stopPropagation();"></span></td> <td class="text-center"><span class="glyphicon glyphicon-hover glyphicon-remove text-danger" onclick="if(confirm('Izbriši lokacijo <?php echo $location['name'] ?>?')){ajax_location_delete(<?=$location['id']?>)};event.stopPropagation();"></span></td>
</tr> </tr>
<? <?
} }
@ -202,7 +204,7 @@ function search_locations()
search = search.slice(0, -1); search = search.slice(0, -1);
console.log(search); //console.log(search);
var items=$('#search_locations-table tr:'+search); var items=$('#search_locations-table tr:'+search);

View File

@ -39,7 +39,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?> ?>
<tr id="row-<?=$transcription['id']?>"onclick="window.document.location='<?=$this->url?>edit_transcription/<?=$transcription['id']?>'"> <tr id="row-<?=$transcription['id']?>"onclick="window.document.location='<?=$this->url?>edit_transcription/<?=$transcription['id']?>'">
<td><?=$i+1?>.</td> <td><?=$i+1?>.</td>
<td><?=$transcription['lexem_title']?></td> <td><?=$transcription['lexem_star'] === '1' ? $transcription['lexem_title'] . '*' : $transcription['lexem_title']?></td>
<td class="ZRCola"><?=$transcription['phonetic_writing']?></td> <td class="ZRCola"><?=$transcription['phonetic_writing']?></td>
<td class="text-center"> <td class="text-center">
<? <?
@ -84,7 +84,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
} }
?> ?>
</td> </td>
<td class="text-center"><span class="glyphicon glyphicon-remove text-danger" onclick="if(confirm('Izbriši transkripcijo?')){ajax_transcription_delete(<?=$transcription['id']?>)};event.stopPropagation();"></span></td> <td class="text-center"><span class="glyphicon glyphicon-hover glyphicon-remove text-danger" onclick="if(confirm('Izbriši transkripcijo <?php echo $transcription['lexem_title'] ?>?')){ajax_transcription_delete(<?=$transcription['id']?>)};event.stopPropagation();"></span></td>
</tr> </tr>
<? <?
} }

View File

@ -39,22 +39,8 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="col-sm-10"><h4 class="text-muted">Uporabniki</h4></div> <div class="col-sm-10"><h4 class="text-muted">Uporabniki</h4></div>
<div class="col-sm-2 text-right"><a class="btn btn-success" href="<?=$this->url?>add_user" title="Dodaj uporabnika">Dodaj</a></div> <div class="col-sm-2 text-right"><a class="btn btn-success" href="<?=$this->url?>add_user" title="Dodaj uporabnika">Dodaj</a></div>
</div> </div>
<?
if(isset($status) and $status=='ok')
{
?>
<div class="alert alert-success fade in" id="alert_ok" role="alert">
<button type="button" class="close">
<span aria-hidden="true">&times;</span>
</button>
<span class="glyphicon glyphicon-ok text-success"></span> Uporabnik uspešno izbrisan!
</div>
<?
}
?>
<br/> <br/>
<div class="list"> <div class="list">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
@ -64,6 +50,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<th>Uporabniško ime</th> <th>Uporabniško ime</th>
<th>Ime</th> <th>Ime</th>
<th>Priimek</th> <th>Priimek</th>
<th>Odstrani</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -72,11 +59,16 @@ Slovenski narečni atlas / Slovenian dialectal atlas
foreach($users as $i=>$user) foreach($users as $i=>$user)
{ {
?> ?>
<tr onclick="window.document.location='<?=$this->url?>edit_user/<?=$user['id']?>'"> <tr id="row-<?=$user['id']?>" onclick="window.document.location='<?=$this->url?>edit_user/<?=$user['id']?>'">
<td><?=$i+1?>.</td> <td><?=$i+1?>.</td>
<td><?=$user['username']?></td> <td><?=$user['username']?></td>
<td><?=$user['name']?$user['name']:'-'?></td> <td><?=$user['name']?$user['name']:'-'?></td>
<td><?=$user['lastname']?$user['lastname']:'-'?></td> <td><?=$user['lastname']?$user['lastname']:'-'?></td>
<?php if($_SESSION['username'] !== $user['username']): ?>
<td><span class="glyphicon glyphicon-remove glyphicon-hover text-danger" onclick="if(confirm('Izbriši uporabnika <?php echo $user['username'] ?>?')){user_delete(<?=$user['id']?>)};event.stopPropagation();"></span></td>
<?php else: ?>
<td style="color: #818181">Prijavljen uporabnik</td>
<?php endif; ?>
</tr> </tr>
<? <?
} }
@ -94,4 +86,36 @@ $('.close').click(function() {
$('#alert_ok').fadeOut(500); $('#alert_ok').fadeOut(500);
}); });
function user_delete(id_user)
{
$.ajax({
type: "POST",
url: "<?=$this->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!');
}
});
}
</script> </script>

View File

@ -20,16 +20,16 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?> ?>
<div class="container container-first-page"> <!--class="container"--> <div class="container container-first-page col-md-12"> <!--class="container"-->
<div class="row row-borders"> <div class="row row-borders">
<div class="col-md-8"> <div>
<div class="map-view-margin"> <div class="map-view-margin">
<h3 >Slovenski narečni atlas</h3> <h3 >Slovenski narečni atlas</h3>
</div> </div>
<div class="form"> <div class="form col-md-6">
<div class="form-group"> <div class="form-group">
<label for="subjects" class="control-label col-sm-1">Tema</label> <label for="subjects" class="control-label col-sm-1">Tema</label>
<div class="col-sm-11"> <div class="col-sm-8">
<select class="form-control map-view-margin input-sm selects" id="subjects" onchange="ajax_change_subject();"> <select class="form-control map-view-margin input-sm selects" id="subjects" onchange="ajax_change_subject();">
<? <?
foreach($subjects as $id=>$subject) foreach($subjects as $id=>$subject)
@ -44,7 +44,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<br/> <br/>
<div class="form-group"> <div class="form-group">
<label for="words" class="ccontrol-label col-sm-1">Beseda</label> <label for="words" class="ccontrol-label col-sm-1">Beseda</label>
<div class="col-sm-11"> <div class="col-sm-8">
<select class="form-control map-view-margin input-sm selects" id="words" onchange="ajax_add_locations();"> <select class="form-control map-view-margin input-sm selects" id="words" onchange="ajax_add_locations();">
<? <?
foreach($words as $id=>$word) foreach($words as $id=>$word)
@ -58,9 +58,9 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row col-md-12">
<!-- info panel --> <!-- info panel -->
<div class="col-sm-3 info-panel"> <div class="col-md-2 info-panel">
<!-- title --> <!-- title -->
<div id="map_title_div" class="hidden info-panel-title"> <div id="map_title_div" class="hidden info-panel-title">
<strong>Izbrana beseda: </strong> <strong>Izbrana beseda: </strong>
@ -69,10 +69,9 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</div> </div>
<!-- image --> <!-- image -->
<div id="image" class="hidden info-panel-image"> <div id="image" class="hidden info-panel-image img-responsive">
<strong><span class="">Slika: </span></strong><br> <strong><span class="">Slika: </span></strong><br>
<img id="word_image" class="info-panel-image-borders" src="" style="width:250px;height:250px;"/> <img id="word_image" class="info-panel-image-borders img-responsive" src=""/> <br/>
<br/>
</div> </div>
<br/> <br/>
@ -80,13 +79,13 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<!-- comment button --> <!-- comment button -->
<div id="button_comment" class="hidden info-panel-comment"> <div id="button_comment" class="hidden info-panel-comment">
<strong><span>Komentar: </span></strong><br> <strong><span>Komentar: </span></strong><br>
<button type="button" class="btn btn-md info-panel-btn" data-toggle="modal" data-target="#modal_comment"> <button type="button" class="btn btn-block btn-sm info-panel-btn" data-toggle="modal" data-target="#modal_comment">
Odpri komentar h karti <span class="glyphicon glyphicon-book"></span> Odpri komentar h karti <span class="glyphicon glyphicon-book"></span>
</button> </button>
</div> </div>
</div> </div>
<!-- actual map --> <!-- actual map -->
<div class="col-sm-9"> <div style="margin-bottom: 40px; margin-top: 15px" class="col-md-7">
<div class="text-right"> <div class="text-right">
<? <?
//load svg map //load svg map
@ -94,6 +93,12 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?> ?>
</div> </div>
</div> </div>
<!-- map legend -->
<div class="col-md-3" id="legend" style="max-width: 270px; margin-top: 15px; margin-left: auto; margin-right: auto">
<?
$this->load->view('home/legend_view.php');
?>
</div>
</div> </div>
<div id="comment"> <div id="comment">
@ -122,6 +127,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?> ?>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function ajax_add_locations() function ajax_add_locations()
@ -133,6 +139,8 @@ Slovenski narečni atlas / Slovenian dialectal atlas
var id_word=$("#words option:selected").val(); var id_word=$("#words option:selected").val();
console.log(id_word);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "<?=$this->url?>ajax_add_locations", url: "<?=$this->url?>ajax_add_locations",
@ -143,8 +151,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas
}, },
dataType: "json", dataType: "json",
success: function(data){ success: function(data){
console.log(data);
if(data.status=='ok') if(data.status=='ok')
{ {
console.log(data);
//update modals //update modals
$('#modals').html(data.view_modals); $('#modals').html(data.view_modals);
@ -224,22 +234,61 @@ Slovenski narečni atlas / Slovenian dialectal atlas
svg.append('defs').append("g").attr("id","pin"+i).append("image").attr("xlink:href",transcription.pin).attr("height","25px").attr("width","25px") svg.append('defs').append("g").attr("id","pin"+i).append("image").attr("xlink:href",transcription.pin).attr("height","25px").attr("width","25px")
*/ */
var g = defs.append("g").attr("id","pin"+i); var g = defs.append("g").attr("id","pin"+i);
var counter = 1;
if(transcription.id) if(transcription.id)
{ {
g.append("text").attr('id','text-'+transcription.pin).attr("x","-5px").attr("y","6px").attr("font-size","18pt").attr('class','SIMBola').style("fill", transcription.icon_color).text(transcription.pin); g.append("text").attr('id','text-'+transcription.pin1).attr("x","0px").attr("y","6px").attr("font-size",transcription.icon_size1 + 'px').attr('class','SIMBola').style("fill", transcription.icon_color1).text(transcription.pin1);
if(transcription.pin2){
counter++;
let dx2 = Number(transcription.icon_size1);
g.append("text").attr('id','text-'+transcription.pin2).attr("x",'+'+dx2+'px').attr("y","6px").attr("font-size",transcription.icon_size2 + 'px').attr('class','SIMBola').style("fill", transcription.icon_color2).text(transcription.pin2);
}
if(transcription.pin3){
counter++;
let dx3 = Number(transcription.icon_size1) + Number(transcription.icon_size2);
g.append("text").attr('id','text-'+transcription.pin3).attr("x",'+'+dx3+'px').attr("y","6px").attr("font-size",transcription.icon_size3 + 'px').attr('class','SIMBola').style("fill", transcription.icon_color3).text(transcription.pin3);
}
if(transcription.pin4){
counter++;
let dx4 = Number(transcription.icon_size1) + Number(transcription.icon_size2) + Number(transcription.icon_size3);
g.append("text").attr('id','text-'+transcription.pin4).attr("x",'+'+dx4+'px').attr("y","6px").attr("font-size",transcription.icon_size4 + 'px').attr('class','SIMBola').style("fill", transcription.icon_color4).text(transcription.pin4);
}
} }
else else
{ {
g.append("text").attr('id','text-'+transcription.pin).attr("x","-5px").attr("y","6px").attr("font-size","18pt").text("/"); g.append("text").attr('id','text-'+transcription.pin1).attr("x","-5px").attr("y","6px").attr("font-size","18pt").text("/");
} }
let element;
let dx;
if(counter === 1){
dx = Number(transcription.icon_size1);
}
if(counter === 2){
dx = Number(transcription.icon_size1) + Number(transcription.icon_size2);
}
if(counter === 3){
dx = Number(transcription.icon_size1) + Number(transcription.icon_size2) + Number(transcription.icon_size3);
}
if(counter === 4){
dx = Number(transcription.icon_size1) + Number(transcription.icon_size2) + Number(transcription.icon_size3) + Number(transcription.icon_size4);
}
var element = d3.select('#text-'+transcription.pin).node(); let name;
var width = element.getBoundingClientRect().width; console.log('star: ', transcription.star);
if(transcription.star === '1'){
name = transcription.short_name + '*';
}
else{
name = transcription.short_name;
}
g.append("text").attr("x",dx+"px").attr("y","4px").attr("font-size","12pt").text(name);
g.append("text").attr("x",width+3+"px").attr("y","4px").attr("font-size","12pt").text(transcription.short_name);
// Create an SVG <use> element // Create an SVG <use> element
var use = document.createElementNS(svgNS, "use"); var use = document.createElementNS(svgNS, "use");
@ -263,7 +312,8 @@ Slovenski narečni atlas / Slovenian dialectal atlas
}); });
} }
}, },
error: function(){ error: function(e){
console.log(e);
alert('Prišlo je do napake pri nalaganju podatkov. Prosimo poskusite ponovno!'); alert('Prišlo je do napake pri nalaganju podatkov. Prosimo poskusite ponovno!');
} }
}); });

View File

@ -45,7 +45,7 @@ if(isset($legend) and $legend)
?> ?>
<tr> <tr>
<td class="text-center"><input style="width:10px;height:10px;" type="checkbox" checked="1" id="icons-<?=$row['code_title']?>" class="toggle_icons"/></td> <td class="text-center"><input style="width:10px;height:10px;" type="checkbox" checked="1" id="icons-<?=$row['code_title']?>" class="toggle_icons"/></td>
<td class="text-center SIMBola" style="color:<?=$row['icon_color']?>;"><?=$row['icon']?></td> <td class="text-center SIMBola"><span style="color:<?=$row['icon_color1']?>; font-size: <?= $row['icon_size1'] && $row['icon_size1'] === 'normal' ? '17px' : '13px'?>"><?=$row['icon1']?></span><span style="color:<?=$row['icon_color2']?>; font-size: <?= $row['icon_size2'] && $row['icon_size2'] === 'normal' ? '17px' : '13px'?>"><?=$row['icon2'] && $row['icon2']!== 0 ? $row['icon2'] : ''?></span><span style="color:<?=$row['icon_color3']?>; font-size: <?= $row['icon_size3'] && $row['icon_size3'] === 'normal' ? '17px' : '13px'?>"><?=$row['icon3'] && $row['icon3']!== 0 ? $row['icon3'] : ''?></span><span style="color:<?=$row['icon_color4']?>; font-size: <?= $row['icon_size4'] && $row['icon_size4'] === 'normal' ? '17px' : '13px'?>"><?=$row['icon4'] && $row['icon4']!== 0 ? $row['icon4'] : ''?></span></td>
<td class="text-center"> <td class="text-center">
<? <?
if($title=='no_title') if($title=='no_title')

View File

@ -120,6 +120,10 @@ span.glyphicon {
width:100px; width:100px;
} }
.glyphicon-hover:hover{
color: #ff0003;
}
.img-wrap .close { .img-wrap .close {
position: absolute; position: absolute;
top: 4px; top: 4px;
@ -156,11 +160,6 @@ span.glyphicon {
border-color:#d3d3d3; border-color:#d3d3d3;
} }
.selects {
width:400px !important;
}
/*tables*/ /*tables*/
.table-striped { .table-striped {
@ -307,9 +306,10 @@ span.glyphicon {
} }
.legend { .legend {
max-height: 270px; max-height: 260px;
overflow-y: auto; overflow-y: auto;
overflow-x: auto; overflow-x: auto;
margin-bottom: 20px;
} }
@ -372,6 +372,77 @@ span.glyphicon {
width:120px; width:120px;
} }
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
/* Hide default HTML checkbox */
.switch input {display:none;}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #207acd;
}
input:checked + .slider.round {
background-color: #207acd;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:focus + .slider.round {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
input:checked + .slider.round:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
/*eof inputs, forms, buttons*/ /*eof inputs, forms, buttons*/