% Dim SQL, Objdb, cSQL, cObjdb Dim sel_gubun : sel_gubun = Request("sel_gubun") set Objdb = Server.CreateObject("ADODB.Recordset") set cObjdb = Server.CreateObject("ADODB.Recordset") Dim exit_cd : exit_cd = request("Exit_cd") Dim sel_code : sel_code = Request("sel_code") if sel_code = "edu" Then sel_gubun = "edu" End If Select case sel_gubun case "login" Dim r_id : r_id = Request("r_id") Dim r_pw : r_pw = Request("r_pw") Session("name") = "" Session("phone") = "" Session("r_phone") = "" Session("position") = "" DBConnect() SQL = "" SQL = SQL&" select r_name, dbo.base64_decode(r_phone) phone, r_phone, r_position, Flag, chk as mobile_check "&VbCrlf SQL = SQL&" from exitpoll.dbo.R_info "&VbCrlf SQL = SQL&" where r_name = '"&r_id&"' and dbo.base64_decode(r_pass) = '"&r_pw&"' "&VbCrlf Objdb.Open SQL,DBConn,3,1,1 if not Objdb.eof Then IF objdb("mobile_check") = "0" Then Response.write "NotMobileCheck" ElseIf objdb("Flag") = "1" Then Session("name") = objdb("r_name") Session("phone") = objdb("phone") Session("r_phone") = objdb("r_phone") Session("position") = objdb("r_position") Response.Write "True" Else Response.write "X" End If Else Response.Write "False" End If DBClose() case "logout" call Logout() Response.Write "로그아웃 되었습니다." case "code" Response.Write "" DBConnect() SQL = " select gubun, r_cd, r_nm, Flag from exitpoll.dbo.R_code where Flag = '1' and gubun = '" & sel_code & "' " if sel_code = "district" Then if LEN(Request("area_cd")) > 2 then SQL = SQL & " and len(r_cd) > 4 and left(r_cd,4) = '" & Request("area_cd") & "' " else SQL = SQL & " and len(r_cd) < 5 and left(r_cd,2) = '" & Request("area_cd") & "' " end if End If Objdb.Open SQL,DBConn,3,1,1 if not Objdb.eof Then while not objdb.eof Response.Write "" objdb.movenext wend End If DBClose() case "edu" Response.Write "" DBConnect() SQL = "" SQL = SQL & " SELECT RE.eduCd, EduArea, EduDate, EduSpace, EduEtc1, Qu, ISNULL(RC.comp_cnt, 0) AS comp_cnt, " SQL = SQL & " CASE WHEN Qu - ISNULL(RC.comp_cnt, 0) < 0 THEN 0 ELSE Qu - ISNULL(RC.comp_cnt , 0) END AS req_cnt " SQL = SQL & " FROM exitpoll.dbo.R_Edu RE " SQL = SQL & " LEFT JOIN ( " SQL = SQL & " SELECT r_edu, count(*) AS comp_cnt " SQL = SQL & " FROM exitpoll.dbo.R_Info " SQL = SQL & " WHERE flag = 1 AND ISNULL(r_edu, '') <> '' " SQL = SQL & " GROUP BY r_edu " SQL = SQL & " ) RC ON RE.EduCd = RC.r_edu " SQL = SQL & " WHERE RE.Flag = 1 AND eduNm = '교육' " SQL = SQL & " And EduArea like '%" & Request("area_cd") & "%' " Objdb.Open SQL,DBConn,3,1,1 if not Objdb.eof Then while not objdb.eof if cint(objdb("req_cnt")) > 0 Then Response.Write "" else Response.Write "" End If objdb.movenext wend End If DBClose() case "pay" DBConnect() SQL = "" SQL = SQL &" select (select r_nm from exitpoll.dbo.R_code where flag='1' and gubun='position' and r_cd = p_cd) as r_position, pay "&VbCrlf SQL = SQL &" from exitpoll.dbo.R_code_pay where Flag='1' and a_cd = '"&Request("a_cd")&"' and p_cd = '"&Request("p_cd")&"' "&VbCrlf Objdb.Open SQL,DBConn,3,1,1 if not Objdb.eof Then Response.Write objdb("r_position")&" 지원 시 "&objdb("pay")&"만원 지급 예정" End If DBClose() case "Qu" 'Response.write "0" 'Response.End '일단 모두 받음 DBConnect() SQL = "" SQL = SQL &" select a.d_cd, a.d_nm, a.p_cd, a.p_nm, isnull(b.cnt,'0') as cnt, a.Qu from "&VbCrlf SQL = SQL &" ( "&VbCrlf SQL = SQL &" select d_cd, d_nm, p_cd, p_nm, Qu from R_Quota "&VbCrlf SQL = SQL &" where flag='1' "&VbCrlf SQL = SQL &" ) as a "&VbCrlf SQL = SQL &" left join "&VbCrlf SQL = SQL &" ( "&VbCrlf SQL = SQL &" select r_position,r_district, count(r_district) as cnt from R_Info where flag='1' "&VbCrlf if Session("r_phone") <> "" Then SQL = SQL &" and r_phone <> '" & Session("r_phone") & "' " End If SQL = SQL &" group by r_position, r_district "&VbCrlf SQL = SQL &" ) as b on a.d_cd = b.r_district and a.p_cd = b.r_position "&VbCrlf SQL = SQL &" where a.p_cd='"&Request("p_cd")&"' and a.d_cd='"&Request("a_cd")&"' "&VbCrlf Objdb.Open SQL,DBConn,3,1,1 if not Objdb.eof Then if Cint(objdb("Cnt")) >= Cint(objdb("Qu")) Then cSQL = " SELECT 1 FROM R_Info WHERE r_phone = '" & Session("r_phone") & "' AND r_district = '"&Request("a_cd")&"' AND r_position = '"&Request("p_cd")&"' " cObjdb.Open cSQL,DBConn,3,1,1 If cObjdb.recordCount > 0 Then Response.write "0" Else Response.write "1" End If Else Response.write "0" End If Else Response.write "1" End If DBClose() case "member_list" DBConnect() SQL = "" SQL = SQL&" SELECT RI.r_name,RI.r_sd,RI.r_sgg, dbo.base64_decode(RI.r_phone) AS r_phone, " SQL = SQL&" dbo.codeLabel('gender', RI.r_gender, NULL) AS r_gender, dbo.codeLabel('position', RI.r_position, NULL) AS r_position, "&VbCrlf SQL = SQL&" CASE WHEN RI.r_birth <> '' then FLOOR(CAST(DATEDIFF(DAY,RI.r_birth,GETDATE()) AS INTEGER)/365.2422) end AS r_age "&VbCrlf SQL = SQL&" FROM R_info RI JOIN R_Deploy RD ON RI.r_phone = RD.r_phone "&VbCrlf SQL = SQL&" WHERE RD.exit_cd = '" & exit_cd & "' AND RI.r_position IN (" & Request("r_position") & ") "&VbCrlf Objdb.Open SQL,DBConn,3,1,1 if not objdb.eof Then while not objdb.eof Response.write "