202 lines
7.4 KiB
Plaintext
202 lines
7.4 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<%
|
|
dim Query
|
|
dim i, j
|
|
dim user_name(4) '현재 사용자,0:사원코드, 1:이름,2:직급,3:전화번호, 4:부서코드(명)
|
|
dim title
|
|
dim Company(6)
|
|
|
|
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) & "'"
|
|
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
|
|
%>
|
|
<link rel="stylesheet" href="//cdn.rawgit.com/fgelinas/timepicker/master/jquery.ui.timepicker.css">
|
|
<script src='//cdn.rawgit.com/fgelinas/timepicker/master/jquery.ui.timepicker.js'></script>
|
|
<style>
|
|
.ui-timepicker { font-size: 12px; width: auto; }
|
|
.ui-timepicker-table td a{ width: auto; }
|
|
</style>
|
|
<!-- 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">
|
|
<form method='post' name='frm_in_out_time'>
|
|
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:1000px;" >
|
|
<tr>
|
|
<td>
|
|
출퇴근보고서 작성페이지입니다.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<table class="table table-sm table-sm2 table-bordered table-head">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center" rowspan="2">일자</th>
|
|
<th class="text-center" colspan="2">시스템상</th>
|
|
<th class="text-center" rowspan="2">보고사유</th>
|
|
<th class="text-center" rowspan="2">출근조정시각</th>
|
|
<th class="text-center" rowspan="2">퇴근조정시각</th>
|
|
<th class="text-center" rowspan="2"> </th>
|
|
</tr>
|
|
<tr>
|
|
<th class="text-center">출근</th>
|
|
<th class="text-center">퇴근</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for i=1 To 5 %>
|
|
<tr>
|
|
<td><input type="text" class="form-control text-center selectDate" readonly name="txt_date_<%=i%>" value="" style="cursor:pointer;"/></td>
|
|
<td><input type="text" class="form-control text-center" readonly name="txt_in_time_1_<%=i%>" value="" /></td>
|
|
<td><input type="text" class="form-control text-center" readonly name="txt_out_time_1_<%=i%>" value="" /></td>
|
|
<td style="width:400px;"><input type="text" class="form-control" name="txt_reason_<%=i%>" value=""/></td>
|
|
<td><input type="text" class="form-control text-center selectTime" readonly name="txt_in_time_2_<%=i%>" value="" style="cursor:pointer;" /></td>
|
|
<td><input type="text" class="form-control text-center selectTime" readonly name="txt_out_time_2_<%=i%>" value="" style="cursor:pointer;" /></td>
|
|
<td><button type="button" class="btn btn-danger btn-sm" id="btn_delrow_<%=i%>" style="width:80px;">지우기</button></td>
|
|
</tr>
|
|
<% Next %>
|
|
</tbody>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-center">
|
|
<button type="button" class="btn btn-success" onclick="goPrint();">작성하기</button>
|
|
<button type="button" class="btn btn-info" onclick="history.back(-1);">취소하기</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
$(function(){
|
|
currentMenu("/approval/doc_select.asp", "");
|
|
|
|
$(".selectDate").datepicker({
|
|
onSelect: function() {
|
|
$(this).change();
|
|
}
|
|
});
|
|
|
|
$('.selectTime').timepicker();
|
|
|
|
$(".selectDate").on("change", function(){
|
|
var selDate = $(this).val();
|
|
var resultTime = {};
|
|
$.ajax({
|
|
url: "./doc_commute_ajax.asp",
|
|
type: "POST",
|
|
data: {"seldate":selDate},
|
|
async: false,
|
|
success: function(response, textStatus, jqXHR){
|
|
resultTime = JSON.parse(response);
|
|
},error:function(){
|
|
alert("Web Service Error.");
|
|
}
|
|
});
|
|
$(this).closest("tr").find("input[name^=txt_in_time_1_]").val(resultTime.inTime || "");
|
|
$(this).closest("tr").find("input[name^=txt_out_time_1_]").val(resultTime.outTime || "");
|
|
});
|
|
|
|
$("button[id^=btn_delrow_]").on("click", function(){
|
|
var rown = $(this).attr("id").split("_")[2];
|
|
$("input[name=txt_date_" + rown + "]").val("");
|
|
$("input[name=txt_in_time_1_" + rown + "]").val("");
|
|
$("input[name=txt_out_time_1_" + rown + "]").val("");
|
|
$("input[name=txt_reason_" + rown + "]").val("");
|
|
$("input[name=txt_in_time_2_" + rown + "]").val("");
|
|
$("input[name=txt_out_time_2_" + rown + "]").val("");
|
|
});
|
|
});
|
|
|
|
function goPrint(){
|
|
var chk = true;
|
|
var selDateChk = false;
|
|
$.each($("input[name^=txt_in_time_2_]"), function(i, ele){
|
|
var selDate = $("input[name=txt_date_"+(i+1)+"]").val();
|
|
var txt_in_time = $(ele).val();
|
|
var txt_out_time = $("input[name=txt_out_time_2_"+(i+1)+"]").val();
|
|
|
|
if(selDate != "" && (txt_in_time == "" || txt_out_time == "")){
|
|
alert("출근/퇴근 조정시각을 모두 입력해주세요.");
|
|
chk = false;
|
|
return false;
|
|
}
|
|
if(selDate == "" && (txt_in_time != "" || txt_out_time != "")){
|
|
alert("일자를 선택해주세요.");
|
|
chk = false;
|
|
return false;
|
|
}
|
|
|
|
var convInTime = +(txt_in_time.replace(":", "")) < 600 ? 2400 + (txt_in_time.replace(":", "")) : +(txt_in_time.replace(":", ""));
|
|
var convOutTime = +(txt_out_time.replace(":", "")) < 600 ? 2400 + (txt_out_time.replace(":", "")) : +(txt_out_time.replace(":", ""));
|
|
|
|
if(selDate != "" && convInTime > convOutTime){
|
|
alert("출근시간이 퇴근시간보다 늦습니다.");
|
|
chk = false;
|
|
return false;
|
|
}
|
|
|
|
if(selDate != "") selDateChk = true;
|
|
});
|
|
if(chk == false){
|
|
return false;
|
|
}
|
|
if(selDateChk == false){
|
|
alert("일자를 선택해주세요.");
|
|
return false;
|
|
}
|
|
var url = "doc_commute_print.asp?";
|
|
for(var i=1; i<=5; i++){
|
|
url += "txt_date_" + i + "=" + $("input[name=txt_date_" + i + "]").val() + "&";
|
|
url += "txt_in_time_1_" + i + "=" + $("input[name=txt_in_time_1_" + i + "]").val() + "&";
|
|
url += "txt_out_time_1_" + i + "=" + $("input[name=txt_out_time_1_" + i + "]").val() + "&";
|
|
url += "txt_reason_" + i + "=" + escape($("input[name=txt_reason_" + i + "]").val()) + "&";
|
|
url += "txt_in_time_2_" + i + "=" + $("input[name=txt_in_time_2_" + i + "]").val() + "&";
|
|
url += "txt_out_time_2_" + i + "=" + $("input[name=txt_out_time_2_" + i + "]").val() + "&";
|
|
}
|
|
url += "print_type=1";
|
|
|
|
window.open(url,"","left=50 ,top=0, menubar=no, location=no ,status=no ,toolbar=no ,width=740, height=860 ,scrollbars=yes ,resizable=yes");
|
|
}
|
|
</script>
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
<!-- #include virtual = "include/footer.asp" --> |