Files
KIN/project/contact_project_search_2014.asp
2025-09-29 17:55:08 +09:00

351 lines
15 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<script language="javascript" src="/js/common.js"></script>
<link rel="stylesheet" type="text/css" href="/css/basic.css">
<%
set rsp = server.CreateObject("ADODB.RECORDSET")
p_contact = request("p_contact")
contat_p_sn = request("contat_p_sn")
p_subject = request("p_subject")
p_depart = request("p_depart")
tmp_month = request("tmp_month")
tmp_year = request("tmp_year")
tmp_state = request("tmp_state")
%>
<script language=javascript>
function openit(a) {
document.pms.action = "contact_project_search_2014.asp";
document.pms.submit();
}
function subit(p_sn, p_subject) {
p_subject = "[" + p_sn + "] " + p_subject;
opener.document.pms.c_project_cd.value = p_sn;
opener.document.pms.c_project_nm.value = p_subject;
self.close();
}
</script>
<script src="/lib/function.js" type="text/javascript1.3"></script>
<form name="pms" method="post">
<td width="100%" valign="top">
<input type="hidden" name="p_contact" value="<%= p_contact%>" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" style="padding:20;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<font class="brown">검색 조건을 선택하세요.</font>
</font>
</td>
</tr>
<tr>
<td style="padding:5 0 0 0">
<table width="100%" height="37" cellpadding="0" cellspacing="0" border="0" bgcolor="#c0c0c0">
<tr>
<td bgcolor="#DFDFDF" style="padding:0 0 0 10">
부서&nbsp;
<select name="p_depart">
<%
if view_depart = "" then
%>
<option value="" <% if p_depart = "" then %> selected <% end if %>>전체</option>
<%
end if
query = "SELECT * " & _
"FROM depart " & _
"WHERE d_yes_no = 'Y' " & _
" AND (" & _
" (d_code <= 12) " & _
" or " & _
" (d_code >= 20 AND d_code <= 39) or (d_code='90') " & _
") ORDER BY d_code "
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
for i = 1 to rsc.RecordCount
if cint(Session("Depart_Code")) = cint(rsc("d_mcode")) OR view_depart = "" then
%>
<option value="<%=rsc("d_code")%>" <% if cstr(p_depart) = cstr(rsc("d_code")) then %> selected <% end if %>><%=rsc("d_name")%></option>
<%
end if
rsc.MoveNext
next
end if
rsc.Close
%>
</select>
&nbsp;&nbsp;
년도&nbsp;
<select name="tmp_year">
<%
for i = year(date()) to 2009 step -1
%>
<option value="<%=i%>" <% if tmp_year = cstr(i) then %> selected <% end if %>><%=i%>년</option>
<%
next
%>
</select>
&nbsp;&nbsp;
월&nbsp;
<select name="tmp_month">
<option value="0" <% if tmp_month = "0" then %> selected <% end if %>>전체</option>
<%
if cstr(tmp_year) = cstr(year(date())) OR tmp_year = "" then
tmp_i = month(date())
else
tmp_i = 12
end if
for i = 1 to tmp_i
%>
<option value="<%=i%>" <% if tmp_month = cstr(i) then %> selected <% end if %>><%=i%>월</option>
<%
next
%>
</select>
&nbsp;&nbsp;
<%
if p_contact <> "002" then
%>
프로젝트 진행상태&nbsp;
<select name="tmp_state" >
<option value="" <% if tmp_state = "" then %> selected <% end if %>>전체</option>
<option value="K" <% if tmp_state = "K" then %> selected <% end if %>>제안</option>
<option value="P" <% if tmp_state = "P" then %> selected <% end if %>>수주</option>
<option value="D" <% if tmp_state = "D" then %> selected <% end if %>>연기</option>
<option value="X" <% if tmp_state = "X" then %> selected <% end if %>>탈락</option>
</select>
<%
else
%>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%
end if
%>
&nbsp;&nbsp;&nbsp;&nbsp;
프로젝트 명 : &nbsp;
<input type="text" style="width:200" name="p_subject" maxlength=20 style='ime-mode:inactive;' value='<%=p_subject%>'>&nbsp;&nbsp;
<img src="/images/common/btn_smallsrch.gif" align="absmiddle" onclick='openit();' style='cursor:pointer' >
&nbsp;&nbsp;
&nbsp;&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding:10 0 0 0">
<%
if p_contact <> "002" then
%>
<table width="100%" cellpadding="3" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td align="center" width=150>제안 번호</td>
<td align="center" >프로젝트 명</td>
<td align="center" >진행 상태</td>
<td align="center" >클라이언트명</td>
<td align="center" >담당자</td>
<td align="center" >최초등록일</td>
</tr>
<!-- loop start -->
<%
query = " SELECT p_sn, p_cli_company_cd, p_client_type_cd, p_subject, p_cli_per_cd, p_memo, "
query = query & " p_cont_cost, p_decide_date, p_input_dt, p_state, p_input_user, "
query = query & " p_depart_dep, p_depart_team, p.p_name as p_name, p.p_depart, D.d_name "
query = query & " FROM T_PROJECT_BASE PB INNER JOIN person P ON PB.p_input_user = P.P_NO "
query = query & " INNER JOIN Depart D ON PB.p_depart_dep = d.d_code "
query = query & " WHERE p_sn IS NOT NULL"
'------------------------------------------------------
'조회 옵션
if p_depart <> "" then
query = query & " AND p_depart_dep = '" & p_depart & "' "
end if
'------------------------------------------------------
'년 옵션
if tmp_year <> "0" and tmp_year <> "" then
query = query & " AND YEAR(p_input_dt) = '" & tmp_year & "' "
else
query = query & " AND YEAR(p_input_dt) = '" & year(date()) & "' "
end if
'------------------------------------------------------
'월 옵션
if tmp_month <> "0" and tmp_month <> "" then
query = query & " AND MONTH(p_input_dt) = '" & right("0" & tmp_month, 2) & "' "
end if
'------------------------------------------------------
'프로젝트 진행상태 옵션
if tmp_state <> "" then
query = query & " AND p_state = '"&tmp_state&"' "
end if
'------------------------------------------------------
'프로젝트 명 검색 옵션
if p_subject <> "" then
query = query & " AND p_subject LIKE '%"&p_subject&"%' "
end if
'------------------------------------------------------
query = query & " ORDER BY p_input_dt"
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
for i = 1 to rsc.RecordCount
query = " SELECT * "
query = query & " FROM V_CLIENT_PERSON "
query = query & " WHERE p_cli_per_cd = '" & rsc("p_cli_per_cd") & "' "
query = query & " AND p_cli_company_cd = '" & rsc("p_cli_company_cd") & "' "
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 then
tmp_cli_name = rsp("p_cli_per_nm")
else
tmp_cli_name = "미존재"
end if
rsp.Close
tmp_content = rsc("p_subject")
if i mod 2 = 0 then
tmp_bgcolor = "#dbe9f2"
else
tmp_bgcolor = "#ffffff"
end if
if rsc("p_state") = "K" then
p_state_kor = "제안"
elseif rsc("p_state") = "P" then
p_state_kor = "수주"
elseif rsc("p_state") = "D" then
p_state_kor = "연기"
elseif rsc("p_state") = "X" then
p_state_kor = "탈락"
else
a = "<오류> : 관리자 문의바람"
end if
%>
<tr bgcolor="<%=tmp_bgcolor%>">
<td align="center"><%=rsc("p_sn")%></td>
<td align="center"><a href="javascript:subit('<%=rsc("p_sn")%>', '<%=rsc("p_subject")%>')" class="blue"><%=rsc("p_subject")%></a></td>
<td align="center"><%=p_state_kor%></td>
<td align="center"><%=tmp_cli_name %></td>
<td class="center" align="center"><%=rsc("p_name")%></td>
<td align="center" ><%=rsc("p_input_dt")%></td>
</tr>
<%
rsc.MoveNext
next
end if
rsc.Close
%>
<!-- loop end -->
<tr>
<td colspan="6" bgcolor="#d5d5d5" height="1"></td>
</tr>
</table>
<%
else
%>
<table width="100%" cellpadding="3" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td align="center" width=100>프로젝트코드</td>
<td align="center" >프로젝트 명</td>
<td align="center" >조사방법</td>
<td align="center" width=60>연구부서</td>
<td align="center" >클라이언트명</td>
<td align="center" width=60>최초등록일</td>
</tr>
<!-- loop start -->
<%
query = " SELECT p_child_sn, p_subject, p_method_nm, CASE WHEN ISNULL(team_name, '') = '' THEN CASE WHEN p_field_dept <> '900' THEN '자료조사실' END ELSE team_name END depart_name, "
query = query & " p_cli_company_nm, Convert(varchar(10), TPM.p_input_dt, 120) as p_input_dt "
query = query & " FROM T_PROJECT_METHOD TPM "
query = query & " LEFT OUTER JOIN T_PROJECT_METHOD_CD TPMC ON TPM.p_method_cd = TPMC.p_method_cd AND TPMC.p_method_yn = 'y' "
query = query & " LEFT OUTER JOIN TEAM_GROUP TG ON TPM.p_rsch_dept = TG.team_cd AND TG.div_use = '1' "
query = query & " LEFT OUTER JOIN V_CLIENT_COMP VCC ON TPM.p_cli_company_cd = VCC.p_cli_company_cd "
query = query & " WHERE TPM.p_progress_status >= '006' AND p_rsch_dept <> '91' "
'------------------------------------------------------
'조회 옵션
if p_depart <> "" then
query = query & " AND (p_rsch_dept = '" & p_depart & "' OR (p_rsch_dept = '900' and p_field_dept = '" & p_depart & "')) "
end if
'------------------------------------------------------
'년 옵션
if tmp_year <> "0" and tmp_year <> "" then
query = query & " AND '20' +LEFT(p_child_sn, 2) = '" & tmp_year & "' "
else
query = query & " AND '20' +LEFT(p_child_sn, 2) = '" & year(date()) & "' "
end if
'------------------------------------------------------
'월 옵션
if tmp_month <> "0" and tmp_month <> "" then
query = query & " AND RIGHT(LEFT(p_child_sn, 4), 2) = '" & right("0" & tmp_month, 2) & "' "
end if
'------------------------------------------------------
'프로젝트 명 검색 옵션
if p_subject <> "" then
query = query & " AND p_subject LIKE '%"&p_subject&"%' "
end if
'------------------------------------------------------
query = query & " ORDER BY p_child_sn "
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
for i = 1 to rsc.RecordCount
if i mod 2 = 0 then
tmp_bgcolor = "#dbe9f2"
else
tmp_bgcolor = "#ffffff"
end if
%>
<tr bgcolor="<%=tmp_bgcolor%>">
<td align="center"><%=rsc("p_child_sn")%></td>
<td align="center"><a href="javascript:subit('<%=rsc("p_child_sn")%>', '<%=rsc("p_subject")%>')" class="blue"><%=rsc("p_subject")%></a></td>
<td align="center" align="center"><%=rsc("p_method_nm")%></td>
<td align="center" align="center"><%=rsc("depart_name") %></td>
<td class="center"><%=rsc("p_cli_company_nm")%></td>
<td align="center" ><%=rsc("p_input_dt")%></td>
</tr>
<%
rsc.MoveNext
next
end if
rsc.Close
%>
<!-- loop end -->
<tr>
<td colspan="6" bgcolor="#d5d5d5" height="1"></td>
</tr>
</table>
<%
end if
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</form>