Subversion-Projekte lars-tiefland.niewerth

Revision

Revision 25 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
22 lars 1
<?php
2
	require("include/common.php");
3
	$smarty->assign("title","Wochenübersicht - Druckausgabe");
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"));
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');
29 lars 18
	$cal="<table width='75%'>";
22 lars 19
	$cal.="<tr><th colspan=8>".$m_d->thisMonthName()." $y </th></tr>";
20
	$tage=Calendar_Decorator_Textual::weekdayNames();
21
	$cal.="<tr><th>KW#</th>";
22
	$kw=$w->thisWeek('n_in_year');
23
	for ($tag=1; $tag < 8; $tag++)
24
	{
25
		$cal.="<th>".$tage[$tag %7]."</th>";
26
	}
27
	$cal.="</tr><tr><td width='10'>$kw</td>";
28
	while ($Day = $w->fetch())
29
	{
30
			if ($Day->isEmpty())
31
			{
32
				$cal.="<td>&nbsp;</td>";
33
			}
34
			else
35
			{
36
				$cal.='<td width="14%" valign="top"><b>'.$Day->thisDay()."</b>";
37
				$termine=Termin::Liste(date("Y-m-d",mktime(0,0,0,$Day->thisMonth(),$Day->thisDay(),$Day->thisYear())));
38
				if (is_array($termine))
39
				{
40
					foreach ($termine as $termin)
41
					{
42
						$cal.="<br>".$termin["an"]." bei <br>" . $termin["firma"]."
43
						<br>";
44
					}
45
				}
46
				$cal.="</td>";
47
			}
48
 
49
			if ($Day->isLast())
50
			{
51
				$cal.="</tr>";
52
			}
53
		}
54
 
29 lars 55
		$cal.="</table>";
22 lars 56
		$smarty->assign("cal",$cal);
25 lars 57
		$smarty->assign("d",$d);
58
		$smarty->assign("m",$m);
59
		$smarty->assign("y",$y);
22 lars 60
		$smarty->display("print.tpl");
61
?>