Files
KIN/project/project_search_2014.asp
Choins 6f3e65eb98 프로젝트>프로젝트 검색
리스트의 직접비항목에 업무일지비용 추가
2026-01-27 15:30:08 +09:00

1366 lines
64 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- #include virtual = "include/header.asp" -->
<%
dim command
command = Request("command")
if command <> "excel" then
%>
<!-- #include virtual = "include/left.asp" -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1>프로젝트 검색</h1>
</div>
<!-- /.content-header -->
<!-- Main content -->
<div class="content-body">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12" onclick="javascript:try{if(winObj.window.focus()){}}catch(exception){}" ondblclick="javascript:try{if(winObj.window.focus()){}}catch(exception){}">
<%
End If
'#### funs ↓#########################################
function fnc_replace(mo,motype)
dim tval : tval=""
select case motype
case "0"
tval=replace(mo,"'", "")
tval=replace(tval,"""", "")
end select
fnc_replace=tval
end function
'#### funs ↑#########################################
dim xxlist : xxlist="0"
p_sn = fnc_replace(Request("p_sn"),"0")
p_subject = fnc_replace(request("p_subject"),"0")
p_depart = request("p_depart")
p_method = request("p_method")
p_cli_company = fnc_replace(request("p_cli_company"),"0")
p_category = request("p_category")
p_target_part = request("p_target_part")
p_area_part = request("p_area_part")
p_survey_part = request("p_survey_part")
p_field_process = request("p_field_process")
p_decide_date_st = request("p_decide_date_st")
p_decide_date_ed = request("p_decide_date_ed")
c_common_code = request("c_common_code") '문서종류
f_file_name = fnc_replace(request("f_file_name"),"0")
p_client_type_cd = request("p_client_type_cd")
p_types1 = request("p_types1")
p_types2 = request("p_types2")
p_types3 = request("p_types3")
project_old_new = request("project_old_new")
p_export_range = request("p_export_range") '용역범위
p_sample_st = fnc_replace(replace(request("p_sample_st"),",",""),"0") '표본수 시작
p_sample_ed = fnc_replace(replace(request("p_sample_ed"),",",""),"0") '표본수 끝
p_intention= replace(replace(request("p_intention"),"'",""),"""","") '조사내용
p_user=replace(replace(request("p_user"),"'",""),"""","") '참여인력
p_no = fnc_replace(Request("p_no"),"0")
print_gubn = request("print_gubn") '-- 출력구분(프로젝트 수행계획서 , 제안 등록) : 추가 20170721
pps_state_nm = request("pps_state_nm") '-- 제안등록 상태 : 추가 20170723
'-- 참여인력 검색
if p_user<>"" then
w_sql = " select p_no from dbo.person "
w_sql = w_sql & " where p_name='"&p_user&"' "
w_sql = w_sql & " order by p_no desc "
rs.Open w_sql, adoConn, 1
if rs.recordCount>0 then p_user_ck="1" '-- 사원정보 있음
new_p="" : old_p=""
for i = 1 to rs.recordCount
'-- 현재 프로젝트
if cint(i)>1 then new_p = new_p & " or "
new_p = new_p & " TPM.p_rsch_1_a='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_2_a='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_3_a='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_4_a='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_1_b='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_2_b='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_3_b='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_4_b='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_1_c='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_2_c='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_3_c='[krc_id]' or "
new_p = new_p & " TPM.p_rsch_4_c='[krc_id]' or "
new_p = new_p & " TPM.p_sv_1='[krc_id]' or "
new_p = new_p & " TPM.p_sv_2='[krc_id]' or "
new_p = new_p & " TPM.p_sv_3='[krc_id]' or "
new_p = new_p & " TPM.p_sv_4='[krc_id]' or "
new_p = new_p & " TPM.p_code_1='[krc_id]' or "
new_p = new_p & " TPM.p_code_2='[krc_id]' or "
new_p = new_p & " TPM.p_code_3='[krc_id]' or "
new_p = new_p & " TPM.p_code_4='[krc_id]' or "
new_p = new_p & " TPM.p_verify_1='[krc_id]' or "
new_p = new_p & " TPM.p_verify_2='[krc_id]' or "
new_p = new_p & " TPM.p_verify_3='[krc_id]' or "
new_p = new_p & " TPM.p_verify_4='[krc_id]' or "
new_p = new_p & " TPM.p_dp_1='[krc_id]' or "
new_p = new_p & " TPM.p_dp_2='[krc_id]' or "
new_p = new_p & " TPM.p_dp_3='[krc_id]' or "
new_p = new_p & " TPM.p_dp_4='[krc_id]' or "
new_p = new_p & " TPM.p_it_1='[krc_id]' or "
new_p = new_p & " TPM.p_it_2='[krc_id]' or "
new_p = new_p & " TPM.p_it_3='[krc_id]' or "
new_p = new_p & " TPM.p_it_4='[krc_id]' or "
new_p = new_p & " TPM.p_supp_1='[krc_id]' or "
new_p = new_p & " TPM.p_supp_2='[krc_id]' or "
new_p = new_p & " TPM.p_supp_3='[krc_id]' or "
new_p = new_p & " TPM.p_supp_4='[krc_id]' "
new_p=replace(new_p,"[krc_id]",rs(0))
'-- 과거 프로젝트
if cint(i)>1 then old_p = old_p & " or "
old_p = old_p & " p.p_rsch_1='[krc_id]' or "
old_p = old_p & " p.p_rsch_2='[krc_id]' or "
old_p = old_p & " p.p_rsch_3='[krc_id]' or "
old_p = old_p & " p.p_rsch_4='[krc_id]' or "
old_p = old_p & " p.p_rsch_5='[krc_id]' or "
old_p = old_p & " p.p_rsch_6='[krc_id]' "
old_p=replace(old_p,"[krc_id]",rs(0))
rs.movenext
next
rs.close
'-- 정리 ---------------------------------------
if len(new_p)>0 then new_p = " and ( " & new_p & ")"
if len(old_p)>0 then old_p = " and ( " & old_p & ")"
'----------------------------------------------
end if
s = request("s")
if command = "excel" then
Response.CacheControl = "public"
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition","attachment;filename=검색_("&replace(cstr(date()),"-","")&").xls"
end if
'======================================================
%>
<form name="pms" method="post">
<input type="hidden" name="project_old_new_check" id= "project_old_new_check" value="<%=project_old_new %>">
<input type="hidden" name="p_types1_check" id= "p_types1_check" value="<%=p_types1%>">
<input type="hidden" name="p_types2_check" id= "p_types2_check" value="<%=p_types2%>">
<input type="hidden" name="p_types3_check" id= "p_types3_check" value="<%=p_types3%>">
<input type="hidden" id="tprint_gubn" value="<%=print_gubn%>" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<%if command <> "excel" then 'excel export[2] %>
<tr>
<td>검색을 원하시는 프로젝트 조건을 설정하시고, 찾기 버튼을 클릭해 주세요.</td>
</tr>
<%end if 'excel export[2] %>
<tr>
<td style="padding:5 0 0 0;">
<%if command <> "excel" then 'excel export[3] %>
<table id= "searchTable" width="1200px" class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td colspan="4" height="4" ></td>
</tr>
<tr>
<td width="15%" align="center" >프로젝트 코드</td>
<td width="35%" >
<input type="text" style="width:250;" name="p_sn" value="<%=p_sn %>" style='ime-mode:active;' onkeyup="javascript:characterCheck(this.name);" onkeydown="javascript:characterCheck(this.name);" >
</td>
<td width="15%" align="center" >프로젝트 명</td>
<td width="35%" >
<input type="text" style="width:250;" name="p_subject" value="<%=p_subject %>" style='ime-mode:active;' onkeyup="javascript:characterCheck(this.name);" onkeydown="javascript:characterCheck(this.name);" >
</td>
</tr>
<tr>
<td width="15%" align="center" >부서</td>
<td width="35%" >
<select name="p_depart" id="p_depart" onchange="exPdepart();" >
<option value="">전 체</option>
<%
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, 90, 93) or before_t_cd1 between 20 and 91) "
query = query & " order by LEFT(T_Name, 8) "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("d_code")%>" <% if p_depart = trim(Rs("d_code")) then %> selected <% end if %> ><%=Rs("d_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
&nbsp;
/
&nbsp;
<select name="p_no" id="p_no" onchange="exPno();" >
<option value="">전 체</option>
<%
query = ""
query = query & " SELECT DISTINCT p_no, p_name, p_team_name, p_team_name +'/'+ p_name as p_departname, p_depart "
query = query & " FROM project2.dbo.v_person "
query = query & " WHERE p_resign = 0 and (p_depart between '20' and '91' or p_depart = 90) "
if p_depart <> "" then
query = query & " AND p_no in (select p_no from project2.dbo.person where p_depart = '" & p_depart & "' ) " '//-- 2020-10-20 16:49:55
end if
query = query & " order by p_depart, p_no "
'response.write query
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("p_no")%>" date-id="<%=Rs("p_depart")%>" <% if p_no = trim(Rs("p_no")) then %> selected <% end if %> ><%=Rs("p_departname")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
<td width="15%" align="center" >조사방법</td>
<td width="35%" >
<select name="p_method">
<option value="">전 체</option>
<%
query = " SELECT * "
query = query & " FROM T_PROJECT_METHOD_CD "
query = query & " WHERE p_method_yn = 'Y' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("p_method_cd")%>" <% if p_method = trim(Rs("p_method_cd")) then %> selected <% end if %>><%=Rs("p_method_nm")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
<option value="99" <% if p_method_cd = "99" then %> selected <% end if %>>기 타</option>
</select>
</td>
</tr>
<tr>
<td align="center" >클라이언트명</td>
<td >
<input type="text" style="width:250;" name="p_cli_company" value="<%=p_cli_company %>" style='ime-mode:active;' onkeyup="javascript:characterCheck(this.name);" onkeydown="javascript:characterCheck(this.name);" >
</td>
<td align="center" >카테고리</td>
<td >
<select name="p_category">
<option value="">전 체</option>
<%
query = " SELECT * "
query = query & " FROM p_category "
query = query & " ORDER BY CODE1 "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("code1")%>" <% if p_category = trim(Rs("code1")) then %> selected <% end if %> ><%=Rs("name1")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
</tr>
<tr>
<td align="center" >업종</td>
<td colspan='3'>
<input type="radio" name="project_old_new" id="project_old_new0" value="" onclick="old_new_change()" <%if project_old_new = "" then %>checked <% end if %>/>선택안함
<input type="radio" name="project_old_new" id="project_old_new1" value="new" onclick="old_new_change()" <%if project_old_new = "new" then %>checked <% end if %>/>신규프로젝트&nbsp;(2014-07 이후 프로젝트)&nbsp;&nbsp;&nbsp;
<input type="radio" name="project_old_new" id="project_old_new2" value="old" onclick="old_new_change()" <%if project_old_new = "old" then %>checked <% end if %>/>구프로젝트
<select name="p_client_type_cd" id="p_client_type_cd" style="display:none">
<option value="">전체</option>
<%
query = " SELECT p_client_type_cd, p_client_type_nm "
query = query & " FROM T_CLIENT_TYPE_CD "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("p_client_type_cd")%>" <% if p_client_type_cd = trim(Rs("p_client_type_cd")) then %> selected <% end if %> ><%=Rs("p_client_type_nm")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
<select name="p_types1" id="p_types1" style="display:none">
<option value="">선택</option>
<%
q = "SELECT * "
q = q & "FROM p_types "
q = q & "WHERE t_type = '1' "
q = q & "ORDER BY t_sn "
Rs.Open q, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("t_code1")%>" <% if p_types1 = trim(Rs("t_code1")) then %> selected <% end if %> ><%=Rs("t_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
&nbsp;&nbsp;&nbsp;
<select name="p_types2" id="p_types2" style="display:none">
</select>
&nbsp;&nbsp;&nbsp;
<select name="p_types3" id="p_types3" style="display:none">
</select>
</td>
</tr>
<tr>
<td align="center" >조사대상</td>
<td >
<select name="p_target_part">
<option value="">전체</option>
<%
query = " SELECT * "
query = query & " FROM T_COMMON_CODE_DETAIL "
query = query & " WHERE c_kind_code = '013' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("c_common_code")%>" <% if p_target_part = trim(Rs("c_common_code")) then %> selected <% end if %> ><%=Rs("c_code_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
<td align="center" >조사지역</td>
<td >
<select name="p_area_part">
<option value="">전체</option>
<%
query = " SELECT * "
query = query & " FROM T_COMMON_CODE_DETAIL "
query = query & " WHERE c_kind_code = '012' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("c_common_code")%>" <% if p_area_part = trim(Rs("c_common_code")) then %> selected <% end if %> ><%=Rs("c_code_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
<option value="5" <% if p_area_part = "5" then %> selected <% end if %>>기타</option>
</select>
</td>
</tr>
<tr>
<td align="center" >조사분류</td>
<td >
<select name="p_survey_part">
<option value="">전체</option>
<%
query = " SELECT * "
query = query & " FROM T_COMMON_CODE_DETAIL "
query = query & " WHERE c_kind_code = '014' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("c_common_code")%>" <% if trim(p_survey_part) = trim(Rs("c_common_code")) then %> selected <% end if %> ><%=Rs("c_code_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
<td align="center" >실사수행</td>
<td >
<select name="p_field_process">
<option value="">전체</option>
<%
query = " SELECT * "
query = query & " FROM T_COMMON_CODE_DETAIL "
query = query & " WHERE c_kind_code = '015' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("c_common_code")%>" <% if trim(p_field_process) = trim(Rs("c_common_code")) then %> selected <% end if %> ><%=Rs("c_code_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
</tr>
<!--------- 추가 20170619 ↓--------->
<tr>
<td align="center" >조사내용</td>
<td colspan='3'><input type="text" style="width:250;" name="p_intention" value="<%=p_intention%>" style='ime-mode:active;' onkeyup="javascript:characterCheck(this.name);" onkeydown="javascript:characterCheck(this.name);" ></td>
</tr>
<tr>
<td align="center" >참여인력</td>
<td colspan='3'><input type="text" style="width:120;" name="p_user" value="<%=p_user%>" >
<%if len(p_user)>0 and p_user_ck="" then %>&nbsp;<font color=red>※ 사원이름이 정확하지 않습니다. 정확하게 입력하신후 찾기버튼을 눌러 주세요</font><%end if%>
</td>
</tr>
<!--------- 추가 20170619 ↑--------->
<tr>
<td align="center" >계약기간</td>
<td colspan='3'>
<input type="text" style="width:100;text-align:right;CURSOR:pointer;" name="p_decide_date_st" readonly onClick="winopn('/include/calendar.html?actval=p_decide_date_st')" value="<%=p_decide_date_st %>">
<img src="/images/common/btn_calendar.jpg" align="absmiddle" onClick="winopn('/include/calendar.html?actval=p_decide_date_st')" style="cursor:pointer">
&nbsp ~ &nbsp
<input type="text" style="width:100;text-align:right;CURSOR:pointer;" name="p_decide_date_ed" readonly onClick="winopn('/include/calendar.html?actval=p_decide_date_ed')" value="<%=p_decide_date_ed %>">
<img src="/images/common/btn_calendar.jpg" align="absmiddle" onClick="winopn('/include/calendar.html?actval=p_decide_date_ed')" style="cursor:pointer">
</td>
</tr>
<tr>
<td align="center" >용역범위<br />(2014-07 이후 프로젝트)</td>
<td >
<select name="p_export_range">
<option value="">전체</option>
<%
query = " SELECT c_kind_code, c_common_code, c_code_name "
query = query & " FROM T_COMMON_CODE_DETAIL "
query = query & " WHERE c_kind_code = '011' and c_common_code < '003' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("c_common_code")%>" <% if p_export_range = trim(Rs("c_common_code")) then %> selected <% end if %> ><%=Rs("c_code_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
<td align="center" >표본수</td>
<td >
<input type="text" style="width:100;text-align:right;" name="p_sample_st" value="<%if p_sample_st="" then response.write "" else response.write formatnumber(p_sample_st,0) end if %>" style='ime-mode:active;' onchange="getNumber(this);" onkeyup="getNumber(this);" style="text-align:right;" >
&nbsp ~ &nbsp
<input type="text" style="width:100;text-align:right;" name="p_sample_ed" value="<%if p_sample_ed="" then response.write "" else response.write formatnumber(p_sample_ed,0) end if %>" style='ime-mode:active;' onchange="getNumber(this);" onkeyup="getNumber(this);" style="text-align:right;" >
</td>
</tr>
<tr>
<td align="center" >문서종류</td>
<td >
<select name="c_common_code">
<option value="">전 체</option>
<%
query = " SELECT * "
query = query & " FROM T_COMMON_CODE_DETAIL "
query = query & " WHERE c_kind_code = '001' "
Rs.Open query, adoConn, 1
if Rs.RecordCount > 0 then
for i = 1 to Rs.RecordCount
%>
<option value="<%=Rs("c_common_code")%>" <% if trim(c_common_code) = trim(Rs("c_common_code")) then %> selected <% end if %> ><%=Rs("c_code_name")%></option>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</select>
</td>
<td align="center" >파일명</td>
<td >
<input type="text" style="width:250;" name="f_file_name" value="<%=f_file_name %>" style='ime-mode:active;' onkeyup="javascript:characterCheck(this.name);" onkeydown="javascript:characterCheck(this.name);" >
</td>
</tr>
<tr>
<td align="center" >출력 구분</td>
<td >
<select name="print_gubn" >
<option value="" <%if print_gubn="" then %> selected <%end if%> >제안 등록 + 프로젝트 수행계획서</option>
<option value="prj_ing" <%if print_gubn="prj_ing" then %> selected <%end if%> >프로젝트 수행계획서</option>
<option value="pps" <%if print_gubn="pps" then %> selected <%end if%> >제안 등록</option>
</select>
</td>
<td align="center" > </td>
<td >&nbsp;</td>
</tr>
<tr>
<td align="center" colspan="4" style="padding:10 0 10 0">
<table border="0" width="100%">
<tr>
<td width="50" align=right>&nbsp;</td>
<td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img src="/images/common/btn_search.jpg" align="absmiddle" style="cursor:pointer" onClick="chkit('1')">
<!--&nbsp;<img src="/images/common/btn_cancel.jpg" align="absmiddle" style="cursor:pointer" onClick="reloadit()"> -->
</td>
<td width="30" align=right><img src="/images/common/excel_down.png" width="40px" onclick='javascript:{excel_export();}' style='CURSOR:pointer;' title ='엑셀로 받기'></td>
</tr>
</table>
</td>
</tr>
</table>
<%end if 'excel export[3] %>
<% '프로젝트 검색 했을때
'##### 조직 개편(2019)
if request("s") = 1 then
'======================================================
'신규 프로젝트 검색
query = ""
query = query & " select "
query = query & " A1.*, "
query = query & " isnull(A2.child_est_money_sum,0) as child_est_money_sum, "
query = query & " isnull(A2.child_act_money_sum,0)+ISNULL(MC.marketing_cost, 0)+ISNULL(JC.job_money, 0) as child_act_money_sum, "
query = query & " isnull(A3.est_money_sum,0) as est_money_sum, "
query = query & " isnull(A3.act_money_sum,0)+ISNULL(MC.marketing_cost, 0)+ISNULL(JC.job_money, 0) as act_money_sum "
query = query & " from "
query = query & " ( "
query = query & " select p_sn, p_subject, isnull(p_depart,'') as p_depart, p_method, p_cli_company, p_conv_date, c_code_name, "
query = query & " count(f_id) as f_id, convert(varchar(10),count(f_file_name))+'개' as f_file_name, "
query = query & " '' as p_name, "
query = query & " '' as f_attach_date, p_sub_type, p_method_cd, p_child_sn, p_con_date_end, p_total_cost, p_cont_cost, p_sample "
query = query & " FROM ( "
query = query & " SELECT TPB.p_sn as p_sn, ISNULL(TPM.p_subject, TPB.p_subject) as p_subject, "
query = query & " isnull(D.T_name, '') as p_depart, "
query = query & " TPMC.p_method_nm as p_method, TCC.p_cli_company_nm as p_cli_company, "
query = query & " TPM.p_decide_date as p_conv_date, '' as c_code_name, TSA.f_id as f_id, TSA.f_file_name as f_file_name, TSA.f_input_user as f_input_user, "
query = query & " per.p_name as p_name, "
query = query & " TSA.f_attach_date as f_attach_date, TPM.p_sub_type, TPM.p_method_cd, isnull(TPM.p_child_sn,tpb.p_sn) as p_child_sn, TPM.p_con_date_end, isnull(TPB.p_total_cost, '0') as p_total_cost, isnull(TPM.p_cont_cost, '0') as p_cont_cost, ISNULL(TPM.p_sample, '0') as p_sample "
query = query & " FROM T_PROJECT_BASE TPB "
query = query & " LEFT OUTER JOIN T_PROJECT_METHOD TPM ON TPM.p_sn = TPB.p_sn /* 조사방법 맵핑 */ "
query = query & " LEFT OUTER JOIN T_PROJECT_METHOD_CD TPMC ON TPM.p_method_cd = TPMC.p_method_cd /* 조사방법 이름 맵핑 */ "
query = query & " LEFT OUTER JOIN V_Department D ON TPM.p_rsch_dept = D.before_t_cd1 /* 부서코드 */ "
query = query & " LEFT OUTER JOIN V_CLIENT_COMP TCC ON TPB.p_cli_company_cd = TCC.p_cli_company_cd /* 회사코드 맵핑 */ "
query = query & " LEFT OUTER JOIN T_SYSTEM_ATTACH TSA ON TPB.p_sn = TSA.f_p_sn AND f_use_yn = 'y' "
query = query & " LEFT OUTER JOIN T_COMMON_CODE_DETAIL TCCD ON TSA.f_work_type = TCCD.c_kind_code AND TSA.f_kind = TCCD.c_common_code /* 문서종류 맵핑 */ "
query = query & " LEFT OUTER JOIN person PER ON TSA.f_input_user = PER.P_NO "
query = query & " WHERE TPB.p_sn <> '' "
'프로젝트 코드--------------------------------------------------
if p_sn <> "" then
query = query & " AND (TPB.p_sn LIKE '%" & p_sn & "%' OR TPM.p_child_sn LIKE '%" & replace(p_sn, "_", "[_]") & "%') "
end if
'프로젝트 명--------------------------------------------------
if p_subject <> "" then
query = query & " AND (TPM.p_subject LIKE '%" & replace(p_subject, "_", "[_]") & "%' OR TPB.p_subject LIKE '%" & replace(p_subject, "_", "[_]") & "%')"
end if
'조사내용(20170619) -------------------------------
if p_intention <> "" then
query = query & " AND TPM.p_intention LIKE '%" & replace(p_intention, "_", "[_]") & "%' "
end if
'참여자 (20170619) --------------------------------
if new_p<>"" then
query = query & new_p
end if
'부서--------------------------------------------------
if p_depart <> "" then
query = query & " AND (TPB.p_depart_dep = '" & p_depart & "' "
query = query & " OR per.p_no in (select p_no from person where p_depart = '" & p_depart & "' )) " '//-- 2020-10-20 16:49:55
end if
if p_no <> "" then
query = query & " AND per.p_no = '" & p_no & "' " '//-- 2020-10-20 16:49:55
end if
'조사방법----------------------------------------------
if p_method <> "" then
query = query & " AND TPM.p_method_cd = '" & p_method & "' "
end if
'클라이언트명------------------------------------------
if p_cli_company <> "" then
query = query & " AND TCC.p_cli_company_nm LIKE '%" & p_cli_company & "%' "
end if
'카테고리--------------------------------------------
if p_category <> "" then
query = query & " AND (TPB.p_category LIKE '%" & p_category & ",%' OR TPM.p_category LIKE '%" & p_category & ",%') "
end if
'업종--------------------------------------------
if p_client_type_cd <> "" then
query = query & " AND TPM.p_client_type_cd = '" & p_client_type_cd & "' "
end if
if project_old_new = "old" then '업종을 구 프로젝트를 선택하면 신규프로젝트는 검색안하게.
query = query & " AND TPM.p_sn = '' "
end if
'용역범위--------------------------------------------
if p_export_range <> "" then
query = query & " AND TPM.p_export_range = '" & p_export_range & "' "
end if
'표본수 시작--------------------------------------------
if p_sample_st <> "" then
query = query & " AND TPM.p_sample >= '" & p_sample_st & "' "
end if
'표본수 끝--------------------------------------------
if p_sample_ed <> "" then
query = query & " AND TPM.p_sample <= '" & p_sample_ed & "' "
end if
'조사대상--------------------------------------------
if p_target_part <> "" then
query = query & " AND TPM.p_sur_target = '" & p_target_part & "' "
end if
'조사지역--------------------------------------------
if p_area_part <> "" then
query = query & " AND TPM.p_sur_area = '" & p_area_part & "' "
end if
'조사분류--------------------------------------------
if p_survey_part <> "" then
query = query & " AND TPM.p_sur_part = '" & p_survey_part & "' "
end if
'실사수행--------------------------------------------
if p_field_process <> "" then
query = query & " AND TPM.p_field_process = '" & p_field_process & "' "
end if
'계약기간--------------------------------------------
if p_decide_date_st <> "" and p_decide_date_ed <> "" then
query = query & " AND TPM.p_decide_date Between '" & p_decide_date_st & "' AND '" & p_decide_date_ed & "' "
end if
'문서종류--------------------------------------------
if c_common_code <> "" then
query = query & " AND TCCD.c_common_code = '" & c_common_code & "' "
end if
'파일명--------------------------------------------
if f_file_name <> "" then
query = query & " AND TSA.f_file_name LIKE '%" & f_file_name & "%' "
end if
'수행계획서만 검색시 20170807 (추가) -------------------
if print_gubn <> "" then
query = query & " and len(TPM.p_child_sn)=11 "
end if
query = query & " UNION ALL "
'예전 프로젝트 검색
query = query & " SELECT p.p_sn as p_sn, p.p_subject as p_subject, "
query = query & " isnull(d.T_Name, '') as p_depart, "
query = query & " pm.name1 as p_method, C.c_name as p_cli_company, "
query = query & " p.p_conv_date as p_conv_date, TCCD.c_code_name as c_code_name, TSA.f_id as f_id, TSA.f_file_name as f_file_name, "
query = query & " TSA.f_input_user as f_input_user, "
query = query & " '' as p_name, "
query = query & " TSA.f_attach_date as f_attach_date, '' as p_sub_type, '' as p_method_cd, '' as p_child_sn ,p.p_convdate_end as p_con_date_end, '' as p_total_cost, p.p_budget as p_cont_cost, ISNULL(P.p_sample, '0') as p_sample "
query = query & " FROM project P LEFT OUTER JOIN V_Department D ON p.p_depart = d.before_t_cd1 /* 부서코드 맵핑 */ "
query = query & " LEFT OUTER JOIN p_method pm ON p.p_method = pm.code1 /* 조사방법 맵핑 */ "
query = query & " LEFT OUTER JOIN Client C ON p.p_cli_company = C.c_code /* 회사이름 맵핑 */ "
query = query & " LEFT OUTER JOIN T_SYSTEM_ATTACH TSA ON p.p_sn = TSA.f_p_sn AND TSA.f_use_yn = 'Y' /* 첨부파일 맵핑 */ "
query = query & " LEFT OUTER JOIN T_COMMON_CODE_DETAIL TCCD ON TSA.f_work_type = TCCD.c_kind_code AND TSA.f_kind = TCCD.c_common_code /* 문서종류 맵핑 */ "
query = query & " LEFT OUTER JOIN person PER ON TSA.f_input_user = PER.P_NO /* 문서 입력자 이름 */ "
query = query & " WHERE p_sn <> '' "
query = query & " AND LEFT(p_sn, 4) <> '9999' "
'프로젝트 코드--------------------------------------------------
if p_sn <> "" then
query = query & " AND p.p_sn LIKE '%" & replace(p_sn, "_", "[_]") & "%' "
end if
'프로젝트 명--------------------------------------------------
if p_subject <> "" then
query = query & " AND p.p_subject LIKE '%" & replace(p_subject, "_", "[_]") & "%' "
end if
'조사내용(20170619) -------------------------------
if p_intention <> "" then
query = query & " AND p.p_intention LIKE '%" & replace(p_intention, "_", "[_]") & "%' "
end if
'참여자 (20170619) --------------------------------
if old_p <> "" then
query = query & old_p
end if
'부서--------------------------------------------------
if p_depart <> "" then
query = query & " AND (p.p_depart = '" & p_depart & "' "
query = query & " OR per.p_no in (select p_no from person where p_depart = '" & p_depart & "' )) " '//-- 2020-10-20 16:49:55
end if
if p_no <> "" then
query = query & " AND per.p_no = '" & p_no & "' " '//-- 2020-10-20 16:49:55
end if
'조사방법----------------------------------------------
if p_method <> "" then
if p_method = "1" then
p_method = "11,17"
elseif p_method = "2" then
p_method = "13"
elseif p_method = "3" then
p_method = "15"
elseif p_method = "4" then
p_method = "16"
elseif p_method = "5" then
p_method = "24"
elseif p_method = "6" then
p_method = "6"
elseif p_method = "7" then
p_method = "21,22"
elseif p_method = "8" then
p_method = "20"
elseif p_method = "9" then
p_method = "19"
elseif p_method = "10" then
p_method = "18"
elseif p_method = "11" then
p_method = "25"
elseif p_method = "12" then
p_method = "12"
elseif p_method = "13" then
p_method = "27"
elseif p_method = "14" then
p_method = "26"
elseif p_method = "15" then
p_method = "15"
elseif p_method = "16" then
p_method = "16"
elseif p_method = "17" then
p_method = "23"
end if
query = query & " AND p.p_method IN (" & p_method & ") "
end if
'클라이언트명------------------------------------------
if p_cli_company <> "" then
query = query & " AND c.c_name LIKE '%" & p_cli_company & "%' "
end if
'카테고리--------------------------------------------
if p_category <> "" then
query = query & " AND p.p_category = '" & p_category & "' "
end if
'조사대상--------------------------------------------
if p_target_part <> "" then
query = query & " AND p.p_target_part = '" & p_target_part & "' "
end if
'조사지역--------------------------------------------
if p_area_part <> "" then
if p_area_part = "001" then
p_area_part = "1,2"
elseif p_area_part = "002" then
p_area_part = "3"
elseif p_area_part = "003" then
p_area_part = "4"
elseif p_area_part = "004" then
p_area_part = "4"
elseif p_area_part = "005" then
p_area_part = "5"
end if
query = query & " AND p.p_area_part IN (" & p_area_part & ") "
end if
'조사분류--------------------------------------------
if p_survey_part <> "" then
query = query & " AND p.p_survey_part = '" & CInt(p_survey_part) & "' "
end if
'실사수행--------------------------------------------
if p_field_process <> "" then
query = query & " AND p.p_field_process = '" & CInt(p_field_process) & "' "
end if
'표본수 시작--------------------------------------------
if p_sample_st <> "" then
query = query & " AND p.p_sample >= '" & p_sample_st & "' "
end if
'표본수 끝--------------------------------------------
if p_sample_ed <> "" then
query = query & " AND p.p_sample <= '" & p_sample_ed & "' "
end if
'계약기간--------------------------------------------
if p_decide_date_st <> "" and p_decide_date_ed <> "" then
query = query & " AND p.p_conv_date Between '" & p_decide_date_st & "' AND '" & p_decide_date_ed & "' "
end if
'문서종류--------------------------------------------
if c_common_code <> "" then
query = query & " AND TCCD.c_common_code = '" & c_common_code & "' "
end if
'파일명--------------------------------------------
if f_file_name <> "" then
query = query & " AND TSA.f_file_name LIKE '%" & f_file_name & "%' "
end if
'업종------------------------------------------------------
if p_types1 <> "" then
query = query & "AND ("
query = query & " p_types1 = '" & p_types1 & "' "
if p_types2 <> "" then
query = query & " AND p_types2 = '" & p_types2 & "' "
end if
if p_types3 <> "" then
query = query & " AND p_types3 = '" & p_types3 & "' "
end if
query = query & ") "
end if
if project_old_new = "new" then '업종을 신규 프로젝트를 선택하면 구프로젝트는 검색안하게.
query = query & " AND p_sn = '' "
end if
query = query & " ) T "
query = query & " group by p_sn, p_subject, p_depart, p_method, p_cli_company, p_conv_date, c_code_name, p_sub_type, p_method_cd, p_child_sn, p_con_date_end, "
query = query & " p_total_cost, p_cont_cost, p_sample"
query = query & " ) A1 "
query = query & " left join " '-- 수행계획서
query = query & " ( "
query = query & " select "
query = query & " p_child_sn, "
query = query & " sum(cast(isnull(est_money,'0') as money)) as child_est_money_sum, " '-- 예산
query = query & " sum(cast(isnull(act_money,'0') as money)) as child_act_money_sum " '-- 사용
query = query & " from [dbo].[direct_cost] "
query = query & " where del_yes_no='no' "
query = query & " group by p_child_sn "
query = query & " ) A2 "
query = query & " on A1.p_child_sn=A2.p_child_sn "
query = query & " left join " '-- 제안/등록
query = query & " ( "
query = query & " select "
query = query & " p_sn, "
query = query & " sum(cast(isnull(est_money,'0') as money)) as est_money_sum, " '-- 예산
query = query & " sum(cast(isnull(act_money,'0') as money)) as act_money_sum " '-- 사용
query = query & " from [dbo].[direct_cost] "
query = query & " where del_yes_no='no' "
query = query & " group by p_sn "
query = query & " ) A3 "
query = query & " on A1.p_sn=A3.p_sn "
query = query & " LEFT JOIN ( "
query = query & " SELECT M.p_sn, SUM(CONVERT(money, REPLACE(CONVERT(varchar(100), M.target6), ',', ''))) AS marketing_cost "
query = query & " FROM project2.dbo.문서내용 M LEFT JOIN project2.dbo.Document D ON M.문서번호 = D.d_no "
query = query & " WHERE M.문서제목 = '접대비보고서' AND M.del_yes_no = 'no' "
query = query & " AND D.d_order_cnt = '77' "
query = query & " GROUP BY M.p_sn "
query = query & " ) MC ON A1.p_child_sn = MC.p_sn "
query = query & " LEFT JOIN ( "
query = query & " SELECT CA.p_sn, SUM(CA.cost_money) AS job_money "
query = query & " FROM project2.dbo.V_BUSI_COST CA "
query = query & " WHERE CA.cost_money > 0 "
query = query & " GROUP BY CA.p_sn "
query = query & " ) JC ON A1.p_child_sn = JC.p_sn "
dim psql : psql=""
select case print_gubn
case "pps" '-- 제안등록 검색시
psql=""
psql=psql&" select A1.*, "
psql=psql& " isnull(A3.est_money_sum,0) as est_money_sum, "
psql=psql& " isnull(A3.act_money_sum,0)+ISNULL(MC.marketing_cost, 0)+ISNULL(JC.job_money, 0) as act_money_sum "
psql=psql& " from "
psql=psql&" ( "
psql=psql&" SELECT p_sn, PB.p_cli_company_cd, PB.p_client_type_cd, p_subject, PB.p_cli_per_cd, PB.p_state, E.p_cli_company_nm, CP.p_cli_depart, "
psql=psql&" CP.p_cli_per_com_tel, CP.p_cli_per_nm, CP.p_cli_per_tel, CP.p_cli_per_email, "
psql=psql&" case when p_contactor = '001' then '공개입찰' when p_contactor = '002' then '제안경쟁' when p_contactor = '003' then '가격입찰' "
psql=psql&" when p_contactor = '004' then '수의계약' else '' end as p_contactor_label, "
psql=psql&" CT.p_client_type_nm, ISNULL(STUFF(( SELECT ',' + p_method_nm FROM T_PROJECT_METHOD TPM LEFT "
psql=psql&" OUTER JOIN "
psql=psql&" T_PROJECT_METHOD_CD TPMC "
psql=psql&" ON TPM.p_method_cd = TPMC.p_method_cd "
psql=psql&" AND TPMC.p_method_yn='y' "
psql=psql&" WHERE p_sn = PB.p_sn "
psql=psql&" ORDER BY TPMC.p_method_cd "
psql=psql&" FOR XML PATH ('')),1,1,''), '') AS p_method_str, "
psql=psql&" p_memo, isnull(p_total_cost,0) as p_total_cost, p_cont_cost, p_decide_date, PB.p_input_dt, "
psql=psql&" case when p_state='K' then '제안' "
psql=psql&" when p_state='P' then '수주' "
psql=psql&" when p_state='D' then '연기' "
psql=psql&" when p_state='X' then '탈락' "
psql=psql&" else '-' end as p_state_nm "
psql=psql&" , PB.p_input_user, p_depart_dep, p_depart_team, "
psql=psql&" p.p_name as p_name, p.p_depart, D.T_name "
psql=psql&" FROM T_PROJECT_BASE PB INNER JOIN person P "
psql=psql&" ON PB.p_input_user = P.P_NO "
psql=psql&" left outer join V_CLIENT_COMP as E on PB.p_cli_company_cd = E.p_cli_company_cd "
psql=psql&" left outer join V_CLIENT_PERSON as CP on PB.p_cli_company_cd = CP.p_cli_company_cd AND PB.p_cli_per_cd = CP.p_cli_per_cd "
psql=psql&" left outer join T_CLIENT_TYPE_CD as CT on PB.p_client_type_cd = CT.p_client_type_cd "
psql=psql&" INNER JOIN V_Department D ON PB.p_depart_dep = d.before_t_cd1 "
psql=psql&" WHERE p_sn in ( "
psql=psql&" select AA.p_sn from ("&query&") AA group by AA.p_sn "
psql=psql&" ) "
psql=psql&" ) A1 "
psql=psql&" left join " '-- 제안/등록
psql=psql &" ( "
psql=psql &" select "
psql=psql &" p_sn, "
psql=psql &" sum(cast(isnull(est_money,'0') as money)) as est_money_sum, " '-- 예산
psql=psql &" sum(cast(isnull(act_money,'0') as money)) as act_money_sum " '-- 사용
psql=psql &" from [dbo].[direct_cost] "
psql=psql &" where del_yes_no='no' "
psql=psql &" group by p_sn "
psql=psql &" ) A3 "
psql=psql &" on A1.p_sn=A3.p_sn "
psql=psql & " LEFT JOIN ( "
psql=psql & " SELECT M.p_sn, SUM(CONVERT(money, REPLACE(CONVERT(varchar(100), M.target6), ',', ''))) AS marketing_cost "
psql=psql & " FROM project2.dbo.문서내용 M LEFT JOIN project2.dbo.Document D ON M.문서번호 = D.d_no "
psql=psql & " WHERE M.문서제목 = '접대비보고서' AND M.del_yes_no = 'no' "
psql=psql & " AND D.d_order_cnt = '77' "
psql=psql & " GROUP BY M.p_sn "
psql=psql & " ) MC ON A1.p_child_sn = MC.p_sn "
psql=psql & " LEFT JOIN ( "
psql=psql & " SELECT CA.p_sn, SUM(CA.cost_money) AS job_money "
psql=psql & " FROM project2.dbo.V_BUSI_COST CA "
psql=psql & " WHERE CA.cost_money > 0 "
psql=psql & " GROUP BY CA.p_sn "
psql=psql & " ) JC ON A1.p_child_sn = JC.p_sn "
psql=psql &" where 1=1 "
if pps_state_nm<>"" then '-- 제안등록 상태 검색시
psql=psql&" and A1.p_state='"&pps_state_nm&"' "
end if
psql=psql&" order by A1.p_sn desc "
query=psql
case "prj_ing" '-- 프로젝트 "수행계획서"만 검색시
query = query & " order by left(A1.p_sn,7) desc, right(A1.p_sn,2) desc "
case else '-- "제안등록" + "수행계획서"
query = query & " order by left(A1.p_sn,7) desc, right(A1.p_sn,2) desc "
end Select
rs.Open query, adoConn, 1
%>
<div id = "resultTable" style="overflow-x:hidden;overflow-y:scroll;height:800px;width:100%;border:none;">
<%if print_gubn="pps" then %> <!-- 제안 등록 -->
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<%if command <> "excel" then 'excel export %>
<tr>
<td align="RIGHT" colspan="13">
<select name="pps_state_nm" onchange="javascript:chkit('1');" >
<option value="" <%if pps_state_nm="" then%> selected <%end if%> >전 체</option>
<option value="K" <%if pps_state_nm="K" then%> selected <%end if%> >제안</option>
<option value="P" <%if pps_state_nm="P" then%> selected <%end if%> >수주</option>
<option value="D" <%if pps_state_nm="D" then%> selected <%end if%> >연기</option>
<option value="X" <%if pps_state_nm="X" then%> selected <%end if%> >탈락</option>
</select>
&nbsp;&nbsp;&nbsp;
<input type="checkbox" name = "searchHide" id = "searchHide" onclick="searchHide()" />
<b style="color:Red;font-size:20px" >검색조건 숨기기</b>
</td>
</tr>
<% end if %>
<tr>
<td width="30" align="center" height="24" >순번</td>
<td width="70" align="center" height="24" >제안번호</td>
<td width="250" align="center" height="24" >제안 명</td>
<td width="180" align="center" height="24" >고객사</td>
<td width="100" align="center" height="24" >고객부서</td>
<td width="164" align="center" height="24" >업종</td>
<td width="174" align="center" height="24" >조사방법</td>
<td width="60" align="center" height="24" >예상계약액</td>
<td width="60" align="center" height="24" >실제계약액</td>
<td width="111" align="center" height="24" >제안부서</td>
<td width="30" align="center" height="24" >상태</td>
<td width="50" align="center" height="24" >예산</td>
<td width="50" align="center" height="24" >직접비</td>
</tr>
<% if rs.recordCount = 0 then %>
<tr height="70" bgcolor="#dbe9f2">
<td width="" colspan="13" align="center" fon><font color="blue" size="5">검색 결과가 없습니다.</font></td>
</tr>
<% end if
for i = 1 to rs.recordCount
%>
<tr height="24" >
<td width="" align="center" ><%= i %></td>
<td width="" align="center" ><%=rs("p_sn")%></td>
<td width="" align="center" >
<!------------------>
<%if command <> "excel" then 'excel export %>
<a href="javascript:open_info(pms,'<%=rs("p_sn")%>');" class="blue"><%=rs("p_subject")%></a>
<%else%>
<%=rs("p_subject")%>
<%end if%>
<!------------------>
</td>
<td width="" align="center" ><%=rs("p_cli_company_nm")%></td>
<td width="" align="center" ><%=rs("p_cli_depart")%></td>
<td width="" align="center" ><%=rs("p_client_type_nm")%></td>
<td width="" align="center" ><%=rs("p_method_str")%></td>
<td width="" align="center" ><%=formatnumber(rs("p_cont_cost"),0)%></td>
<td width="" align="center" ><%=formatnumber(rs("p_total_cost"),0)%></td>
<td width="" align="center" ><%=rs("T_name")%></td>
<td width="" align="center" ><%=rs("p_state_nm")%></td>
<td width="" align="center" ><%=formatnumber(rs("est_money_sum"),0)%></td>
<td width="" align="center" ><%=formatnumber(rs("act_money_sum"),0)%></td>
</tr>
<%
xxlist="1" '-- excel 다운로드 체크용
rs.movenext
next
%>
</table>
<%else %><!-- 제안 등록 + 프로젝트 수행계획서 -->
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<%if command <> "excel" then 'excel export %>
<tr>
<td align="RIGHT" colspan="15">
<input type="checkbox" name = "searchHide" id = "searchHide" onclick="searchHide()" />
<b style="color:Red;font-size:20px" >검색조건 숨기기</b>
</td>
</tr>
<% end if %>
<tr>
<td width="35" align="center" height="24" >순번</td>
<td width="80" align="center" height="24" >프로젝트코드</td>
<td width="230" align="center" height="24" >프로젝트명</td>
<td width="50" align="center" height="24" >부서</td>
<td width="50" align="center" height="24" >등록인</td>
<td width="100" align="center" height="24" >조사방법</td>
<td width="120" align="center" height="24" >클라이언트</td>
<td width="65" align="center" height="24" >계약일</td>
<td width="65" align="center" height="24" >계약종료일</td>
<td width="65" align="center" height="24" >전체수주금액</td>
<td width="65" align="center" height="24" >단위계약액</td>
<td width="45" align="center" height="24" >샘플수</td>
<td width="40" align="center" height="24" >파일</td>
<td width="50" align="center" height="24" >예산</td>
<td width="50" align="center" height="24" >직접비</td>
</tr>
<% if rs.recordCount = 0 then %>
<tr height="70" bgcolor="#dbe9f2">
<td width="" colspan="15" align="center" fon><font color="blue" size="5">검색 결과가 없습니다.</font></td>
</tr>
<% end if
for i = 1 to rs.recordCount
p_sn = rs("p_sn")
p_cont_cost=""
if rs("p_cont_cost") <> "" then
tmp_len = len(rs("p_cont_cost"))
for j = 1 to int(tmp_len)
if j mod 3 = 1 and j <> 1 then
p_cont_cost = "," & p_cont_cost
end if
p_cont_cost = left(right(rs("p_cont_cost"),j), 1) & p_cont_cost
next
end If
%>
<tr height="24">
<td width="" align="center" ><%= i %></td>
<td width="" align="center" >
<% If rs("p_child_sn") = "" Then %>
<%=rs("p_sn")%>
<% Else %>
<%=rs("p_child_sn")%>
<% End If %>
</td>
<td width="" align="center" >
<%if command <> "excel" then 'excel export %><a href="javascript:openit('1','<%=rs("p_sn")%>','<%=rs("p_sub_type")%>','<%=rs("p_method_cd")%>','<%=rs("p_child_sn")%>')" class="blue"><%end if%>
<%=rs("p_subject") %>
<%if command <> "excel" then 'excel export %></a><%end if%></td>
<td width="" align="center" ><%= rs("p_depart")%></td>
<td width="" align="center" ><%= rs("p_name")%></td>
<td width="" align="center" ><%= rs("p_method") %></td>
<td width="" align="center" ><%= rs("p_cli_company") %></td>
<td width="" align="center" ><%= rs("p_conv_date") %></td>
<td width="" align="center" ><%= rs("p_con_date_end") %></td>
<td width="" align="center" ><%= formatnumber(rs("p_total_cost"), 0) %></td>
<td width="" align="center" ><%= p_cont_cost %></td>
<td width="" align="center" ><%= rs("p_sample") %></td>
<% if c_common_code <> "" then %>
<td width="" align="center" >
<% If Session("teamplace") <> 10 Then %>
<!------------------>
<%if command <> "excel" then 'excel export %>
<a href="javascript:download('<%=rs("p_sn")%>','<%=rs("f_id")%>')" class="blue"><%= rs("f_file_name") %></a>
<%else%>
<%= rs("f_file_name") %>
<%end if%>
<!------------------>
<% else %>
<%= rs("f_file_name") %>
<%end if%>
</td>
<% else %>
<td width="" align="center" ><%= rs("f_file_name") %></td>
<% end if %>
<% If rs("p_child_sn") = "" Then %>
<td width="" align="center" ><%=formatnumber(rs("est_money_sum"),0)%></td>
<td width="" align="center" ><%=formatnumber(rs("act_money_sum"),0)%></td>
<%else%>
<td width="" align="center" ><%=formatnumber(rs("child_est_money_sum"),0)%></td>
<td width="" align="center" ><%=formatnumber(rs("child_act_money_sum"),0)%></td>
<%end if%>
</tr>
<%
xxlist="1" '-- excel 다운로드 체크용
rs.movenext
next
end if
%>
</table>
<%end if%>
</div>
</td>
</tr>
</table>
<input type="hidden" name="xxlist" value="<%=xxlist%>" />
</form>
<% if command <> "excel" then%>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
function chkit(txt) {
var f = document.pms;
var url = "project_search_2014.asp";
if((f.p_sn.value=="")&&(f.p_subject.value=="")&&(f.p_intention.value=="")&&(f.p_cli_company.value=="")&&(f.p_field_process.value=="")&&(f.p_depart.value=="")){
alert("[프로젝트 코드][프로젝트 명][조사내용][클라이언트명][실사수행][부서] 중 최소한 한개는 검색조건을 입력하여 주세요 ");
return false;
}
// 계약기간
if((f.p_decide_date_st.value!="")||(f.p_decide_date_ed.value!="")){
if((f.p_decide_date_st.value=="")||(f.p_decide_date_ed.value=="")){
alert("[계약기간]의 범위를 정확히 선택하여 주세요 ");
return false;
}
}
// 표본수
if((f.p_sample_st.value!="")||(f.p_sample_ed.value!="")){
if((f.p_sample_st.value=="")||(f.p_sample_ed.value=="")){
alert("[표본수]의 범위를 정확히 입력하여 주세요 ");
return false;
}
}
if (txt == "1") {
url = url + '?s=1';
}
else {
url = url + '?s=1&command=excel';
}
f.action = url;
f.submit();
}
function download(p_sn,f_id) {
url = jPath + "download";
var param = "?p_sn=" + p_sn + "&f_id=" + f_id;
$(location).attr("href", url + param);
}
function openit(a, z, x, y, v) {
var tmp_width = 1400;
var tmp_height = 800;
if (a == 1) {
//옛날 프로젝트인지 확인
if (new_project_2014(z) == 1) {
var url = 'project_list2_dep.asp?p_sn=' + z;
} else {
//수행계획서 판단(p_subtype이 없으면 수행계획서가 없다고 판단)
if (x != '') {
var url = 'project_list2_dep_2014.asp?p_sn=' + z;
} else {
if(confirm("프로젝트 수행계획이 작성되지 않았습니다.\n제안등록 화면으로 이동하시겠습니까?")){
var url = 'project_ContactInfo.asp?cutmenu=1&p_sn=' + z;
tmp_width = 1020;
tmp_height = 945;
}else{
return;
}
}
}
if (v != "") {
url = url + "&p_sub_type=" + x + "&p_method_cd=" + y + "&p_child_sn=" + v;
} else {
url = url + "&p_sub_type=" + x + "&p_method_cd=" + y;
}
}
winObj=window.open(url, '', 'left=0,top=0,width=' + tmp_width + ',height=' + tmp_height + ',scrollbars=yes,resizable=yes')
}
function excel_export() {
if(pms.xxlist.value=="0"){
alert("다운로드 하실 리스트가 없습니다 ");
return false;
}
document.pms.action = "project_search_2014.asp?s=1&command=excel";
document.pms.submit();
}
function open_info(f,psn){
var tmp_width = 1050;
var tmp_height = 800;
var url="";
var tmsg=confirm("\n확인을 누르시면 [제안 등록] 정보를\n\n취소를 누르시면 등록된[프로젝트 수행계획] 리스트를 출력합니다 ");
if(tmsg==true){
tmp_width = 1020;
tmp_height = 945;
url="project_ContactInfo.asp?cutmenu=1&p_sn="+psn;
winObj=window.open(url, '', 'left=0,top=0,width=' + tmp_width + ',height=' + tmp_height + ',scrollbars=yes,resizable=yes')
}else{
tmp_width = 1050;
tmp_height = 300;
url="project_search_2014_p_sn.asp?s=1&p_sn="+psn;
winObj=window.open(url, '', 'left=0,top=0,width=' + tmp_width + ',height=' + tmp_height + ',scrollbars=yes,resizable=yes')
}
}
function exPdepart(){
var p_depart = $("#p_depart option:selected").attr("date-id");
if( p_depart != "" ){
$("#p_no").val("");
chkit('1');
}
}
function exPno(){
var p_no = $("#p_no option:selected").attr("date-id");
if( p_no != "" ){
$("#p_depart").val(p_no);
chkit('1');
}
}
$(document).ready(function () {
if ($('#project_old_new_check').val() == "") {
$('#project_old_new_check').css("display", "none");
} else if ($('#project_old_new_check').val() == "new") {
$('#p_client_type_cd').css("display", "");
$('#p_types1').css("display", "none");
$('#p_types2').css("display", "none");
$('#p_types3').css("display", "none");
} else if ($('#project_old_new_check').val() == "old") {
$('#p_client_type_cd').css("display", "none");
$('#p_types1').css("display", "");
if ($('#p_types1_check').val() != "") {
$('#p_types2').css("display", "");
ajaxCallJson("project_search_ajax_type2_2014.asp", { p_types1: $('#p_types1_check').val(), p_types2: $('#p_types2_check').val() }, null, "post", "type1ReturnFunc()");
}
if ($('#p_types2_check').val() != "") {
$('#p_types3').css("display", "");
ajaxCallJson("project_search_ajax_type3_2014.asp", { p_types1: $('#p_types1_check').val(), p_types2: $('#p_types2_check').val(), p_types3: $('#p_types3_check').val() }, null, "post", "type2ReturnFunc()");
}
}
});
$("#searchHide").click(function () {
if ($(this).is(':checked')) {
$("#searchTable").hide();
$("#resultTable").height("800px");
} else {
$("#searchTable").show();
$("#resultTable").height("400px");
}
});
function old_new_change() {
var temp = $(':radio[name="project_old_new"]:checked').val();
if (temp == "") {
$('#p_client_type_cd').css("display", "none");
$('#p_types1').css("display", "none");
$('#p_types2').css("display", "none");
$('#p_types3').css("display", "none");
$('#p_client_type_cd').val("");
$('#p_types1').val("");
$('#p_types2').val("");
$('#p_types3').val("");
}else if (temp == "old") {
$('#p_client_type_cd').css("display", "none");
$('#p_types1').css("display", "");
$('#p_client_type_cd').val("");
} else if (temp == "new") {
$('#p_client_type_cd').css("display", "");
$('#p_types1').css("display", "none");
$('#p_types2').css("display", "none");
$('#p_types3').css("display", "none");
$('#p_types1').val("");
$('#p_types2').val("");
$('#p_types3').val("");
}
}
$('#p_types1').change(function () {
$('#p_types3').css("display", "none");
if ($('#p_types1').val() != "") {
$('#p_types2').css("display", "");
ajaxCallJson("project_search_ajax_type2_2014.asp", { p_types1: $('#p_types1').val() }, null, "post", "type1ReturnFunc()");
} else {
$('#p_types2').css("display", "none");
$('#p_types3').css("display", "none");
}
});
$('#p_types2').change(function () {
if ($('#p_types2').val() != "") {
$('#p_types3').css("display", "");
ajaxCallJson("project_search_ajax_type3_2014.asp", { p_types1: $('#p_types1').val(), p_types2: $('#p_types2').val() }, null, "post", "type2ReturnFunc()");
} else {
$('#p_types3').css("display", "none");
}
});
function type1ReturnFunc() {
$("#p_types2 option").remove();
$("#p_types2").append(ajaxResponse);
}
function type2ReturnFunc() {
$("#p_types3 option").remove();
$("#p_types3").append(ajaxResponse);
}
var rgx1 = /\D/g; // /[^0-9]/g 와 같은 표현
var rgx2 = /(\d+)(\d{3})/;
function getNumber(obj){
var num01;
var num02;
num01 = obj.value;
num02 = num01.replace(rgx1,"");
num01 = setComma(num02);
obj.value = num01;
}
function setComma(inNum){
var outNum;
outNum = inNum;
while (rgx2.test(outNum)) {
outNum = outNum.replace(rgx2, '$1' + ',' + '$2');
}
return outNum;
}
function getNumber_only(obj){
var num01;
var num02;
num01 = obj.value;
num02 = num01.replace(rgx1,"");
num01 = num02;
obj.value = num01;
}
function characterCheck(tname){
var RegExp = /[\'\"]/;//정규식 구문
var obj = document.getElementsByName(tname)[0]
if (RegExp.test(obj.value)) {
obj.value = obj.value.substring(0, obj.value.length - 1);//특수문자를 지우는 구문
}
}
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->
<% end if %>