Adjust form to new table einsatz and co.
[misc/kostenrechnung] / masks / overview_geraete.php
1 <?php
2
3 include_once($_SESSION['sys']['basedir'].'/lib/overview_utils.php');
4
5 if (empty($_SESSION['overview_geraete.year'])) $_SESSION['overview_geraete.year'] = 0;
6
7 $mask = array(
8               'table' => 'einsatz',
9               'title' => 'Stundenübersicht pro Gerät',
10               'join' => array('gerate ON einsatz.geraet = gerate.id',
11                               'anbaugeraete ON einsatz.anbaugeraet = anbaugeraete.id',
12                               'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
13                               ),
14               'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
15                        . " AND date_part('year', datum) = " . $_SESSION['overview_geraete.year'],
16               'select' => array(
17                                 'title' => 'Auswahl',
18                                 'options' => discover_years(),
19                                 'default' => 'Jahr wählen',
20                                 'selected' => $_SESSION['overview_geraete.year'],
21                                 'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
22                                 ),
23               'variables' => array(
24                                    'year' => array(),
25                                    ),
26               'list' => array(
27                               'id' => array(
28                                             'name' => 'ID',
29                                             'visible' => false,
30                                             'sql' => 'einsatz.id',
31                                             ),
32                               'datum' => array(
33                                             'name' => 'Datum',
34                                             'type' => 'date',
35                                             'width' => 70,
36                                             ),
37                               'geraet' => array(
38                                             'name' => 'Gerät',
39                                             'sql' => "gerate.geraet",
40                                             'width' => 150,
41                                             'specs' => "filterUI: 's'",
42                                             ),
43                               'anbaugeraet' => array(
44                                             'name' => 'Anbaugerät',
45                                             'sql' => "anbaugeraete.anbaugeraet",
46                                             'width' => 150,
47                                             'specs' => "filterUI: 's'",
48                                             ),
49                               'arbeitsarten' => array(
50                                             'name' => 'Arbeiten',
51                                             'sql' => "arbeitsarten.arbeitsart",
52                                             'width' => 150,
53                                             'specs' => "filterUI: 's'",
54                                             ),
55                               'geraetstunden' => array(
56                                             'name' => 'Gerätstunden',
57                                             'type' => 'number',
58                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
59                                             'width' => 60,
60                                             ),
61                               'anbaugeraetstunden' => array(
62                                             'name' => 'Anbaugerätstunden',
63                                             'type' => 'number',
64                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
65                                             'width' => 60,
66                                             ),
67                               ),
68               );
69
70 ?>