xref: /webtrees/resources/views/modules/gedcom_stats/statistics.phtml (revision 01cccaa9b32930a9abd41484566fc39269a168b4)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4
5?>
6
7<?php if ($show_last_update) : ?>
8    <p class="card-text">
9        <?= I18N::translate('This family tree was last updated on %s.', strip_tags($stats->gedcomUpdated())) ?>
10    </p>
11<?php endif ?>
12
13<div class="row">
14    <div class="col col">
15        <table class="table wt-facts-table">
16            <caption class="sr-only">
17                <?= I18N::translate('Statistics') ?>
18            </caption>
19            <tbody>
20            <?php if ($stat_indi) : ?>
21                <tr>
22                    <th scope="row">
23                        <?= I18N::translate('Individuals') ?>
24                    </th>
25                    <td>
26                        <?= $stats->totalIndividuals() ?>
27                    </td>
28                </tr>
29
30                <tr>
31                    <th scope="row">
32                        <?= I18N::translate('Males') ?>
33                    </th>
34                    <td>
35                        <?= $stats->totalSexMales() ?>
36                        <br>
37                        <?= $stats->totalSexMalesPercentage() ?>
38                    </td>
39                </tr>
40
41                <tr>
42                    <th scope="row">
43                        <?= I18N::translate('Females') ?>
44                    </th>
45                    <td>
46                        <?= $stats->totalSexFemales() ?>
47                        <br>
48                        <?= $stats->totalSexFemalesPercentage() ?>
49                    </td>
50                </tr>
51            <?php endif ?>
52
53            <?php if ($stat_surname) : ?>
54                <tr>
55                    <th scope="row">
56                        <?= I18N::translate('Surnames') ?>
57                    </th>
58                    <td>
59                        <?= $stats->totalSurnames() ?>
60                    </td>
61                </tr>
62            <?php endif ?>
63
64            <?php if ($stat_fam) : ?>
65                <tr>
66                    <th scope="row">
67                        <?= I18N::translate('Families') ?>
68                    </th>
69                    <td>
70                        <?= $stats->totalFamilies() ?>
71                    </td>
72                </tr>
73            <?php endif ?>
74
75
76            <?php if ($stat_sour) : ?>
77                <tr>
78                    <th scope="row">
79                        <?= I18N::translate('Sources') ?>
80                    </th>
81                    <td>
82                        <?= $stats->totalSources() ?>
83                    </td>
84                </tr>
85            <?php endif ?>
86
87            <?php if ($stat_media) : ?>
88                <tr>
89                    <th scope="row">
90                        <?= I18N::translate('Media objects') ?>
91                    </th>
92                    <td>
93                        <?= $stats->totalMedia() ?>
94                    </td>
95                </tr>
96            <?php endif ?>
97
98            <?php if ($stat_repo) : ?>
99                <tr>
100                    <th scope="row">
101                        <?= I18N::translate('Repositories') ?>
102                    </th>
103                    <td>
104                        <?= $stats->totalRepositories() ?>
105                    </td>
106                </tr>
107            <?php endif ?>
108
109            <?php if ($stat_events) : ?>
110                <tr>
111                    <th scope="row">
112                        <?= I18N::translate('Events') ?>
113                    </th>
114                    <td>
115                        <?= $stats->totalEvents() ?>
116                    </td>
117                </tr>
118            <?php endif ?>
119
120            <?php if ($stat_users) : ?>
121                <tr>
122                    <th scope="row">
123                        <?= I18N::translate('Users') ?>
124                    </th>
125                    <td>
126                        <?= $stats->totalUsers() ?>
127                    </td>
128                </tr>
129            <?php endif ?>
130            </tbody>
131        </table>
132    </div>
133
134    <div class="col col">
135        <table class="table wt-facts-table">
136            <caption class="sr-only">
137                <?= I18N::translate('Statistics') ?>
138            </caption>
139
140            <tbody>
141            <?php if ($stat_first_birth) : ?>
142                <tr>
143                    <th scope="row">
144                        <?= I18N::translate('Earliest birth') ?>
145                    </th>
146                    <td>
147                        <?= $stats->firstBirth() ?>
148                    </td>
149                </tr>
150            <?php endif ?>
151
152            <?php if ($stat_last_birth) : ?>
153                <tr>
154                    <th scope="row">
155                        <?= I18N::translate('Latest birth') ?>
156                    </th>
157                    <td>
158                        <?= $stats->lastBirth() ?>
159                    </td>
160                </tr>
161            <?php endif ?>
162
163            <?php if ($stat_first_death) : ?>
164                <tr>
165                    <th scope="row">
166                        <?= I18N::translate('Earliest death') ?>
167                    </th>
168                    <td>
169                        <?= $stats->firstDeath() ?>
170                    </td>
171                </tr>
172            <?php endif ?>
173
174            <?php if ($stat_last_death) : ?>
175                <tr>
176                    <th scope="row">
177                        <?= I18N::translate('Latest death') ?>
178                    </th>
179                    <td>
180                        <?= $stats->lastDeath() ?>
181                    </td>
182                </tr>
183            <?php endif ?>
184
185            <?php if ($stat_long_life) : ?>
186                <tr>
187                    <th scope="row">
188                        <?= I18N::translate('Individual who lived the longest') ?>
189                    </th>
190                    <td>
191                        <?= $stats->longestLife() ?>
192                    </td>
193                </tr>
194            <?php endif ?>
195
196            <?php if ($stat_avg_life) : ?>
197                <tr>
198                    <th scope="row">
199                        <?= I18N::translate('Average age at death') ?>
200                    </th>
201                    <td>
202                        <?= $stats->averageLifespan() ?>
203                        <br>
204                        <?= I18N::translate('Males') ?>:&nbsp;<?= $stats->averageLifespanMale() ?>
205                        <br>
206                        <?= I18N::translate('Females') ?>&nbsp;<?= $stats->averageLifespanFemale() ?>
207                    </td>
208                </tr>
209            <?php endif ?>
210
211            <?php if ($stat_most_chil) : ?>
212                <tr>
213                    <th scope="row">
214                        <?= I18N::translate('Family with the most children') ?>
215                    </th>
216                    <td>
217                        <?= e($stats->largestFamilySize()) ?>
218                        <br>
219                        <?= $stats->largestFamily() ?>
220                    </td>
221                </tr>
222            <?php endif ?>
223
224            <?php if ($stat_avg_chil) : ?>
225                <tr>
226                    <th scope="row">
227                        <?= I18N::translate('Average number of children per family') ?>
228                    </th>
229                    <td>
230                        <?= $stats->averageChildren() ?>
231                    </td>
232                </tr>
233            <?php endif ?>
234            </tbody>
235        </table>
236    </div>
237</div>
238
239<?php if ($surnames !== '') : ?>
240    <div class="clearfix">
241        <p>
242            <strong>
243                <?= I18N::translate('Most common surnames') ?>
244            </strong>
245            <br>
246            <span class="common_surnames">
247                <?= $surnames ?>
248            </span>
249        </p>
250    </div>
251<?php endif ?>
252