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

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