| 1 |
<?php |
| 2 |
require_once( USCES_PLUGIN_DIR . "/classes/itemList.class.php" ); |
| 3 |
global $wpdb, $post; |
| 4 |
$wpdb->show_errors(); |
| 5 |
|
| 6 |
$tableName = $wpdb->posts; |
| 7 |
if( USCES_MYSQL_VERSION >= 5 ){ |
| 8 |
$arr_column = array( |
| 9 |
__('item code', 'usces') => 'item_code', |
| 10 |
__('item name', 'usces') => 'item_name', |
| 11 |
__('SKU code', 'usces') => 'sku_key', |
| 12 |
apply_filters('usces_filter_sellingprice_label', __('selling price', 'usces'), NULL, NULL) => 'price', |
| 13 |
__('stock', 'usces') => 'zaiko_num', |
| 14 |
__('stock status', 'usces') => 'zaiko', |
| 15 |
__('Categories', 'usces') => 'category', |
| 16 |
__('display status', 'usces') => 'display_status'); |
| 17 |
} else { |
| 18 |
$arr_column = array( |
| 19 |
__('item code', 'usces') => 'item_code', |
| 20 |
__('page title', 'usces') => 'post_title', |
| 21 |
__('SKU code', 'usces') => 'sku_key', |
| 22 |
apply_filters('usces_filter_sellingprice_label', __('selling price', 'usces'), NULL, NULL) => 'price', |
| 23 |
__('stock', 'usces') => 'zaiko_num', |
| 24 |
__('stock status', 'usces') => 'zaiko', |
| 25 |
__('Categories', 'usces') => 'category', |
| 26 |
__('display status', 'usces') => 'display_status'); |
| 27 |
} |
| 28 |
|
| 29 |
$DT = new dataList($tableName, $arr_column); |
| 30 |
$res = $DT->MakeTable(); |
| 31 |
$arr_search = $DT->GetSearchs(); |
| 32 |
$arr_status = get_option('usces_management_status'); |
| 33 |
$arr_header = $DT->GetListheaders(); |
| 34 |
$dataTableNavigation = $DT->GetDataTableNavigation(); |
| 35 |
$rows = $DT->rows; |
| 36 |
$zaiko_status = get_option('usces_zaiko_status'); |
| 37 |
$status = isset($_REQUEST['usces_status']) ? $_REQUEST['usces_status'] : $DT->get_action_status(); |
| 38 |
$message = isset($_REQUEST['usces_message']) ? urldecode($_REQUEST['usces_message']) : $DT->get_action_message(); |
| 39 |
$curent_url = urlencode(USCES_ADMIN_URL . '?' . $_SERVER['QUERY_STRING']); |
| 40 |
//20101111ysk start |
| 41 |
$usces_opt_item = get_option('usces_opt_item'); |
| 42 |
//20101111ysk end |
| 43 |
?> |
| 44 |
<script type="text/javascript"> |
| 45 |
jQuery(function($){ |
| 46 |
<?php if($status == 'success'){ ?> |
| 47 |
$("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000); |
| 48 |
<?php }else if($status == 'caution'){ ?> |
| 49 |
$("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000); |
| 50 |
<?php }else if($status == 'error'){ ?> |
| 51 |
$("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000); |
| 52 |
<?php } ?> |
| 53 |
|
| 54 |
$("#aAdditionalURLs").click(function () { |
| 55 |
$("#AdditionalURLs").toggle(); |
| 56 |
}); |
| 57 |
|
| 58 |
$("input[name='allcheck']").click(function () { |
| 59 |
if( $(this).attr("checked") ){ |
| 60 |
$("input[name*='listcheck']").attr({checked: true}); |
| 61 |
}else{ |
| 62 |
$("input[name*='listcheck']").attr({checked: false}); |
| 63 |
} |
| 64 |
}); |
| 65 |
|
| 66 |
$("#searchselect").change(function () { |
| 67 |
operation.change_search_field(); |
| 68 |
}); |
| 69 |
|
| 70 |
$("#changeselect").change(function () { |
| 71 |
operation.change_collective_field(); |
| 72 |
}); |
| 73 |
|
| 74 |
$("#collective_change").click(function () { |
| 75 |
if( $("input[name*='listcheck']:checked").length == 0 ) { |
| 76 |
alert("<?php _e('no items are selected', 'usces'); ?>"); |
| 77 |
$("#itemlistaction").val(''); |
| 78 |
return false; |
| 79 |
} |
| 80 |
var coll = $("#changeselect").val(); |
| 81 |
var mes = ''; |
| 82 |
if( coll == 'zaiko' ){ |
| 83 |
mes = <?php echo sprintf(__("'Stock status of items which you have checked will be changed into ' + %s + ' Stock status of each SKU will be all shown as ' + %s + ' Do you agree with this oparation?'", 'usces'), |
| 84 |
'$("select\[name=\"change\[word\]\[zaiko\]\"\] option:selected").html()', |
| 85 |
'$("select\[name=\"change\[word\]\[zaiko\]\"\] option:selected").html()'); ?>; |
| 86 |
}else if( coll == 'display_status' ){ |
| 87 |
mes = <?php echo sprintf(__("'Are you sure of changing all the items you have checked in to ' + %s + ' ?'", 'usces'), |
| 88 |
'$("select\[name=\"change\[word\]\[display_status\]\"\] option:selected").html()'); ?>; |
| 89 |
}else if(coll == 'delete'){ |
| 90 |
mes = <?php _e("'Are you sure of deleting all the items you have checked in bulk?'", 'usces'); ?>; |
| 91 |
}else{ |
| 92 |
$("#itemlistaction").val(''); |
| 93 |
return false; |
| 94 |
} |
| 95 |
if( !confirm(mes) ){ |
| 96 |
$("#itemlistaction").val(''); |
| 97 |
return false; |
| 98 |
} |
| 99 |
$("#itemlistaction").val('collective'); |
| 100 |
return true; |
| 101 |
}); |
| 102 |
|
| 103 |
operation = { |
| 104 |
change_search_field :function (){ |
| 105 |
|
| 106 |
var label = ''; |
| 107 |
var html = ''; |
| 108 |
var column = $("#searchselect").val(); |
| 109 |
|
| 110 |
if( column == 'item_name' ) { |
| 111 |
label = '<?php _e('key words', 'usces'); ?>'; |
| 112 |
html = '<input name="search[word][item_name]" type="text" value="<?php if(isset($arr_search['word']['item_name'])) echo esc_attr($arr_search['word']['item_name']); ?>" class="searchword" maxlength="50" />'; |
| 113 |
}else if( column == 'item_code' ) { |
| 114 |
label = '<?php _e('key words', 'usces'); ?>'; |
| 115 |
html = '<input name="search[word][item_code]" type="text" value="<?php if(isset($arr_search['word']['item_code'])) echo esc_attr($arr_search['word']['item_code']); ?>" class="searchword" maxlength="50" />'; |
| 116 |
}else if( column == 'post_title' ) { |
| 117 |
label = '<?php _e('key words', 'usces'); ?>'; |
| 118 |
html = '<input name="search[word][post_title]" type="text" value="<?php if(isset($arr_search['word']['post_title'])) echo esc_attr($arr_search['word']['post_title']); ?>" class="searchword" maxlength="50" />'; |
| 119 |
}else if( column == 'zaiko_num' ) { |
| 120 |
label = ''; |
| 121 |
html = ''; |
| 122 |
}else if( column == 'zaiko' ) { |
| 123 |
label = ''; |
| 124 |
html = '<select name="search[word][zaiko]" class="searchselect">'; |
| 125 |
<?php foreach($zaiko_status as $zkey => $zvalue){ |
| 126 |
if(isset($arr_search['word']['zaiko']) && $zkey == $arr_search['word']['zaiko']){ |
| 127 |
$zselected = ' selected="selected"'; |
| 128 |
}else{ |
| 129 |
$zselected = ''; |
| 130 |
} |
| 131 |
?> |
| 132 |
html += '<option value="<?php echo esc_attr($zkey); ?>"<?php echo $zselected ?>><?php echo esc_html($zvalue); ?></option>'; |
| 133 |
<?php } ?> |
| 134 |
html += '</select>'; |
| 135 |
}else if( column == 'category' ) { |
| 136 |
label = ''; |
| 137 |
html = '<select name="search[word][category]" class="searchselect">'; |
| 138 |
<?php |
| 139 |
$categories = get_categories(array('child_of' => USCES_ITEM_CAT_PARENT_ID)); |
| 140 |
foreach($categories as $ckey => $cvalue){ |
| 141 |
if(isset($arr_search['word']['category']) && $cvalue->term_id == $arr_search['word']['category']){ |
| 142 |
$cselected = ' selected="selected"'; |
| 143 |
}else{ |
| 144 |
$cselected = ''; |
| 145 |
} |
| 146 |
?> |
| 147 |
html += '<option value="<?php echo $cvalue->term_id; ?>"<?php echo $cselected ?>><?php echo esc_html($cvalue->name); ?></option>'; |
| 148 |
<?php } ?> |
| 149 |
html += '</select>'; |
| 150 |
}else if( column == 'display_status' ) { |
| 151 |
label = ''; |
| 152 |
html = '<select name="search[word][display_status]" class="searchselect">'; |
| 153 |
html += '<option value="publish"<?php if(isset($arr_search['word']['display_status']) && __('Published', 'usces') == $arr_search['word']['display_status']) echo ' selected="selected"'; ?>><?php _e('Published', 'usces'); ?></option>'; |
| 154 |
html += '<option value="future"<?php if(isset($arr_search['word']['display_status']) && __('Scheduled', 'usces') == $arr_search['word']['display_status']) echo ' selected="selected"'; ?>><?php _e('Scheduled', 'usces'); ?></option>'; |
| 155 |
html += '<option value="draft"<?php if(isset($arr_search['word']['display_status']) && __('Draft', 'usces') == $arr_search['word']['display_status']) echo ' selected="selected"'; ?>><?php _e('Draft', 'usces'); ?></option>'; |
| 156 |
html += '<option value="pending"<?php if(isset($arr_search['word']['display_status']) && __('Pending Review', 'usces') == $arr_search['word']['display_status']) echo ' selected="selected"'; ?>><?php _e('Pending Review', 'usces'); ?></option>'; |
| 157 |
html += '<option value="private"<?php if(isset($arr_search['word']['display_status']) && __('Closed', 'usces') == $arr_search['word']['display_status']) echo ' selected="selected"'; ?>><?php _e('Closed', 'usces'); ?></option>'; |
| 158 |
html += '<option value="trash"<?php if(isset($arr_search['word']['display_status']) && __('Trash', 'usces') == $arr_search['word']['display_status']) echo ' selected="selected"'; ?>><?php _e('Trash', 'usces'); ?></option>'; |
| 159 |
html += '</select>'; |
| 160 |
} |
| 161 |
|
| 162 |
$("#searchlabel").html( label ); |
| 163 |
$("#searchfield").html( html ); |
| 164 |
|
| 165 |
}, |
| 166 |
|
| 167 |
change_collective_field :function (){ |
| 168 |
|
| 169 |
var label = ''; |
| 170 |
var html = ''; |
| 171 |
var column = $("#changeselect").val(); |
| 172 |
|
| 173 |
if( column == 'zaiko' ) { |
| 174 |
label = ''; |
| 175 |
html = '<select name="change[word][zaiko]" class="searchselect">'; |
| 176 |
<?php foreach($zaiko_status as $zkey => $zvalue){ ?> |
| 177 |
html += '<option value="<?php echo $zkey; ?>"><?php echo esc_html($zvalue); ?></option>'; |
| 178 |
<?php } ?> |
| 179 |
html += '</select>'; |
| 180 |
}else if( column == 'display_status' ) { |
| 181 |
label = ''; |
| 182 |
html = '<select name="change[word][display_status]" class="searchselect">'; |
| 183 |
html += '<option value="publish"><?php _e('Published', 'usces'); ?></option>'; |
| 184 |
html += '<option value="private"><?php _e('Closed', 'usces'); ?></option>'; |
| 185 |
html += '</select>'; |
| 186 |
}else if( column == 'delete' ) { |
| 187 |
label = ''; |
| 188 |
html = ''; |
| 189 |
} |
| 190 |
|
| 191 |
$("#changelabel").html( label ); |
| 192 |
$("#changefield").html( html ); |
| 193 |
|
| 194 |
} |
| 195 |
}; |
| 196 |
|
| 197 |
|
| 198 |
/******************************************************************/ |
| 199 |
// ダイアログ生成 |
| 200 |
/******************************************************************/ |
| 201 |
$("#upload_dialog").dialog({ |
| 202 |
bgiframe: true, |
| 203 |
autoOpen: false, |
| 204 |
height: 350, |
| 205 |
modal: true, |
| 206 |
buttons: { |
| 207 |
Cancel: function() { |
| 208 |
$(this).dialog('close'); |
| 209 |
} |
| 210 |
}, |
| 211 |
close: function() { |
| 212 |
$("#usces_upcsv").val(''); |
| 213 |
} |
| 214 |
}); |
| 215 |
//20101111ysk start |
| 216 |
//$('#up_dlg').click(function() { |
| 217 |
$('#up_itemlist').click(function() { |
| 218 |
//20101111ysk end |
| 219 |
$('#upload_dialog').dialog( 'option' , 'title' , '<?php _e('Collective registration item', 'usces'); ?>' ); |
| 220 |
$('#upload_dialog').dialog( 'option' , 'width' , 500 ); |
| 221 |
$('#dialogExp').html( '<?php _e('Upload prescribed CSV file and perform the collective registration of the article.<br />Please choose a file, and push the registration start.', 'usces'); ?>' ); |
| 222 |
$('#upload_dialog').dialog( 'open' ); |
| 223 |
}); |
| 224 |
//20101111ysk start |
| 225 |
$("#dlItemListDialog").dialog({ |
| 226 |
bgiframe: true, |
| 227 |
autoOpen: false, |
| 228 |
height: 400, |
| 229 |
width: 700, |
| 230 |
resizable: true, |
| 231 |
modal: true, |
| 232 |
buttons: { |
| 233 |
'<?php _e('close', 'usces'); ?>': function() { |
| 234 |
$(this).dialog('close'); |
| 235 |
} |
| 236 |
}, |
| 237 |
close: function() { |
| 238 |
} |
| 239 |
}); |
| 240 |
$('#dl_item').click(function() { |
| 241 |
//20120123ysk start 0000385 |
| 242 |
//var args = "&search[column]="+$(':input[name="search[column]"]').val() |
| 243 |
// +"&search[word]["+$("#searchselect").val()+"]="+$(':input[name="search[word]['+$("#searchselect").val()+']"]').val() |
| 244 |
// +"&searchSwitchStatus="+$(':input[name="searchSwitchStatus"]').val() |
| 245 |
// +"&ftype="+$(':input[name="ftype_item[]"]:checked').val();//20120123ysk 0000385 |
| 246 |
var args = "&search[column]="+$(':input[name="search[column]"]').val() |
| 247 |
+"&search[word]["+$("#searchselect").val()+"]="+$(':input[name="search[word]['+$("#searchselect").val()+']"]').val() |
| 248 |
+"&searchSwitchStatus="+$(':input[name="searchSwitchStatus"]').val() |
| 249 |
+"&ftype=csv"; |
| 250 |
//20120123ysk end |
| 251 |
if($('#chk_header').attr('checked')) { |
| 252 |
args += '&chk_header=on'; |
| 253 |
} |
| 254 |
location.href = "<?php echo USCES_ADMIN_URL; ?>?page=usces_itemedit&action=dlitemlist&noheader=true"+args<?php echo apply_filters( 'usces_filter_item_list_dlargs', '' ); ?>; |
| 255 |
}); |
| 256 |
$('#dl_itemlist').click(function() { |
| 257 |
$('#dlItemListDialog').dialog('open'); |
| 258 |
}); |
| 259 |
//20101111ysk end |
| 260 |
<?php echo apply_filters( 'usces_filter_item_list_page_js', '' ); ?> |
| 261 |
}); |
| 262 |
|
| 263 |
function toggleVisibility(id) { |
| 264 |
var e = document.getElementById(id); |
| 265 |
if(e.style.display == 'block') { |
| 266 |
e.style.display = 'none'; |
| 267 |
document.getElementById("searchSwitchStatus").value = 'OFF'; |
| 268 |
} else { |
| 269 |
e.style.display = 'block'; |
| 270 |
document.getElementById("searchSwitchStatus").value = 'ON'; |
| 271 |
document.getElementById("searchVisiLink").style.display = 'none'; |
| 272 |
} |
| 273 |
}; |
| 274 |
|
| 275 |
function deleteconfirm(item_id){ |
| 276 |
if(confirm(<?php _e("'Are you sure of deleting the item, item code ' + item_id + ' ?'", 'usces'); ?>)){ |
| 277 |
return true; |
| 278 |
}else{ |
| 279 |
return false; |
| 280 |
} |
| 281 |
} |
| 282 |
|
| 283 |
|
| 284 |
jQuery(document).ready(function($){ |
| 285 |
$("table#mainDataTable tr:even").addClass("rowSelection_even"); |
| 286 |
$("table#mainDataTable tr").hover(function() { |
| 287 |
$(this).addClass("rowSelection_hilight"); |
| 288 |
}, |
| 289 |
function() { |
| 290 |
$(this).removeClass("rowSelection_hilight"); |
| 291 |
}); |
| 292 |
if( $("#searchSwitchStatus").val() == 'OFF'){ |
| 293 |
$("#searchBox").css("display", "none"); |
| 294 |
$("#searchVisiLink").html('<?php _e('Show the Operation field', 'usces'); ?>'); |
| 295 |
} else { |
| 296 |
$("#searchBox").css("display", "block"); |
| 297 |
$("#searchVisiLink").css("display", "none"); |
| 298 |
} |
| 299 |
|
| 300 |
operation.change_search_field(); |
| 301 |
|
| 302 |
}); |
| 303 |
</script> |
| 304 |
<div class="wrap"> |
| 305 |
<div class="usces_admin"> |
| 306 |
<form action="<?php echo USCES_ADMIN_URL.'?page=usces_itemedit'; ?>" method="post" name="tablesearch"> |
| 307 |
<h2>Welcart Shop <?php _e('Item list','usces'); ?></h2> |
| 308 |
<p class="version_info">Version <?php echo USCES_VERSION; ?></p> |
| 309 |
<div id="aniboxStatus" class="<?php echo $status; ?>"> |
| 310 |
<div id="anibox" class="clearfix"> |
| 311 |
<img src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" /> |
| 312 |
<div class="mes" id="info_massage"><?php echo $message; ?></div> |
| 313 |
</div> |
| 314 |
</div> |
| 315 |
|
| 316 |
<div id="datatable"> |
| 317 |
<div id="tablenavi"><?php echo $dataTableNavigation ?></div> |
| 318 |
|
| 319 |
<div id="tablesearch"> |
| 320 |
<div id="searchBox"> |
| 321 |
<table id="search_table"> |
| 322 |
<tr> |
| 323 |
<td><?php _e('search fields', 'usces'); ?></td> |
| 324 |
<td><select name="search[column]" class="searchselect" id="searchselect"> |
| 325 |
<option value="none"> </option> |
| 326 |
<?php foreach ($arr_column as $key => $value): |
| 327 |
if($value == $arr_search['column']){ |
| 328 |
$selected = ' selected="selected"'; |
| 329 |
}else{ |
| 330 |
$selected = ''; |
| 331 |
} |
| 332 |
if( $value != 'sku_key' && $value != 'price' ) : |
| 333 |
?> |
| 334 |
<?php if( $value == 'zaiko_num' ){ ?> |
| 335 |
<option value="<?php echo esc_attr($value); ?>"<?php echo $selected ?>><?php _e('items without stock', 'usces'); ?></option> |
| 336 |
<?php }else if( USCES_MYSQL_VERSION < 5 && $value == 'item_code' ){ continue; ?> |
| 337 |
<?php }else{ ?> |
| 338 |
<option value="<?php echo esc_attr($value); ?>"<?php echo $selected ?>><?php echo esc_html($key); ?></option> |
| 339 |
<?php } ?> |
| 340 |
<?php endif; endforeach; ?> |
| 341 |
</select></td> |
| 342 |
<td id="searchlabel"></td> |
| 343 |
<td id="searchfield"></td> |
| 344 |
<td><input name="searchIn" type="submit" class="searchbutton" value="<?php _e('Search', 'usces'); ?>" /> |
| 345 |
<input name="searchOut" type="submit" class="searchbutton" value="<?php _e('Cancellation', 'usces'); ?>" /> |
| 346 |
<input name="searchSwitchStatus" id="searchSwitchStatus" type="hidden" value="<?php echo $DT->searchSwitchStatus; ?>" /> |
| 347 |
</td> |
| 348 |
</tr> |
| 349 |
</table> |
| 350 |
<table id="change_table"> |
| 351 |
<tr> |
| 352 |
<td><?php _e('Oparation in bulk', 'usces'); ?></td> |
| 353 |
<td><select name="allchange[column]" class="searchselect" id="changeselect"> |
| 354 |
<option value="none"> </option> |
| 355 |
<option value="zaiko"><?php _e('Changes in stock status', 'usces'); ?></option> |
| 356 |
<option value="display_status"><?php _e('Edit the display status', 'usces'); ?></option> |
| 357 |
<option value="delete"><?php _e('Delete in bulk', 'usces'); ?></option> |
| 358 |
</select></td> |
| 359 |
<td id="changelabel"></td> |
| 360 |
<td id="changefield"></td> |
| 361 |
<td><input name="collective" type="submit" class="searchbutton" id="collective_change" value="<?php _e('start', 'usces'); ?>" /> |
| 362 |
<!--20101111ysk start--> |
| 363 |
<!-- <a href="#" id="up_dlg"><?php _e('Collective registration item', 'usces'); ?></a>--> |
| 364 |
</td> |
| 365 |
</tr> |
| 366 |
</table> |
| 367 |
<table id="dl_list_table"> |
| 368 |
<tr> |
| 369 |
<?php echo apply_filters( 'usces_filter_dl_item_list_table', '' ); ?> |
| 370 |
<td><input type="button" id="up_itemlist" class="searchbutton" value="<?php _e('Collective registration item', 'usces'); ?>" /></td> |
| 371 |
<td><input type="button" id="dl_itemlist" class="searchbutton" value="<?php _e('Download Item List', 'usces'); ?>" /></td> |
| 372 |
</tr> |
| 373 |
</table> |
| 374 |
<!--20101111ysk end--> |
| 375 |
</td> |
| 376 |
</tr> |
| 377 |
</table> |
| 378 |
<input name="action" id="itemlistaction" type="hidden" /> |
| 379 |
</div> |
| 380 |
</div> |
| 381 |
|
| 382 |
<table id="mainDataTable" cellspacing="1"> |
| 383 |
<tr> |
| 384 |
<th scope="col"><input name="allcheck" type="checkbox" value="" /></th> |
| 385 |
<th scope="col"> </th> |
| 386 |
<?php foreach ( (array)$arr_header as $key => $value ) : ?> |
| 387 |
<?php if ( $key == 'item_code' ) : ?> |
| 388 |
<th scope="col"><?php echo $value ?> / |
| 389 |
<?php elseif ( $key == 'item_name' || $key == 'post_title' ) : ?> |
| 390 |
<?php echo $value; ?></th> |
| 391 |
<?php elseif ( $key == 'price' ) : ?> |
| 392 |
<th scope="col"><?php echo $value; ?>(<?php usces_crcode(); ?>)</th> |
| 393 |
<?php else : ?> |
| 394 |
<th scope="col"><?php echo $value; ?></th> |
| 395 |
<?php endif; ?> |
| 396 |
<?php endforeach; ?> |
| 397 |
</tr> |
| 398 |
<?php foreach ( (array)$rows as $array ) : |
| 399 |
$pctid = (int)$this->get_mainpictid($array['item_code']); |
| 400 |
$post = get_post($array['ID']); |
| 401 |
$array['sku'] = $skus = $this->get_skus( $array['ID'], 'sort' ); |
| 402 |
$array['category'] = ""; |
| 403 |
$array['post_status'] = $post->post_status; |
| 404 |
?> |
| 405 |
<tr> |
| 406 |
<td width="20px" align="center"><input name="listcheck[]" type="checkbox" value="<?php echo (int)$array['ID']; ?>" /></td> |
| 407 |
<td width="50px"><a href="<?php echo USCES_ADMIN_URL.'?page=usces_itemedit&action=edit&post='.$array['ID'].'&usces_referer='.$curent_url; ?>" title="<?php echo esc_attr($array['item_name']); ?>"><?php echo wp_get_attachment_image( $pctid, array(50, 50), true ); ?></a></td> |
| 408 |
<?php foreach ( (array)$array as $key => $value ) : ?> |
| 409 |
<?php if( $key == 'item_code') : ?> |
| 410 |
<?php if( USCES_MYSQL_VERSION < 5 ){ $value = get_post_meta($array['ID'], '_itemCode', true); $array['item_code'] = $value; } ?> |
| 411 |
<td class="item"> |
| 412 |
<?php if( $value != '' ) : ?> |
| 413 |
<strong><?php echo esc_html($value); ?></strong> |
| 414 |
<?php else : ?> |
| 415 |
|
| 416 |
<?php endif; ?> |
| 417 |
<br /> |
| 418 |
<?php elseif( $key == 'item_name' ) : ?> |
| 419 |
<?php if( $value != '' ) : ?> |
| 420 |
<strong><?php echo esc_html($value); ?></strong> |
| 421 |
<?php else : ?> |
| 422 |
|
| 423 |
<?php endif; ?> |
| 424 |
<ul class="item_list_navi"> |
| 425 |
<li><a href="<?php echo USCES_ADMIN_URL.'?page=usces_itemedit&action=edit&post='.$array['ID'].'&usces_referer='.$curent_url; ?>"><?php _e('edit', 'usces'); ?></a></li> |
| 426 |
<li> | </li> |
| 427 |
<!--<li><a href="<?php echo wp_nonce_url("post.php?action=delete&post=".$array['ID'], 'delete-post_' . $array['ID']); ?>" onclick="return deleteconfirm('<?php echo esc_attr($array['item_code']); ?>');"><?php _e('Delete', 'usces'); ?></a></li>--> |
| 428 |
<?php |
| 429 |
if ( current_user_can('delete_post', $post->ID) ) { |
| 430 |
if ( 'trash' == $post->post_status ){ |
| 431 |
$actions['untrash'] = "<li><a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a></li><li> | </li>"; |
| 432 |
echo $actions['untrash']; |
| 433 |
}elseif ( EMPTY_TRASH_DAYS ){ |
| 434 |
$actions['trash'] = "<li><a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a></li>"; |
| 435 |
echo $actions['trash']; |
| 436 |
} |
| 437 |
if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ){ |
| 438 |
$actions['delete'] = "<li><a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a></li>"; |
| 439 |
echo $actions['delete']; |
| 440 |
} |
| 441 |
} |
| 442 |
?> |
| 443 |
</ul> |
| 444 |
</td> |
| 445 |
|
| 446 |
<?php elseif( $key == 'post_title' ) : ?> |
| 447 |
<?php if( $post->post_title != '' ) : ?> |
| 448 |
<strong><?php echo esc_html($post->post_title); ?></strong> |
| 449 |
<?php else : ?> |
| 450 |
|
| 451 |
<?php endif; ?> |
| 452 |
<ul class="item_list_navi"> |
| 453 |
<li><a href="<?php echo USCES_ADMIN_URL.'?page=usces_itemedit&action=edit&post='.$array['ID'].'&usces_referer='.$curent_url; ?>"><?php _e('edit', 'usces'); ?></a></li> |
| 454 |
<li> | </li> |
| 455 |
<li><a href="<?php echo wp_nonce_url("post.php?action=delete&post=".$array['ID'], 'delete-post_' . $array['ID']); ?>" onclick="return deleteconfirm('<?php echo esc_attr($array['item_code']); ?>');"><?php _e('Delete', 'usces'); ?></a></li> |
| 456 |
</ul> |
| 457 |
</td> |
| 458 |
|
| 459 |
<?php elseif( $key == 'sku' ): $no_sku = ( 0 === count($value) ) ? " " : ""; ?> |
| 460 |
|
| 461 |
<td class="sku"> |
| 462 |
<?php $i=0; foreach((array)$value as $key => $sv) { $bgc = ($i%2 == 1) ? ' bgc1' : ' bgc2'; $i++; ?> |
| 463 |
<div class="skuline<?php echo $bgc; ?>"><?php echo esc_html($sv['code']); ?></div> |
| 464 |
<?php } echo $no_sku; ?> |
| 465 |
</td> |
| 466 |
<td class="price"> |
| 467 |
<?php $i=0; foreach((array)$value as $key => $sv) { $bgc = ($i%2 == 1) ? ' bgc1' : ' bgc2'; $i++; ?> |
| 468 |
<div class="priceline<?php echo $bgc; ?>"><?php usces_crform( $sv['price'], true, false ); ?></div> |
| 469 |
<?php } echo $no_sku; ?> |
| 470 |
</td> |
| 471 |
<td class="zaikonum"> |
| 472 |
<?php $i=0; foreach((array)$value as $key => $sv) { $bgc = ($i%2 == 1) ? ' bgc1' : ' bgc2'; $i++; ?> |
| 473 |
<div class="priceline<?php echo $bgc; ?>"><?php echo (( WCUtils::is_blank($sv['stocknum']) || '0' != $sv['stocknum'] ) ? esc_html($sv['stocknum']) : " "); ?></div> |
| 474 |
<?php } echo $no_sku; ?> |
| 475 |
</td> |
| 476 |
<td class="zaiko"> |
| 477 |
<?php $i=0; foreach((array)$value as $key => $sv) { $zaikokey = $sv['stock']; $bgc = ($i%2 == 1) ? ' bgc1' : ' bgc2'; $i++; ?> |
| 478 |
<div class="zaikoline<?php echo $bgc; ?>"><?php echo esc_html($zaiko_status[$zaikokey]); ?></div> |
| 479 |
<?php } echo $no_sku; ?> |
| 480 |
</td> |
| 481 |
<?php elseif( $key == 'category' ) : ?> |
| 482 |
<td class="listcat"> |
| 483 |
<?php |
| 484 |
$cat_ids = wp_get_post_categories($array['ID']); |
| 485 |
if ( !empty( $cat_ids ) ) { |
| 486 |
$out = array(); |
| 487 |
foreach ( $cat_ids as $id ) |
| 488 |
$out[] = get_cat_name($id); |
| 489 |
echo join( ', ', $out ); |
| 490 |
} else { |
| 491 |
_e('Uncategorized'); |
| 492 |
} |
| 493 |
?> |
| 494 |
</td> |
| 495 |
<?php elseif( $key == 'post_status' ): ?> |
| 496 |
<td><?php |
| 497 |
switch ($value){ |
| 498 |
case 'publish': |
| 499 |
echo __('Published', 'usces'); |
| 500 |
break; |
| 501 |
case 'future': |
| 502 |
echo __('Scheduled', 'usces'); |
| 503 |
break; |
| 504 |
case 'draft': |
| 505 |
echo __('Draft', 'usces'); |
| 506 |
break; |
| 507 |
case 'pending': |
| 508 |
echo __('Pending Review', 'usces'); |
| 509 |
break; |
| 510 |
case 'trash': |
| 511 |
echo __('Trash', 'usces'); |
| 512 |
break; |
| 513 |
default: |
| 514 |
echo __('Closed', 'usces'); |
| 515 |
} ?><?php if( !empty( $post->post_password) ){echo '<br />'.__('Password protected');} ?></td> |
| 516 |
<?php endif; ?> |
| 517 |
<?php endforeach; ?> |
| 518 |
</tr> |
| 519 |
<?php endforeach; ?> |
| 520 |
</table> |
| 521 |
|
| 522 |
</div> |
| 523 |
<?php echo apply_filters( 'usces_filter_item_list_footer', '' ); ?> |
| 524 |
</form> |
| 525 |
<div id="upload_dialog"> |
| 526 |
<p id="dialogExp"></p> |
| 527 |
<form action="<?php echo USCES_ADMIN_URL; ?>" method="post" enctype="multipart/form-data" name="upform" id="upform"> |
| 528 |
<input name="usces_upcsv" type="file" id="usces_upcsv" style="width:100%" /> |
| 529 |
<?php echo apply_filters( 'usces_filter_item_list_upload_dialog', '' ); ?> |
| 530 |
<input name="itemcsv" type="submit" id="upcsv" value="<?php _e('Registration start', 'usces'); ?>" /> |
| 531 |
<input name="page" type="hidden" value="usces_itemedit" /> |
| 532 |
<input name="action" type="hidden" value="itemcsv" /> |
| 533 |
</form> |
| 534 |
<p><?php _e('Indication is updated after upload completion.', 'usces'); ?></p> |
| 535 |
<p><?php _e('Look at log to know the registration situation.(usc-e-shop/logs/itemcsv_log.txt)<br />The log is updated, overwrite, every upload.', 'usces'); ?></p> |
| 536 |
</div> |
| 537 |
<!--20101111ysk start--> |
| 538 |
<div id="dlItemListDialog" title="<?php _e('Download Item List', 'usces'); ?>"> |
| 539 |
<p><?php _e('Choose the file format, and push the download.', 'usces'); ?></p> |
| 540 |
<fieldset> |
| 541 |
<label for="chk_header"><input type="checkbox" class="check_item" id="chk_header" value="date"<?php if($usces_opt_item['chk_header'] == 1) echo ' checked'; ?> /><?php _e('To add a subject title at the first line','usces'); ?></label> |
| 542 |
<?php echo apply_filters( 'usces_filter_item_list_download_dialog', '' ); ?> |
| 543 |
<!--20120123ysk start 0000385--> |
| 544 |
<input type="button" id="dl_item" value="<?php _e('Download', 'usces'); ?>" /> |
| 545 |
<!--20120123ysk end--> |
| 546 |
</fieldset> |
| 547 |
</div> |
| 548 |
<!--20101111ysk end--> |
| 549 |
|
| 550 |
</div><!--usces_admin--> |
| 551 |
</div><!--wrap--> |
| 552 |
[memory peak usage] <?php echo round(memory_get_peak_usage()/1048576, 1); ?>Mb |