<% Response.CharSet = "EUC-KR" '한글 Response.AddHeader "Pragma","no-cache" Response.AddHeader "cache-control", "no-staff" Response.Expires = -1 dim info : set info = JSON.parse(request("data")) dim query, krc_no, tmpstr, tmp dim Company(6) dim user_name(4) dim target97, target98, target99, target100 dim executeCount : executeCount = 0 dim title : title = "업무일지" ''회사 회사명, 사업자등록번호, 대표자명, 주소 가져오기 query = "select * from company" adoRs.open query, adoconn,adopenstatic, adlockreadonly Company(1) = adors("com_name") Company(2) = adors("사업자등록번호") Company(3) = adors("대표자명") Company(4) = adors("주소") Company(5) = adors("법인등록번호") Company(6) = adors("회사대표전화번호") adoRs.close ''로그인 사용자 정보 user_name(0) = Session("User_Number") 'query = "SELECT p_name, p_team_name, p_rank_name, p_tel3 FROM project2.dbo.V_Person WHERE p_no = '" & user_name(0) & "'" Query = "SELECT p_name, CASE WHEN p_team_name IN ( '솔루션개발그룹','데이터분석그룹','온라인서베이운영그룹', '디지털COMM그룹') THEN '디지털서비스본부' ELSE p_team_name END AS p_team_name, p_rank_name, p_tel3 FROM project2.dbo.V_Person WHERE p_no = '" & user_name(0) & "'" adoRs.open query, adoconn,adopenstatic, adlockreadonly user_name(1) = adoRs("p_name") '이름 user_name(2) = adoRs("p_rank_name") '직위 코드 user_name(3) = adoRs("p_tel3") '직통 전화 user_name(4) = adoRs("p_team_name") '부서코드 adoRs.close query = " select d_no as krc_no from document " query = query & " where d_name = '업무일지' " query = query & " and substring(d_no, 5, 4) = '" & year(date) & "' " query = query & " order by d_no " adoRs.open Query, adoconn,adopenstatic, adlockreadonly if adoRs.recordcount <= 0 then krc_no = 0 else adoRs.movelast tmpstr = split(trim(adoRs("krc_no")),"-") krc_no = tmpstr(3) end if adoRs.close krc_no = int(krc_no) + 1 tmpstr = "KRC-" & year(date) & "-" tmpstr = tmpstr & "B-" krc_no = tmpstr & ZeroFormat(krc_no,5) target97 = user_name(1) & "^^" & user_name(2) & "^^" & user_name(3) & "^^" & user_name(4) target98 = Company(1) & "^^" & Company(2) & "^^" & Company(3) & "^^" & Company(4) & "^^" & Company(5) & "^^" & Company(6) tmp_txt = Session("loginuser") & "
" & replace(date(), "-","") & "
" & Session("User_Number") if my_pos = 6 then '사장 tmp_txt1 = "전결" : tmp_txt2 = "전결" : tmp_txt3 = "전결" : tmp_txt4 = "전결" : tmp_txt5 = tmp_txt tmp_txt6 = "/" : tmp_txt7 = "/" : tmp_txt8 = "/" : tmp_txt9 = "/" : tmp_txt10 = month(now()) & " / " & day(now()) elseif my_pos = 5 then '임원 tmp_txt1 = "전결" : tmp_txt2 = "전결" : tmp_txt3 = "전결" : tmp_txt4 = tmp_txt : tmp_txt5 = " " tmp_txt6 = "/" : tmp_txt7 = "/" : tmp_txt8 = "/" : tmp_txt9 = month(now()) & " / " & day(now()) : tmp_txt10 = "/" elseif my_pos = 3 or my_pos = 4 then '부서장 tmp_txt1 = "전결" : tmp_txt2 = "전결" : tmp_txt3 = tmp_txt : tmp_txt4 = " " : tmp_txt5 = " " tmp_txt6 = "/" : tmp_txt7 = "/" : tmp_txt8 = month(now()) & " / " & day(now()) : tmp_txt9 = "/" : tmp_txt10 = "/" elseif my_pos = 2 then '팀장 tmp_txt1 = tmp_txt : tmp_txt2 = "전결" : tmp_txt3 = " " : tmp_txt4 = " " : tmp_txt5 = " " tmp_txt6 = month(now()) & " / " & day(now()) : tmp_txt7 = "/" : tmp_txt8 = "/" : tmp_txt9 = "/" : tmp_txt10 = "/" elseif my_pos = 1 then '팀 팀원 tmp_txt1 = tmp_txt : tmp_txt2 = " " : tmp_txt3 = " " : tmp_txt4 = " " : tmp_txt5 = " " tmp_txt6 = month(now()) & " / " & day(now()) : tmp_txt7 = "/" : tmp_txt8 = "/" : tmp_txt9 = "/" : tmp_txt10 = "/" else '노팀 팀원 tmp_txt1 = tmp_txt : tmp_txt2 = "전결" : tmp_txt3 = " " : tmp_txt4 = " " : tmp_txt5 = " " tmp_txt6 = month(now()) & " / " & day(now()) : tmp_txt7 = "/" : tmp_txt8 = "/" : tmp_txt9 = "/" : tmp_txt10 = "/" end if %> <% target99 = tmp_txt1 & "^^" & tmp_txt2 & "^^" & tmp_txt3 & "^^" & tmp_txt4 & "^^" & tmp_txt5 target100 = tmp_txt6 & "^^" & tmp_txt7 & "^^" & tmp_txt8 & "^^" & tmp_txt9 & "^^" & tmp_txt10 'Document table에 삽입 query = "INSERT INTO Document " query = query & " (d_no, d_name, d_write_name, d_write_date, d_flag, d_type, " query = query & " d_order_cnt, d_orders," query = query & " d_order1, d_order2, d_order3, d_order4, d_order5, " query = query & " d_order6, d_order7, d_order8, d_order9, d_order10, " query = query & " d_view, d_delok) " query = query & "VALUES " query = query & " ('" & krc_no & "', '업무일지', '" & Session("loginuser") & "', '" & date() & "', '14', '" & d_type & "', " query = query & " '" & d_order_cnt & "', '" & d_orders & "', " query = query & " '" & d_order1 & "', '" & d_order2 & "', '" & d_order3 & "', '" & d_order4 & "', '" & d_order5 & "', " query = query & " '" & d_order6 & "', '" & Session("User_Number") & "', '" & d_orders & "', '" & date() & "', '" & d_order10 & "', " query = query & " 'N', 'N') " adoconn.execute query '==================================================================== '//======================== '문서 내용 저장하기 query = "insert into 문서내용 (문서번호, 문서제목, " query = query & " target3, target4, target97, target98, target99, target100, " query = query & " 발급일, 발급시각, login_p_no, login_이름,login_ip, part) values ( " query = query & "'" & krc_no & "', " query = query & "'업무일지', " query = query & "'" & info.j_date_1 & "', " query = query & "'" & info.j_date_2 & "', " query = query & "'" & target97 & "', " query = query & "'" & target98 & "', " query = query & "'" & target99 & "', " query = query & "'" & target100 & "', " query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', " query = query & "'" & time() & "', " query = query & "'" & user_name(0) & "', " query = query & "'" & user_name(1) & "', " query = query & "'" & Session("USERIP") & "'," query = query & "'" & part & "') " adoconn.execute query query = " UPDATE Job_List SET j_approval = '" & krc_no & "' " query = query & " WHERE j_date BETWEEN '" & info.j_date_1 & "' AND '" & info.j_date_2 & "' " query = query & " AND p_no = '" & Session("User_Number") & "' AND j_flag = '1' " adoconn.execute query, executeCount Response.Clear if executeCount > 0 then Response.Write "1" else Response.Write "0" end if %>