Files
poll-recruit/Recruit/main/MyPoll.asp
2025-10-01 09:29:34 +09:00

252 lines
8.5 KiB
Plaintext

<%
Dim eSQL, eObjdb
set eObjdb = Server.CreateObject("ADODB.Recordset")
DBConnect()
eSQL=""
eSQL=eSQL&" SELECT distinct dbo.codeLabel('position', RI.r_position, NULL) AS r_position, dbo.codeLabel('pay', RE.e_district_cd, RI.r_position) AS r_pay, "
eSQL=eSQL&" RD.exit_cd, RE.e_exit_nm, RE.e_full_nm, RE.e_full_ad, "
eSQL=eSQL&" isnull(RI2.r_name,'') as L_NAME, isnull(dbo.base64_decode(RI2.r_phone),'') as L_PHONE, case when RI2.r_position = 1 then '조장' when RI2.r_position = 4 then '감독관' else '' end as L_GRADE, "
eSQL=eSQL&" RE.e_assembly_place, RE.e_assembly_time, RE.e_stay_nm, RE.e_stay_tel, RE.e_stay_add, "
eSQL=eSQL&" case when RE.s_stay = 1 then '숙박' when RE.s_stay = 2 then '비숙박' else '미정' end as s_stay "
eSQL=eSQL&" FROM R_Info RI JOIN R_Deploy RD ON RI.r_phone = RD.r_phone "
eSQL=eSQL&" JOIN R_Exit RE ON RD.exit_cd = RE.e_full_it "
eSQL=eSQL&" LEFT JOIN (select IN_RI2.r_phone, IN_RI2.r_name, IN_RI2.r_position, RD2.exit_cd from R_Info IN_RI2 JOIN R_Deploy RD2 ON IN_RI2.r_phone = RD2.r_phone) RI2 on RI2.exit_cd=RD.exit_cd and RI2.r_position = case when ri.r_position = 1 then 4 else 1 end "
eSQL=eSQL&" WHERE dbo.base64_decode(RI.r_phone) = '" & Session("phone") & "' "
eObjdb.Open eSQL,DBConn,3,1,1
'exit_cd = eObjdb("exit_cd")
%>
<form class="form-horizontal" id="MyPoll">
<%
If eObjdb.RecordCount > 0 Then
%>
<style>
.modal.in{
padding-right: 0 !important;
}
.modal-dialog {
width: 100%;
max-width:1000px;
height: 100%;
padding: 0;
margin:0 auto;
}
.modal-content {
height: 100%;
overflow:auto;
}
.modal-header{
margin-bottom:-60px;
position:relative;
z-index:10;
}
.modal-body {
padding-top:70px;
height: 100%;
}
.modal-body .in-content{
border-width:0;
width:100%;height:100%;
overflow:auto;
}
</style>
<script>
$(function(){
$(".member_list").parent().parent().hide();
<%
Dim r_pos_value
Select Case eObjdb("r_position")
Case "감독관"
r_pos_value = "1,2,3"
Case "롱폼조사원"
r_pos_value = "4"
Case Else
r_pos_value = "2,3"
End Select
%>
<%if eObjdb("r_position") = "조장" Or eObjdb("r_position") = "감독관" Or eObjdb("r_position") = "롱폼조사원" then %>
$(".member_list").each(function(){
var memberListTb = $(this);
$(memberListTb).parent().parent().show();
var exit_cd = $(memberListTb).data("exitcd");
$.ajax({
url:"/Ajax/AjaxSelect.asp",
data:{
"sel_gubun": "member_list",
"Exit_cd": exit_cd,
"r_position": "<%=r_pos_value%>"
},
success:function(res){
if(res != ""){
$(memberListTb).children("tbody").append(res);
}
},
error:function(){
$("System Error");
}
});
});
<%End If%>
$(".ExitInfo").click(function(){
$(".modal-body").empty();
var exit_cd = $(this).data("exitcd")
$.ajax({
url:"ExitInfo.asp",
type:"POST",
data:{"Exit_cd":exit_cd},
success:function(res){
$(".modal-body").html(res);
$("#ExitModal").modal("show");
},
error:function(err){
alert("System Error");
return false;
}
});
});
});
</script>
<div class="modal fade" id="ExitModal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">투표소 정보</h4>
</div>
<div class="modal-body text-center"></div>
</div><!-- /.modal-content -->
</div>
</div>
<div class="form-group">
<label>직책</label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("r_position") %>
</div>
</div>
<hr/>
</div>
<!--
<div class="form-group">
<label>수당</label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("r_pay") %> 만원
</div>
</div>
<hr/>
</div>
-->
<%
Do while Not eObjdb.Eof
%>
<div class="form-group">
<label>투표소명 <button type="button" class="btn btn-info btn-sm ExitInfo" data-exitcd="<%=eObjdb("exit_cd")%>">사전답사 보고서 조회</button></label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("e_exit_nm") %>(<%=eObjdb("s_stay") %>)
</div>
</div>
<hr/>
</div>
<div class="form-group">
<label>투표소 건물명</label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("e_full_nm") %><br>
<small><%=eObjdb("e_full_ad") %></small>
</div>
</div>
<hr/>
</div>
<% IF eObjdb("r_position") <> "감독관" THEN %>
<div class="form-group">
<label>
<%
IF eObjdb("r_position") = "조원" THEN
response.write "조장"
ElseIF eObjdb("r_position") = "조장" THEN
response.write "감독관"
ElseIF eObjdb("r_position") = "롱폼조사원" THEN
response.write "조장"
END IF
%>
연락처</label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("L_NAME")%> - <a href='tel:<%=eObjdb("L_PHONE") %>'><%=eObjdb("L_PHONE") %></a>
</div>
</div>
<hr/>
</div>
<% END IF %>
<div class="form-group">
<label>배정 리스트</label>
<div class="input-group">
<table class="table table-responsiv member_list" data-exitcd="<%=eObjdb("exit_cd")%>" style="font-size: calc(11px + 0.2vw);">
<thead>
<tr>
<th>직책</th>
<th>이름</th>
<th>연락처</th>
<th>성별</th>
<th>거주시군</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<hr style="border-top: 2px solid #333;" />
</div>
<!--
<div class="form-group">
<label>집결지 정보</label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("e_assembly_place") %><br>
<%=eObjdb("e_assembly_time") %>
</div>
</div>
<hr/>
</div>
<div class="form-group">
<label>숙박소 정보</label>
<div class="input-group">
<div class="btn-group">
<%=eObjdb("e_stay_nm") %><br>
<a href="tel:<%=eObjdb("e_stay_tel") %>"><%=eObjdb("e_stay_tel") %></a><br>
<small><%=eObjdb("e_stay_add") %></small>
</div>
</div>
<hr/>
</div>
-->
<%
eObjdb.MoveNext
Loop
Else
%>
<div class="form-group divider">
<label class="control-label">배정 받은 투표소가 없습니다.</label>
</div>
<%
End IF
%>
</form>
<%
DBClose()
%>