260424_02_ENH: 관리 사이트 엑셀 파일 업로드로 지원자 추가/수정, 투표소 배정/해제 추가
This commit is contained in:
@@ -12,41 +12,71 @@ select case gubun
|
||||
|
||||
case "List"
|
||||
|
||||
DBConnect()
|
||||
DBConnect()
|
||||
|
||||
SQL = ""
|
||||
SQL = SQL&" select a.*, case isnull(b.Status,'') when '1' then '진행중' when '11' then '수정가능' when '10' then '완료' else '미진행' end as status from [No.6].krc_survey.dbo.Dat_2002020_B_exit a "&VbCrlf
|
||||
SQL = SQL&" left join [No.6].krc_survey.dbo.Dat_2002020_B b on a.id=case when CHARINDEX('_', b.IDKey)<>0 then LEFT(b.IDKey, CHARINDEX('_', b.IDKey)-1) end where a.flag='1' "&VbCrlf
|
||||
'response.write SQL
|
||||
Objdb.Open SQL,DBConn,3,1,1
|
||||
If not objdb.eof Then
|
||||
while not objdb.eof
|
||||
response.write "<tr>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q1")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("cluster_nm")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q4")&"<input type='hidden' name='E_No' value='"&objdb("ID")&"'/></td>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q3")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q10")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("pre_name")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("pre_phone")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("status")&"</td>"&VbCrlf
|
||||
response.write "</tr>"&VbCrlf
|
||||
objdb.movenext
|
||||
wend
|
||||
End If
|
||||
SQL = ""
|
||||
SQL = SQL&" select a.*, case isnull(b.Status,'') when '1' then '진행중' when '11' then '수정가능' when '10' then '완료' else '미진행' end as status from [No.6].krc_survey.dbo.Dat_2002020_B_exit a "&VbCrlf
|
||||
SQL = SQL&" left join [No.6].krc_survey.dbo.Dat_2002020_B b on a.id=case when CHARINDEX('_', b.IDKey)<>0 then LEFT(b.IDKey, CHARINDEX('_', b.IDKey)-1) end where a.flag='1' "&VbCrlf
|
||||
'response.write SQL
|
||||
Objdb.Open SQL,DBConn,3,1,1
|
||||
If not objdb.eof Then
|
||||
while not objdb.eof
|
||||
response.write "<tr>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q1")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("cluster_nm")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q4")&"<input type='hidden' name='E_No' value='"&objdb("ID")&"'/></td>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q3")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("Q10")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("pre_name")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("pre_phone")&"</td>"&VbCrlf
|
||||
response.write " <td>"&objdb("status")&"</td>"&VbCrlf
|
||||
response.write "</tr>"&VbCrlf
|
||||
objdb.movenext
|
||||
wend
|
||||
End If
|
||||
|
||||
DBClose()
|
||||
DBClose()
|
||||
|
||||
case "json_list"
|
||||
DBConnect()
|
||||
|
||||
SQL = ""
|
||||
SQL = SQL & " SELECT e_subarea_cd " & VbCrlf
|
||||
SQL = SQL & " ,e_subarea_nm " & VbCrlf
|
||||
SQL = SQL & " ,e_exit_cd " & VbCrlf
|
||||
SQL = SQL & " ,e_full_it " & VbCrlf
|
||||
SQL = SQL & " ,e_it " & VbCrlf
|
||||
SQL = SQL & " ,ex_cd " & VbCrlf
|
||||
SQL = SQL & " ,cluster " & VbCrlf
|
||||
SQL = SQL & " ,e_exit_nm " & VbCrlf
|
||||
SQL = SQL & " ,e_full_nm " & VbCrlf
|
||||
SQL = SQL & " ,e_full_ad " & VbCrlf
|
||||
SQL = SQL & " FROM exitpoll.dbo.R_Exit " & VbCrlf
|
||||
SQL = SQL & " WHERE Flag = 1 " & VbCrlf
|
||||
SQL = SQL & " FOR JSON PATH " & VbCrlf
|
||||
|
||||
Objdb.Open SQL,DBConn
|
||||
If Not Objdb.EOF Then
|
||||
Do While Not Objdb.EOF
|
||||
Response.Write Objdb(0)
|
||||
Objdb.MoveNext
|
||||
Loop
|
||||
Else
|
||||
Response.Write "[]"
|
||||
End If
|
||||
|
||||
DBClose()
|
||||
|
||||
case "confirm"
|
||||
|
||||
If IDKey <> "" Then
|
||||
SQL = "Update krc_survey.dbo.dat_2002020_B set status='10' where Idkey= '"&IDKEY&"'"
|
||||
flag = ExecuteSQL1(SQL)
|
||||
Else
|
||||
flag = false
|
||||
End If
|
||||
If IDKey <> "" Then
|
||||
SQL = "Update krc_survey.dbo.dat_2002020_B set status='10' where Idkey= '"&IDKEY&"'"
|
||||
flag = ExecuteSQL1(SQL)
|
||||
Else
|
||||
flag = false
|
||||
End If
|
||||
|
||||
response.write flag
|
||||
response.write flag
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Dim SQL, Objdb
|
||||
Dim sel_gubun : sel_gubun = Request("sel_gubun")
|
||||
set Objdb = Server.CreateObject("ADODB.Recordset")
|
||||
Dim sel_code : sel_code = Request("sel_code")
|
||||
Dim r_phone : r_phone = Request("r_phone")
|
||||
|
||||
if sel_code = "edu" Then
|
||||
sel_gubun = "edu"
|
||||
@@ -29,7 +30,36 @@ case "code"
|
||||
End If
|
||||
|
||||
DBClose()
|
||||
case "upload_use_code"
|
||||
DBConnect()
|
||||
SQL = ""
|
||||
SQL = SQL & " SELECT gubun, r_cd, r_nm " & vbCrLf
|
||||
SQL = SQL & " FROM [exitpoll].[dbo].[R_code] " & vbCrLf
|
||||
SQL = SQL & " WHERE Flag = 1 AND gubun in ('area','district','position') " & vbCrLf
|
||||
SQL = SQL & " ORDER BY gubun, r_cd " & vbCrLf
|
||||
SQL = SQL & " FOR JSON PATH "
|
||||
|
||||
Objdb.Open SQL,DBConn
|
||||
If Not Objdb.EOF Then
|
||||
Do While Not Objdb.EOF
|
||||
Response.Write Objdb(0)
|
||||
Objdb.MoveNext
|
||||
Loop
|
||||
Else
|
||||
Response.Write "[]"
|
||||
End If
|
||||
|
||||
DBClose()
|
||||
case "phone_exist"
|
||||
DBConnect()
|
||||
SQL = " SELECT 1 FROM exitpoll.dbo.R_info WHERE r_phone = dbo.base64_encode('" & r_phone & "') And flag = 1"
|
||||
Objdb.Open SQL,DBConn,3,1,1
|
||||
if not Objdb.eof Then
|
||||
response.write "EXIST"
|
||||
ELSE
|
||||
response.write "NOT EXIST"
|
||||
End If
|
||||
DBClose()
|
||||
case "edu"
|
||||
Response.Write "<option value=''>선택</option>"
|
||||
DBConnect()
|
||||
|
||||
38
AdminPoll/Ajax/DeployEdit.asp
Normal file
38
AdminPoll/Ajax/DeployEdit.asp
Normal file
@@ -0,0 +1,38 @@
|
||||
<!--#include Virtual="/Lib/config.asp" -->
|
||||
<%
|
||||
Dim SQL, Objdb
|
||||
Dim gubun : gubun = Request("gubun")
|
||||
set Objdb = Server.CreateObject("ADODB.Recordset")
|
||||
Dim r_phone : r_phone = Request("r_phone")
|
||||
Dim exit_cd : exit_cd = Trim(Request("exit_cd"))
|
||||
|
||||
|
||||
Dim flag
|
||||
|
||||
if gubun = "insert" then
|
||||
SQL = ""
|
||||
SQL = SQL & " Delete " & VbcRlf
|
||||
SQL = SQL & " FROM exitpoll.dbo.R_Deploy " & VbcRlf
|
||||
SQL = SQL & " where dbo.base64_decode(r_phone) = '" & r_phone & "' And exit_cd = '" & exit_cd & "'" & VbcRlf
|
||||
ExecuteSQL(SQL)
|
||||
|
||||
SQL = ""
|
||||
SQL = SQL &" insert into exitpoll.dbo.R_Deploy ( r_phone, exit_cd) " & VbcRlf
|
||||
SQL = SQL &" values ( " & VbcRlf
|
||||
SQL = SQL &" dbo.base64_encode('" & r_phone & "'), " & VbcRlf
|
||||
SQL = SQL &" '" & exit_cd & "' " & VbcRlf
|
||||
SQL = SQL &" ) " & VbcRlf
|
||||
flag = ExecuteSQL(SQL)
|
||||
End If
|
||||
|
||||
If gubun = "delete" Then
|
||||
SQL = ""
|
||||
SQL = SQL & " Delete from R_Deploy where dbo.base64_decode(r_phone) = '" & r_phone & "' And exit_cd = '" & exit_cd & "'" & VbcRlf
|
||||
flag = ExecuteSQL(SQL)
|
||||
End If
|
||||
|
||||
|
||||
if flag = True Then
|
||||
response.write "1"
|
||||
End If
|
||||
%>
|
||||
@@ -4,6 +4,7 @@ Dim SQL, Objdb
|
||||
Dim gubun : gubun = Request("gubun")
|
||||
set Objdb = Server.CreateObject("ADODB.Recordset")
|
||||
Dim r_phone : r_phone = Request("r_phone")
|
||||
Dim r_name : r_name = Trim(Request("r_name"))
|
||||
Dim r_position : r_position = Trim(Request("r_position"))
|
||||
Dim r_area : r_area = Request("r_area")
|
||||
Dim r_district : r_district = Request("r_district")
|
||||
@@ -11,15 +12,41 @@ Dim r_edu : r_edu = Trim(Request("r_edu"))
|
||||
|
||||
Dim flag
|
||||
|
||||
if gubun = "insert" then
|
||||
SQL = ""
|
||||
SQL = SQL &" insert into exitpoll.dbo.R_Info (r_name, r_phone, r_pass, r_area, r_district, r_position, r_job, chk) " & VbcRlf
|
||||
SQL = SQL &" values ( " & VbcRlf
|
||||
SQL = SQL &" '" & r_name & "', " & VbcRlf
|
||||
SQL = SQL &" dbo.base64_encode('" & r_phone & "'), " & VbcRlf
|
||||
SQL = SQL &" dbo.base64_encode('" & r_phone & "'), " & VbcRlf
|
||||
SQL = SQL &" '" & r_area & "', " & VbcRlf
|
||||
SQL = SQL &" '" & r_district & "', " & VbcRlf
|
||||
SQL = SQL &" '" & r_position & "', " & VbcRlf
|
||||
SQL = SQL &" '1', " & VbcRlf
|
||||
SQL = SQL &" '0' " & VbcRlf
|
||||
SQL = SQL &" ) " & VbcRlf
|
||||
|
||||
flag = ExecuteSQL(SQL)
|
||||
End If
|
||||
|
||||
if gubun = "update" Then
|
||||
SQL = ""
|
||||
SQL = SQL &" Update exitpoll.dbo.R_Info set "&VbcRlf
|
||||
SQL = SQL &" r_position = '"&r_position&"', "&VbcRlf
|
||||
SQL = SQL &" r_area = '"&r_area&"', "&VbcRlf
|
||||
If r_district <> "" Then
|
||||
If r_name <> "NULL" Then
|
||||
SQL = SQL &" r_name = '"&r_name&"', "&VbcRlf
|
||||
End If
|
||||
If r_position <> "NULL" Then
|
||||
SQL = SQL &" r_position = '"&r_position&"', "&VbcRlf
|
||||
End If
|
||||
If r_area <> "NULL" Then
|
||||
SQL = SQL &" r_area = '"&r_area&"', "&VbcRlf
|
||||
End If
|
||||
If r_district <> "" OR r_district <> "NULL" Then
|
||||
SQL = SQL &" r_district = '"&r_district&"', "&VbcRlf
|
||||
End If
|
||||
SQL = SQL &" r_edu = '"&r_edu&"', "&VbcRlf
|
||||
If r_edu <> "NULL" Then
|
||||
SQL = SQL &" r_edu = '"&r_edu&"', "&VbcRlf
|
||||
End If
|
||||
SQL = SQL &" Udate = getDate() "&VbcRlf
|
||||
SQL = SQL &" where dbo.base64_decode(r_phone) = '"&r_phone&"'; "&VbcRlf
|
||||
flag = ExecuteSQL(SQL)
|
||||
|
||||
Reference in New Issue
Block a user