file_upload.tpl 2.82 KB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="Microsoft FrontPage 4.0">
<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<TITLE>e-イベント管理メニュー</TITLE>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
{literal}
<!--

function file_up(){

	if(document.frm_sub.upfile.value == ""){
			alert("ファイルを指定してください");
			return false;
	}

	var addr = document.frm_sub.upfile.value;

	if(addr.match(/\.(jpg|jpeg|gif)$/i)){
			document.frm_sub.action = "file_touroku.php";
			document.frm_sub.method="POST";
			document.frm_sub.submit();
	}else{
			alert("対応してません");
			return false;
	}

}

function ImgSet(){
	var strCheckValur;
	strCheckValur="";

	if (document.frm_sub.rdoSelect.length){
			for(i = 0 ; i <= document.frm_sub.rdoSelect.length; i++ ){
					if (document.frm_sub.rdoSelect[i].checked==true){
							strCheckValur = document.frm_sub.rdoSelect[i].value;
							break;
					}
			}
	}else{
			if (document.frm_sub.rdoSelect.checked==true){
					strCheckValur = document.frm_sub.rdoSelect.value;
			}
	}

	if (strCheckValur==""){
			alert("ファイルを選択してください。");
	}else{
			//alert(window.opener.document.forms[0].cboHeader.value);
			for(i=0;i<window.opener.document.forms[0].cboHeader.options.length;i++){
					if(window.opener.document.forms[0].cboHeader.options[i].value == strCheckValur){
							//alert(i);
							window.opener.document.forms[0].cboHeader.selectedIndex = i;
							break;
					}
			}
			window.opener.document.forms[0].submit();
			window.close();
	}
}

//-->
{/literal}
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD="POST" name="frm_sub" enctype="multipart/form-data">
<TABLE width="100%" border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
	<TR>
		<TD align="left" width="20%"><img src="image/titilemini.gif" alt="e-イベント" width="117" height="40"></TD>
		<TD align="center"><font color="#ffffff">ファイルアップロード</font></TD>
	</TR>
</TABLE>
<input type="file" name="upfile" ><input type="button" value="アップロード" onclick="file_up();" {$mode_disabled}>
<table border="1" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td align="center"> </td>
		<td align="center">画像</td>
		<td align="center">パス</td>
	</tr>
	{section name=idx loop=$File_Data}
			<tr>
				<td><input type="radio" value="{$File_Data[idx][0]}" name="rdoSelect"></td>
				<td align="center"><a href="{$File_Path}{$File_Data[idx][1]}" target="_blank"><img src="{$File_Path}{$File_Data[idx][1]}" width="80" height="80" /></a></td>
				<td>{$File_Path}{$File_Data[idx][1]}</td>
			</tr>
	{/section}
</table>
<input type="button" name="send" value="画像設定" onclick="return ImgSet();" {$mode_disabled}>
</FORM>
</BODY>
</HTML>