PluginProbe
Welcart e-Commerce / 2.12.3
Welcart e-Commerce v2.12.3
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 1.4.13 All 291 releases
usc-e-shop / includes / order_list.php

order_list.php in Welcart e-Commerce 2.12.3, at includes/order_list.php

963 lines 53.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Order List Page.
4 * - Old type
5 *
6 * @package Welcart
7 */
8
9 require_once USCES_PLUGIN_DIR . '/classes/orderList.class.php';
10 global $wpdb;
11
12 $tableName = $wpdb->prefix . 'usces_order'; // phpcs:ignore
13 if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>' ) ) {
14 $arr_column = array(
15 __( 'ID', 'usces' ) => 'ID',
16 __( 'Order number', 'usces' ) => 'deco_id',
17 __( 'Regular ID', 'autodelivery' ) => 'reg_id',
18 __( 'date', 'usces' ) => 'date',
19 __( 'membership number', 'usces' ) => 'mem_id',
20 __( 'name', 'usces' ) => 'name',
21 __( 'Region', 'usces' ) => 'pref',
22 __( 'shipping option', 'usces' ) => 'delivery_method',
23 __( 'Amount', 'usces' ) . '(' . __( usces_crcode( 'return' ), 'usces' ) . ')' => 'total_price',
24 __( 'payment method', 'usces' ) => 'payment_name',
25 __( 'transfer statement', 'usces' ) => 'receipt_status',
26 __( 'Processing', 'usces' ) => 'order_status',
27 __( 'shpping date', 'usces' ) => 'order_modified',
28 );
29 } else {
30 $arr_column = array(
31 __( 'ID', 'usces' ) => 'ID',
32 __( 'Order number', 'usces' ) => 'deco_id',
33 __( 'date', 'usces' ) => 'date',
34 __( 'membership number', 'usces' ) => 'mem_id',
35 __( 'name', 'usces' ) => 'name',
36 __( 'Region', 'usces' ) => 'pref',
37 __( 'shipping option', 'usces' ) => 'delivery_method',
38 __( 'Amount', 'usces' ) . '(' . __( usces_crcode( 'return' ), 'usces' ) . ')' => 'total_price',
39 __( 'payment method', 'usces' ) => 'payment_name',
40 __( 'transfer statement', 'usces' ) => 'receipt_status',
41 __( 'Processing', 'usces' ) => 'order_status',
42 apply_filters( 'usces_filter_admin_modified_label', __( 'shpping date', 'usces' ) ) => 'order_modified',
43 );
44 }
45 $arr_column = apply_filters( 'usces_filter_order_list_column', $arr_column );
46
47 // phpcs:disable
48 $DT = new dataList( $tableName, $arr_column );
49 $res = $DT->MakeTable();
50 $arr_search = $DT->GetSearchs();
51 $management_status = apply_filters( 'usces_filter_management_status', get_option( 'usces_management_status' ) );
52 $arr_header = $DT->GetListheaders();
53 $dataTableNavigation = $DT->GetDataTableNavigation();
54 $rows = $DT->rows;
55 $status = $DT->get_action_status();
56 $message = $DT->get_action_message();
57 $status = apply_filters( 'usces_order_list_action_status', $status );
58 $message = apply_filters( 'usces_order_list_action_message', $message );
59 // phpcs:enable
60
61 $usces_admin_path = '';
62 $admin_perse = explode( '/', $_SERVER['REQUEST_URI'] ); // phpcs:ignore
63 $apct = count( $admin_perse ) - 1;
64 for ( $ap = 0; $ap < $apct; $ap++ ) {
65 $usces_admin_path .= $admin_perse[ $ap ] . '/';
66 }
67
68 $startdate = ( ! empty( $DT->startdate ) ) ? $DT->startdate : ''; // phpcs:ignore
69 $enddate = ( ! empty( $DT->enddate ) ) ? $DT->enddate : ''; // phpcs:ignore
70 $period_specified_index = $DT->get_period_specified_index(); // phpcs:ignore
71 $pref = array();
72 $target_market = $this->options['system']['target_market'];
73 foreach ( (array) $target_market as $country ) {
74 $prefs = get_usces_states( $country );
75 if ( is_array( $prefs ) && 0 < count( $prefs ) ) {
76 $pos = strpos( $prefs[0], '--' );
77 if ( false !== $pos ) {
78 array_shift( $prefs );
79 }
80 foreach ( (array) $prefs as $state ) {
81 $pref[] = $state;
82 }
83 }
84 }
85 $payment_name = array();
86 $payments = usces_get_system_option( 'usces_payment_method', 'sort' );
87 foreach ( (array) $payments as $id => $payment ) { // phpcs:ignore
88 $payment_name[ $id ] = $payment['name'];
89 }
90 foreach ( (array) $management_status as $key => $value ) {
91 if ( 'noreceipt' == $key || 'receipted' == $key || 'pending' == $key ) {
92 $receipt_status[ $key ] = $value;
93 } else {
94 $order_status[ $key ] = $value;
95 }
96 }
97 $order_status['new'] = __( 'new order', 'usces' );
98 $curent_url = urlencode( esc_url( USCES_ADMIN_URL . '?' . $_SERVER['QUERY_STRING'] ) ); // phpcs:ignore
99
100 $csod_meta = usces_has_custom_field_meta( 'order' );
101 $cscs_meta = usces_has_custom_field_meta( 'customer' );
102 $csde_meta = usces_has_custom_field_meta( 'delivery' );
103 $usces_opt_order = get_option( 'usces_opt_order' );
104 $chk_pro = ( isset( $usces_opt_order['chk_pro'] ) ) ? $usces_opt_order['chk_pro'] : array();
105 $chk_ord = ( isset( $usces_opt_order['chk_ord'] ) ) ? $usces_opt_order['chk_ord'] : array();
106 $applyform = usces_get_apply_addressform( $this->options['system']['addressform'] );
107 $settlement_backup = ( isset( $this->options['system']['settlement_backup'] ) ) ? $this->options['system']['settlement_backup'] : 0;
108 $settlement_notice = get_option( 'usces_settlement_notice' );
109
110 $order_list_delete_link = ( isset( $this->options['system']['order_list_delete_link'] ) ) ? $this->options['system']['order_list_delete_link'] : 0;
111
112 ?>
113 <script type="text/javascript">
114 jQuery(function($){
115
116 $("input[name='allcheck']").click(function () {
117 if( $(this).prop("checked") ){
118 $("input[name*='listcheck']").prop( "checked", true );
119 }else{
120 $("input[name*='listcheck']").prop( "checked", false );
121 }
122 });
123
124 $("#searchselect").change(function () {
125 operation.change_search_field();
126 });
127
128 $("#searchselectsku").change(function () {
129 operation.change_search_sku_field();
130 });
131
132 $("#changeselect").change(function () {
133 operation.change_collective_field();
134 });
135
136 $("#collective_change").click(function () {
137 if( $("#changeselect option:selected").val() == 'none' ) {
138 $("#orderlistaction").val('');
139 return false;
140 }
141 if( $("input[name*='listcheck']:checked").length == 0 ) {
142 alert("<?php esc_html_e( 'Choose the data.', 'usces' ); ?>");
143 $("#orderlistaction").val('');
144 return false;
145 }
146 var coll = $("#changeselect").val();
147 var mes = '';
148 if( coll == 'order_reciept' ){
149 mes = <?php echo sprintf( __( "'Transfer status of the items which you have checked will be changed in to ' + %s + '. %sDo you agree?'", 'usces' ), '$("select\[name=\"change\[word\]\[order_reciept\]\"\] option:selected").html()', '\n\n' ); // phpcs:ignore ?>;
150 }else if( coll == 'order_status' ){
151 mes = <?php echo sprintf( __( "'Data status which you have cheked will be changed in to ' + %s + '. %sDo you agree?'", 'usces' ), '$("select\[name=\"change\[word\]\[order_status\]\"\] option:selected").html()', '\n\n' ); // phpcs:ignore ?>;
152 }else if(coll == 'delete'){
153 mes = '<?php esc_html_e( 'Are you sure of deleting all the checked data in bulk?', 'usces' ); ?>';
154 }
155 if( mes != '' ) {
156 if( !confirm(mes) ){
157 $("#orderlistaction").val('');
158 return false;
159 }
160 }
161 <?php do_action( 'usces_action_order_list_collective_change_js' ); ?>
162 $("#orderlistaction").val('collective');
163 $('#form_tablesearch').submit();
164 });
165
166 operation = {
167 change_search_field :function (){
168 var label = '';
169 var html = '';
170 var column = $("#searchselect").val();
171
172 if( column == 'ID' ) {
173 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
174 html = '<input name="search[word][ID]" type="text" value="<?php echo esc_attr( isset( $arr_search['word']['ID'] ) ? $arr_search['word']['ID'] : '' ); ?>" class="searchword" maxlength="50" />';
175 }else if( column == 'deco_id' ) {
176 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
177 html = '<input name="search[word][deco_id]" type="text" value="<?php echo esc_attr( isset( $arr_search['word']['deco_id'] ) ? $arr_search['word']['deco_id'] : '' ); ?>" class="searchword" maxlength="50" />';
178 }else if( column == 'date' ) {
179 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
180 html = '<input name="search[word][date]" type="text" value="<?php echo esc_attr( isset( $arr_search['word']['date'] ) ? $arr_search['word']['date'] : '' ); ?>" class="searchword" maxlength="50" />';
181 }else if( column == 'mem_id' ) {
182 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
183 html = '<input name="search[word][mem_id]" type="text" value="<?php echo esc_attr( isset( $arr_search['word']['mem_id'] ) ? $arr_search['word']['mem_id'] : '' ); ?>" class="searchword" maxlength="50" />';
184 }else if( column == 'name' ) {
185 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
186 html = '<input name="search[word][name]" type="text" value="<?php echo esc_attr( isset( $arr_search['word']['name'] ) ? $arr_search['word']['name'] : '' ); ?>" class="searchword" maxlength="50" />';
187 }else if( column == 'order_modified' ) {
188 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
189 html = '<input name="search[word][order_modified]" type="text" value="<?php echo esc_attr( isset( $arr_search['word']['order_modified'] ) ? $arr_search['word']['order_modified'] : '' ); ?>" class="searchword" maxlength="50" />';
190 }else if( column == 'pref' ) {
191 label = '';
192 html = '<select name="search[word][pref]" class="searchselect">';
193 <?php
194 foreach ( (array) $pref as $pkey => $pvalue ) :
195 if ( isset( $arr_search['word']['pref'] ) && $pvalue == $arr_search['word']['pref'] ) {
196 $pselected = ' selected="selected"';
197 } else {
198 $pselected = '';
199 }
200 ?>
201 html += '<option value="<?php echo esc_attr( $pvalue ); ?>"<?php echo esc_attr( $pselected ); ?>><?php echo esc_html( $pvalue ); ?></option>';
202 <?php
203 endforeach;
204 ?>
205 html += '</select>';
206 }else if( column == 'delivery_method' ) {
207 label = '';
208 html = '<select name="search[word][delivery_method]" class="searchselect">';
209 <?php
210 foreach ( (array) $this->options['delivery_method'] as $dkey => $dvalue ) :
211 if ( isset( $arr_search['word']['delivery_method'] ) && $dvalue['id'] == $arr_search['word']['delivery_method'] ) {
212 $dselected = ' selected="selected"';
213 } else {
214 $dselected = '';
215 }
216 ?>
217 html += '<option value="<?php echo esc_attr( $dvalue['id'] ); ?>"<?php echo esc_attr( $dselected ); ?>><?php echo esc_html( $dvalue['name'] ); ?></option>';
218 <?php
219 endforeach;
220 ?>
221 html += '</select>';
222 }else if( column == 'payment_name' ) {
223 label = '';
224 html = '<select name="search[word][payment_name]" class="searchselect">';
225 <?php
226 foreach ( (array) $payment_name as $pnkey => $pnvalue ) :
227 if ( isset( $arr_search['word']['payment_name'] ) && $pnvalue == $arr_search['word']['payment_name'] ) {
228 $pnselected = ' selected="selected"';
229 } else {
230 $pnselected = '';
231 }
232 ?>
233 html += '<option value="<?php echo esc_attr( $pnvalue ); ?>"<?php echo esc_attr( $pnselected ); ?>><?php echo esc_html( $pnvalue ); ?></option>';
234 <?php
235 endforeach;
236 ?>
237 html += '</select>';
238 }else if( column == 'receipt_status' ) {
239 label = '';
240 html = '<select name="search[word][receipt_status]" class="searchselect">';
241 <?php
242 foreach ( (array) $receipt_status as $rkey => $rvalue ) :
243 if ( isset( $arr_search['word']['receipt_status'] ) && $rvalue == $arr_search['word']['receipt_status'] ) {
244 $rselected = ' selected="selected"';
245 } else {
246 $rselected = '';
247 }
248 ?>
249 html += '<option value="<?php echo esc_attr( $rvalue ); ?>"<?php echo esc_attr( $rselected ); ?>><?php echo esc_html( $rvalue ); ?></option>';
250 <?php
251 endforeach;
252 ?>
253 html += '</select>';
254 }else if( column == 'order_status' ) {
255 label = '';
256 html = '<select name="search[word][order_status]" class="searchselect">';
257 <?php
258 foreach ( (array) $order_status as $okey => $ovalue ) :
259 if ( isset( $arr_search['word']['order_status'] ) && $ovalue == $arr_search['word']['order_status'] ) {
260 $oselected = ' selected="selected"';
261 } else {
262 $oselected = '';
263 }
264 ?>
265 html += '<option value="<?php echo esc_attr( $ovalue ); ?>"<?php echo esc_attr( $oselected ); ?>><?php echo esc_html( $ovalue ); ?></option>';
266 <?php
267 endforeach;
268 ?>
269 html += '</select>';
270 }
271
272 $("#searchlabel").html( label );
273 $("#searchfield").html( html );
274 },
275
276 change_search_sku_field :function (){
277 var label = '';
278 var html = '';
279 var column = $("#searchselectsku").val();
280
281 if( column == 'item_code' ) {
282 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
283 html = '<input name="search[skuword][item_code]" type="text" value="<?php echo esc_attr( isset( $arr_search['skuword']['item_code'] ) ? $arr_search['skuword']['item_code'] : '' ); ?>" class="searchword" maxlength="50" />';
284 }else if( column == 'item_name' ) {
285 label = '<?php esc_html_e( 'key words', 'usces' ); ?>';
286 html = '<input name="search[skuword][item_name]" type="text" value="<?php echo esc_attr( isset( $arr_search['skuword']['item_name'] ) ? $arr_search['skuword']['item_name'] : '' ); ?>" class="searchword" maxlength="50" />';
287 }
288
289 $("#searchlabelsku").html( label );
290 $("#searchfieldsku").html( html );
291 },
292
293 change_collective_field :function (){
294 var label = '';
295 var html = '';
296 var column = $("#changeselect").val();
297
298 if( column == 'order_reciept' ) {
299 label = '';
300 html = '<select name="change[word][order_reciept]" class="searchselect">';
301 <?php foreach ( (array) $receipt_status as $orkey => $orvalue ) : ?>
302 html += '<option value="<?php echo esc_attr( $orkey ); ?>"><?php echo esc_html( $orvalue ); ?></option>';
303 <?php endforeach; ?>
304 html += '</select>';
305 }else if( column == 'order_status' ) {
306 label = '';
307 html = '<select name="change[word][order_status]" class="ksearchselect">';
308 <?php foreach ( (array) $order_status as $oskey => $osvalue ) : ?>
309 html += '<option value="<?php echo esc_attr( $oskey ); ?>"><?php echo esc_html( $osvalue ); ?></option>';
310 <?php endforeach; ?>
311 html += '</select>';
312 }else if( column == 'delete' ) {
313 label = '';
314 html = '';
315 }
316
317 $("#changelabel").html( label );
318 $("#changefield").html( html );
319 }
320 };
321 <?php usces_order_list_js_settlement_dialog(); ?>
322 <?php echo apply_filters( 'usces_filter_order_list_page_js', '', $DT ); // phpcs:ignore ?>
323 });
324
325 function deleteconfirm(order_id){
326 if(confirm(<?php _e( "'Are you sure of deleting an order number ' + order_id + ' ?'", 'usces' ); // phpcs:ignore ?>)){
327 return true;
328 }else{
329 return false;
330 }
331 }
332
333 jQuery(document).ready(function($){
334 (function setCookie() {
335 <?php
336 // phpcs:disable
337 $data_cookie = array();
338 $data_cookie['placeholder_escape'] = $DT->placeholder_escape;
339 $data_cookie['startRow'] = $DT->startRow; /* 表示開始行番号 */
340 $data_cookie['sortColumn'] = $DT->sortColumn; /* 現在ソート中のフィールド */
341 $data_cookie['totalRow'] = $DT->totalRow; /* �
342 �行数 */
343 $data_cookie['selectedRow'] = $DT->selectedRow; /* 絞り込まれた行数 */
344 $data_cookie['currentPage'] = $DT->currentPage; /* 現在のページNo */
345 $data_cookie['previousPage'] = $DT->previousPage; /* 前のページNo */
346 $data_cookie['nextPage'] = $DT->nextPage; /* 次のページNo */
347 $data_cookie['lastPage'] = $DT->lastPage; /* 最終ページNo */
348 $data_cookie['userHeaderNames'] = $DT->userHeaderNames; /* �
349 �てのフィールド */
350 // $data_cookie['rows'] = $DT->rows; /* 表示する行オブジェクト */
351 $data_cookie['sortSwitchs'] = $DT->sortSwitchs; /* 各フィールド毎の昇順降順スイッチ */
352 $data_cookie['searchSql'] = $DT->searchSql;
353 $data_cookie['searchSkuSql'] = $DT->searchSkuSql;
354 $data_cookie['arr_search'] = $DT->arr_search;
355 $data_cookie['searchSwitchStatus'] = $DT->searchSwitchStatus;
356 $data_cookie['startdate'] = $DT->startdate;
357 $data_cookie['enddate'] = $DT->enddate;
358 // phpcs:enable
359 ?>
360 $.cookie('<?php echo "{$DT->table}" . "_path"; ?>', '<?php echo esc_url( $usces_admin_path ); ?>', { path: "<?php echo esc_url( $usces_admin_path ); ?>", domain: ""});
361 $.cookie('<?php echo "{$DT->table}"; ?>', '<?php echo str_replace( "'", "\'", json_encode( $data_cookie ) ); ?>', { path: "<?php echo esc_url( $usces_admin_path ); ?>", domain: ""});
362 })();
363 $("table#mainDataTable tr:even").addClass("rowSelection_even");
364 $("table#mainDataTable tr").hover(function() {
365 $(this).addClass("rowSelection_hilight");
366 },
367 function() {
368 $(this).removeClass("rowSelection_hilight");
369 });
370
371 $(document).on( "click", "#searchVisiLink", function() {
372 if( $("#searchBox").css("display") == "block" ) {
373 $("#searchBox").css("display", "none");
374 $("#searchVisiLink").html('<?php esc_html_e( 'Show the Operation field', 'usces' ); ?><span class="dashicons dashicons-arrow-down"></span>');
375 } else {
376 $("#searchBox").css("display", "block");
377 $("#searchVisiLink").html('<?php esc_html_e( 'Hide the Operation field', 'usces' ); ?><span class="dashicons dashicons-arrow-up"></span>');
378 }
379 });
380
381 operation.change_search_field();
382 operation.change_search_sku_field();
383
384 $("#dlProductListDialog").dialog({
385 bgiframe: true,
386 autoOpen: false,
387 height: 400,
388 width: 700,
389 resizable: true,
390 modal: true,
391 buttons: {
392 '<?php esc_html_e( 'close', 'usces' ); ?>': function() {
393 $(this).dialog('close');
394 }
395 },
396 close: function() {
397 }
398 });
399 $('#dl_pro').click(function() {
400 var listcheck = [];
401 $("input[name='listcheck[]']:checked").each(function() {
402 listcheck.push($(this).val());
403 });
404
405 var form = $('<form>', {
406 action: "<?php echo esc_url( USCES_ADMIN_URL ); ?>?page=usces_orderlist&order_action=dlproductlist&noheader=true",
407 method: 'post'
408 });
409 form.append($('<input>', { type: 'hidden', name: 'search[column]', value: $(':input[name="search[column]"]').val() }));
410 form.append($('<input>', { type: 'hidden', name: 'search[sku]', value: $(':input[name="search[sku]"]').val() }));
411 form.append($('<input>', { type: 'hidden', name: 'search[word]['+$("#searchselect").val()+']', value: $(':input[name="search[word]['+$("#searchselect").val()+']"]').val() }));
412 form.append($('<input>', { type: 'hidden', name: 'search[skuword]['+$("#searchselectsku").val()+']', value: $(':input[name="search[skuword]['+$("#searchselectsku").val()+']"]').val() }));
413 form.append($('<input>', { type: 'hidden', name: 'search[period]', value: $(':input[name="search[period]"]').val() }));
414 form.append($('<input>', { type: 'hidden', name: 'searchSwitchStatus', value: $(':input[name="searchSwitchStatus"]').val() }));
415 form.append($('<input>', { type: 'hidden', name: 'ftype', value: 'csv' }));
416 form.append($('<input>', { type: 'hidden', name: 'wc_nonce', value: $("#wc_nonce").val() }));
417
418 $(".check_product").each(function() {
419 if($(this).prop('checked')) {
420 form.append($('<input>', { type: 'hidden', name: 'check['+$(this).val()+']', value: 'on' }));
421 }
422 });
423
424 if (listcheck.length > 0) {
425 form.append($('<input>', { type: 'hidden', name: 'listcheck', value: listcheck.join(',') }));
426 }
427
428 form.appendTo('body').submit().remove();
429 });
430 $('#dl_productlist').click(function() {
431 $('#dlProductListDialog').dialog('open');
432 });
433
434 $("#dlOrderListDialog").dialog({
435 bgiframe: true,
436 autoOpen: false,
437 height: 600,
438 width: 700,
439 resizable: true,
440 modal: true,
441 buttons: {
442 '<?php esc_html_e( 'close', 'usces' ); ?>': function() {
443 $(this).dialog('close');
444 }
445 },
446 close: function() {
447 }
448 });
449 $('#dl_ord').click(function() {
450 var listcheck = [];
451 $("input[name='listcheck[]']:checked").each(function() {
452 listcheck.push($(this).val());
453 });
454
455 var form = $('<form>', {
456 action: "<?php echo esc_url( USCES_ADMIN_URL ); ?>?page=usces_orderlist&order_action=dlorderlist&noheader=true",
457 method: 'post'
458 });
459 form.append($('<input>', { type: 'hidden', name: 'search[column]', value: $(':input[name="search[column]"]').val() }));
460 form.append($('<input>', { type: 'hidden', name: 'search[sku]', value: $(':input[name="search[sku]"]').val() }));
461 form.append($('<input>', { type: 'hidden', name: 'search[word]['+$("#searchselect").val()+']', value: $(':input[name="search[word]['+$("#searchselect").val()+']"]').val() }));
462 form.append($('<input>', { type: 'hidden', name: 'search[skuword]['+$("#searchselectsku").val()+']', value: $(':input[name="search[skuword]['+$("#searchselectsku").val()+']"]').val() }));
463 form.append($('<input>', { type: 'hidden', name: 'search[period]', value: $(':input[name="search[period]"]').val() }));
464 form.append($('<input>', { type: 'hidden', name: 'searchSwitchStatus', value: $(':input[name="searchSwitchStatus"]').val() }));
465 form.append($('<input>', { type: 'hidden', name: 'ftype', value: 'csv' }));
466 form.append($('<input>', { type: 'hidden', name: 'wc_nonce', value: $("#wc_nonce").val() }));
467
468 $(".check_order").each(function() {
469 if($(this).prop('checked')) {
470 form.append($('<input>', { type: 'hidden', name: 'check['+$(this).val()+']', value: 'on' }));
471 }
472 });
473
474 if (listcheck.length > 0) {
475 form.append($('<input>', { type: 'hidden', name: 'listcheck', value: listcheck.join(',') }));
476 }
477
478 form.appendTo('body').submit().remove();
479 });
480 $('#dl_orderlist').click(function() {
481 $('#dlOrderListDialog').dialog('open');
482 });
483
484 <?php if ( isset( $_GET['order_action'] ) && 'settlement_notice' == $_GET['order_action'] ) : ?>
485 $("#searchBox").css( "display","block" );
486 $("#searchSwitchStatus").val( "ON" );
487 $("#searchSwitchStatus").css( "display","none" );
488 $("#settlement_errorlog").trigger( "click" );
489 <?php endif; ?>
490
491 <?php
492 $set_startdate = ( ! empty( $startdate ) ) ? ', setDate: "' . $startdate . '", defaultDate: "' . $startdate . '"' : ''; // phpcs:ignore
493 $set_enddate = ( ! empty( $enddate ) ) ? ', setDate: "' . $enddate . '", defaultDate: "' . $enddate . '"' : ''; // phpcs:ignore
494 ?>
495 $("#startdate").datepicker({
496 dateFormat: "yy-mm-dd"<?php wel_esc_script_e( $set_startdate ); ?>
497 });
498 $("#enddate").datepicker({
499 dateFormat: "yy-mm-dd"<?php wel_esc_script_e( $set_enddate ); ?>
500 });
501 $("select[name='search[period]']").change(function() {
502 var period = $("select[name='search[period]'] option:selected").val();
503 if( period == <?php wel_esc_script_e( $period_specified_index ); ?> ) {
504 $("#period_specified").css( "display", "block" );
505 } else {
506 $("#period_specified").css( "display", "none" );
507 }
508 });
509 $("select[name='search[period]']").triggerHandler("change");
510 <?php if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>' ) ) : ?>
511 $(".regular_parent_order").removeClass( "rowSelection_even" );
512 $(".regular_parent_order").css( "background-color","#e6fe9e" );
513 <?php endif; ?>
514 <?php do_action( 'usces_action_order_list_document_ready_js', $DT ); // phpcs:ignore ?>
515 });
516 </script>
517
518 <div class="wrap">
519 <div class="usces_admin">
520 <form action="<?php echo esc_url( USCES_ADMIN_URL . '?page=usces_orderlist' ); ?>" method="post" name="tablesearch" id="form_tablesearch">
521 <h1>Welcart Management <?php esc_html_e( 'Order List', 'usces' ); ?></h1>
522 <p class="version_info">Version <?php echo esc_html( USCES_VERSION ); ?></p>
523 <?php usces_admin_action_status( $status, $message ); ?>
524
525 <div id="datatable">
526 <div id="tablenavi"><?php wel_esc_script_e( $dataTableNavigation ); ?></div>
527
528 <div id="tablesearch">
529 <div id="searchBox">
530 <table id="search_table">
531 <tr>
532 <td><?php esc_html_e( 'search fields', 'usces' ); ?></td>
533 <td><select name="search[column]" class="searchselect" id="searchselect">
534 <option value="none"> </option>
535 <?php
536 foreach ( (array) $arr_column as $key => $value ) :
537 if ( 'total_price' == $value ) {
538 continue;
539 }
540 $selected = ( $value == $arr_search['column'] ) ? ' selected="selected"' : '';
541 ?>
542 <option value="<?php echo esc_attr( $value ); ?>"<?php echo esc_attr( $selected ); ?>><?php echo esc_html( $key ); ?></option>
543 <?php
544 endforeach;
545 ?>
546 </select>
547 </td>
548 <td id="searchlabel"></td>
549 <td id="searchfield"></td>
550 <td rowspan="2"><input name="searchIn" type="submit" class="searchbutton button" value="<?php esc_attr_e( 'Search', 'usces' ); ?>" />
551 <input name="searchOut" type="submit" class="searchbutton button" value="<?php esc_attr_e( 'Cancellation', 'usces' ); ?>" />
552 <input name="searchSwitchStatus" id="searchSwitchStatus" type="hidden" value="<?php echo esc_attr( $DT->searchSwitchStatus ); // phpcs:ignore ?>" />
553 </td>
554 </tr>
555 <td><?php esc_html_e( 'search fields', 'usces' ); ?></td>
556 <td><select name="search[sku]" class="searchselect" id="searchselectsku">
557 <option value="none"> </option>
558 <option value="item_code"<?php echo( 'item_code' == $arr_search['sku'] ? ' selected="selected"' : '' ); ?>><?php esc_html_e( 'item code', 'usces' ); ?></option>
559 <option value="item_name"<?php echo( 'item_name' == $arr_search['sku'] ? ' selected="selected"' : '' ); ?>><?php esc_html_e( 'item name', 'usces' ); ?></option>
560 </select></td>
561 <td id="searchlabelsku"></td>
562 <td id="searchfieldsku"></td>
563 <tr>
564 </tr>
565 </table>
566 <table id="period_table">
567 <tr>
568 <?php
569 $period_table = '<td><div id="period_specified"><input type="text" name="startdate" id="startdate" value="' . $startdate . '">' . __( ' - ', 'usces' ) . '<input type="text" name="enddate" id="enddate" value="' . $enddate . '"></div></td>';
570 ?>
571 <?php echo apply_filters( 'usces_filter_order_list_period_table', $period_table ); // phpcs:ignore ?>
572 <td><?php esc_html_e( 'Period', 'usces' ); ?></td>
573 <td><select name="search[period]" class="searchselect">
574 <?php
575 foreach ( (array) $DT->arr_period as $key => $value ) : // phpcs:ignore
576 $selected = ( $key == $arr_search['period'] ) ? ' selected="selected"' : '';
577 ?>
578 <option value="<?php echo esc_attr( $key ); ?>"<?php echo esc_attr( $selected ); ?>><?php echo esc_html( $value ); ?></option>
579 <?php
580 endforeach;
581 ?>
582 </select></td>
583 </tr>
584 </table>
585 <table id="change_table">
586 <tr>
587 <td><?php esc_html_e( 'Oparation in bulk', 'usces' ); ?></td>
588 <td><select name="allchange[column]" class="searchselect" id="changeselect">
589 <option value="none"> </option>
590 <option value="order_reciept"><?php esc_html_e( 'Edit the receiving money status', 'usces' ); ?></option>
591 <option value="order_status"><?php esc_html_e( 'Edit of status process', 'usces' ); ?></option>
592 <option value="delete"><?php esc_html_e( 'Delete in bulk', 'usces' ); ?></option>
593 <?php echo apply_filters( 'usces_filter_allchange_column', '' ); // phpcs:ignore ?>
594 </select></td>
595 <td id="changelabel"></td>
596 <td id="changefield"></td>
597 <td><input name="collective_change" type="button" class="searchbutton button" id="collective_change" value="<?php esc_attr_e( 'start', 'usces' ); ?>" />
598 </td>
599 </tr>
600 </table>
601 <input name="collective" id="orderlistaction" type="hidden" />
602 <table id="dl_list_table">
603 <tr>
604 <?php echo apply_filters( 'usces_filter_dl_list_table', '' ); // phpcs:ignore ?>
605 <?php do_action( 'usces_action_dl_list_table' ); ?>
606 <td><input type="button" id="dl_productlist" class="searchbutton button" value="<?php esc_attr_e( 'Download Product List', 'usces' ); ?>" /></td>
607 <td><input type="button" id="dl_orderlist" class="searchbutton button" value="<?php esc_attr_e( 'Download Order List', 'usces' ); ?>" /></td>
608 <?php if ( ! empty( $settlement_backup ) && 1 == $settlement_backup ) : ?>
609 <td><input type="button" id="settlementlog" class="searchbutton button" value="<?php esc_attr_e( 'Settlement previous log list', 'usces' ); ?>" /></td>
610 <?php endif; ?>
611 <?php if ( ! empty( $settlement_notice ) ) : ?>
612 <td><input type="button" id="settlement_errorlog" class="searchbutton button" value="<?php esc_attr_e( 'Settlement error log list', 'usces' ); ?>" /></td>
613 <?php endif; ?>
614 </tr>
615 </table>
616 <div<?php if ( has_action( 'usces_action_order_list_searchbox_bottom' ) ) echo ' class="searchbox_bottom"'; // phpcs:ignore ?>>
617 <?php do_action( 'usces_action_order_list_searchbox_bottom' ); ?>
618 </div>
619 </div>
620 <?php do_action( 'usces_action_order_list_searchbox' ); ?>
621 </div>
622
623 <table id="mainDataTable" cellspacing="1">
624 <?php
625 $list_header = '<th scope="col"><input name="allcheck" type="checkbox" value="" /></th>';
626 foreach ( (array) $arr_header as $value ) {
627 $list_header .= '<th scope="col">' . $value . '</th>';
628 }
629
630 if ( $order_list_delete_link ) {
631 $list_header .= '<th scope="col">&nbsp;</th>';
632 }
633
634 ?>
635 <tr>
636 <?php echo apply_filters( 'usces_filter_order_list_header', $list_header, $arr_header ); // phpcs:ignore ?>
637 </tr>
638 <?php
639 foreach ( (array) $rows as $data ) :
640 $list_detail = '<td align="center"><input name="listcheck[]" type="checkbox" value="' . $data['ID'] . '" /></td>';
641 foreach ( (array) $data as $key => $value ) {
642 if ( WCUtils::is_blank( $value ) ) {
643 $value = '&nbsp;';
644 }
645 if ( 'ID' === $key || 'deco_id' === $key ) {
646 $list_detail .= '<td><a href="' . USCES_ADMIN_URL . '?page=usces_orderlist&order_action=edit&order_id=' . $data['ID'] . '&usces_referer=' . $curent_url . '&wc_nonce=' . wp_create_nonce( 'order_edit' ) . '">' . esc_html( $value ) . '</a></td>';
647 } elseif ( 'reg_id' == $key ) {
648 if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>' ) ) {
649 if ( '&nbsp;' == $value || '-' == $value ) {
650 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
651 } else {
652 $list_detail .= '<td><a href="' . USCES_ADMIN_URL . '?page=usces_regularlist&regular_action=edit&regular_id=' . $value . '&usces_referer=' . $curent_url . '&wc_nonce=' . wp_create_nonce( 'order_edit' ) . '">' . esc_html( $value ) . '</a></td>';
653 }
654 }
655 } elseif ( 'date' === $key ) {
656 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
657 } elseif ( 'mem_id' === $key ) {
658 if ( WCUtils::is_zero( $value ) ) {
659 $value = '&nbsp;';
660 }
661 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
662 } elseif ( 'name' === $key ) {
663 switch ( $applyform ) {
664 case 'JP':
665 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
666 break;
667 case 'US':
668 default:
669 $names = explode( ' ', $value );
670 $list_detail .= '<td>' . esc_html( $names[1] . ' ' . $names[0] ) . '</td>';
671 }
672 } elseif ( 'pref' === $key ) {
673 if ( __( '-- Select --', 'usces' ) == $value || '-- Select --' == $value ) {
674 $list_detail .= '<td>&nbsp;</td>';
675 } else {
676 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
677 }
678 } elseif ( 'delivery_method' === $key ) {
679 if ( -1 != $value ) {
680 $delivery_method_index = $this->get_delivery_method_index( $value );
681 $value = ( isset( $this->options['delivery_method'][ $delivery_method_index ]['name'] ) ) ? $this->options['delivery_method'][ $delivery_method_index ]['name'] : '&nbsp;';
682 } else {
683 $value = '&nbsp;';
684 }
685 $list_detail .= '<td class="green">' . esc_html( $value ) . '</td>';
686 } elseif ( 'total_price' === $key ) {
687 if ( $value < 0 ) {
688 $value = 0;
689 }
690 $list_detail .= '<td class="price">' . usces_crform( $value, true, false, 'return' ) . '</td>';
691 } elseif ( 'payment_name' === $key ) {
692 if ( '#none#' == $value ) {
693 $list_detail .= '<td>&nbsp;</td>';
694 } else {
695 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
696 }
697 } elseif ( 'receipt_status' === $key ) {
698 if ( __( 'unpaid', 'usces' ) == $value ) {
699 $list_detail .= '<td class="red">' . esc_html( $value ) . '</td>';
700 } elseif ( 'Pending' == $value ) {
701 $list_detail .= '<td class="red">' . esc_html( $value ) . '</td>';
702 } elseif ( __( 'payment confirmed', 'usces' ) == $value ) {
703 $list_detail .= '<td class="green">' . esc_html( $value ) . '</td>';
704 } else {
705 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
706 }
707 } elseif ( 'order_status' === $key ) {
708 if ( __( 'It has sent it out.', 'usces' ) == $value ) {
709 $process_status = esc_html( $value );
710 $process_status_class = ' class="green"';
711 } else {
712 $process_status = esc_html( $value );
713 $process_status_class = '';
714 }
715 $process_status = apply_filters( 'usces_filter_orderlist_process_status', $process_status, $value, $management_status );
716 $process_status_class = apply_filters( 'usces_filter_orderlist_process_status_class', $process_status_class, $value );
717 $list_detail .= '<td' . $process_status_class . '>' . $process_status . '</td>';
718 } elseif ( 'order_modified' === $key ) {
719 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
720 }
721 }
722
723 if ( $order_list_delete_link ) {
724 $list_detail .= '<td><a href="' . USCES_ADMIN_URL . '?page=usces_orderlist&order_action=delete&order_id=' . $data['ID'] . '&wc_nonce=' . wp_create_nonce( 'order_list' ) . '" onclick="return deleteconfirm(\'' . $data['ID'] . '\');"><span style="color:#FF0000; font-size:9px;">' . __( 'Delete', 'usces' ) . '</span></a></td>';
725 }
726
727 if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>=' ) ) {
728 $trclass = ( ! empty( $data['reg_parent_id'] ) ) ? ' class="regular_parent_order"' : '';
729 } else {
730 $trclass = '';
731 }
732 ?>
733 <tr<?php echo apply_filters( 'usces_filter_order_list_detail_trclass', $trclass, $data ); // phpcs:ignore ?>>
734 <?php echo apply_filters( 'usces_filter_order_list_detail', $list_detail, $data, $curent_url ); // phpcs:ignore ?>
735 </tr>
736 <?php
737 endforeach;
738 ?>
739 </table>
740
741 </div>
742 <!-- [memory peak usage] <?php // echo round(memory_get_peak_usage()/1048576, 1); ?>Mb -->
743
744 <div id="dlProductListDialog" title="<?php esc_attr_e( 'Download Product List', 'usces' ); ?>">
745 <p><?php esc_html_e( 'Select the item you want, please press the download.', 'usces' ); ?></p>
746 <input type="button" class="button" id="dl_pro" value="<?php esc_attr_e( 'Download', 'usces' ); ?>" />
747 <fieldset><legend><?php esc_html_e( 'Header Information', 'usces' ); ?></legend>
748 <label for="chk_pro[ID]"><input type="checkbox" class="check_product" id="chk_pro[ID]" value="ID" checked disabled /><?php esc_html_e( 'ID', 'usces' ); ?></label>
749 <label for="chk_pro[deco_id]"><input type="checkbox" class="check_product" id="chk_pro[deco_id]" value="deco_id" checked disabled /><?php esc_html_e( 'order number', 'usces' ); ?></label>
750 <label for="chk_pro[date]"><input type="checkbox" class="check_product" id="chk_pro[date]" value="date"<?php usces_checked( $chk_pro, 'date' ); ?> /><?php esc_html_e( 'order date', 'usces' ); ?></label>
751 <label for="chk_pro[mem_id]"><input type="checkbox" class="check_product" id="chk_pro[mem_id]" value="mem_id"<?php usces_checked( $chk_pro, 'mem_id' ); ?> /><?php esc_html_e( 'membership number', 'usces' ); ?></label>
752 <label for="chk_pro[name]"><input type="checkbox" class="check_product" id="chk_pro[name]" value="name"<?php usces_checked( $chk_pro, 'name' ); ?> /><?php esc_html_e( 'name', 'usces' ); ?></label>
753 <label for="chk_pro[delivery_method]"><input type="checkbox" class="check_product" id="chk_pro[delivery_method]" value="delivery_method"<?php usces_checked( $chk_pro, 'delivery_method' ); ?> /><?php esc_html_e( 'shipping option', 'usces' ); ?></label>
754 <label for="chk_pro[shipping_date]"><input type="checkbox" class="check_product" id="chk_pro[shipping_date]" value="shipping_date"<?php usces_checked( $chk_pro, 'shipping_date' ); ?> /><?php esc_html_e( 'shpping date', 'usces' ); ?></label>
755 <?php do_action( 'usces_action_chk_pro_head', $chk_pro ); ?>
756 </fieldset>
757 <fieldset><legend><?php esc_html_e( 'Product Information', 'usces' ); ?></legend>
758 <label for="chk_pro[item_code]"><input type="checkbox" class="check_product" id="chk_pro[item_code]" value="item_code" checked disabled /><?php esc_html_e( 'item code', 'usces' ); ?></label>
759 <label for="chk_pro[sku_code]"><input type="checkbox" class="check_product" id="chk_pro[sku_code]" value="sku_code" checked disabled /><?php esc_html_e( 'SKU code', 'usces' ); ?></label>
760 <label for="chk_pro[item_name]"><input type="checkbox" class="check_product" id="chk_pro[item_name]" value="item_name"<?php usces_checked( $chk_pro, 'item_name' ); ?> /><?php esc_html_e( 'item name', 'usces' ); ?></label>
761 <label for="chk_pro[sku_name]"><input type="checkbox" class="check_product" id="chk_pro[sku_name]" value="sku_name"<?php usces_checked( $chk_pro, 'sku_name' ); ?> /><?php esc_html_e( 'SKU display name ', 'usces' ); ?></label>
762 <label for="chk_pro[options]"><input type="checkbox" class="check_product" id="chk_pro[options]" value="options"<?php usces_checked( $chk_pro, 'options' ); ?> /><?php esc_html_e( 'options for items', 'usces' ); ?></label>
763 <label for="chk_pro[quantity]"><input type="checkbox" class="check_product" id="chk_pro[quantity]" value="quantity" checked disabled /><?php esc_html_e( 'Quantity', 'usces' ); ?></label>
764 <label for="chk_pro[price]"><input type="checkbox" class="check_product" id="chk_pro[price]" value="price" checked disabled /><?php esc_html_e( 'Unit price', 'usces' ); ?></label>
765 <label for="chk_pro[unit]"><input type="checkbox" class="check_product" id="chk_pro[unit]" value="unit"<?php usces_checked( $chk_pro, 'unit' ); ?> /><?php esc_html_e( 'unit', 'usces' ); ?></label>
766 <?php do_action( 'usces_action_chk_pro_detail', $chk_pro ); ?>
767 </fieldset>
768 </div>
769 <div id="dlOrderListDialog" title="<?php esc_attr_e( 'Download Order List', 'usces' ); ?>">
770 <p><?php esc_html_e( 'Select the item you want, please press the download.', 'usces' ); ?></p>
771 <input type="button" class="button" id="dl_ord" value="<?php esc_attr_e( 'Download', 'usces' ); ?>" />
772 <fieldset><legend><?php esc_html_e( 'Customer Information', 'usces' ); ?></legend>
773 <label for="chk_ord[ID]"><input type="checkbox" class="check_order" id="chk_ord[ID]" value="ID" checked disabled /><?php esc_html_e( 'ID', 'usces' ); ?></label>
774 <label for="chk_ord[deco_id]"><input type="checkbox" class="check_order" id="chk_ord[deco_id]" value="deco_id" checked disabled /><?php esc_html_e( 'Order number', 'usces' ); ?></label>
775 <label for="chk_ord[date]"><input type="checkbox" class="check_order" id="chk_ord[date]" value="date" checked disabled /><?php esc_html_e( 'order date', 'usces' ); ?></label>
776 <label for="chk_ord[mem_id]"><input type="checkbox" class="check_order" id="chk_ord[mem_id]" value="mem_id"<?php usces_checked( $chk_ord, 'mem_id' ); ?> /><?php esc_html_e( 'membership number', 'usces' ); ?></label>
777 <label for="chk_ord[email]"><input type="checkbox" class="check_order" id="chk_ord[email]" value="email"<?php usces_checked( $chk_ord, 'email' ); ?> /><?php esc_html_e( 'e-mail', 'usces' ); ?></label>
778 <?php
779 if ( ! empty( $cscs_meta ) ) {
780 foreach ( $cscs_meta as $key => $entry ) {
781 if ( 'name_pre' == $entry['position'] ) {
782 $cscs_key = 'cscs_' . $key;
783 $checked = usces_checked( $chk_ord, $cscs_key, 'return' );
784 $name = $entry['name'];
785 echo '<label for="chk_ord[' . esc_attr( $cscs_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $cscs_key ) . ']" value="' . esc_attr( $cscs_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
786 }
787 }
788 }
789 ?>
790 <label for="chk_ord[name]"><input type="checkbox" class="check_order" id="chk_ord[name]" value="name" checked disabled /><?php esc_html_e( 'name', 'usces' ); ?></label>
791 <?php
792 switch ( $applyform ) {
793 case 'JP':
794 ?>
795 <label for="chk_ord[kana]"><input type="checkbox" class="check_order" id="chk_ord[kana]" value="kana"<?php usces_checked( $chk_ord, 'kana' ); ?> /><?php esc_html_e( 'furigana', 'usces' ); ?></label>
796 <?php
797 break;
798 }
799
800 if ( ! empty( $cscs_meta ) ) {
801 foreach ( $cscs_meta as $key => $entry ) {
802 if ( 'name_after' == $entry['position'] ) {
803 $cscs_key = 'cscs_' . $key;
804 $checked = usces_checked( $chk_ord, $cscs_key, 'return' );
805 $name = $entry['name'];
806 echo '<label for="chk_ord[' . esc_attr( $cscs_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $cscs_key ) . ']" value="' . esc_attr( $cscs_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
807 }
808 }
809 }
810
811 switch ( $applyform ) {
812 case 'JP':
813 ?>
814 <label for="chk_ord[zip]"><input type="checkbox" class="check_order" id="chk_ord[zip]" value="zip"<?php usces_checked( $chk_ord, 'zip' ); ?> /><?php esc_html_e( 'Zip/Postal Code', 'usces' ); ?></label>
815 <label for="chk_ord[country]"><input type="checkbox" class="check_order" id="chk_ord[country]" value="country"<?php usces_checked( $chk_ord, 'country' ); ?> /><?php esc_html_e( 'Country', 'usces' ); ?></label>
816 <label for="chk_ord[pref]"><input type="checkbox" class="check_order" id="chk_ord[pref]" value="pref"<?php usces_checked( $chk_ord, 'pref' ); ?> /><?php esc_html_e( 'Province', 'usces' ); ?></label>
817 <label for="chk_ord[address1]"><input type="checkbox" class="check_order" id="chk_ord[address1]" value="address1"<?php usces_checked( $chk_ord, 'address1' ); ?> /><?php esc_html_e( 'city', 'usces' ); ?></label>
818 <label for="chk_ord[address2]"><input type="checkbox" class="check_order" id="chk_ord[address2]" value="address2"<?php usces_checked( $chk_ord, 'address2' ); ?> /><?php esc_html_e( 'numbers', 'usces' ); ?></label>
819 <label for="chk_ord[address3]"><input type="checkbox" class="check_order" id="chk_ord[address3]" value="address3"<?php usces_checked( $chk_ord, 'address3' ); ?> /><?php esc_html_e( 'building name', 'usces' ); ?></label>
820 <label for="chk_ord[tel]"><input type="checkbox" class="check_order" id="chk_ord[tel]" value="tel"<?php usces_checked( $chk_ord, 'tel' ); ?> /><?php esc_html_e( 'Phone number', 'usces' ); ?></label>
821 <label for="chk_ord[fax]"><input type="checkbox" class="check_order" id="chk_ord[fax]" value="fax"<?php usces_checked( $chk_ord, 'fax' ); ?> /><?php esc_html_e( 'FAX number', 'usces' ); ?></label>
822 <?php
823 break;
824 case 'US':
825 default:
826 ?>
827 <label for="chk_ord[address2]"><input type="checkbox" class="check_order" id="chk_ord[address2]" value="address2"<?php usces_checked( $chk_ord, 'address2' ); ?> /><?php esc_html_e( 'Address Line1', 'usces' ); ?></label>
828 <label for="chk_ord[address3]"><input type="checkbox" class="check_order" id="chk_ord[address3]" value="address3"<?php usces_checked( $chk_ord, 'address3' ); ?> /><?php esc_html_e( 'Address Line2', 'usces' ); ?></label>
829 <label for="chk_ord[address1]"><input type="checkbox" class="check_order" id="chk_ord[address1]" value="address1"<?php usces_checked( $chk_ord, 'address1' ); ?> /><?php esc_html_e( 'city', 'usces' ); ?></label>
830 <label for="chk_ord[pref]"><input type="checkbox" class="check_order" id="chk_ord[pref]" value="pref"<?php usces_checked( $chk_ord, 'pref' ); ?> /><?php esc_html_e( 'State', 'usces' ); ?></label>
831 <label for="chk_ord[country]"><input type="checkbox" class="check_order" id="chk_ord[country]" value="country"<?php usces_checked( $chk_ord, 'country' ); ?> /><?php esc_html_e( 'Country', 'usces' ); ?></label>
832 <label for="chk_ord[zip]"><input type="checkbox" class="check_order" id="chk_ord[zip]" value="zip"<?php usces_checked( $chk_ord, 'zip' ); ?> /><?php esc_html_e( 'Zip', 'usces' ); ?></label>
833 <label for="chk_ord[tel]"><input type="checkbox" class="check_order" id="chk_ord[tel]" value="tel"<?php usces_checked( $chk_ord, 'tel' ); ?> /><?php esc_html_e( 'Phone number', 'usces' ); ?></label>
834 <label for="chk_ord[fax]"><input type="checkbox" class="check_order" id="chk_ord[fax]" value="fax"<?php usces_checked( $chk_ord, 'fax' ); ?> /><?php esc_html_e( 'FAX number', 'usces' ); ?></label>
835 <?php
836 break;
837 }
838
839 if ( ! empty( $cscs_meta ) ) {
840 foreach ( $cscs_meta as $key => $entry ) {
841 if ( 'fax_after' == $entry['position'] ) {
842 $cscs_key = 'cscs_' . $key;
843 $checked = usces_checked( $chk_ord, $cscs_key, 'return' );
844 $name = $entry['name'];
845 echo '<label for="chk_ord[' . esc_attr( $cscs_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $cscs_key ) . ']" value="' . esc_attr( $cscs_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
846 }
847 }
848 }
849 ?>
850 <?php do_action( 'usces_action_chk_ord_customer', $chk_ord ); ?>
851 </fieldset>
852 <fieldset><legend><?php esc_html_e( 'Shipping address information', 'usces' ); ?></legend>
853 <?php
854 if ( ! empty( $csde_meta ) ) {
855 foreach ( $csde_meta as $key => $entry ) {
856 if ( 'name_pre' == $entry['position'] ) {
857 $csde_key = 'csde_' . $key;
858 $checked = usces_checked( $chk_ord, $csde_key, 'return' );
859 $name = $entry['name'];
860 echo '<label for="chk_ord[' . esc_attr( $csde_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $csde_key ) . ']" value="' . esc_attr( $csde_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
861 }
862 }
863 }
864 ?>
865 <label for="chk_ord[delivery_name]"><input type="checkbox" class="check_order" id="chk_ord[delivery_name]" value="delivery_name"<?php usces_checked( $chk_ord, 'delivery_name' ); ?> /><?php esc_html_e( 'name', 'usces' ); ?></label>
866 <?php
867 switch ( $applyform ) {
868 case 'JP':
869 ?>
870 <label for="chk_ord[delivery_kana]"><input type="checkbox" class="check_order" id="chk_ord[delivery_kana]" value="delivery_kana"<?php usces_checked( $chk_ord, 'delivery_kana' ); ?> /><?php esc_html_e( 'furigana', 'usces' ); ?></label>
871 <?php
872 break;
873 }
874
875 if ( ! empty( $csde_meta ) ) {
876 foreach ( $csde_meta as $key => $entry ) {
877 if ( 'name_after' == $entry['position'] ) {
878 $csde_key = 'csde_' . $key;
879 $checked = usces_checked( $chk_ord, $csde_key, 'return' );
880 $name = $entry['name'];
881 echo '<label for="chk_ord[' . esc_attr( $csde_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $csde_key ) . ']" value="' . esc_attr( $csde_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
882 }
883 }
884 }
885
886 switch ( $applyform ) {
887 case 'JP':
888 ?>
889 <label for="chk_ord[delivery_zip]"><input type="checkbox" class="check_order" id="chk_ord[delivery_zip]" value="delivery_zip"<?php usces_checked( $chk_ord, 'delivery_zip' ); ?> /><?php esc_html_e( 'Zip/Postal Code', 'usces' ); ?></label>
890 <label for="chk_ord[delivery_country]"><input type="checkbox" class="check_order" id="chk_ord[delivery_country]" value="delivery_country"<?php usces_checked( $chk_ord, 'delivery_country' ); ?> /><?php esc_html_e( 'Country', 'usces' ); ?></label>
891 <label for="chk_ord[delivery_pref]"><input type="checkbox" class="check_order" id="chk_ord[delivery_pref]" value="delivery_pref"<?php usces_checked( $chk_ord, 'delivery_pref' ); ?> /><?php esc_html_e( 'Province', 'usces' ); ?></label>
892 <label for="chk_ord[delivery_address1]"><input type="checkbox" class="check_order" id="chk_ord[delivery_address1]" value="delivery_address1"<?php usces_checked( $chk_ord, 'delivery_address1' ); ?> /><?php esc_html_e( 'city', 'usces' ); ?></label>
893 <label for="chk_ord[delivery_address2]"><input type="checkbox" class="check_order" id="chk_ord[delivery_address2]" value="delivery_address2"<?php usces_checked( $chk_ord, 'delivery_address2' ); ?> /><?php esc_html_e( 'numbers', 'usces' ); ?></label>
894 <label for="chk_ord[delivery_address3]"><input type="checkbox" class="check_order" id="chk_ord[delivery_address3]" value="delivery_address3"<?php usces_checked( $chk_ord, 'delivery_address3' ); ?> /><?php esc_html_e( 'building name', 'usces' ); ?></label>
895 <label for="chk_ord[delivery_tel]"><input type="checkbox" class="check_order" id="chk_ord[delivery_tel]" value="delivery_tel"<?php usces_checked( $chk_ord, 'delivery_tel' ); ?> /><?php esc_html_e( 'Phone number', 'usces' ); ?></label>
896 <label for="chk_ord[delivery_fax]"><input type="checkbox" class="check_order" id="chk_ord[delivery_fax]" value="delivery_fax"<?php usces_checked( $chk_ord, 'delivery_fax' ); ?> /><?php esc_html_e( 'FAX number', 'usces' ); ?></label>
897 <?php
898 break;
899 case 'US':
900 default:
901 ?>
902 <label for="chk_ord[delivery_address2]"><input type="checkbox" class="check_order" id="chk_ord[delivery_address2]" value="delivery_address2"<?php usces_checked( $chk_ord, 'delivery_address2' ); ?> /><?php esc_html_e( 'Address Line1', 'usces' ); ?></label>
903 <label for="chk_ord[delivery_address3]"><input type="checkbox" class="check_order" id="chk_ord[delivery_address3]" value="delivery_address3"<?php usces_checked( $chk_ord, 'delivery_address3' ); ?> /><?php esc_html_e( 'Address Line2', 'usces' ); ?></label>
904 <label for="chk_ord[delivery_address1]"><input type="checkbox" class="check_order" id="chk_ord[delivery_address1]" value="delivery_address1"<?php usces_checked( $chk_ord, 'delivery_address1' ); ?> /><?php esc_html_e( 'city', 'usces' ); ?></label>
905 <label for="chk_ord[delivery_pref]"><input type="checkbox" class="check_order" id="chk_ord[delivery_pref]" value="delivery_pref"<?php usces_checked( $chk_ord, 'delivery_pref' ); ?> /><?php esc_html_e( 'State', 'usces' ); ?></label>
906 <label for="chk_ord[delivery_country]"><input type="checkbox" class="check_order" id="chk_ord[delivery_country]" value="delivery_country"<?php usces_checked( $chk_ord, 'delivery_country' ); ?> /><?php esc_html_e( 'Country', 'usces' ); ?></label>
907 <label for="chk_ord[delivery_zip]"><input type="checkbox" class="check_order" id="chk_ord[delivery_zip]" value="delivery_zip"<?php usces_checked( $chk_ord, 'delivery_zip' ); ?> /><?php esc_html_e( 'Zip', 'usces' ); ?></label>
908 <label for="chk_ord[delivery_tel]"><input type="checkbox" class="check_order" id="chk_ord[delivery_tel]" value="delivery_tel"<?php usces_checked( $chk_ord, 'delivery_tel' ); ?> /><?php esc_html_e( 'Phone number', 'usces' ); ?></label>
909 <label for="chk_ord[delivery_fax]"><input type="checkbox" class="check_order" id="chk_ord[delivery_fax]" value="delivery_fax"<?php usces_checked( $chk_ord, 'delivery_fax' ); ?> /><?php esc_html_e( 'FAX number', 'usces' ); ?></label>
910 <?php
911 break;
912 }
913
914 if ( ! empty( $csde_meta ) ) {
915 foreach ( $csde_meta as $key => $entry ) {
916 if ( 'fax_after' == $entry['position'] ) {
917 $csde_key = 'csde_' . $key;
918 $checked = usces_checked( $chk_ord, $csde_key, 'return' );
919 $name = $entry['name'];
920 echo '<label for="chk_ord[' . esc_attr( $csde_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $csde_key ) . ']" value="' . esc_attr( $csde_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
921 }
922 }
923 }
924 ?>
925 <?php do_action( 'usces_action_chk_ord_delivery', $chk_ord ); ?>
926 </fieldset>
927 <fieldset><legend><?php esc_html_e( 'Order Infomation', 'usces' ); ?></legend>
928 <label for="chk_ord[shipping_date]"><input type="checkbox" class="check_order" id="chk_ord[shipping_date]" value="shipping_date"<?php usces_checked( $chk_ord, 'shipping_date' ); ?> /><?php esc_html_e( 'shpping date', 'usces' ); ?></label>
929 <label for="chk_ord[peyment_method]"><input type="checkbox" class="check_order" id="chk_ord[peyment_method]" value="peyment_method"<?php usces_checked( $chk_ord, 'peyment_method' ); ?> /><?php esc_html_e( 'payment method', 'usces' ); ?></label>
930 <label for="chk_ord[delivery_method]"><input type="checkbox" class="check_order" id="chk_ord[delivery_method]" value="delivery_method"<?php usces_checked( $chk_ord, 'delivery_method' ); ?> /><?php esc_html_e( 'shipping option', 'usces' ); ?></label>
931 <label for="chk_ord[delivery_date]"><input type="checkbox" class="check_order" id="chk_ord[delivery_date]" value="delivery_date"<?php usces_checked( $chk_ord, 'delivery_date' ); ?> /><?php esc_html_e( 'Delivery date', 'usces' ); ?></label>
932 <label for="chk_ord[delivery_time]"><input type="checkbox" class="check_order" id="chk_ord[delivery_time]" value="delivery_time"<?php usces_checked( $chk_ord, 'delivery_time' ); ?> /><?php esc_html_e( 'delivery time', 'usces' ); ?></label>
933 <label for="chk_ord[delidue_date]"><input type="checkbox" class="check_order" id="chk_ord[delidue_date]" value="delidue_date"<?php usces_checked( $chk_ord, 'delidue_date' ); ?> /><?php esc_html_e( 'Shipping date', 'usces' ); ?></label>
934 <label for="chk_ord[status]"><input type="checkbox" class="check_order" id="chk_ord[status]" value="status"<?php usces_checked( $chk_ord, 'status' ); ?> /><?php esc_html_e( 'Status', 'usces' ); ?></label>
935 <label for="chk_ord[total_amount]"><input type="checkbox" class="check_order" id="chk_ord[total_amount]" value="total_amount" checked disabled /><?php esc_html_e( 'Total Amount', 'usces' ); ?></label>
936 <label for="chk_ord[getpoint]"><input type="checkbox" class="check_order" id="chk_ord[getpoint]" value="getpoint"<?php usces_checked( $chk_ord, 'getpoint' ); ?> /><?php esc_html_e( 'granted points', 'usces' ); ?></label>
937 <label for="chk_ord[usedpoint]"><input type="checkbox" class="check_order" id="chk_ord[usedpoint]" value="usedpoint"<?php usces_checked( $chk_ord, 'usedpoint' ); ?> /><?php esc_html_e( 'Used points', 'usces' ); ?></label>
938 <label for="chk_ord[discount]"><input type="checkbox" class="check_order" id="chk_ord[discount]" value="discount" checked disabled /><?php esc_html_e( 'Discount', 'usces' ); ?></label>
939 <label for="chk_ord[shipping_charge]"><input type="checkbox" class="check_order" id="chk_ord[shipping_charge]" value="shipping_charge" checked disabled /><?php esc_html_e( 'Shipping', 'usces' ); ?></label>
940 <label for="chk_ord[cod_fee]"><input type="checkbox" class="check_order" id="chk_ord[cod_fee]" value="cod_fee" checked disabled /><?php echo apply_filters( 'usces_filter_cod_label', __( 'COD fee', 'usces' ) ); // phpcs:ignore ?></label>
941 <label for="chk_ord[tax]"><input type="checkbox" class="check_order" id="chk_ord[tax]" value="tax" checked disabled /><?php esc_html_e( 'consumption tax', 'usces' ); ?></label>
942 <label for="chk_ord[note]"><input type="checkbox" class="check_order" id="chk_ord[note]" value="note"<?php usces_checked( $chk_ord, 'note' ); ?> /><?php esc_html_e( 'Notes', 'usces' ); ?></label>
943 <?php
944 if ( ! empty( $csod_meta ) ) {
945 foreach ( $csod_meta as $key => $entry ) {
946 $csod_key = 'csod_' . $key;
947 $checked = usces_checked( $chk_ord, $csod_key, 'return' );
948 $name = $entry['name'];
949 echo '<label for="chk_ord[' . esc_attr( $csod_key ) . ']"><input type="checkbox" class="check_order" id="chk_ord[' . esc_attr( $csod_key ) . ']" value="' . esc_attr( $csod_key ) . '"' . esc_attr( $checked ) . ' />' . esc_html( $name ) . '</label>';
950 }
951 }
952 ?>
953 <?php do_action( 'usces_action_chk_ord_order', $chk_ord ); ?>
954 </fieldset>
955 </div>
956 <?php echo apply_filters( 'usces_filter_order_list_footer', '' ); // phpcs:ignore ?>
957 <?php wp_nonce_field( 'order_list', 'wc_nonce' ); ?>
958 </form>
959 <?php usces_order_list_form_settlement_dialog(); ?>
960 <?php do_action( 'usces_action_order_list_footer' ); ?>
961 </div><!--usces_admin-->
962 </div><!--wrap-->
963