-
Notifications
You must be signed in to change notification settings - Fork 2
/
kalender_bearbeiten.php
87 lines (80 loc) · 2 KB
/
kalender_bearbeiten.php
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
<?php
include('klassen/schicht.klasse.php');
if($_GET['tag']<10 && substr($_GET['monat'],0,1)!='0')
{
$tag = '0'.$_GET['tag'];
}
else
{
$tag = $_GET['tag'];
}
if($_GET['monat']<10 && substr($_GET['monat'],0,1)!='0')
{
$monat = '0'.$_GET['monat'];
}
else
{
$monat = $_GET['monat'];
}
$jahr = $_GET['jahr'];
$termin = $jahr.'-'.$monat.'-'.$tag;
if(isset($_POST['speichern']))
{
$schicht_termin_neu = new Schicht();
$schicht_termin_neu->schreibe_schicht_termin($_POST, $termin);
}
$schicht_neu = new Schicht();
$schichten_objekt_feld = $schicht_neu->hole_alle_schichten();
$schicht_termin = new Schicht();
if($schicht_termin->hole_alle_schichten_durch_termin($termin))
{
$schichten_termin_objekt_feld = $schicht_termin->hole_alle_schichten_durch_termin($termin);
}
?>
<h1>Schichten hinzuf�gen f�r den: <?php echo $tag.'.'.$monat.'.'.$jahr; ?></h1>
<?php
echo '<form action="index.php?seite=kalender_bearbeiten&tag='.$tag.'&monat='.$monat.'&jahr='.$jahr.'" method="post">';
echo ' <table>';
echo ' <tr>';
echo ' <th> </th>';
echo ' <th>von</th>';
echo ' <th>bis</th>';
echo ' <th>Bezeichnung</th>';
echo ' </tr>';
if(isset($schichten_termin_objekt_feld))
{
foreach($schichten_termin_objekt_feld as $schicht_termin)
{
$schicht_id_feld[] = $schicht_termin->sid;
}
}
else
{
$schicht_id_feld = array();
}
foreach($schichten_objekt_feld as $schicht)
{
echo ' <tr>';
if(in_array($schicht->sid, $schicht_id_feld))
{
echo ' <td><input type="checkbox" name="'.$schicht->sid.'" value="1" checked="checked"></td>';
}
else
{
echo ' <td><input type="checkbox" name="'.$schicht->sid.'" value="0"></td>';
}
echo ' <td>'.$schicht->ab.'</td>';
echo ' <td>'.$schicht->bis.'</td>';
echo ' <td>'.$schicht->bez.'</td>';
echo ' </tr>';
}
echo ' </table>';
?>
<br>
<input class="knopf" name="speichern" type="submit" value="Bestätigen">
</form>
</div>
<br id="abschliessen">
</div>
<div id="fuss">
</div>