%
security_ad_cms()
v_mid = InputValue(Request("p_mid"))
dateY = Trim(Request("dateY"))
dateM = Right("0"&Trim(Request("dateM")), 2)
dateD = Right("0"&Trim(Request("dateD")), 2)
If dateY = "" Then
dateY = Year(now)
End If
If dateM = "" Then
dateM = month(now)
End if
If dateD = "" Or dateD = 0 Then
thisDate = dateY & "-" & dateM & "-01"
thisDate2 = DateSerial(dateY, dateM + 1, 1 - 1)
Else
thisDate = dateY & "-" & dateM & "-" & dateD
thisDate2 = thisDate
End if
tran_etc4 = Trim(Request.QueryString("tran_etc4"))
If tran_etc4 <> "" then
addqry = "and tran_etc4 = '"&tran_etc4&"'"
End if
'테이블 존재유무 확인 쿼리
log_table = "em_log_" & dateY & dateM
sql = "select * from information_schema.tables where table_name = '" & log_table & "'"
Set rs = Dbcon.Execute( sql )
If rs.bof Or rs.eof Then
Set rs = Nothing
list_data = null
Else
Set rs = nothing
'sql = "select tran_phone, tran_callback, tran_date, tran_msg, tran_id, tran_etc3, tran_etc4, tran_rslt from "&log_table&" where tran_rsltdate between '"&thisDate&"' and '"&thisDate&"'+ ' 23:59:59'"
'sql = "SELECT count(tran_pr), tran_callback, convert(varchar,tran_date,23) as tran_date , tran_msg, tran_id, tran_etc3, tran_etc4, tran_rslt FROM "&log_table&" WHERE tran_id='"&v_mid&"' and tran_rsltdate between '"&thisDate&"' and '"&thisDate2&"'+ ' 23:59:59' "&addqry&" group by tran_callback, convert(varchar,tran_date,23), tran_msg, tran_id, tran_etc3, tran_etc4, tran_rslt"
sql = "SELECT '1', tran_callback, CONVERT(CHAR(19), tran_date, 20) as tran_date, tran_msg, tran_id, tran_etc3, tran_etc4, tran_rslt, tran_phone FROM "&log_table&" WHERE tran_id='"&v_mid&"' and tran_rsltdate between '"&thisDate&"' and '"&thisDate2&"'+ ' 23:59:59' "&addqry
'response.write sql
Set rs = Dbcon.Execute( sql )
If rs.bof Or rs.eof Then
list_data = null
Else
list_data = rs.getrows
End if
Set rs = Nothing
'response.write weeksumYes & "/" & weeksumNo
End if
%>