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

master
Nermin 6 years ago
parent ff33d1503f
commit b199e0534e

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

@ -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' => '',

@ -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);

@ -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);

@ -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);

@ -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;

@ -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">
</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">
<label for="short_name" class="col-sm-2 control-label">Zemljepisna širina (lat)<span class="text-danger">*</span></label>
<div class="col-sm-10">
@ -124,21 +137,6 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</select>
</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>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
@ -222,4 +220,6 @@ function ajax_update_subsubdialects()
}
</script>

@ -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">
</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">
<label for="short_name" class="col-sm-2 control-label">Zemljepisna širina (lat)<span class="text-danger">*</span></label>
<div class="col-sm-10">
@ -138,22 +151,6 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</select>
</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>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">

@ -148,7 +148,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
}
?>
</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>
<?
}

@ -43,7 +43,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
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);
});
$('.confirm').click(function() {
return window.confirm("Izbriši uporabnika?");
});
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
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>

@ -64,7 +64,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group">
<label for="subjects" class="col-sm-2 control-label">Tema</label>
<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)
{
@ -77,7 +77,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group">
<label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label>
<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)
{
@ -90,21 +90,70 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:300px;">
</div>
</div>
<div class="form-group">
<label for="icon" class="col-sm-2 control-label">Simbol leksema<span class="text-danger">*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon']?>" id="icon" name="icon" style="width:100px;">
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Barva simbola leksema</label>
<div class="col-sm-10" style="padding-top:5px;">
<input name="icon_color" id="icon_color" value="<?=$lexem['icon_color']?>" type="color"/>
<input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:315px;">
</div>
</div>
<div class="form-group">
<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">
<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 id="div2" class="form-group form-inline">
<label for="icon2" class="col-sm-2 control-label">Drugi simbol leksema</label>
<div class="col-sm-10">
<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>
<br> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success button-medium">Shrani</button>
@ -155,4 +204,5 @@ function ajax_update_words()
});
}
</script>

@ -76,59 +76,105 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<form class="form-horizontal form-border" action="<?=$this->url?>post_edit_lexem" method="POST" id="edit_lexem">
<input type="hidden" id="id" name="id" value="<?=$lexem['id']?>">
<div class="form-group">
<label for="subjects" class="col-sm-2 control-label">Tema</label>
<div class="col-sm-10">
<select class="form-control" style="width:300px;" id="subjects" name="subjects" onchange="ajax_update_words();">
<?
foreach($subjects as $id=>$subject)
{
?><option value="<?=$id?>" <?=$id==$lexem['id_subject']?'selected="selected"':''?> ><?=$subject?></option><?
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label>
<div class="col-sm-10">
<select class="form-control" style="width:300px;" name="words" id="words">
<?
foreach($words as $id=>$word)
{
?><option value="<?=$id?>" <?=$id==$lexem['id_word']?'selected="selected"':''?>><?=$word?></option><?
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:300px;">
</div>
</div>
<div class="form-group">
<label for="icon" class="col-sm-2 control-label">Simbol leksema<span class="text-danger">*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control input-md SIMBola" value="<?=$lexem['icon']?>" id="icon" name="icon" style="width:100px;">
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Barva simbola leksema</label>
<div class="col-sm-10" style="padding-top:5px;">
<input name="icon_color" id="icon_color" value="<?=$lexem['icon_color']?>" type="color"/>
</div>
</div>
<br>
<div class="form-group">
<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-default button-medium" name=save_close>Shrani in zapri</button>
</div>
<label for="subjects" class="col-sm-2 control-label">Tema</label>
<div class="col-sm-10">
<select class="form-control" style="width:315px;" id="subjects" name="subjects" onchange="ajax_update_words();">
<?
foreach($subjects as $id=>$subject)
{
?><option value="<?=$id?>" <?=$id==$lexem['id_subject']?'selected="selected"':''?>><?=$subject?></option><?
}
?>
</select>
</div>
</div>
</form>
<div class="form-group">
<label for="words" class="col-sm-2 control-label">Beseda<span class="text-danger">*</span></label>
<div class="col-sm-10">
<select class="form-control" style="width:315px;" name="words" id="words">
<?
foreach($words as $id=>$word)
{
?><option value="<?=$id?>" <?=$id==$lexem['id_word']?'selected="selected"':''?>><?=$word?></option><?
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Leksem<span class="text-danger">*</span></label>
<div class="col-sm-10">
<input type="text" class="form-control input-md" value="<?=$lexem['title']?>" id="title" name="title" style="width:315px;">
</div>
</div>
<div class="form-group">
<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">
<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 id="div2" class="form-group form-inline">
<label for="icon2" class="col-sm-2 control-label">Drugi simbol leksema</label>
<div class="col-sm-10">
<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>
<br> <div class="form-group">
<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-default button-medium" name=save_close>Shrani in zapri</button>
</div>
</div>
</form>
<br>
</div>
</div>

@ -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']?>'">
<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 class="SIMBola text-center"><span style="color:<?=$lexem['icon_color']?>"><?=$lexem['icon']?></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="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-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>
<?
}

@ -69,9 +69,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<table class="table table-hover table-striped" id="search_locations-table">
<thead>
<tr id="locations_header">
<th width="10%">Št.</th>
<th width="24%">Kraj</th>
<th width="7%">Št.</th>
<th width="18%">Kraj</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 dolžina (long)</th>
<th class="text-center">Odstrani</th>
@ -86,9 +87,10 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<td><?=$i+1?>.</td>
<td><?=$location['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['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>
<?
}
@ -202,7 +204,7 @@ function search_locations()
search = search.slice(0, -1);
console.log(search);
//console.log(search);
var items=$('#search_locations-table tr:'+search);

@ -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']?>'">
<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="text-center">
<?
@ -84,7 +84,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
}
?>
</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>
<?
}

@ -39,21 +39,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<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>
<?
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/>
<div class="list">
@ -64,6 +50,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<th>Uporabniško ime</th>
<th>Ime</th>
<th>Priimek</th>
<th>Odstrani</th>
</tr>
</thead>
<tbody>
@ -72,11 +59,16 @@ Slovenski narečni atlas / Slovenian dialectal atlas
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><?=$user['username']?></td>
<td><?=$user['name']?$user['name']:'-'?></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>
<?
}
@ -94,4 +86,36 @@ $('.close').click(function() {
$('#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>

@ -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="col-md-8">
<div>
<div class="map-view-margin">
<h3 >Slovenski narečni atlas</h3>
</div>
<div class="form">
<div class="form col-md-6">
<div class="form-group">
<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();">
<?
foreach($subjects as $id=>$subject)
@ -44,7 +44,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<br/>
<div class="form-group">
<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();">
<?
foreach($words as $id=>$word)
@ -58,9 +58,9 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</div>
</div>
</div>
<div class="row">
<div class="row col-md-12">
<!-- info panel -->
<div class="col-sm-3 info-panel">
<div class="col-md-2 info-panel">
<!-- title -->
<div id="map_title_div" class="hidden info-panel-title">
<strong>Izbrana beseda: </strong>
@ -69,10 +69,9 @@ Slovenski narečni atlas / Slovenian dialectal atlas
</div>
<!-- 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>
<img id="word_image" class="info-panel-image-borders" src="" style="width:250px;height:250px;"/>
<br/>
<img id="word_image" class="info-panel-image-borders img-responsive" src=""/> <br/>
</div>
<br/>
@ -80,13 +79,13 @@ Slovenski narečni atlas / Slovenian dialectal atlas
<!-- comment button -->
<div id="button_comment" class="hidden info-panel-comment">
<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>
</button>
</div>
</div>
<!-- actual map -->
<div class="col-sm-9">
<div style="margin-bottom: 40px; margin-top: 15px" class="col-md-7">
<div class="text-right">
<?
//load svg map
@ -94,6 +93,12 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?>
</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 id="comment">
@ -122,6 +127,7 @@ Slovenski narečni atlas / Slovenian dialectal atlas
?>
</div>
<script type="text/javascript">
function ajax_add_locations()
@ -133,6 +139,8 @@ Slovenski narečni atlas / Slovenian dialectal atlas
var id_word=$("#words option:selected").val();
console.log(id_word);
$.ajax({
type: "POST",
url: "<?=$this->url?>ajax_add_locations",
@ -142,9 +150,11 @@ Slovenski narečni atlas / Slovenian dialectal atlas
id_subject:id_subject,
},
dataType: "json",
success: function(data){
success: function(data){
console.log(data);
if(data.status=='ok')
{
console.log(data);
//update modals
$('#modals').html(data.view_modals);
@ -223,23 +233,62 @@ Slovenski narečni atlas / Slovenian dialectal atlas
var svg = d3.select("body").select("#Layer_1");
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 counter = 1;
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
{
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("/");
}
var element = d3.select('#text-'+transcription.pin).node();
var width = element.getBoundingClientRect().width;
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);
}
let name;
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
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!');
}
});

@ -45,7 +45,7 @@ if(isset($legend) and $legend)
?>
<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 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">
<?
if($title=='no_title')

@ -120,6 +120,10 @@ span.glyphicon {
width:100px;
}
.glyphicon-hover:hover{
color: #ff0003;
}
.img-wrap .close {
position: absolute;
top: 4px;
@ -156,11 +160,6 @@ span.glyphicon {
border-color:#d3d3d3;
}
.selects {
width:400px !important;
}
/*tables*/
.table-striped {
@ -307,9 +306,10 @@ span.glyphicon {
}
.legend {
max-height: 270px;
max-height: 260px;
overflow-y: auto;
overflow-x: auto;
margin-bottom: 20px;
}
@ -372,6 +372,77 @@ span.glyphicon {
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*/

Loading…
Cancel
Save