
{if $subaction != 'print'}
{$BACKLINK}
<form action="{$smarty.server.SCRIPT_NAME}" method="get">
<input type="hidden" value="{$action}" name="action">
{else}
<body onLoad="window.print();">
	{assign var="print" value="1"}
{/if}


<table border="0" cellpadding="3" cellspacing="0"><tr><td align="center">

<br />

{if $print == 1}
<table cellpadding="1" cellspacing="1" class="printtable">
{else}
<table style="background-color: #007AC2; border:none"  cellpadding="1" cellspacing="1">
{/if}

{if $print == 1}
<tr class="dataTableHeadingRow">
    <th style="font-size:10pt;" colspan="7">
                {foreach from=$cal_months item=cal_month}
                    {if ($month->month+1) == $cal_month.id}
                         {$cal_month.name}
		    {/if}
                {/foreach}
		{$month->year}
    </th>
</tr>
{else}
<tr class="dataTableHeadingRow">
    <th style="color: #FFFFFF; font-size:10pt;" colspan="7">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td class="quote"><b>&nbsp;<a href="{$smarty.server.SCRIPT_NAME}?month={$month->month+1}&amp;year={$month->year}&amp;calaction=-1&amp;action={$action}" class="gen">&laquo;</a>&nbsp;</b></td>
            <td align="center">
                <select name="month" onchange="submit()" class="dbforminput">
                {foreach from=$cal_months item=cal_month}
                    <option value="{$cal_month.id}" {if ($month->month+1) == $cal_month.id}selected="selected"{/if}>
                        {$cal_month.name}
                    </option>
                {/foreach}
                </select>
                <select name="year" onchange="submit()" class="dbforminput">
                {foreach from=$cal_years item=cal_year}
                    <option value="{$cal_year}" {if $month->year == $cal_year}selected="selected"{/if}>{$cal_year}</option>
                {/foreach}
                </select>
            </td>
            <td class="quote"><b>&nbsp;<a href="{$smarty.server.SCRIPT_NAME}?month={$month->month+1}&amp;year={$month->year}&amp;calaction=+1&amp;action={$action}" class="gen">&raquo;</a>&nbsp;</b></td>
            <td align="right">&nbsp;<!--<a href="#" onClick="window.open('{$BASE_FILENAME}?action=calendar&subaction=print&calaction={$urlencode_calaction}&month={$get_month}&year={$get_year}','popup','width={$EXT_POPUP_WIDTH},height={$EXT_POPUP_HEIGHT},scrollbars=yes,resizable=yes');"><u>Druckansicht</u></a>//--></td>
        </tr>
    </table>
    </th>
</tr>
{/if}
<tr class="day_name">
    <th>{$DAY1}</th>
    <th>{$DAY2}</th>
    <th>{$DAY3}</th>
    <th>{$DAY4}</th>
    <th>{$DAY5}</th>
    <th>{$DAY6}</th>
    <th>{$DAY7}</th>
</tr>
{foreach from=$month->weeks item=week}
<tr class="week">
    {foreach from=$week item=day}
        {if $month->days.$day->is_today()}
        <td class="today_date_box">
        {elseif ($month->days.$day->is_weekend())}
        <td class="weekend_box">
        {elseif ($month->days.$day->month != $month->get_month())}
        <td class="dark_date_box">
        {else}
        <td class="date_box">
        {/if}
            <table width="100%" border="0" cellpadding="0" cellspacing="0"{if ($month->days.$day->has_actions() == 1)} bgcolor="#FFFFFF"{/if}>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td align="right">
		    {if ($month->days.$day->month == $month->get_month())}
			{if ($month->days.$day->has_actions() == 1)}
			<a href="{$BASE_FILENAME}?action={$action}&calaction={$urlencode_calaction}&month={$get_month}&year={$get_year}&viewday={$month->days.$day->day}"><img src="images/uhr-button.gif" alt="{$month->days.$day->count_actions()} {$NUM_TERMINE}" title="{$month->days.$day->count_actions()} {$NUM_TERMINE}" border="0"></a>
			{/if}
			<a href="{$BASE_FILENAME}?action={$action}&calaction={$urlencode_calaction}&month={$get_month}&year={$get_year}&viewday={$month->days.$day->day}">
			{if ($month->days.$day->has_actions() == 1)}
			<b>
			{/if}
		    {/if}
                    {$month->days.$day->day}
		    {if ($month->days.$day->month == $month->get_month())}
			{if ($month->days.$day->has_actions() == 1)}
			</b>
			{/if}
			</a>
		    {/if}
		    <br />
                </td>
            </tr>
            </table>
        </td>
    {/foreach}
</tr>
{/foreach}
{if $viewday and $viewday > 0}

	{if $print != 1}
<tr class="dataTableRow">
	<td colspan="7">
	<b>{$TERMINE_AM} {$viewday}. {$AT_MONTH}</b>
	</td>
</tr>
	{/if}
	{foreach from=$month->weeks item=week}
		{foreach from=$week item=day}
		   {if ( ($viewday == $month->days.$day->day and ($month->days.$day->month == $month->get_month() )) or $print == 1 ) }
			
			{if ($month->days.$day->has_actions() == 1) }

				{if $print == 1}
<tr class="dataTableRow">
	<td colspan="7" align="left">
		<b>{$TERMINE_AM} {$month->days.$day->day}.{$month->days.$day->month}.</b>
	</td>
</tr>
				{/if}
<tr>
	<td colspan="7">
		<table border="0" cellspacing="1" cellpadding="0" width="100%">

				{foreach from=$month->days.$day->termine item=termin}
		<tr bgcolor="#FFFFFF">
			<td valign="top" width="50">{$termin.datum}&nbsp;</td>
			<td valign="top" align="left">{$termin.capt}</td>
					{if $print != 1}
			<td valign="top" width="10" align="right"><a href="{$BASE_FILENAME}?action=view&id={$termin.id}" class="lbOn"><img border="0" src="images/icon_arrow_right.gif" alt="{$VIEW_NOTE}" title="{$VIEW_NOTE}"></a></td>
					{/if}
		</tr>
					{if $print == 1}
		<tr>
			<td colspan="2" style="border-top:solid;border-width:thin;border-color:#000000;"><img src="images/pixel_trans.gif" border="0" width="100%" height="1"></td>
		</tr>
					{/if}
				{/foreach}
		
		</table>	
	</td>
</tr>

			{else}
				{if $print != 1}
<tr bgcolor="#FFFFFF">
	<td colspan="7">
	{$NO_SAVED_TERMINE}
	</td>
</tr>
				{/if}
			{/if}
		   
		    {/if}
		{/foreach}
		
	{/foreach}

{/if}
</table>

</td></tr></table>
</form>
</body>
</html>
