SEND3000.js 3.72 KB
var SFlg = false;						//サブミットフラグを定義
function DoubleSubmit(){		//ダブルサブミットチェック関数
	if (SFlg){								//ダブルサブミットの場合
		alert("応答中です");		//メッセージを出力
		return false;
	}
	SFlg = true;							//サブミットフラグを設定
	return true;							//戻り値を設定
}

function send_change(){
	if(document.Frm.radSendPtn[1].checked){
		document.Frm.sousin_sentaku.disabled = true;
		if(document.Frm.group_dat){
			if(document.Frm.group_dat.length > 0){
				for(i=0;i<document.Frm.group_dat.length;i++){
					document.Frm.group_dat[i].disabled = false;
				}
			}else{
				document.Frm.group_dat.disabled = false;
			}
		}
	}else{
		document.Frm.sousin_sentaku.disabled = false;
		if(document.Frm.group_dat){
			if(document.Frm.group_dat.length > 0){
				for(i=0;i<document.Frm.group_dat.length;i++){
					document.Frm.group_dat[i].disabled = true;
				}
			}else{
				document.Frm.group_dat.disabled = true;
			}
		}
	}
}

function menuBack(){
	if (confirm("入力内容は破棄してメニュー画面に戻ります\nよろしいですか?")){
			//location="./MAIN0000.php?strMainDate=<?PHP  echo $strMainDate ?>";
			location="./MAIN0000.php";
	}
}

function haisin(db_flg,strName,strKenmei){

	if(document.Frm.radSendPtn[1].checked){
		intflg=0;
		strData="/";
		if(document.Frm.group_dat){
			intlength = document.Frm.group_dat.length;
			var intGroupCount=0;
			if(!document.Frm.group_dat.length){	
				if(document.Frm.group_dat.checked==true){
					intflg=1;
					strData=strData+document.Frm.group_dat.value+"/";
					intGroupCount=eval(document.Frm.group_count.value);
				}
			}else{
				for(intCount = 0; intCount < intlength; intCount++){
					if(document.Frm.group_dat[intCount].checked==true){
						intflg=1;
						strData=strData+document.Frm.group_dat[intCount].value+"/";
						intGroupCount+=eval(document.Frm.group_count[intCount].value);
					}
				}
			}
		}
		document.Frm.group_id.value=strData;
		if(intflg==0){
			window.alert(strName+"を最低1件選択してください");
			return false;
		}
	}else{
		intGroupCount = document.Frm.userCNT.value;
		if(intGroupCount==0){
			window.alert("送信先を最低1件選択してください");
			return false;
		}
	}
	if(document.Frm.kenmei.value==""){
		window.alert(strKenmei + "を入力して下さい");
		Frm.kenmei.focus();
		return false;
	}
	if(document.Frm.text.value==""){
		window.alert("本文を入力して下さい");
		Frm.text.focus();
		return false;
	}

	var strGroupCount="";
	
	if(db_flg != 6 || intGroupCount==0 || (eval(document.Frm.total_max_point.value) >=1000)){
		strGroupCount = "";
	}else{
			strGroupCount = "\nこのメールを配信するには"+intGroupCount+"ポイント必要です";
			if((eval(document.Frm.total_point.value)-intGroupCount) < 0){
				window.alert("ポイントが足りません"+strGroupCount);
				return false;
			}
	}

	if (DoubleSubmit()) {
		if (confirm("この内容で情報を配信しますか?"+strGroupCount)){
			document.Frm.action = "SEND3010.php";
			document.Frm.method="POST";
			document.Frm.submit();
			return false;
		}
	}
}

function Cheng_Send(){
	if(document.Frm.NowSend.checked){
		document.Frm.send_yyyy.disabled  = false;
		document.Frm.send_mm.disabled  = false;
		document.Frm.send_dd.disabled  = false;
		document.Frm.send_hh.disabled  = false;
		document.Frm.send_time_mm.disabled  = false;
	}else{
		document.Frm.send_yyyy.disabled  = true;
		document.Frm.send_mm.disabled  = true;
		document.Frm.send_dd.disabled  = true;
		document.Frm.send_hh.disabled  = true;
		document.Frm.send_time_mm.disabled  = true;
		document.Frm.send_yyyy.selectedIndex =  0;
		document.Frm.send_mm.selectedIndex  = 0;
		document.Frm.send_dd.selectedIndex  = 0;
		document.Frm.send_hh.selectedIndex  = 0;
		document.Frm.send_time_mm.selectedIndex  = 0;

	}
}

function Select_User(){
	document.Frm.action="SEND3002.php";
	document.Frm.submit();
}