<?php include_once( "../../spider.inc.php" ); ?>{charset:UTF-8}<?php header( 'Content-type: text/plain;charset=UTF-8' ); ?>
/**
 * {write:MEMBER_PERSONAL_LABEL}登録ウィンドウを立ち上げます
 */
function memberAddMember() {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/member/form.php';
}
/**
 * {write:MEMBER_PERSONAL_LABEL}情報ウィンドウを立ち上げます
 */
function memberMemberDetail( id ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/member/detail.php?'
		+ '&mi=' + id;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}情報編集ウィンドウを立ち上げます
 */
function memberMemberModify( num ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/member/form.php?'
		+ '&mn=' + num;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}ログイン履歴ウィンドウを立ち上げます
 */
function memberMemberHistoryLogin( id ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/history/login.php?'
		+ '&mi=' + id;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}ポイント履歴ウィンドウを立ち上げます
 */
function memberMemberHistoryPoint( id ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/history/point.php?'
		+ '&mi=' + id;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}対応履歴ウィンドウを立ち上げます
 */
function memberMemberCorrespond( id ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/history/correspond.php?'
		+ '&mi=' + id;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}メール送信履歴ウィンドウを立ち上げます
 */
function memberMemberHistoryMail( id ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/history/mail.php?'
		+ '&mi=' + id;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}メール送信ウィンドウを立ち上げます
 */
function memberMemberMailForm( id ) {
	window.location.href='/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/mail/form.php?'
		+ '&mi=' + id;
}
/**
 * {write:MEMBER_PERSONAL_LABEL}選択リスト追加と削除
 */
var member_selectHttpObject;
function member_selectMemberCheck(checkBox) {
	if(checkBox) {
		var command		= 'drop';
		var member_id	= checkBox.value;
		if( checkBox.checked ) {
			command	= 'add';
		}
		if( member_id ) {
			member_selectMember(command,member_id);
		} else {
			alert('呼び出し方法が正しくありません!');
		}
	} else {
		alert('操作方法が正しくありません!');
	}
}
function member_selectMember(command,member_id) {
	if(command && member_id) {
		var contents		= 'command='+encodeURIComponent(command);
		contents			+= "&" + encodeURIComponent('member_id')+ "="+encodeURIComponent(member_id);
		member_selectHttpObject	= FormerCommon.createHttpRequest(member_selectMemberResult);
		if( member_selectHttpObject ) {
			FormerCommon.displayGrayOut(9999);
			member_selectHttpObject.open("POST",'{write:spider.base_uri}<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/select.php',true);
			member_selectHttpObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			member_selectHttpObject.send(contents);
		} else {
			alert('サーバー通信作成に失敗しました!');
		}
	} else {
		alert('操作方法が正しくありません!');
	}
}
function member_selectMemberResult() {
	if ((member_selectHttpObject.readyState == 4) && (member_selectHttpObject.status == 200)){
		setTimeout(FormerCommon.displayWhiteIn, 500);
	} else if ((member_selectHttpObject.readyState == 4) && (member_selectHttpObject.status != 200)){
		setTimeout(FormerCommon.displayWhiteIn, 500);
		alert('適用時にサーバー通信でエラーが発生しました。');
	}
}
function member_dropSelectedMember(member_id) {
	if(member_id) {
		var contents		= 'command='+encodeURIComponent('drop');
		contents			+= "&" + encodeURIComponent('member_id')+ "="+encodeURIComponent(member_id);
		member_selectHttpObject	= FormerCommon.createHttpRequest(member_dropSelectedMemberResult);
		if( member_selectHttpObject ) {
			FormerCommon.displayGrayOut(9999);
			member_selectHttpObject.open("POST",'{write:spider.base_uri}<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/select.php',true);
			member_selectHttpObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			member_selectHttpObject.send(contents);
		} else {
			alert('サーバー通信作成に失敗しました!');
		}
	} else {
		alert('操作方法が正しくありません!');
	}
}
function member_dropSelectedMemberResult() {
	if ((member_selectHttpObject.readyState == 4) && (member_selectHttpObject.status == 200)){
		window.location.reload();
	} else if ((member_selectHttpObject.readyState == 4) && (member_selectHttpObject.status != 200)){
		setTimeout(FormerCommon.displayWhiteIn, 500);
		alert('適用時にサーバー通信でエラーが発生しました。');
	}
}
