stat2.tpl
8.62 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<div>
<a href="/admin.php?action=stat&modAction=stat">Ñòàòèñòèêà 1</a> <br />
<a href="/admin.php?action=stat&modAction=stat2">Ñòàòèñòèêà 2</a>
</div>
<form method="post" action="/admin.php?action=stat&modAction=stat2">
<div style="padding:10px;background:#e8e8e8;float:left;margin:10px 10px 10px 0px;">
<table cellpadding="5" cellspacing="5" border="0">
<tr>
<td>
Ãîä:
</td>
<td>
<select name="y">
<option value="0"></option>
{section name=i loop=$year_ot}
<option value="{$year_ot[i]}" {if $smarty.post.y eq $year_ot[i]}selected{/if}>{$year_ot[i]}</option>
{/section}
</select>
-
<select name="y2">
<option value="0"></option>
{section name=i loop=$year_do}
<option value="{$year_do[i]}" {if $smarty.post.y2 eq $year_do[i]}selected{/if}>{$year_do[i]}</option>
{/section}
</select>
</td>
<td>
Ìåñÿö:
</td>
<td>
<select name="m">
<option value="0"></option>
<option value="1" {if $smarty.post.m eq 1}selected{/if}>ßíâàðü</option>
<option value="2" {if $smarty.post.m eq 2}selected{/if}>Ôåâðàëü</option>
<option value="3" {if $smarty.post.m eq 3}selected{/if}>Ìàðò</option>
<option value="4" {if $smarty.post.m eq 4}selected{/if}>Àïðåëü</option>
<option value="5" {if $smarty.post.m eq 5}selected{/if}>Ìàé</option>
<option value="6" {if $smarty.post.m eq 6}selected{/if}>Èþíü</option>
<option value="7" {if $smarty.post.m eq 7}selected{/if}>Èþëü</option>
<option value="8" {if $smarty.post.m eq 8}selected{/if}>Àâãóñò</option>
<option value="9" {if $smarty.post.m eq 9}selected{/if}>Ñåíòÿáðü</option>
<option value="10" {if $smarty.post.m eq 10}selected{/if}>Îêòÿáðü</option>
<option value="11" {if $smarty.post.m eq 11}selected{/if}>Íîÿáðü</option>
<option value="12" {if $smarty.post.m eq 12}selected{/if}>Äåêàáðü</option>
</select>
-
<select name="m2">
<option value="0"></option>
<option value="1" {if $smarty.post.m2 eq 1}selected{/if}>ßíâàðü</option>
<option value="2" {if $smarty.post.m2 eq 2}selected{/if}>Ôåâðàëü</option>
<option value="3" {if $smarty.post.m2 eq 3}selected{/if}>Ìàðò</option>
<option value="4" {if $smarty.post.m2 eq 4}selected{/if}>Àïðåëü</option>
<option value="5" {if $smarty.post.m2 eq 5}selected{/if}>Ìàé</option>
<option value="6" {if $smarty.post.m2 eq 6}selected{/if}>Èþíü</option>
<option value="7" {if $smarty.post.m2 eq 7}selected{/if}>Èþëü</option>
<option value="8" {if $smarty.post.m2 eq 8}selected{/if}>Àâãóñò</option>
<option value="9" {if $smarty.post.m2 eq 9}selected{/if}>Ñåíòÿáðü</option>
<option value="10" {if $smarty.post.m2 eq 10}selected{/if}>Îêòÿáðü</option>
<option value="11" {if $smarty.post.m2 eq 11}selected{/if}>Íîÿáðü</option>
<option value="12" {if $smarty.post.m2 eq 12}selected{/if}>Äåêàáðü</option>
</select>
</td>
<td>
Íåäåëÿ:
</td>
<td>
<select name="w">
<option value="0"></option>
{section name=i loop=$week_ot}
<option value="{$week_ot[i]}" {if $smarty.post.w eq $week_ot[i]}selected{/if}>{$week_ot[i]}</option>
{/section}
</select>
-
<select name="w2">
<option value="0"></option>
{section name=i loop=$week_do}
<option value="{$week_do[i]}" {if $smarty.post.w2 eq $week_do[i]}selected{/if}>{$week_do[i]}</option>
{/section}
</select>
</td>
</tr>
</table>
</div>
{*
<div style="padding:10px;background:#e8e8e8;float:left;margin:10px 10px 10px 0px;">
<table cellpadding="5" cellspacing="5" border="0">
<tr>
<td>
Äàòà îò:
</td>
<td>
<input class="input_form" value="{$smarty.post.date_ot}" name="date_ot" id="date_ot" style="width: 70px;" type="text">
<img src="{$smarty.const.URL}img/calendar.gif" id="frd_trg" style="cursor: pointer;" title="Date selector">
{literal}
<script type="text/javascript">
Calendar.setup(
{
inputField : "date_ot", // ID of the input field
ifFormat : "%d-%m-%Y", // the date format
button : "frd_trg"
}
);
</script>
{/literal}
</td>
<td>
äàòî äî:
</td>
<td>
<input class="input_form" value="{$smarty.post.date_do}" name="date_do" id="date_do" style="width: 70px;" type="text">
<img src="{$smarty.const.URL}img/calendar.gif" id="frd_trg2" style="cursor: pointer;" title="Date selector">
{literal}
<script type="text/javascript">
Calendar.setup(
{
inputField : "date_do", // ID of the input field
ifFormat : "%d-%m-%Y", // the date format
button : "frd_trg2"
}
);
</script>
{/literal}
</td>
</tr>
</table>
</div>
*}
<div style="clear:both"></div>
<select name="rubrics[]" multiple size=15>
{section name=i loop=$rubrics}
<option value="{$rubrics[i].id}" {if $rubrics[i].parent_id eq 0}disabled{/if} {section name=j loop=$smarty.post.rubrics}{if $smarty.post.rubrics[j] eq $rubrics[i].id}selected{/if}{/section}>{$rubrics[i].name}</option>
{/section}
</select>
<br><br>
<input type="submit" style="width:350px;" value=" Èñêàòü " /><br /><br />
</form>
<table cellpadding="5" cellspacing="1" border="0" bgcolor="#4d4d4d">
<tr bgcolor="#bcedff"><td></td>
{section name=i loop=$orders}
<td nowrap width="300">{$orders[i].date_start} - {$orders[i].date_end}</td>
{/section}
</tr>
{section name=r loop=$orders[0].rubrics}
<tr>
<td bgcolor="#fffac5">{$orders[0].rubrics[r].name}</td>
<td valign="top" bgcolor="#ffffff">
<table cellpadding="5" cellspacing="1" border="0">
<tr bgcolor="#fec9c9"><td width="100">Ìåòêà</td><td width="100">Êîë-âî</td><td width="100">Ñóììà</td></tr>
{section name=m loop=$orders[0].rubrics[r].metka}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td noWrap>{$orders[0].rubrics[r].metka[m].label} - {$orders[0].rubrics[r].metka[m].label|label}</td><td width="100">{$orders[0].rubrics[r].metka[m].count|default:0}</td><td width="200">{$orders[0].rubrics[r].metka[m].sum|default:0}</td></tr>
{/section}
<tr bgcolor="#c2ffc3"><td></td><td><b>{$orders[0].rubrics[r].count}</b></td><td><b>{$orders[0].rubrics[r].sum}</b></td></tr>
<tr bgcolor="#ffd6fb"><td align="center" colspan="3">Îòìåíåí</td></tr>
{section name=m loop=$orders[0].rubrics[r].otmena}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td noWrap>{$orders[0].rubrics[r].otmena[m].cause}</td><td width="100">{$orders[0].rubrics[r].otmena[m].count|default:0}</td><td width="200">{$orders[0].rubrics[r].otmena[m].sum|default:0}</td></tr>
{/section}
</table>
</td>
{section name=i loop=$orders start=1}
{if $orders[i].rubrics[r].name}
<td valign="top" bgcolor="#ffffff">
<table cellpadding="5" cellspacing="1" border="0">
<tr bgcolor="#fec9c9"><td width="100">Êîë-âî</td><td width="200">Ñóììà</td></tr>
{section name=m loop=$orders[i].rubrics[r].metka}
{section name=a loop=$orders[0].rubrics[r].metka}
{if $orders[i].rubrics[r].metka[m].label eq $orders[i.index_prev].rubrics[r].metka[a].label}
{assign var=rcount value=$orders[i].rubrics[r].metka[m].count-$orders[i.index_prev].rubrics[r].metka[a].count}
{assign var=rsum value=$orders[i].rubrics[r].metka[m].sum-$orders[i.index_prev].rubrics[r].metka[a].sum}
{/if}
{/section}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td width="100">{$orders[i].rubrics[r].metka[m].count|default:0} <font color="{if $rcount>-1}#48b073{else}#ff0048{/if}">({$rcount})</font></td><td width="200">{$orders[i].rubrics[r].metka[m].sum|default:0} <font color="{if $rsum>-1}#48b073{else}#ff0048{/if}">({$rsum})</font></td></tr>
{/section}
{assign var=r_count value=$orders[i].rubrics[r].count-$orders[i.index_prev].rubrics[r].count}
{assign var=r_sum value=$orders[i].rubrics[r].sum-$orders[i.index_prev].rubrics[r].sum}
<tr bgcolor="#c2ffc3"><td><b>{$orders[i].rubrics[r].count}</b> <font color="{if $r_count>-1}#48b073{else}#ff0048{/if}">({$r_count})</font></td><td><b>{$orders[i].rubrics[r].sum}</b> <font color="{if $r_sum>-1}#48b073{else}#ff0048{/if}">({$r_sum})</font></td></tr>
<tr bgcolor="#ffd6fb"><td align="center" colspan="2">Îòìåíåí</td></tr>
{section name=m loop=$orders[i].rubrics[r].otmena}
{section name=a loop=$orders[0].rubrics[r].otmena}
{if $orders[i].rubrics[r].otmena[m].cause eq $orders[i.index_prev].rubrics[r].otmena[a].cause}
{assign var=rcount value=$orders[i].rubrics[r].otmena[m].count-$orders[i.index_prev].rubrics[r].otmena[a].count}
{assign var=rsum value=$orders[i].rubrics[r].otmena[m].sum-$orders[i.index_prev].rubrics[r].otmena[a].sum}
{/if}
{/section}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td width="100">{$orders[i].rubrics[r].otmena[m].count|default:0} <font color="{if $rcount>-1}#48b073{else}#ff0048{/if}">({$rcount})</font></td><td width="200">{$orders[i].rubrics[r].otmena[m].sum|default:0} <font color="{if $rsum>-1}#48b073{else}#ff0048{/if}">({$rsum})</font></td></tr>
{/section}
</table>
</td>
{/if}
{/section}
</tr>
{/section}
</table>