-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.class.php
More file actions
executable file
·143 lines (118 loc) · 4.8 KB
/
gui.class.php
File metadata and controls
executable file
·143 lines (118 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
class CGuiGenerator {
private $prefixId;
private $daydate;
public function __construct() {
$this->prefixId = "default";
$this->daydate = 1;
}
public function setPrefix($str) {
$this->prefixId = $str;
}
public function setDayDate($str) {
$this->daydate = $str;
}
public function generateDayDate() {
$ret = "<span class=\"daydate\" id=\"daydate" . $this->daydate . "\"> </span>";
return $ret;
}
public function generateAll() {
$ret = "<div class=\"sep\"> </div>";
$ret .= "<div class=\"day\" id=\"" . $this->prefixId . "\" >";
$ret .= $this->generateColOne();
$ret .= $this->generateWorkareas();
$ret .= "<div class=\"col3\" id=\"" . $this->prefixId . "col3\">";
$ret .= $this->generateCommentBox();
$ret .= "</div>";
$ret .= "<div class=\"col4\">";
$ret .= $this->generateDropDownBox();
$ret .= "</div>";
$ret .= "<div class=\"col5\">";
$ret .= $this->generateCarActionBox();
$ret.= "</div>";
$ret .= "</div>";
return $ret;
}
public function generateColOne() {
$ret = "<div class=\"col1\" id=\"" . $this->prefixId . "col1\" />";
$ret .= $this->generateDayDate();
$ret .= $this->generateTblWorkhours();
$ret .= $this->generateDisplayWorkhours();
$ret .= "</div>";
return $ret;
}
public function generateDropDownBox() {
$ret = "<select id=\"" . $this->prefixId . "hollidaybox\" onChange=\"javascript:GUIchanges();\" >";
$ret .= "<option value=\"1\">Normaler Arbeitstag</option>";
$ret .= "<option value=\"2\">Urlaub</option>";
$ret .= "<option value=\"3\">Feiertag</option>";
$ret .= "<option value=\"4\">Krankheit</option>";
$ret .= "<option value=\"5\">Sonstiges</option>";
$ret .= "</select>";
$ret .= "<br><input type=\"text\" id=\"" . $this->prefixId . "hollidaydescription\">";
return $ret;
}
public function generateTblWorkhours() {
$ret = "<!-- workhours -->";
$ret .= $this->generateDayDate();
$ret .= "<table class=\"workhours\" id=\"" . $this->prefixId . "workhours\">";
$ret .= "<tr class=\"workentrydescription\">";
$ret .= "<td class=\"workfrom\">Von</td>";
$ret .= "<td class=\"workto\">Bis</td>";
$ret .= "</tr>";
for ( $i = 1; $i <= 4; $i++ ) {
$ret .= "<tr class=\"workentry$i\">";
$ret .= "<td class=\"workfrom\"> <input type=\"text\" size=\"9\" name=\"workfrom$i\" id=\"" . $this->prefixId . "workfrom$i\" onChange=\"javascript:calcChanges('" . $this->prefixId . "');GUIchanges();\"> </td>";
$ret .= "<td class=\"workto\"> <input type=\"text\" size=\"9\" name=\"workto$i\" id=\"" . $this->prefixId . "workto$i\" onChange=\"javascript:calcChanges('" . $this->prefixId . "');GUIchanges();\"> </td>";
$ret .= "</tr>";
}
$ret .= "</table>";
$ret .= "<!-- end table workhours -->";
//$ret .= "</div>";
return $ret;
}
public function generateDisplayWorkhours() {
$ret = "<span class=\"descriptionWorkhours\"> Geleistete Stunden: </span> <input type=\"text\" id=\"" . $this->prefixId . "displayworkhours\" name=\"" . $this->prefixId . "displayworkhours\" size=\"8\">";
return $ret;
}
// col2
public function generateWorkareas() {
$ret = "<!-- workareas -->";
$ret .= "<div class=\"col2\">";
$ret .= "<table class=\"workareas\">";
for ( $lines = 0; $lines < 6; $lines++ ) {
$ret .= "<tr>";
for ( $columns = 0; $columns < 4; $columns++ ) {
$runNbr = ($lines * 4) + ($columns + 1);
$ret .= "<td class=\"workarealabel\" id=\"" . $this->prefixId . "walbl$runNbr\"> </td>";
$ret .= "<td class=\"workareainput\" ><input type=\"text\" class=\"inputtime\" name=\"" . $this->prefixId . "wa$runNbr\" id=\"" . $this->prefixId . "wa$runNbr\" onChange=\"javascript:calcChanges('" . $this->prefixId . "');GUIchanges();\" ></td>";
}
$ret .= "</tr>";
}
$ret .= "</table>";
$ret .= "</div>";
$ret .= "<!-- end div col2monday -->";
return $ret;
}
// col3
public function generateCommentBox() {
$ret = "<!-- comment on day -->";
$ret .= "<textarea id=\"" . $this->prefixId . "comment\" class=\"comment\"> </textarea>";
return $ret;
}
public function generateCarActionBox() {
$ret = "<!-- kilometers (to be filled by javascript) -->";
$ret .= "<div class=\"kilometeres\" id=\"" . $this->prefixId . "kilometer\">";
$ret .= "<table id=\"" . $this->prefixId . "cartable\" class=\"cartable\" >";
$ret .= "<thead><tr><th>Von</th><th>Bis</th><th>KM</th></thead>";
$ret .= "</table>";
$ret .= "<div id=\"" . $this->prefixId . "travel\">";
$ret .= "<input type=\"button\" value=\"Fahrt hinzufügen\" id=\"" . $this->prefixId . "plus\" onClick=\"javascript:doPlusKm('" . $this->prefixId . "');\" >";
$ret .= "<input type=\"button\" value=\"Fahrt entfernen\" id=\"" . $this->prefixId . "minus\" onClick=\"javascript:doMinusKm('" . $this->prefixId . "');\" >";
$ret .= "</div>";
$ret .= "</div>";
$ret .= "<!-- end kilometers -->";
return $ret;
}
}
?>