Files
KIN/other/capi_device_reg.asp
2025-09-29 17:55:08 +09:00

69 lines
2.2 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" -->
<%
set dbin = server.CreateObject("ADODB.CONNECTION")
p_child_sn = URLDecode(request("p_child_sn"))
use_st_dt = request("use_st_dt")
use_ed_dt = request("use_ed_dt")
use_device_cnt = request("use_device_cnt")
use_device_id = request("use_device_id")
Response.CharSet = "EUC-KR" 'ÇѱÛ
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-control", "no-staff"
Response.Expires = -1
query = ""
query = query & " SELECT ID "
query = query & " FROM project2.dbo.V_DEVICE_STATUS "
query = query & " WHERE P_CHILD_SN = '' "
query = query & " AND ID IN (" & use_device_id & ")"
Rs.Open Query, adoConn, 1
if Rs.recordcount < cint(use_device_cnt) Then
Rs.Close
response.Write "2"
response.End
End if
insertCnt = 0
now_year = Right(left(now(),4),2)
now_month = mid(now(),6,2)
now_day = mid(now(),9,2)
now_hour = right("0" & hour(now), 2)
now_minute = right("0" & minute(now), 2)
now_second = right("0" & second(now), 2)
now_micro = right("000" & (timer * 1000) Mod 1000, 3)
d_no = "G" & now_year & now_month & now_day & now_hour & now_minute & now_second & now_micro ' ±×·ìID
for k=1 To Rs.recordcount
query = ""
query = query & " INSERT INTO project2.dbo.T_DEVICE_USE "
query = query & " (DEVICE_ID, P_CHILD_SN, USE_ST_DT, USE_ED_DT, D_NO, USE_YN, MODIFY_DT, INSERT_DT, INSERT_USER) VALUES "
query = query & " (" & Rs("ID") & ", '" & p_child_sn & "', '" & use_st_dt & "', '" & use_ed_dt & "', '" & d_no & "', 'Y', getdate(), getdate(), '" & session("User_number") & "'); "
dbin.Open adoConn
dbin.Execute query
dbin.Close
insertCnt = insertCnt + 1
Rs.moveNext
Next
Rs.close
if insertCnt = cint(use_device_cnt) Then
response.Write "1"
else
response.Write "0"
end if
function URLDecode(str)
Dim objScript
Set objScript = Server.CreateObject("ScriptControl")
objScript.Language = "JavaScript"
URLDecode = objScript.Eval("decodeURIComponent(""" & str & """.replace(/\+/g,"" ""))")
Set objScript = Nothing
end function
%>