| 1 |
<?php |
| 2 |
$status = $this->action_status; |
| 3 |
$message = $this->action_message; |
| 4 |
$this->action_status = 'none'; |
| 5 |
$this->action_message = ''; |
| 6 |
|
| 7 |
require_once( USCES_PLUGIN_DIR . "/classes/dataList.class.php" ); |
| 8 |
global $wpdb; |
| 9 |
|
| 10 |
$tableName = $wpdb->prefix . "usces_member"; |
| 11 |
$arr_column = array( |
| 12 |
__('membership number', 'usces') => 'ID', |
| 13 |
__('name', 'usces') => 'name', |
| 14 |
__('Address', 'usces') => 'address', |
| 15 |
__('Phone number', 'usces') => 'tel', |
| 16 |
__('e-mail', 'usces') => 'email', |
| 17 |
__('Strated date', 'usces') => 'date', |
| 18 |
__('current point', 'usces') => 'point'); |
| 19 |
|
| 20 |
$DT = new dataList($tableName, $arr_column); |
| 21 |
$res = $DT->MakeTable(); |
| 22 |
$arr_search = $DT->GetSearchs(); |
| 23 |
//$arr_status = get_option('usces_management_status'); |
| 24 |
$arr_header = $DT->GetListheaders(); |
| 25 |
$dataTableNavigation = $DT->GetDataTableNavigation(); |
| 26 |
$rows = $DT->rows; |
| 27 |
|
| 28 |
//20100908ysk start |
| 29 |
$csmb_meta = usces_has_custom_field_meta('member'); |
| 30 |
$usces_opt_member = get_option('usces_opt_member'); |
| 31 |
$chk_mem = $usces_opt_member['chk_mem']; |
| 32 |
//20100908ysk end |
| 33 |
//20110411ysk start |
| 34 |
$applyform = usces_get_apply_addressform($this->options['system']['addressform']); |
| 35 |
//20110411ysk end |
| 36 |
?> |
| 37 |
<script type="text/javascript"> |
| 38 |
jQuery(function($){ |
| 39 |
<?php if($status == 'success'){ ?> |
| 40 |
$("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000); |
| 41 |
<?php }else if($status == 'caution'){ ?> |
| 42 |
$("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000); |
| 43 |
<?php }else if($status == 'error'){ ?> |
| 44 |
$("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000); |
| 45 |
<?php } ?> |
| 46 |
|
| 47 |
// $("#aAdditionalURLs").click(function () { |
| 48 |
// $("#AdditionalURLs").toggle(); |
| 49 |
// }); |
| 50 |
|
| 51 |
}); |
| 52 |
|
| 53 |
function toggleVisibility(id) { |
| 54 |
var e = document.getElementById(id); |
| 55 |
if(e.style.display == 'block') { |
| 56 |
e.style.display = 'none'; |
| 57 |
document.getElementById("searchSwitchStatus").value = 'OFF'; |
| 58 |
} else { |
| 59 |
e.style.display = 'block'; |
| 60 |
document.getElementById("searchSwitchStatus").value = 'ON'; |
| 61 |
document.getElementById("searchVisiLink").style.display = 'none'; |
| 62 |
} |
| 63 |
}; |
| 64 |
|
| 65 |
function deleteconfirm(member_id){ |
| 66 |
if(confirm(<?php _e("'Are you sure of deleting your membership number ' + member_id + ' ?'", 'usces'); ?>)){ |
| 67 |
return true; |
| 68 |
}else{ |
| 69 |
return false; |
| 70 |
} |
| 71 |
} |
| 72 |
|
| 73 |
jQuery(document).ready(function($){ |
| 74 |
$("table#mainDataTable tr:even").addClass("rowSelection_even"); |
| 75 |
$("table#mainDataTable tr").hover(function() { |
| 76 |
$(this).addClass("rowSelection_hilight"); |
| 77 |
}, |
| 78 |
function() { |
| 79 |
$(this).removeClass("rowSelection_hilight"); |
| 80 |
}); |
| 81 |
if( $("#searchSwitchStatus").val() == 'OFF'){ |
| 82 |
$("#searchBox").css("display", "none"); |
| 83 |
$("#searchVisiLink").html('<?php _e('Show the Operation field', 'usces'); ?>'); |
| 84 |
} else { |
| 85 |
$("#searchBox").css("display", "block"); |
| 86 |
$("#searchVisiLink").css("display", "none"); |
| 87 |
} |
| 88 |
|
| 89 |
//20100908ysk start |
| 90 |
$("#dlMemberListDialog").dialog({ |
| 91 |
bgiframe: true, |
| 92 |
autoOpen: false, |
| 93 |
height: 400, |
| 94 |
width: 700, |
| 95 |
resizable: true, |
| 96 |
modal: true, |
| 97 |
buttons: { |
| 98 |
'<?php _e('close', 'usces'); ?>': function() { |
| 99 |
$(this).dialog('close'); |
| 100 |
} |
| 101 |
}, |
| 102 |
close: function() { |
| 103 |
} |
| 104 |
}); |
| 105 |
$('#dl_mem').click(function() { |
| 106 |
//20120123ysk start 0000385 |
| 107 |
//var args = "&search[column]="+$(':input[name="search[column]"]').val() |
| 108 |
// +"&search[word]="+$(':input[name="search[word]"]').val() |
| 109 |
// +"&searchSwitchStatus="+$(':input[name="searchSwitchStatus"]').val() |
| 110 |
// +"&ftype="+$(':input[name="ftype_mem[]"]:checked').val(); |
| 111 |
var args = "&search[column]="+$(':input[name="search[column]"]').val() |
| 112 |
+"&search[word]="+$(':input[name="search[word]"]').val() |
| 113 |
+"&searchSwitchStatus="+$(':input[name="searchSwitchStatus"]').val() |
| 114 |
+"&ftype=csv"; |
| 115 |
//20120123ysk end |
| 116 |
$('*[class=check_member]').each(function(i) { |
| 117 |
if($(this).attr('checked')) { |
| 118 |
args += '&check['+$(this).val()+']=on'; |
| 119 |
} |
| 120 |
}); |
| 121 |
location.href = "<?php echo USCES_ADMIN_URL; ?>?page=usces_memberlist&member_action=dlmemberlist&noheader=true"+args; |
| 122 |
}); |
| 123 |
$('#dl_memberlist').click(function() { |
| 124 |
$('#dlMemberListDialog').dialog('open'); |
| 125 |
}); |
| 126 |
//20100908ysk end |
| 127 |
}); |
| 128 |
</script> |
| 129 |
<div class="wrap"> |
| 130 |
<div class="usces_admin"> |
| 131 |
|
| 132 |
<h2>Welcart Management <?php _e('List of Members','usces'); ?></h2> |
| 133 |
<p class="version_info">Version <?php echo USCES_VERSION; ?></p> |
| 134 |
<div id="aniboxStatus" class="<?php echo $status; ?>"> |
| 135 |
<div id="anibox" class="clearfix"> |
| 136 |
<img src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" /> |
| 137 |
<div class="mes" id="info_massage"><?php echo $message; ?></div> |
| 138 |
</div> |
| 139 |
</div> |
| 140 |
|
| 141 |
<div id="datatable"> |
| 142 |
<div id="tablenavi"><?php echo $dataTableNavigation ?></div> |
| 143 |
|
| 144 |
<div id="tablesearch"> |
| 145 |
<div id="searchBox"> |
| 146 |
<form action="<?php echo USCES_ADMIN_URL.'?page=usces_memberlist'; ?>" method="post" name="tablesearch"> |
| 147 |
<table id="search_table"> |
| 148 |
<tr> |
| 149 |
<td><?php _e('search fields', 'usces'); ?></td> |
| 150 |
<td><select name="search[column]" class="searchselect"> |
| 151 |
<option value="none"> </option> |
| 152 |
<?php foreach ((array)$arr_column as $key => $value): |
| 153 |
if($value == $arr_search['column']){ |
| 154 |
$selected = ' selected="selected"'; |
| 155 |
}else{ |
| 156 |
$selected = ''; |
| 157 |
} |
| 158 |
?> |
| 159 |
<option value="<?php echo esc_attr($value); ?>"<?php echo $selected; ?>><?php echo esc_html($key); ?></option> |
| 160 |
<?php endforeach; ?> |
| 161 |
</select></td> |
| 162 |
<td><?php _e('key words', 'usces'); ?></td> |
| 163 |
<td><input name="search[word]" type="text" value="<?php echo esc_attr($arr_search['word']); ?>" class="searchword" maxlength="50" /></td> |
| 164 |
<td><input name="searchIn" type="submit" class="searchbutton" value="<?php _e('Search', 'usces'); ?>" /> |
| 165 |
<input name="searchOut" type="submit" class="searchbutton" value="<?php _e('Cancellation', 'usces'); ?>" /> |
| 166 |
<input name="searchSwitchStatus" id="searchSwitchStatus" type="hidden" value="<?php echo esc_attr($DT->searchSwitchStatus); ?>" /> |
| 167 |
</td> |
| 168 |
</tr> |
| 169 |
</table> |
| 170 |
<!--20100908ysk start--> |
| 171 |
<table id="dl_list_table"> |
| 172 |
<tr> |
| 173 |
<td><input type="button" id="dl_memberlist" class="searchbutton" value="<?php _e('Download Member List', 'usces'); ?>" /></td> |
| 174 |
</tr> |
| 175 |
</table> |
| 176 |
<!--20100908ysk end--> |
| 177 |
|
| 178 |
</form> |
| 179 |
</div> |
| 180 |
</div> |
| 181 |
|
| 182 |
<table id="mainDataTable" cellspacing="1"> |
| 183 |
<tr> |
| 184 |
<?php foreach ( (array)$arr_header as $value ) : ?> |
| 185 |
<th scope="col"><?php echo $value; ?></th> |
| 186 |
<?php endforeach; ?> |
| 187 |
<th scope="col"> </th> |
| 188 |
</tr> |
| 189 |
<?php foreach ( (array)$rows as $array ) : ?> |
| 190 |
<tr> |
| 191 |
<?php foreach ( (array)$array as $key => $value ) : ?> |
| 192 |
<?php if( WCUtils::is_blank($value) ) $value = ' '; ?> |
| 193 |
<?php if( $key == 'ID' ): ?> |
| 194 |
<td><a href="<?php echo USCES_ADMIN_URL.'?page=usces_memberlist&member_action=edit&member_id=' . esc_attr($value); ?>"><?php esc_html_e($value); ?></a></td> |
| 195 |
<?php elseif( $key == 'name' ): ?> |
| 196 |
<td> |
| 197 |
<?php |
| 198 |
$names = explode(' ', $value); |
| 199 |
usces_localized_name( esc_html($names[0]), esc_html($names[1])); |
| 200 |
?> |
| 201 |
</td> |
| 202 |
<?php elseif( $key == 'address' ): |
| 203 |
$pos = strpos( $value, __('-- Select --','usces') ); |
| 204 |
if( $pos !== false ) $value = ' '; |
| 205 |
?> |
| 206 |
<td><?php esc_html_e($value); ?></td> |
| 207 |
<?php elseif( $key == 'point' ): ?> |
| 208 |
<td class="right"><?php esc_html_e($value); ?></td> |
| 209 |
<?php else: ?> |
| 210 |
<td><?php esc_html_e($value); ?></td> |
| 211 |
<?php endif; ?> |
| 212 |
<?php endforeach; ?> |
| 213 |
<td><a href="<?php echo USCES_ADMIN_URL.'?page=usces_memberlist&member_action=delete&member_id=' . $array['ID']; ?>" onclick="return deleteconfirm('<?php echo $array['ID']; ?>');"><span style="color:#FF0000; font-size:9px;"><?php _e('Delete', 'usces'); ?></span></a></td> |
| 214 |
</tr> |
| 215 |
<?php endforeach; ?> |
| 216 |
</table> |
| 217 |
|
| 218 |
</div> |
| 219 |
<!--20100908ysk start--> |
| 220 |
<div id="dlMemberListDialog" title="<?php _e('Download Member List', 'usces'); ?>"> |
| 221 |
<p><?php _e('Select the item you want, please press the download.', 'usces'); ?></p> |
| 222 |
<fieldset> |
| 223 |
<input type="button" id="dl_mem" value="<?php _e('Download', 'usces'); ?>" /> |
| 224 |
</fieldset> |
| 225 |
<fieldset><legend><?php _e('Membership information', 'usces'); ?></legend> |
| 226 |
<label for="chk_mem[ID]"><input type="checkbox" class="check_member" id="chk_mem[ID]" value="ID" checked disabled /><?php _e('membership number', 'usces'); ?></label> |
| 227 |
<label for="chk_mem[email]"><input type="checkbox" class="check_member" id="chk_mem[email]" value="email"<?php usces_checked($chk_mem, 'email'); ?> /><?php _e('e-mail', 'usces'); ?></label> |
| 228 |
<?php |
| 229 |
if(!empty($csmb_meta)) { |
| 230 |
foreach($csmb_meta as $key => $entry) { |
| 231 |
if($entry['position'] == 'name_pre') { |
| 232 |
//20110208ysk start |
| 233 |
$csmb_key = 'csmb_'.$key; |
| 234 |
//$checked = ($chk_mem[$entry['name']] == 1) ? ' checked' : ''; |
| 235 |
//$checked = ($chk_mem[$csmb_key] == 1) ? ' checked' : ''; |
| 236 |
$checked = usces_checked( $chk_mem, $csmb_key, 'return' ); |
| 237 |
$name = $entry['name']; |
| 238 |
//echo '<label for="chk_mem['.$name.']"><input type="checkbox" class="check_member" id="chk_mem['.$name.']" value="'.$name.'"'.$checked.' />'.$name.'</label>'; |
| 239 |
echo '<label for="chk_mem['.$csmb_key.']"><input type="checkbox" class="check_member" id="chk_mem['.esc_attr($csmb_key).']" value="'.esc_attr($csmb_key).'"'.$checked.' />'.esc_html($name).'</label>'."\n";//20111116ysk 0000302 |
| 240 |
//20110208ysk end |
| 241 |
} |
| 242 |
} |
| 243 |
} |
| 244 |
//20110411ysk start |
| 245 |
?> |
| 246 |
<label for="chk_mem[name]"><input type="checkbox" class="check_member" id="chk_mem[name]" value="name" checked disabled /><?php _e('name', 'usces'); ?></label> |
| 247 |
<?php |
| 248 |
switch($applyform) { |
| 249 |
case 'JP': |
| 250 |
?> |
| 251 |
<label for="chk_mem[kana]"><input type="checkbox" class="check_member" id="chk_mem[kana]" value="kana"<?php usces_checked($chk_mem, 'kana'); ?> /><?php _e('furigana','usces'); ?></label> |
| 252 |
<?php |
| 253 |
break; |
| 254 |
} |
| 255 |
//20110411ysk end |
| 256 |
|
| 257 |
if(!empty($csmb_meta)) { |
| 258 |
foreach($csmb_meta as $key => $entry) { |
| 259 |
if($entry['position'] == 'name_after') { |
| 260 |
//20110208ysk start |
| 261 |
$csmb_key = 'csmb_'.$key; |
| 262 |
//$checked = ($chk_mem[$entry['name']] == 1) ? ' checked' : ''; |
| 263 |
//$checked = ($chk_mem[$csmb_key] == 1) ? ' checked' : ''; |
| 264 |
$checked = usces_checked( $chk_mem, $csmb_key, 'return' ); |
| 265 |
$name = $entry['name']; |
| 266 |
//echo '<label for="chk_mem['.$name.']"><input type="checkbox" class="check_member" id="chk_mem['.$name.']" value="'.$name.'"'.$checked.' />'.$name.'</label>'; |
| 267 |
echo '<label for="chk_mem['.esc_attr($csmb_key).']"><input type="checkbox" class="check_member" id="chk_mem['.esc_attr($csmb_key).']" value="'.esc_attr($csmb_key).'"'.$checked.' />'.esc_html($name).'</label>'."\n";//20111116ysk 0000302 |
| 268 |
//20110208ysk end |
| 269 |
} |
| 270 |
} |
| 271 |
} |
| 272 |
|
| 273 |
//20110411ysk start |
| 274 |
switch($applyform) { |
| 275 |
case 'JP': |
| 276 |
?> |
| 277 |
<label for="chk_mem[zip]"><input type="checkbox" class="check_member" id="chk_mem[zip]" value="zip"<?php usces_checked($chk_mem, 'zip'); ?> /><?php _e('Zip/Postal Code', 'usces'); ?></label> |
| 278 |
<label for="chk_mem[country]"><input type="checkbox" class="check_member" id="chk_mem[country]" value="country" checked disabled /><?php _e('Country', 'usces'); ?></label> |
| 279 |
<label for="chk_mem[pref]"><input type="checkbox" class="check_member" id="chk_mem[pref]" value="pref" checked disabled /><?php _e('Province', 'usces'); ?></label> |
| 280 |
<label for="chk_mem[address1]"><input type="checkbox" class="check_member" id="chk_mem[address1]" value="address1" checked disabled /><?php _e('city', 'usces'); ?></label> |
| 281 |
<label for="chk_mem[address2]"><input type="checkbox" class="check_member" id="chk_mem[address2]" value="address2" checked disabled /><?php _e('numbers', 'usces'); ?></label> |
| 282 |
<label for="chk_mem[address3]"><input type="checkbox" class="check_member" id="chk_mem[address3]" value="address3" checked disabled /><?php _e('building name', 'usces'); ?></label> |
| 283 |
<label for="chk_mem[tel]"><input type="checkbox" class="check_member" id="chk_mem[tel]" value="tel"<?php usces_checked($chk_mem, 'tel'); ?> /><?php _e('Phone number', 'usces'); ?></label> |
| 284 |
<label for="chk_mem[fax]"><input type="checkbox" class="check_member" id="chk_mem[fax]" value="fax"<?php usces_checked($chk_mem, 'fax'); ?> /><?php _e('FAX number', 'usces'); ?></label> |
| 285 |
<?php |
| 286 |
break; |
| 287 |
case 'US': |
| 288 |
default: |
| 289 |
?> |
| 290 |
<label for="chk_mem[address2]"><input type="checkbox" class="check_member" id="chk_mem[address2]" value="address2" checked disabled /><?php _e('Address Line1', 'usces'); ?></label> |
| 291 |
<label for="chk_mem[address3]"><input type="checkbox" class="check_member" id="chk_mem[address3]" value="address3" checked disabled /><?php _e('Address Line2', 'usces'); ?></label> |
| 292 |
<label for="chk_mem[address1]"><input type="checkbox" class="check_member" id="chk_mem[address1]" value="address1" checked disabled /><?php _e('city', 'usces'); ?></label> |
| 293 |
<label for="chk_mem[pref]"><input type="checkbox" class="check_member" id="chk_mem[pref]" value="pref" checked disabled /><?php _e('State', 'usces'); ?></label> |
| 294 |
<label for="chk_mem[country]"><input type="checkbox" class="check_member" id="chk_mem[country]" value="country" checked disabled /><?php _e('Country', 'usces'); ?></label> |
| 295 |
<label for="chk_mem[zip]"><input type="checkbox" class="check_member" id="chk_mem[zip]" value="zip"<?php usces_checked($chk_mem, 'zip'); ?> /><?php _e('Zip', 'usces'); ?></label> |
| 296 |
<label for="chk_mem[tel]"><input type="checkbox" class="check_member" id="chk_mem[tel]" value="tel"<?php usces_checked($chk_mem, 'tel'); ?> /><?php _e('Phone number', 'usces'); ?></label> |
| 297 |
<label for="chk_mem[fax]"><input type="checkbox" class="check_member" id="chk_mem[fax]" value="fax"<?php usces_checked($chk_mem, 'fax'); ?> /><?php _e('FAX number', 'usces'); ?></label> |
| 298 |
<?php |
| 299 |
break; |
| 300 |
} |
| 301 |
//20110411ysk end |
| 302 |
|
| 303 |
if(!empty($csmb_meta)) { |
| 304 |
foreach($csmb_meta as $key => $entry) { |
| 305 |
if($entry['position'] == 'fax_after') { |
| 306 |
//20110208ysk start |
| 307 |
$csmb_key = 'csmb_'.$key; |
| 308 |
//$checked = ($chk_mem[$entry['name']] == 1) ? ' checked' : ''; |
| 309 |
//$checked = ($chk_mem[$csmb_key] == 1) ? ' checked' : ''; |
| 310 |
$checked = usces_checked( $chk_mem, $csmb_key, 'return' ); |
| 311 |
$name = $entry['name']; |
| 312 |
//echo '<label for="chk_mem['.$name.']"><input type="checkbox" class="check_member" id="chk_mem['.$name.']" value="'.$name.'"'.$checked.' />'.$name.'</label>'; |
| 313 |
echo '<label for="chk_mem['.esc_attr($csmb_key).']"><input type="checkbox" class="check_member" id="chk_mem['.esc_attr($csmb_key).']" value="'.esc_attr($csmb_key).'"'.$checked.' />'.esc_html($name).'</label>'."\n";//20111116ysk 0000302 |
| 314 |
//20110208ysk end |
| 315 |
} |
| 316 |
} |
| 317 |
} |
| 318 |
?> |
| 319 |
<label for="chk_mem[date]"><input type="checkbox" class="check_member" id="chk_mem[date]" value="date"<?php usces_checked($chk_mem, 'date'); ?> /><?php _e('Strated date','usces'); ?></label> |
| 320 |
<label for="chk_mem[point]"><input type="checkbox" class="check_member" id="chk_mem[point]" value="point"<?php usces_checked($chk_mem, 'point'); ?> /><?php _e('current point','usces'); ?></label> |
| 321 |
<label for="chk_mem[rank]"><input type="checkbox" class="check_member" id="chk_mem[rank]" value="rank"<?php usces_checked($chk_mem, 'rank'); ?> /><?php _e('Rank', 'usces'); ?></label> |
| 322 |
<?php do_action( 'usces_action_chk_mem', $chk_mem ); ?> |
| 323 |
</fieldset> |
| 324 |
</div> |
| 325 |
<!--20100908ysk end--> |
| 326 |
</div><!--usces_admin--> |
| 327 |
</div><!--wrap--> |
| 328 |
<script type="text/javascript"> |
| 329 |
// rowSelection("mainDataTable"); |
| 330 |
</script> |
| 331 |
|