Files
KIN/nk/sv_work_insert.asp
2025-09-29 17:55:08 +09:00

174 lines
6.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- #include virtual = "lib/config.asp" -->
<%
Dim neakeun_id
Dim neakeun_name : neakeun_name = Request("neakeun_name")
Dim neakeun_jumin : neakeun_jumin = Request("neakeun_jumin")
Dim txtDate : txtDate = Request("txtDate")
Dim txtyoil : txtyoil = Request("txtyoil")
Dim sv_ok : sv_ok = Request.Form("sv_ok")
Dim ip_address : ip_address = Request.ServerVariables("REMOTE_HOST")
Dim in_time : in_time = Request("in_time")
Dim out_time : out_time = Request("out_time")
Dim all_time, add1, add2
query = " Select * from project2.dbo.man where m_name='"&neakeun_name&"' and Left(m_jumin,6)='"&left(neakeun_jumin,6)&"'"
AdoRs.open Query, adoconn, adopenstatic, adlockreadonly
neakeun_id = AdoRs("id")
AdoRs.Close
If sv_ok = "1" Then
If out_time <> "" then
all_time = (Cint(out_time) - Cint(in_time))/100
If all_time >= 7 Then
add1 = "1"
Else
add1 = "0"
End If
If all_time >= 9 Then
add2 = "1"
Else
add2 = "0"
End If
End If
Query = ""
Query = Query&" MERGE Into project2.dbo.neakeun_in_out_time as AA "&VbCrlf
Query = Query&" USING (select '"&neakeun_id&"' mid, '"&txtDate&"' mdate) as BB "&VbCrlf
Query = Query&" on AA.m_id = BB.mid and AA.date = BB.mdate "&VbCrlf
Query = Query&" When Matched Then "&VbCrlf
Query = Query&" Update set in_time='"&in_time&"', out_time='"&out_time&"', all_time='"&all_time&"', add1='"&add1&"', add2='"&add2&"' "&VbCrlf
Query = Query&" When Not Matched Then "&VbCrlf
Query = Query&" Insert (neakeun_name, neakeun_jumin, date, yoil, in_time, out_time, all_time, add1, add2, m_id, in_ip_addr) values "&VbCrlf
Query = Query&" ('"&neakeun_name&"','"&neakeun_jumin&"','"&txtDate&"','"&txtyoil&"','"&in_time&"','"&out_time&"','"&all_time&"','"&add1&"','"&add2&"','"&neakeun_id&"', '"&ip_address&"'); "&VbCrlf
adoConn.Execute Query
Response.Write "<script type='text/javascript'>"
Response.Write "alert('<27><><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD>');"
Response.Write "window.opener.location.reload();"
Response.Write "window.close();"
Response.Write "</script>"
End If
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Է<EFBFBD></title>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ajax-call.js"></script>
<script src="/js/jquery.form.min.js"></script>
<script language="javascript" src="/lib/function.js"></script>
<style>
.div_arr
{
margin-top:3%;
}
</style>
</head>
<body>
<form name="sv_insert" method="post">
<div style="text-align:center;margin-top:5%;">
<h3><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>/<2F><><EFBFBD><EFBFBD> <20>ð<EFBFBD> <20>Է<EFBFBD>(SV<53><56>)</h3>
</div>
<div style="width:30%;text-align:right;display:inline-block;">
<div class="div_arr">
<b><3E≯<EFBFBD> :</b>
</div>
<div class="div_arr">
<b><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :</b>
</div>
<div class="div_arr">
<b><3E><><EFBFBD><EFBFBD> :</b>
</div>
<div class="div_arr">
<b><3E><><EFBFBD><EFBFBD> <20>ð<EFBFBD> :</b>
</div>
<div class="div_arr">
<b><3E><><EFBFBD><EFBFBD> <20>ð<EFBFBD> :</b>
</div>
</div>
<div style="text-align:left;display:inline-block;">
<div class="div_arr">
<%=neakeun_name %>
<input type="hidden" name="neakeun_name" id="neakeun_name" value="<%=neakeun_name %>" />
<input type="hidden" name="neakeun_id" id="neakeun_id" value="<%=neakeun_id %>" />
</div>
<div class="div_arr">
<%=left(neakeun_jumin,6) %>
<input type="hidden" name="neakeun_jumin" id="neakeun_jumin" value="<%=neakeun_jumin %>" />
</div>
<div class="div_arr">
<%=txtDate %>&nbsp;(<%=txtyoil %>)
<input type="hidden" name="txtDate" id="txtDate" value="<%=txtDate %>" />
<input type="hidden" name="txtyoil" id="txtyoil" value="<%=txtyoil %>" />
</div>
<div class="div_arr">
<input type="number" name="in_time" id="in_time" value="<%=in_time %>" style="ime-mode:disabled;" onkeydown='javascript:ck_down(event);' onkeyUp='javascript:ck_up(this);'/>
</div>
<div class="div_arr">
<input type="number" name="out_time" id="out_time" value="<%=out_time %>" style="ime-mode:disabled;" onkeydown='javascript:ck_down(event);' onkeyUp='javascript:ck_up(this);'/>
</div>
</div>
<div style="text-align:center;margin-top:5%;">
<button name="" id="" onclick="javascript:js_ok(this.form);"><3E><><EFBFBD><EFBFBD></button>
<input type="hidden" name="sv_ok" id="sv_ok" value="" />
</div>
</form>
</body>
</html>
<Script type="text/javascript">
function ck_down(event) {
var kcode = (window.event) ? window.event.keyCode : event.which;
if (!((kcode >= 48 && kcode <= 57) || (kcode >= 96 && kcode <= 105) || kcode == 8 || kcode == 9)) {
event.preventDefault ? event.preventDefault() : (event.returnValue = false);
}
}
function ck_up(obj) {
if (isNaN(obj.value)) {
obj.value = obj.value.replace(/[a-z<><7A>-<2D><><EFBFBD><EFBFBD>-<2D>Ӱ<EFBFBD>-Þ]/g, '');
}
}
function js_ok(frm)
{
var in_time = $("input[name=in_time]").val();
var out_time = $("input[name=out_time]").val();
var in_ok;
var out_ok;
if (in_time == "") {
alert("<22><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> <20>Է<EFBFBD><D4B7>Ͽ<EFBFBD> <20>ֽʽÿ<CABD>.");
$("input[name=in_time]").focus();
return false;
}
if (in_time.length != 4) {
alert("<22><>/<2F><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> 4<>ڸ<EFBFBD><DAB8><EFBFBD> <20>Է<EFBFBD><D4B7>Ͽ<EFBFBD> <20>ֽʽÿ<CABD>.\n(<28><>: 09:30 <20><><EFBFBD><EFBFBD> -> 0930)");
$("input[name=in_time]").focus();
return false;
}
if (out_time != "") {
if (out_time.length != 4) {
alert("<22><>/<2F><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> 4<>ڸ<EFBFBD><DAB8><EFBFBD> <20>Է<EFBFBD><D4B7>Ͽ<EFBFBD> <20>ֽʽÿ<CABD>.\n(<28><>: 09:30 <20><><EFBFBD><EFBFBD> -> 0930)");
$("input[name=out_time]").focus();
return false;
}
}
$("input[name=sv_ok]").val("1");
frm.target = "";
frm.action = "sv_work_insert.asp";
frm.submit();
}
</Script>