PluginProbe
Welcart e-Commerce / 1.4.10
Welcart e-Commerce v1.4.10
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.4.10, at classes/orderList.class.php

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