그룹
<%
query = ""
query = query & " SELECT DISTINCT before_t_cd1 as d_code, LEFT(T_Name, 8) as d_name "
query = query & " FROM project2.dbo.v_Department "
query = query & " WHERE (before_t_cd1 in (12, 17, 18, 19, 90) or before_t_cd1 between 20 and 99) "
' if session("User_Number") = "20200302" Then '안정모
' query = query & " AND before_t_cd1 in ('71', '72') " & vbCrLf
' End IF
if session("User_Number") = "20190601" Then '이혜진
query = query & " AND before_t_cd1 in ('71', '72', '73') " & vbCrLf
End IF
if session("User_Number") = "20190301" Then '조우철 - 2024-06-17 M3그룹 (20210105)부재로 인한 대리
query = query & " AND before_t_cd1 in ('71', '72', '73','61','62','63','64','65','66') " & vbCrLf
End IF
if session("User_Number") = "20210107" Then '신상욱
query = query & " AND before_t_cd1 in ('91') " & vbCrLf '-- ai 81 20240722 주간업무현황 수정
End IF
if session("User_Number") = "20160205" Then '박지훈
query = query & " AND before_t_cd1 in ('61','62','63','64','65','66') " & vbCrLf
End IF
query = query & " order by LEFT(T_Name, 8)"
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
If (Session("teamplace") > 4 and Session("teamplace") <= 6) Or session("User_Number") = "20200302" Or Session("Depart_Code") = "18" Then
%>
" <% if cstr(search_depart) = cstr(Rs("d_code")) then %> selected <% end if %>><%=Rs("d_name")%>
<%
ElseIf Session("teamplace") < 5 and Session("teamplace") >= 0 Then
if cint(search_depart) = cint(Rs("d_code")) Then
%>
" <% if cstr(search_depart) = cstr(Rs("d_code")) then %> selected <% end if %>><%=Rs("d_name")%>
<%
end If
End if
Rs.MoveNext
next
end if
Rs.Close
%>
참여인력
<% if (cint(search_depart) >= 20 and cint(search_depart) <= 90) or cint(search_depart) = 90 or cint(search_depart) = 91 or cint(search_depart) = 101 or cint(search_depart) = 102 or cint(search_depart) = 103 Then %>
제안 현황.(연구)
- 결정예정일 기준
asdf
No.
프로젝트코드
프로젝트명
조사방법
클라이언트
계약금액
진행상태
담당연구원
결정예정일
등록일자
메모
<%
'전주 & 금주 제안등록 현황~!
query = ""&VbCrlf
query = query & "select p_sn, p_subject as p_subject_tmp, '0' as p_method, '0' as p_sample, p_cli_company_cd as p_cli_company, p_cont_cost, "&VbCrlf
query = query & "p_depart_dep, p_input_user, p_decide_date, p_input_dt, p_state, p_memo "&VbCrlf
query = query & "from t_project_base "&VbCrlf
query = query & "where convert(varchar, p_decide_date,23) >= convert(varchar, GETDATE(),23) "&VbCrlf
query = query & "and p_depart_dep = '" & search_depart & "' "&VbCrlf
if search_person <> "" then
query = query & "and p_input_user = '"& search_person &"' "&VbCrlf
end if
query = query & "order by p_input_dt "&VbCrlf
'------------------------------------------------------
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method") <> "" Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
query = query & "where p_sn = '" & rsp("p_sn") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
rsa.close
End If
client_name = ""
If rsp("p_cli_company") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_input_user") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_input_user") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
p_cont_cost = "0"
If CDbl(rsp("p_cont_cost")) > 0 Then
p_cont_cost = formatnumber(rsp("p_cont_cost"), 0)
Else
p_cont_cost = "0.00"
End If
Dim proposal_status
If rsp("p_state") <> "" Then
If rsp("p_state") = "X" Then
proposal_status = "탈락"
ElseIf rsp("p_state") = "D" Then
proposal_status = "연기"
ElseIf rsp("p_state") = "K" Then
proposal_status = "제안"
Elseif rsp("p_state") = "E" Then
proposal_status = "검토(가망)"
Else
proposal_status = "수주"
End if
End if
%>
<%=i%>
')" class="blue"><%=rsp("p_sn")%>
')" class="blue"><%=rsp("p_subject_tmp")%>
<%=p_method_name%>
<%=client_name%>
<%=p_cont_cost%>
<%=proposal_status%>
<%=researcher_name%>
<%=Mid(Left(rsp("p_decide_date"), 10), 6, 10)%>
<%=Mid(Left(rsp("p_input_dt"), 10), 6, 10)%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
신규 프로젝트 현황.(연구)
asdf
No.
프로젝트코드
프로젝트명
조사방법
표본수
클라이언트
계약금액
예상직접비율
진행상태
담당연구원
등록일자
메모
<%
'전주 & 금주 신규 프로젝트(수행계획서 결재 미완료 단계) 등록 현황~!
query = "select * "
query = query & "from ( "
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sample, TPM.p_cli_company_cd, TPM.p_cont_cost "
query = query & ", TPB.p_depart_dep, TPB.p_input_user, TPM.p_rsch_dept, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "
query = query & ", p_rsch_1_a, p_rsch_1_b, p_rsch_1_c, p_rsch_2_a, p_rsch_2_b, p_rsch_2_c "
query = query & ", p_rsch_3_a, p_rsch_3_b, p_rsch_3_c, p_rsch_4_a, p_rsch_4_b, p_rsch_4_c "
query = query & "from T_PROJECT_METHOD as TPM "
query = query & "inner join T_PROJECT_BASE as TPB "
query = query & "on TPM.p_sn = TPB.p_sn "
query = query & "where TPM.p_sub_type = 'C' "
query = query & "and TPM.p_progress_status > '001' "
query = query & "and TPM.p_progress_status < '008' "
query = query & "and (p_research_complete is null or p_field_complete is null or p_dp_complete is null ) "
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
query = query & "and TPM.p_input_dt <= (GETDATE()+(7-" & yoil & ")) "
query = query & "union all "
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sample, TPM.p_cli_company_cd, TPB.p_cont_cost "
query = query & ", TPB.p_depart_dep, TPB.p_input_user, TPM.p_rsch_dept, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "
query = query & ", p_rsch_1_a, p_rsch_1_b, p_rsch_1_c, p_rsch_2_a, p_rsch_2_b, p_rsch_2_c "
query = query & ", p_rsch_3_a, p_rsch_3_b, p_rsch_3_c, p_rsch_4_a, p_rsch_4_b, p_rsch_4_c "
query = query & "from T_PROJECT_METHOD as TPM "
query = query & "inner join T_PROJECT_BASE as TPB "
query = query & "on TPM.p_sn = TPB.p_sn "
query = query & "where TPM.p_sub_type = 'M' "
query = query & "and TPM.p_progress_status > '001' "
query = query & "and TPM.p_progress_status < '008' "
query = query & "and (p_research_complete is null or p_field_complete is null or p_dp_complete is null ) "
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
query = query & "and TPM.p_input_dt <= (GETDATE()+(7-" & yoil & ")) "
query = query & ") as T "
query = query & "where p_child_sn like case p_sub_type when 'M' then '%_M01' else '%%' end "
query = query & "and (p_depart_dep = '" & search_depart & "' OR p_rsch_dept = '" & search_depart & "')"
if search_person <> "" then
query = query & " and (p_rsch_1_a = '"& search_person &"' or p_rsch_1_b = '"& search_person &"' or p_rsch_1_c = '"& search_person &"' "
query = query & " or p_rsch_2_a = '"& search_person &"' or p_rsch_2_b = '"& search_person &"' or p_rsch_2_c = '"& search_person &"' "
query = query & " or p_rsch_3_a = '"& search_person &"' or p_rsch_3_b = '"& search_person &"' or p_rsch_3_c = '"& search_person &"' "
query = query & " or p_rsch_4_a = '"& search_person &"' or p_rsch_4_b = '"& search_person &"' or p_rsch_4_c = '"& search_person &"') "
end if
query = query & "order by p_depart_dep, p_child_sn "
'------------------------------------------------------
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method_cd") <> "" Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
If rsp("p_sub_type") = "M" Then
query = query & "where p_sn = '" & Left(rsp("p_child_sn"), 7) &"' "
Else
query = query & "where p_child_sn = '" & rsp("p_child_sn") &"' "
End if
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
rsa.close
End If
client_name = ""
If rsp("p_cli_company_cd") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company_cd") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_input_user") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_input_user") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
p_cont_cost = "0"
If CDbl(rsp("p_cont_cost")) > 0 Then
p_cont_cost = formatnumber(rsp("p_cont_cost"), 0)
Else
p_cont_cost = "0.00"
End If
progress_status = ""
If rsp("p_input_user") <> "" Then
query = "select * from T_COMMON_CODE_DETAIL where c_kind_code = '010' and c_common_code = '" & rsp("p_progress_status") & "' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
progress_status = rsa("c_code_name")
End If
rsa.close
End If
tmp_total_rate = "0"
If rsp("p_child_sn") <> "" Then
sub_where_query = ""
If rsp("p_sub_type") = "M" Then
sub_where_query = " and p_child_sn = '" & Left(rsp("p_child_sn"), 7) & "_M01' "
Else
sub_where_query = " and p_child_sn = '" & rsp("p_child_sn") & "' "
End If
query = " select sum(T.total_money) as total_money "
query = query + " from( "
query = query + " select sum(convert(money, est_money)) as total_money from direct_cost "
query = query + " where p_sn like '" & Left(rsp("p_child_sn"), 7) & "' and cost_type = 'research' and del_yes_no = 'no' "
query = query + sub_where_query
query = query + " union all "
query = query + " select sum(convert(money, est_money)) as total_money from direct_cost "
query = query + " where p_sn like '" & Left(rsp("p_child_sn"), 7) & "' and cost_type = 'field' and del_yes_no = 'no' "
query = query + sub_where_query
query = query + " ) as T "
rsa.Open query, adoConn, 1
'''response.write query & " "
tmp_total_money = ""
tmp_total_rate = ""
if rsa.RecordCount = 1 Then
'''response.write "$" & rsa("total_money") & " "
if rsa("total_money") <> "" then
tmp_len = len(rsa("total_money"))
for j = 1 to int(tmp_len)
if j mod 3 = 1 and j <> 1 then
tmp_total_money = "," & tmp_total_money
end if
tmp_total_money = left(right(rsa("total_money"),j), 1) & tmp_total_money
Next
If CDbl(p_cont_cost) = 0 Then
tmp_total_rate = "0.0"
Else
tmp_total_rate = formatnumber((tmp_total_money / p_cont_cost) * 100, 1)
End if
Else
tmp_total_money = "0"
tmp_total_rate = "0"
end If
end if
rsa.Close
End If
%>
<%=i%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"> <%=rsp("p_child_sn")%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"> <%=rsp("p_subject")%>
<%=p_method_name%>
<%=rsp("p_sample")%>
<%=client_name%>
<%=p_cont_cost%>
<%=tmp_total_rate%>%
<%=progress_status%>
<%=researcher_name%>
<%=Mid(Left(rsp("p_input_dt"), 10), 6, 10)%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
진행 프로젝트 현황.(연구)
asdf
No.
프로젝트코드
프로젝트명
조사방법
표본수
클라이언트
계약금액
예상직접비율
진행상태
담당연구원
등록일자
완료여부
메모
현재상태
계약종료
연구
실사
전산
<%
'전주 & 금주 진행 프로젝트(수행계획서 결재 완료 단계) 등록 현황~!
query = "select * "
query = query & "from ( "
query = query & "select p_sn as p_child_sn, 'C' as p_sub_type, p_subject, p_method as p_method_cd, p_convdate_end as p_con_date_end, p_sample, p_cli_company as p_cli_company_cd "
query = query & ", '' as p_rsch_dept, '' as p_field_dept, '' as p_is_dept, p_budget as p_cont_cost "
query = query & ", p_depart_dep, p_rsch_1 as p_input_user, p_contact_date as p_input_dt, '999' as p_progress_status, p_memo "
query = query & ", p_rsch_1 as p_rsch_1_a, '' as p_rsch_1_b, '' as p_rsch_1_c, p_rsch_2 as p_rsch_2_a, '' as p_rsch_2_b, '' as p_rsch_2_c "
query = query & ", p_rsch_3 as p_rsch_3_a, '' as p_rsch_3_b, '' as p_rsch_3_c, p_rsch_4 as p_rsch_4_a, '' as p_rsch_4_b, '' as p_rsch_4_c "
query = query & ", p_research_complete, p_field_complete, p_dp_complete, p_support_complete "
query = query & "from project "
'query = query & "where substring(p_field_end,1,4) = year(GETDATE()) and p_field_end > GETDATE() "
query = query & "where p_sn like substring(convert(varchar(4), year(GETDATE())), 3, 2)+'%' and p_contact_date is not null "
query = query & "and substring(p_contact_date,1,4) = year(GETDATE()) "
query = query & "and (p_research_complete is null or p_field_complete is null or p_dp_complete is null ) "
query = query & "union all "
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_con_date_end, TPM.p_sample, TPM.p_cli_company_cd "
query = query & ", p_rsch_dept, p_field_dept, p_is_dept, TPM.p_cont_cost "
query = query & ", TPB.p_depart_dep, TPB.p_input_user, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "
query = query & ", p_rsch_1_a, p_rsch_1_b, p_rsch_1_c, p_rsch_2_a, p_rsch_2_b, p_rsch_2_c "
query = query & ", p_rsch_3_a, p_rsch_3_b, p_rsch_3_c, p_rsch_4_a, p_rsch_4_b, p_rsch_4_c "
query = query & ", p_research_complete, p_field_complete, p_dp_complete, p_support_complete "
query = query & "from T_PROJECT_METHOD as TPM "
query = query & "inner join T_PROJECT_BASE as TPB "
query = query & "on TPM.p_sn = TPB.p_sn "
query = query & "where TPM.p_sub_type = 'C' "
query = query & "and TPM.p_progress_status > '007' "
query = query & "and (p_research_complete is null or p_field_complete is null or p_dp_complete is null ) "
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
query = query & "union all "
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_con_date_end, TPM.p_sample, TPM.p_cli_company_cd "
query = query & ", p_rsch_dept, p_field_dept, p_is_dept, TPB.p_cont_cost "
query = query & ", TPB.p_depart_dep, TPB.p_input_user, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "
query = query & ", p_rsch_1_a, p_rsch_1_b, p_rsch_1_c, p_rsch_2_a, p_rsch_2_b, p_rsch_2_c "
query = query & ", p_rsch_3_a, p_rsch_3_b, p_rsch_3_c, p_rsch_4_a, p_rsch_4_b, p_rsch_4_c "
query = query & ", p_research_complete, p_field_complete, p_dp_complete, p_support_complete "
query = query & "from T_PROJECT_METHOD as TPM "
query = query & "inner join T_PROJECT_BASE as TPB "
query = query & "on TPM.p_sn = TPB.p_sn "
query = query & "where TPM.p_sub_type = 'M' "
query = query & "and TPM.p_progress_status > '007' "
query = query & "and (p_research_complete is null or p_field_complete is null or p_dp_complete is null ) "
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
query = query & ") as T "
query = query & "where p_child_sn like case p_sub_type when 'M' then '%_M01' else '%%' end "
query = query & "and (p_depart_dep = '" & search_depart & "' OR p_rsch_dept = '" & search_depart & "') "
if search_person <> "" then
query = query & " and (p_rsch_1_a = '"& search_person &"' or p_rsch_1_b = '"& search_person &"' or p_rsch_1_c = '"& search_person &"' "
query = query & " or p_rsch_2_a = '"& search_person &"' or p_rsch_2_b = '"& search_person &"' or p_rsch_2_c = '"& search_person &"' "
query = query & " or p_rsch_3_a = '"& search_person &"' or p_rsch_3_b = '"& search_person &"' or p_rsch_3_c = '"& search_person &"' "
query = query & " or p_rsch_4_a = '"& search_person &"' or p_rsch_4_b = '"& search_person &"' or p_rsch_4_c = '"& search_person &"') "
end if
query = query & "order by p_depart_dep, p_child_sn "
'------------------------------------------------------
'response.write query
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method_cd") <> "" Then
If Len(rsp("p_child_sn")) > 10 Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
If rsp("p_sub_type") = "M" Then
query = query & "where p_sn = '" & Left(rsp("p_child_sn"), 7) &"' "
Else
query = query & "where p_child_sn = '" & rsp("p_child_sn") &"' "
End If
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
Else
query = "select code1, name1 from p_method where code1 = '" & rsp("p_method_cd") & "' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("name1")
Else
p_method_name = p_method_name & ", " & rsa("name1")
End if
rsa.moveNext
next
End If
End if
rsa.close
End If
client_name = ""
If rsp("p_cli_company_cd") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company_cd") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_rsch_1_a") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_1_a") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
researcher_name2 = ""
If rsp("p_rsch_1_b") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_1_b") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name2 = rsa("p_name")
End If
rsa.close
End If
p_cont_cost = "0"
If CDbl(rsp("p_cont_cost")) > 0 Then
p_cont_cost = formatnumber(rsp("p_cont_cost"), 0)
Else
p_cont_cost = "0.0"
End If
tmp_total_rate = "0"
If rsp("p_child_sn") <> "" Then
tmp_total_money = ""
tmp_total_rate = ""
If CLng(Left(rsp("p_child_sn"), 4)) >= 1407 Then
If rsp("p_sub_type") = "M" Then
sub_where_query = " and p_child_sn = '" & Left(rsp("p_child_sn"), 7) & "_M01' "
Else
sub_where_query = " and p_child_sn = '" & rsp("p_child_sn") & "' "
End If
query = " select sum(T.total_money) as total_money "
query = query + " from( "
query = query + " select sum(convert(money, est_money)) as total_money from direct_cost "
query = query + " where p_sn like '" & Left(rsp("p_child_sn"), 7) & "' and cost_type = 'research' and del_yes_no = 'no' "
query = query + sub_where_query
query = query + " union all "
query = query + " select sum(convert(money, est_money)) as total_money from direct_cost "
query = query + " where p_sn like '" & Left(rsp("p_child_sn"), 7) & "' and cost_type = 'field' and del_yes_no = 'no' "
query = query + sub_where_query
query = query + " ) as T "
rsa.Open query, adoConn, 1
'''response.write query
if rsa.RecordCount = 1 Then
If rsp("p_sub_type") = "M" then
'''response.write query
End if
if rsa("total_money") <> "" then
tmp_len = len(rsa("total_money"))
for j = 1 to int(tmp_len)
if j mod 3 = 1 and j <> 1 then
tmp_total_money = "," & tmp_total_money
end if
tmp_total_money = left(right(rsa("total_money"),j), 1) & tmp_total_money
Next
If CDbl(p_cont_cost) = 0 Then
tmp_total_rate = "0.0"
Else
tmp_total_rate = formatnumber((tmp_total_money / p_cont_cost) * 100, 1)
End if
Else
tmp_total_money = "0"
tmp_total_rate = "0"
end If
end if
rsa.Close
Else
query = "select p_esti_cost as total_money from project where p_sn = '" & rsp("p_child_sn") & "' "
rsa.Open query, adoConn, 1
'''response.write query
tmp_total_money = ""
tmp_total_rate = ""
if rsa.RecordCount = 1 Then
if rsa("total_money") <> "" then
tmp_len = len(rsa("total_money"))
for j = 1 to int(tmp_len)
if j mod 3 = 1 and j <> 1 then
tmp_total_money = "," & tmp_total_money
end if
tmp_total_money = left(right(rsa("total_money"),j), 1) & tmp_total_money
Next
If CDbl(p_cont_cost) = 0 Then
tmp_total_rate = "0.0"
Else
tmp_total_rate = formatnumber((tmp_total_money / p_cont_cost) * 100, 1)
End if
Else
tmp_total_money = "0"
tmp_total_rate = "0"
end If
end if
rsa.Close
End if
End If
If rsp("p_input_user") <> "" Then
If Len(rsp("p_child_sn")) > 10 Then
query = ""&VbCrlf
query = query & "select case when p_rsch_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_rsch_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '보고서 진행중' else '' end as progress_01 "&VbCrlf
query = query & " ,p_rsch_date_end as progress_01_dt "&VbCrlf
query = query & " ,case when p_field_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_field_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '실사 진행중' else '' end as progress_02 "&VbCrlf
query = query & " ,p_field_date_end as progress_02_dt "&VbCrlf
query = query & " ,case when p_verify_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_verify_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '검증 진행중' else '' end as progress_03 "&VbCrlf
query = query & " ,p_verify_date_end as progress_03_dt "&VbCrlf
query = query & " ,case when p_punch_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_punch_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '펀칭 진행중' else '' end as progress_04 "&VbCrlf
query = query & " ,p_punch_date_end as progress_04_dt "&VbCrlf
query = query & " ,case when p_code_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_code_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '코딩 진행중' else '' end as progress_05 "&VbCrlf
query = query & " ,p_code_date_end as progress_05_dt "&VbCrlf
query = query & " ,case when p_dp_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_dp_date_end >= CONVERT(varchar(10), GETDATE(), 126) then 'DP 진행중' else '' end as progress_06 "&VbCrlf
query = query & " ,p_dp_date_end as progress_06_dt "&VbCrlf
query = query & " from T_PROJECT_METHOD where p_child_sn = '" & rsp("p_child_sn") & "' "&VbCrlf
Else
query = "select case when p_report_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_report_end2 >= CONVERT(varchar(10), GETDATE(), 126) then '보고서 진행중' else '' end as progress_01 "&VbCrlf
query = query & " ,p_report_end2 as progress_01_dt "&VbCrlf
query = query & " ,case when p_field_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_field_end2 >= CONVERT(varchar(10), GETDATE(), 126) then '실사(코딩+에디팅) 진행중' else '' end as progress_02 "&VbCrlf
query = query & " ,p_field_end2 as progress_02_dt "&VbCrlf
query = query & " ,case when p_punch_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_punch_end2 >= CONVERT(varchar(10), GETDATE(), 126) then '펀칭 진행중' else '' end as progress_03 "&VbCrlf
query = query & " ,p_punch_end2 as progress_03_dt "&VbCrlf
query = query & " ,case when p_dp_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_dp_end2 >= CONVERT(varchar(10), GETDATE(), 126) then 'DP 진행중' else '' end as progress_04 "&VbCrlf
query = query & " ,p_dp_end2 as progress_04_dt "&VbCrlf
query = query & " from project where p_sn = '" & rsp("p_child_sn") & "' "&VbCrlf
End if
'if( rsp("p_child_sn") = "2207007_C02" )then
' response.write query
'end if
rsa.Open query, adoConn, 1
progress_status = ""
progress_end_dt = ""
If rsa.RecordCount > 0 Then
If Len(rsp("p_child_sn")) > 10 then
toNum = 6
Else
toNum = 4
End If
For j = 1 To toNum
If rsa("progress_0"& j) <> "" Then
If progress_status <> "" Then progress_status = progress_status & ","
progress_status = progress_status & rsa("progress_0"& j)
progress_end_dt = rsa("progress_0"& j & "_dt")
End if
Next
End If
rsa.close
End If
r_complete = "N"
f_complete = "N"
d_complete = "N"
s_complete = "N"
If rsp("p_research_complete") = "1" Then
r_complete = "Y"
End If
If rsp("p_field_complete") = "1" Then
f_complete = "Y"
End If
If rsp("p_dp_complete") = "1" Then
d_complete = "Y"
End If
If rsp("p_support_complete") = "1" Then
s_complete = "Y"
End if
if rsp("p_rsch_dept") = "900" then
r_complete = "-"
end if
if rsp("p_field_dept") = "900" then
f_complete = "-"
end if
if rsp("p_is_dept") = "900" then
d_complete = "-"
s_complete = "-"
end If
Dim progress_status_arr
If InStr(progress_status,",") <> "0" Then
progress_status_arr= Split(progress_status,",")
progress_status=progress_status_arr(0)
Else
progress_status=progress_status
End If
%>
<%=i%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"><%=rsp("p_child_sn")%>
<% if Session("teamplace") >= 3 and Session("teamplace") <= 6 and r_complete = "N" then %>
')">(완료)
<% end if %>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"><%=rsp("p_subject")%>
<%=p_method_name%>
<%=rsp("p_sample")%>
<%=client_name%>
<%=p_cont_cost%>
<%=tmp_total_rate%>%
<%=progress_status%>
<%=rsp("p_con_date_end")%>
<%=researcher_name%>, <%=researcher_name2%>
<%=Mid(Left(rsp("p_input_dt"), 10), 6, 10)%>
<%=r_complete%>
<%=f_complete%>
<%=d_complete%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
<% End If %>
<% if cint(search_depart) = 12 then %>
신규 프로젝트 현황.(실사)
asdf
No.
프로젝트코드
프로젝트명
조사방법
지역
담당부서
담당자
표본수
외주여부
OT일정
진행상태
DP이관일
메모
연구
실사
QC (검증, 코딩, 펀치)
<%
'전주 & 금주 신규 프로젝트(수행계획서 결재 미완료 단계) 등록 현황~!
query = "select * "&VbCrlf
query = query & "from ( "&VbCrlf
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sur_area, TPM.p_sample, TPM.p_field_process, TPM.p_cli_company_cd, TPM.p_cont_cost, TPM.p_ot_date "&VbCrlf
query = query & ", TPM.p_rsch_dept, TPM.p_field_dept, TPM.p_is_dept, TPB.p_depart_dep, TPM.p_dp_date_st, TPB.p_input_user, TPM.p_dp_1, TPM.p_input_dt, TPM.p_progress_flag, TPM.p_input_complete, TPM.p_progress_status, TPM.p_memo "&VbCrlf
query = query & ", p_rsch_1_b, p_rsch_2_b, p_sv_1, p_sv_2, p_sv_3, p_sv_4, p_code_1, p_code_2, p_code_3, p_code_4, p_verify_1, p_verify_2, p_verify_3, p_verify_4, p_punch_1, p_punch_2, p_punch_3, p_punch_4 "&VbCrlf
query = query & "from T_PROJECT_METHOD as TPM "&VbCrlf
query = query & "inner join T_PROJECT_BASE as TPB "&VbCrlf
query = query & "on TPM.p_sn = TPB.p_sn "&VbCrlf
query = query & "where TPM.p_sub_type = 'C' "&VbCrlf
query = query & "and TPM.p_progress_status > '001' "&VbCrlf
query = query & "and TPM.p_progress_status < '008' "&VbCrlf
query = query & "and (p_field_complete is null or p_field_complete = '' or p_field_complete = 0) "&VbCrlf
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
query = query & "and TPM.p_input_dt <= (GETDATE()+(7-" & yoil & ")) "&VbCrlf
query = query & "and p_field_dept <> '900' "&VbCrlf
query = query & "union all "&VbCrlf
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sur_area, TPM.p_sample, TPM.p_field_process, TPM.p_cli_company_cd, TPB.p_cont_cost, TPM.p_ot_date "&VbCrlf
query = query & ", TPM.p_rsch_dept, TPM.p_field_dept, TPM.p_is_dept, TPB.p_depart_dep, TPM.p_dp_date_st, TPB.p_input_user, TPM.p_dp_1, TPM.p_input_dt, TPM.p_progress_flag, TPM.p_input_complete, TPM.p_progress_status, TPM.p_memo "&VbCrlf
query = query & ", p_rsch_1_b, p_rsch_2_b, p_sv_1, p_sv_2, p_sv_3, p_sv_4, p_code_1, p_code_2, p_code_3, p_code_4, p_verify_1, p_verify_2, p_verify_3, p_verify_4, p_punch_1, p_punch_2, p_punch_3, p_punch_4 "&VbCrlf
query = query & "from T_PROJECT_METHOD as TPM "&VbCrlf
query = query & "inner join T_PROJECT_BASE as TPB "&VbCrlf
query = query & "on TPM.p_sn = TPB.p_sn "&VbCrlf
query = query & "where TPM.p_sub_type = 'M' "&VbCrlf
query = query & "and TPM.p_progress_status > '001' "&VbCrlf
query = query & "and TPM.p_progress_status < '008' "&VbCrlf
query = query & "and (p_field_complete is null or p_field_complete = '' or p_field_complete = 0) "&VbCrlf
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
query = query & "and TPM.p_input_dt <= (GETDATE()+(7-" & yoil & ")) "&VbCrlf
query = query & "and p_field_dept <> '900' "&VbCrlf
query = query & ") as T "&VbCrlf
query = query & "where p_child_sn like case p_sub_type when 'M' then '%_M01' else '%%' end "&VbCrlf
'query = query & "where p_depart_dep = '" & search_depart & "' "
if search_person <> "" then
query = query & " and (p_sv_1 = '"& search_person &"' or p_sv_2 = '"& search_person &"' or p_sv_3 = '"& search_person &"' or p_sv_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_code_1 = '"& search_person &"' or p_code_2 = '"& search_person &"' or p_code_3 = '"& search_person &"' or p_code_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_verify_1 = '"& search_person &"' or p_verify_2 = '"& search_person &"' or p_verify_3 = '"& search_person &"' or p_verify_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_punch_1 = '"& search_person &"' or p_punch_2 = '"& search_person &"' or p_punch_3 = '"& search_person &"' or p_punch_4 = '"& search_person &"' ) "&VbCrlf
end if
query = query & "order by p_depart_dep, p_child_sn "&VbCrlf
'------------------------------------------------------
'Response.Write query&" "
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method_cd") <> "" Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
If rsp("p_sub_type") = "M" Then
query = query & "where p_sn = '" & Left(rsp("p_child_sn"), 7) &"' "
Else
query = query & "where p_child_sn = '" & rsp("p_child_sn") &"' "
End if
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
rsa.close
End If
client_name = ""
If rsp("p_cli_company_cd") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company_cd") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_rsch_1_b") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_1_b") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
researcher_name2 = ""
If rsp("p_rsch_2_b") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_2_b") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name2 = rsa("p_name")
End If
rsa.close
End If
sv_name = ""
If rsp("p_sv_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_sv_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
sv_name = rsa("p_name")
End If
rsa.close
End If
qc_name = ""
If rsp("p_verify_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_verify_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
qc_name = rsa("p_name")
End If
rsa.close
End If
code_name = ""
If rsp("p_code_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_code_1") &"' " '#####코딩 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
code_name = rsa("p_name")
End If
rsa.close
End If
punch_name = ""
If rsp("p_punch_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_punch_1") &"' " '#####펀치 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
punch_name = rsa("p_name")
End If
rsa.close
End If
dp_name = ""
If rsp("p_dp_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_dp_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
dp_name = rsa("p_name")
End If
rsa.close
End If
progress_status = ""
If rsp("p_input_user") <> "" Then
IF rsp("p_progress_status") = "001" Then
progress_status = "참여부서 정보 입력 중"
Elseif rsp("p_progress_status") = "006" Then
progress_status = ""
if rsp("p_rsch_dept") <> "900" and left(rsp("p_progress_flag"), 1) = "x" Then
progress_status = "연구"
End If
if rsp("p_field_dept") <> "900" and mid(rsp("p_progress_flag"), 2, 1) = "x" Then
if progress_status <> "" Then
progress_status = progress_status & ","
End If
progress_status = progress_status & "실사"
End If
if rsp("p_is_dept") <> "900" and mid(rsp("p_progress_flag"), 3, 1) = "x" Then
if progress_status <> "" Then
progress_status = progress_status & ","
End If
progress_status = progress_status & "DP"
End If
if inStr(rsp("p_progress_flag"), "x") > 0 Then
progress_status = progress_status & " 정보 "
End If
if progress_status <> "" Then
progress_status = progress_status & " "
End If
if rsp("p_rsch_dept") <> "900" and left(rsp("p_input_complete"), 1) = "x" Then
progress_status = progress_status & "연구"
End If
if rsp("p_field_dept") <> "900" and mid(rsp("p_input_complete"), 2, 1) = "x" Then
if rsp("p_rsch_dept") <> "900" and left(rsp("p_input_complete"), 1) = "x" Then
progress_status = progress_status & ","
End If
progress_status = progress_status & "실사"
End If
if inStr(rsp("p_input_complete"), "x") > 0 Then
progress_status = progress_status & " 직접비 "
End If
if inStr(rsp("p_progress_flag"), "x") > 0 or inStr(rsp("p_input_complete"), "x") > 0 then
progress_status = progress_status & "입력중"
else
progress_status = "수행계획서 결재 전"
end if
Elseif rsp("p_progress_status") = "007" Then
progress_status = "수행계획서 결재중"
Elseif rsp("p_progress_status") = "008" Then
progress_status = "수행계획서 결재완료"
End If
End If
%>
<%=i%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"> <%=rsp("p_child_sn")%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"> <%=rsp("p_subject")%>
<%=p_method_name%>
<%
q = "SELECT c_kind_code, c_common_code, c_code_name FROM T_COMMON_CODE_DETAIL WHERE c_kind_code = '012' and c_common_code = '" & rsp("p_sur_area") & "' "
rsa.Open q, adoConn, 1
if rsa.RecordCount > 0 Then
%>
<%=rsa("c_code_name")%>
<%
end if
rsa.Close
%>
<%
'##### 조직 개편(2019)
'q = "select d_code, d_name from Depart where d_yes_no = 'Y' and d_code = '" & rsp("p_depart_dep") & "' "
dim t_name
q = "Select T_name from V_department where before_t_cd1 = '"& rsp("p_depart_dep") &"' "
rsa.Open q, adoConn, 1
If rsa.RecordCount > 0 Then
'If (Instr(rsa("T_name"),"컨설팅") <> 0) or (Instr(rsa("T_name"),"연구") <> 0) Then
't_name = Right(rsa("T_name"),2)
'Else
t_name = rsa("T_name")
'End If
%>
<%=t_name%>
<%
end if
rsa.Close
%>
<%=researcher_name%>, <%=researcher_name2%>
<%=sv_name%>
<%=qc_name%>, <%=code_name%>, <%=punch_name%>
<%=rsp("p_sample")%>
<%
q = "SELECT c_kind_code, c_common_code, c_code_name FROM T_COMMON_CODE_DETAIL WHERE c_kind_code = '015' and c_common_code = '" & rsp("p_field_process") & "' "
rsa.Open q, adoConn, 1
if rsa.RecordCount > 0 Then
%>
<%=rsa("c_code_name")%>
<%
end if
rsa.Close
%>
<%=Mid(Left(rsp("p_ot_date"), 10), 6, 10)%>
<%=progress_status%>
<%=Mid(Left(rsp("p_dp_date_st"), 10), 6, 10)%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
진행 프로젝트 현황.(실사)
asdf
No.
프로젝트코드
프로젝트명
조사방법
지역
담당부서
담당자
표본수
외주여부
OT일정
진행상태
DP이관일
메모
연구
실사
QC (검증, 코딩, 펀치)
<%
'전주 & 금주 진행 프로젝트(수행계획서 결재 완료 단계) 등록 현황~!
query = ""
query = query & " select t.p_child_sn AS p_child_sn_real, "&VbCrlf
query = query & " case when [실사] = 'Y' then '(완)' else '' end as [실사], "&VbCrlf
query = query & " case when [검증] = 'Y' then '(완)' else '' end as [검증], "&VbCrlf
query = query & " case when [코딩] = 'Y' then '(완)' else '' end as [코딩], "&VbCrlf
query = query & " case when [펀치] = 'Y' then '(완)' else '' end as [펀치], T.* "&VbCrlf
query = query & " from "&VbCrlf
query = query & " ( --프로젝트(수행계획서) 정보 "&VbCrlf
query = query & " select "&VbCrlf
query = query & " TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sur_area, TPB.p_depart_dep, "&VbCrlf
query = query & " TPM.p_sample, TPM.p_ot_date, TPM.p_dp_date_st, TPM.p_memo, TPM.p_cli_company_cd, TPM.p_cont_cost, "&VbCrlf
query = query & " TPM.p_rsch_1_b, TPM.p_rsch_2_b, "&VbCrlf
query = query & " TPM.p_sv_1, p_sv_2, p_sv_3, p_sv_4, "&VbCrlf
query = query & " TPM.p_verify_1, p_verify_2, p_verify_3, p_verify_4, "&VbCrlf
query = query & " TPM.p_code_1, p_code_2, p_code_3, p_code_4, "&VbCrlf
query = query & " TPM.p_punch_1, p_punch_2, p_punch_3, p_punch_4, "&VbCrlf
query = query & " TPM.p_field_process, TPB.p_input_user, TPM.p_dp_1, TPM.p_input_dt, TPM.p_progress_status, p_field_complete "&VbCrlf
query = query & " from T_PROJECT_METHOD as TPM "&VbCrlf
query = query & " inner join T_PROJECT_BASE as TPB "&VbCrlf
query = query & " on TPM.p_sn = TPB.p_sn "&VbCrlf
query = query & " where TPM.p_sub_type = 'C' "&VbCrlf
query = query & " and TPM.p_progress_status > '007' "&VbCrlf
query = query & " and p_field_dept <> '900' "&VbCrlf
query = query & " and (p_field_complete is null or p_field_complete = '' or p_field_complete = 0) "&VbCrlf
query = query & " ) as T "&VbCrlf
query = query & " left outer join --실사&QC 완료 "&VbCrlf
query = query & " ( "&VbCrlf
query = query & " select p_child_sn, [실사], "&VbCrlf
query = query & " case "&VbCrlf
query = query & " when [검증]='Y' and [감청] = 'Y' then 'Y' "&VbCrlf
query = query & " when [검증] is null and [감청] = 'Y' then 'Y' "&VbCrlf
query = query & " when [검증] = 'Y' and [감청] is null then 'Y' "&VbCrlf
query = query & " else 'N' end [검증], "&VbCrlf
query = query & " [코딩], [펀치] from "&VbCrlf
query = query & " ( "&VbCrlf
query = query & " select p_child_sn, isnull(confirm_yn,'N') as confirm_yn, "&VbCrlf
query = query & " case when sebu not in ('검증','감청','코딩','펀치') then '실사' else sebu end as sebu from direct_cost "&VbCrlf
query = query & " where del_yes_no = 'no' "&VbCrlf
query = query & " and cost_type = 'field' "&VbCrlf
query = query & " and hangmok NOT IN ('메모','메모_경영지원실') "&VbCrlf
query = query & " ) as a "&VbCrlf
query = query & " pivot "&VbCrlf
query = query & " ( "&VbCrlf
query = query & " min(confirm_yn) for sebu in ([실사], [검증], [감청], [코딩], [펀치]) "&VbCrlf
query = query & " ) as pvt "&VbCrlf
query = query & " ) as F on T.p_child_sn = F.p_child_sn "&VbCrlf
if search_person <> "" then
query = query & " and (p_sv_1 = '"& search_person &"' or p_sv_2 = '"& search_person &"' or p_sv_3 = '"& search_person &"' or p_sv_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_code_1 = '"& search_person &"' or p_code_2 = '"& search_person &"' or p_code_3 = '"& search_person &"' or p_code_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_verify_1 = '"& search_person &"' or p_verify_2 = '"& search_person &"' or p_verify_3 = '"& search_person &"' or p_verify_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_punch_1 = '"& search_person &"' or p_punch_2 = '"& search_person &"' or p_punch_3 = '"& search_person &"' or p_punch_4 = '"& search_person &"' ) "&VbCrlf
end if
query = query & " order by T.p_child_sn "
'------------------------------------------------------
'Response.Write query
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method_cd") <> "" Then
If Len(rsp("p_child_sn_real")) > 10 Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
If rsp("p_sub_type") = "M" Then
query = query & "where p_sn = '" & Left(rsp("p_child_sn_real"), 7) &"' "
Else
query = query & "where p_child_sn = '" & rsp("p_child_sn_real") &"' "
End If
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
Else
query = "select code1, name1 from p_method where code1 = '" & rsp("p_method_cd") & "' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("name1")
Else
p_method_name = p_method_name & ", " & rsa("name1")
End if
rsa.moveNext
next
End If
End if
rsa.close
End If
client_name = ""
If rsp("p_cli_company_cd") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company_cd") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_rsch_1_b") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_1_b") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
researcher_name2 = ""
If rsp("p_rsch_2_b") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_2_b") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name2 = rsa("p_name")
End If
rsa.close
End If
sv_name = ""
If rsp("p_sv_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_sv_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
sv_name = rsa("p_name")
End If
rsa.close
End If
qc_name = ""
If rsp("p_verify_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_verify_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
qc_name = rsa("p_name")
End If
rsa.close
End If
code_name = ""
If rsp("p_code_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_code_1") &"' " '#####코딩 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
code_name = rsa("p_name")
End If
rsa.close
End If
punch_name = ""
If rsp("p_punch_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_punch_1") &"' " '#####펀치 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
punch_name = rsa("p_name")
End If
rsa.close
End If
dp_name = ""
If rsp("p_dp_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_dp_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
dp_name = rsa("p_name")
End If
rsa.close
End If
If rsp("p_input_user") <> "" Then
If Len(rsp("p_child_sn_real")) > 10 then
query = "select case when p_field_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_field_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '실사 진행중' else '' end as progress_01 "
query = query & " ,case when p_code_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_code_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '검증 진행중' else '' end as progress_02 "
query = query & " ,case when p_verify_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_verify_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '코딩 진행중' else '' end as progress_03 "
query = query & " ,case when p_punch_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_punch_date_end >= CONVERT(varchar(10), GETDATE(), 126) then '펀칭 진행중' else '' end as progress_04 "
query = query & " ,case when p_dp_date_st <= CONVERT(varchar(10), GETDATE(), 126) and p_dp_date_end >= CONVERT(varchar(10), GETDATE(), 126) then 'DP 진행중' else '' end as progress_05 "
query = query & " from T_PROJECT_METHOD where p_child_sn = '" & rsp("p_child_sn_real") & "' "
Else
query = "select case when p_field_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_field_end2 >= CONVERT(varchar(10), GETDATE(), 126) then '실사(코딩+에디팅) 진행중' else '' end as progress_01 "
query = query & " ,case when p_punch_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_punch_end2 >= CONVERT(varchar(10), GETDATE(), 126) then '펀칭 진행중' else '' end as progress_02 "
query = query & " ,case when p_dp_st2 <= CONVERT(varchar(10), GETDATE(), 126) and p_dp_end2 >= CONVERT(varchar(10), GETDATE(), 126) then 'DP 진행중' else '' end as progress_03 "
query = query & " from project where p_sn = '" & rsp("p_child_sn_real") & "' "
End if
rsa.Open query, adoConn, 1
progress_status = ""
If rsa.RecordCount > 0 Then
If Len(rsp("p_child_sn_real")) > 10 then
toNum = 5
Else
toNum = 3
End If
For j = 1 To toNum
If rsa("progress_0"& j) <> "" Then
progress_status = rsa("progress_0"& j)
End if
Next
End If
rsa.close
End If
%>
<%=i%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn_real")%>')" class="blue"><%=rsp("p_child_sn_real")%>
<% if Session("teamplace") >= 3 and Session("teamplace") <= 6 then %>
')">(완료)
<% end if %>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn_real")%>')" class="blue"><%=rsp("p_subject")%>
<%=p_method_name%>
<%
q = "SELECT c_kind_code, c_common_code, c_code_name FROM T_COMMON_CODE_DETAIL WHERE c_kind_code = '012' and c_common_code = '" & rsp("p_sur_area") & "' "
rsa.Open q, adoConn, 1
if rsa.RecordCount > 0 Then
%>
<%=rsa("c_code_name")%>
<%
end if
rsa.Close
%>
<%
'##### 조직 개편(2019)
'q = "select d_code, d_name from Depart where d_yes_no = 'Y' and d_code = '" & rsp("p_depart_dep") & "' "
q = "Select T_name from V_department where before_t_cd1 = '"& rsp("p_depart_dep") &"' "
rsa.Open q, adoConn, 1
If rsa.RecordCount > 0 Then
'If (Instr(rsa("T_name"),"컨설팅") <> 0) or (Instr(rsa("T_name"),"연구") <> 0) Then
't_name = Right(rsa("T_name"),2)
'Else
t_name = rsa("T_name")
'End If
%>
<%=t_name%>
<%
end if
rsa.Close
%>
<%=researcher_name%>, <%=researcher_name2%>
<%=sv_name%><%=rsp("실사") %>
<%=qc_name%><%=rsp("검증") %> ,
<%=code_name%><%=rsp("코딩") %> ,
<%=punch_name%><%=rsp("펀치") %>
<%=rsp("p_sample")%>
<%
q = "SELECT c_kind_code, c_common_code, c_code_name FROM T_COMMON_CODE_DETAIL WHERE c_kind_code = '015' and c_common_code = '" & rsp("p_field_process") & "' "
rsa.Open q, adoConn, 1
if rsa.RecordCount > 0 Then
%>
<%=rsa("c_code_name")%>
<%
end if
rsa.Close
%>
<%=Mid(Left(rsp("p_ot_date"), 10), 6, 10)%>
<%=progress_status%>
<%=Mid(Left(rsp("p_dp_date_st"), 10), 6, 10)%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
<% End If %>
<% if( cint(search_depart) = 17 or cint(search_depart) = 18 or cint(search_depart) = 19 )Then %>
신규 프로젝트 현황.(전산)
asdf
No.
프로젝트코드
프로젝트명
조사방법
표본수
클라이언트
담당자
진행상태
DP완료일
메모
연구
실사
QC (검증, 코딩, 펀치)
전산
<%
'전주 & 금주 신규 프로젝트(수행계획서 결재 미완료 단계) 등록 현황~!
query = "select * "
query = query & "from ( "
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sample, TPM.p_cli_company_cd, TPM.p_cont_cost "
query = query & ", TPB.p_depart_dep, TPM.p_dp_date_end, TPB.p_input_user, TPM.p_sv_1, TPM.p_verify_1, TPM.p_code_1, TPM.p_punch_1, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "
query = query & ", p_rsch_1_a, p_rsch_2_a, p_dp_1, p_dp_2, p_dp_3, p_dp_4, p_it_1, p_it_2, p_it_3, p_it_4 "
query = query & "from T_PROJECT_METHOD as TPM "
query = query & "inner join T_PROJECT_BASE as TPB "
query = query & "on TPM.p_sn = TPB.p_sn "
query = query & "where TPM.p_sub_type = 'C' "
query = query & "and TPM.p_progress_status > '001' "
query = query & "and TPM.p_progress_status < '008' "
query = query & "and TPM.p_input_dt <= (GETDATE()+(7-" & yoil & ")) "
query = query & "and p_is_dept <> '900' "
if( cint(search_depart) = 17 )then
query = query & "and (p_dp_complete is null or p_dp_complete = '' or p_dp_complete = 0) "
end if
if( cint(search_depart) = 18 )then
query = query & " and (p_it_complete is null or p_it_complete = '' or p_it_complete = 0) "
end if
query = query & "union all "
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sample, TPM.p_cli_company_cd, TPB.p_cont_cost "
query = query & ", TPB.p_depart_dep, TPM.p_dp_date_end, TPB.p_input_user, TPM.p_sv_1, TPM.p_verify_1, TPM.p_code_1, TPM.p_punch_1, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "
query = query & ", p_rsch_1_a, p_rsch_2_a, p_dp_1, p_dp_2, p_dp_3, p_dp_4, p_it_1, p_it_2, p_it_3, p_it_4 "
query = query & "from T_PROJECT_METHOD as TPM "
query = query & "inner join T_PROJECT_BASE as TPB "
query = query & "on TPM.p_sn = TPB.p_sn "
query = query & "where TPM.p_sub_type = 'M' "
query = query & "and TPM.p_progress_status > '001' "
query = query & "and TPM.p_progress_status < '008' "
query = query & "and TPM.p_input_dt <= (GETDATE()+(7-" & yoil & ")) "
query = query & "and p_is_dept <> '900' "
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then
query = query & "and (p_dp_complete is null or p_dp_complete = '' or p_dp_complete = 0) "
end if
if( cint(search_depart) = 18)then
query = query & " and (p_it_complete is null or p_it_complete = '' or p_it_complete = 0) "
end if
query = query & ") as T "
query = query & "where 1=1 "
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then
query = query & " and p_child_sn like case p_sub_type when 'M' then '%_M01' else '%%' end "
end if
if( cint(search_depart) = 18)then
query = query & " and ( p_it_1 <> '' or p_it_2 <> '' or p_it_3 <> ''or p_it_4 <> '') "
end if
'query = query & "where p_depart_dep = '" & search_depart & "' "
if search_person <> "" then
query = query & " and (p_dp_1 = '"& search_person &"' or p_dp_2 = '"& search_person &"' or p_dp_3 = '"& search_person &"' or p_dp_4 = '"& search_person &"' "
query = query & " or p_it_1 = '"& search_person &"' or p_it_2 = '"& search_person &"' or p_it_3 = '"& search_person &"' or p_it_4 = '"& search_person &"' ) "
end if
query = query & "order by p_depart_dep, p_child_sn "
'------------------------------------------------------
'Response.Write query
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method_cd") <> "" Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
If rsp("p_sub_type") = "M" Then
query = query & "where p_sn = '" & Left(rsp("p_child_sn"), 7) &"' "
Else
query = query & "where p_child_sn = '" & rsp("p_child_sn") &"' "
End if
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
rsa.close
End If
client_name = ""
If rsp("p_cli_company_cd") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company_cd") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_rsch_1_a") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_1_a") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
researcher_name2 = ""
If rsp("p_rsch_2_a") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_2_a") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name2 = rsa("p_name")
End If
rsa.close
End If
sv_name = ""
If rsp("p_sv_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_sv_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
sv_name = rsa("p_name")
End If
rsa.close
End If
qc_name = ""
If rsp("p_verify_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_verify_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
qc_name = rsa("p_name")
End If
rsa.close
End If
code_name = ""
If rsp("p_code_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_code_1") &"' " '#####코딩 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
code_name = rsa("p_name")
End If
rsa.close
End If
punch_name = ""
If rsp("p_punch_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_punch_1") &"' " '#####펀치 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
punch_name = rsa("p_name")
End If
rsa.close
End If
dp_name = ""
If rsp("p_dp_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_dp_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
dp_name = rsa("p_name")
End If
rsa.close
End If
progress_status = ""
If rsp("p_input_user") <> "" Then
query = "select * from T_COMMON_CODE_DETAIL where c_kind_code = '010' and c_common_code = '" & rsp("p_progress_status") & "' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
progress_status = rsa("c_code_name")
End If
rsa.close
End If
%>
<%=i%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"> <%=rsp("p_child_sn")%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"> <%=rsp("p_subject")%>
<%=p_method_name%>
<%=rsp("p_sample")%>
<%=client_name%>
<%=researcher_name%>, <%=researcher_name2%>
<%=sv_name%>
<%=qc_name%>, <%=code_name%>, <%=punch_name%>
<%=dp_name%>
<%=progress_status%>
<%=Mid(Left(rsp("p_dp_date_end"), 10), 6, 10)%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
진행 프로젝트 현황.(전산)
asdf
No.
프로젝트코드
프로젝트명
조사방법
표본수
클라이언트
담당자
DP완료일
메모
연구
실사
QC (검증, 코딩, 펀치)
전산
<%
'전주 & 금주 진행 프로젝트(수행계획서 결재 완료 단계) 등록 현황~!
query = "select * "&VbCrlf
query = query & "from ( "&VbCrlf
query = query & "select p_sn as p_child_sn, 'C' as p_sub_type, p_subject, p_method as p_method_cd, p_sample, p_cli_company as p_cli_company_cd "&VbCrlf
query = query & ", p_budget as p_cont_cost, p_depart_dep, p_dp_end2 as p_dp_date_end, p_rsch_1 as p_input_user, p_sv as p_sv_1, p_verify as p_verify_1, p_coder as p_code_1, p_puncher as p_punch_1, p_contact_date as p_input_dt, '999' as p_progress_status, p_memo "&VbCrlf
query = query & ", p_rsch_1 as p_rsch_1_a, p_rsch_2 as p_rsch_2_a, p_dper as p_dp_1, p_dper2 as p_dp_2, p_dper3 as p_dp_3, p_dper4 as p_dp_4, '' as p_it_1, '' as p_it_2, '' as p_it_3, '' as p_it_4, p_dp_complete, p_it_complete "&VbCrlf
query = query & "from project "&VbCrlf
query = query & "where p_sn like substring(convert(varchar(4), year(GETDATE())), 3, 2)+'%' and p_contact_date is not null "&VbCrlf
query = query & "and substring(p_contact_date,1,4) = year(GETDATE()) "&VbCrlf
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then
query = query & "and (p_dp_complete is null or p_dp_complete = '' or p_dp_complete = 0) "&VbCrlf
end if
if( cint(search_depart) = 18)then
query = query & " and (p_it_complete is null or p_it_complete = '' or p_it_complete = 0) " &VbCrlf
end if
'query = query & "where substring(p_dp_end2,1,4) = year(GETDATE()) and p_dp_end2 >= '" & search_ST_DT & "' "
query = query & "union all "&VbCrlf
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sample, TPM.p_cli_company_cd, TPM.p_cont_cost "&VbCrlf
query = query & ", TPB.p_depart_dep, TPM.p_dp_date_end, TPB.p_input_user, TPM.p_sv_1, TPM.p_verify_1, TPM.p_code_1, TPM.p_punch_1, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "&VbCrlf
query = query & ", p_rsch_1_a, p_rsch_2_a, p_dp_1, p_dp_2, p_dp_3, p_dp_4, p_it_1, p_it_2, p_it_3, p_it_4, p_dp_complete, p_it_complete "&VbCrlf
query = query & "from T_PROJECT_METHOD as TPM "&VbCrlf
query = query & "inner join T_PROJECT_BASE as TPB "&VbCrlf
query = query & "on TPM.p_sn = TPB.p_sn "&VbCrlf
query = query & "where TPM.p_sub_type = 'C' "&VbCrlf
query = query & "and TPM.p_progress_status > '007' "&VbCrlf
query = query & "and p_is_dept <> '900' "&VbCrlf
'query = query & "and p_dp_date_end >= '" & search_ST_DT & "' "
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then
query = query & "and (p_dp_complete is null or p_dp_complete = '' or p_dp_complete = 0) "&VbCrlf
end if
if( cint(search_depart) = 18)then
query = query & " and (p_it_complete is null or p_it_complete = '' or p_it_complete = 0) " &VbCrlf
end if
query = query & "union all "&VbCrlf
query = query & "select TPM.p_child_sn, TPM.p_sub_type, TPM.p_subject, TPM.p_method_cd, TPM.p_sample, TPM.p_cli_company_cd, TPB.p_cont_cost "&VbCrlf
query = query & ", TPB.p_depart_dep, TPM.p_dp_date_end, TPB.p_input_user, TPM.p_sv_1, TPM.p_verify_1, TPM.p_code_1, TPM.p_punch_1, TPM.p_input_dt, TPM.p_progress_status, TPM.p_memo "&VbCrlf
query = query & ", p_rsch_1_a, p_rsch_2_a, p_dp_1, p_dp_2, p_dp_3, p_dp_4, p_it_1, p_it_2, p_it_3, p_it_4, p_dp_complete, p_it_complete "&VbCrlf
query = query & "from T_PROJECT_METHOD as TPM "&VbCrlf
query = query & "inner join T_PROJECT_BASE as TPB "&VbCrlf
query = query & "on TPM.p_sn = TPB.p_sn "&VbCrlf
query = query & "where TPM.p_sub_type = 'M' "&VbCrlf
query = query & "and TPM.p_progress_status > '007' "&VbCrlf
query = query & "and p_is_dept <> '900' "&VbCrlf
'query = query & "and p_dp_date_end >= '" & search_ST_DT & "' "
'query = query & "and TPM.p_input_dt between (GETDATE()-" & yoil & "+1)-7 and (GETDATE()+(7-" & yoil & ")) "
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then
query = query & "and (p_dp_complete is null or p_dp_complete = '' or p_dp_complete = 0) "&VbCrlf
end if
if( cint(search_depart) = 18)then
query = query & " and (p_it_complete is null or p_it_complete = '' or p_it_complete = 0) " &VbCrlf
end if
query = query & ") as T "&VbCrlf
'query = query & "where p_child_sn like case p_sub_type when 'M' then '%_M01' else '%%' end "&VbCrlf
query = query & "where 1=1 "&VbCrlf
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then
query = query & " and p_child_sn like case p_sub_type when 'M' then '%_M01' else '%%' end "
end if
if( cint(search_depart) = 18)then
query = query & " and ( p_it_1 <> '' or p_it_2 <> '' or p_it_3 <> ''or p_it_4 <> '') "
end if
'query = query & "where p_depart_dep = '" & search_depart & "' "
if search_person <> "" then
query = query & " and (p_dp_1 = '"& search_person &"' or p_dp_2 = '"& search_person &"' or p_dp_3 = '"& search_person &"' or p_dp_4 = '"& search_person &"' "&VbCrlf
query = query & " or p_it_1 = '"& search_person &"' or p_it_2 = '"& search_person &"' or p_it_3 = '"& search_person &"' or p_it_4 = '"& search_person &"' ) "&VbCrlf
end if
query = query & "order by p_child_sn "&VbCrlf
'------------------------------------------------------
'Response.Write query
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 Then
For i = 1 To rsp.RecordCount
p_method_name = ""
If rsp("p_method_cd") <> "" Then
If Len(rsp("p_child_sn")) > 10 Then
query = "select a.p_method_cd, b.p_method_nm from V_PROJECT_METHOD as A "
query = query & "inner join T_PROJECT_METHOD_CD as B on a.p_method_cd = b.p_method_cd "
If rsp("p_sub_type") = "M" Then
query = query & "where p_sn = '" & Left(rsp("p_child_sn"), 7) &"' "
Else
query = query & "where p_child_sn = '" & rsp("p_child_sn") &"' "
End If
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("p_method_nm")
Else
p_method_name = p_method_name & ", " & rsa("p_method_nm")
End if
rsa.moveNext
next
End If
Else
query = "select code1, name1 from p_method where code1 = '" & rsp("p_method_cd") & "' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
For j = 1 To rsa.RecordCount
If j = 1 Then
p_method_name = rsa("name1")
Else
p_method_name = p_method_name & ", " & rsa("name1")
End if
rsa.moveNext
next
End If
End if
rsa.close
End If
client_name = ""
If rsp("p_cli_company_cd") <> "" Then
query = "select p_cli_company_nm from V_CLIENT_COMP where p_cli_company_cd = '" & rsp("p_cli_company_cd") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
client_name = rsa("p_cli_company_nm")
End If
rsa.close
End If
researcher_name = ""
If rsp("p_rsch_1_a") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_1_a") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name = rsa("p_name")
End If
rsa.close
End If
researcher_name2 = ""
If rsp("p_rsch_2_a") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_rsch_2_a") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
researcher_name2 = rsa("p_name")
End If
rsa.close
End If
sv_name = ""
If rsp("p_sv_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_sv_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
sv_name = rsa("p_name")
End If
rsa.close
End If
qc_name = ""
If rsp("p_verify_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_verify_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
qc_name = rsa("p_name")
End If
rsa.close
End If
code_name = ""
If rsp("p_code_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_code_1") &"' " '#####코딩 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
code_name = rsa("p_name")
End If
rsa.close
End If
punch_name = ""
If rsp("p_punch_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_punch_1") &"' " '#####펀치 2018-11-06 (Hwi)
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
punch_name = rsa("p_name")
End If
rsa.close
End If
dp_name = ""
If rsp("p_dp_1") <> "" Then
query = "select p_name from person where p_no = '" & rsp("p_dp_1") &"' "
rsa.Open query, adoConn, 1
If rsa.RecordCount > 0 Then
dp_name = rsa("p_name")
End If
rsa.close
End If
%>
<%=i%>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"><%=rsp("p_child_sn")%>
<% if (Session("teamplace") >= 3 and Session("teamplace") <= 6) or Session("User_Number") = "20160203" then %>
<% '//-- 정보분석 20160203 성희그룹장님 완료 버튼 나오도록 수정 240812
if( cint(search_depart) = 17 or cint(search_depart) = 19 )then %>
')">(완료)
<% end if
'//-- 개발팀
if( cint(search_depart) = 18 )then %>
')">(완료)
<%end if %>
<% end if %>
','<%=rsp("p_sub_type")%>','<%=rsp("p_method_cd")%>','<%=rsp("p_child_sn")%>')" class="blue"><%=rsp("p_subject")%>
<%=p_method_name%>
<%=rsp("p_sample")%>
<%=client_name%>
<%=researcher_name%>, <%=researcher_name2%>
<%=sv_name%>
<%=qc_name%>, <%=code_name%>, <%=punch_name%>
<%=dp_name%>
<%=Mid(Left(rsp("p_dp_date_end"), 10), 6, 10)%>
<% If Len(rsp("p_memo")) > 10 Then %> <%=(Left(rsp("p_memo"), 10) & "...")%>
<% Else %> <%=rsp("p_memo")%> <% End If %>
<%
rsp.MoveNext
Next
end if
rsp.Close
%>
<% End If %>