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

function chk(strCmp){
	var stradd;
	var stradd_view;
	var stradd_chk;
	var stradd_view_chk;
	if (hissu_chk("タイトル",document.e_gru.kairan_title.value)==false) {
		document.e_gru.kairan_title.focus();
		return false;
	}
	if (script_chk("タイトル",document.e_gru.kairan_title.value)==false) {
		document.e_gru.kairan_title.focus();
		return false;
	}

	if (hissu_chk("回覧内容",document.e_gru.your_memo.value)==false) {
		document.e_gru.your_memo.focus();
		return false;
	}
	if (script_chk("回覧内容",document.e_gru.your_memo.value)==false) {
		document.e_gru.your_memo.focus();
		return false;
	}
	
	stradd="";
	for (i=0; i<document.e_gru.syain_add.options.length; i++){ 
		stradd = stradd+document.e_gru.syain_add.options[i].value+"/";
	}
	if (document.e_gru.send_flg[1].checked == true) {
		if (stradd == "/"){
			alert("担当者を1人以上選択してください");
			return false;
		}
	}

	stradd_view="";
	for (i=0; i<document.e_gru.syain_add_view.options.length; i++){ 
		stradd_view = stradd_view+document.e_gru.syain_add_view.options[i].value+"/";
	}

	stradd_chk="";
	stradd_view_chk="";
	for (i=0; i<document.e_gru.syain_add_view.options.length; i++){ 
		stradd_view_chk = document.e_gru.syain_add_view.options[i].value;
		for (j=0; j<document.e_gru.syain_add.options.length; j++){ 
			stradd_chk = document.e_gru.syain_add.options[j].value;
			if (stradd_view_chk!="" || stradd_chk!=""){
				if (stradd_view_chk == stradd_chk){
					alert("回覧先と閲覧先の宛先が重複しています");
					return false;
				}
			}
		}
	}

	strArr1=document.e_gru.upfile1.value.split("\\");
	strFName1=strArr1[strArr1.length-1].toUpperCase();
	strArr2=document.e_gru.upfile2.value.split("\\");
	strFName2=strArr2[strArr2.length-1].toUpperCase();
	strArr3=document.e_gru.upfile3.value.split("\\");
	strFName3=strArr3[strArr3.length-1].toUpperCase();
	if (DoubleSubmit()) {
		document.e_gru.strsel.value=stradd;
		document.e_gru.strsel2.value=stradd_view;
		document.e_gru.file_name1.value=strFName1;
		document.e_gru.file_name2.value=strFName2;
		document.e_gru.file_name3.value=strFName3;
		document.e_gru.action = "CIR003.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
		return false;
	}
}

function Cir_Rtn(){
	document.location = "CIR001.php?kind_flg=2";
}
	
function add(intaddsts){
	var strsel;
	var stradd;
	var inti;
	var intchk;
	var intPt;
	var strArray = new Array();
	var intflg=0;
	document.e_gru.intaddsts.value=intaddsts;
	document.e_gru.send_flg[1].checked=true;

	//追加
	if (intaddsts==1){
		inti=document.e_gru.syain_add.length-1;
		for(i=0;i<document.e_gru.syain_list.length;i++){
			if(document.e_gru.syain_list.options[i].selected){
				//データ存在チェック
				for(intchk=0;intchk<document.e_gru.syain_add.length;intchk++){
					if (document.e_gru.syain_list.options[i].value==document.e_gru.syain_add.options[intchk].value){
						intflg=1;
						break;
					}
				}
				
				//配信リスト設定
				if (intflg==0){
					document.e_gru.syain_add.options[inti]=new Option(document.e_gru.syain_list.options[i].text,document.e_gru.syain_list.options[i].value);
					inti=inti+1;
				}
				intflg=0;
			}
		}
		//最終行空文字
		document.e_gru.syain_add.options[inti]=new Option("          ","");
	}
	//削除
	else{
		//削除選択データ取得
		inti=0;
		for(i=0;i<document.e_gru.syain_add.length;i++){
			if(document.e_gru.syain_add.options[i].selected){
				strArray[inti]=document.e_gru.syain_add.options[i].value;
				inti=inti+1;
			}
		}

		for(i=0;i<strArray.length;i++){
			for(intchk=0;intchk<document.e_gru.syain_add.length;intchk++){
				if (strArray[i]==document.e_gru.syain_add.options[intchk].value){
					if (document.e_gru.syain_add.options[intchk].value!=""){
						document.e_gru.syain_add.options[intchk]=null;
						break;
					}
				}
			}
		}
	}
}

function add_view(intaddsts){
	var strsel2;
	var stradd_view;
	var inti;
	var intchk;
	var intPt;
	var strArray = new Array();
	var intflg=0;
	document.e_gru.intaddsts.value=intaddsts;

	//追加
	if (intaddsts==1){
		inti=document.e_gru.syain_add_view.length-1;
		for(i=0;i<document.e_gru.syain_list_view.length;i++){
			if(document.e_gru.syain_list_view.options[i].selected){
				//データ存在チェック
				for(intchk=0;intchk<document.e_gru.syain_add_view.length;intchk++){
					if (document.e_gru.syain_list_view.options[i].value==document.e_gru.syain_add_view.options[intchk].value){
						intflg=1;
						break;
					}
				}
				
				//配信リスト設定
				if (intflg==0){
					document.e_gru.syain_add_view.options[inti]=new Option(document.e_gru.syain_list_view.options[i].text,document.e_gru.syain_list_view.options[i].value);
					inti=inti+1;
				}
				intflg=0;
			}
		}
		//最終行空文字
		document.e_gru.syain_add_view.options[inti]=new Option("          ","");
	}
	//削除
	else{
		//削除選択データ取得
		inti=0;
		for(i=0;i<document.e_gru.syain_add_view.length;i++){
			if(document.e_gru.syain_add_view.options[i].selected){
				strArray[inti]=document.e_gru.syain_add_view.options[i].value;
				inti=inti+1;
			}
		}

		for(i=0;i<strArray.length;i++){
			for(intchk=0;intchk<document.e_gru.syain_add_view.length;intchk++){
				if (strArray[i]==document.e_gru.syain_add_view.options[intchk].value){
					if (document.e_gru.syain_add_view.options[intchk].value!=""){
						document.e_gru.syain_add_view.options[intchk]=null;
						break;
					}
				}
			}
		}
	}
}

function kairan_Ichiran(){
	location.href = 'CIR001.php';
	return false;
}

function kairan_Ichiran2(){
	location.href = 'CIR007.php';
	return false;
}

function kairan_make(){
	location.href = 'CIR002.php';
	return false;
}

function file_del(file_kind){
	if (DoubleSubmit()) {
		document.e_gru.file_kind.value=file_kind;
		document.e_gru.action = "CIR002.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
	}
}

-->
</SCRIPT>