| 12 |
lars |
1 |
<?php
|
|
|
2 |
require("include/common.php");
|
|
|
3 |
$smarty->assign("title","Wochenübersicht");
|
| 13 |
lars |
4 |
$d=intval(isset($_GET["tag"])?$_GET["tag"]:date("d"));
|
|
|
5 |
$m=intval(isset($_GET["monat"])?$_GET["monat"]:date("m"));
|
|
|
6 |
$y=intval(isset($_GET["jahr"])?$_GET["jahr"]:date("Y"));
|
| 12 |
lars |
7 |
$w=new Calendar_Week($y,$m,$d);
|
|
|
8 |
$w->build();
|
|
|
9 |
setLocale(LC_ALL,"de_DE");
|
|
|
10 |
$mode=(isset($_GET["mode"]))?$_GET["mode"]:"";
|
|
|
11 |
$smarty->assign("mode",$mode);
|
|
|
12 |
$Month = new Calendar_Month_Weekdays($y, $m);
|
|
|
13 |
$m_d=new Calendar_Decorator_Textual($Month);
|
|
|
14 |
$u_d=new Calendar_Decorator_Uri($w);
|
|
|
15 |
$u_d->setFragments("jahr", "monat", "tag");
|
|
|
16 |
$nw=$w->nextWeek('array');
|
|
|
17 |
$pw=$w->prevWeek('array');
|
|
|
18 |
$cal="<table>";
|
|
|
19 |
$cal.="<tr><th colspan=8>
|
|
|
20 |
<form action=wochen.php>
|
|
|
21 |
<input type='hidden' name='tag' value='$d'>
|
|
|
22 |
<input type='hidden' name='monat' value='$m'>
|
|
|
23 |
<input type='hidden' name='jahr' value='".$u_d->prevYear()."'>
|
|
|
24 |
<input class='liteoption' type='submit' value='<<<' title='Ein Jahr zurück'>
|
|
|
25 |
</form>
|
|
|
26 |
|
|
|
27 |
<form action=wochen.php>
|
|
|
28 |
<input type='hidden' name='tag' value='$d'>
|
|
|
29 |
<input type='hidden' name='monat' value='".$u_d->prevMonth()."'>
|
|
|
30 |
<input type='hidden' name='jahr' value='".(($m==1)?$u_d->prevYear():$y)."'>
|
|
|
31 |
<input class='liteoption' type='submit' value='<<' title='Einen Monat zurück'>
|
|
|
32 |
</form>
|
|
|
33 |
|
|
|
34 |
<form action=wochen.php>
|
|
|
35 |
<input type='hidden' name='tag' value='".$pw["day"]."'>
|
|
|
36 |
<input type='hidden' name='monat' value='".$pw["month"]."'>
|
|
|
37 |
<input type='hidden' name='jahr' value='".$pw["year"]."'>
|
|
|
38 |
<input class='liteoption' type='submit' value='<' title='Eine Woche zurück'>
|
|
|
39 |
</form>
|
|
|
40 |
|
|
|
41 |
".$m_d->thisMonthName()." ".$y."
|
|
|
42 |
<form action=wochen.php>
|
|
|
43 |
<input type='hidden' name='tag' value='".$nw["day"]."'>
|
|
|
44 |
<input type='hidden' name='monat' value='".$nw["month"]."'>
|
|
|
45 |
<input type='hidden' name='jahr' value='".$nw["year"]."'>
|
|
|
46 |
<input class='liteoption' type='submit' value='>' title='Eine Woche vor'>
|
|
|
47 |
</form>
|
|
|
48 |
|
|
|
49 |
<form action=wochen.php>
|
|
|
50 |
<input type='hidden' name='tag' value='$d'>
|
|
|
51 |
<input type='hidden' name='monat' value='".$u_d->nextMonth()."'>
|
|
|
52 |
<input type='hidden' name='jahr' value='".(($m==12)?$u_d->nextYear():$y)."'>
|
|
|
53 |
<input class='liteoption' type='submit' value='>>' title='Einen Monat vor'>
|
|
|
54 |
</form>
|
|
|
55 |
|
|
|
56 |
<form action=wochen.php>
|
|
|
57 |
<input type='hidden' name='tag' value='$d'>
|
|
|
58 |
<input type='hidden' name='monat' value='$m'>
|
|
|
59 |
<input type='hidden' name='jahr' value='".$u_d->nextYear()."'>
|
|
|
60 |
<input class='liteoption' type='submit' value='>>>' title='Ein Jahr vor'>
|
|
|
61 |
</form>
|
|
|
62 |
|
|
|
63 |
</th></tr>";
|
|
|
64 |
$tage=Calendar_Decorator_Textual::weekdayNames();
|
|
|
65 |
$cal.="<tr><th>KW#</th>";
|
|
|
66 |
$kw=$w->thisWeek('n_in_year');
|
|
|
67 |
for ($tag=1; $tag < 8; $tag++)
|
|
|
68 |
{
|
|
|
69 |
$cal.="<th>".$tage[$tag %7]."</th>";
|
|
|
70 |
}
|
|
|
71 |
$cal.="</tr><tr><td width='10'>$kw</td>";
|
|
|
72 |
while ($Day = $w->fetch())
|
|
|
73 |
{
|
|
|
74 |
if ($Day->isEmpty())
|
|
|
75 |
{
|
|
|
76 |
$cal.="<td> </td>";
|
|
|
77 |
}
|
|
|
78 |
else
|
|
|
79 |
{
|
| 19 |
lars |
80 |
$cal.='<td width="14%" valign="top"><b>'.$Day->thisDay()."</b>";
|
| 12 |
lars |
81 |
$termine=Termin::Liste(date("Y-m-d",mktime(0,0,0,$Day->thisMonth(),$Day->thisDay(),$Day->thisYear())));
|
|
|
82 |
if (is_array($termine))
|
|
|
83 |
{
|
|
|
84 |
foreach ($termine as $termin)
|
|
|
85 |
{
|
| 19 |
lars |
86 |
$cal.="<br>".$termin["an"]." bei <br>" . $termin["firma"]."
|
| 13 |
lars |
87 |
<form action='del.php'>
|
|
|
88 |
<input type='hidden' name='id' value='".$termin["t_id"]."'>
|
|
|
89 |
<input type='image' src='images/topic_delete.gif' ondblclick='javascript:submit(this)'>
|
|
|
90 |
<input type='hidden' name='tag' value='".$Day->thisDay()."'>
|
|
|
91 |
<input type='hidden' name='monat' value='".$Day->thisMonth()."'>
|
|
|
92 |
<input type='hidden' name='jahr' value='".$Day->thisYear()."'>
|
|
|
93 |
</form>
|
|
|
94 |
<br>";
|
| 12 |
lars |
95 |
}
|
|
|
96 |
}
|
|
|
97 |
$cal.="</td>";
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
if ($Day->isLast())
|
|
|
101 |
{
|
|
|
102 |
$cal.="</tr>";
|
|
|
103 |
}
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
$cal.="</table>";
|
|
|
107 |
$smarty->assign("cal",$cal);
|
| 21 |
lars |
108 |
$smarty->display("wochen.tpl");
|
| 12 |
lars |
109 |
?>
|