Files
KIN/other/rent_device_status.asp
2025-09-29 17:55:08 +09:00

337 lines
17 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. 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" -->
<!-- #include virtual = "include/left.asp" -->
<%
Dim query, p_no
p_no = session("User_Number")
%>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<style>
input[type=button]{
cursor:pointer;
}
.reg_device_btn{
font-weight: bold;
font-size: 12px;
}
.reg_device_btn.act{
color:#fff;
background-color:#000;
}
.ret_device_btn{
font-weight: bold;
font-size: 12px;
}
#device_status{
width:100%;
border-collapse: collapse;
}
#device_status > tbody > tr > td{
text-align:center;
line-height: 20px;
white-space: nowrap;
vertical-align:middle;
}
#device_status > tbody > tr:first-child > td{
text-align:center;
font-weight:bold;
padding:4px;
}
#device_status > tbody > tr:nth-child(n+2) > td:nth-child(4){
text-align:left;
}
#device_status > tbody > tr:nth-child(n+2) > td:nth-child(4) span{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 360px;
display: inline-block;
vertical-align:middle;
}
#deviceModDialog table tr td {
padding:4px;
}
#deviceModDialog table tr td:first-child {
text-align:center;
}
#regPrjDialog table tr td {
padding:2px;
text-align:center;
}
#regPrjDialog table tr:nth-child(n+2) td:nth-child(2) {
text-align:left;
}
</style>
<!-- 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">
<div>
<%
dim chk_user
query = ""
query = query & " SELECT NO, ID, T_RENT_DEVICE_MODEL, T_RENT_DEVICE_NUM, DEVICE_INFO, DEVICE_ETC, P_CHILD_SN, P_SUBJECT, "
query = query & " USE_ST_DT, USE_ED_DT, INSERT_USER, INSERT_USER_NAME, "
query = query & " (SELECT COUNT(*) FROM project2.dbo.T_RENT_USE WHERE USE_YN = 'N' AND RENT_DEVICE_ID = VDS.ID) AS LOG_CNT "
query = query & " FROM project2.dbo.V_RENT_STATUS VDS "
query = query & " order by T_RENT_DEVICE_MODEL asc , convert(int,T_RENT_DEVICE_NUM) asc "
adors.open query, adoconn, adopenstatic, adlockreadonly
%>
<table id="device_status" class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td style="width:3%;">No</td>
<td style="width:10%;">Á¾·ù</td>
<td style="width:15%;">¼³¸í</td>
<td style="width:33%;">ÇÁ·ÎÁ§Æ®</td>
<td style="width:10%;">´ë¿©½ÃÀÛÀÏ</td>
<td style="width:10%;">¹Ý³³¿¹Á¤ÀÏ</td>
<td style="width:8%;">´ë¿© / ¹Ý³³</td>
<td style="width:7%;">´ë¿©½ÅûÀÚ</td>
<td style="width:4%;">±â·Ï</td>
</tr>
<%
Do While Not adors.Eof
chk_user = iif(adors("INSERT_USER") = cstr(session("User_Number")), true, false) ' insert_user¿Í ·Î±×ÀÎ À¯Àú°¡ °°À¸¸é true
%>
<tr style="height:36px;">
<td ><%=adors("NO")%><input type="hidden" value="<%=adors("ID")%>" name="DEVICE_ID"/></td>
<td ><% if adors("T_RENT_DEVICE_NUM") <> "" then %><%=adors("T_RENT_DEVICE_NUM")%>¹ø <% end if %><%=adors("T_RENT_DEVICE_MODEL")%></td>
<td ><%=adors("DEVICE_INFO")%></td>
<td ><span><%=iif(adors("P_CHILD_SN") = "", "", "[" & adors("P_CHILD_SN") & "] ")%><%=adors("P_SUBJECT")%></span></td>
<td ><%=adors("USE_ST_DT")%></td>
<td ><%=adors("USE_ED_DT")%></td>
<td ><%
if adors("P_CHILD_SN") <> "" Then
if chk_user = true Then
%>
<input type="button" value="¹Ý³³" class="ret_device_btn" data-device_id="<%=adors("ID")%>"/><%
End if
else
%>
<input type="button" value="´ë¿©" class="reg_device_btn" />
<%
end if
%></td>
<td ><%=adors("INSERT_USER_NAME")%></td>
<td ><%
if cint(adors("LOG_CNT")) > 0 then
%><input type="button" value="¢¸" id="device_log" style="cursor:pointer;margin:0;padding:1px 10px;border:0;background:rgba(255,255,255,0);" data-rowinf="<%=adoRs("ID")%>"/><%
end if
%></td>
</tr>
<%
adors.MoveNext
Loop
%>
</table>
</div>
<%
adors.close
%>
<div id="regPrjDialog">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td style="width:8%">ÇÁ·ÎÁ§Æ® ÄÚµå</td>
<td style="width:37%">ÇÁ·ÎÁ§Æ® ¸í</td>
<td style="width:15%">Á¶»ç¹æ¹ý</td>
<td style="width:15%">´ã´çºÎ¼­</td>
</tr>
<%
Query = " SELECT p_child_sn, p_subject, p_method_nm, p_intention, ISNULL(D.T_name, '') as d_name "
Query = Query & " FROM V_PROJECT_METHOD VPM LEFT OUTER JOIN v_Department D "
Query = Query & " ON VPM.p_rsch_dept = D.before_t_cd1 "
Query = Query & " WHERE ISNULL(p_child_sn, '') <> '' "
Query = Query & " AND p_progress_status >= '006' "
Query = Query & " AND (p_research_complete + p_field_complete + p_dp_complete) IS NULL "
Query = Query & " AND ( "
Query = Query & " p_rsch_1_a = '" & p_no & "' OR p_rsch_2_a = '" & p_no & "' OR p_rsch_3_a = '" & p_no & "' OR p_rsch_4_a = '" & p_no & "' OR "
Query = Query & " p_rsch_1_b = '" & p_no & "' OR p_rsch_2_b = '" & p_no & "' OR p_rsch_3_b = '" & p_no & "' OR p_rsch_4_b = '" & p_no & "' OR "
Query = Query & " p_rsch_1_c = '" & p_no & "' OR p_rsch_2_c = '" & p_no & "' OR p_rsch_3_c = '" & p_no & "' OR p_rsch_4_c = '" & p_no & "' OR "
Query = Query & " p_sv_1 = '" & p_no & "' OR p_sv_2 = '" & p_no & "' OR p_sv_3 = '" & p_no & "' OR p_sv_4 = '" & p_no & "' OR "
Query = Query & " p_code_1 = '" & p_no & "' OR p_code_2 = '" & p_no & "' OR p_code_3 = '" & p_no & "' OR p_code_4 = '" & p_no & "' OR "
Query = Query & " p_verify_1 = '" & p_no & "' OR p_verify_2 = '" & p_no & "' OR p_verify_3 = '" & p_no & "' OR p_verify_4 = '" & p_no & "' OR "
Query = Query & " p_dp_1 = '" & p_no & "' OR p_dp_2 = '" & p_no & "' OR p_dp_3 = '" & p_no & "' OR p_dp_4 = '" & p_no & "' OR "
Query = Query & " p_it_1 = '" & p_no & "' OR p_it_2 = '" & p_no & "' OR p_it_3 = '" & p_no & "' OR p_it_4 = '" & p_no & "' OR "
Query = Query & " p_supp_1 = '" & p_no & "' OR p_supp_2 = '" & p_no & "' OR p_supp_3 = '" & p_no & "' OR p_supp_4 = '" & p_no & "' "
Query = Query & " ) "
Query = Query & " ORDER BY p_child_sn "
Rs.Open Query, adoConn, 1
for i = 1 to Rs.RecordCount
%>
<tr>
<td ><%=Rs("p_child_sn")%></td>
<td ><a href="javascript:selectPrj('<%=Rs("p_child_sn")%>','<%=Rs("p_subject")%>')"><%=Rs("p_subject")%></a></td>
<td ><%=Rs("p_method_nm")%></td>
<td ><%=Rs("d_name")%></td>
</tr>
<%
Rs.MoveNext
next
Rs.Close
%>
<tr>
<td colspan="4">±âŸ : <input type='text' id='etc_prj' value='' /> <a href="javascript:selectPrj('etc_prj','')">¼±ÅÃ</a></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
$.ui.dialog.prototype._focusTabbable = $.noop;
$(function(){
regPrjDialog = $("#regPrjDialog").dialog({
autoOpen: false,
modal: true,
resizable: false,
height: 600,
width: 800,
title: 'ÇÁ·ÎÁ§Æ® ¼±ÅÃ',
close: function(){
$("#etc_prj").val("");
}
});
$(".reg_device_btn").on("click", function(){
var parentTr = $(this).parents("tr").eq(0);
if($(this).hasClass("act")){
if($("#reg_p_child_sn").val() == "" && $("#use_st_dt").val() == "" && $("#use_ed_dt").val() == ""){
$(this).removeClass("act");
parentTr.children("td").eq(3).html('');
parentTr.children("td").eq(4).html('');
parentTr.children("td").eq(5).html('');
return;
}
if($("#reg_p_child_sn").val() == ""){
alert("ÇÁ·ÎÁ§Æ®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
return;
}
if($("#use_st_dt").val() == "" || $("#use_ed_dt").val() == ""){
alert("´ë¿©±â°£À» ¼±ÅÃÇØÁÖ¼¼¿ä.");
return;
}
if($("#use_st_dt").val() > $("#use_ed_dt").val()){
alert("´ë¿©±â°£ ½ÃÀÛÀÏÀÌ\nÁ¾·áÀϺ¸´Ù À۾ƾßÇÕ´Ï´Ù.");
return;
}
if(confirm("´ë¿© µî·ÏÇϽðڽÀ´Ï±î?")){
$.ajax({
url: './rent_device_reg.asp',
type: 'POST',
data: {
'p_child_sn' : encodeURIComponent($("#reg_p_child_sn").val()),
'use_st_dt' : $("#use_st_dt").val(),
'use_ed_dt' : $("#use_ed_dt").val(),
'use_device_id' : parentTr.find("input[name='DEVICE_ID']").val()
},
success: function(result){
if(result == "1"){ // ¼º°ø
$(this).removeClass("act");
location.reload();
}else{
alert("Web Service Error !!");
}
}
});
}
}else{
if($(".act").length > 0){
$(".act").parents("tr").eq(0).children("td").eq(3).html("");
$(".act").parents("tr").eq(0).children("td").eq(4).html("");
$(".act").parents("tr").eq(0).children("td").eq(5).html("");
$(".act").removeClass("act");
}
parentTr.children("td").eq(3).html('<input type="hidden" id="reg_p_child_sn" />'+
'<input type="text" id="reg_p_subject" class="project_search" style="cursor:pointer; width:100%;" '+
'palceHolder="ÇÁ·ÎÁ§Æ®¸¦ ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä" readonly/>');
parentTr.children("td").eq(4).html('<input type="text" id="use_st_dt" style="cursor:pointer; width:100px;text-align:center;" readonly/>');
parentTr.children("td").eq(5).html('<input type="text" id="use_ed_dt" style="cursor:pointer; width:100px;text-align:center;" readonly/>');
$(this).addClass("act");
$("#use_st_dt").datepicker();
$("#use_ed_dt").datepicker();
$(".project_search").click(function(){
regPrjDialog.dialog("open");
});
}
});
$(".ret_device_btn").click(function () {
if(confirm("¹Ý³³Ã³¸®ÇϰڽÀ´Ï±î?")){
$.ajax({
url: './rent_device_return.asp',
data: {
'device_id' : $(this).data("device_id")
},
success: function(result){
if(result == "1"){ // ¼º°ø
location.reload();
}else{
alert("Web Service Error !!");
}
}
});
}
});
$("input[id=device_log]").click(function (){
var obj = $(this);
if(obj.val() == "¡å"){
obj.val("¢¸");
obj.parent().parent().next("tr").remove();
}else{
var device_id = $(this).data("rowinf")
$.ajax({
url: './rent_device_log.asp',
data: {
'device_id' : device_id
},
success: function(result){
if(result != ""){
obj.parent().parent().after("<tr><td colspan='" + obj.parent().parent().find("td").length + "' align='right'>" + result + "</td></tr>");
obj.val("¡å");
}else{
alert("Web Service Error !!");
}
}
});
}
});
});
function selectPrj(p_child_sn, p_subject){
if(p_child_sn == 'etc_prj'){
$("#reg_p_child_sn").val($("#etc_prj").val());
$("#reg_p_subject").val("["+$("#etc_prj").val()+"]"+p_subject);
}else{
$("#reg_p_child_sn").val(p_child_sn);
$("#reg_p_subject").val("["+p_child_sn+"]"+p_subject);
}
regPrjDialog.dialog("close");
}
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->