57 lines
2.8 KiB
Plaintext
57 lines
2.8 KiB
Plaintext
|
|
<!-- #include virtual = "lib/config.asp" -->
|
|
<!-- #include file = "../lib/json2.asp" -->
|
|
<%
|
|
|
|
set dbin = server.CreateObject("ADODB.CONNECTION")
|
|
dbin.Open adoConn
|
|
Response.CharSet = "EUC-KR" 'ÇѱÛ
|
|
Response.AddHeader "Pragma","no-cache"
|
|
Response.AddHeader "cache-control", "no-staff"
|
|
Response.Expires = -1
|
|
|
|
dim p_child_sn : p_child_sn = request("p_child_sn")
|
|
dim info : set info = JSON.parse(request("result"))
|
|
Dim rsp
|
|
executeCount = 0
|
|
chk = 0
|
|
for i = 0 To info.length - 1
|
|
query = "SET NOCOUNT ON;"
|
|
query = query & " INSERT INTO project2.dbo.neakeun_work"
|
|
query = query & " (neakeun_jumin, neakeun_name, p_sn, p_sebu, date, yoil, in_time, out_time, job_in_time, job_out_time, job_jumal_time, "
|
|
query = query & " insert_date, insert_time, insert_ip, p_sv_no, p_sv_main, p_child_sn, job_start_time, job_end_time, job_total_time, "
|
|
query = query & " job_lunch_yn, job_dinner_yn, job_confirm_yn, p_sebu_code) "
|
|
query = query & " VALUES "
|
|
query = query & " ( "
|
|
query = query & " (SELECT TOP 1 LEFT(m_jumin, 6) + '0000000' FROM project2.dbo.man WHERE new_id = '" & info.get(i).coderID & "'),"
|
|
query = query & " (SELECT TOP 1 m_name FROM project2.dbo.man WHERE new_id = '" & info.get(i).coderID & "'),"
|
|
query = query & " LEFT('" & p_child_sn & "', 7), 'ÄÚµù', CONVERT(varchar(10), getdate(), 120), datename(dw, getdate()), "
|
|
query = query & " '0000', '0000', " & info.get(i).codingCount & ", 0, 0, CONVERT(varchar(10), getdate(), 120), RIGHT(CONVERT(varchar(16), getdate(), 120), 5), "
|
|
query = query & " '" & Request.ServerVariables("Remote_Addr") & "', '" & Session("User_Number") & "', '" & Session("User_Number") & "', '" & p_child_sn & "', '1000', '2400', 0, '', '', 'Y', '4'"
|
|
query = query & " )"
|
|
query = query & " SET NOCOUNT OFF; SELECT SCOPE_IDENTITY() ID; "
|
|
set rsp = dbin.Execute(query)
|
|
|
|
if rsp("ID") <> "" then
|
|
query = ""
|
|
query = query & " INSERT INTO project2.dbo.T_NEAKEUN_PAY "
|
|
query = query & " (p_sn, m_name, m_jumin, work_dt, s_ot, s_gubun, s_pay_unit, s_wan, s_sum, "
|
|
query = query & " s_time_style, pay_type, pay_month, insert_dt, insert_user, attribute01) "
|
|
query = query & " SELECT p_child_sn, neakeun_name, neakeun_jumin, date, '0', p_sebu, "
|
|
query = query & " " & info.get(i).unitPay & ", " & info.get(i).codingCount & ", " & cdbl(info.get(i).unitPay) * cdbl(info.get(i).codingCount) & ", "
|
|
query = query & " '', '1', CONVERT(varchar(7), dateadd(m, 1, getdate()), 120) + '-15', "
|
|
query = query & " getdate(), '" & Session("User_Number") & "', '" & rsp("ID") & "' "
|
|
query = query & " FROM project2.dbo.neakeun_work WHERE id = '" & rsp("ID") & "' "
|
|
|
|
dbin.Execute query, chk
|
|
executeCount = executeCount + chk
|
|
End if
|
|
Next
|
|
|
|
if executeCount = info.length then
|
|
Response.Write "1"
|
|
else
|
|
Response.Write "0"
|
|
end if
|
|
dbin.Close
|
|
%> |