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

621 lines 23.0 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 //$limit = ' LIMIT ' . $this->startRow . ', ' . $this->maxRow;
301
302 /* $status_sql = '';
303 foreach ($this->management_status as $status_key => $status_name){
304 $status_sql .= " WHEN LOCATE('" . $status_key . "', order_status) > 0 THEN '" . $status_name . "'";
305 }
306
307 $query = $wpdb->prepare("SELECT ID, meta.meta_value AS deco_id, DATE_FORMAT(order_date, %s) AS date, mem_id,
308 CONCAT(order_name1, ' ', order_name2) AS name, order_pref AS pref, order_delivery_method AS delivery_method,
309 (order_item_total_price - order_usedpoint + order_discount + order_shipping_charge + order_cod_fee + order_tax) AS total_price,
310 order_payment_name AS payment_name,
311 CASE WHEN LOCATE('noreceipt', order_status) > 0 THEN %s
312 WHEN LOCATE('receipted', order_status) > 0 THEN %s
313 WHEN LOCATE('pending', order_status) > 0 THEN %s
314 ELSE %s
315 END AS receipt_status,
316 CASE {$status_sql}
317 ELSE %s
318 END AS order_status,
319 order_modified
320 FROM {$this->table}
321 LEFT JOIN {$meta_table} AS meta ON ID = meta.order_id AND meta.meta_key = 'dec_order_id' ",
322 '%Y-%m-%d %H:%i', __('unpaid', 'usces'), __('payment confirmed', 'usces'), __('Pending', 'usces'), '&nbsp;', __('new order', 'usces'));
323
324 $query .= $where . $order;// . $limit;
325 */
326 $select = '';
327 foreach( $this->selectSql as $value ) {
328 $select .= $value.", ";
329 }
330 $select = rtrim( $select, ", " );
331 $join_table = '';
332 foreach( $this->joinTableSql as $value ) {
333 $join_table .= $value." ";
334 }
335 $query = "SELECT ".$select." FROM {$this->table} ".$join_table.$where.$order;
336 $query = apply_filters( 'usces_filter_order_list_get_rows', $query, $this);
337 //var_dump($query);
338 $wpdb->show_errors();
339
340 $rows = $wpdb->get_results($query, ARRAY_A);
341 $this->selectedRow = count($rows);
342 //20101202ysk start
343 if($this->pageLimit == 'off') {
344 $this->rows = (array)$rows;
345 } else {
346 //20101202ysk end
347 $this->rows = array_slice((array)$rows, $this->startRow, $this->maxRow);
348 //20101202ysk start
349 }
350 //20101202ysk end
351
352 return $this->rows;
353 }
354
355 function SetTotalRow()
356 {
357 global $wpdb;
358 $query = "SELECT COUNT(ID) AS ct FROM {$this->table}".apply_filters( 'usces_filter_order_list_sql_where', '', $this );
359 $query = apply_filters( 'usces_filter_order_list_set_total_row', $query, $this);
360 $res = $wpdb->get_var($query);
361 $this->totalRow = $res;
362 }
363
364 /* function SetSelectedRow()
365 {
366 global $wpdb;
367 $where = $this->GetWhere();
368 $query = $wpdb->prepare("SELECT ID, DATE_FORMAT(order_date, %s) AS date, mem_id,
369 CONCAT(order_name1, ' ', order_name2) AS name, order_pref AS pref, order_delivery_method AS delivery_method,
370 (order_item_total_price - order_usedpoint + order_discount + order_shipping_charge + order_cod_fee + order_tax) AS total_price,
371 order_payment_name AS payment_name,
372 CASE WHEN LOCATE('noreceipt', order_status) > 0 THEN %s
373 WHEN LOCATE('receipted', order_status) > 0 THEN %s
374 ELSE %s
375 END AS receipt_status,
376 CASE WHEN LOCATE('estimate', order_status) > 0 THEN %s
377 WHEN LOCATE('adminorder', order_status) > 0 THEN %s
378 WHEN LOCATE('duringorder', order_status) > 0 THEN %s
379 WHEN LOCATE('cancel', order_status) > 0 THEN %s
380 WHEN LOCATE('completion', order_status) > 0 THEN %s
381 ELSE %s
382 END AS order_status,
383 order_modified
384 FROM {$this->table}",
385 '%Y-%m-%d %H:%i', '未', '済', '&nbsp;', '見積り', '管理受注', '取り寄せ中', 'キャンセル', '発送済', '新規受付');
386
387 $query .= $where;
388 $rows = $wpdb->get_results($query, ARRAY_A);
389 $this->selectedRow = count($rows);
390
391 }*/
392
393 function GetWhere()
394 {
395 $str = '';
396 $thismonth = date('Y-m-01 00:00:00');
397 $lastmonth = date('Y-m-01 00:00:00', mktime(0, 0, 0, date('m')-1, 1, date('Y')));
398 $lastweek = date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d')-7, date('Y')));
399 $last30 = date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d')-30, date('Y')));
400 $last90 = date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d')-90, date('Y')));
401 switch ( $this->arr_search['period'] ) {
402 case 0:
403 $str = " WHERE order_date >= '{$thismonth}'";
404 break;
405 case 1:
406 $str = " WHERE order_date >= '{$lastmonth}' AND order_date < '{$thismonth}'";
407 break;
408 case 2:
409 $str = " WHERE order_date >= '{$lastweek}'";
410 break;
411 case 3:
412 $str = " WHERE order_date >= '{$last30}'";
413 break;
414 case 4:
415 $str = " WHERE order_date >= '{$last90}'";
416 break;
417 case 5:
418 $str = "";
419 break;
420 }
421 $str = apply_filters( 'usces_filter_order_list_sql_where', $str, $this );
422 if( WCUtils::is_blank($str) && !WCUtils::is_blank($this->searchSql) ){
423 $str = ' HAVING ' . $this->searchSql;
424 }else if($str != '' && $this->searchSql != ''){
425 $str .= ' HAVING ' . $this->searchSql;
426 }
427 return apply_filters( 'usces_filter_order_list_get_where', $str, $this );
428 }
429
430 function SearchIn()
431 {
432 switch ($this->arr_search['column']) {
433 case 'ID':
434 $column = 'ID';
435 $this->searchSql = $column . ' = ' . (int)$this->arr_search['word']['ID'];
436 break;
437 case 'deco_id':
438 $column = 'deco_id';
439 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['deco_id']) . "%'";
440 break;
441 case 'date':
442 $column = 'date';
443 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['date']) . "%'";
444 break;
445 case 'mem_id':
446 $column = 'mem_id';
447 $this->searchSql = $column . ' = ' . (int)$this->arr_search['word']['mem_id'];
448 break;
449 case 'name':
450 $column = 'name';
451 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['name']) . "%'";
452 break;
453 case 'order_modified':
454 $column = 'order_modified';
455 $this->searchSql = $column . ' LIKE '."'%" . mysql_real_escape_string($this->arr_search['word']['order_modified']) . "%'";
456 break;
457 case 'pref':
458 $column = 'pref';
459 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['pref']) . "'";
460 break;
461 case 'delivery_method':
462 $column = 'delivery_method';
463 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['delivery_method']) . "'";
464 break;
465 case 'payment_name':
466 $column = 'payment_name';
467 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['payment_name']) . "'";
468 break;
469 case 'receipt_status':
470 $column = 'receipt_status';
471 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['receipt_status']) . "'";
472 break;
473 case 'order_status':
474 $column = 'order_status';
475 $this->searchSql = $column . " = '" . mysql_real_escape_string($this->arr_search['word']['order_status']) . "'";
476 break;
477 }
478 }
479
480 function SearchOut()
481 {
482 $this->searchSql = '';
483 }
484
485 function SetNavi()
486 {
487 $this->lastPage = ceil($this->selectedRow / $this->maxRow);
488 $this->previousPage = ($this->currentPage - 1 == 0) ? 1 : $this->currentPage - 1;
489 $this->nextPage = ($this->currentPage + 1 > $this->lastPage) ? $this->lastPage : $this->currentPage + 1;
490
491 for($i=0; $i<$this->naviMaxButton; $i++){
492 if($i > $this->lastPage-1) break;
493 if($this->lastPage <= $this->naviMaxButton) {
494 $box[] = $i+1;
495 }else{
496 if($this->currentPage <= 6) {
497 $label = $i + 1;
498 $box[] = $label;
499 }else{
500 $label = $i + 1 + $this->currentPage - 6;
501 $box[] = $label;
502 if($label == $this->lastPage) break;
503 }
504 }
505 }
506
507 $html = '';
508 $html .= '<ul class="clearfix">'."\n";
509 $html .= '<li class="rowsnum">' . $this->selectedRow . ' / ' . $this->totalRow . ' ' . __('cases', 'usces') . '</li>' . "\n";
510 if(($this->currentPage == 1) || ($this->selectedRow == 0)){
511 $html .= '<li class="navigationStr">first&lt;&lt;</li>' . "\n";
512 $html .= '<li class="navigationStr">prev&lt;</li>'."\n";
513 }else{
514 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=1">first&lt;&lt;</a></li>' . "\n";
515 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $this->previousPage . '">prev&lt;</a></li>'."\n";
516 }
517 if($this->selectedRow > 0) {
518 for($i=0; $i<count($box); $i++){
519 if($box[$i] == $this->currentPage){
520 $html .= '<li class="navigationButtonSelected">' . $box[$i] . '</li>'."\n";
521 }else{
522 $html .= '<li class="navigationButton"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $box[$i] . '">' . $box[$i] . '</a></li>'."\n";
523 }
524 }
525 }
526 if(($this->currentPage == $this->lastPage) || ($this->selectedRow == 0)){
527 $html .= '<li class="navigationStr">&gt;next</li>'."\n";
528 $html .= '<li class="navigationStr">&gt;&gt;last</li>'."\n";
529 }else{
530 $html .= '<li class="navigationStr"><a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changePage=' . $this->nextPage . '">&gt;next</a></li>'."\n";
531 $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";
532 }
533 if($this->searchSwitchStatus == 'OFF'){
534 $html .= '<li class="rowsnum"><a style="cursor:pointer;" id="searchVisiLink" onclick="toggleVisibility(\'searchBox\');">' . __('Show the Operation field', 'usces') . '</a>'."\n";
535 }else{
536 $html .= '<li class="rowsnum"><a style="cursor:pointer;" id="searchVisiLink" onclick="toggleVisibility(\'searchBox\');">' . __('hide the Operation field', 'usces') . '</a>'."\n";
537 }
538
539 $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";
540 $html .= '</ul>'."\n";
541
542 $this->dataTableNavigation = $html;
543 }
544
545 function SetSESSION()
546 {
547 $_SESSION[$this->table]['startRow'] = $this->startRow; //表示開始行番号
548 $_SESSION[$this->table]['sortColumn'] = $this->sortColumn; //現在ソート中のフィールド
549 $_SESSION[$this->table]['totalRow'] = $this->totalRow; //�
550 �行数
551 $_SESSION[$this->table]['selectedRow'] = $this->selectedRow; //絞り込まれた行数
552 $_SESSION[$this->table]['currentPage'] = $this->currentPage; //現在のページNo
553 $_SESSION[$this->table]['previousPage'] = $this->previousPage; //前のページNo
554 $_SESSION[$this->table]['nextPage'] = $this->nextPage; //次のページNo
555 $_SESSION[$this->table]['lastPage'] = $this->lastPage; //最終ページNo
556 $_SESSION[$this->table]['userHeaderNames'] = $this->userHeaderNames;//�
557 �てのフィールド
558 $_SESSION[$this->table]['headers'] = $this->headers;//表示するヘッダ文字列
559 $_SESSION[$this->table]['rows'] = $this->rows; //表示する行オブジェクト
560 $_SESSION[$this->table]['sortSwitchs'] = $this->sortSwitchs; //各フィールド毎の昇順降順スイッチ
561 $_SESSION[$this->table]['dataTableNavigation'] = $this->dataTableNavigation;
562 $_SESSION[$this->table]['searchSql'] = $this->searchSql;
563 $_SESSION[$this->table]['arr_search'] = $this->arr_search;
564 $_SESSION[$this->table]['searchSwitchStatus'] = $this->searchSwitchStatus;
565 do_action( 'usces_action_order_list_set_session', $this );
566 }
567
568 function SetHeaders()
569 {
570 foreach ($this->columns as $key => $value){
571 if($value == $this->sortColumn){
572 if($this->sortSwitchs[$value] == 'ASC'){
573 $str = __('[ASC]', 'usces');
574 $switch = 'DESC';
575 }else{
576 $str = __('[DESC]', 'usces');
577 $switch = 'ASC';
578 }
579 $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>';
580 }else{
581 $switch = $this->sortSwitchs[$value];
582 $this->headers[$value] = '<a href="' . get_option('siteurl') . '/wp-admin/admin.php?page=usces_orderlist&changeSort=' . $value . '&switch=' . $switch . '"><span>' . $key . '</span></a>';
583 }
584 }
585 //$this->headers = array_keys($this->columns);
586 }
587
588 function GetSearchs()
589 {
590 return $this->arr_search;
591 }
592
593 function GetListheaders()
594 {
595 return $this->headers;
596 }
597
598 function GetDataTableNavigation()
599 {
600 return $this->dataTableNavigation;
601 }
602
603 function set_action_status($status, $message)
604 {
605 $this->action_status = $status;
606 $this->action_message = $message;
607 }
608
609 function get_action_status()
610 {
611 return $this->action_status;
612 }
613
614 function get_action_message()
615 {
616 return $this->action_message;
617 }
618 }
619
620
621 ?>