1 | <!--{* |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | *}--> |
---|
24 | |
---|
25 | <script type="text/javascript"> |
---|
26 | $(function(){ |
---|
27 | var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat; |
---|
28 | |
---|
29 | <!--{if $arrForm.search_startyear_m.value != '' && $arrForm.search_startmonth_m.value != ''}--> |
---|
30 | var search_startyear_m = '<!--{$arrForm.search_startyear_m.value|h}-->'; |
---|
31 | var search_startmonth_m = '<!--{$arrForm.search_startmonth_m.value|h}-->'; |
---|
32 | var search_start_m_ymd = $.datepicker.formatDate(dateFormat, new Date(search_startyear_m, search_startmonth_m - 1)); |
---|
33 | console.log(search_start_m_ymd); |
---|
34 | $("#datepickersearch_start_m").val(search_start_m_ymd); |
---|
35 | <!--{/if}--> |
---|
36 | |
---|
37 | $( "#datepickersearch_start_m" ).datepicker({ |
---|
38 | beforeShowDay: function(date) { |
---|
39 | if(date.getDay() == 0) { |
---|
40 | return [true,"date-sunday"]; |
---|
41 | } else if(date.getDay() == 6){ |
---|
42 | return [true,"date-saturday"]; |
---|
43 | } else { |
---|
44 | return [true]; |
---|
45 | } |
---|
46 | } |
---|
47 | ,changeYear: 'true' |
---|
48 | ,changeYear: 'true' |
---|
49 | ,onSelect: function(dateText, inst){ |
---|
50 | var year = inst.selectedYear; |
---|
51 | var month = inst.selectedMonth + 1; |
---|
52 | var day = inst.selectedDay; |
---|
53 | setDatesearch_start_m(year + '/' + month); |
---|
54 | }, |
---|
55 | showButtonPanel: true, |
---|
56 | beforeShow: showAdditionalButtonsearch_start_m, |
---|
57 | onChangeMonthYear: showAdditionalButtonsearch_start_m |
---|
58 | }); |
---|
59 | |
---|
60 | $("#datepickersearch_start_m").change( function() { |
---|
61 | var dateText = $(this).val(); |
---|
62 | var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat; |
---|
63 | // console.log(dateText); |
---|
64 | // console.log(dateFormat); |
---|
65 | var date; |
---|
66 | var year = ''; |
---|
67 | var month = ''; |
---|
68 | try { |
---|
69 | date = $.datepicker.parseDate(dateFormat, dateText); |
---|
70 | year = date.getFullYear(); |
---|
71 | month = date.getMonth() + 1; |
---|
72 | day = date.getDay(); |
---|
73 | } catch (e) { |
---|
74 | // console.log(e); |
---|
75 | // clear date text |
---|
76 | $(this).val(''); |
---|
77 | } |
---|
78 | setDatesearch_start_m(year + '/' + month); |
---|
79 | }); |
---|
80 | |
---|
81 | <!--{if $arrForm.search_startyear.value != '' && $arrForm.search_startmonth.value != '' && $arrForm.search_startday.value != ''}--> |
---|
82 | var search_startyear = '<!--{$arrForm.search_startyear.value|h}-->'; |
---|
83 | var search_startmonth = '<!--{$arrForm.search_startmonth.value|h}-->'; |
---|
84 | var search_startday = '<!--{$arrForm.search_startday.value|h}-->'; |
---|
85 | var search_start_ymd = $.datepicker.formatDate(dateFormat, new Date(search_startyear, search_startmonth - 1, search_startday)); |
---|
86 | $("#datepickersearch_start").val(search_start_ymd); |
---|
87 | <!--{/if}--> |
---|
88 | |
---|
89 | $( "#datepickersearch_start" ).datepicker({ |
---|
90 | beforeShowDay: function(date) { |
---|
91 | if(date.getDay() == 0) { |
---|
92 | return [true,"date-sunday"]; |
---|
93 | } else if(date.getDay() == 6){ |
---|
94 | return [true,"date-saturday"]; |
---|
95 | } else { |
---|
96 | return [true]; |
---|
97 | } |
---|
98 | },changeMonth: 'true' |
---|
99 | ,changeYear: 'true' |
---|
100 | ,onSelect: function(dateText, inst){ |
---|
101 | var year = inst.selectedYear; |
---|
102 | var month = inst.selectedMonth + 1; |
---|
103 | var day = inst.selectedDay; |
---|
104 | setDatesearch_start(year + '/' + month + '/' + day); |
---|
105 | }, |
---|
106 | showButtonPanel: true, |
---|
107 | beforeShow: showAdditionalButtonsearch_start, |
---|
108 | onChangeMonthYear: showAdditionalButtonsearch_start |
---|
109 | }); |
---|
110 | |
---|
111 | $("#datepickersearch_start").blur( function() { |
---|
112 | var dateText = $(this).val(); |
---|
113 | var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat; |
---|
114 | // console.log(dateText); |
---|
115 | // console.log(dateFormat); |
---|
116 | var date; |
---|
117 | var year = ''; |
---|
118 | var month = ''; |
---|
119 | var day = ''; |
---|
120 | try { |
---|
121 | date = $.datepicker.parseDate(dateFormat, dateText); |
---|
122 | year = date.getFullYear(); |
---|
123 | month = date.getMonth() + 1; |
---|
124 | day = date.getDay(); |
---|
125 | } catch (e) { |
---|
126 | // console.log(e); |
---|
127 | // clear date text |
---|
128 | $(this).val(''); |
---|
129 | } |
---|
130 | setDatesearch_start(year + '/' + month + '/' + day); |
---|
131 | }); |
---|
132 | |
---|
133 | <!--{if $arrForm.search_endyear.value != '' && $arrForm.search_endmonth.value != '' && $arrForm.search_endday.value != ''}--> |
---|
134 | var search_endyear = '<!--{$arrForm.search_endyear.value|h}-->'; |
---|
135 | var search_endmonth = '<!--{$arrForm.search_endmonth.value|h}-->'; |
---|
136 | var search_endday = '<!--{$arrForm.search_endday.value|h}-->'; |
---|
137 | var search_end_ymd = $.datepicker.formatDate(dateFormat, new Date(search_endyear, search_endmonth - 1, search_endday)); |
---|
138 | $("#datepickersearch_end").val(search_end_ymd); |
---|
139 | <!--{/if}--> |
---|
140 | |
---|
141 | $( "#datepickersearch_end" ).datepicker({ |
---|
142 | beforeShowDay: function(date) { |
---|
143 | if(date.getDay() == 0) { |
---|
144 | return [true,"date-sunday"]; |
---|
145 | } else if(date.getDay() == 6){ |
---|
146 | return [true,"date-saturday"]; |
---|
147 | } else { |
---|
148 | return [true]; |
---|
149 | } |
---|
150 | },changeMonth: 'true' |
---|
151 | ,changeYear: 'true' |
---|
152 | ,onSelect: function(dateText, inst){ |
---|
153 | var year = inst.selectedYear; |
---|
154 | var month = inst.selectedMonth + 1; |
---|
155 | var day = inst.selectedDay; |
---|
156 | setDatesearch_end(year + '/' + month + '/' + day); |
---|
157 | }, |
---|
158 | showButtonPanel: true, |
---|
159 | beforeShow: showAdditionalButtonsearch_end, |
---|
160 | onChangeMonthYear: showAdditionalButtonsearch_end |
---|
161 | }); |
---|
162 | |
---|
163 | $("#datepickersearch_end").blur( function() { |
---|
164 | var dateText = $(this).val(); |
---|
165 | var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat; |
---|
166 | // console.log(dateText); |
---|
167 | // console.log(dateFormat); |
---|
168 | var date; |
---|
169 | var year = ''; |
---|
170 | var month = ''; |
---|
171 | var day = ''; |
---|
172 | try { |
---|
173 | date = $.datepicker.parseDate(dateFormat, dateText); |
---|
174 | year = date.getFullYear(); |
---|
175 | month = date.getMonth() + 1; |
---|
176 | day = date.getDay(); |
---|
177 | } catch (e) { |
---|
178 | // console.log(e); |
---|
179 | // clear date text |
---|
180 | $(this).val(''); |
---|
181 | } |
---|
182 | setDatesearch_end(year + '/' + month + '/' + day); |
---|
183 | }); |
---|
184 | |
---|
185 | }); |
---|
186 | |
---|
187 | var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>'); |
---|
188 | |
---|
189 | var showAdditionalButtonsearch_start_m = function (input) { |
---|
190 | setTimeout(function () { |
---|
191 | var buttonPane = $(input) |
---|
192 | .datepicker("widget") |
---|
193 | .find(".ui-datepicker-buttonpane"); |
---|
194 | btn |
---|
195 | .unbind("click") |
---|
196 | .bind("click", function () { |
---|
197 | $.datepicker._clearDate(input); |
---|
198 | $("*[name=search_startyear_m]").val(""); |
---|
199 | $("*[name=search_startmonth_m]").val(""); |
---|
200 | }); |
---|
201 | btn.appendTo(buttonPane); |
---|
202 | }, 1); |
---|
203 | }; |
---|
204 | |
---|
205 | var showAdditionalButtonsearch_start = function (input) { |
---|
206 | setTimeout(function () { |
---|
207 | var buttonPane = $(input) |
---|
208 | .datepicker("widget") |
---|
209 | .find(".ui-datepicker-buttonpane"); |
---|
210 | btn |
---|
211 | .unbind("click") |
---|
212 | .bind("click", function () { |
---|
213 | $.datepicker._clearDate(input); |
---|
214 | $("*[name=search_startyear]").val(""); |
---|
215 | $("*[name=search_startmonth]").val(""); |
---|
216 | $("*[name=search_startday]").val(""); |
---|
217 | }); |
---|
218 | btn.appendTo(buttonPane); |
---|
219 | }, 1); |
---|
220 | }; |
---|
221 | |
---|
222 | var showAdditionalButtonsearch_end = function (input) { |
---|
223 | setTimeout(function () { |
---|
224 | var buttonPane = $(input) |
---|
225 | .datepicker("widget") |
---|
226 | .find(".ui-datepicker-buttonpane"); |
---|
227 | btn |
---|
228 | .unbind("click") |
---|
229 | .bind("click", function () { |
---|
230 | $.datepicker._clearDate(input); |
---|
231 | $("*[name=search_endyear]").val(""); |
---|
232 | $("*[name=search_endmonth]").val(""); |
---|
233 | $("*[name=search_endday]").val(""); |
---|
234 | }); |
---|
235 | btn.appendTo(buttonPane); |
---|
236 | }, 1); |
---|
237 | }; |
---|
238 | |
---|
239 | function setDatesearch_start_m(dateText){ |
---|
240 | var dates = dateText.split('/'); |
---|
241 | $("*[name=search_startyear_m]").val(dates[0]); |
---|
242 | $("*[name=search_startmonth_m]").val(dates[1]); |
---|
243 | } |
---|
244 | |
---|
245 | function setDatesearch_start(dateText){ |
---|
246 | var dates = dateText.split('/'); |
---|
247 | $("*[name=search_startyear]").val(dates[0]); |
---|
248 | $("*[name=search_startmonth]").val(dates[1]); |
---|
249 | $("*[name=search_startday]").val(dates[2]); |
---|
250 | } |
---|
251 | |
---|
252 | function setDatesearch_end(dateText){ |
---|
253 | var dates = dateText.split('/'); |
---|
254 | $("*[name=search_endyear]").val(dates[0]); |
---|
255 | $("*[name=search_endmonth]").val(dates[1]); |
---|
256 | $("*[name=search_endday]").val(dates[2]); |
---|
257 | } |
---|
258 | |
---|
259 | </script> |
---|
260 | |
---|
261 | <div id="total" class="contents-main"> |
---|
262 | <!--{* 検索条件設定テーブルここから *}--> |
---|
263 | <table summary="Search condition settings" class="input-form form"> |
---|
264 | <tr> |
---|
265 | <th><!--{t string="tpl_687"}--></th> |
---|
266 | <td> |
---|
267 | <form name="search_form1" id="search_form1" method="post" action="?"> |
---|
268 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
269 | <input type="hidden" name="mode" value="search" /> |
---|
270 | <input type="hidden" name="search_form" value="1" /> |
---|
271 | <input type="hidden" name="page" value="<!--{$arrForm.page.value|h}-->" /> |
---|
272 | <input type="hidden" name="type" value="<!--{$smarty.post.type|h}-->" /> |
---|
273 | <!--{if $arrErr.search_startyear_m || $arrErr.search_startmonth_m}--> |
---|
274 | <span class="attention"><!--{$arrErr.search_startyear_m}--></span> |
---|
275 | <span class="attention"><!--{$arrErr.search_startmonth_m}--></span> |
---|
276 | <!--{/if}--> |
---|
277 | <input id="datepickersearch_start_m" type="text" value="" <!--{if $arrErr.search_startyear_m != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> /> |
---|
278 | <!--{if $smarty.const.CLOSE_DAY == 31}--> |
---|
279 | <!--{t string="tpl_802"}--> |
---|
280 | <!--{else}--> |
---|
281 | <!--{t string="tpl_803" T_FIELD=$smarty.const.CLOSE_DAY}--> |
---|
282 | <!--{/if}--> |
---|
283 | <input type="hidden" name="search_startyear_m" value="<!--{$arrForm.search_startyear_m.value|h}-->" /> |
---|
284 | <input type="hidden" name="search_startmonth_m" value="<!--{$arrForm.search_startmonth_m.value|h}-->" /> |
---|
285 | <a class="btn-normal" href="javascript:;" onclick="fnFormModeSubmit('search_form1', 'search', '', ''); return false;" name="subm"><!--{t string="tpl_688"}--></a> |
---|
286 | </form> |
---|
287 | </td> |
---|
288 | </tr> |
---|
289 | <tr> |
---|
290 | <th><!--{t string="tpl_689"}--></th> |
---|
291 | <td> |
---|
292 | <form name="search_form2" id="search_form2" method="post" action="?"> |
---|
293 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
294 | <input type="hidden" name="mode" value="search" /> |
---|
295 | <input type="hidden" name="search_form" value="2" /> |
---|
296 | <input type="hidden" name="page" value="<!--{$arrForm.page.value|h}-->" /> |
---|
297 | <input type="hidden" name="type" value="<!--{$smarty.post.type|h}-->" /> |
---|
298 | <!--{if $arrErr.search_startyear || $arrErr.search_endyear}--> |
---|
299 | <span class="attention"><!--{$arrErr.search_startyear}--></span> |
---|
300 | <span class="attention"><!--{$arrErr.search_endyear}--></span> |
---|
301 | <!--{/if}--> |
---|
302 | <input id="datepickersearch_start" type="text" value="" <!--{if $arrErr.search_startyear != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> /> |
---|
303 | <input type="hidden" name="search_startyear" value="<!--{$arrForm.search_startyear.value|h}-->" /> |
---|
304 | <input type="hidden" name="search_startmonth" value="<!--{$arrForm.search_startmonth.value|h}-->" /> |
---|
305 | <input type="hidden" name="search_startday" value="<!--{$arrForm.search_startday.value|h}-->" /> |
---|
306 | <!--{t string="-"}--> |
---|
307 | <input id="datepickersearch_end" type="text" value="" <!--{if $arrErr.search_endyear != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> /> |
---|
308 | <input type="hidden" name="search_endyear" value="<!--{$arrForm.search_endyear.value|h}-->" /> |
---|
309 | <input type="hidden" name="search_endmonth" value="<!--{$arrForm.search_endmonth.value|h}-->" /> |
---|
310 | <input type="hidden" name="search_endday" value="<!--{$arrForm.search_endday.value|h}-->" /> |
---|
311 | <a class="btn-normal" href="javascript:;" onclick="fnFormModeSubmit('search_form2', 'search', '', ''); return false;" name="subm"><!--{t string="tpl_690"}--></a> |
---|
312 | </form> |
---|
313 | </td> |
---|
314 | </tr> |
---|
315 | </table> |
---|
316 | <!--{* 検索条件設定テーブルここまで *}--> |
---|
317 | |
---|
318 | |
---|
319 | <!--{* 検索結果一覧ここから *}--> |
---|
320 | <!--{if count($arrResults) > 0}--> |
---|
321 | <form name="form1" id="form1" method="post" action="?"> |
---|
322 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
323 | <input type="hidden" name="mode" value="search" /> |
---|
324 | <input type="hidden" name="type" value="<!--{$arrForm.type.value|h}-->" /> |
---|
325 | <input type="hidden" name="page" value="<!--{$arrForm.page.value|h}-->" /> |
---|
326 | <!--{foreach key=key item=item from=$arrHidden}--> |
---|
327 | <input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" /> |
---|
328 | <!--{/foreach}--> |
---|
329 | |
---|
330 | <!--検索結果表示テーブル--> |
---|
331 | <h2><!--{include file=$tpl_graphsubtitle}--></h2> |
---|
332 | |
---|
333 | <div class="btn"> |
---|
334 | <a class="btn-normal" href="javascript:;" onclick="fnModeSubmit('csv','',''); return false;"><span><!--{t string="tpl_254"}--></span></a> |
---|
335 | </div> |
---|
336 | |
---|
337 | <!--{* グラフ表示 *}--> |
---|
338 | <!--{if $install_GD}--> |
---|
339 | <div id="graph-image"> |
---|
340 | <!--{* <img src="<!--{$tpl_image}-->?<!--{$cashtime}-->" alt="Graph"> *}--> |
---|
341 | <img src="?draw_image=true&type=<!--{$smarty.post.type|h}-->&mode=search&search_form=<!--{$smarty.post.search_form|h}-->&page=<!--{$smarty.post.page|h}-->&search_startyear_m=<!--{$smarty.post.search_startyear_m|h}-->&search_startmonth_m=<!--{$smarty.post.search_startmonth_m|h}-->&search_startyear=<!--{$smarty.post.search_startyear|h}-->&search_startmonth=<!--{$smarty.post.search_startmonth|h}-->&search_startday=<!--{$smarty.post.search_startday|h}-->&search_endyear=<!--{$smarty.post.search_endyear|h}-->&search_endmonth=<!--{$smarty.post.search_endmonth|h}-->&search_endday=<!--{$smarty.post.search_endday|h}-->" alt="Graph" /> |
---|
342 | </div> |
---|
343 | <!--{/if}--> |
---|
344 | <!--{* グラフ表示 *}--> |
---|
345 | |
---|
346 | <!--{* ▼検索結果テーブルここから *}--> |
---|
347 | <!--{include file=$tpl_page_type}--> |
---|
348 | <!--{* ▲検索結果テーブルここまで *}--> |
---|
349 | <!--検索結果表示テーブル--> |
---|
350 | </form> |
---|
351 | <!--{else}--> |
---|
352 | <!--{if $smarty.post.mode == 'search'}--> |
---|
353 | <form name="form1" id="form1" method="post" action="?"> |
---|
354 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
355 | <input type="hidden" name="mode" value="search" /> |
---|
356 | <input type="hidden" name="type" value="<!--{$arrForm.type.value|h}-->" /> |
---|
357 | <input type="hidden" name="page" value="<!--{$arrForm.page.value|h}-->" /> |
---|
358 | <!--{foreach key=key item=item from=$arrHidden}--> |
---|
359 | <input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" /> |
---|
360 | <!--{/foreach}--> |
---|
361 | <!--検索結果表示テーブル--> |
---|
362 | <h2><!--{include file=$tpl_graphsubtitle}--></h2> |
---|
363 | <div class="message"> |
---|
364 | <!--{t string="tpl_437"}--> |
---|
365 | </div> |
---|
366 | <!--検索結果表示テーブル--> |
---|
367 | </form> |
---|
368 | <!--{/if}--> |
---|
369 | <!--{/if}--> |
---|
370 | <!--{* 検索結果一覧ここまで *}--> |
---|
371 | </div> |
---|