Changeset 31


Ignore:
Timestamp:
Dec 30, 2018, 7:37:55 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Store date of meet items including time. For items without specified time, just use current time (time of import).
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Global.php

    r4 r31  
    55  return(date('j.n.Y', $Time));
    66}
     7
     8function HumanTime($Time)
     9{
     10  return(date('H:i:s', $Time));
     11}
     12
     13function HumanDateTime($Time)
     14{
     15  $Output = HumanDate($Time);
     16  $Time = HumanTime($Time);
     17  if ($Time != '00:00:00') $Output .= ' '.$Time;
     18  return($Output);
     19}
     20
    721function Link2($URL)
    822{
  • trunk/Import/Amblar.php

    r20 r31  
    5555      $Type = trim(GetTextBetween($Item, ' ', ' '));
    5656      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')
    5959      {           
    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()));
    6565      $MeetItem->Email = '';
    6666      $MeetItem->Message = '';
  • trunk/Import/AstraPraha.php

    r26 r31  
    2323      $Item = GetTextBetween($Content, $ItemStart, $ItemEnd);
    2424      $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()));
    2727
    2828      $MeetItem->Gender = trim(GetTextBetween($Item, '<h3 class=\'dating-heading\'>', '</h3>'));
  • trunk/Import/Csts.php

    r26 r31  
    2929        else $MeetItem->Gender = Gender::Undefined;
    3030      $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);
    3333      $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm'));
    3434      $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, '<td colspan="3">', '</td>'))));
  • trunk/Import/Eso.php

    r23 r31  
    3535        $Small = substr($Small, strpos($Small, '/') + 1);
    3636      }     
    37       $MeetItem->Date = trim($Small);
    38       $MeetItem->Date = HumanDateTimeToTime($MeetItem->Date);
     37      $MeetItem->Time = trim($Small);
     38      $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time.' '.HumanTime(time()));
    3939      $MeetItem->Message = trim(GetTextBetween($Item, '<p class="lead">', '</p>'));
    4040      $MeetItem->Age = GetAgeFromText($MeetItem->Message);     
  • trunk/Import/Facebook.php

    r23 r31  
    3232        else $MeetItem->Gender = Gender::Undefined;
    3333      $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);
    3636      $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm'));
    3737      $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, 'data-ft="&#123;&quot;tn&quot;:&quot;K&quot;&#125;">', '</div>'))));
  • trunk/Import/MajkluvSvet.php

    r14 r31  
    4242        $MeetItem->Email = trim(substr($MeetItem->Email, strpos($MeetItem->Email, '|') + 1));
    4343      } 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);
    4747      $MeetItem->Link = 'http://www.majkluvsvet.cz'.trim(GetTextBetween($Item, "<span class='linkk pravo'><a href='", "'>odkaz"));
    4848      $MeetItem->Database = $this->Database;
  • trunk/Import/SalsaDance.php

    r11 r31  
    2222      $Item = GetTextBetween($Content, $ItemStart, $ItemEnd);
    2323      $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);
    3131      $MeetItem->Name = trim(GetTextBetween($Item, '<div class="comment-name">', '</div>'));
    3232      $MeetItem->Message = trim(GetTextBetween($Item, '<p>', '</p>'));
  • trunk/Import/Seznamka.php

    r30 r31  
    4040      $MeetItem->Age = trim(str_replace('let', '', $MeetItem->Age));
    4141      $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()));
    4343      $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, 'margin-top:10px;\'>', '</div>')));
    4444      $MeetItem->Link = GetTextBetween($Item, "<a href='", "'");
  • trunk/Import/TanecniSkola.php

    r16 r31  
    4747      {
    4848        $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)
    5151        {
    52           $PreviousTime = $MeetItem->Date;
    53         } else $MeetItem->Date = $PreviousTime;
     52          $PreviousTime = $MeetItem->Time;
     53        } else $MeetItem->Time = $PreviousTime;
    5454
    5555        $Part = GetTextBetween($Item, '</strong>', '<strong>');
  • trunk/Import/Vavruska.php

    r11 r31  
    2525      $MeetItem = new MeetItem();
    2626
    27       $MeetItem->Date = MysqlDateTimeToTime(trim(GetTextBetween($Item, 'přidáno:', '</i>')));
     27      $MeetItem->Time = MysqlDateTimeToTime(trim(GetTextBetween($Item, 'přidáno:', '</i>')));
    2828      $MeetItem->Gender = trim(GetTextBetween($Item, '<img src=/design/', 'alt="avatar"'));
    2929      if ($MeetItem->Gender == 'avatar_m_03.png') $MeetItem->Gender = Gender::Male;
  • trunk/Meet.php

    r26 r31  
    328328  var $Name = '';
    329329  var $Message = '';
    330   var $Date = '';
     330  var $Time = '';
    331331  var $Gender = Gender::Undefined;
    332332  var $Phone = '';
     
    347347      '(`Message` = "'.$this->Database->real_escape_string($this->Message).'") AND '.
    348348      '(`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)).'")');
    350350    if ($DbResult->num_rows == 0)
    351351    {
     
    358358      $this->Database->insert('MeetItem', array(
    359359        'Message' => $this->Message,
    360         'Date' => TimeToMysqlDate($this->Date),
     360        'Time' => TimeToMysqlDateTime($this->Time),
    361361        'Gender' => $this->Gender,
    362362        '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
     10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
     11SET time_zone = "+00:00";
     12
     13--
     14-- Databáze: `tanec`
     15--
     16
     17-- --------------------------------------------------------
     18
     19--
     20-- Struktura tabulky `Dance`
     21--
     22
    2523CREATE 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
    4241CREATE 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
    5656CREATE TABLE `MeetItem` (
    57   `Id` int(11) NOT NULL AUTO_INCREMENT,
     57  `Id` int(11) NOT NULL,
    5858  `Message` text NOT NULL,
    5959  `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,
    6262  `Source` int(11) NOT NULL,
    6363  `Email` varchar(255) NOT NULL,
    6464  `Phone` varchar(255) NOT NULL,
    6565  `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,
    6868  `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
    8284CREATE TABLE `MeetSource` (
    83   `Id` int(11) NOT NULL AUTO_INCREMENT,
     85  `Id` int(11) NOT NULL,
    8486  `Name` varchar(255) NOT NULL,
    8587  `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
    98101CREATE TABLE `Music` (
    99   `Id` int(11) NOT NULL AUTO_INCREMENT,
     102  `Id` int(11) NOT NULL,
    100103  `Name` varchar(255) NOT NULL,
    101104  `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
    116120CREATE TABLE `Resource` (
    117   `Id` int(11) NOT NULL AUTO_INCREMENT,
     121  `Id` int(11) NOT NULL,
    118122  `Name` varchar(255) NOT NULL,
    119123  `Dance` int(11) NOT NULL,
    120124  `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
    137142CREATE 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
    152158CREATE TABLE `School` (
    153   `Id` int(11) NOT NULL AUTO_INCREMENT,
     159  `Id` int(11) NOT NULL,
    154160  `Name` varchar(255) NOT NULL,
    155161  `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--
     176ALTER TABLE `Dance`
     177  ADD PRIMARY KEY (`Id`),
     178  ADD KEY `Group` (`Group`);
     179
     180--
     181-- Klíče pro tabulku `DanceGroup`
     182--
     183ALTER TABLE `DanceGroup`
     184  ADD PRIMARY KEY (`Id`);
     185
     186--
     187-- Klíče pro tabulku `MeetItem`
     188--
     189ALTER TABLE `MeetItem`
     190  ADD PRIMARY KEY (`Id`),
     191  ADD KEY `Source` (`Source`);
     192
     193--
     194-- Klíče pro tabulku `MeetSource`
     195--
     196ALTER TABLE `MeetSource`
     197  ADD PRIMARY KEY (`Id`);
     198
     199--
     200-- Klíče pro tabulku `Music`
     201--
     202ALTER TABLE `Music`
     203  ADD PRIMARY KEY (`Id`),
     204  ADD KEY `Dance` (`Dance`);
     205
     206--
     207-- Klíče pro tabulku `Resource`
     208--
     209ALTER 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--
     217ALTER TABLE `ResourceGroup`
     218  ADD PRIMARY KEY (`Id`);
     219
     220--
     221-- Klíče pro tabulku `School`
     222--
     223ALTER TABLE `School`
     224  ADD PRIMARY KEY (`Id`);
     225
     226--
     227-- AUTO_INCREMENT pro tabulky
     228--
     229
     230--
     231-- AUTO_INCREMENT pro tabulku `Dance`
     232--
     233ALTER TABLE `Dance`
     234  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     235--
     236-- AUTO_INCREMENT pro tabulku `DanceGroup`
     237--
     238ALTER TABLE `DanceGroup`
     239  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     240--
     241-- AUTO_INCREMENT pro tabulku `MeetItem`
     242--
     243ALTER TABLE `MeetItem`
     244  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=93;
     245--
     246-- AUTO_INCREMENT pro tabulku `MeetSource`
     247--
     248ALTER TABLE `MeetSource`
     249  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
     250--
     251-- AUTO_INCREMENT pro tabulku `Music`
     252--
     253ALTER TABLE `Music`
     254  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     255--
     256-- AUTO_INCREMENT pro tabulku `Resource`
     257--
     258ALTER TABLE `Resource`
     259  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     260--
     261-- AUTO_INCREMENT pro tabulku `ResourceGroup`
     262--
     263ALTER TABLE `ResourceGroup`
     264  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     265--
     266-- AUTO_INCREMENT pro tabulku `School`
     267--
     268ALTER 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--
     277ALTER TABLE `Dance`
     278  ADD CONSTRAINT `Dance_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `DanceGroup` (`Id`);
     279
     280--
     281-- Omezení pro tabulku `MeetItem`
     282--
     283ALTER TABLE `MeetItem`
     284  ADD CONSTRAINT `MeetItem_ibfk_1` FOREIGN KEY (`Source`) REFERENCES `MeetSource` (`Id`);
     285
     286--
     287-- Omezení pro tabulku `Music`
     288--
     289ALTER TABLE `Music`
     290  ADD CONSTRAINT `Music_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`);
     291
     292--
     293-- Omezení pro tabulku `Resource`
     294--
     295ALTER 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  
    77ALTER TABLE `MeetItem` CHANGE `Weight` `Weight` INT NULL DEFAULT NULL;
    88UPDATE `MeetItem` SET `Weight`=NULL WHERE `Weight`=0;
     9
     10ALTER TABLE `MeetItem` CHANGE `Date` `Time` DATETIME NOT NULL;
  • trunk/index.php

    r30 r31  
    267267    $Output .= $PageList['Output'];
    268268    $TableColumns = array(
    269       array('Name' => 'Date', 'Title' => 'Datum'),
     269      array('Name' => 'Time', 'Title' => 'Čas'),
    270270      array('Name' => 'Name', 'Title' => 'Jméno'),
    271271      array('Name' => 'Height', 'Title' => 'Výška'),
     
    278278      array('Name' => '', 'Title' => 'Detail'),
    279279    );
    280     $Order = GetOrderTableHeader($TableColumns, 'Date', 1);
     280    $Order = GetOrderTableHeader($TableColumns, 'Time', 1);
    281281    $Output .= '<table class="WideTable">';
    282282    $Output .= $Order['Output'];
     
    286286    {
    287287      $Output .= '<tr>'.
    288         '<td>'.HumanDate(MysqlDateToTime($MeetItem['Date'])).'</td>'.
     288        '<td>'.HumanDate(MysqlDateToTime($MeetItem['Time'])).'</td>'.
    289289        '<td>'.$MeetItem['Name'].'</td>'.
    290290        '<td>'.$MeetItem['Height'].'</td>'.
     
    332332        else $Link = '';
    333333      $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>'.
    335335        '<tr><th>Pohlaví</th><td>'.$Gender[$MeetItem['Gender']].'</td></tr>'.
    336336        '<tr><th>Jméno</th><td>'.$MeetItem['Name'].'</td></tr>'.
     
    360360
    361361    $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');
    363363    while($MeetItem = $DbResult->fetch_assoc())
    364364    {
Note: See TracChangeset for help on using the changeset viewer.