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