Files
KIN/nk/input_time_2014.asp

826 lines
40 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<!-- #include virtual = "include/holiday_count.asp" -->
<!-- #include virtual = "lib/logger_nk.asp" -->
<%
dim neakeun_name, neakeun_jumin, neakeun_id
dim Query
dim condate
dim in_time_chk '0:기록없음, 1:출근시간이미 기록, 2:출근/퇴근 시각이미기록
dim yoil, yoilvalue
dim Moon_Date
dim permanent_position
If request("condate") = "" Or request("condate") = null Then
condate = year(date) & "-" & zeroformat(month(date),2) & "-"
if clng(hour(time)) < 7 then
condate = condate & zeroformat(day(date-1) ,2)
else
condate = condate & zeroformat(day(date) ,2)
end If
Else
condate = request("condate")
End If
dim work_start_time, work_end_time ' 업무 시작 시간, 업무 종료 시간
'예) work_stat_time이 1000, work_end_time 1800 이면, 출퇴근이 0900 ~ 2000 여도 근무 인정시간은 1000 ~ 1800 안에서 인정한다.
'2025_04_14 : 업무 시작 시간을 "오전 10시 → 오전 9시 45분" 으로 변경
If condate < "2025-04-26" Then
work_start_time = "1000"
Else
work_start_time = "0945"
End If
work_end_time = "2400"
dim lunch_time_st, lunch_time_end ' lunch_time_st 이전 출근 ~ lunch_time_end 이후 퇴근 시 점심식대 지급
dim dinner_time_st, dinner_time_end ' dinner_time_st 이전 출근 ~ dinner_time_end 이후 퇴근 시 저녁식대 지급
lunch_time_st = "1100"
lunch_time_end = "1500"
dinner_time_st = "1800"
dinner_time_end = "2100"
If UCase(request("permanent_position")) = "TRUE" Then
permanent_position = request("permanent_position")
Else
permanent_position = false
End if
yoil = weekday(condate)
yoilvalue = yoil
select case yoil
case 1 yoil = "일요일"
case 2 yoil = "월요일"
case 3 yoil = "화요일"
case 4 yoil = "수요일"
case 5 yoil = "목요일"
case 6 yoil = "금요일"
case 7 yoil = "토요일"
end select
call day_off_chk(Mid(condate, 1, 4), Mid(condate, 6, 2), Mid(condate, 9, 2))
if day_off = "true" then
yoil="공휴일"
end if
neakeun_name = unescape(Request("neakeun_name"))
neakeun_jumin = Request("neakeun_jumin")
neakeun_id = Request("neakeun_id")
query = " select in_time, out_time from neakeun_in_out_time "
query = query & " where neakeun_name = '" & neakeun_name & "' "
query = query & " and left(neakeun_jumin, 6) = left('" & neakeun_jumin & "', 6) "
query = query & " and [date] = '" & condate & "'"
'Response.Write query
adoRs.Open query, adoconn, adopenstatic, adlockreadonly
if adoRs.recordcount = 0 then
in_time_chk= 0 '미출근
else
if trim(adors("in_time")) <> "" then
in_time_chk= 1 '출근
end if
if trim(adors("out_time")) <> "" then
in_time_chk= 2 '퇴근
end if
end if
adoRs.close
now_time = zeroformat(hour(time),2) & zeroformat(minute(time),2)
if cint(now_time) >= 1200 and cint(now_time) < 1300 then
now_time = "1300"
end if
'response.write "<br> time = "& time
'response.write "<br> now_time = "& now_time
'response.write "<br> cint(now_time) = "& cint(now_time)
'response.write "<br> yoil = "& yoil
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<link rel="stylesheet" type="text/css" href="/css/jquery-ui.min.css">
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ajax-call.js"></script>
<script src="/js/jquery.form.min.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script language="javascript">
$(document).ready(function () {
$.datepicker.setDefaults({
dateFormat: 'yy-mm-dd',
prevText: '이전 달',
nextText: '다음 달',
monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
dayNames: ['일', '월', '화', '수', '목', '금', '토'],
dayNamesShort: ['일', '월', '화', '수', '목', '금', '토'],
dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
showMonthAfterYear: true,
yearSuffix: '년'
});
$(".selectDate").datepicker();
var login_out_flag = '<%=in_time_chk%>';
if (login_out_flag == "2") {
setAvailableTime();
} else if (login_out_flag == "0") {
var permanent_position = document.frm_work.permanent_position.value;
if (permanent_position != "True") {
go_time_write('1');
}
}
});
function svChange(sv, index) {
ajaxCallJson("sv_change_ajax.asp", { "sv": sv , "div": "1"}, null, "post", "LoadProjectList(" + index + ")");
ajaxCallJson("sv_change_ajax.asp", { "sv": sv , "div": "2"}, null, "post", "LoadSebuList(" + index + ")");
}
function LoadProjectList(index) {
if (ajaxResponse != "NONE") {
$("select[name=prj_code]:eq(" + (index * 1 - 1) + ") option").remove();
$("select[name=prj_code]:eq(" + (index * 1 - 1) + ")").html(ajaxResponse);
} else {
alert("해당 직원이 참여한 프로젝트가 없습니다.");
}
}
function LoadSebuList(index) {
if (ajaxResponse != "NONE") {
$("select[name=prj_sebu]:eq(" + (index * 1 - 1) + ") option").remove();
$("select[name=prj_sebu]:eq(" + (index * 1 - 1) + ")").html(ajaxResponse);
} else {
alert("세부근무를 불러오는 중 오류가 발생하였습니다.");
}
}
function setAvailableTime() {
var actualStartTime = "0"
var actualEndTime = "0"
var actualInTime = "0"
var actualOutTime = "0"
var actualInputTime = "0"
var actualOutputTime = "0"
var LogInTime = $("input[name=InTime]").val(); //실제출근시간
var LogOutTime = $("input[name=OutTime]").val(); //실제퇴근시간
var StartTime = $("input[name=txtStartTime]").val(); //업무시작시간 : 0945
var EndTime = $("input[name=txtEndTime]").val(); //업무종료시간 : 2400
var workEndTime = "";
var lunch_time_st = <%=lunch_time_st %>; //점심지급 시작 시간 : 1100
var lunch_time_end = <%=lunch_time_end %>; //점심지급 종료 시간 : 1500
var dinner_time_st = <%=dinner_time_st %>; //저녁지급 시작 시간 : 1800
var dinner_time_end = <%=dinner_time_end %>; //저녁지급 종료 시간 : 2100
//출근 시간과 근무시작시간, 퇴근시간과 근무종료시간을 체크 하여 하루의 근무인정시간을 계산~!
// 출근시간 설정
if (Number(LogInTime) < Number(StartTime)) { //실제출근시간 < 업무시작시간 : 0945
actualStartTime = StartTime; //actualStartTime(인정시작시간) = 업무시작시간
} else { //실제출근시간 > 업무시작시간 : 0945
actualStartTime = LogInTime; //actualStartTime(인정시작시간) = 출근시간
}
//퇴근시간 설정
if (Number(LogOutTime) < Number(EndTime)) { //실제퇴근시간 < 업무종료시간 : 2400
if(Number(LogOutTime) < Number(StartTime)){ //실제퇴근시간 < 업무시작시간 : 0945
actualEndTime = StartTime; //actualEndTime(인정종료시간) = 업무시작시간
}else{ //실제퇴근시간 > 업무시작시간 : 0945
actualEndTime = LogOutTime; //actualEndTime(인정종료시간) = 실제퇴근시간
}
} else { //실제퇴근시간 > 업무종료시간 : 2400
actualEndTime = EndTime; //actualEndTime(인정종료시간) = 업무종료시간
}
//식대 체크
if (actualStartTime != "0" && actualEndTime != "0") {
//출근, 퇴근시간을 분으로 변환
actualInTime = Number(actualStartTime.substr(0, 2)) * 60 + Number(actualStartTime.substr(2, 2));
actualOutTime = Number(actualEndTime.substr(0, 2)) * 60 + Number(actualEndTime.substr(2, 2));
//출근 ~ 18:00까지의 근무시간을 분으로 변환
var tempActualInTime = (18 * 60 > actualOutTime ? actualOutTime : 18 * 60) - eval(actualInTime);
//18:00 이후의 근무시간을 분으로 변환
var tempActualOutTime = eval(actualOutTime) - 18 * 60;
//점심식대 체크~!
//출근시간이 점심 시작시간(11:00)보다 빠르거나 같고 퇴근시간이 점심 종료시간(15:00)보다 늦거나 같으면 점심식대 지급 하고 1시간(60분)을 실제근무시간에서 차감
if (Number(actualStartTime) <= lunch_time_st && Number(actualEndTime) >= lunch_time_end) {
//$("input[name=lunch]").attr("checked", true);
$("input[name=lunch]").val("1");
//$("input[name=lunch_flag]").val("1");
tempActualInTime = tempActualInTime - 60; //점심식대가 지급된다면 1시간을 제외~!
}
// //저녁식대 체크~!
// //출근시간이 저녁 시작시간(1800)보다 빠르거나 같고 퇴근시간이 저녁 종료시간(2100)보다 늦거나 같으면 저녁식대 지급 하고 30분을 야간근무시간에서 차감
// if (Number(actualStartTime) <= dinner_time_st && Number(actualEndTime) >= dinner_time_end) {
// //$("input[name=dinner]").attr("checked", true);
// $("input[name=dinner]").val("1");
// //$("input[name=dinner_flag]").val("1");
// tempActualOutTime = tempActualOutTime - 30;
// }
//근무시간을 15분 단위로 아래 방향으로 절삭
//00,15,45,60,75,90 을 기준으로 현재값 이하에서 가장 큰 15의 배수로 내림
//61분 → 60분
//74분 → 60분
//89분 → 75분
//104분 → 90분
//18시 이전 시간 절삭 처리
var temp_MinusInTime = tempActualInTime % 15;
tempActualInTime = tempActualInTime - temp_MinusInTime;
actualInputTime = (tempActualInTime / 60).toFixed(2);
//18시 이후 시간 절삭 처리
var temp_MinusOutTime = tempActualOutTime % 15;
tempActualOutTime = tempActualOutTime - temp_MinusOutTime;
actualOutputTime = (tempActualOutTime / 60).toFixed(2);
//계산결과 셋팅
// var outputTime = actualOutputTime > 0 ? actualOutputTime : 0;
// var totalTime = parseFloat(actualInputTime) + parseFloat(outputTime);
//
// $("input[name=txtInputTime]").val(totalTime.toFixed(2)); // 주간+야간 합계
//$("input[name=txtOutputTime]").val(outputTime); // 야간
var totalTxtInputTime = Number(actualInputTime) + Number(actualOutputTime);
$("input[name=txtInputTime]").val(totalTxtInputTime); //근무인정시간(주간)
$("input[name=txtOutputTime]").val(actualOutputTime > 0 ? actualOutputTime : 0); //근무인정시간(야간)
// var workTimeSum = parseFloat(document.frm_neakeun_job.txtInTimeSum.value) + parseFloat(document.frm_neakeun_job.txtOutTimeSum.value);
var workTimeSum = parseFloat(document.frm_neakeun_job.txtInTimeSum.value);
if(workTimeSum >= 4){
$("input[name=lunch]").attr("checked", true);
$("input[name=lunch_flag]").val("1");
}
// if(workTimeSum >= 8){
// $("input[name=dinner]").attr("checked", true);
// $("input[name=dinner_flag]").val("1");
// }
}
}
function go_time_write(txt) {
var neakeun_name = document.frm_work.neakeun_name.value;
var neakeun_jumin = document.frm_work.neakeun_jumin.value;
var permanent_position = document.frm_work.permanent_position.value;
if (neakeun_name != "" && neakeun_jumin != "") {
var condate = document.frm_work.condate.value; //날짜
var url = "input_time_write.asp?time_chk=" + txt;
url = url + "&neakeun_name=" + neakeun_name;
url = url + "&neakeun_jumin=" + neakeun_jumin;
url = url + "&permanent_position=" + permanent_position;
url = url + "&condate=" + condate;
document.frm_work.action = url;
document.frm_work.submit();
} else {
alert("내근직을 선택하세요.");
}
}
function go_delete(neakeun_name, del_date) {
//해당 내근직의 해당일자 근태 기록 삭제
var confirm_flag = false;
var temp_confirm = "";
for (var i = 0; i < 10; i++) {
temp_confirm = document.frm_neakeun_job.job_confirm_yn[i].value;
if (temp_confirm == "Y") {
confirm_flag = true;
}
}
if (confirm_flag) {
alert("SV가 업무확인한 내역이 존재 합니다.\n삭제 할 수 없습니다.");
} else {
if (confirm(neakeun_name + "님의 " + del_date + "일자\n\n내근직 근태 기록 전부를 정말로 삭제할까요...\n\n삭제를 원하시면 확인을 클릭하시고\n\n아니면 취소를 클릭하세요")) {
var neakeun_jumin = document.frm_neakeun_job.neakeun_jumin.value;
var url = "work_delete.asp?neakeun_name=" + neakeun_name + "&del_date=" + del_date + "&neakeun_jumin=" + neakeun_jumin;
window.open(url, "", "left=50, top=50, menubar=no, location=no, status=no ,toolbar=no, width=850, height=600, scrollbars=yes ,resizable=no");
} else {
alert("삭제를 취소를 하였습니다...");
}
}
}
function Sendit(txt) {
var yoil = document.frm_neakeun_job.txtyoilvalue.value;
var availableInTime = document.frm_neakeun_job.txtInputTime.value; // '주간 근무인정시간
// var availableOutTime = document.frm_neakeun_job.txtOutputTime.value; // '야간 근무인정시간
var txtInTime = 0
var txtInTimeSum = 0
// var txtOutTime = 0
// var txtOutTimeSum = 0
for (var i = 0; i < 10; i++) {
prj_code = document.frm_neakeun_job.prj_code[i].value;
prj_sebu = document.frm_neakeun_job.prj_sebu[i].value;
txtInTime = 0;
if(document.frm_neakeun_job.txtInTime[i].value == ""){
document.frm_neakeun_job.txtInTime[i].value = "0";
}
// if(document.frm_neakeun_job.txtOutTime[i].value == ""){
// document.frm_neakeun_job.txtOutTime[i].value = "0";
// }
txtInTime = document.frm_neakeun_job.txtInTime[i].value;
txtInTimeSum = txtInTimeSum + txtInTime * 1;
// txtOutTime = document.frm_neakeun_job.txtOutTime[i].value;
// txtOutTimeSum = txtOutTimeSum + txtOutTime * 1;
// if (eval(txtInTime) > 0 || eval(txtOutTime) > 0) {
if (eval(txtInTime) > 0) {
if (prj_code == "") {
alert((eval(i) + 1) + "번째 줄 프로젝트를 선택하세요.");
return false;
}
if (prj_sebu == "") {
alert((eval(i) + 1) + "번째 줄 업무내용을 선택하세요.");
return false;
}
}
}
if (eval(availableInTime) < eval(txtInTimeSum)) {
alert("주간 근무인정시간을 초과되었습니다.");
return false;
}
// if (eval(availableOutTime) < eval(txtOutTimeSum)) {
// alert("야간 근무인정시간을 초과되었습니다.");
// return false;
// }
document.frm_neakeun_job.txtInTimeSum.value = txtInTimeSum;
// document.frm_neakeun_job.txtOutTimeSum.value = txtOutTimeSum;
// if (eval(txtInTimeSum) == 0 && eval(txtOutTimeSum) == 0) {
if (eval(txtInTimeSum) == 0) {
alert("근무 시간을 입력하세요.");
return false;
}
// var workTimeSum = parseFloat(document.frm_neakeun_job.txtInTimeSum.value) + parseFloat(document.frm_neakeun_job.txtOutTimeSum.value);
var workTimeSum = parseFloat(document.frm_neakeun_job.txtInTimeSum.value);
if(workTimeSum >= 4){
$("input[name=lunch]").attr("checked", true);
$("input[name=lunch_flag]").val("1");
}
// if(workTimeSum >= 8){
// $("input[name=dinner]").attr("checked", true);
// $("input[name=dinner_flag]").val("1");
// }
document.frm_neakeun_job.action = "work_submit_save_2014.asp";
document.frm_neakeun_job.submit();
}
function Search_Name() {
var m_name = document.frm_work.neakeun_name.value;
if (m_name == "") {
alert("찾고자 하는 면접원 이름을 입력한 후 찾기 버튼을 이용하여 해당 면접원을 선택하세요.");
return false;
}
var url = "/project_list/myun_search.asp?cutmenu=1&part=naekeun_search&m_name=" + m_name;
window.open(url, "", "left=0, top=5, width=500, height=500, scrollbars=yes, statbar=no");
}
function work_date_change() {
var neakeun_name = document.frm_work.neakeun_name.value;
var neakeun_jumin = document.frm_work.neakeun_jumin.value;
if (neakeun_name != "" && neakeun_jumin != "") {
var condate = document.frm_work.condate.value;
var dateArray = condate.split("-");
var sel_date = new Date(dateArray[0], Number(dateArray[1]) - 1, dateArray[2]);
var now_date_full = new Date();
var now_date = new Date(now_date_full.getFullYear(), now_date_full.getMonth(), now_date_full.getDate());
if (document.frm_work.permanent_position.value.toUpperCase() != "TRUE") { // SV가 아니면
if ((now_date.getTime() - sel_date.getTime()) / 24 / 60 / 60 / 1000 > 5) {
alert("5일 초과한 업무일지는 작성할 수 없습니다.");
//return false;
}
}
document.frm_work.action = "input_time_2014.asp";
document.frm_work.submit();
} else {
alert("내근직을 선택하세요.");
}
}
function work_time_change() {
frm = document.frm_neakeun_job;
if (frm.in_time.value.replace(/ /gi, "") == "" || frm.out_time.value.replace(/ /gi, "") == ""){
alert("출퇴근시간 중 빈 값이 입력되어있습니다.\n확인 후 다시 진행해주세요.");
return false;
}
if (isNaN(frm.in_time.value) || isNaN(frm.out_time.value)){
alert("출퇴근시간 중 잘못된 값이 입력되어있습니다.\n확인 후 다시 진행해주세요.");
return false;
}
if (frm.in_time.value > frm.out_time.value) {
alert("퇴근시간이 출근시간보다 빠를 수 없습니다.");
return false;
}
if (confirm("출퇴근 시간을 정말 수정하시겠습니까?")) {
frm.action = "work_time_change_2014.asp";
frm.submit();
}
}
function resetJumin() {
document.frm_work.neakeun_jumin.value = "";
}
function onlyNum() {
if (event.keyCode == 46) {
return true;
} else if ((event.keyCode < 48) || (event.keyCode > 57)) {
event.returnValue = false;
}
}
function logout() {
document.frm_work.action = "./neakeun_Logout.asp";
document.frm_work.submit();
}
</script>
<TITLE>내근직 업무일지 기록</TITLE>
</head>
<body leftmargin=0 topmargin=0>
<form method='post' name='frm_work'>
<div align='left'>
<table border=1 bordercolor="#CD1039" bordercolorlight="#CD1039" cellspacing="0" bordercolordark="#FFFFFF" cellpadding=0 width=1000>
<tr>
<td align="center" bgcolor="#32A4FF"><FONT color=#ffffff size=2>
<% If permanent_position = "True" then %>
내근직이름 : <input type=text name='neakeun_name' size=10 value = '<%=neakeun_name%>' onkeydown="resetJumin()">
<input type="button" value="찾기" onclick="Search_Name()"/>
<% else %>
내근직이름 : <input type=text name='neakeun_name' readonly size=10 value = '<%=neakeun_name%>'>
<% End If %>
</td>
<td align="center" bgcolor="#32A4FF"><FONT color=#ffffff size=2>
기록일 : <input type="text" class="selectDate" style="width:150;text-align:right;" name="condate" value="<%=condate%>" readonly>
<input type="button" value="조회" onclick="work_date_change()"/>
</td>
<td align="center" bgcolor="#32A4FF"><FONT color=#ffffff size=2>
요 일 : <input type=text name='yoil' readonly size=10 value = '<%=yoil%>'>
</td>
</tr>
<%
sql = " select date, in_time, out_time From neakeun_in_out_time where left(neakeun_jumin, 6) = left('" & neakeun_jumin & "', 6) and date = '" & condate & "'"
sql = sql & " and neakeun_name = '" & neakeun_name & "'"
'response.write sql
AdoRs.open sql, adoconn, adopenstatic, adlockreadonly
Dim InTime, OutTime
Dim convert_InTime_minute, convert_OutTime_minute
Dim innerInTime, OverInTime
InTime = 0
OutTime = 0
if AdoRs.recordcount > 0 Then
If AdoRs("in_time") <> "" Then
InTime = AdoRs("in_time")
End If
If AdoRs("out_time") <> "" Then
OutTime = AdoRs("out_time")
End If
If AdoRs("in_time") <> "" And AdoRs("out_time") <> "" Then
convert_InTime_minute = eval(left(InTime,2)) * 60 + eval(right(InTime,2))
convert_OutTime_minute = eval(left(OutTime,2)) * 60 + eval(right(OutTime,2))
end If
%>
<tr height=30>
<td align="center" bgcolor="#32A4FF" colspan=3>
<FONT color=#ffffff size=2>출근일자 : <%=AdoRs("date")%>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;출근 시각 : <%=InTime%>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;퇴근 시각 : <%=OutTime%> </font>
</td>
</tr>
<%
End if
adoRs.close
%>
<tr>
<td align="center" bgcolor="#32A4FF" colspan=3>
<%if condate = left(now(), 10) OR permanent_position = "True" then %>
<% if in_time_chk=0 then %>
&nbsp;&nbsp;<img src = '/images/nk/출근.gif' title = "출근시각입력" onclick="go_time_write('1');" align=absmiddle style='cursor:pointer'>
<% else %>
&nbsp;&nbsp;<img src = '/images/nk/퇴근.gif' title = "퇴근시각입력" onclick="go_time_write('2');" align=absmiddle style='cursor:pointer'>
<% end if %>
<%end if %>
<img src = '/images/nk/로그아웃.gif' title = "로그아웃" onclick="logout();" align='absmiddle' style='cursor:pointer' />
<input type='hidden' name='neakeun_jumin' value = '<%=neakeun_jumin%>' />
<input type='hidden' name='permanent_position' value = '<%=permanent_position%>' />
<input type="hidden" name="neakeun_id" id="neakeun_id" value="<%=neakeun_id %>" />
</td>
</tr>
</table>
</form>
<%
If in_time_chk = 2 Then
dim sv_list()
dim in_time, out_time
dim Categori_Cnt : Categori_Cnt = 10
dim gap()
reDim gap(Categori_Cnt, 13)
'##### 내근직 업무일지 담당 직원
cost_sql = " select p_name,p_no from dbo.person "&VbCrlf
cost_sql = cost_sql & " where p_depart in ('12','17') and p_job_part in ('03','04','05','06','12','15') and "&VbCrlf '-- 실사,QC,DP(코딩)
cost_sql = cost_sql & " ( "&VbCrlf
cost_sql = cost_sql & " krc_out_date = '' or "&VbCrlf
cost_sql = cost_sql & " convert(int,replace(krc_out_date,'-',''))>=convert(int,replace('" & condate & "','-','')) "&VbCrlf
cost_sql = cost_sql & " ) "&VbCrlf
cost_sql = cost_sql & " order by p_name asc "&VbCrlf
'Response.Write cost_sql
Rs.open cost_sql, adoconn, adopenstatic, adlockreadonly
redim sv_list(Rs.recordCount, 2)
for i=1 To Rs.recordCount
sv_list(i, 1) = Rs("p_name")
sv_list(i, 2) = cstr(Rs("p_no"))
Rs.MoveNext
Next
Rs.Close
Dim job_confirm_yn
job_confirm_yn = "N"
'저장여부 확인
sql = " SELECT nw.p_sn, nw.p_sv_no, isnull((select TOP 1 p_name from person where p_no = nw.p_sv_no), '&nbsp;') as p_sv_name, p_sv_main, nw.p_child_sn, TPM.p_subject, nw.p_sebu, nw.p_sebu_code, nw.job_in_time, nw.job_out_time, nw.job_jumal_time, niot.in_time, niot.out_time, job_total_time, "&VbCrlf
sql = sql & " job_lunch_yn, job_dinner_yn, job_start_time, job_end_time, isnull(job_confirm_yn,'N') as job_confirm_yn, isnull((select TOP 1 p_name from person where p_no = TNP.insert_user), '&nbsp;') as insert_user "&VbCrlf
sql = sql & " FROM neakeun_work nw LEFT OUTER JOIN "&VbCrlf
sql = sql & " ( "&VbCrlf
sql = sql & " select neakeun_name, neakeun_jumin, date, min(in_time) as in_time, max(out_time) as out_time "&VbCrlf
sql = sql & " from neakeun_in_out_time "&VbCrlf
sql = sql & " group by neakeun_name, neakeun_jumin, date "&VbCrlf
sql = sql & " ) niot "&VbCrlf
sql = sql & " on left(nw.neakeun_jumin, 6) = left(niot.neakeun_jumin, 6) and nw.neakeun_name = niot.neakeun_name AND NW.date = NIOT.date "&VbCrlf
sql = sql & " left outer join T_NEAKEUN_PAY TNP ON convert(varchar(15), nw.id) = TNP.attribute01 and nw.p_sebu = TNP.s_gubun "&VbCrlf
sql = sql & " left outer join T_PROJECT_METHOD TPM ON nw.p_child_sn = TPM.p_child_sn "&VbCrlf
sql = sql & " WHERE left(nw.neakeun_jumin, 6) = left('" & neakeun_jumin & "', 6) "&VbCrlf
sql = sql & " AND nw.[date] = '" & condate & "' "&VbCrlf
sql = sql & " AND nw.in_time + nw.out_time <> '00000000' "&VbCrlf
sql = sql & " and nw.neakeun_name = '" & neakeun_name & "' "&VbCrlf
'Response.write sql
AdoRs.open sql, adoconn, adopenstatic, adlockreadonly
if AdoRs.recordcount > 0 then
i=0
in_time = AdoRs("in_time")
out_time = AdoRs("out_time")
job_total_time = AdoRs("job_total_time")
lunch_flag = AdoRs("job_lunch_yn")
'dinner_flag = AdoRs("job_dinner_yn")
do until AdoRs.eof
i = i + 1
gap(i,0) = adors("p_subject")
gap(i,1) = adors("p_child_sn")
gap(i,2) = adors("p_sebu")
gap(i,3) = formatnumber(cDbl(adors("job_in_time")) - cDbl(adors("job_out_time")),2)
gap(i,4) = adors("job_start_time")
gap(i,5) = adors("job_end_time")
gap(i,6) = adors("job_out_time")
gap(0,3) = formatnumber(cdbl(gap(0,3)) + cdbl(gap(i,3)),2)
gap(0,6) = formatnumber(cdbl(gap(0,6)) + cdbl(gap(i,6)),2)
gap(i,7) = adors("job_confirm_yn")
If gap(i,7) = "Y" Then
job_confirm_yn = "Y"
End if
gap(i,8) = adors("insert_user")
gap(i,9) = adors("p_sv_name")
gap(i,10) = adors("p_sv_no")
gap(i,11) = adors("p_sv_main")
gap(i,12) = adors("p_sebu_code")
AdoRs.movenext
loop
else
AdoRs.close
query = "select in_time, out_time from neakeun_in_out_time "&VbCrlf
query = query & " where "&VbCrlf
query = query & " left(neakeun_jumin, 6) = left('" & neakeun_jumin & "', 6) "&VbCrlf
query = query & " and [date] = '" & condate & "'"&VbCrlf
query = query & " and neakeun_name = '" & neakeun_name & "'"&VbCrlf
'Response.Write query
AdoRs.open query, adoconn, adopenstatic, adlockreadonly
in_time = AdoRs("in_time")
out_time = AdoRs("out_time")
end if
AdoRs.close
%>
<form name='frm_neakeun_job' method='post' style='TEXT-ALIGN: left' >
<input type=hidden name='InTime' value = '<%=InTime%>'>
<input type=hidden name='OutTime' value = '<%=OutTime%>'>
<div align='left' >
<table border=1 cellpadding='0' cellspacing='0' width='1000' bordercolor='white' bordercolorlight='black'>
<tr height='50' >
<td colspan="7" align="center" bgcolor="#32A4FF">
<FONT color=#ffffff size=3>
오늘날짜(<%=condate%>) 기준으로 설정되어 있는 프로젝트, 업무내용을 선택 가능 합니다.<br>
(프로젝트 및 업무내용, 근무시작시간, 종료시간은 SV가 입력을 했어야만 나타납니다.<br>
근무시간을 입력 할때 0.25는 15분이고, 0.5는 30분, 0.75는 45분을 의미 합니다.<br>
예) 2.25는 2시간 15분 이고, 5.5는 5시간 30분이고, 4.75는 4시간 45분 입니다.
</font>
</td>
</tr>
<tr height='35' >
<td align="center" bgcolor="#32A4FF" style="width: 5%;"><FONT color=#ffffff size=2>대표SV<br />(선택X)</font></td>
<td align="center" bgcolor="#32A4FF" style="width: 15%;"><FONT color=#ffffff size=2>SV</font></td>
<td align="center" bgcolor="#32A4FF" style="width: 43%;"><FONT color=#ffffff size=2>프&nbsp;로&nbsp;젝&nbsp;트&nbsp;명</font></td>
<td align="center" bgcolor="#32A4FF" style="width: 13%;"><FONT color=#ffffff size=2>업무내용</font></td>
<td align="center" bgcolor="#32A4FF" style="width: 8%;"><FONT color=#ffffff size=2>근무시간</font></td>
<td align="center" bgcolor="#32A4FF" style="width: 7%;"><FONT color=#ffffff size=2>업무확인<br>유무</font></td>
<td align="center" bgcolor="#32A4FF" style="width: 7%;"><FONT color=#ffffff size=2>업무확인<br>SV</font></td>
</tr>
<%For i = 1 To Categori_Cnt%>
<tr height='25' >
<td align="center">
<input type="radio" value="<%=i %>" name="main_sv" <%if gap(i,11) <> "" and gap(i,11) = gap(i,10) then %> checked <%end if %> disabled="disabled"/>
</td>
<td align="center">
<select name="sv_list" style="font-size:10pt; width: 98%;height:23px;" onchange="svChange(this.value, '<%= i %>');">
<% if gap(i,7) = "Y" then %>
<option value="<%=gap(i,10) %>" selected><%=gap(i,9) %></option>
<% else %>
<option value=''>= 담당직원 선택 =</option>
<%for j=1 to ubound(sv_list) %>
<option value='<%=sv_list(j,2)%>' <%if gap(i,10) = sv_list(j,2) then %> selected <% end if %>><%=sv_list(j,1)%></option>
<% next %>
<% end if %>
</select>
<td align="center">
<select name="prj_code" style="font-size:10pt; width: 98%;height:23px;">
<% if gap(i,7) = "Y" then %>
<option value='<%=gap(i,1) %>' selected>[<%=gap(i,1) %>]<%=gap(i,0) %></option>
<% else %>
<option value=''>= 프로젝트 선택 =</option>
<%
if gap(i,10) <> "" then
'##### 실사 미완료 프로젝트
Query = " select p_child_sn, p_subject from dbo.T_PROJECT_METHOD "&VbCrlf
Query = Query & " where convert(int,left(p_child_sn,2))>=16 "&VbCrlf
Query = Query & " and (p_field_complete is null or p_dp_complete is null) and p_progress_status >= '006' "&VbCrlf '-- 실사완료(1), 미완료(null)
Query = Query & " and "&VbCrlf
Query = Query & " ':'+isnull(p_sv_1, '')+':'+isnull(p_sv_2, '')+':'+isnull(p_sv_3, '')+':'+isnull(p_sv_4, '')+"&VbCrlf
Query = Query & " ':'+isnull(p_punch_1, '')+':'+isnull(p_punch_2, '')+':'+isnull(p_punch_3, '')+':'+isnull(p_punch_4, '')+"&VbCrlf
Query = Query & " ':'+isnull(p_verify_1, '')+':'+isnull(p_verify_2, '')+':'+isnull(p_verify_3, '')+':'+isnull(p_verify_4, '')+"&VbCrlf
Query = Query & " ':'+isnull(p_code_1, '')+':'+isnull(p_code_2, '')+':'+isnull(p_code_3, '')+':'+isnull(p_code_4, '')+':' "&VbCrlf
Query = Query & " like ('%:" & gap(i,10) & ":%') "&VbCrlf
Query = Query & " order by p_child_sn asc, p_subject asc "&VbCrlf
'Response.write Query
AdoRs.open Query, adoconn, adopenstatic, adlockreadonly
tmp_chk = 0
If AdoRs.recordcount > 0 Then
Do while Not AdoRs.Eof
response.Write "<option value=""" & AdoRs("p_child_sn") & """ "
if gap(i,1) = AdoRs("p_child_sn") then
response.Write " selected "
tmp_chk = 1
end if
response.Write ">[" & AdoRs("p_child_sn") & "]" & AdoRs("p_subject") & "</option>"
AdoRs.movenext
Loop
End if
AdoRs.close
if tmp_chk = 0 then
%>
<option value="<%=gap(i,1) %>" selected>[<%=gap(i,1) %>]<%=gap(i,0) %></option>
<%
end if
end if
%>
<% end if %>
</select>
</td>
<td align="center">
<select name="prj_sebu" style="font-size:10pt; width:98%;height:23px;">
<%
if gap(i,7) = "Y" then
%>
<option value='<%=gap(i,12)%>@<%=gap(i,2)%>' selected><%=gap(i,2)%></option>
<%
else
%>
<option value=''>= 세부근무 선택 =</option>
<%
if gap(i,10) <> "" Then
If fnc_user_level("0", "내근직업무1", gap(i,10)) = "1" Then ' AS, 컨택, 해독원, 진행보조 (1,3,8,9) + 에디팅, 코딩, 펀치 (2,4,7) --> S.V ##### 2018-02-23 김종휘
'subQuery = " AND d_cost_code IN (1, 3/*, 8, 9*/) "
subQuery = " AND d_cost_code IN ('1', '2', '3', '7', '8', '9') "
ElseIf fnc_user_level("0", "내근직업무2", gap(i,10)) = "1" Then ' 에디팅, 펀치 (2,4,7) --> S.V ##### 2018-02-23 김종휘
subQuery = " AND d_cost_code IN ('2', '7') "
ElseIf fnc_user_level("0", "내근직업무3", gap(i,10)) = "1" Then ' 검증, 감청 (5,6) -->한진수, 내근직업무3(검증, 감청) ##### 2018-02-23 김종휘
subQuery = " AND d_cost_code IN ('5', '6') "
' gap(i,10) => (p_sv_no) 내근직 테이블
ElseIf fnc_user_level("0", "내근직업무4", gap(i,10)) = "1" Then ' 코딩 --> 김유경(DP), 내근직업부4(코딩) ##### 2018-02-23 김종휘
subQuery = " AND d_cost_code IN ('4') "
End if
'##### IF문 걷어내고, 내근직 업무내용 별 담당 직원 구분 2018-02-23 김종휘
Query = " SELECT d_cost_code, d_cost_name FROM direct_costcode "&VbCrlf
Query = Query & " WHERE d_cost_kind in ('field','dp') AND d_cost_useyn = 'Y' AND d_cost_parents = '2' "
Query = Query & " " & subQuery&VbCrlf
Query = Query & " ORDER BY attribute01 "&VbCrlf
'Response.Write Query
AdoRs.open Query, adoconn, adopenstatic, adlockreadonly
tmp_chk = 0
Do while Not AdoRs.Eof
if Cint(gap(i,12)) = Cint(AdoRs("d_cost_code")) then
response.Write "<option value=""" & AdoRs("d_cost_code") & "@" & AdoRs("d_cost_name") & """ "
response.Write " selected "
response.Write ">" & AdoRs("d_cost_name") & "</option>"
tmp_chk = 1
Else
response.Write "<option value=""" & AdoRs("d_cost_code") & "@" & AdoRs("d_cost_name") & """ "
response.Write ">" & AdoRs("d_cost_name") & "</option>"
end if
AdoRs.MoveNext
Loop
AdoRs.Close
End if
end if
%>
</select>
</td>
<td align='center' style="letter-spacing:-2px;font-size:12px;">
<input size=4 maxlength=5 value='<%=gap(i,3)%>' <% if gap(i,7) = "Y" then %> readonly <% end if %> style='width:50px; text-align:center;' OnKeyPress='onlyNum();' name='txtInTime'/>
<!--<font color="red">야간</font> : <input size=4 maxlength=4 value='<%=gap(i,6)%>' <% if gap(i,7) = "Y" then %> readonly <% end if %> style='width:50px;' OnKeyPress='onlyNum();' name='txtOutTime'/>-->
<!--<input type="hidden" value='<%=gap(i,6)%>' name='txtOutTime'/>-->
<input type="hidden" value='<%=gap(i,7)%>' name='job_confirm_yn'/>
</td>
<td align='center'><font size="2"><%=gap(i,7)%></font></td>
<td align='center'><font size="2"><%=gap(i,8)%></font></td>
</tr>
<% next %>
<tr height=30>
<td colspan=3 rowspan=2 align="center" bgcolor="#32A4FF"><FONT color=#ffffff size=2>합&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;계</font></td>
<td colspan=4 align="center" bgcolor="#32A4FF">근무인정시간 : <input type="text" name="txtInputTime" style="text-align:center;" size= "2" value='' readonly>
<!-- , <font color="red"><b>야간</b></font> : <input type="text" name="txtOutputTime" size= "2" value='' readonly>-->
</td>
</tr>
<tr height=30>
<td align="center" bgcolor="#32A4FF"><input type="checkbox" name="lunch" value="" disabled>중식<input type="hidden" name="lunch_flag" value='' /></td>
<!-- <td align="center" bgcolor="#32A4FF"><input type="checkbox" name="dinner" value="" disabled>석식<input type="hidden" name="dinner_flag" value='' /></td>-->
<td colspan=3 align="center" bgcolor="#32A4FF">
<input type="text" name="txtInTimeSum" size= "2" style="color:blue; text-align:center;" value = '<%=gap(0,3)%>' readonly />
<!-- <input type="text" name="txtOutTimeSum" size= "2" style="color:red;" value = '<%=gap(0,6)%>' readonly />-->
<input type="hidden" name="txtStartTime" value = '<%=work_start_time %>' />
<input type="hidden" name="txtEndTime" value = '<%=work_end_time %>' />
</td>
</tr>
</table>
<table border=0 cellpadding='0' cellspacing='0' width='1000' bordercolor='white' bordercolorlight='black'>
<tr height="30px">
<td width=150 align="center" bgcolor="#32A4FF">
<font color=blue><b>일자</b></font><input size=8 maxlength=4 name=Condate readonly value ="<%=Condate%>">
</td>
<td width=150 align="center" bgcolor="#32A4FF">
<font color=blue><b>출근시각</b></font><input size=4 maxlength=4 name=in_time <% if permanent_position <> "True" then %> readonly <% end if %> value ="<%=In_Time%>">
</td>
<td width=150 align="center" bgcolor="#32A4FF">
<font color=blue><b>퇴근시각</b></font><input size=4 maxlength=4 name=out_time <% if permanent_position <> "True" then %>readonly <% end if %> value ="<%=Out_Time%>">
</td>
<td align="center" bgcolor="#32A4FF" <% If job_confirm_yn = "Y" Then %> style="display:none;" <% End If %>>
<% if permanent_position = "True" then %>
<input type="button" value="출퇴근 시간 수정" onclick="work_time_change()" style="width: 120px; cursor:pointer;vertical-align:middle;" />
<% end if %>
</td>
<td align="center" bgcolor="#32A4FF" <% If job_confirm_yn = "Y" Then %> style="display:none;" <% End If %>>
<INPUT type="button" value="<%=neakeun_name%>님의 <%=Condate%>일 일지내용 삭제" onclick='go_delete("<%=neakeun_name%>","<%=Condate%>");' style="width:260px;cursor:pointer;vertical-align:middle;">
&nbsp;
</td>
<td width=150 align="center" bgcolor="#32A4FF">
<img src='/images/nk/저장.gif' title = '내근일지 저장' onclick="javascript:Sendit()" style="cursor:pointer;vertical-align:middle;">
</td>
</tr>
</table>
<input type='hidden' name='permanent_position' value='<%=permanent_position%>' />
<input type='hidden' name='txtyoilvalue' value='<%=yoilvalue%>' />
<input type='hidden' name='txtyoil' value='<%=yoil%>' />
<input type='hidden' name='txtDate' value='<%=condate%>' />
<input type='hidden' name='neakeun_jumin' value='<%=neakeun_jumin%>' />
<input type='hidden' name='neakeun_name' value='<%=neakeun_name%>' />
<input type="hidden" name="neakeun_id" id="neakeun_id" value="<%=neakeun_id %>" />
</div>
</form>
<% End if %>
<%If permanent_position = "True" then %>
<div style='margin-top:1%;'>
<button type="button" name="sv_input" id="sv_input" onclick="javascript:sv_insert();">출근/퇴근 입력(S/V용)</button>
</div>
<%End If %>
</body>
</html>
<% %>
<script type="text/javascript">
function sv_insert()
{
var n_name = $("input[name=neakeun_name]").val();
var n_jumin = $("input[name=neakeun_jumin]").val();
var n_date = $("input[name=condate]").val();
var n_yoil = $("input[name=yoil]").val();
var n_intime = "<%=InTime %>";
var n_outtime = "<%=OutTime %>";
var url = "sv_work_insert.asp?neakeun_name=" + n_name + "&neakeun_jumin=" + n_jumin + "&txtDate=" + n_date + "&txtyoil=" + n_yoil + "&in_time=" + n_intime + "&out_time=" + n_outtime;
if(n_name == "")
{
alert("내근직/면접원 이름을 우선 조회하여 주십시오.");
return false;
}
window.open(url,"", "left=0, top=5, width=500, height=300, scrollbars=yes, statbar=no");
}
</script>