| 1 |
lars |
1 |
{* Smarty *}
|
|
|
2 |
<html>
|
|
|
3 |
<body bgcolor="#bbbbbb" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
|
|
|
4 |
<center>
|
|
|
5 |
<form name=datepick method=get action="index.php" onSubmit="javascript:submitform();">
|
|
|
6 |
<table border=0 cellspacing=0 bgcolor=#d3d3d3>
|
|
|
7 |
<tr bgcolor=#bbbbbb>
|
|
|
8 |
<td nowrap align=center colspan=7>
|
|
|
9 |
<select name=curr_month onChange="javascript:submitform();">
|
|
|
10 |
{html_options values=$month_vals selected=$curr_date|safe_date_format:"%m" output=$month_names}
|
|
|
11 |
</select>
|
|
|
12 |
<input type=text name=curr_year value="{$curr_date|safe_date_format:"%Y"}" size=4
|
|
|
13 |
onBlur="javascript:submitform();">
|
|
|
14 |
<input type=hidden name=date value="">
|
|
|
15 |
</td>
|
|
|
16 |
</tr>
|
|
|
17 |
<tr bgcolor=#d3d3d3>
|
|
|
18 |
<td>
|
|
|
19 |
<TT>Su</TT>
|
|
|
20 |
</td>
|
|
|
21 |
<td>
|
|
|
22 |
<TT>Mo</TT>
|
|
|
23 |
</td>
|
|
|
24 |
<td>
|
|
|
25 |
<TT>Tu</TT>
|
|
|
26 |
</td>
|
|
|
27 |
<td>
|
|
|
28 |
<TT>We</TT>
|
|
|
29 |
</td>
|
|
|
30 |
<td>
|
|
|
31 |
<TT>Th</TT>
|
|
|
32 |
</td>
|
|
|
33 |
<td>
|
|
|
34 |
<TT>Fr</TT>
|
|
|
35 |
</td>
|
|
|
36 |
<td>
|
|
|
37 |
<TT>Sa</TT>
|
|
|
38 |
</td>
|
|
|
39 |
</tr>
|
|
|
40 |
{foreach from=$cal_array item=row}
|
|
|
41 |
<tr bgcolor=#e0e0e0>
|
|
|
42 |
{foreach name=row_loop from=$row item=col}
|
|
|
43 |
{if $curr_date|safe_date_format:"%m" eq $col|safe_date_format:"%m"}
|
|
|
44 |
{assign var="bgcolor" value="#e0e0e0"}
|
|
|
45 |
{else}
|
|
|
46 |
{assign var="bgcolor" value="#bbbbbb"}
|
|
|
47 |
{/if}
|
|
|
48 |
<td bgcolor="{$bgcolor}" valign=top>
|
|
|
49 |
{if $type eq "dropdown"}
|
|
|
50 |
<TT><a href="javascript:populateDate(parseInt('{$col|safe_date_format:"%Y"}'), parseInt('{$col|safe_date_format:"%m"}',10), parseInt('{$col|safe_date_format:"%d"}',10)); window.close();">{$col|safe_date_format:"%d"}</a></TT>
|
|
|
51 |
{else}
|
|
|
52 |
<TT><a href="javascript:window.opener.argDate.value='{$col|safe_date_format:"%Y-%m-%d"}'; window.close();">{$col|safe_date_format:"%d"}</a></TT>
|
|
|
53 |
{/if}
|
|
|
54 |
</td>
|
|
|
55 |
{/foreach}
|
|
|
56 |
</tr>
|
|
|
57 |
{/foreach}
|
|
|
58 |
</table>
|
|
|
59 |
<input type=hidden name=type value="{$type}">
|
|
|
60 |
<input type=hidden name=theme value="{$theme}">
|
|
|
61 |
</form>
|
|
|
62 |
</center>
|
|
|
63 |
</body>
|
|
|
64 |
{literal}
|
|
|
65 |
<script language="javascript">
|
|
|
66 |
<!--
|
|
|
67 |
function submitform() {
|
|
|
68 |
document.datepick.date.value=document.datepick.curr_year.value + '-' + document.datepick.curr_month.options[document.datepick.curr_month.selectedIndex].value + '-01';
|
|
|
69 |
document.datepick.submit();
|
|
|
70 |
}
|
|
|
71 |
// -->
|
|
|
72 |
</script>
|
|
|
73 |
{/literal}
|
|
|
74 |
{if $type eq "dropdown"}
|
|
|
75 |
{literal}
|
|
|
76 |
<script language="javascript">
|
|
|
77 |
<!--
|
|
|
78 |
function populateDate(year, month, day) {
|
|
|
79 |
wo = window.opener;
|
|
|
80 |
selectDropDown(wo.argYear, year);
|
|
|
81 |
selectDropDown(wo.argMonth, month);
|
|
|
82 |
selectDropDown(wo.argDay, day);
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
function selectDropDown(control,value) {
|
|
|
86 |
if(control) {
|
|
|
87 |
for(i=0; i < control.options.length;i++) {
|
|
|
88 |
if(control.options[i].value == value)
|
|
|
89 |
control.selectedIndex = i;
|
|
|
90 |
}
|
|
|
91 |
}
|
|
|
92 |
}
|
|
|
93 |
// -->
|
|
|
94 |
</script>
|
|
|
95 |
{/literal}
|
|
|
96 |
{/if}
|
|
|
97 |
</html>
|