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

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

po_pk = InputValue(request("po_pk"))


' 테이블 기본 환경설정 ********************************************************************************
table			= "poll_question"		' 테이블명
idx_field		= "poq_idx"		' 기본키
oreder_filed	= "poq_code ASC"	' 정렬기준 필드
Query_Fields	= "poq_idx ,po_pk ,poq_code, poq_topmemo, poq_question, poq_type, poq_multi, poq_chk, poq_bogi1, poq_bogi2, poq_bogi3, poq_bogi4, poq_bogi5, poq_wdate, poq_mdate"	' 불러올 필드
' ****************************************************************************************************

' ---------------조합 쿼리문------------------------------------
If v_keyword <> "" then
	search_str = " AND "&v_search&" like '%"&v_keyword&"%'"
End if

Query_OrderBy = " ORDER BY "&oreder_filed
' ---------------------------------------------------------------

' -----------------------------리스트 출력 쿼리문 생성-----------------------------
sql = "select "&Query_Fields&" from "&table&" WHERE po_pk = "&po_pk
sql = sql & search_str & search_str2 & Query_OrderBy
Set Rs = Dbcon.Execute (sql)
If rs.eof Then
	vCnt = -1
Else
	vData = rs.getrows()
	vCnt = UBound(vData,2)
End If
rs.close : Set rs = Nothing

' ---------------------------------------------------------------------------------

%>

		<!-- 내용영역 -->
		<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>설문조사 문항설정</span></h1>

				</div>
				<div id="location">
					<a href="/manager/" tabindex="<%=getTabIndex()%>">Home</a> &gt; <a href="/manager/content/04popup/list.asp" tabindex="<%=getTabIndex()%>">부가기능</a> &gt; <a href="/manager/content/04poll/list.asp" tabindex="<%=getTabIndex()%>">설문조사관리</a> &gt; <a href="#" class="now" tabindex="<%=getTabIndex()%>">설문조사 문항설정</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="poq_idx" value="<%=poq_idx%>" />
				<input type="hidden" name="po_pk" value="<%=po_pk%>" />
				</div>


					<h2 class="<%=skin%>">현재경로<span class="loc">: <a href="/manager/content/04poll/list.asp" tabindex="<%=getTabIndex()%>">설문조사 리스트</a>  > <strong class="orange"><%=get_pollsubject(po_pk)%></strong></span></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="poq_topmemo">머릿말</label></th>
							<td class="left"><textarea cols="90" rows="2" id="poq_topmemo" name="poq_topmemo" title="머릿말 내용 입력" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" tabindex="<%=getTabIndex()%>"></textarea></td>
						</tr>
						<tr>
							<th scope="row"><label for="poq_question">문항 제목</label></th>
							<td class="left"><input type="text" size="90" title="문항제목 입력" id="poq_question" name="poq_question" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=poq_question%>" maxlength="200" tabindex="<%=getTabIndex()%>" /></td>
						</tr>
						<tr>
							<th scope="row"><label for="poq_type">형식</label></th>
							<td class="left">

								<select id="poq_type" name="poq_type" title="문항 형식을 선택" tabindex="<%=getTabIndex()%>" onchange="javascript:a_level_chg(this.value,'mode_view');">
									<option value="1">객관식</option>
									<option value="2" >주관식</option>
								</select>


								<div id="mode_view" style="display:block;" class="pt4">
									
									<table cellspacing="0" class="bbs_2step" summary="설문항목 입력 양식입니다.">
									<caption>설문항목 서식</caption>
									<colgroup>
									<col width="100" />
									<col width="450" />
									</colgroup>
									<!-- <tr>
										<th scope="row"><label for="item_count">항목 갯수</label></th>
										<td class="left">
											<select id="item_count" name="item_count" title="객관식 항목갯수 선택" tabindex="<%=getTabIndex()%>">
												<option value="2">2</option>
												<option value="3" >3</option>
												<option value="4" >4</option>
												<option value="5" selected='selected'>5</option>
											</select> 개
										</td>
									</tr> -->
									<tr>
										<th scope="row"><label for="poq_bogi1">항목</label></th>
										<td class="left item">
											<span>1</span> <input type="text" size="67" title="1번 항목 내용 입력" id="poq_bogi1" name="poq_bogi1" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="" maxlength="200" tabindex="<%=getTabIndex()%>" /><br />
											<span>2</span> <input type="text" size="67" title="2번 항목 내용 입력" id="poq_bogi2" name="poq_bogi2" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="" maxlength="200" tabindex="<%=getTabIndex()%>" /><br />
											<span>3</span> <input type="text" size="67" title="3번 항목 내용 입력" id="poq_bogi3" name="poq_bogi3" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="" maxlength="200" tabindex="<%=getTabIndex()%>" /><br />
											<span>4</span> <input type="text" size="67" title="4번 항목 내용 입력" id="poq_bogi4" name="poq_bogi4" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="" maxlength="200" tabindex="<%=getTabIndex()%>" /><br />
											<span>5</span> <input type="text" size="67" title="5번 항목 내용 입력" id="poq_bogi5" name="poq_bogi5" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="" maxlength="200" tabindex="<%=getTabIndex()%>" /><br />
										</td>
									</tr>
									<tr>
										<th scope="row"><label for="poq_multi_Y">다중선택</label></th>
										<td class="left">
											<label for="poq_multi_Y"><input type="radio" id="poq_multi_Y" name="poq_multi" value="Y" title="사용 선택" tabindex="<%=getTabIndex()%>" />사용</label>
											<label for="poq_multi_N"><input type="radio" id="poq_multi_N" name="poq_multi" value="N" title="사용안함 선택" checked='checked' tabindex="<%=getTabIndex()%>" />사용안함</label>
											<!-- &nbsp;&nbsp;&nbsp;<strong>제한여부</strong> :
												<select id="item_count" name="duselect_count" title="객관식 항목갯수 선택" tabindex="<%=getTabIndex()%>">
													<option value="0">제한을 두지 않음</option>
													<option value="1" >1개까지 선택 가능</option>
													<option value="2" >2개까지 선택 가능</option>
													<option value="3" >3개까지 선택 가능</option>
													<option value="4" >4개까지 선택 가능</option>
													<option value="5" >5개까지 선택 가능</option>
												</select> -->
										</td>
									</tr>
									</table>

								</div>

							</td>
						</tr>

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



						</table>
					</fieldset>


					<div style="padding:10px 0 0 0;height:25px;">
						<div id="<%=skin%>_bt" style="float:right"><span class="button"><input type="submit" value="문항등록" tabindex="<%=getTabIndex()%>" /></span></div>
					</div>

				</form>


					<div style="text-align:center;padding-bottom:5px;">
						<img src="/manager/img/poll_arrow_<%=skin%>.gif" width="53" height="37" alt="" />
					</div>













				<!-- 수정.. -->

				<form id= "frm_list" action=""  method='post'>
					<div>
						<input type="hidden" name="status" />
						<input type="hidden" id="poq_chk" name="poq_chk" />
						<input type="hidden" id="chk_all" name="chk_all" />
						
						
						<input type="hidden" id="po_pk" name="po_pk" value="<%=po_pk%>" />
						<input type="hidden" id="poq_idx" name="poq_idx" />
					</div>


					<fieldset>
						<legend>설문조사관리 수정/삭제/보기</legend>
						<table cellspacing="0" class="bbs_<%=skin%>" summary="설문조사을 관리합니다.">
						<caption>설문조사관리 서식</caption>
						<colgroup>
						<col width="40" />
						<col width="50" />
						<col />
						<col width="70" />
						<col width="50" />
						<col width="50" />
						</colgroup>

						<thead>
						<tr>
							<th scope="col">선택</th>
							<th scope="col">순서</th>
							<th scope="col">제목</th>
							<th scope="col">사용여부</th>
							<th scope="col">수정</th>
							<th scope="col">삭제</th>
						</tr>
						</thead>

						<tbody>

<%
If vCnt > -1 Then

	zz = 1
	For i=0 To vCnt

		Call arr2Value(Query_Fields, "vData", i)

		If poq_chk ="Y" then
			poq_chk_str = "<strong>사용</strong>"
		else
			poq_chk_str = "중지"
		End If

%>


						<tr>
							<td scope="row" class="center"><input type="checkbox" name="chk" value="<%=poq_idx%>" title="해당 설문조사 선택" tabindex="<%=getTabIndex()%>" /></td>
							<td scope="row" class="center">
								<a href="move.asp?po_pk=<%=po_pk%>&amp;move=up&amp;poq_idx=<%=poq_idx%>&amp;poq_code=<%=poq_code%>" title="순서 위로 이동" tabindex="<%=getTabIndex()%>"><img src="/manager/img/ic_up.gif" width="10" height="9" alt="순서 위로 이동" /></a><a href="move.asp?po_pk=<%=po_pk%>&amp;move=down&amp;poq_idx=<%=poq_idx%>&amp;poq_code=<%=poq_code%>" title="순서 아래로 이동" tabindex="<%=getTabIndex()%>"><img src="/manager/img/ic_down.gif" width="10" height="9" alt="순서 아래로 이동" /></a>
							</td>
							<td scope="row" class="left">


									<table cellspacing="0" class="bbs_2step">
									<colgroup>
									<col width="100" />
									<col width="320" />
									</colgroup>
									<tr>
										<th scope="row"><label for="poq_topmemo_<%=poq_idx%>">머릿말</label></th>
										<td class="left"><textarea cols="46" rows="2" id="poq_topmemo_<%=poq_idx%>" name="poq_topmemo_<%=poq_idx%>" title="머릿말 내용 입력" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" tabindex="<%=getTabIndex()%>"><%=poq_topmemo%></textarea></td>
									</tr>
									<tr>
										<th scope="row"><label for="poq_question_<%=poq_idx%>"> <strong class="orange">[<%=zz%>] 문항 제목</strong></label></th>
										<td class="left"><input type="text" size="47" title="문항제목 입력" id="poq_question_<%=poq_idx%>" name="poq_question_<%=poq_idx%>" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=poq_question%>" maxlength="300" tabindex="<%=getTabIndex()%>" /></td>
									</tr>
									<tr>
										<th scope="row"><label for="poq_type_<%=poq_idx%>">형식</label></th>
										<td class="left item">
											<select id="poq_type_<%=poq_idx%>" name="poq_type_<%=poq_idx%>" title="문항 형식을 선택" tabindex="<%=getTabIndex()%>" onchange="javascript:a_level_chg(this.value,'mode_view<%=poq_idx%>');">
												<option value="1" <%if poq_type = "1" Then response.write "selected='selected'" End if %>>객관식</option>
												<option value="2" <%if poq_type = "2" Then response.write "selected='selected'" End If %>>주관식</option>
											</select>
										</td>
									</tr>
									</table>


								<div id="mode_view<%=poq_idx%>" style="display:block;" class="pt4">
									
									<table cellspacing="0" class="bbs_2step">
									<colgroup>
									<col width="100" />
									<col width="320" />
									</colgroup>
									<tr>
										<th scope="row"><label for="poq_bogi1_<%=poq_idx%>">항목</label></th>
										<td class="left item">
											<span>1</span> <input type="text" size="45" title="1번 항목 내용 입력" id="poq_bogi1_<%=poq_idx%>" name="poq_bogi1_<%=poq_idx%>" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="<%=poq_bogi1%>" maxlength="300"  tabindex="<%=getTabIndex()%>" /><br />
											<span>2</span> <input type="text" size="45" title="2번 항목 내용 입력" id="poq_bogi2_<%=poq_idx%>" name="poq_bogi2_<%=poq_idx%>" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="<%=poq_bogi2%>" maxlength="300" tabindex="<%=getTabIndex()%>" /><br />
											<span>3</span> <input type="text" size="45" title="3번 항목 내용 입력" id="poq_bogi3_<%=poq_idx%>" name="poq_bogi3_<%=poq_idx%>" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="<%=poq_bogi3%>" maxlength="300" tabindex="<%=getTabIndex()%>" /><br />
											<span>4</span> <input type="text" size="45" title="4번 항목 내용 입력" id="poq_bogi4_<%=poq_idx%>" name="poq_bogi4_<%=poq_idx%>" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="<%=poq_bogi4%>" maxlength="300" tabindex="<%=getTabIndex()%>" /><br />
											<span>5</span> <input type="text" size="45" title="5번 항목 내용 입력" id="poq_bogi5_<%=poq_idx%>" name="poq_bogi5_<%=poq_idx%>" class="input_box2" onfocus="focus_on2(this);" onblur="focus_off2(this);" value="<%=poq_bogi5%>" maxlength="300" tabindex="<%=getTabIndex()%>" /><br />
										</td>
									</tr>
									<tr>
										<th scope="row"><label for="poq_multi_<%=poq_idx%>_Y">다중선택</label></th>
										<td class="left">
											<label for="poq_multi_<%=poq_idx%>_Y"><input type="radio" id="poq_multi_<%=poq_idx%>_Y" name="poq_multi_<%=poq_idx%>" value="Y" title="사용 선택" <%if poq_multi = "Y" Then response.write "checked='checked'" End If %> tabindex="<%=getTabIndex()%>" />사용</label>
											<label for="poq_multi_<%=poq_idx%>_N"><input type="radio" id="poq_multi_<%=poq_idx%>_N" name="poq_multi_<%=poq_idx%>" value="N" title="사용안함 선택" <%If poq_multi = "N" Then response.write "checked='checked'" End If %> tabindex="<%=getTabIndex()%>" />사용안함</label>
											<!-- &nbsp;&nbsp;&nbsp;
												<select id="item_count" name="duselect_count" title="객관식 항목갯수 선택" tabindex="<%=getTabIndex()%>">
													<option value="0">제한을 두지 않음</option>
													<option value="1" >1개까지 선택 가능</option>
													<option value="2" >2개까지 선택 가능</option>
													<option value="3" >3개까지 선택 가능</option>
													<option value="4" >4개까지 선택 가능</option>
													<option value="5" >5개까지 선택 가능</option>
												</select> -->

												
										</td>
									</tr>
									</table>

									<script type="text/javascript">
									<!--
										a_level_chg(<%=poq_type%>,'mode_view<%=poq_idx%>')
									' -->
									</script>

								</div>

							</td>

							<td scope="row" class="center"><%=poq_chk_str%></td>
							<td scope="row" class="center"><input type="button" value="수정" class="ct_bt01" onclick="m_chk(<%=poq_idx%>);" tabindex="<%=getTabIndex()%>" /></td>
							<td scope="row" class="center"><input type="button" value="삭제" class="ct_bt01" onclick="d_chk('delete_ok.asp?poq_idx=<%=poq_idx%>');" tabindex="<%=getTabIndex()%>" /></td>
						</tr>



<%
		
		zz = zz+1
	Next


Else	' 게시할 목록이 없다면
%>

						<tr>
							<td scope="row" class="center"></td>
							<td scope="row" class="left"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
						</tr>


<%
End if
%>





						</tbody>
						</table>
					</fieldset>

					<div class="contoll_box2">
						<ul>
						<li><img src="/manager/img/line01.gif" width="36" height="21" alt="" /></li>
						<li class="pt7"><div class="bt01"><a href="javascript:checkAll();" tabindex="<%=getTabIndex()%>"><span>전체 선택/해제</span></a></div><div class="bt01"><a href="javascript:delete2();" tabindex="<%=getTabIndex()%>"><span>선택 문항삭제</span></a></div></li>
						<li class="pt7 pl4"><span class="gray">|</span> &nbsp;선택한 문항을 
								<select id="tot_m_level" name="tot_level_chk" title="선택한 문항 사용여부 선택" tabindex="<%=getTabIndex()%>">
									<option value="Y" selected="selected">사용</option>
									<option value="N">중지</option>
								</select>으로
						</li>
						<li class="pt7 pl2"><div class="bt01"><a href="javascript:tot_levelchage('<%=page_info%>');" tabindex="<%=getTabIndex()%>"><span>변경</span></a></div></li>
						</ul>
					</div>

					<div class="contoll_box">
						<div id="<%=skin%>_bt"><span class="button"><input type="button" value="취소" onclick="parent.dialog_close();" tabindex="<%=getTabIndex()%>" /></span></div>
					</div>
				</form>

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

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


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