Changeset 12
- Timestamp:
- Aug 29, 2019, 12:14:23 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SQL/Structure.sql
r2 r12 3 3 -- https://www.phpmyadmin.net/ 4 4 -- 5 -- Počítač: localhost:33066 -- Vytvořeno: Pon 10. zář 2018, 00:547 -- Verze serveru: 5.7.23-0ubuntu0.18.04.18 -- Verze PHP: 7.1.15-0ubuntu0.17.10.15 -- Host: localhost:3306 6 -- Generation Time: Aug 29, 2019 at 12:02 AM 7 -- Server version: 10.3.17-MariaDB-0ubuntu0.19.04.1 8 -- PHP Version: 7.2.19-0ubuntu0.19.04.2 9 9 10 10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 11 SET time_zone = "+00:00"; 12 12 13 14 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 /*!40101 SET NAMES utf8mb4 */; 18 13 19 -- 14 -- Datab áze: `teribear`20 -- Database: `teribear` 15 21 -- 22 CREATE DATABASE IF NOT EXISTS `teribear` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 23 USE `teribear`; 16 24 17 25 -- -------------------------------------------------------- 18 26 19 27 -- 20 -- Struktura tabulky`Runner`28 -- Table structure for table `Runner` 21 29 -- 22 30 23 31 CREATE TABLE `Runner` ( 24 32 `Id` int(11) NOT NULL, 25 `Name` varchar(255) CHARACTER SET utf8NOT NULL,33 `Name` varchar(255) NOT NULL, 26 34 `Gender` int(11) NOT NULL, 27 `Team` int(11) NOT NULL,35 `Team` int(11) DEFAULT NULL, 28 36 `ChipNumber` int(11) NOT NULL 29 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 30 31 -- 32 -- RELACE PRO TABULKU `Runner`: 33 -- `Team` 34 -- `Team` -> `Id` 35 -- 37 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; 36 38 37 39 -- -------------------------------------------------------- 38 40 39 41 -- 40 -- Struktura tabulky`RunnerStat`42 -- Table structure for table `RunnerStat` 41 43 -- 42 44 … … 48 50 `Rank` int(11) NOT NULL, 49 51 `Money` int(11) NOT NULL 50 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 51 52 -- 53 -- RELACE PRO TABULKU `RunnerStat`: 54 -- `Runner` 55 -- `Runner` -> `Id` 56 -- 52 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; 57 53 58 54 -- -------------------------------------------------------- 59 55 60 56 -- 61 -- Struktura tabulky`Team`57 -- Table structure for table `Team` 62 58 -- 63 59 64 60 CREATE TABLE `Team` ( 65 61 `Id` int(11) NOT NULL, 66 `Name` varchar(255) CHARACTER SET utf8 NOT NULL, 67 `WebId` int(11) NOT NULL 68 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 62 `Name` varchar(255) NOT NULL, 63 `WebId` int(11) NOT NULL, 64 `IsFamily` int(11) NOT NULL 65 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; 66 67 -- -------------------------------------------------------- 69 68 70 69 -- 71 -- RELACE PRO TABULKU `Team`: 70 -- Table structure for table `TeamStat` 71 -- 72 73 CREATE TABLE `TeamStat` ( 74 `Id` int(11) NOT NULL, 75 `Time` datetime NOT NULL, 76 `Team` int(11) NOT NULL, 77 `Distance` decimal(10,1) NOT NULL, 78 `Rank` int(11) NOT NULL, 79 `Money` int(11) NOT NULL 80 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; 81 82 -- 83 -- Indexes for dumped tables 72 84 -- 73 85 74 86 -- 75 -- Klíče pro exportované tabulky 76 -- 77 78 -- 79 -- Klíče pro tabulku `Runner` 87 -- Indexes for table `Runner` 80 88 -- 81 89 ALTER TABLE `Runner` … … 84 92 85 93 -- 86 -- Klíče pro tabulku`RunnerStat`94 -- Indexes for table `RunnerStat` 87 95 -- 88 96 ALTER TABLE `RunnerStat` … … 91 99 92 100 -- 93 -- Klíče pro tabulku`Team`101 -- Indexes for table `Team` 94 102 -- 95 103 ALTER TABLE `Team` … … 97 105 98 106 -- 99 -- AUTO_INCREMENT pro tabulky 107 -- Indexes for table `TeamStat` 108 -- 109 ALTER TABLE `TeamStat` 110 ADD PRIMARY KEY (`Id`), 111 ADD KEY `Team` (`Team`); 112 113 -- 114 -- AUTO_INCREMENT for dumped tables 100 115 -- 101 116 102 117 -- 103 -- AUTO_INCREMENT pro tabulku`Runner`118 -- AUTO_INCREMENT for table `Runner` 104 119 -- 105 120 ALTER TABLE `Runner` 106 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT= 59;121 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18158; 107 122 -- 108 -- AUTO_INCREMENT pro tabulku`RunnerStat`123 -- AUTO_INCREMENT for table `RunnerStat` 109 124 -- 110 125 ALTER TABLE `RunnerStat` 111 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT= 41;126 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=136448; 112 127 -- 113 -- AUTO_INCREMENT pro tabulku`Team`128 -- AUTO_INCREMENT for table `Team` 114 129 -- 115 130 ALTER TABLE `Team` 116 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT= 2;131 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12718; 117 132 -- 118 -- Omezení pro exportované tabulky 133 -- AUTO_INCREMENT for table `TeamStat` 134 -- 135 ALTER TABLE `TeamStat` 136 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4088; 137 -- 138 -- Constraints for dumped tables 119 139 -- 120 140 121 141 -- 122 -- Omezení pro tabulku`Runner`142 -- Constraints for table `Runner` 123 143 -- 124 144 ALTER TABLE `Runner` … … 126 146 127 147 -- 128 -- Omezení pro tabulku`RunnerStat`148 -- Constraints for table `RunnerStat` 129 149 -- 130 150 ALTER TABLE `RunnerStat` 131 151 ADD CONSTRAINT `RunnerStat_ibfk_1` FOREIGN KEY (`Runner`) REFERENCES `Runner` (`Id`); 152 153 -- 154 -- Constraints for table `TeamStat` 155 -- 156 ALTER TABLE `TeamStat` 157 ADD CONSTRAINT `TeamStat_ibfk_1` FOREIGN KEY (`Team`) REFERENCES `Team` (`Id`); 158 159 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 160 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 161 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -
trunk/index.php
r11 r12 36 36 { 37 37 $Output = '<div>'. 38 '<a href="'.$this->Link('/').'">Summary</a> '. 38 39 '<a href="'.$this->Link('/runners').'">Runners</a> '. 39 40 '<a href="'.$this->Link('/teams').'">Teams</a> '. … … 592 593 function ShowMain() 593 594 { 594 return ""; 595 $Output = ''; 596 $DbResult = $this->Database->select('Runner', 'COUNT(*) AS Total'); 597 $DbRow = $DbResult->fetch_assoc(); 598 $RunnersCount = $DbRow['Total']; 599 600 $Output = ''; 601 $DbResult = $this->Database->select('Runner', 'COUNT(*) AS Total', 'Gender=1'); 602 $DbRow = $DbResult->fetch_assoc(); 603 $MenCount = $DbRow['Total']; 604 605 $Output = ''; 606 $DbResult = $this->Database->select('Runner', 'COUNT(*) AS Total', 'Gender=2'); 607 $DbRow = $DbResult->fetch_assoc(); 608 $WomenCount = $DbRow['Total']; 609 610 $Output = ''; 611 $DbResult = $this->Database->select('Runner', 'COUNT(*) AS Total', 'Gender=3'); 612 $DbRow = $DbResult->fetch_assoc(); 613 $KidsCount = $DbRow['Total']; 614 615 $DbResult = $this->Database->select('Team', 'COUNT(*) AS Total', 'IsFamily=0'); 616 $DbRow = $DbResult->fetch_assoc(); 617 $TeamsCount = $DbRow['Total']; 618 619 $DbResult = $this->Database->select('Team', 'COUNT(*) AS Total', 'IsFamily=1'); 620 $DbRow = $DbResult->fetch_assoc(); 621 $FamiliesCount = $DbRow['Total']; 622 623 $Output .= '<div class="page-title">Summary</div>'; 624 $Output .= '<table class="WideTable">'; 625 $Output .= '<tr><th>Category</th><th>Total count</th></tr>'; 626 $Output .= '<tr><td>Runners</td><td>'.$RunnersCount.'</td></tr>'; 627 $Output .= '<tr><td>Men</td><td>'.$MenCount.'</td></tr>'; 628 $Output .= '<tr><td>Women</td><td>'.$WomenCount.'</td></tr>'; 629 $Output .= '<tr><td>Kids</td><td>'.$KidsCount.'</td></tr>'; 630 $Output .= '<tr><td>Teams</td><td>'.$TeamsCount.'</td></tr>'; 631 $Output .= '<tr><td>Families</td><td>'.$FamiliesCount.'</td></tr>'; 632 $Output .= '</table>'; 633 634 return $Output; 595 635 } 596 636 … … 632 672 { 633 673 if($this->PathItems[0] == 'sync') $Output .= $this->ShowSync(); 634 else if($this->PathItems[0] == 'empty') $Output .= $this->ShowEmpty();674 //else if($this->PathItems[0] == 'empty') $Output .= $this->ShowEmpty(); 635 675 else if($this->PathItems[0] == 'runner') $Output .= $this->ShowRunner(); 636 676 else if($this->PathItems[0] == 'runners') $Output .= $this->ShowRunners();
Note:
See TracChangeset
for help on using the changeset viewer.