PluginProbe
Welcart e-Commerce / 2.11.30
Welcart e-Commerce v2.11.30
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 / includes / order_list.php

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

957 lines 52.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[word]', value: $(':input[name="search[word]"]').val() }));
411 form.append($('<input>', { type: 'hidden', name: 'searchSwitchStatus', value: $(':input[name="searchSwitchStatus"]').val() }));
412 form.append($('<input>', { type: 'hidden', name: 'ftype', value: 'csv' }));
413 form.append($('<input>', { type: 'hidden', name: 'wc_nonce', value: $("#wc_nonce").val() }));
414
415 $(".check_product").each(function() {
416 if($(this).prop('checked')) {
417 form.append($('<input>', { type: 'hidden', name: 'check['+$(this).val()+']', value: 'on' }));
418 }
419 });
420
421 if (listcheck.length > 0) {
422 form.append($('<input>', { type: 'hidden', name: 'listcheck', value: listcheck.join(',') }));
423 }
424
425 form.appendTo('body').submit().remove();
426 });
427 $('#dl_productlist').click(function() {
428 $('#dlProductListDialog').dialog('open');
429 });
430
431 $("#dlOrderListDialog").dialog({
432 bgiframe: true,
433 autoOpen: false,
434 height: 600,
435 width: 700,
436 resizable: true,
437 modal: true,
438 buttons: {
439 '<?php esc_html_e( 'close', 'usces' ); ?>': function() {
440 $(this).dialog('close');
441 }
442 },
443 close: function() {
444 }
445 });
446 $('#dl_ord').click(function() {
447 var listcheck = [];
448 $("input[name='listcheck[]']:checked").each(function() {
449 listcheck.push($(this).val());
450 });
451
452 var form = $('<form>', {
453 action: "<?php echo esc_url( USCES_ADMIN_URL ); ?>?page=usces_orderlist&order_action=dlorderlist&noheader=true",
454 method: 'post'
455 });
456 form.append($('<input>', { type: 'hidden', name: 'search[column]', value: $(':input[name="search[column]"]').val() }));
457 form.append($('<input>', { type: 'hidden', name: 'search[word]', value: $(':input[name="search[word]"]').val() }));
458 form.append($('<input>', { type: 'hidden', name: 'searchSwitchStatus', value: $(':input[name="searchSwitchStatus"]').val() }));
459 form.append($('<input>', { type: 'hidden', name: 'ftype', value: 'csv' }));
460 form.append($('<input>', { type: 'hidden', name: 'wc_nonce', value: $("#wc_nonce").val() }));
461
462 $(".check_order").each(function() {
463 if($(this).prop('checked')) {
464 form.append($('<input>', { type: 'hidden', name: 'check['+$(this).val()+']', value: 'on' }));
465 }
466 });
467
468 if (listcheck.length > 0) {
469 form.append($('<input>', { type: 'hidden', name: 'listcheck', value: listcheck.join(',') }));
470 }
471
472 form.appendTo('body').submit().remove();
473 });
474 $('#dl_orderlist').click(function() {
475 $('#dlOrderListDialog').dialog('open');
476 });
477
478 <?php if ( isset( $_GET['order_action'] ) && 'settlement_notice' == $_GET['order_action'] ) : ?>
479 $("#searchBox").css( "display","block" );
480 $("#searchSwitchStatus").val( "ON" );
481 $("#searchSwitchStatus").css( "display","none" );
482 $("#settlement_errorlog").trigger( "click" );
483 <?php endif; ?>
484
485 <?php
486 $set_startdate = ( ! empty( $startdate ) ) ? ', setDate: "' . $startdate . '", defaultDate: "' . $startdate . '"' : ''; // phpcs:ignore
487 $set_enddate = ( ! empty( $enddate ) ) ? ', setDate: "' . $enddate . '", defaultDate: "' . $enddate . '"' : ''; // phpcs:ignore
488 ?>
489 $("#startdate").datepicker({
490 dateFormat: "yy-mm-dd"<?php wel_esc_script_e( $set_startdate ); ?>
491 });
492 $("#enddate").datepicker({
493 dateFormat: "yy-mm-dd"<?php wel_esc_script_e( $set_enddate ); ?>
494 });
495 $("select[name='search[period]']").change(function() {
496 var period = $("select[name='search[period]'] option:selected").val();
497 if( period == <?php wel_esc_script_e( $period_specified_index ); ?> ) {
498 $("#period_specified").css( "display", "block" );
499 } else {
500 $("#period_specified").css( "display", "none" );
501 }
502 });
503 $("select[name='search[period]']").triggerHandler("change");
504 <?php if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>' ) ) : ?>
505 $(".regular_parent_order").removeClass( "rowSelection_even" );
506 $(".regular_parent_order").css( "background-color","#e6fe9e" );
507 <?php endif; ?>
508 <?php do_action( 'usces_action_order_list_document_ready_js', $DT ); // phpcs:ignore ?>
509 });
510 </script>
511
512 <div class="wrap">
513 <div class="usces_admin">
514 <form action="<?php echo esc_url( USCES_ADMIN_URL . '?page=usces_orderlist' ); ?>" method="post" name="tablesearch" id="form_tablesearch">
515 <h1>Welcart Management <?php esc_html_e( 'Order List', 'usces' ); ?></h1>
516 <p class="version_info">Version <?php echo esc_html( USCES_VERSION ); ?></p>
517 <?php usces_admin_action_status( $status, $message ); ?>
518
519 <div id="datatable">
520 <div id="tablenavi"><?php wel_esc_script_e( $dataTableNavigation ); ?></div>
521
522 <div id="tablesearch">
523 <div id="searchBox">
524 <table id="search_table">
525 <tr>
526 <td><?php esc_html_e( 'search fields', 'usces' ); ?></td>
527 <td><select name="search[column]" class="searchselect" id="searchselect">
528 <option value="none"> </option>
529 <?php
530 foreach ( (array) $arr_column as $key => $value ) :
531 if ( 'total_price' == $value ) {
532 continue;
533 }
534 $selected = ( $value == $arr_search['column'] ) ? ' selected="selected"' : '';
535 ?>
536 <option value="<?php echo esc_attr( $value ); ?>"<?php echo esc_attr( $selected ); ?>><?php echo esc_html( $key ); ?></option>
537 <?php
538 endforeach;
539 ?>
540 </select>
541 </td>
542 <td id="searchlabel"></td>
543 <td id="searchfield"></td>
544 <td rowspan="2"><input name="searchIn" type="submit" class="searchbutton button" value="<?php esc_attr_e( 'Search', 'usces' ); ?>" />
545 <input name="searchOut" type="submit" class="searchbutton button" value="<?php esc_attr_e( 'Cancellation', 'usces' ); ?>" />
546 <input name="searchSwitchStatus" id="searchSwitchStatus" type="hidden" value="<?php echo esc_attr( $DT->searchSwitchStatus ); // phpcs:ignore ?>" />
547 </td>
548 </tr>
549 <td><?php esc_html_e( 'search fields', 'usces' ); ?></td>
550 <td><select name="search[sku]" class="searchselect" id="searchselectsku">
551 <option value="none"> </option>
552 <option value="item_code"<?php echo( 'item_code' == $arr_search['sku'] ? ' selected="selected"' : '' ); ?>><?php esc_html_e( 'item code', 'usces' ); ?></option>
553 <option value="item_name"<?php echo( 'item_name' == $arr_search['sku'] ? ' selected="selected"' : '' ); ?>><?php esc_html_e( 'item name', 'usces' ); ?></option>
554 </select></td>
555 <td id="searchlabelsku"></td>
556 <td id="searchfieldsku"></td>
557 <tr>
558 </tr>
559 </table>
560 <table id="period_table">
561 <tr>
562 <?php
563 $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>';
564 ?>
565 <?php echo apply_filters( 'usces_filter_order_list_period_table', $period_table ); // phpcs:ignore ?>
566 <td><?php esc_html_e( 'Period', 'usces' ); ?></td>
567 <td><select name="search[period]" class="searchselect">
568 <?php
569 foreach ( (array) $DT->arr_period as $key => $value ) : // phpcs:ignore
570 $selected = ( $key == $arr_search['period'] ) ? ' selected="selected"' : '';
571 ?>
572 <option value="<?php echo esc_attr( $key ); ?>"<?php echo esc_attr( $selected ); ?>><?php echo esc_html( $value ); ?></option>
573 <?php
574 endforeach;
575 ?>
576 </select></td>
577 </tr>
578 </table>
579 <table id="change_table">
580 <tr>
581 <td><?php esc_html_e( 'Oparation in bulk', 'usces' ); ?></td>
582 <td><select name="allchange[column]" class="searchselect" id="changeselect">
583 <option value="none"> </option>
584 <option value="order_reciept"><?php esc_html_e( 'Edit the receiving money status', 'usces' ); ?></option>
585 <option value="order_status"><?php esc_html_e( 'Edit of status process', 'usces' ); ?></option>
586 <option value="delete"><?php esc_html_e( 'Delete in bulk', 'usces' ); ?></option>
587 <?php echo apply_filters( 'usces_filter_allchange_column', '' ); // phpcs:ignore ?>
588 </select></td>
589 <td id="changelabel"></td>
590 <td id="changefield"></td>
591 <td><input name="collective_change" type="button" class="searchbutton button" id="collective_change" value="<?php esc_attr_e( 'start', 'usces' ); ?>" />
592 </td>
593 </tr>
594 </table>
595 <input name="collective" id="orderlistaction" type="hidden" />
596 <table id="dl_list_table">
597 <tr>
598 <?php echo apply_filters( 'usces_filter_dl_list_table', '' ); // phpcs:ignore ?>
599 <?php do_action( 'usces_action_dl_list_table' ); ?>
600 <td><input type="button" id="dl_productlist" class="searchbutton button" value="<?php esc_attr_e( 'Download Product List', 'usces' ); ?>" /></td>
601 <td><input type="button" id="dl_orderlist" class="searchbutton button" value="<?php esc_attr_e( 'Download Order List', 'usces' ); ?>" /></td>
602 <?php if ( ! empty( $settlement_backup ) && 1 == $settlement_backup ) : ?>
603 <td><input type="button" id="settlementlog" class="searchbutton button" value="<?php esc_attr_e( 'Settlement previous log list', 'usces' ); ?>" /></td>
604 <?php endif; ?>
605 <?php if ( ! empty( $settlement_notice ) ) : ?>
606 <td><input type="button" id="settlement_errorlog" class="searchbutton button" value="<?php esc_attr_e( 'Settlement error log list', 'usces' ); ?>" /></td>
607 <?php endif; ?>
608 </tr>
609 </table>
610 <div<?php if ( has_action( 'usces_action_order_list_searchbox_bottom' ) ) echo ' class="searchbox_bottom"'; // phpcs:ignore ?>>
611 <?php do_action( 'usces_action_order_list_searchbox_bottom' ); ?>
612 </div>
613 </div>
614 <?php do_action( 'usces_action_order_list_searchbox' ); ?>
615 </div>
616
617 <table id="mainDataTable" cellspacing="1">
618 <?php
619 $list_header = '<th scope="col"><input name="allcheck" type="checkbox" value="" /></th>';
620 foreach ( (array) $arr_header as $value ) {
621 $list_header .= '<th scope="col">' . $value . '</th>';
622 }
623
624 if ( $order_list_delete_link ) {
625 $list_header .= '<th scope="col">&nbsp;</th>';
626 }
627
628 ?>
629 <tr>
630 <?php echo apply_filters( 'usces_filter_order_list_header', $list_header, $arr_header ); // phpcs:ignore ?>
631 </tr>
632 <?php
633 foreach ( (array) $rows as $data ) :
634 $list_detail = '<td align="center"><input name="listcheck[]" type="checkbox" value="' . $data['ID'] . '" /></td>';
635 foreach ( (array) $data as $key => $value ) {
636 if ( WCUtils::is_blank( $value ) ) {
637 $value = '&nbsp;';
638 }
639 if ( 'ID' === $key || 'deco_id' === $key ) {
640 $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>';
641 } elseif ( 'reg_id' == $key ) {
642 if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>' ) ) {
643 if ( '&nbsp;' == $value || '-' == $value ) {
644 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
645 } else {
646 $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>';
647 }
648 }
649 } elseif ( 'date' === $key ) {
650 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
651 } elseif ( 'mem_id' === $key ) {
652 if ( WCUtils::is_zero( $value ) ) {
653 $value = '&nbsp;';
654 }
655 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
656 } elseif ( 'name' === $key ) {
657 switch ( $applyform ) {
658 case 'JP':
659 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
660 break;
661 case 'US':
662 default:
663 $names = explode( ' ', $value );
664 $list_detail .= '<td>' . esc_html( $names[1] . ' ' . $names[0] ) . '</td>';
665 }
666 } elseif ( 'pref' === $key ) {
667 if ( __( '-- Select --', 'usces' ) == $value || '-- Select --' == $value ) {
668 $list_detail .= '<td>&nbsp;</td>';
669 } else {
670 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
671 }
672 } elseif ( 'delivery_method' === $key ) {
673 if ( -1 != $value ) {
674 $delivery_method_index = $this->get_delivery_method_index( $value );
675 $value = ( isset( $this->options['delivery_method'][ $delivery_method_index ]['name'] ) ) ? $this->options['delivery_method'][ $delivery_method_index ]['name'] : '&nbsp;';
676 } else {
677 $value = '&nbsp;';
678 }
679 $list_detail .= '<td class="green">' . esc_html( $value ) . '</td>';
680 } elseif ( 'total_price' === $key ) {
681 if ( $value < 0 ) {
682 $value = 0;
683 }
684 $list_detail .= '<td class="price">' . usces_crform( $value, true, false, 'return' ) . '</td>';
685 } elseif ( 'payment_name' === $key ) {
686 if ( '#none#' == $value ) {
687 $list_detail .= '<td>&nbsp;</td>';
688 } else {
689 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
690 }
691 } elseif ( 'receipt_status' === $key ) {
692 if ( __( 'unpaid', 'usces' ) == $value ) {
693 $list_detail .= '<td class="red">' . esc_html( $value ) . '</td>';
694 } elseif ( 'Pending' == $value ) {
695 $list_detail .= '<td class="red">' . esc_html( $value ) . '</td>';
696 } elseif ( __( 'payment confirmed', 'usces' ) == $value ) {
697 $list_detail .= '<td class="green">' . esc_html( $value ) . '</td>';
698 } else {
699 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
700 }
701 } elseif ( 'order_status' === $key ) {
702 if ( __( 'It has sent it out.', 'usces' ) == $value ) {
703 $process_status = esc_html( $value );
704 $process_status_class = ' class="green"';
705 } else {
706 $process_status = esc_html( $value );
707 $process_status_class = '';
708 }
709 $process_status = apply_filters( 'usces_filter_orderlist_process_status', $process_status, $value, $management_status );
710 $process_status_class = apply_filters( 'usces_filter_orderlist_process_status_class', $process_status_class, $value );
711 $list_detail .= '<td' . $process_status_class . '>' . $process_status . '</td>';
712 } elseif ( 'order_modified' === $key ) {
713 $list_detail .= '<td>' . esc_html( $value ) . '</td>';
714 }
715 }
716
717 if ( $order_list_delete_link ) {
718 $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>';
719 }
720
721 if ( defined( 'WCEX_AUTO_DELIVERY' ) && version_compare( WCEX_AUTO_DELIVERY_VERSION, '1.4.0', '>=' ) ) {
722 $trclass = ( ! empty( $data['reg_parent_id'] ) ) ? ' class="regular_parent_order"' : '';
723 } else {
724 $trclass = '';
725 }
726 ?>
727 <tr<?php echo apply_filters( 'usces_filter_order_list_detail_trclass', $trclass, $data ); // phpcs:ignore ?>>
728 <?php echo apply_filters( 'usces_filter_order_list_detail', $list_detail, $data, $curent_url ); // phpcs:ignore ?>
729 </tr>
730 <?php
731 endforeach;
732 ?>
733 </table>
734
735 </div>
736 <!-- [memory peak usage] <?php // echo round(memory_get_peak_usage()/1048576, 1); ?>Mb -->
737
738 <div id="dlProductListDialog" title="<?php esc_attr_e( 'Download Product List', 'usces' ); ?>">
739 <p><?php esc_html_e( 'Select the item you want, please press the download.', 'usces' ); ?></p>
740 <input type="button" class="button" id="dl_pro" value="<?php esc_attr_e( 'Download', 'usces' ); ?>" />
741 <fieldset><legend><?php esc_html_e( 'Header Information', 'usces' ); ?></legend>
742 <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>
743 <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>
744 <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>
745 <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>
746 <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>
747 <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>
748 <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>
749 <?php do_action( 'usces_action_chk_pro_head', $chk_pro ); ?>
750 </fieldset>
751 <fieldset><legend><?php esc_html_e( 'Product Information', 'usces' ); ?></legend>
752 <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>
753 <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>
754 <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>
755 <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>
756 <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>
757 <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>
758 <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>
759 <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>
760 <?php do_action( 'usces_action_chk_pro_detail', $chk_pro ); ?>
761 </fieldset>
762 </div>
763 <div id="dlOrderListDialog" title="<?php esc_attr_e( 'Download Order List', 'usces' ); ?>">
764 <p><?php esc_html_e( 'Select the item you want, please press the download.', 'usces' ); ?></p>
765 <input type="button" class="button" id="dl_ord" value="<?php esc_attr_e( 'Download', 'usces' ); ?>" />
766 <fieldset><legend><?php esc_html_e( 'Customer Information', 'usces' ); ?></legend>
767 <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>
768 <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>
769 <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>
770 <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>
771 <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>
772 <?php
773 if ( ! empty( $cscs_meta ) ) {
774 foreach ( $cscs_meta as $key => $entry ) {
775 if ( 'name_pre' == $entry['position'] ) {
776 $cscs_key = 'cscs_' . $key;
777 $checked = usces_checked( $chk_ord, $cscs_key, 'return' );
778 $name = $entry['name'];
779 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>';
780 }
781 }
782 }
783 ?>
784 <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>
785 <?php
786 switch ( $applyform ) {
787 case 'JP':
788 ?>
789 <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>
790 <?php
791 break;
792 }
793
794 if ( ! empty( $cscs_meta ) ) {
795 foreach ( $cscs_meta as $key => $entry ) {
796 if ( 'name_after' == $entry['position'] ) {
797 $cscs_key = 'cscs_' . $key;
798 $checked = usces_checked( $chk_ord, $cscs_key, 'return' );
799 $name = $entry['name'];
800 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>';
801 }
802 }
803 }
804
805 switch ( $applyform ) {
806 case 'JP':
807 ?>
808 <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>
809 <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>
810 <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>
811 <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>
812 <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>
813 <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>
814 <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>
815 <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>
816 <?php
817 break;
818 case 'US':
819 default:
820 ?>
821 <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>
822 <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>
823 <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>
824 <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>
825 <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>
826 <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>
827 <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>
828 <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>
829 <?php
830 break;
831 }
832
833 if ( ! empty( $cscs_meta ) ) {
834 foreach ( $cscs_meta as $key => $entry ) {
835 if ( 'fax_after' == $entry['position'] ) {
836 $cscs_key = 'cscs_' . $key;
837 $checked = usces_checked( $chk_ord, $cscs_key, 'return' );
838 $name = $entry['name'];
839 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>';
840 }
841 }
842 }
843 ?>
844 <?php do_action( 'usces_action_chk_ord_customer', $chk_ord ); ?>
845 </fieldset>
846 <fieldset><legend><?php esc_html_e( 'Shipping address information', 'usces' ); ?></legend>
847 <?php
848 if ( ! empty( $csde_meta ) ) {
849 foreach ( $csde_meta as $key => $entry ) {
850 if ( 'name_pre' == $entry['position'] ) {
851 $csde_key = 'csde_' . $key;
852 $checked = usces_checked( $chk_ord, $csde_key, 'return' );
853 $name = $entry['name'];
854 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>';
855 }
856 }
857 }
858 ?>
859 <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>
860 <?php
861 switch ( $applyform ) {
862 case 'JP':
863 ?>
864 <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>
865 <?php
866 break;
867 }
868
869 if ( ! empty( $csde_meta ) ) {
870 foreach ( $csde_meta as $key => $entry ) {
871 if ( 'name_after' == $entry['position'] ) {
872 $csde_key = 'csde_' . $key;
873 $checked = usces_checked( $chk_ord, $csde_key, 'return' );
874 $name = $entry['name'];
875 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>';
876 }
877 }
878 }
879
880 switch ( $applyform ) {
881 case 'JP':
882 ?>
883 <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>
884 <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>
885 <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>
886 <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>
887 <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>
888 <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>
889 <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>
890 <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>
891 <?php
892 break;
893 case 'US':
894 default:
895 ?>
896 <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>
897 <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>
898 <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>
899 <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>
900 <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>
901 <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>
902 <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>
903 <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>
904 <?php
905 break;
906 }
907
908 if ( ! empty( $csde_meta ) ) {
909 foreach ( $csde_meta as $key => $entry ) {
910 if ( 'fax_after' == $entry['position'] ) {
911 $csde_key = 'csde_' . $key;
912 $checked = usces_checked( $chk_ord, $csde_key, 'return' );
913 $name = $entry['name'];
914 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>';
915 }
916 }
917 }
918 ?>
919 <?php do_action( 'usces_action_chk_ord_delivery', $chk_ord ); ?>
920 </fieldset>
921 <fieldset><legend><?php esc_html_e( 'Order Infomation', 'usces' ); ?></legend>
922 <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>
923 <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>
924 <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>
925 <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>
926 <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>
927 <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>
928 <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>
929 <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>
930 <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>
931 <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>
932 <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>
933 <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>
934 <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>
935 <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>
936 <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>
937 <?php
938 if ( ! empty( $csod_meta ) ) {
939 foreach ( $csod_meta as $key => $entry ) {
940 $csod_key = 'csod_' . $key;
941 $checked = usces_checked( $chk_ord, $csod_key, 'return' );
942 $name = $entry['name'];
943 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>';
944 }
945 }
946 ?>
947 <?php do_action( 'usces_action_chk_ord_order', $chk_ord ); ?>
948 </fieldset>
949 </div>
950 <?php echo apply_filters( 'usces_filter_order_list_footer', '' ); // phpcs:ignore ?>
951 <?php wp_nonce_field( 'order_list', 'wc_nonce' ); ?>
952 </form>
953 <?php usces_order_list_form_settlement_dialog(); ?>
954 <?php do_action( 'usces_action_order_list_footer' ); ?>
955 </div><!--usces_admin-->
956 </div><!--wrap-->
957