<!-- #include file="../../../include.asp" -->

<%
'<!-- 
'################################################
'	名称	:ポータルサイト(会社サイト編集)
'	作成日	:2008/08/25
'	作成者	:小野
'	目的	:会社サイト編集画面の表示
'	概要	:
'	修正変更:
'################################################
'-->
'
%>

<%
main()
Sub main()
	If Not(SessionCheck()) Then
		Exit Sub
	End If

	Dim Query
	Dim Content

	Dim ShijoCD
	ShijoCD = Request("ShijoCD")

	Dim Shinki
	Shinki = 1

	Dim Midashi
	Dim Banner
	Dim Shokai
	Dim ShelfHyoji
	Dim ShelfZaiko
	Dim ContentsHyoji
	Dim ContentsTitle
	Dim ContentsValue
	Dim LinkHyoji
	Dim LinkTitle
	Dim LinkValue
	Query = "exec SPPポータル会社取得 '" & GB_SystemCD & "', '" & EnshuCD & "', '" & KaisyaCD & "', '" & GB_GakuseiNo & "'"
	Set Content = OpenQuery(Query)		
	If Not(Content.BOF Or Content.EOF) Then
		Midashi = "" & Content.Fields("見出し文")
		Banner = "" & Content.Fields("バナー")
		Shokai = "" & Content.Fields("紹介文")
		ShelfHyoji = "" & Content.Fields("商品棚表示")
		ShelfZaiko = "" & Content.Fields("商品棚在庫無し表示")
		ContentsHyoji = "" & Content.Fields("コンテンツ表示")
		ContentsTitle = "" & Content.Fields("コンテンツタイトル")
		ContentsValue = "" & Content.Fields("コンテンツ")
		LinkHyoji = "" & Content.Fields("リンク表示")
		LinkTitle = "" & Content.Fields("リンクタイトル")
		LinkValue = "" & Content.Fields("リンク")
		Shinki = 0
	Else
		Midashi = "" & ConvKaisyaMeisyo(KaisyaCD)
	End If
	Dim BannerURL
	If Banner <> "" Then
		BannerURL = FPortal & "/" & GB_EnshuCD & "/" & KaisyaCD & "/" & Banner
	Else
		BannerURL = "/" & HomeAlias & "/images/default_banner.gif"
	End If
	If ShelfZaiko <> "0" Then
		ShelfZaiko = "1"
	End If
	Shokai = Replace(Shokai, "<BR>", vbCrLf)

%>
<html>
<% = HtmlHeader("") %>
<SCRIPT LANGUAGE="JavaScript">
<!--
	ExitFlg = 2;
	HomeAlias = "<% = HomeAlias %>";
	HomeAliasSL = "<% = HomeAliasSL %>";
-->
</SCRIPT>

<body onkeydown="if(ExitFlg==2)ExitFlg=3;" onBeforeUnload="if(ExitFlg!=0)window.event.returnValue = ExitMsg(ExitFlg)" bgcolor="#5C70B6" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="form1" method="POST" action="portal_kaisha_bin.asp" ENCTYPE="multipart/form-data" autocomplete="off">
<input type="hidden" name="BannerHenkoFlg" value="0">
<input type="hidden" name="OldBanner" value="<% = Banner %>">
<input type="hidden" name="OldContentsValue" value="<% = ContentsValue %>">
<input type="hidden" name="ShijoCD" value="<% = ShijoCD %>">

<%
	Response.Write(HtmlDesign(11))

	If Shinki = 0 Then
		Response.Write(HttpL3_1("保存", "SubmitCheck()", "&nbsp;商品棚の編集&nbsp;", "tblbtn('portal_shelf_edit.asp?ShijoCD=" & ShijoCD & "')", "&nbsp;会社一覧に戻る&nbsp;", "tblbtn('portal_kaisha_ichiran.asp?ShijoCD=" & ShijoCD & "')", "閉じる", "ExitFlg=0;top.window.close()", "", ""))
	Else
		Response.Write(HttpL3_1("保存", "SubmitCheck()", "&nbsp;会社一覧に戻る&nbsp;", "tblbtn('portal_kaisha_ichiran.asp?ShijoCD=" & ShijoCD & "')", "閉じる", "ExitFlg=0;top.window.close()", "", "", "", ""))
	End If

	Response.Write(HttpL4("自社サイト編集", ""))

%>

<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="0" WIDTH="100%" HEIGHT="100%">
	<TR> 
		<TD ALIGN="CENTER"> 
			<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="15" BGCOLOR="#FFFFFF" STYLE="BORDER:1px solid #000000" WIDTH="1" HEIGHT="100%">
				<TR> 
					<TD ALIGN="CENTER" BACKGROUND="/<% = HomeAlias %>/images/window_bk.gif">
						<TABLE WIDTH="615" BORDER="1" CELLSPACING="0" CELLPADDING="3" BORDERCOLOR="#000000" BGCOLOR="#FFFFCC" CLASS="tx1416" STYLE="border-collapse: collapse">
							<TR>
								<td WIDTH="110" height="24" bgcolor="#FFEE88" nowrap>見出し</td>
								<td>
									<input type="text" name="Midashi" value="<% = Midashi %>" style="height:20;" size="80" onKeyDown="FormKeyDown(this);" onBlur="FormStrLeftIME(this, 60, true);" class="tbox4_ime">
								</td>
							</TR>
							<TR>
								<td height="30" bgcolor="#FFEE88">バナー画像<BR>(360×40)</td>
								<td>
									<div id="bannerGazo"><img src="<% = BannerURL %>" WIDTH="360" HEIGHT="40"></div>
									<input type="file" name="Banner" value="" size="58" UNSELECTABLE="On" onChange="GazoHenko(1);" class="tbox4nh">
									<input type="button" style="width:66;" value="元に戻す" onClick="GazoHenko(0);">
								</td>
							</TR>
							<TR>
								<td height="24" bgcolor="#FFEE88" nowrap>会社紹介</td>
								<td>
									<textarea name="Shokai" rows="3" wrap="soft" cols="79" onBlur="FormStrLeftIME(this, 216, true);" class="tarea4_ime"><% = Shokai %></textarea>
								</td>
							</TR>
							<TR>
								<td height="24" bgcolor="#FFEE88" nowrap>表示項目設定</td>
								<td>
									<input type="checkbox"  name="ShelfHyoji" value="1" <% If ShelfHyoji= "1" Then Response.Write(" checked") End If %>>商品棚
									 <input type="checkbox"  name="ContentsHyoji" value="1" <% If ContentsHyoji= "1" Then Response.Write(" checked") End If %>>コンテンツ
									 <input type="checkbox"  name="LinkHyoji" value="1" <% If LinkHyoji= "1" Then Response.Write(" checked") End If %>>リンク<br>
								</td>
							</TR>
							<TR>
								<td height="24" bgcolor="#FFEE88" nowrap>商品棚表示設定</td>
								<td>
									&nbsp;在庫の無い商品を <INPUT type='radio'  name='ShelfZaiko' value= "1" <% If ShelfZaiko = "1" Then Response.Write(" checked") End If %>>表示する
									 <INPUT type='radio'  name='ShelfZaiko' value= "0" <% If ShelfZaiko = "0" Then Response.Write(" checked") End If %>>表示しない
								</td>
							</TR>
							<TR>
								<td height="24" bgcolor="#FFEE88" nowrap>コンテンツタイトル</td>
								<td>
									<input type="text" name="ContentsTitle" value="<% = ContentsTitle %>" style="height:20;" size="80" onKeyDown="FormKeyDown(this);" onBlur="FormStrLeftIME(this, 60, true);" class="tbox4_ime">
								</td>
							</TR>
							<TR>
								<td height="30" bgcolor="#FFEE88" nowrap>コンテンツ</td>
								<td>
									現在のコンテンツ:<B><% = ContentsValue %></B>
									<input type="file" name="ContentsValue" value="" size="58" UNSELECTABLE="On" class="tbox4nh">
									<input type="button" style="width:66;" value="元に戻す" onClick="ContentsClear();">
								</td>
							</TR>
							<TR>
								<td height="24" bgcolor="#FFEE88" nowrap>リンクタイトル</td>
								<td>
									<input type="text" name="LinkTitle" value="<% = LinkTitle %>" style="height:20;" size="80" onKeyDown="FormKeyDown(this);" onBlur="FormStrLeftIME(this, 60, true);" class="tbox4_ime">
								</td>
							</TR>
							<TR>
								<td height="24" bgcolor="#FFEE88" nowrap>リンク先URL</td>
								<td>
									<input type="text" name="LinkValue" value="<% = LinkValue %>" style="height:20;" size="80" onKeyDown="FormKeyDown(this);" onBlur="FormStrLeftIME(this, 60, true);" maxlength="120" class="tbox4" style="ime-mode:inactive;">
								</td>
							</TR>

						</TABLE>
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
</TABLE>
</div>

</form>

</body>

<script language="JavaScript" type="text/JavaScript">
<!--

	function SubmitCheck() {
		if (form1.Midashi.value == "") {
			alert("見出しを入力してください ");
			form1.Midashi.focus();
			return false;
		}
		SubmitReal(form1);
		return true;
	}


	function GazoHenko(mode) {
		if (mode == 1) {
			//IE以外ではローカル画像を表示できない
			if (navigator.userAgent.indexOf("; MSIE ") < 0 && navigator.userAgent.indexOf("Trident") < 0) {
			} else {
				bannerGazo.innerHTML = '<img src="' + form1.Banner.value + '" WIDTH="360" HEIGHT="40">';
			}
			form1.BannerHenkoFlg.value = '1';
		} else {
			var el = document.form1.elements["Banner"]; 
			el.parentNode.replaceChild(el.cloneNode(false), el); 
			bannerGazo.innerHTML = '<img src="<% = BannerURL %>" WIDTH="360" HEIGHT="40">';
			form1.BannerHenkoFlg.value = '0';
		}
	}

	function ContentsClear() {
		var el = document.form1.elements["ContentsValue"]; 
		el.parentNode.replaceChild(el.cloneNode(false), el); 
	}

-->
</script>

<% = HtmlFooter %>

</html>
<% 
End Sub
%>