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

<%
'<!--
'################################################
'	名称	:社員台帳詳細表示
'	作成日	:2007/5/25
'	作成者	:小野
'	目的 	:社員台帳の詳細を表示する。
'	概要	:
'################################################
'-->
'
%>

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

	Dim HyojiFlg
	HyojiFlg = Request("HyojiFlg")

	Dim Action , NRflg , ErrMSG
	Dim DbSyainNo
	Dim SyainNo
	Dim Shimei
	Dim Birthday
	Dim FuyoNinzu
	Dim YubinNo
	Dim Jyusyo
	Dim TelNo
	Dim MobileNo
	Dim DaihyoFlg
	Dim Yakusyoku
	Dim Nyusyabi
	Dim Risyokubi

	Dim Kihonkyu
	Dim SyokumuTeate
	Dim KazokuTeate
	Dim JyutakuTeate
	Dim SeikinTeate
	Dim KaikinTeate
	Dim TukinTeate
	Dim KenkoHoken
	Dim KoseiNenkin
	Dim NenkinKikin
	Dim KoyoHoken
	Dim KaigoHoken

	Dim Query
	Dim Content
	Dim GakuseiShimei
	Dim GakuseiBango

	NRflg = Request("nr")
	Action = Request("Action")

	DbSyainNo = Request("DbSyainNo")
	SyainNo = Request("SyainNo")
	ErrMSG = Request("ErrMSG")
	If NRflg = "r" then

		Shimei = Request("Shimei")
		Birthday = Request("Birthday")
		FuyoNinzu = Request("FuyoNinzu")
		YubinNo = Request("YubinNo")
		Jyusyo = Request("Jyusyo")
		TelNo = Request("TelNo")
		MobileNo = Request("MobileNo")
		DaihyoFlg = Request("DaihyoFlg")
		Yakusyoku = Request("Yakusyoku")
		Nyusyabi = Request("Nyusyabi")
		Risyokubi = Request("Risyokubi")
		Kihonkyu = Request("Kihonkyu")
		SyokumuTeate = Request("SyokumuTeate")
		KazokuTeate = Request("KazokuTeate")
		JyutakuTeate = Request("JyutakuTeate")
		SeikinTeate = Request("SeikinTeate")
		KaikinTeate = Request("KaikinTeate")
		TukinTeate = Request("TukinTeate")
		KenkoHoken = Request("KenkoHoken")
		KoseiNenkin = Request("KoseiNenkin")
		NenkinKikin = Request("NenkinKikin")
		KoyoHoken = Request("KoyoHoken")
		KaigoHoken = Request("KaigoHoken")

	Else

		If Action <> "1" Then

			Query = "exec SPK社員台帳取得2 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "','" & DbSyainNo & "'"
			Set Content = OpenQuery(Query)

			If Not(Content.BOF Or Content.EOF) Then
				SyainNo = Content.Fields("社員番号ラベル")
				Shimei = Content.Fields("氏名")
				Birthday = SetTimeYYYYMMDD(Content.Fields("生年月日"))
				FuyoNinzu = Content.Fields("扶養家族人数")
				YubinNo = Content.Fields("郵便番号")
				Jyusyo = Content.Fields("住所")
				TelNo = Content.Fields("電話番号")
				MobileNo = Content.Fields("ケータイ")
				DaihyoFlg = "" & Content.Fields("代表取締役フラグ")
				Yakusyoku = Content.Fields("役職")
				Nyusyabi = SetTimeYYYYMMDD(Content.Fields("入社年月日"))
				Risyokubi = SetTimeYYYYMMDD(Content.Fields("離職年月日"))
				Kihonkyu = "" & Content.Fields("基本給")
				SyokumuTeate = "" & Content.Fields("職務手当")
				KazokuTeate = "" & Content.Fields("家族手当")
				JyutakuTeate = "" & Content.Fields("住宅手当")
				SeikinTeate = "" & Content.Fields("精勤手当")
				KaikinTeate = "" & Content.Fields("皆勤手当")
				TukinTeate = "" & Content.Fields("通勤手当")
				KenkoHoken = "" & Content.Fields("健康保険")
				KoseiNenkin = "" & Content.Fields("厚生年金")
				NenkinKikin = "" & Content.Fields("年金基金")
				KoyoHoken = "" & Content.Fields("雇用保険")
				KaigoHoken = "" & Content.Fields("介護保険")

'				If Kihonkyu = "" Then Kihonkyu = 0 End If
'				If SyokumuTeate = "" Then SyokumuTeate = 0 End If
'				If KazokuTeate = "" Then KazokuTeate = 0 End If
'				If JyutakuTeate = "" Then JyutakuTeate = 0 End If
'				If SeikinTeate = "" Then SeikinTeate = 0 End If
'				If KaikinTeate = "" Then KaikinTeate = 0 End If
'				If TukinTeate = "" Then TukinTeate = 0 End If
'				If KenkoHoken = "" Then KenkoHoken = 0 End If
'				If KoseiNenkin = "" Then KoseiNenkin = 0 End If
'				If NenkinKikin = "" Then NenkinKikin = 0 End If
'				If KoyoHoken = "" Then KoyoHoken = 0 End If
'				If KaigoHoken = "" Then KaigoHoken = 0 End If

				Action = "2"

			End If
		End If
	End If

%>
<html>
<% = HtmlHeader("") %>
<SCRIPT LANGUAGE="JavaScript">
<!--
	HomeAlias = "<% = HomeAlias %>";
	HomeAliasSL = "<% = HomeAliasSL %>";
	ExitFlg = 1;
-->
</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 OnKeyDown="FormKeyDown(this)"	name="form1" method="POST" action="fk_syain_bin.asp">
<input type="hidden" name="Action" value="<% = Action %>">
<input type="hidden" name="DbSyainNo" value="<% = DbSyainNo %>">
<input type="hidden" name="HyojiFlg" value="<% = HyojiFlg %>">
<input type="hidden" name="RisyokuFlg" value="">

<%
	Response.Write(HtmlDesign(1))
	
	Response.Write(HttpL1(2))

	Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "社長室・総務部", "tblbtn('/" & HomeAlias & "/user/bk/menu_s4.asp')", "社員台帳", "", "", "", "", ""))
	
	Response.Write(HttpL3("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""))	
	
	If DaihyoFlg <> "1" And "" & Risyokubi = "" Then
		Response.Write(HttpL3_1("印刷", "PrintoutReal()", "修正", "UpdateCall()", "離職", "SubmitCheck('Risyoku')", "", "", "", ""))
	ElseIf "" & Risyokubi <> "" Then
		Response.Write(HttpL3_1("印刷", "PrintoutReal()", "修正", "UpdateCall()", "復帰", "SubmitCheck('Hukki')", "", "", "", ""))
	Else
		Response.Write(HttpL3_1("印刷", "PrintoutReal()", "修正", "UpdateCall()", "", "", "", "", "", ""))
	End If

	Response.Write(HttpL3_2("追加","tblbtn( 'fk_syain.asp?Action=1&HyojiFlg=" & HyojiFlg & "')" ,"一覧表示", "tblbtn( 'fk_syain_ichiran.asp?DbSyainNo=" & DbSyainNo & "&HyojiFlg=" & HyojiFlg & "')", "", "", "", "", "", ""))

	Response.Write(HttpL4("社員台帳", "照会"))
%>

<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="5">
	<tr>
		<td valign="top">

<!-- 外側の隙間 -->
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="100%">
	<tr>
		<td align="CENTER" valign="MIDDLE">

<!-- 大外の黒線枠 -->
<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="20" BGCOLOR="#FFFFFF" STYLE="BORDER:1px solid #000000" WIDTH="660" HEIGHT="300">
	<TR>
		<!-- 水色格子の背景 -->
		<TD ALIGN="CENTER" BACKGROUND="/<% = HomeAlias %>/images/window_bk.gif">

<!-- 水色格子背景の内側の黒線枠及び中外の間隔 -->
<table BORDER="0" CELLSPACING="5" CELLPADDING="5" BGCOLOR="#FFFFFF" STYLE="BORDER:1px solid #000000" WIDTH="740" HEIGHT="300">
	<tr>
		<td>

<!-- 台帳の全体バランス -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td>

<!-- 個人情報部分 -->
<table border="1" width="100%" style="border-collapse: collapse" bordercolor="#000000" class="tx1618" STYLE="BORDER:2px solid #000000">
	<tr height="27">
		<td width="17%" align="center" colspan="6">個 人 情 報</td>
	</tr>
	<tr bgcolor="#DDDDDD">
		<td width="17%" align="center">社員番号</td>
		<td width="50%" align="center" COLSPAN="3">氏 名</td>
		<td width="17%" align="center">生年月日</td>
		<td width="16%" align="center">扶養家族人数</td>
	</tr>
	<tr height="27">
		<td width="17%" align="center"><% = SyainNo %></td>
		<td width="50%" align="center" COLSPAN="3"><% = Shimei %></td>
		<td width="17%" align="center"><% = Birthday %></td>
		<td width="16%" align="center"><% = FuyoNinzu %></td>
	</tr>
	<tr bgcolor="#DDDDDD">
		<td width="17%" align="center">郵便番号</td>
		<td width="83%" align="center" COLSPAN="5">住 所</td>
	</tr>
	<tr height="27">
		<td width="17%" align="center">&nbsp;<% = YubinNo %>&nbsp;</td>
		<td width="83%" align="center" COLSPAN="5"><% = Jyusyo %></td>
	</tr>
	<tr bgcolor="#DDDDDD">
		<td width="17%" align="center">電話番号</td>
		<td width="17%" align="center">緊急時連絡先</td>
		<% If DaihyoFlg <> "1" Then %>
		<td width="33%" align="center" COLSPAN="2">役 職</td>
		<% Else %>
		<td width="33%" align="right" COLSPAN="2">役 職    <span class="tx1416"><font color="#FF0000">※代表取締役です</font></span>&nbsp;</td>
		<% End If %>
		<td width="17%" align="center">入社年月日</td>
		<td width="16%" align="center">離職年月日</td>
	</tr>
	<tr height="27">
		<td width="17%" align="center"><% = TelNo %></td>
		<td width="16%" align="center"><% = MobileNo %></td>
		<td width="33%" align="center" COLSPAN="2"><% = Yakusyoku %></td>
		<td width="17%" align="center"><% = Nyusyabi %></td>
		<td width="17%" align="center">
		<% If DaihyoFlg <> "1" And "" & Risyokubi = "" Then %>
			<input type="text" name="Risyokubi" size="13" value="<% = Risyokubi %>" onkeyup="FormStrDate(this);" onKeypress="FormStrDate(this);" onBlur="SetDate(this, 1, false)" class="tbox4">
		<% Else %>
			&nbsp;<% = Risyokubi %>&nbsp;
			<input type="hidden" name="Risyokubi" value="<% = Risyokubi %>">
		<% End If %>
		</td>
	</tr>
</table>

		</td>
    </tr>
    <tr>
		<!-- 間隔 -->
		<td height="24">
		</td>
    </tr>
    <tr>
		<td>

<!-- 基礎給与部分 -->
<table border="1" width="100%" style="border-collapse: collapse" bordercolor="#000000" class="tx1618" STYLE="BORDER:2px solid #000000">
	<tr height="27">
		<td align="center" colspan="7">基 礎 給 与 情 報</td>
	</tr>
	<tr bgcolor="#DDDDDD">
		<td width="16%" align="center">基本給</td>
		<td width="14%" align="center">職務手当</td>
		<td width="14%" align="center">扶養家族手当</td>
		<td width="14%" align="center">住宅手当</td>
		<td width="14%" align="center">精勤手当</td>
		<td width="14%" align="center">皆勤手当</td>
		<td width="14%" align="center">通勤手当</td>
	</tr>
	<tr height="27">
		<td width="16%" align="center"><% = ConvIntToMoney(Kihonkyu , false, false) %></td>
		<td width="14%" align="center"><% = ConvIntToMoney(SyokumuTeate , false, false) %></td>
		<td width="14%" align="center"><% = ConvIntToMoney(KazokuTeate , false, false) %></td>
		<td width="14%" align="center"><% = ConvIntToMoney(JyutakuTeate , false, false) %></td>
		<td width="14%" align="center"><% = ConvIntToMoney(SeikinTeate , false, false) %></td>
		<td width="14%" align="center"><% = ConvIntToMoney(KaikinTeate , false, false) %></td>
		<td width="14%" align="center">&nbsp;<% = ConvIntToMoney(TukinTeate , false, false) %>&nbsp;</td>
	</tr>
<!--
	<tr bgcolor="#DDDDDD">
		<td width="17%" align="center">健康保険</td>
		<td width="17%" align="center">厚生年金</td>
		<td width="16%" align="center">年金基金</td>
		<td width="17%" align="center">雇用保険</td>
		<td width="17%" align="center">介護保険</td>
		<td width="16%" align="center"></td>
	</tr>
	<tr>
		<td width="17%" align="center"><% = ConvIntToMoney(KenkoHoken , false, false) %></td>
		<td width="17%" align="center"><% = ConvIntToMoney(KoseiNenkin , false, false) %></td>
		<td width="16%" align="center"><% = ConvIntToMoney(NenkinKikin , false, false) %></td>
		<td width="17%" align="center"><% = ConvIntToMoney(KoyoHoken , false, false) %></td>
		<td width="17%" align="center"><% = ConvIntToMoney(KaigoHoken , false, false) %></td>
		<td width="16%" align="center">&nbsp;</td>
	</tr>
-->
</table>

		</td>
	</tr>
</table>

		</td>
	</tr>
</table>

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

		</td>
	</tr>
</table>

		</td>
	</tr>
</table>

</div>

</body>
<% = HtmlFooter %>
</html>

<SCRIPT LANGUAGE="JavaScript">

	function UpdateCall() {
		tblbtn( "fk_syain.asp?Action=2&nr=n&DbSyainNo=<% = DbSyainNo %>&HyojiFlg=<% = HyojiFlg %>");
		return true;
	}


	function SubmitCheck(flg) {
//		if (form1.SyainNo.value == "")
//		{
//			alert("社員番号を入力して下さい");
//			form1.SyainNo.focus();
//			return false;
//		}
		//離職ボタン
		if (flg == "Risyoku") {
			if (form1.Risyokubi.value == "") {
				alert("離職年月日を入力して下さい");
				form1.Risyokubi.focus();
				return false;
			}
			if (confirm("離職させてよろしいですか?")) {
				form1.RisyokuFlg.value = "Risyoku";
				SubmitReal(form1);
				return true;
			} else {
				return false;
			}
		}
		//復帰ボタン
		if (flg == "Hukki") {
			form1.Risyokubi.value = "";
			form1.RisyokuFlg.value = "Hukki";
			SubmitReal(form1);
			return true;
		}
		//保存ボタン
		if (form1.Shimei.value == "") {
			alert("氏名を入力して下さい");
			form1.Shimei.focus();
			return false;
		}
		form1.Risyokubi.value = "";	//離職日を空にする
		SubmitReal(form1);
		return true;
	}

</script>

<% 
End Sub
%>