PluginProbe
Welcart e-Commerce / 1.3.2
Welcart e-Commerce v1.3.2
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
usc-e-shop / classes / orderList.class.php

orderList.class.php in Welcart e-Commerce 1.3.2, at classes/orderList.class.php

628 lines 22.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class dataList
3 {
4 var $table; //テーブル名
5 var $rows; //データ
6 var $action; //アクション
7 var $startRow; //表示開始行番号
8 var $maxRow; //最大表示行数
9 var $currentPage; //現在のページNo
10 var $firstPage; //最初のページNo
11 var $previousPage; //前のページNo
12 var $nextPage; //次のページNo
13 var $lastPage; //最終ページNo
14 var $naviMaxButton; //ページネーション・ナビのボタンの数
15 var $dataTableNavigation; //ナヴィゲーションhtmlコード
16 var $arr_period; //表示データ期間
17 var $arr_search; //サーチ条件
18 var $searchSql; //簡易絞込みSQL
19 var $searchSwitchStatus; //サーチ表示スイッチ
20 var $columns; //データカラム
21 var $sortColumn; //現在ソート中のフィールド
22 var $sortOldColumn;
23 var $sortSwitchs; //各フィールド毎の昇順降順スイッチ
24 var $userHeaderNames; //ユーザー指定のヘッダ名
25 var $action_status, $action_message;
26 //20101202ysk start
27 var $pageLimit; //ページ制限
28 //20101202ysk end
29 var $management_status; //処理ステータス
30 var $selectSql;
31 var $joinTableSql;
32
33 //Constructor
34 function dataList($tableName, $arr_column)
35 {
36
37 $this->table = $tableName;
38 $this->columns = $arr_column;
39 $this->rows = array();
40
41 $this->maxRow = 30;
42 $this->naviMaxButton = 11;
43 $this->firstPage = 1;
44 $this->action_status = 'none';
45 $this->action_message = '';
46 //20101202ysk start
47 $this->pageLimit = 'on';
48 //20101202ysk end
49 $this->selectSql = '';
50 $this->joinTableSql = '';
51
52 $this->SetParamByQuery();
53
54 $this->arr_period = array(__('This month', 'usces'), __('Last month', 'usces'), __('The past one week', 'usces'), __('Last 30 days', 'usces'), __('Last 90days', 'usces'), __('All', 'usces'));
55
56 $management_status = array(
57 'duringorder' => __('temporaly out of stock', 'usces'),
58 'cancel' => __('Cancel', 'usces'),
59 'completion' => __('It has sent it out.', 'usces'),
60 'estimate' => __('An estimate', 'usces'),
61 'adminorder' => __('Management of Note', 'usces'),
62 'continuation' => __('Continuation', 'usces'),
63 'termination' => __('Termination', 'usces')
64 );
65 $this->management_status = apply_filters( 'usces_filter_management_status', $management_status, $this );
66
67 $this->SetSelects();
68 $this->SetJoinTables();
69 }
70
71 function SetSelects()
72 {
73 $status_sql = '';
74 foreach( $this->management_status as $status_key => $status_name ) {
75 $status_sql .= " WHEN LOCATE('".$status_key."', order_status) > 0 THEN '".$status_name."'";
76 }
77
78 $select = array(
79 "ID",
80 "meta.meta_value AS deco_id",
81 "DATE_FORMAT(order_date, '%Y-%m-%d %H:%i') AS date",
82 "mem_id",
83 "CONCAT(order_name1, ' ', order_name2) AS name",
84 "order_pref AS pref",
85 "order_delivery_method AS delivery_method",
86 "(order_item_total_price - order_usedpoint + order_discount + order_shipping_charge + order_cod_fee + order_tax) AS total_price",
87 "order_payment_name AS payment_name",
88 "CASE WHEN LOCATE('noreceipt', order_status) > 0 THEN '".__('unpaid', 'usces')."'
89 WHEN LOCATE('receipted', order_status) > 0 THEN '".__('payment confirmed', 'usces')."'
90 WHEN LOCATE('pending', order_status) > 0 THEN '".__('Pending', 'usces')."'
91 ELSE '&nbsp;'
92 END AS receipt_status",
93 "CASE {$status_sql}
94 ELSE '".__('new order', 'usces')."'
95 END AS order_status",
96 "order_modified"
97 );
98 $this->selectSql = apply_filters( 'usces_filter_order_list_sql_select', $select, $status_sql, $this );
99 }
100
101 function SetJoinTables()
102 {
103 global $wpdb;
104 $meta_table = $wpdb->prefix.'usces_order_meta';
105 $join_table = array(
106 "LEFT JOIN {$meta_table} AS meta ON ID = meta.order_id AND meta.meta_key = 'dec_order_id'"
107 );
108 $this->joinTableSql = apply_filters( 'usces_filter_order_list_sql_jointable', $join_table, $meta_table, $this );
109 }
110
111 function MakeTable()
112 {
113
114 $this->SetParam();
115
116 switch ($this->action){
117
118 case 'searchIn':
119 $this->SearchIn();
120 //$this->SetSelectedRow();
121 $res = $this->GetRows();
122 break;
123
124 case 'searchOut':
125 $this->SearchOut();
126 //$this->SetSelectedRow();
127 $res = $this->GetRows();
128 break;
129
130 case 'changeSort':
131 $res = $this->GetRows();
132 break;
133
134 case 'changePage':
135 $res = $this->GetRows();
136 break;
137
138 case 'collective_order_reciept':
139 usces_all_change_order_reciept($this);
140 $res = $this->GetRows();
141 break;
142
143 case 'collective_order_status':
144 usces_all_change_order_status($this);
145 $res = $this->GetRows();
146 break;
147
148 case 'collective_delete':
149 usces_all_delete_order_data($this);
150 $this->SetTotalRow();
151 $res = $this->GetRows();
152 break;
153
154 case 'refresh':
155 default:
156 $this->SetDefaultParam();
157 $res = $this->GetRows();
158 break;
159 }
160
161 $this->SetNavi();
162 $this->SetHeaders();
163 $this->SetSESSION();
164
165 if($res){
166
167 return TRUE;
168
169 }else{
170 return FALSE;
171 }
172 }
173
174 //DefaultParam
175 function SetDefaultParam()
176 {
177 unset($_SESSION[$this->table]);
178 $this->startRow = 0;
179 $this->currentPage = 1;
180 if(isset($_SESSION[$this->table]['arr_search'])){
181 $this->arr_search = $_SESSION[$this->table]['arr_search'];
182 }else{
183 $this->arr_search = array('period'=>'3', 'column'=>'', 'word'=>'');
184 }
185 if(isset($_SESSION[$this->table]['searchSwitchStatus'])){
186 $this->searchSwitchStatus = $_SESSION[$this->table]['searchSwitchStatus'];
187 }else{
188 $this->searchSwitchStatus = 'OFF';
189 }
190 $this->searchSql = '';
191 $this->sortColumn = 'ID';
192 foreach($this->columns as $value ){
193 $this->sortSwitchs[$value] = 'DESC';
194 }
195
196
197 $this->SetTotalRow();
198 //$this->SetSelectedRow();
199
200 }
201
202 function SetParam()
203 {
204 $this->startRow = ($this->currentPage-1) * $this->maxRow;
205 }
206
207 function SetParamByQuery()
208 {
209
210 if(isset($_REQUEST['changePage'])){
211
212 $this->action = 'changePage';
213 $this->currentPage = $_REQUEST['changePage'];
214
215 $this->sortColumn = $_SESSION[$this->table]['sortColumn'];
216 $this->sortSwitchs = $_SESSION[$this->table]['sortSwitchs'];
217 $this->userHeaderNames = $_SESSION[$this->table]['userHeaderNames'];
218 $this->searchSwitchStatus = $_SESSION[$this->table]['searchSwitchStatus'];
219 $this->searchSql = $_SESSION[$this->table]['searchSql'];
220 $this->arr_search = $_SESSION[$this->table]['arr_search'];
221 $this->totalRow = $_SESSION[$this->table]['totalRow'];
222 $this->selectedRow = $_SESSION[$this->table]['selectedRow'];
223
224 }else if(isset($_REQUEST['changeSort'])){
225
226 $this->action = 'changeSort';
227 $this->sortOldColumn = $this->sortColumn;
228 $this->sortColumn = $_REQUEST['changeSort'];
229 $this->sortSwitchs = $_SESSION[$this->table]['sortSwitchs'];
230 $this->sortSwitchs[$this->sortColumn] = $_REQUEST['switch'];
231
232 $this->currentPage = $_SESSION[$this->table]['currentPage'];
233 $this->userHeaderNames = $_SESSION[$this->table]['userHeaderNames'];
234 $this->searchSql = $_SESSION[$this->table]['searchSql'];
235 $this->arr_search = $_SESSION[$this->table]['arr_search'];
236 $this->searchSwitchStatus = $_SESSION[$this->table]['searchSwitchStatus'];
237 $this->totalRow = $_SESSION[$this->table]['totalRow'];
238 $this->selectedRow = $_SESSION[$this->table]['selectedRow'];
239
240 } else if(isset($_REQUEST['searchIn'])){
241
242 $this->action = 'searchIn';
243 $this->arr_search['column'] = isset($_REQUEST['search']['column']) ? $_REQUEST['search']['column'] : '';
244 $this->arr_search['word'] = isset($_REQUEST['search']['word']) ? $_REQUEST['search']['word'] : '';
245 $this->arr_search['period'] = isset($_REQUEST['search']['period']) ? (int)$_REQUEST['search']['period'] : 0;
246 $this->searchSwitchStatus = isset($_REQUEST['searchSwitchStatus']) ? $_REQUEST['searchSwitchStatus'] : '';
247
248 $this->currentPage = 1;
249 $this->sortColumn = $_SESSION[$this->table]['sortColumn'];
250 $this->sortSwitchs = $_SESSION[$this->table]['sortSwitchs'];
251 $this->userHeaderNames = $_SESSION[$this->table]['userHeaderNames'];
252 $this->totalRow = $_SESSION[$this->table]['totalRow'];
253
254 }else if(isset($_REQUEST['searchOut'])){
255
256 $this->action = 'searchOut';
257 $this->arr_search['column'] = '';
258 $this->arr_search['word'] = '';
259 $this->arr_search['period'] = $_SESSION[$this->table]['arr_search']['period'];
260 $this->searchSwitchStatus = isset($_REQUEST['searchSwitchStatus']) ? $_REQUEST['searchSwitchStatus'] : '';
261
262 $this->currentPage = 1;
263 $this->sortColumn = $_SESSION[$this->table]['sortColumn'];
264 $this->sortSwitchs = $_SESSION[$this->table]['sortSwitchs'];
265 $this->userHeaderNames = $_SESSION[$this->table]['userHeaderNames'];
266 $this->totalRow = $_SESSION[$this->table]['totalRow'];
267
268 }else if(isset($_REQUEST['refresh'])){
269
270 $this->action = 'refresh';
271
272 $this->currentPage = $_SESSION[$this->table]['currentPage'];
273 $this->sortColumn = $_SESSION[$this->table]['sortColumn'];
274 $this->sortSwitchs = $_SESSION[$this->table]['sortSwitchs'];
275 $this->userHeaderNames = $_SESSION[$this->table]['userHeaderNames'];
276 $this->searchSql = $_SESSION[$this->table]['searchSql'];
277 $this->arr_search = $_SESSION[$this->table]['arr_search'];
278 $this->searchSwitchStatus = $_SESSION[$this->table]['searchSwitchStatus'];
279 $this->totalRow = $_SESSION[$this->table]['totalRow'];
280 $this->selectedRow = $_SESSION[$this->table]['selectedRow'];
281
282 }else if(isset($_REQUEST['collective'])){
283
284 $this->action = 'collective_' . $_POST['allchange']['column'];
285 $this->currentPage = $_SESSION[$this->table]['currentPage'];
286 $this->sortColumn = $_SESSION[$this->table]['sortColumn'];
287 $this->sortSwitchs = $_SESSION[$this->table]['sortSwitchs'];
288 $this->userHeaderNames = $_SESSION[$this->table]['userHeaderNames'];
289 $this->searchSql = $_SESSION[$this->table]['searchSql'];
290 $this->arr_search = $_SESSION[$this->table]['arr_search'];
291 $this->searchSwitchStatus = $_SESSION[$this->table]['searchSwitchStatus'];
292 $this->totalRow = $_SESSION[$this->table]['totalRow'];
293 $this->selectedRow = $_SESSION[$this->table]['selectedRow'];
294
295 }else{
296
297 $this->action = 'default';
298 }
299 }
300
301 //GetRows
302 function GetRows()
303 {
304 global $wpdb;
305 //$meta_table = $wpdb->prefix . 'usces_order_meta';
306 $where = $this->GetWhere();
307 $order = ' ORDER BY `' . $this->sortColumn . '` ' . $this->sortSwitchs[$this->sortColumn];
308 //$limit = ' LIMIT ' . $this->startRow . ', ' . $this->maxRow;
309
310 /* $status_sql = '';
311 foreach ($this->management_status as $status_key => $status_name){
312 $status_sql .= " WHEN LOCATE('" . $status_key . "', order_status) > 0 THEN '" . $status_name . "'";
313 }
314
315 $query = $wpdb->prepare("SELECT ID, meta.meta_value AS deco_id, DATE_FORMAT(order_date, %s) AS date, mem_id,
316 CONCAT(order_name1, ' ', order_name2) AS name, order_pref AS pref, order_delivery_method AS delivery_method,
317 (order_item_total_price - order_usedpoint + order_discount + order_shipping_charge + order_cod_fee + order_tax) AS total_price,
318 order_payment_name AS payment_name,
319 CASE WHEN LOCATE('noreceipt', order_status) > 0 THEN %s
320 WHEN LOCATE('receipted', order_status) > 0 THEN %s
321 WHEN LOCATE('pending', order_status) > 0 THEN %s
322 ELSE %s
323 END AS receipt_status,
324 CASE {$status_sql}
325 ELSE %s
326 END AS order_status,
327 order_modified
328 FROM {$this->table}
329 LEFT JOIN {$meta_table} AS meta ON ID = meta.order_id AND meta.meta_key = 'dec_order_id' ",
330 '%Y-%m-%d %H:%i', __('unpaid', 'usces'), __('payment confirmed', 'usces'), __('Pending', 'usces'), '&nbsp;', __('new order', 'usces'));
331
332 $query .= $where . $order;// . $limit;
333 */
334 $select = '';
335 foreach( $this->selectSql as $value ) {
336 $select .= $value.", ";
337 }
338 $select = rtrim( $select, ", " );
339 $join_table = '';
340 foreach( $this->joinTableSql as $value ) {
341 $join_table .= $value." ";
342 }
343 $query = "SELECT ".$select." FROM {$this->table} ".$join_table.$where.$order;
344 $query = apply_filters( 'usces_filter_order_list_get_rows', $query, $this);
345 //var_dump($query);
346 $wpdb->show_errors();
347
348 $rows = $wpdb->get_results($query, ARRAY_A);
349 $this->selectedRow = count($rows);
350 //20101202ysk start
351 if($this->pageLimit == 'off') {
352 $this->rows = (array)$rows;
353 } else {
354 //20101202ysk end
355 $this->rows = array_slice((array)$rows, $this->startRow, $this->maxRow);
356 //20101202ysk start
357 }
358 //20101202ysk end
359
360 return $this->rows;
361 }
362
363 function SetTotalRow()
364 {
365 global $wpdb;
366 $query = "SELECT COUNT(ID) AS ct FROM {$this->table}".apply_filters( 'usces_filter_order_list_sql_where', '' );
367 $query = apply_filters( 'usces_filter_order_list_set_total_row', $query, $this);
368 $res = $wpdb->get_var($query);
369 $this->totalRow = $res;
370 }
371
372 /* function SetSelectedRow()
373 {
374 global $wpdb;
375 $where = $this->GetWhere();
376 $query = $wpdb->prepare("SELECT ID, DATE_FORMAT(order_date, %s) AS date, mem_id,
377 CONCAT(order_name1, ' ', order_name2) AS name, order_pref AS pref, order_delivery_method AS delivery_method,
378 (order_item_total_price - order_usedpoint + order_discount + order_shipping_charge + order_cod_fee + order_tax) AS total_price,
379 order_payment_name AS payment_name,
380 CASE WHEN LOCATE('noreceipt', order_status) > 0 THEN %s
381 WHEN LOCATE('receipted', order_status) > 0 THEN %s
382 ELSE %s
383 END AS receipt_status,
384 CASE WHEN LOCATE('estimate', order_status) > 0 THEN %s
385 WHEN LOCATE('adminorder', order_status) > 0 THEN %s
386 WHEN LOCATE('duringorder', order_status) > 0 THEN %s
387 WHEN LOCATE('cancel', order_status) > 0 THEN %s
388 WHEN LOCATE('completion', order_status) > 0 THEN %s
389 ELSE %s
390 END AS order_status,
391 order_modified
392 FROM {$this->table}",
393 '%Y-%m-%d %H:%i', '未', '済', '&nbsp;', '見積り', '管理受注', '取り寄せ中', 'キャンセル', '発送済', '新規受付');
394
395 $query .= $where;
396 $rows = $wpdb->get_results($query, ARRAY_A);
397 $this->selectedRow = count($rows);
398
399 }*/
400
401 function GetWhere()
402 {
403 $str = '';
404 $thismonth = date('Y-m-01 00:00:00');
405 $lastmonth = date('Y-m-01 00:00:00', mktime(0, 0, 0, date('m')-1, 1, date('Y')));
406 $lastweek = date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d')-7, date('Y')));
407 $last30 = date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d')-30, date('Y')));
408 $last90 = date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d')-90, date('Y')));
409 switch ( $this->arr_search['period'] ) {
410 case 0:
411 $str = " WHERE order_date >= '{$thismonth}'";
412 break;
413 case 1:
414 $str = " WHERE order_date >= '{$lastmonth}' AND order_date < '{$thismonth}'";
415 break;
416 case 2:
417 $str = " WHERE order_date >= '{$lastweek}'";
418 break;
419 case 3:
420 $str = " WHERE order_date >= '{$last30}'";
421 break;
422 case 4:
423 $str = " WHERE order_date >= '{$last90}'";
424 break;
425 case 5:
426 $str = "";
427 break;
428 }
429 $str = apply_filters( 'usces_filter_order_list_sql_where', $str );
430 if( WCUtils::is_blank($str) && !WCUtils::is_blank($this->searchSql) ){
431 $str = ' HAVING ' . $this->searchSql;
432 }else if($str != '' && $this->searchSql != ''){
433 $str .= ' HAVING ' . $this->searchSql;
434 }
435 return apply_filters( 'usces_filter_order_list_get_where', $str, $this );
436 }
437
438 function SearchIn()
439 {
440 switch ($this->arr_search['column']) {
441 case 'ID':
442 $column = 'ID';
443 $this->searchSql = $column . ' = ' . (int)$this->arr_search['word']['ID'];
444 break;
445 case 'deco_id':
446 $column = 'deco_id';
447 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['deco_id']) . "%'";
448 break;
449 case 'date':
450 $column = 'date';
451 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['date']) . "%'";
452 break;
453 case 'mem_id':
454 $column = 'mem_id';
455 $this->searchSql = $column . ' = ' . (int)$this->arr_search['word']['mem_id'];
456 break;
457 case 'name':
458 $column = 'name';
459 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['name']) . "%'";
460 break;
461 case 'order_modified':
462 $column = 'order_modified';
463 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['order_modified']) . "%'";
464 break;
465 case 'pref':
466 $column = 'pref';
467 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['pref']) . "'";
468 break;
469 case 'delivery_method':
470 $column = 'delivery_method';
471 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['delivery_method']) . "'";
472 break;
473 case 'payment_name':
474 $column = 'payment_name';
475 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['payment_name']) . "'";
476 break;
477 case 'receipt_status':
478 $column = 'receipt_status';
479 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['receipt_status']) . "'";
480 break;
481 case 'order_status':
482 $column = 'order_status';
483 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['order_status']) . "'";
484 break;
485 }
486 }
487
488 function SearchOut()
489 {
490 $this->searchSql = '';
491 }
492
493 function SetNavi()
494 {
495
496 $this->lastPage = ceil($this->selectedRow / $this->maxRow);
497 $this->previousPage = ($this->currentPage - 1 == 0) ? 1 : $this->currentPage - 1;
498 $this->nextPage = ($this->currentPage + 1 > $this->lastPage) ? $this->lastPage : $this->currentPage + 1;
499
500 for($i=0; $i<$this->naviMaxButton; $i++){
501 if($i > $this->lastPage-1) break;
502 if($this->lastPage <= $this->naviMaxButton) {
503 $box[] = $i+1;
504 }else{
505 if($this->currentPage <= 6) {
506 $label = $i + 1;
507 $box[] = $label;
508 }else{
509 $label = $i + 1 + $this->currentPage - 6;
510 $box[] = $label;
511 if($label == $this->lastPage) break;
512 }
513 }
514 }
515
516 $html = '';
517 $html .= '<ul class="clearfix">'."\n";
518 $html .= '<li class="rowsnum">' . $this->selectedRow . ' / ' . $this->totalRow . ' ' . __('cases', 'usces') . '</li>' . "\n";
519 if(($this->currentPage == 1) || ($this->selectedRow == 0)){
520 $html .= '<li class="navigationStr">first&lt;&lt;</li>' . "\n";
521 $html .= '<li class="navigationStr">prev&lt;</li>'."\n";
522 }else{
523 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=1">first&lt;&lt;</a></li>' . "\n";
524 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $this->previousPage . '">prev&lt;</a></li>'."\n";
525 }
526 if($this->selectedRow > 0) {
527 for($i=0; $i<count($box); $i++){
528 if($box[$i] == $this->currentPage){
529 $html .= '<li class="navigationButtonSelected">' . $box[$i] . '</li>'."\n";
530 }else{
531 $html .= '<li class="navigationButton"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $box[$i] . '">' . $box[$i] . '</a></li>'."\n";
532 }
533 }
534 }
535 if(($this->currentPage == $this->lastPage) || ($this->selectedRow == 0)){
536 $html .= '<li class="navigationStr">&gt;next</li>'."\n";
537 $html .= '<li class="navigationStr">&gt;&gt;last</li>'."\n";
538 }else{
539 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $this->nextPage . '">&gt;next</a></li>'."\n";
540 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $this->lastPage . '">&gt;&gt;last</a></li>'."\n";
541 }
542 if($this->searchSwitchStatus == 'OFF'){
543 $html .= '<li class="rowsnum"><a style="cursor:pointer;" id="searchVisiLink" onclick="toggleVisibility(\'searchBox\');">' . __('Show the Operation field', 'usces') . '</a>'."\n";
544 }else{
545 $html .= '<li class="rowsnum"><a style="cursor:pointer;" id="searchVisiLink" onclick="toggleVisibility(\'searchBox\');">' . __('hide the Operation field', 'usces') . '</a>'."\n";
546 }
547
548 $html .= '<li class="refresh"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&refresh">' . __('updates it to latest information', 'usces') . '</a></li>' . "\n";
549 $html .= '</ul>'."\n";
550
551 $this->dataTableNavigation = $html;
552 }
553
554 function SetSESSION()
555 {
556
557 $_SESSION[$this->table]['startRow'] = $this->startRow; //表示開始行番号
558 $_SESSION[$this->table]['sortColumn'] = $this->sortColumn; //現在ソート中のフィールド
559 $_SESSION[$this->table]['totalRow'] = $this->totalRow; //�
560 �行数
561 $_SESSION[$this->table]['selectedRow'] = $this->selectedRow; //絞り込まれた行数
562 $_SESSION[$this->table]['currentPage'] = $this->currentPage; //現在のページNo
563 $_SESSION[$this->table]['previousPage'] = $this->previousPage; //前のページNo
564 $_SESSION[$this->table]['nextPage'] = $this->nextPage; //次のページNo
565 $_SESSION[$this->table]['lastPage'] = $this->lastPage; //最終ページNo
566 $_SESSION[$this->table]['userHeaderNames'] = $this->userHeaderNames;//�
567 �てのフィールド
568 $_SESSION[$this->table]['headers'] = $this->headers;//表示するヘッダ文字列
569 $_SESSION[$this->table]['rows'] = $this->rows; //表示する行オブジェクト
570 $_SESSION[$this->table]['sortSwitchs'] = $this->sortSwitchs; //各フィールド毎の昇順降順スイッチ
571 $_SESSION[$this->table]['dataTableNavigation'] = $this->dataTableNavigation;
572 $_SESSION[$this->table]['searchSql'] = $this->searchSql;
573 $_SESSION[$this->table]['arr_search'] = $this->arr_search;
574 $_SESSION[$this->table]['searchSwitchStatus'] = $this->searchSwitchStatus;
575 }
576
577 function SetHeaders()
578 {
579 foreach ($this->columns as $key => $value){
580 if($value == $this->sortColumn){
581 if($this->sortSwitchs[$value] == 'ASC'){
582 $str = __('[ASC]', 'usces');
583 $switch = 'DESC';
584 }else{
585 $str = __('[DESC]', 'usces');
586 $switch = 'ASC';
587 }
588 $this->headers[$value] = '<a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changeSort=' . $value . '&switch=' . $switch . '"><span class="sortcolumn">' . $key . ' ' . $str . '</span></a>';
589 }else{
590 $switch = $this->sortSwitchs[$value];
591 $this->headers[$value] = '<a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changeSort=' . $value . '&switch=' . $switch . '"><span>' . $key . '</span></a>';
592 }
593 }
594 //$this->headers = array_keys($this->columns);
595 }
596
597 function GetSearchs()
598 {
599 return $this->arr_search;
600 }
601
602 function GetListheaders()
603 {
604 return $this->headers;
605 }
606
607 function GetDataTableNavigation()
608 {
609 return $this->dataTableNavigation;
610 }
611
612 function set_action_status($status, $message)
613 {
614 $this->action_status = $status;
615 $this->action_message = $message;
616 }
617 function get_action_status()
618 {
619 return $this->action_status;
620 }
621 function get_action_message()
622 {
623 return $this->action_message;
624 }
625 }
626
627
628 ?>