Fix umlauts
[misc/kostenrechnung] / masks / overview_kostenstellen.php
1 <?php
2
3 include_once($_SESSION['sys']['basedir'].'/lib/overview_utils.php');
4
5 if (empty($_SESSION['overview_kostenstellen.year'])) $_SESSION['overview_kostenstellen.year'] = 0;
6
7 $mask = array(
8               'table' => 'kostenstellen',
9               'title' => 'Übersicht nach Kostenstellen',
10               'join' => array('gebiet ON kostenstellen.gebiet = gebiet.id'),
11               'select' => array(
12                                 'title' => 'Auswahl',
13                                 'options' => discover_years(),
14                                 'default' => 'Jahr wählen',
15                                 'selected' => $_SESSION['overview_kostenstellen.year'],
16                                 'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
17                                 ),
18               'variables' => array(
19                                    'year' => array(),
20                                    ),
21               'list' => array(
22                               'id' => array(
23                                             'name' => 'ID',
24                                             'visible' => false,
25                                             'width' => 60,
26                                             'sql' => 'kostenstellen.id',
27                                             ),
28                               'gebiet' => array(
29                                             'name' => 'Gebiet',
30                                             'sql' => "gebiet.gebiet",
31                                             'width' => 150,
32                                             'specs' => "filterUI: 't'",
33                                             ),
34                               'kostenstelle' => array(
35                                             'name' => 'Gewässer',
36                                             'sql' => "kostenstellen.kostenstelle",
37                                             'width' => 150,
38                                             'specs' => "filterUI: 't'",
39                                             ),
40                               'laenge' => array(
41                                             'name' => 'Länge',
42                                             'type' => 'number',
43                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
44                                             'width' => 60,
45                                             ),
46                               'personalstunden' => array(
47                                             'name' => 'Personalstunden',
48                                             'type' => 'number',
49                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
50                                             'width' => 60,
51                                             'sql' => "(SELECT sum(stunden) FROM einsatzpersonal WHERE einsatz IN " .
52                                                      "(SELECT id FROM einsatz WHERE kostenstelle = kostenstellen.id " .
53                                                      "AND date_part('year', datum) = " . $_SESSION['overview_kostenstellen.year'] . "))",
54                                             ),
55                               'geraetstunden' => array(
56                                             'name' => 'Gerätestunden',
57                                             'type' => 'number',
58                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
59                                             'width' => 60,
60                                             'sql' => "(SELECT sum(stunden) FROM einsatzgeraete WHERE einsatz IN " .
61                                                      "(SELECT id FROM einsatz WHERE kostenstelle = kostenstellen.id " .
62                                                      "AND date_part('year', datum) = " . $_SESSION['overview_kostenstellen.year'] . "))",
63                                             ),
64                               'stdlfdm' => array(
65                                             'name' => 'Stunden pro lfdm',
66                                             'type' => 'number',
67                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
68                                             'width' => 60,
69                                             'sql' => "((SELECT sum(stunden) FROM einsatzpersonal WHERE einsatz IN " .
70                                                      "(SELECT id FROM einsatz WHERE kostenstelle = kostenstellen.id " .
71                                                      "AND date_part('year', datum) = " . $_SESSION['overview_kostenstellen.year'] . ")) + ".
72                                                      "(SELECT sum(stunden) FROM einsatzgeraete WHERE einsatz IN " .
73                                                      "(SELECT id FROM einsatz WHERE kostenstelle = kostenstellen.id " .
74                                                      "AND date_part('year', datum) = " . $_SESSION['overview_kostenstellen.year'] . "))) / laenge",
75                                             ),
76                               ),
77               );
78
79 ?>