Changeset 31
- Timestamp:
- Dec 30, 2018, 7:37:55 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Global.php
r4 r31 5 5 return(date('j.n.Y', $Time)); 6 6 } 7 8 function HumanTime($Time) 9 { 10 return(date('H:i:s', $Time)); 11 } 12 13 function HumanDateTime($Time) 14 { 15 $Output = HumanDate($Time); 16 $Time = HumanTime($Time); 17 if ($Time != '00:00:00') $Output .= ' '.$Time; 18 return($Output); 19 } 20 7 21 function Link2($URL) 8 22 { -
trunk/Import/Amblar.php
r20 r31 55 55 $Type = trim(GetTextBetween($Item, ' ', ' ')); 56 56 if ($Type == 'odpovězeno') continue; 57 $MeetItem-> Date = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>'));58 if (mb_substr($MeetItem-> Date, 0, 4) == 'před')57 $MeetItem->Time = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>')); 58 if (mb_substr($MeetItem->Time, 0, 4) == 'před') 59 59 { 60 $Parts = explode(' ', $MeetItem-> Date);61 if ($Parts[2] == 'hours') $MeetItem-> Date = strtotime("-".$Parts[1]." hours");62 else if ($Parts[2] == 'dní') $MeetItem-> Date = strtotime("-".$Parts[1]." days");63 else if ($Parts[2] == 'dny') $MeetItem-> Date = strtotime("-".$Parts[1]." days");64 } else $MeetItem-> Date = HumanDateToTime($MeetItem->Date);60 $Parts = explode(' ', $MeetItem->Time); 61 if ($Parts[2] == 'hours') $MeetItem->Time = strtotime("-".$Parts[1]." hours"); 62 else if ($Parts[2] == 'dní') $MeetItem->Time = strtotime("-".$Parts[1]." days"); 63 else if ($Parts[2] == 'dny') $MeetItem->Time = strtotime("-".$Parts[1]." days"); 64 } else $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time.' '.HumanTime(time())); 65 65 $MeetItem->Email = ''; 66 66 $MeetItem->Message = ''; -
trunk/Import/AstraPraha.php
r26 r31 23 23 $Item = GetTextBetween($Content, $ItemStart, $ItemEnd); 24 24 $MeetItem = new MeetItem(); 25 $MeetItem-> Date = trim(GetTextBetween($Item, 'Vloženo:', '</p>'));26 $MeetItem-> Date = HumanDateToTime($MeetItem->Date);25 $MeetItem->Time = trim(GetTextBetween($Item, 'Vloženo:', '</p>')); 26 $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time.' '.HumanTime(time())); 27 27 28 28 $MeetItem->Gender = trim(GetTextBetween($Item, '<h3 class=\'dating-heading\'>', '</h3>')); -
trunk/Import/Csts.php
r26 r31 29 29 else $MeetItem->Gender = Gender::Undefined; 30 30 $MeetItem->Name = trim(html_entity_decode(GetTextBetween($Item, 'Vložil/a', ','))); 31 $MeetItem-> Date = trim(GetTextBetween($Item, ' ', '</th>'));32 $MeetItem-> Date = HumanDateTimeToTime($MeetItem->Date);31 $MeetItem->Time = trim(GetTextBetween($Item, ' ', '</th>')); 32 $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time); 33 33 $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm')); 34 34 $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, '<td colspan="3">', '</td>')))); -
trunk/Import/Eso.php
r23 r31 35 35 $Small = substr($Small, strpos($Small, '/') + 1); 36 36 } 37 $MeetItem-> Date = trim($Small);38 $MeetItem-> Date = HumanDateTimeToTime($MeetItem->Date);37 $MeetItem->Time = trim($Small); 38 $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time.' '.HumanTime(time())); 39 39 $MeetItem->Message = trim(GetTextBetween($Item, '<p class="lead">', '</p>')); 40 40 $MeetItem->Age = GetAgeFromText($MeetItem->Message); -
trunk/Import/Facebook.php
r23 r31 32 32 else $MeetItem->Gender = Gender::Undefined; 33 33 $MeetItem->Name = trim(html_entity_decode(GetTextBetween($Item, '<span class="_39_n">', '</span>'))); 34 $MeetItem-> Date = trim(GetTextBetween($Item, ' ', '</th>'));35 $MeetItem-> Date = HumanDateTimeToTime($MeetItem->Date);34 $MeetItem->Time = trim(GetTextBetween($Item, ' ', '</th>')); 35 $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time); 36 36 $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm')); 37 37 $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, 'data-ft="{"tn":"K"}">', '</div>')))); -
trunk/Import/MajkluvSvet.php
r14 r31 42 42 $MeetItem->Email = trim(substr($MeetItem->Email, strpos($MeetItem->Email, '|') + 1)); 43 43 } else $MeetItem->Phone = ''; 44 $MeetItem-> Date = trim(GetTextBetween($Item, "<span id='datum1", '</span>'));45 $MeetItem-> Date = substr($MeetItem->Date, strpos($MeetItem->Date, '>') + 1);46 $MeetItem-> Date = HumanDateTimeToTime($MeetItem->Date);44 $MeetItem->Time = trim(GetTextBetween($Item, "<span id='datum1", '</span>')); 45 $MeetItem->Time = substr($MeetItem->Time, strpos($MeetItem->Time, '>') + 1); 46 $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time); 47 47 $MeetItem->Link = 'http://www.majkluvsvet.cz'.trim(GetTextBetween($Item, "<span class='linkk pravo'><a href='", "'>odkaz")); 48 48 $MeetItem->Database = $this->Database; -
trunk/Import/SalsaDance.php
r11 r31 22 22 $Item = GetTextBetween($Content, $ItemStart, $ItemEnd); 23 23 $MeetItem = new MeetItem(); 24 $MeetItem-> Date = trim(GetTextBetween($Item, '<span class="created">', '</span>'));25 $MeetItem-> Date = str_replace('. ', '.', $MeetItem->Date);26 if (strpos($MeetItem-> Date, 'dnes v') !== false)27 $MeetItem-> Date = str_replace('dnes v', HumanDate(time()), $MeetItem->Date);28 if (strpos($MeetItem-> Date, 'včera v') !== false)29 $MeetItem-> Date = str_replace('včera v', HumanDate(strtotime('-1 day', time())), $MeetItem->Date);30 $MeetItem-> Date = HumanDateTimeToTime($MeetItem->Date);24 $MeetItem->Time = trim(GetTextBetween($Item, '<span class="created">', '</span>')); 25 $MeetItem->Time = str_replace('. ', '.', $MeetItem->Time); 26 if (strpos($MeetItem->Time, 'dnes v') !== false) 27 $MeetItem->Time = str_replace('dnes v', HumanDate(time()), $MeetItem->Time); 28 if (strpos($MeetItem->Time, 'včera v') !== false) 29 $MeetItem->Time = str_replace('včera v', HumanDate(strtotime('-1 day', time())), $MeetItem->Time); 30 $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time); 31 31 $MeetItem->Name = trim(GetTextBetween($Item, '<div class="comment-name">', '</div>')); 32 32 $MeetItem->Message = trim(GetTextBetween($Item, '<p>', '</p>')); -
trunk/Import/Seznamka.php
r30 r31 40 40 $MeetItem->Age = trim(str_replace('let', '', $MeetItem->Age)); 41 41 $MeetItem->Location = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>')); 42 $MeetItem-> Date = HumanDateToTime(trim(GetTextBetween($Item, '> </a>', '</span>')));42 $MeetItem->Time = HumanDateTimeToTime(trim(GetTextBetween($Item, '> </a>', '</span>')).' '.HumanTime(time())); 43 43 $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, 'margin-top:10px;\'>', '</div>'))); 44 44 $MeetItem->Link = GetTextBetween($Item, "<a href='", "'"); -
trunk/Import/TanecniSkola.php
r16 r31 47 47 { 48 48 $MeetItem = new MeetItem(); 49 $MeetItem-> Date = HumanDateToTime(trim(GetTextBetween($Item, '<h3>', '</h3>')));50 if ($MeetItem-> Date != null)49 $MeetItem->Time = HumanDateTimeToTime(trim(GetTextBetween($Item, '<h3>', '</h3>')).' '.HumanTime(time())); 50 if ($MeetItem->Time != null) 51 51 { 52 $PreviousTime = $MeetItem-> Date;53 } else $MeetItem-> Date = $PreviousTime;52 $PreviousTime = $MeetItem->Time; 53 } else $MeetItem->Time = $PreviousTime; 54 54 55 55 $Part = GetTextBetween($Item, '</strong>', '<strong>'); -
trunk/Import/Vavruska.php
r11 r31 25 25 $MeetItem = new MeetItem(); 26 26 27 $MeetItem-> Date = MysqlDateTimeToTime(trim(GetTextBetween($Item, 'přidáno:', '</i>')));27 $MeetItem->Time = MysqlDateTimeToTime(trim(GetTextBetween($Item, 'přidáno:', '</i>'))); 28 28 $MeetItem->Gender = trim(GetTextBetween($Item, '<img src=/design/', 'alt="avatar"')); 29 29 if ($MeetItem->Gender == 'avatar_m_03.png') $MeetItem->Gender = Gender::Male; -
trunk/Meet.php
r26 r31 328 328 var $Name = ''; 329 329 var $Message = ''; 330 var $ Date = '';330 var $Time = ''; 331 331 var $Gender = Gender::Undefined; 332 332 var $Phone = ''; … … 347 347 '(`Message` = "'.$this->Database->real_escape_string($this->Message).'") AND '. 348 348 '(`Email` = "'.$this->Database->real_escape_string($this->Email).'") AND '. 349 '(` Date` = "'.$this->Database->real_escape_string(TimeToMysqlDate($this->Date)).'")');349 '(`Time` = "'.$this->Database->real_escape_string(TimeToMysqlDateTime($this->Time)).'")'); 350 350 if ($DbResult->num_rows == 0) 351 351 { … … 358 358 $this->Database->insert('MeetItem', array( 359 359 'Message' => $this->Message, 360 ' Date' => TimeToMysqlDate($this->Date),360 'Time' => TimeToMysqlDateTime($this->Time), 361 361 'Gender' => $this->Gender, 362 362 'Age' => $Age, -
trunk/SQL/Structure.sql
r10 r31 1 -- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64) 2 -- 3 -- Host: localhost Database: tanec 4 -- ------------------------------------------------------ 5 -- Server version 5.7.22-0ubuntu18.04.1 6 7 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 /*!40101 SET NAMES utf8 */; 11 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 /*!40103 SET TIME_ZONE='+00:00' */; 13 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 18 -- 19 -- Table structure for table `Dance` 20 -- 21 22 DROP TABLE IF EXISTS `Dance`; 23 /*!40101 SET @saved_cs_client = @@character_set_client */; 24 /*!40101 SET character_set_client = utf8 */; 1 -- phpMyAdmin SQL Dump 2 -- version 4.6.6deb5 3 -- https://www.phpmyadmin.net/ 4 -- 5 -- Počítač: localhost:3306 6 -- Vytvořeno: Ned 30. pro 2018, 19:07 7 -- Verze serveru: 10.1.34-MariaDB-0ubuntu0.18.04.1 8 -- Verze PHP: 7.2.10-0ubuntu0.18.04.1 9 10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 SET time_zone = "+00:00"; 12 13 -- 14 -- Databáze: `tanec` 15 -- 16 17 -- -------------------------------------------------------- 18 19 -- 20 -- Struktura tabulky `Dance` 21 -- 22 25 23 CREATE TABLE `Dance` ( 26 `Id` int(11) NOT NULL AUTO_INCREMENT, 27 `Name` varchar(255) NOT NULL, 28 `Group` int(11) DEFAULT NULL, 29 PRIMARY KEY (`Id`), 30 KEY `Group` (`Group`), 31 CONSTRAINT `Dance_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `DanceGroup` (`Id`) 32 ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; 33 /*!40101 SET character_set_client = @saved_cs_client */; 34 35 -- 36 -- Table structure for table `DanceGroup` 37 -- 38 39 DROP TABLE IF EXISTS `DanceGroup`; 40 /*!40101 SET @saved_cs_client = @@character_set_client */; 41 /*!40101 SET character_set_client = utf8 */; 24 `Id` int(11) NOT NULL, 25 `Name` varchar(255) NOT NULL, 26 `Group` int(11) DEFAULT NULL 27 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 28 29 -- 30 -- RELACE PRO TABULKU `Dance`: 31 -- `Group` 32 -- `DanceGroup` -> `Id` 33 -- 34 35 -- -------------------------------------------------------- 36 37 -- 38 -- Struktura tabulky `DanceGroup` 39 -- 40 42 41 CREATE TABLE `DanceGroup` ( 43 `Id` int(11) NOT NULL AUTO_INCREMENT, 44 `Name` varchar(255) NOT NULL, 45 PRIMARY KEY (`Id`) 46 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 47 /*!40101 SET character_set_client = @saved_cs_client */; 48 49 -- 50 -- Table structure for table `MeetItem` 51 -- 52 53 DROP TABLE IF EXISTS `MeetItem`; 54 /*!40101 SET @saved_cs_client = @@character_set_client */; 55 /*!40101 SET character_set_client = utf8 */; 42 `Id` int(11) NOT NULL, 43 `Name` varchar(255) NOT NULL 44 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 45 46 -- 47 -- RELACE PRO TABULKU `DanceGroup`: 48 -- 49 50 -- -------------------------------------------------------- 51 52 -- 53 -- Struktura tabulky `MeetItem` 54 -- 55 56 56 CREATE TABLE `MeetItem` ( 57 `Id` int(11) NOT NULL AUTO_INCREMENT,57 `Id` int(11) NOT NULL, 58 58 `Message` text NOT NULL, 59 59 `Name` varchar(255) NOT NULL, 60 `Age` varchar(255) NOT NULL,61 `Height` varchar(255) NOT NULL,60 `Age` int(11) DEFAULT NULL, 61 `Height` int(11) DEFAULT NULL, 62 62 `Source` int(11) NOT NULL, 63 63 `Email` varchar(255) NOT NULL, 64 64 `Phone` varchar(255) NOT NULL, 65 65 `Gender` int(11) NOT NULL, 66 ` Date` date NOT NULL,67 `Weight` varchar(255) NOT NULL,66 `Time` datetime NOT NULL, 67 `Weight` int(11) DEFAULT NULL, 68 68 `Location` varchar(255) NOT NULL, 69 PRIMARY KEY (`Id`), 70 KEY `Source` (`Source`), 71 CONSTRAINT `MeetItem_ibfk_1` FOREIGN KEY (`Source`) REFERENCES `MeetSource` (`Id`) 72 ) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8; 73 /*!40101 SET character_set_client = @saved_cs_client */; 74 75 -- 76 -- Table structure for table `MeetSource` 77 -- 78 79 DROP TABLE IF EXISTS `MeetSource`; 80 /*!40101 SET @saved_cs_client = @@character_set_client */; 81 /*!40101 SET character_set_client = utf8 */; 69 `Link` varchar(255) NOT NULL 70 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 71 72 -- 73 -- RELACE PRO TABULKU `MeetItem`: 74 -- `Source` 75 -- `MeetSource` -> `Id` 76 -- 77 78 -- -------------------------------------------------------- 79 80 -- 81 -- Struktura tabulky `MeetSource` 82 -- 83 82 84 CREATE TABLE `MeetSource` ( 83 `Id` int(11) NOT NULL AUTO_INCREMENT,85 `Id` int(11) NOT NULL, 84 86 `Name` varchar(255) NOT NULL, 85 87 `URL` varchar(255) NOT NULL, 86 `Method` varchar(255) NOT NULL, 87 PRIMARY KEY (`Id`) 88 ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 89 /*!40101 SET character_set_client = @saved_cs_client */; 90 91 -- 92 -- Table structure for table `Music` 93 -- 94 95 DROP TABLE IF EXISTS `Music`; 96 /*!40101 SET @saved_cs_client = @@character_set_client */; 97 /*!40101 SET character_set_client = utf8 */; 88 `Method` varchar(255) NOT NULL 89 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 90 91 -- 92 -- RELACE PRO TABULKU `MeetSource`: 93 -- 94 95 -- -------------------------------------------------------- 96 97 -- 98 -- Struktura tabulky `Music` 99 -- 100 98 101 CREATE TABLE `Music` ( 99 `Id` int(11) NOT NULL AUTO_INCREMENT,102 `Id` int(11) NOT NULL, 100 103 `Name` varchar(255) NOT NULL, 101 104 `URL` varchar(255) NOT NULL, 102 `Dance` int(11) NOT NULL, 103 PRIMARY KEY (`Id`), 104 KEY `Dance` (`Dance`), 105 CONSTRAINT `Music_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`) 106 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 107 /*!40101 SET character_set_client = @saved_cs_client */; 108 109 -- 110 -- Table structure for table `Resource` 111 -- 112 113 DROP TABLE IF EXISTS `Resource`; 114 /*!40101 SET @saved_cs_client = @@character_set_client */; 115 /*!40101 SET character_set_client = utf8 */; 105 `Dance` int(11) NOT NULL 106 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 107 108 -- 109 -- RELACE PRO TABULKU `Music`: 110 -- `Dance` 111 -- `Dance` -> `Id` 112 -- 113 114 -- -------------------------------------------------------- 115 116 -- 117 -- Struktura tabulky `Resource` 118 -- 119 116 120 CREATE TABLE `Resource` ( 117 `Id` int(11) NOT NULL AUTO_INCREMENT,121 `Id` int(11) NOT NULL, 118 122 `Name` varchar(255) NOT NULL, 119 123 `Dance` int(11) NOT NULL, 120 124 `URL` varchar(255) NOT NULL, 121 `Group` int(11) DEFAULT NULL, 122 PRIMARY KEY (`Id`), 123 KEY `Dance` (`Dance`), 124 KEY `Group` (`Group`), 125 CONSTRAINT `Resource_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`), 126 CONSTRAINT `Resource_ibfk_2` FOREIGN KEY (`Group`) REFERENCES `ResourceGroup` (`Id`) 127 ) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8; 128 /*!40101 SET character_set_client = @saved_cs_client */; 129 130 -- 131 -- Table structure for table `ResourceGroup` 132 -- 133 134 DROP TABLE IF EXISTS `ResourceGroup`; 135 /*!40101 SET @saved_cs_client = @@character_set_client */; 136 /*!40101 SET character_set_client = utf8 */; 125 `Group` int(11) DEFAULT NULL 126 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 127 128 -- 129 -- RELACE PRO TABULKU `Resource`: 130 -- `Dance` 131 -- `Dance` -> `Id` 132 -- `Group` 133 -- `ResourceGroup` -> `Id` 134 -- 135 136 -- -------------------------------------------------------- 137 138 -- 139 -- Struktura tabulky `ResourceGroup` 140 -- 141 137 142 CREATE TABLE `ResourceGroup` ( 138 `Id` int(11) NOT NULL AUTO_INCREMENT, 139 `Name` varchar(255) NOT NULL, 140 `URL` varchar(255) NOT NULL, 141 PRIMARY KEY (`Id`) 142 ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 143 /*!40101 SET character_set_client = @saved_cs_client */; 144 145 -- 146 -- Table structure for table `School` 147 -- 148 149 DROP TABLE IF EXISTS `School`; 150 /*!40101 SET @saved_cs_client = @@character_set_client */; 151 /*!40101 SET character_set_client = utf8 */; 143 `Id` int(11) NOT NULL, 144 `Name` varchar(255) NOT NULL, 145 `URL` varchar(255) NOT NULL 146 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 147 148 -- 149 -- RELACE PRO TABULKU `ResourceGroup`: 150 -- 151 152 -- -------------------------------------------------------- 153 154 -- 155 -- Struktura tabulky `School` 156 -- 157 152 158 CREATE TABLE `School` ( 153 `Id` int(11) NOT NULL AUTO_INCREMENT,159 `Id` int(11) NOT NULL, 154 160 `Name` varchar(255) NOT NULL, 155 161 `Address` varchar(255) NOT NULL, 156 `URL` varchar(255) NOT NULL, 157 PRIMARY KEY (`Id`) 158 ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; 159 /*!40101 SET character_set_client = @saved_cs_client */; 160 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 161 162 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 163 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 164 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 165 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 166 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 167 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 168 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 169 170 -- Dump completed on 2018-08-04 22:01:08 162 `URL` varchar(255) NOT NULL 163 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 164 165 -- 166 -- RELACE PRO TABULKU `School`: 167 -- 168 169 -- 170 -- Klíče pro exportované tabulky 171 -- 172 173 -- 174 -- Klíče pro tabulku `Dance` 175 -- 176 ALTER TABLE `Dance` 177 ADD PRIMARY KEY (`Id`), 178 ADD KEY `Group` (`Group`); 179 180 -- 181 -- Klíče pro tabulku `DanceGroup` 182 -- 183 ALTER TABLE `DanceGroup` 184 ADD PRIMARY KEY (`Id`); 185 186 -- 187 -- Klíče pro tabulku `MeetItem` 188 -- 189 ALTER TABLE `MeetItem` 190 ADD PRIMARY KEY (`Id`), 191 ADD KEY `Source` (`Source`); 192 193 -- 194 -- Klíče pro tabulku `MeetSource` 195 -- 196 ALTER TABLE `MeetSource` 197 ADD PRIMARY KEY (`Id`); 198 199 -- 200 -- Klíče pro tabulku `Music` 201 -- 202 ALTER TABLE `Music` 203 ADD PRIMARY KEY (`Id`), 204 ADD KEY `Dance` (`Dance`); 205 206 -- 207 -- Klíče pro tabulku `Resource` 208 -- 209 ALTER TABLE `Resource` 210 ADD PRIMARY KEY (`Id`), 211 ADD KEY `Dance` (`Dance`), 212 ADD KEY `Group` (`Group`); 213 214 -- 215 -- Klíče pro tabulku `ResourceGroup` 216 -- 217 ALTER TABLE `ResourceGroup` 218 ADD PRIMARY KEY (`Id`); 219 220 -- 221 -- Klíče pro tabulku `School` 222 -- 223 ALTER TABLE `School` 224 ADD PRIMARY KEY (`Id`); 225 226 -- 227 -- AUTO_INCREMENT pro tabulky 228 -- 229 230 -- 231 -- AUTO_INCREMENT pro tabulku `Dance` 232 -- 233 ALTER TABLE `Dance` 234 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 235 -- 236 -- AUTO_INCREMENT pro tabulku `DanceGroup` 237 -- 238 ALTER TABLE `DanceGroup` 239 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 240 -- 241 -- AUTO_INCREMENT pro tabulku `MeetItem` 242 -- 243 ALTER TABLE `MeetItem` 244 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=93; 245 -- 246 -- AUTO_INCREMENT pro tabulku `MeetSource` 247 -- 248 ALTER TABLE `MeetSource` 249 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; 250 -- 251 -- AUTO_INCREMENT pro tabulku `Music` 252 -- 253 ALTER TABLE `Music` 254 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 255 -- 256 -- AUTO_INCREMENT pro tabulku `Resource` 257 -- 258 ALTER TABLE `Resource` 259 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 260 -- 261 -- AUTO_INCREMENT pro tabulku `ResourceGroup` 262 -- 263 ALTER TABLE `ResourceGroup` 264 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 265 -- 266 -- AUTO_INCREMENT pro tabulku `School` 267 -- 268 ALTER TABLE `School` 269 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 270 -- 271 -- Omezení pro exportované tabulky 272 -- 273 274 -- 275 -- Omezení pro tabulku `Dance` 276 -- 277 ALTER TABLE `Dance` 278 ADD CONSTRAINT `Dance_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `DanceGroup` (`Id`); 279 280 -- 281 -- Omezení pro tabulku `MeetItem` 282 -- 283 ALTER TABLE `MeetItem` 284 ADD CONSTRAINT `MeetItem_ibfk_1` FOREIGN KEY (`Source`) REFERENCES `MeetSource` (`Id`); 285 286 -- 287 -- Omezení pro tabulku `Music` 288 -- 289 ALTER TABLE `Music` 290 ADD CONSTRAINT `Music_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`); 291 292 -- 293 -- Omezení pro tabulku `Resource` 294 -- 295 ALTER TABLE `Resource` 296 ADD CONSTRAINT `Resource_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`), 297 ADD CONSTRAINT `Resource_ibfk_2` FOREIGN KEY (`Group`) REFERENCES `ResourceGroup` (`Id`); -
trunk/SQL/Update.php
r25 r31 7 7 ALTER TABLE `MeetItem` CHANGE `Weight` `Weight` INT NULL DEFAULT NULL; 8 8 UPDATE `MeetItem` SET `Weight`=NULL WHERE `Weight`=0; 9 10 ALTER TABLE `MeetItem` CHANGE `Date` `Time` DATETIME NOT NULL; -
trunk/index.php
r30 r31 267 267 $Output .= $PageList['Output']; 268 268 $TableColumns = array( 269 array('Name' => ' Date', 'Title' => 'Datum'),269 array('Name' => 'Time', 'Title' => 'Čas'), 270 270 array('Name' => 'Name', 'Title' => 'Jméno'), 271 271 array('Name' => 'Height', 'Title' => 'Výška'), … … 278 278 array('Name' => '', 'Title' => 'Detail'), 279 279 ); 280 $Order = GetOrderTableHeader($TableColumns, ' Date', 1);280 $Order = GetOrderTableHeader($TableColumns, 'Time', 1); 281 281 $Output .= '<table class="WideTable">'; 282 282 $Output .= $Order['Output']; … … 286 286 { 287 287 $Output .= '<tr>'. 288 '<td>'.HumanDate(MysqlDateToTime($MeetItem[' Date'])).'</td>'.288 '<td>'.HumanDate(MysqlDateToTime($MeetItem['Time'])).'</td>'. 289 289 '<td>'.$MeetItem['Name'].'</td>'. 290 290 '<td>'.$MeetItem['Height'].'</td>'. … … 332 332 else $Link = ''; 333 333 $Output .= '<table class="ItemTable">'. 334 '<tr><th> Datum</th><td>'.HumanDate(MysqlDateToTime($MeetItem['Date'])).'</td></tr>'.334 '<tr><th>Čas</th><td>'.HumanDate(MysqlDateToTime($MeetItem['Time'])).'</td></tr>'. 335 335 '<tr><th>Pohlaví</th><td>'.$Gender[$MeetItem['Gender']].'</td></tr>'. 336 336 '<tr><th>Jméno</th><td>'.$MeetItem['Name'].'</td></tr>'. … … 360 360 361 361 $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '. 362 '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL, UNIX_TIMESTAMP(` Date`) AS `UnixTime`', '1 ORDER BY `Date` DESC LIMIT 30');362 '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL, UNIX_TIMESTAMP(`Time`) AS `UnixTime`', '1 ORDER BY `Time` DESC LIMIT 30'); 363 363 while($MeetItem = $DbResult->fetch_assoc()) 364 364 {
Note:
See TracChangeset
for help on using the changeset viewer.