Files
KIN/inspection/ins_cnt.asp
2025-09-29 17:55:08 +09:00

68 lines
3.4 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
Response.CharSet = "EUC-KR"
dim prj_code : prj_code = Request("prj_code")
dim prj_name : prj_name = unescape(Request("prj_name"))
%>
<form id="prj_search" method="post">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td align="center" colspan="6">(<%=prj_code %>) <%=prj_name %></td>
</tr>
<tr>
<td align="center" >검증원</td>
<td align="center" >근무일자</td>
<td align="center" >완료</td>
<td align="center" >에러</td>
<td align="center" >비수신</td>
<td align="center" >리체크</td>
</tr>
<%
query = ""
query = query&" select p_sn, ins_user, ins_birth, ins_date, sum(TOK) as TOK, sum(ERROR) as ERROR, sum(RECHECK) as RECHECK, sum(NOTEL) as NOTEL from "&VbCrlf
query = query&" ( "&VbCrlf
query = query&" select left(pvt.p_sn,11) as p_sn, "&VbCrlf
query = query&" case "&VbCrlf
query = query&" when len(pvt.inspection_user) = 8 then (select p_name from project2.dbo.person where p_no = inspection_user) "&VbCrlf
query = query&" else (select m_name from project2.dbo.man where id = inspection_user) "&VbCrlf
query = query&" end as ins_user, "&VbCrlf
query = query&" case "&VbCrlf
query = query&" when len(pvt.inspection_user) <> 8 then (select left(m_jumin,6) from project2.dbo.man where id = inspection_user) else pvt.inspection_user "&VbCrlf
query = query&" end as ins_birth, "&VbCrlf
query = query&" pvt.ins_date, TOK, ERROR, RECHECK, NOTEL from "&VbCrlf
query = query&" ( "&VbCrlf
query = query&" select * from "&VbCrlf
query = query&" ( "&VbCrlf
query = query&" select p_sn, inspection_user, convert(varchar, inspection_date, 23) as ins_date, pass_stat from T_INSPECTION_RES where pass_stat in ('TOK','ERROR') "&VbCrlf
query = query&" union all "&VbCrlf
query = query&" select p_sn, inspection_user, convert(varchar, inspection_date, 23) as ins_date, pass_stat from T_INSPECTION_RES_log where pass_stat in ('NOTEL','RECHECK') "&VbCrlf
query = query&" ) a "&VbCrlf
query = query&" ) AA "&VbCrlf
query = query&" pivot "&VbCrlf
query = query&" ( "&VbCrlf
query = query&" count(pass_stat) for pass_stat in (TOK,ERROR,RECHECK,NOTEL) "&VbCrlf
query = query&" )as pvt "&VbCrlf
query = query&" ) as PP "&VbCrlf
query = query&" where p_sn = '" & prj_code & "' "&VbCrlf
query = query&" group by p_sn, ins_user, ins_birth, ins_date "&VbCrlf
query = query&" order by p_sn, ins_user, ins_date "&VbCrlf
Rs.open query, adoconn, adopenstatic, adlockreadonly
while not rs.eof
%>
<tr class="prj_pick">
<td class="text-center"><%=Rs("ins_user") %></td>
<td class="text-center"><%=Rs("ins_date") %></td>
<td class="text-center"><%=Rs("TOK") %></td>
<td class="text-center"><%=Rs("ERROR") %></td>
<td class="text-center"><%=Rs("NOTEL") %></td>
<td class="text-center"><%=Rs("RECHECK") %></td>
</tr>
<%
rs.movenext
wend
Rs.close
%>
</table>
</form>