| @@ -1,330 +1,342 @@ | ||
| 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+"&wc_nonce=<?php echo wp_create_nonce( 'dlmemberlist' ); ?>"; | |
| 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'] . '&wc_nonce=' . wp_create_nonce( 'delete_member' ); ?>" 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> | |
| 1 | +<?php | |
| 2 | +require_once( USCES_PLUGIN_DIR . "/classes/dataList.class.php" ); | |
| 3 | +global $wpdb; | |
| 4 | + | |
| 5 | +$tableName = usces_get_tablename( 'usces_member' ); | |
| 6 | +$arr_column = array( | |
| 7 | + __('membership number', 'usces') => 'ID', | |
| 8 | + __('name', 'usces') => 'name', | |
| 9 | + __('Address', 'usces') => 'address', | |
| 10 | + __('Phone number', 'usces') => 'tel', | |
| 11 | + __('e-mail', 'usces') => 'email', | |
| 12 | + __('Strated date', 'usces') => 'date', | |
| 13 | + __('current point', 'usces') => 'point'); | |
| 14 | +if( !usces_is_membersystem_point() ) { | |
| 15 | + array_pop($arr_column); | |
| 16 | +} | |
| 17 | + | |
| 18 | +$DT = new dataList($tableName, $arr_column); | |
| 19 | +$res = $DT->MakeTable(); | |
| 20 | +$arr_search = $DT->GetSearchs(); | |
| 21 | +$arr_header = $DT->GetListheaders(); | |
| 22 | +$dataTableNavigation = $DT->GetDataTableNavigation(); | |
| 23 | +$rows = $DT->rows; | |
| 24 | + | |
| 25 | +$usces_admin_path = ''; | |
| 26 | +$admin_perse = explode('/', $_SERVER['REQUEST_URI']); | |
| 27 | +$apct = count($admin_perse) - 1; | |
| 28 | +for($ap=0; $ap < $apct; $ap++){ | |
| 29 | + $usces_admin_path .= $admin_perse[$ap] . '/'; | |
| 30 | +} | |
| 31 | + | |
| 32 | +$csmb_meta = usces_has_custom_field_meta('member'); | |
| 33 | +$usces_opt_member = get_option('usces_opt_member'); | |
| 34 | +$chk_mem = (isset($usces_opt_member['chk_mem'])) ? $usces_opt_member['chk_mem'] : []; | |
| 35 | +$applyform = usces_get_apply_addressform($this->options['system']['addressform']); | |
| 36 | + | |
| 37 | +$member_list_delete_link = ( isset( $this->options['system']['member_list_delete_link'] ) ) ? $this->options['system']['member_list_delete_link'] : 0; | |
| 38 | + | |
| 39 | +?> | |
| 40 | +<script type="text/javascript"> | |
| 41 | +function deleteconfirm(member_id){ | |
| 42 | + if(confirm(<?php _e("'Are you sure of deleting your membership number ' + member_id + ' ?'", 'usces'); ?>)){ | |
| 43 | + return true; | |
| 44 | + }else{ | |
| 45 | + return false; | |
| 46 | + } | |
| 47 | +} | |
| 48 | + | |
| 49 | +jQuery(document).ready(function($){ | |
| 50 | + $("table#mainDataTable tr:even").addClass("rowSelection_even"); | |
| 51 | + $("table#mainDataTable tr").hover(function() { | |
| 52 | + $(this).addClass("rowSelection_hilight"); | |
| 53 | + }, | |
| 54 | + function() { | |
| 55 | + $(this).removeClass("rowSelection_hilight"); | |
| 56 | + }); | |
| 57 | + | |
| 58 | + $(document).on( "click", "#searchVisiLink", function() { | |
| 59 | + if( $("#searchBox").css("display") == "block" ) { | |
| 60 | + $("#searchBox").css("display", "none"); | |
| 61 | + $("#searchVisiLink").html('<?php _e('Show the Operation field', 'usces'); ?>'); | |
| 62 | + } else { | |
| 63 | + $("#searchBox").css("display", "block"); | |
| 64 | + $("#searchVisiLink").html('<?php _e('Hide the Operation field', 'usces'); ?>'); | |
| 65 | + } | |
| 66 | + }); | |
| 67 | + | |
| 68 | + (function setCookie() { | |
| 69 | + <?php | |
| 70 | + $data_cookie = []; | |
| 71 | + $data_cookie['placeholder_escape'] = $DT->placeholder_escape; | |
| 72 | + $data_cookie['startRow'] = $DT->startRow; //表示開始行番号 | |
| 73 | + $data_cookie['sortColumn'] = $DT->sortColumn; //現在ソート中のフィールド | |
| 74 | + $data_cookie['totalRow'] = $DT->totalRow; //全行数 | |
| 75 | + $data_cookie['selectedRow'] = $DT->selectedRow; //絞り込まれた行数 | |
| 76 | + $data_cookie['currentPage'] = $DT->currentPage; //現在のページNo | |
| 77 | + $data_cookie['previousPage'] = $DT->previousPage; //前のページNo | |
| 78 | + $data_cookie['nextPage'] = $DT->nextPage; //次のページNo | |
| 79 | + $data_cookie['lastPage'] = $DT->lastPage; //最終ページNo | |
| 80 | + $data_cookie['userHeaderNames'] = $DT->userHeaderNames;//全てのフィールド | |
| 81 | + $data_cookie['sortSwitchs'] = $DT->sortSwitchs; //各フィールド毎の昇順降順スイッチ | |
| 82 | + $data_cookie['searchSql'] = $DT->searchSql; | |
| 83 | + $data_cookie['arr_search'] = $DT->arr_search; | |
| 84 | + $data_cookie['searchSwitchStatus'] = $DT->searchSwitchStatus; | |
| 85 | + ?> | |
| 86 | + $.cookie('<?php echo esc_attr( "{$DT->table}_path" ); ?>', '<?php echo esc_attr( $usces_admin_path ); ?>', { path: "<?php echo esc_attr( $usces_admin_path ); ?>", domain: ""}); | |
| 87 | + $.cookie('<?php echo esc_attr( "{$DT->table}" );?>', '<?php echo str_replace( "'", "\'", json_encode( $data_cookie ) ); ?>', { path: "<?php echo esc_attr( $usces_admin_path ); ?>", domain: ""}); | |
| 88 | + })(); | |
| 89 | + | |
| 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 | + | |
| 106 | + $("input[name='allcheck']").click(function () { | |
| 107 | + if ($(this).prop("checked")) { | |
| 108 | + $("input[name*='listcheck']").prop("checked", true); | |
| 109 | + } else { | |
| 110 | + $("input[name*='listcheck']").prop("checked", false); | |
| 111 | + } | |
| 112 | + }); | |
| 113 | + $('#dl_mem').click(function() { | |
| 114 | + var listcheck = []; | |
| 115 | + $("input[name='listcheck[]']:checked").each(function() { | |
| 116 | + listcheck.push($(this).val()); | |
| 117 | + }); | |
| 118 | + | |
| 119 | + var form = $('<form>', { | |
| 120 | + action: "<?php echo USCES_ADMIN_URL; ?>?page=usces_memberlist&member_action=dlmemberlist&noheader=true", | |
| 121 | + method: 'post' | |
| 122 | + }); | |
| 123 | + form.append($('<input>', { type: 'hidden', name: 'search[column]', value: $(':input[name="search[column]"]').val() })); | |
| 124 | + form.append($('<input>', { type: 'hidden', name: 'search[word]', value: $(':input[name="search[word]"]').val() })); | |
| 125 | + form.append($('<input>', { type: 'hidden', name: 'searchSwitchStatus', value: $(':input[name="searchSwitchStatus"]').val() })); | |
| 126 | + form.append($('<input>', { type: 'hidden', name: 'ftype', value: 'csv' })); | |
| 127 | + form.append($('<input>', { type: 'hidden', name: 'wc_nonce', value: '<?php echo wp_create_nonce( "post_member" ); ?>' })); | |
| 128 | + | |
| 129 | + $('*[class=check_member]').each(function() { | |
| 130 | + if($(this).prop('checked')) { | |
| 131 | + form.append($('<input>', { type: 'hidden', name: 'check['+$(this).val()+']', value: 'on' })); | |
| 132 | + } | |
| 133 | + }); | |
| 134 | + | |
| 135 | + if (listcheck.length > 0) { | |
| 136 | + form.append($('<input>', { type: 'hidden', name: 'listcheck', value: listcheck.join(',') })); | |
| 137 | + } | |
| 138 | + | |
| 139 | + form.appendTo('body').submit().remove(); | |
| 140 | + }); | |
| 141 | + $('#dl_memberlist').click(function() { | |
| 142 | + $('#dlMemberListDialog').dialog('open'); | |
| 143 | + }); | |
| 144 | + | |
| 145 | + | |
| 146 | + <?php do_action('usces_action_member_list_page_js'); ?> | |
| 147 | +}); | |
| 148 | +</script> | |
| 149 | +<div class="wrap"> | |
| 150 | +<div class="usces_admin"> | |
| 151 | +<h1>Welcart Management <?php _e('List of Members','usces'); ?></h1> | |
| 152 | +<p class="version_info">Version <?php echo esc_html( USCES_VERSION ); ?></p> | |
| 153 | +<?php usces_admin_action_status(); ?> | |
| 154 | + | |
| 155 | +<div id="datatable"> | |
| 156 | +<div id="tablenavi"><?php wel_esc_script_e( $dataTableNavigation ); ?></div> | |
| 157 | + | |
| 158 | +<div id="tablesearch"> | |
| 159 | +<div id="searchBox"> | |
| 160 | + <form action="<?php echo USCES_ADMIN_URL . '?page=usces_memberlist'; ?>" method="post" name="tablesearch"> | |
| 161 | + <table id="search_table"> | |
| 162 | + <tr> | |
| 163 | + <td><?php _e('search fields', 'usces'); ?></td> | |
| 164 | + <td><select name="search[column]" class="searchselect"> | |
| 165 | + <option value="none"> </option> | |
| 166 | +<?php foreach ((array)$arr_column as $key => $value): | |
| 167 | + if($value == $arr_search['column']){ | |
| 168 | + $selected = ' selected="selected"'; | |
| 169 | + }else{ | |
| 170 | + $selected = ''; | |
| 171 | + } | |
| 172 | +?> | |
| 173 | + <option value="<?php echo esc_attr( $value ); ?>"<?php echo esc_attr( $selected ); ?>><?php echo esc_html( $key ); ?></option> | |
| 174 | +<?php endforeach; ?> | |
| 175 | + | |
| 176 | +<?php foreach ((array)$csmb_meta as $key => $value): | |
| 177 | + $csmb_key = 'csmb_'.$key; | |
| 178 | + if($csmb_key == $arr_search['column']){ | |
| 179 | + $selected = ' selected="selected"'; | |
| 180 | + }else{ | |
| 181 | + $selected = ''; | |
| 182 | + } | |
| 183 | +?> | |
| 184 | + <option value="<?php echo esc_attr($csmb_key); ?>"<?php echo esc_attr( $selected ); ?>><?php echo esc_html($value['name']); ?></option> | |
| 185 | +<?php endforeach; ?> | |
| 186 | + | |
| 187 | + </select></td> | |
| 188 | + <td><?php _e('key words', 'usces'); ?></td> | |
| 189 | + <td><input name="search[word]" type="text" value="<?php echo esc_attr($arr_search['word']); ?>" class="searchword" maxlength="50" /></td> | |
| 190 | + <td><input name="searchIn" type="submit" class="searchbutton button" value="<?php _e('Search', 'usces'); ?>" /> | |
| 191 | + <input name="searchOut" type="submit" class="searchbutton button" value="<?php _e('Cancellation', 'usces'); ?>" /> | |
| 192 | + <input name="searchSwitchStatus" id="searchSwitchStatus" type="hidden" value="<?php echo esc_attr($DT->searchSwitchStatus); ?>" /> | |
| 193 | + </td> | |
| 194 | + </tr> | |
| 195 | + </table> | |
| 196 | + <table id="dl_list_table"> | |
| 197 | + <tr> | |
| 198 | + <?php do_action( 'usces_action_dl_member_list_table' ); ?> | |
| 199 | + <td><input type="button" id="dl_memberlist" class="searchbutton button" value="<?php _e('Download Member List', 'usces'); ?>" /></td> | |
| 200 | + </tr> | |
| 201 | + </table> | |
| 202 | + </form> | |
| 203 | +</div> | |
| 204 | +</div> | |
| 205 | + | |
| 206 | +<table id="mainDataTable" cellspacing="1"> | |
| 207 | + <tr> | |
| 208 | + <th scope="col"><input name="allcheck" type="checkbox" value="" /></th> | |
| 209 | +<?php foreach ( (array)$arr_header as $value ) : ?> | |
| 210 | + <th scope="col"><?php wel_esc_script_e( $value ); ?></th> | |
| 211 | +<?php endforeach; ?> | |
| 212 | + | |
| 213 | +<?php if ( $member_list_delete_link ) : ?> | |
| 214 | + <th scope="col"> </th> | |
| 215 | +<?php endif; ?> | |
| 216 | + | |
| 217 | + | |
| 218 | + </tr> | |
| 219 | +<?php foreach ( (array)$rows as $array ) : ?> | |
| 220 | + <tr> | |
| 221 | + <td align="center"><input name="listcheck[]" type="checkbox" value="<?php echo esc_attr( $array['ID'] ); ?>" /></td> | |
| 222 | + <?php foreach ( (array)$array as $key => $value ) : ?> | |
| 223 | + <?php if( WCUtils::is_blank($value) ) $value = ' '; ?> | |
| 224 | + <?php if( $key == 'ID' ): ?> | |
| 225 | + <td><a href="<?php echo esc_url( USCES_ADMIN_URL . '?page=usces_memberlist&member_action=edit&member_id=' . $value . '&wc_nonce=' . wp_create_nonce( 'member_list' ) ); ?>"><?php echo esc_html( $value ); ?></a></td> | |
| 226 | + <?php elseif( $key == 'name' ): ?> | |
| 227 | + <td> | |
| 228 | + <?php | |
| 229 | + $names = explode(' ', $value); | |
| 230 | + usces_localized_name( esc_html($names[0]), esc_html($names[1])); | |
| 231 | + ?> | |
| 232 | + </td> | |
| 233 | + <?php elseif( $key == 'address' ): | |
| 234 | + $pos = strpos( $value, __('-- Select --','usces') ); | |
| 235 | + if( $pos !== false ) $value = ' '; | |
| 236 | + ?> | |
| 237 | + <td><?php echo esc_html($value); ?></td> | |
| 238 | + <?php elseif( $key == 'point' ): ?> | |
| 239 | + <td class="right"><?php echo esc_html($value); ?></td> | |
| 240 | + <?php else: ?> | |
| 241 | + <td><?php echo esc_html($value); ?></td> | |
| 242 | + <?php endif; ?> | |
| 243 | +<?php endforeach; ?> | |
| 244 | + | |
| 245 | +<?php if ( $member_list_delete_link ) : ?> | |
| 246 | + <td><a href="<?php echo esc_url( USCES_ADMIN_URL ); ?>?page=usces_memberlist&member_action=delete&member_id=<?php echo esc_html( $array['ID'] ); ?>&wc_nonce=<?php echo wp_create_nonce( 'delete_member' ); ?>" onclick="return deleteconfirm('<?php echo esc_js( $array['ID'] ); ?>');"><span style="color:#FF0000; font-size:9px;"><?php _e( 'Delete', 'usces' ); ?></span></a></td> | |
| 247 | +<?php endif; ?> | |
| 248 | + | |
| 249 | +</tr> | |
| 250 | +<?php endforeach; ?> | |
| 251 | +</table> | |
| 252 | + | |
| 253 | +</div> | |
| 254 | +<div id="dlMemberListDialog" title="<?php _e('Download Member List', 'usces'); ?>"> | |
| 255 | + <p><?php _e('Select the item you want, please press the download.', 'usces'); ?></p> | |
| 256 | + <fieldset> | |
| 257 | + <input type="button" class="button" id="dl_mem" value="<?php _e('Download', 'usces'); ?>" /> | |
| 258 | + </fieldset> | |
| 259 | + <fieldset><legend><?php _e('Membership information', 'usces'); ?></legend> | |
| 260 | + <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> | |
| 261 | + <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> | |
| 262 | +<?php | |
| 263 | + if(!empty($csmb_meta)) { | |
| 264 | + foreach($csmb_meta as $key => $entry) { | |
| 265 | + if($entry['position'] == 'name_pre') { | |
| 266 | + $csmb_key = 'csmb_'.$key; | |
| 267 | + $checked = usces_checked( $chk_mem, $csmb_key, 'return' ); | |
| 268 | + $name = $entry['name']; | |
| 269 | + 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"; | |
| 270 | + } | |
| 271 | + } | |
| 272 | + } | |
| 273 | +?> | |
| 274 | + <label for="chk_mem[name]"><input type="checkbox" class="check_member" id="chk_mem[name]" value="name" checked disabled /><?php _e('name', 'usces'); ?></label> | |
| 275 | +<?php | |
| 276 | + switch($applyform) { | |
| 277 | + case 'JP': | |
| 278 | +?> | |
| 279 | + <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> | |
| 280 | +<?php | |
| 281 | + break; | |
| 282 | + } | |
| 283 | + | |
| 284 | + if(!empty($csmb_meta)) { | |
| 285 | + foreach($csmb_meta as $key => $entry) { | |
| 286 | + if($entry['position'] == 'name_after') { | |
| 287 | + $csmb_key = 'csmb_'.$key; | |
| 288 | + $checked = usces_checked( $chk_mem, $csmb_key, 'return' ); | |
| 289 | + $name = $entry['name']; | |
| 290 | + 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"; | |
| 291 | + } | |
| 292 | + } | |
| 293 | + } | |
| 294 | + | |
| 295 | + switch($applyform) { | |
| 296 | + case 'JP': | |
| 297 | +?> | |
| 298 | + <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> | |
| 299 | + <label for="chk_mem[country]"><input type="checkbox" class="check_member" id="chk_mem[country]" value="country" checked disabled /><?php _e('Country', 'usces'); ?></label> | |
| 300 | + <label for="chk_mem[pref]"><input type="checkbox" class="check_member" id="chk_mem[pref]" value="pref" checked disabled /><?php _e('Province', 'usces'); ?></label> | |
| 301 | + <label for="chk_mem[address1]"><input type="checkbox" class="check_member" id="chk_mem[address1]" value="address1" checked disabled /><?php _e('city', 'usces'); ?></label> | |
| 302 | + <label for="chk_mem[address2]"><input type="checkbox" class="check_member" id="chk_mem[address2]" value="address2" checked disabled /><?php _e('numbers', 'usces'); ?></label> | |
| 303 | + <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> | |
| 304 | + <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> | |
| 305 | + <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> | |
| 306 | +<?php | |
| 307 | + break; | |
| 308 | + case 'US': | |
| 309 | + default: | |
| 310 | +?> | |
| 311 | + <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> | |
| 312 | + <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> | |
| 313 | + <label for="chk_mem[address1]"><input type="checkbox" class="check_member" id="chk_mem[address1]" value="address1" checked disabled /><?php _e('city', 'usces'); ?></label> | |
| 314 | + <label for="chk_mem[pref]"><input type="checkbox" class="check_member" id="chk_mem[pref]" value="pref" checked disabled /><?php _e('State', 'usces'); ?></label> | |
| 315 | + <label for="chk_mem[country]"><input type="checkbox" class="check_member" id="chk_mem[country]" value="country" checked disabled /><?php _e('Country', 'usces'); ?></label> | |
| 316 | + <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> | |
| 317 | + <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> | |
| 318 | + <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> | |
| 319 | +<?php | |
| 320 | + break; | |
| 321 | + } | |
| 322 | + | |
| 323 | + if(!empty($csmb_meta)) { | |
| 324 | + foreach($csmb_meta as $key => $entry) { | |
| 325 | + if($entry['position'] == 'fax_after') { | |
| 326 | + $csmb_key = 'csmb_'.$key; | |
| 327 | + $checked = usces_checked( $chk_mem, $csmb_key, 'return' ); | |
| 328 | + $name = $entry['name']; | |
| 329 | + 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"; | |
| 330 | + } | |
| 331 | + } | |
| 332 | + } | |
| 333 | +?> | |
| 334 | + <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> | |
| 335 | + <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> | |
| 336 | + <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> | |
| 337 | + <?php do_action( 'usces_action_chk_mem', $chk_mem ); ?> | |
| 338 | + </fieldset> | |
| 339 | +</div> | |
| 340 | +<?php do_action( 'usces_action_member_list_footer' ); ?> | |
| 341 | +</div><!--usces_admin--> | |
| 342 | +</div><!--wrap--> | |