404 lines
21 KiB
Plaintext
404 lines
21 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<!-- #include virtual = "include/JSON_2.0.4.asp" -->
|
|
|
|
<%
|
|
Response.CharSet="euc-kr"
|
|
Response.AddHeader "Pragma","no-cache"
|
|
Response.AddHeader "cache-control", "no-staff"
|
|
Response.Expires = -1
|
|
|
|
|
|
Dim Flag : Flag = Request("Flag")
|
|
Dim Search : Search = unescape(Request("Search"))
|
|
Dim Depart : Depart = Request("Depart")
|
|
Dim DivHtml
|
|
|
|
Select case Flag
|
|
|
|
Case "CompanyList"
|
|
|
|
|
|
query = "select * from project2.dbo.V_CLIENT_COMP where p_cli_company_nm like '%"&Search&"%' ORDER BY p_cli_company_nm"
|
|
rsc.Open query, adoConn, 1
|
|
DivHtml=""
|
|
If not rsc.eof Then
|
|
while not rsc.eof
|
|
DivHtml =+ DivHtml&"<div class='ComList'>"&rsc("p_cli_company_nm")&"<input type='hidden' name='ComCode' value='"&rsc("p_cli_company_cd")&"'/></div>"
|
|
rsc.movenext
|
|
wend
|
|
end If
|
|
rsc.close
|
|
DivHtml =+ DivHtml&"<div class='ComAdd'>"
|
|
DivHtml =+ DivHtml&"<input type='text' id='ComAddName' style='width:59%;display:none;' value='' /> "
|
|
DivHtml =+ DivHtml&"<button type='button' id='ComAddBtn' style='width:100%;background-color:#ffffff;' class='ui-button ui-widget ui-corner-all'>Ãß°¡</button>"
|
|
DivHtml =+ DivHtml&"<button type='button' id='ComAddCancleBtn' style='width:20%;background-color:#ffffff;display:none;' class='ui-button ui-widget ui-corner-all'>Ãë¼Ò</button>"
|
|
DivHtml =+ DivHtml&"</div>"
|
|
response.write DivHtml
|
|
|
|
case "CompanyPerson"
|
|
|
|
query = "select * from project2.dbo.V_CLIENT_PERSON where p_cli_company_cd = '"&Search&"' ORDER BY p_cli_per_nm "
|
|
'response.write query
|
|
|
|
rsc.Open query, adoConn, 1
|
|
DivHtml = "<legend class='Cnm'></legend>"
|
|
DivHtml =+ DivHtml&"<table class='PerList'>"
|
|
DivHtml =+ DivHtml&"<thead class='ui-widget-header'>"
|
|
DivHtml =+ DivHtml&"<tr>"
|
|
DivHtml =+ DivHtml&"<th>Client</th>"
|
|
DivHtml =+ DivHtml&"<th>ºÎ¼¸í</th>"
|
|
DivHtml =+ DivHtml&"<th></th>"
|
|
DivHtml =+ DivHtml&"</tr>"
|
|
DivHtml =+ DivHtml&"</thead>"
|
|
DivHtml =+ DivHtml&"<tbody class='ui-widget-content'>"
|
|
If not rsc.eof Then
|
|
|
|
|
|
|
|
while not rsc.eof
|
|
DivHtml =+ DivHtml&"<tr>"
|
|
DivHtml =+ DivHtml&"<input type='hidden' name='PerDepart' value='"&rsc("p_cli_depart")&"'/>"
|
|
DivHtml =+ DivHtml&"<input type='hidden' name='PerCode' value='"&rsc("p_cli_per_cd")&"'/>"
|
|
DivHtml =+ DivHtml&"<input type='hidden' name='PerName' value='"&rsc("p_cli_per_nm")&"'/>"
|
|
DivHtml =+ DivHtml&"<input type='hidden' name='PerTel' value='"&rsc("p_cli_per_com_tel")&"'/>"
|
|
DivHtml =+ DivHtml&"<input type='hidden' name='PerPhone' value='"&rsc("p_cli_per_tel")&"'/>"
|
|
DivHtml =+ DivHtml&"<input type='hidden' name='PerEmail' value='"&rsc("p_cli_per_email")&"'/>"
|
|
DivHtml =+ DivHtml&"<td>"&rsc("p_cli_per_nm")&"</td>"
|
|
DivHtml =+ DivHtml&"<td>"&rsc("p_cli_depart")&"</td>"
|
|
DivHtml =+ DivHtml&"<td><button type='button' class='ui-button ui-widget ui-corner-all' name='CliEdit'>¼öÁ¤</button></td>"
|
|
DivHtml =+ DivHtml&"</tr>"
|
|
rsc.movenext
|
|
wend
|
|
|
|
|
|
end If
|
|
DivHtml =+ DivHtml&"<tr>"
|
|
DivHtml =+ DivHtml&"<td colspan='3' style='text-align:center;'>¹ÌÁ¤(Click!)</td>"
|
|
DivHtml =+ DivHtml&"</tr>"
|
|
DivHtml =+ DivHtml&"</tbody>"
|
|
DivHtml =+ DivHtml&"<tfoot>"
|
|
DivHtml =+ DivHtml&"<tr>"
|
|
DivHtml =+ DivHtml&"<td colspan='3'><button type='button' id='add' style='width:100%;background-color:#ffffff;' class='ui-button ui-widget ui-corner-all'>´ã´çÀÚ Ãß°¡Çϱâ</button></td>"
|
|
DivHtml =+ DivHtml&"</tr>"
|
|
DivHtml =+ DivHtml&"</tfoot>"
|
|
DivHtml =+ DivHtml&"</table>"
|
|
rsc.close
|
|
response.write DivHtml
|
|
|
|
case "DetailList"
|
|
Dim sdate : sdate = Request("sdate")
|
|
Dim edate : edate = Request("edate")
|
|
|
|
query = ""
|
|
query = query&" select p_sn, p_subject, a.p_cli_company_cd, b.p_cli_company_nm, a.p_cli_per_cd, c.p_cli_per_nm, "&VbScript
|
|
query = query&" a.p_client_type_cd, d.p_client_type_nm, p_memo, isnull(p_total_cost,0) p_total_cost, isnull(p_obtain_cost,0) p_obtain_cost, "&VbScript
|
|
query = query&" p_cont_cost, p_decide_date, convert(varchar(10),a.p_input_dt,23) as p_input_dt, a.p_input_user, e.p_name, "&VbScript
|
|
query = query&" case p_state "&VbScript
|
|
query = query&" when 'E' then '°ËÅä(°¡¸Á)' "&VbScript
|
|
query = query&" when 'K' then 'Á¦¾È' "&VbScript
|
|
query = query&" when 'D' then '¿¬±â' "&VbScript
|
|
query = query&" when 'X' then 'Å»¶ô' "&VbScript
|
|
query = query&" when 'P' then '¼öÁÖ' "&VbScript
|
|
query = query&" when 'C' then 'ÁøÇà' "&VbScript
|
|
query = query&" when 'F' then '¿Ï·á' end p_state, "&VbScript
|
|
query = query&" p_Depart_N, p_Team_N, f.D_Name, f.T_Name "&VbScript
|
|
query = query&" from T_PROJECT_BASE a "&VbScript
|
|
query = query&" left join project2.dbo.V_CLIENT_COMP b on a.p_cli_company_cd=b.p_cli_company_cd "&VbScript
|
|
query = query&" left join project2.dbo.V_CLIENT_PERSON c on a.p_cli_per_cd=c.p_cli_per_cd and a.p_cli_company_cd=c.p_cli_company_cd "&VbScript
|
|
query = query&" left join project2.dbo.T_CLIENT_TYPE_CD d on a.p_client_type_cd=d.p_client_type_cd "&VbScript
|
|
query = query&" left join project2.dbo.V_Person e on a.p_input_user = e.p_no "&VbScript
|
|
query = query&" left join project2.dbo.v_Department f on a.p_Depart_N+a.p_Team_N=f.Code "&VbScript
|
|
If sdate = "" Then
|
|
query = query&" where convert(varchar(7),a.p_input_dt,23)='"&Year(Now())&"-0"&Month(Now())&"' "&Vbscript
|
|
Else
|
|
query = query&" where a.p_input_dt between '"&sdate&"' and '"&edate&"'"&VbScript
|
|
End If
|
|
query = query&" order by p_sn desc "&VbScript
|
|
'response.write query
|
|
rsc.Open query, adoConn, 1
|
|
set json = jsObject()
|
|
|
|
Redim data(rsc.recordcount-1)
|
|
iCnt = 0
|
|
if not rsc.eof then
|
|
while not rsc.eof
|
|
set Contact = jsObject()
|
|
Contact("p_sn") = rsc("p_sn")
|
|
Contact("p_subject") = rsc("p_subject")
|
|
Contact("p_state") = rsc("p_state")
|
|
Contact("p_cli_company_nm") = rsc("p_cli_company_nm")
|
|
Contact("p_total_cost") = Cdbl(rsc("p_total_cost"))
|
|
Contact("p_cont_cost") = Cdbl(rsc("p_cont_cost"))
|
|
Contact("p_name") = rsc("p_name")
|
|
Contact("p_input_dt") = rsc("p_input_dt")
|
|
set data(iCnt) = Contact
|
|
iCnt = iCnt + 1
|
|
rsc.movenext
|
|
wend
|
|
|
|
|
|
json("data") = data
|
|
|
|
Else
|
|
json("data") = ""
|
|
End If
|
|
rsc.close
|
|
response.write toJSON(json)
|
|
|
|
Case "ContactList"
|
|
|
|
sdate = Request("sdate")
|
|
edate = Request("edate")
|
|
|
|
query = ""
|
|
query = query &"select * from"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" select"&VbCrlf
|
|
query = query &" isnull(PCode,'') PCode, isnull(PTeam,'') PTeam, p_sn, p_subject, p_cli_company_nm, '' as p_method, ''as p_sample ,"&VbCrlf
|
|
query = query &" p_cont_cost, isnull(p_total_cost,0) as p_total_cost, '' as pc_con_cost, '' as sum_est, '' as rate_est, '' as sum_act, '' as rate_act, "&VbCrlf
|
|
query = query &" '' as r_est, '' as r_act, '' as f_est, '' as f_act, convert(varchar(10), p_decide_date,23) p_decide_date,"&VbCrlf
|
|
query = query &" '' as p_con_date_st, '' as p_con_date_end, p_state, '' as r_user, '' as f_user, p_input_user, p_name, convert(varchar(10), p_input_dt,23) p_input_dt, '' as p_input_progress from"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" select f.Code as PCode, f.T_Name as PTeam,T.* from"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" select p_sn, p_subject, a.p_cli_company_cd, b.p_cli_company_nm, p_total_cost, p_obtain_cost,"&VbCrlf
|
|
query = query &" p_cont_cost, p_decide_date, a.p_input_dt, a.p_input_user, e.p_name,"&VbCrlf
|
|
query = query &" case p_state"&VbCrlf
|
|
query = query &" when 'E' then '°ËÅä(°¡¸Á)'"&VbCrlf
|
|
query = query &" when 'K' then 'Á¦¾È'"&VbCrlf
|
|
query = query &" when 'D' then '¿¬±â'"&VbCrlf
|
|
query = query &" when 'X' then 'Å»¶ô'"&VbCrlf
|
|
query = query &" when 'P' then '¼öÁÖ'"&VbCrlf
|
|
query = query &" when 'C' then 'ÁøÇà'"&VbCrlf
|
|
query = query &" when 'F' then '¿Ï·á' end p_state,"&VbCrlf
|
|
query = query &" Case "&VbCrlf
|
|
query = query &" When p_Depart_N is null then cast(p_depart_dep as varchar)"&VbCrlf
|
|
query = query &" Else p_Depart_N+p_Team_N"&VbCrlf
|
|
query = query &" End Team"&VbCrlf
|
|
query = query &" from project2.dbo.T_PROJECT_BASE a"&VbCrlf
|
|
query = query &" left join project2.dbo.V_CLIENT_COMP b on a.p_cli_company_cd=b.p_cli_company_cd"&VbCrlf
|
|
query = query &" left join project2.dbo.V_Person e on a.p_input_user = e.p_no"&VbCrlf
|
|
query = query &" ) T"&VbCrlf
|
|
query = query &" left join project2.dbo.v_Department f on T.Team=f.Code or T.Team=f.before_t_cd1"&VbCrlf
|
|
query = query &" ) as A"&VbCrlf
|
|
query = query &" union all"&VbCrlf
|
|
query = query &" "&VbCrlf
|
|
query = query &" select"&VbCrlf
|
|
query = query &" isnull(Tcode,'') Tcode, isnull(depart_name,'') depart_name, p_child_sn as p_sn, p_subject, p_cli_company_nm, p_method_nm, isnull(p_sample,'') p_sample, p_cont_cost, p_total_cost, isnull(pc_cont_cost,0) pc_cont_cost,"&VbCrlf
|
|
query = query &" sum_est, case when pc_cont_cost = 0 or isnull(pc_cont_cost,0) = 0 then 0 else (isnull(sum_est,0)*100)/pc_cont_cost end as rate_est,"&VbCrlf
|
|
query = query &" sum_act, case when pc_cont_cost = 0 or isnull(pc_cont_cost,0) = 0 then 0 else (isnull(sum_act,0)*100)/pc_cont_cost end as rate_act,"&VbCrlf
|
|
query = query &" r_est, r_act, f_est, f_act, '', "&VbCrlf
|
|
query = query &" isnull(p_con_date_st,'') p_con_date_st, isnull(p_con_date_end,'') p_con_date_end, p_state, isnull(r_user, '') as r_user, isnull(f_user, '') as f_user, p_input_user, isnull(p_name,'') p_name, convert(varchar(10), p_input_dt,23) p_input_dt, "&VbCrlf
|
|
query = query &" CASE WHEN left(p_input_complete, 1) = 'x' THEN '¿¬±¸ ' ELSE '' END + "&VbCrLf
|
|
query = query &" CASE WHEN substring(p_input_complete, 2, 1) = 'x' THEN '½Ç»ç' + "&VbCrLf
|
|
query = query &" CASE WHEN p_field_dept = '8' THEN "&VbCrLf
|
|
query = query &" CASE WHEN ISNULL(qc_prog, '') = '' THEN '(QC) ' ELSE '' END "&VbCrLf
|
|
query = query &" WHEN p_field_dept = '9' THEN "&VbCrLf
|
|
query = query &" CASE WHEN ISNULL(SV_prog, '') = '' THEN '(SV) ' ELSE '' END "&VbCrLf
|
|
query = query &" ELSE "&VbCrLf
|
|
query = query &" CASE WHEN ISNULL(SV_prog, '') = '' THEN "&VbCrLf
|
|
query = query &" '(SV' + "&VbCrLf
|
|
query = query &" CASE WHEN ISNULL(qc_prog, '') = '' THEN ', QC) ' ELSE ') ' END "&VbCrLf
|
|
query = query &" ELSE "&VbCrLf
|
|
query = query &" CASE WHEN ISNULL(qc_prog, '') = '' THEN '(QC) ' ELSE '' END "&VbCrLf
|
|
query = query &" END "&VbCrLf
|
|
query = query &" END "&VbCrLf
|
|
query = query &" ELSE '' "&VbCrLf
|
|
query = query &" END + "&VbCrLf
|
|
query = query &" CASE WHEN left(p_input_complete, 1) = 'x' OR substring(p_input_complete, 2, 1) = 'x' THEN 'Á÷Á¢ºñ ¹ÌÀÔ·Â' ELSE '' END AS p_input_progress "&VbCrLf
|
|
query = query &" from"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT p_field_dept, p_is_dept,"&VbCrlf
|
|
query = query &" TPB.p_Depart_N+TPB.p_Team_N as Tcode,"&VbCrlf
|
|
query = query &" ISNULL(ISNULL(DRE.depart_name, DFI.depart_name), DDE.depart_name) AS depart_name,"&VbCrlf
|
|
query = query &" TPM.p_child_sn, TPM.p_subject,"&VbCrlf
|
|
query = query &" VCC.p_cli_company_nm,"&VbCrlf
|
|
query = query &" TPM.p_method_cd,"&VbCrlf
|
|
query = query &" TPMC.p_method_nm,"&VbCrlf
|
|
query = query &" TPM.p_sample, --Ç¥º»"&VbCrlf
|
|
query = query &" TPB.p_cont_cost, --¿¹»ó°è¾à¾×"&VbCrlf
|
|
query = query &" TPB.p_total_cost, --½ÇÁ¦°è¾à¾×"&VbCrlf
|
|
query = query &" TPM.p_cont_cost as pc_cont_cost, --´ÜÀ§°è¾à"&VbCrlf
|
|
query = query &" ISNULL(DC.sum_est, 0) AS sum_est, --¿¹»óÁ÷Á¢ºñ"&VbCrlf
|
|
query = query &" (ISNULL(DC.sum_act, 0) + ISNULL(MC.marketing_cost, 0) + ISNULL(JC.job_money, 0)) AS sum_act, --ÁýÇàÁ÷Á¢ºñ"&VbCrlf
|
|
query = query &" ISNULL(DC.sum_act, 0) AS sum_act_tmp,"&VbCrlf
|
|
query = query &" ISNULL(DC.r_est, 0) AS r_est,"&VbCrlf
|
|
query = query &" ISNULL(DC.r_act, 0) AS r_act,"&VbCrlf
|
|
query = query &" ISNULL(DC.f_est, 0) AS f_est,"&VbCrlf
|
|
query = query &" ISNULL(DC.f_act, 0) AS f_act,"&VbCrlf
|
|
query = query &" TPM.p_con_date_st,"&VbCrlf
|
|
query = query &" TPM.p_con_date_end,"&VbCrlf
|
|
query = query &" TPM.p_progress_status,"&VbCrlf
|
|
query = query &" TPM.p_input_complete,"&VbCrlf
|
|
query = query &" DCF.sv_prog,"&VbCrlf
|
|
query = query &" DCF.qc_prog,"&VbCrlf
|
|
query = query &" ISNULL(TPM.p_research_complete, 0) AS p_research_complete,"&VbCrlf
|
|
query = query &" ISNULL(TPM.p_field_complete, 0) AS p_field_complete,"&VbCrlf
|
|
query = query &" ISNULL(TPM.p_dp_complete, 0) AS p_dp_complete,"&VbCrlf
|
|
query = query &" TPM.p_sn, RU.p_name as r_user, FU.p_name as f_user, VP.p_name, TPB.p_input_user, TPM.p_input_dt,"&VbCrlf
|
|
query = query &" case p_progress_status when '008' then case when p_research_complete='1' and p_field_complete='1' and p_dp_complete='1' then '¿Ï·á' else 'ÁøÇà' end else '¹ÌÁøÇà' end p_state"&VbCrlf
|
|
query = query &" FROM project2.dbo.T_PROJECT_METHOD TPM LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.T_PROJECT_BASE TPB on TPM.p_sn = TPB.p_sn LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.T_PROJECT_METHOD_CD TPMC ON TPM.p_method_cd = TPMC.p_method_cd LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.V_Person VP ON TPB.p_input_user = VP.p_no LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.V_Person RU ON TPM.p_rsch_1_a = RU.p_no LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.V_Person FU ON TPM.p_sv_1 = FU.p_no LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.V_CLIENT_COMP VCC ON TPM.p_cli_company_cd = VCC.p_cli_company_cd LEFT JOIN"&VbCrlf
|
|
query = query &" project2.dbo.direct_cost_field DCF ON TPM.p_child_sn = DCF.p_child_sn AND DCF.del_yn = 'n' LEFT JOIN"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT DISTINCT LEFT(CASE WHEN D_Code = 'S' AND before_t_cd1 IN (17, 18, 19) THEN 'ŰÀ§¼º£ÀÌ' ELSE T_Name END, 8) AS depart_name, "&VbCrlf
|
|
query = query &" before_t_cd1 AS depart_code "&VbCrlf
|
|
query = query &" FROM project2.dbo.v_Department"&VbCrlf
|
|
query = query &" WHERE before_t_cd1 NOT IN ('0', '18')"&VbCrlf
|
|
query = query &" ) DDE ON TPB.p_depart_dep = DDE.depart_code LEFT JOIN"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT DISTINCT LEFT(T_Name, 8) AS depart_name, before_t_cd1 AS depart_code"&VbCrlf
|
|
query = query &" FROM project2.dbo.v_Department"&VbCrlf
|
|
query = query &" WHERE before_t_cd1 NOT IN ('17', '18', '0')"&VbCrlf
|
|
query = query &" ) DRE ON TPM.p_rsch_dept = DRE.depart_code LEFT JOIN"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT DISTINCT LEFT(T_Name, 8) AS depart_name, before_t_cd1 AS depart_code"&VbCrlf
|
|
query = query &" FROM project2.dbo.v_Department"&VbCrlf
|
|
query = query &" WHERE before_t_cd1 NOT IN ('17', '18', '0')"&VbCrlf
|
|
query = query &" ) DFI ON TPM.p_field_dept = DFI.depart_code LEFT JOIN"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT p_child_sn,"&VbCrlf
|
|
query = query &" sum(CONVERT(money, est_money)) AS sum_est,"&VbCrlf
|
|
query = query &" sum(CONVERT(money, act_money)) AS sum_act,"&VbCrlf
|
|
query = query &" sum(case when cost_type = 'research' then CONVERT(money, est_money) else 0 end) AS r_est,"&VbCrlf
|
|
query = query &" sum(case when cost_type = 'research' then CONVERT(money, act_money) else 0 end) AS r_act,"&VbCrlf
|
|
query = query &" sum(case when cost_type = 'field' then CONVERT(money, est_money) else 0 end) AS f_est,"&VbCrlf
|
|
query = query &" sum(case when cost_type = 'field' then CONVERT(money, act_money) else 0 end) AS f_act"&VbCrlf
|
|
query = query &" FROM project2.dbo.direct_cost"&VbCrlf
|
|
query = query &" WHERE p_child_sn > '17' AND del_yes_no = 'no'"&VbCrlf
|
|
query = query &" GROUP BY p_child_sn"&VbCrlf
|
|
query = query &" ) DC ON TPM.p_child_sn = DC.p_child_sn LEFT JOIN"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT M.p_sn, SUM(CONVERT(money, REPLACE(CONVERT(varchar(100), M.target6), ',', ''))) AS marketing_cost"&VbCrlf
|
|
query = query &" FROM project2.dbo.¹®¼³»¿ë M LEFT JOIN project2.dbo.Document D ON M.¹®¼¹øÈ£ = D.d_no"&VbCrlf
|
|
query = query &" WHERE M.¹®¼Á¦¸ñ = 'Á¢´ëºñº¸°í¼' AND M.del_yes_no = 'no'"&VbCrlf
|
|
query = query &" AND D.d_order_cnt = '77'"&VbCrlf
|
|
query = query &" GROUP BY M.p_sn"&VbCrlf
|
|
query = query &" ) MC ON TPM.p_child_sn = MC.p_sn LEFT JOIN"&VbCrlf
|
|
query = query &" ("&VbCrlf
|
|
query = query &" SELECT CA.p_sn, SUM(CA.cost_money) AS job_money"&VbCrlf
|
|
query = query &" FROM project2.dbo.cost_account CA LEFT JOIN project2.dbo.¹®¼³»¿ë M ON CA.d_no = M.¹®¼¹øÈ£"&VbCrlf
|
|
query = query &" LEFT JOIN project2.dbo.Document D ON M.¹®¼¹øÈ£ = D.d_no"&VbCrlf
|
|
query = query &" WHERE CA.cost_money > 0 AND CA.approval = 'yes'"&VbCrlf
|
|
query = query &" AND M.del_yes_no = 'no' AND D.d_order_cnt = '77'"&VbCrlf
|
|
query = query &" GROUP BY CA.p_sn"&VbCrlf
|
|
query = query &" ) JC ON TPM.p_child_sn = JC.p_sn"&VbCrlf
|
|
query = query &" where TPM.p_child_sn is not null"&VbCrlf
|
|
query = query &" ) as A"&VbCrlf
|
|
query = query &" ) AA"&VbCrlf
|
|
query = query& " where p_input_dt between '"&sdate&"' and '"&edate&"' and p_state <> '¼öÁÖ'"&VBCrlf
|
|
if Depart <> "1" Then
|
|
if session("User_Number") <> "20210801" Then '¼°½Å
|
|
if cint(session("Depart_Code")) >= 20 Then
|
|
query = query & " AND (PCode = '" & Session("N_depart") & Session("N_team") &"' " & vbCrLf
|
|
' if session("depart_code") = 64 Then
|
|
' query = query & " OR PCode = 'R601' " & vbCrLf
|
|
' End IF
|
|
if session("depart_code") = 63 Then
|
|
query = query & " OR PCode = 'R602' " & vbCrLf
|
|
End IF
|
|
if session("User_Number") = "20200302" Then '¾ÈÁ¤¸ð
|
|
query = query & " OR PCode in ('R701', 'R702') " & vbCrLf
|
|
End IF
|
|
query = query & " ) "
|
|
End if
|
|
End IF
|
|
if session("User_Number") = "20000201" Then '¿ø¼ºÈÆ
|
|
query = query & " AND PCode in ('R601', 'R602', 'R603','R604','R605','R606') " & vbCrLf
|
|
End IF
|
|
if session("User_Number") = "20190601" Then 'ÀÌÇýÁø
|
|
query = query & " AND PCode in ('R701', 'R702', 'R501') " & vbCrLf
|
|
End IF
|
|
if session("User_Number") = "20210105" Then '±è´Ù½½
|
|
query = query & " AND PCode in ('R703', 'R704') " & vbCrLf
|
|
End IF
|
|
if session("User_Number") = "20160205" Then '¹ÚÁöÈÆ
|
|
'query = query & " and PCode in ('R604','R605','R606', 'A101') " & vbCrLf
|
|
query = query & " AND PCode in ('R601','R602','R603') " & vbCrLf
|
|
End IF
|
|
if session("User_Number") = "20210107" Then '½Å»ó¿í
|
|
'query = query & " and PCode in ('R604','R605','R606', 'A101') " & vbCrLf
|
|
query = query & " AND PCode in ('R604','R605','R606') " & vbCrLf
|
|
End IF
|
|
if session("User_Number") = "20210801" Then '¼°½Å
|
|
query = query & " and PCode in ('R900','R903') " & vbCrLf
|
|
End IF
|
|
End If
|
|
query = query&" ORDER BY p_sn"&VbCrlf
|
|
|
|
'response.write query &" ---------------------------------<br>"
|
|
|
|
rsc.Open query, adoConn, 1
|
|
set json = jsObject()
|
|
|
|
Redim data(rsc.recordcount-1)
|
|
iCnt = 0
|
|
if not rsc.eof then
|
|
while not rsc.eof
|
|
set Contact = jsObject()
|
|
if rsc("PTeam") = "" Then
|
|
Contact("Team") = "¹ÌÁöÁ¤"
|
|
Else
|
|
Contact("Team") = rsc("PTeam")
|
|
End If
|
|
Contact("p_sn") = rsc("p_sn")
|
|
Contact("p_subject") = replace(rsc("p_subject"), """", """)
|
|
Contact("p_cli_company_nm") = rsc("p_cli_company_nm")
|
|
If rsc("p_method") = "" Then
|
|
Contact("p_method") = "¹ÌÁöÁ¤"
|
|
Else
|
|
Contact("p_method") = rsc("p_method")
|
|
End If
|
|
Contact("p_sample") = Cdbl(rsc("p_sample"))
|
|
Contact("p_cont_cost") = Cdbl(rsc("p_cont_cost"))
|
|
Contact("p_total_cost") = Cdbl(rsc("p_total_cost"))
|
|
Contact("pc_con_cost") = Cdbl(rsc("pc_con_cost"))
|
|
Contact("sum_est") = Cdbl(rsc("sum_est"))
|
|
Contact("rate_est") = Round(Cdbl(rsc("rate_est")),2)
|
|
Contact("sum_act") = Cdbl(rsc("sum_act"))
|
|
Contact("rate_act") = Round(Cdbl(rsc("rate_act")),2)
|
|
Contact("r_est") = Cdbl(rsc("r_est"))
|
|
Contact("r_act") = Cdbl(rsc("r_act"))
|
|
Contact("f_est") = Cdbl(rsc("f_est"))
|
|
Contact("f_act") = Cdbl(rsc("f_act"))
|
|
Contact("p_decide_date") = rsc("p_decide_date")
|
|
Contact("p_con_date_st") = rsc("p_con_date_st")
|
|
Contact("p_con_date_end") = rsc("p_con_date_end")
|
|
Contact("p_state") = rsc("p_state")
|
|
If rsc("p_name") = "" then
|
|
Contact("p_input_user") = "¹ÌÁöÁ¤"
|
|
Else
|
|
Contact("p_input_user") = rsc("p_name")
|
|
End If
|
|
If rsc("r_user") = "" then
|
|
Contact("r_user") = "¹ÌÁöÁ¤"
|
|
Else
|
|
Contact("r_user") = rsc("r_user")
|
|
End If
|
|
If rsc("f_user") = "" then
|
|
Contact("f_user") = "¹ÌÁöÁ¤"
|
|
Else
|
|
Contact("f_user") = rsc("f_user")
|
|
End If
|
|
Contact("p_input_dt") = rsc("p_input_dt")
|
|
Contact("p_input_progress") = rsc("p_input_progress")
|
|
set data(iCnt) = Contact
|
|
iCnt = iCnt + 1
|
|
|
|
rsc.movenext
|
|
wend
|
|
|
|
json("data") = data
|
|
|
|
Else
|
|
json("data") = ""
|
|
End If
|
|
rsc.close
|
|
response.write toJSON(json)
|
|
End Select
|
|
%> |