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