<!-- #include virtual="/manager/common/file/other_top.asp" -->
<script type="text/javascript" src="/common/js/04poll.js"></script>

<!-- 권한 체크 -->
<!-- #include file="config.asp" -->

<%

' 파라미터정보 *************************************************************************************
po_idx		= InputValue(request("po_idx")) ' --Pk
' **************************************************************************************************


If po_idx <> "" then ' --수정상태일때..
	
	' 레코드필드
	R_Fields	= "po_idx, po_subject, po_group, po_addid, po_sdate, po_edate, po_chk, po_code, po_pk, po_wdate, po_mdate"
	R_tablename_str	= "poll "
	R_WHERE_str		= " WHERE po_idx="&po_idx

	Call SelectQuery (R_Fields, R_tablename_str, R_WHERE_str)

	reset_url = "list.asp?"&page_info
	is_title_str = "설문조사 정보 수정"


Else ' 새글등록

	po_chk   = "Y"
	reset_url = "write.asp"
	is_title_str = "신규 설문조사 생성"	

End if


po_sdate = request("po_sdate")
po_edate = request("po_edate")

If po_sdate  = "" then

	po_sdate_y = Year(now)
	po_sdate_m = Month(now)
	po_sdate_d = day(now)

	If Len(po_sdate_m)=1 Then po_sdate_m = "0"&po_sdate_m
	If Len(po_sdate_d)=1 Then po_sdate_d = "0"&po_sdate_d

else

	po_sdate_arr	= split(po_sdate, "-")

	po_sdate_y = po_sdate_arr(0)
	po_sdate_m = po_sdate_arr(1)
	po_sdate_d = po_sdate_arr(2)

End if


If po_edate  = "" Then
	
	nm = DateAdd("m",1, now)

	po_edate_y = Year(nm)
	po_edate_m = Month(nm)
	po_edate_d = Day(nm)

	If Len(po_edate_m)=1 Then po_edate_m = "0"&po_edate_m
	If Len(po_edate_d)=1 Then po_edate_d = "0"&po_edate_d

else

	po_edate_arr = split(po_edate, "-")

	po_edate_y = po_edate_arr(0)
	po_edate_m = po_edate_arr(1)
	po_edate_d = po_edate_arr(2)

End if

%>
		
		



		<!-- 내용영역 -->
		<div id="contents">

			<div id="contents_head"> 
				<div id="contents_title">
					<img src="/manager/img/tit_ic06.gif" width="22" height="21" class="<%=skin%> center" alt="" /><h1><span><%=is_title_str%></span></h1>
				</div>
				<div id="location">
					<a href="/manager/" tabindex="<%=getTabIndex()%>">Home</a> &gt; <a href="/manager/content/04poll/list.asp" tabindex="<%=getTabIndex()%>">부가기능</a> &gt; <a href="list.asp" tabindex="<%=getTabIndex()%>">설문조사관리</a> &gt; <a href="write.asp" class="now" tabindex="<%=getTabIndex()%>"><%=is_title_str%></a>
				</div>
			</div>

			<!-- 내용들어가는곳 -->
			<div id="contents_area">

				<form id="frm" method="post" action="write_ok.asp?<%=page_info%>" onsubmit="return w_chk();">
				<div>
				<input type="hidden" name="po_idx" value="<%=po_idx%>" />
				</div>

					<h2 class="space"></h2>


					<fieldset>
						<legend>설문조사생성 서식 작성</legend>
						<table cellspacing="0" class="bbs_<%=skin%>" summary="신규 설문조사 생성을 위한 입력 양식입니다.">
						<caption>설문조사생성 서식</caption>
						<colgroup>
						<col width="140" />
						<col width="580" />
						</colgroup>
						<tr>
							<th scope="row"><label for="po_subject">제목</label></th>
							<td class="left"><input type="text" size="90" title="제목 입력" id="po_subject" name="po_subject" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=po_subject%>" maxlength="200"  tabindex="<%=getTabIndex()%>" /></td>
						</tr>
						<tr>
							<th scope="row">설문 대상자 선택</th>
							<td class="left">
								<fieldset>
									<table cellspacing="0" class="bbs_2step" summary="설문그룹선택">
									<colgroup>
									<col width="130" />
									<col width="428" />
									</colgroup>
									<tr>
										<th scope="row">회원그룹</th>
										<td class="left">
											<fieldset>
												<table cellspacing="0" class="bbs_3step" summary="설문 대상자(회원그룹) 선택 양식입니다.">
												<colgroup>
												<col width="33%" />
												<col width="33%" />
												<col width="33%" />
												</colgroup>
												<tr>
													<%


													R_Fields_SS = "g_num, g_code, g_menuname"

													sql = "SELECT "&R_Fields_SS&" FROM member_group WHERE g_chk='Y' ORDER BY  g_code ASC" 
													Set rs = Dbcon.execute(sql)

													zz = 1

													Do While Not rs.eof 
														g_num = rs("g_num")
														g_code = rs("g_code")
														g_menuname = rs("g_menuname")
													%>

													<td>
														<input type="checkbox"  name="po_group" value="<%=g_num%>" <%=chkchkbox2(po_group,"["&g_num&"]")%>  tabindex="<%=getTabIndex()%>" /><%=g_menuname%>
													</td>
													<%

														If zz =3 then
															response.write "</tr> <tr>"
															zz=1
														End if

														zz = zz+1
														rs.movenext
													Loop
													rs.close : Set rs = Nothing
													%>
												</tr>
												</table>
											</fieldset>
										</td>
									</tr>
									</table>
								</fieldset>
							</td>
						</tr>
						<tr>
							<th scope="row"><label for="po_sdate_y">설문기간</label></th>
							<td class="left">
								<select id="po_sdate_y" name="po_sdate_y" title="시작 사용기간(년)을 선택" tabindex="<%=getTabIndex()%>">
									<% For z=2009 To Year(now)+5 %>
									<option value="<%=z%>" <%If z=Int(po_sdate_y) Then response.write "selected='selected'" End If %>><%=z%>년</option>
									<% next%>
								</select>
								<select id="po_sdate_m" name="po_sdate_m"  title="시작 사용기간(월)을 선택" tabindex="<%=getTabIndex()%>">
									<% For z=1 To 12 %>
									<option value="<%=z%>" <%If z=Int(po_sdate_m) Then response.write "selected='selected'" End if%>><%=z%>월</option>
									<% Next %>
								</select>
								<select id="po_sdate_d" name="po_sdate_d"   title="시작 사용기간(일)을 선택" tabindex="<%=getTabIndex()%>">
									<% For z=1 To 31 %>
									<option value="<%=z%>" <%If z=Int(po_sdate_d) Then response.write "selected='selected'" End if%>><%=z%>일</option>
									<%next%>
								</select>

								~

								<select id="po_edate_y" name="po_edate_y" title="종료 사용기간(년)을 선택" tabindex="<%=getTabIndex()%>">
									<% For z=2009 To Year(now)+5 %>
									<option value="<%=z%>" <%If z=Int(po_edate_y) Then response.write "selected='selected'" End If %>><%=z%>년</option>
									<% next%>
								</select>
								<select id="po_edate_m" name="po_edate_m"  title="종료 사용기간(월)을 선택" tabindex="<%=getTabIndex()%>">
									<% For z=1 To 12 %>
									<option value="<%=z%>" <%If z=Int(po_edate_m) Then response.write "selected='selected'" End if%>><%=z%>월</option>
									<% Next %>
								</select>
								<select id="po_edate_d" name="po_edate_d"   title="종료 사용기간(일)을 선택" tabindex="<%=getTabIndex()%>">
									<% For z=1 To 31 %>
									<option value="<%=z%>" <%If z=Int(po_edate_d) Then response.write "selected='selected'" End if%>><%=z%>일</option>
									<%next%>
								</select>
							</td>
						</tr>

						<tr>
							<th scope="row"><label for="po_chk">사용여부</label></th>
							<td class="left">
								<select id="po_chk" name="po_chk" title="설문 사용여부 선택" tabindex="<%=getTabIndex()%>">
									<option value="Y" <%if po_chk = "Y" Then response.write "selected='selected'" End if %>>사용</option>
									<option value="N" <%if po_chk = "N" Then response.write "selected='selected'" End If %>>중지</option>
								</select>

								<span class="text1">* 사용선택시 등록과 동시에 바로 적용되므로 주의 하세요. </span>
							</td>
						</tr>

						
						</table>
					</fieldset>


					<div class="contoll_box">
						<div id="<%=skin%>_bt"><span class="button"><input type="submit" value="등록" tabindex="<%=getTabIndex()%>" /></span>  <span class="button"><input type="button" value="취소" onclick="page_go1('<%=reset_url%>');" tabindex="<%=getTabIndex()%>" /></span></div>
					</div>

				</form>

			</div>
			<!-- 내용들어가는곳 -->

		</div>
		<!-- ' 내용영역 -->






<!--#include virtual = "/manager/common/file/sub_bottom.asp" -->
