관리자모드 게시판관리 셀렉트박스 질문드립니다
본문
<td>서브메뉴</td>
</td>
<select name=bo_submenu id='bo_submenu'>
<option value='1'>서브메뉴1
<option value='2'>서브메뉴2
<option value='3'>서브메뉴3
<option value='4'>서브메뉴4
<option value='5'>서브메뉴5
<option value='6'>서브메뉴6
<option value='7'>서브메뉴7
<option value='8'>서브메뉴8
<option value='9'>서브메뉴9
<option value='10'>서브메뉴10
</select>
<script type='text/javascript'>document.getElementById('bo_submenu').value='<?=$board[bo_submenu]?>';</script>
</td>
그누보드4 사용중입니다
제가 게시판마다 서브메뉴를 다르게 주고싶어서 관리자모드 수정중인데요
우선 게시판 db에다가 bo_submenu 라는걸 추가했습니다
adm/board_form.php 에 저 위에 소스를 추가해서 서브메뉴 셀렉트박스 선택하면 잘 적용되는데
adm/board_list.php 에 저 위에 소스를 추가하면 셀렉트박스 클릭해도 db에 적용이 안되네요
초보라 전혀 감을 못잡겠습니다
관리자모드 게시판 전체리스트 (adm/board_list.php)에
셀렉트박스 추가하고싶은데 고수님들 조언좀 부탁드릴게요
쉽게말해서 게시판관리에 저 서브메뉴 셀렉트박스를 추가해서 셀렉트박스선택시에 db에 값이 저장되었으면합니다ㅠ
아래는 adm/board_list.php 전체소스입니다
<?
?>
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$token = get_token();
// DHTML 에디터 사용 필드 추가 : 061021
sql_query(" ALTER TABLE `$g4[board_table]` ADD `bo_use_dhtml_editor` TINYINT NOT NULL AFTER `bo_use_secret` ", false);
// RSS 보이기 사용 필드 추가 : 061106
sql_query(" ALTER TABLE `$g4[board_table]` ADD `bo_use_rss_view` TINYINT NOT NULL AFTER `bo_use_dhtml_editor` ", false);
$sql_common = " from $g4[board_table] a ";
$sql_search = " where (1) ";
if ($is_admin != "super") {
$sql_common .= " , $g4[group_table] b ";
$sql_search .= " and (a.gr_id = b.gr_id and b.gr_admin = '$member[mb_id]') ";
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "bo_table" :
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.gr_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.gr_id, a.bo_table";
$sod = "asc";
}
$sql_order = " order by $sst $sod ";
$sql = " select count(*) as cnt
$sql_common
$sql_search
$sql_order ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
$rows = $config[cf_page_rows];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
$sql_common
$sql_search
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);
$listall = "<a href='$_SERVER[PHP_SELF]'>처음</a>";
$g4[title] = "게시판관리";
include_once("./admin.head.php");
$colspan = 13;
?>
<?=subtitle("게시판관리")?>
<script type="text/javascript">
var list_update_php = 'board_list_update.php';
var list_delete_php = 'board_list_delete.php';
</script>
<table width=100% cellpadding=3 cellspacing=1>
<form name=fsearch method=get>
<tr>
<td width=50% align=left><?=$listall?> (게시판수 : <?=number_format($total_count)?>개)</td>
<td width=50% align=right>
<select name=sfl>
<option value='bo_table'>TABLE</option>
<option value='bo_subject'>제목</option>
<option value='a.gr_id'>그룹ID</option>
</select>
<input type=text name=stx class=ed required itemname='검색어' value='<?=$stx?>'>
<input type=image src='<?=$g4[admin_path]?>/img/btn_search.gif' align=absmiddle></td>
</tr>
</form>
</table>
<form name=fboardlist method=post>
<input type=hidden name=sst value="<?=$sst?>">
<input type=hidden name=sod value="<?=$sod?>">
<input type=hidden name=sfl value="<?=$sfl?>">
<input type=hidden name=stx value="<?=$stx?>">
<input type=hidden name=page value="<?=$page?>">
<input type=hidden name=token value="<?=$token?>">
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="t_style">
<tr>
<td align="center" width="3%" class="t_name"><input type=checkbox name=chkall value="1" onclick="check_all(this.form)"></td>
<td align="center" width="6%" class="t_name"><?=subject_sort_link("bo_table")?>TABLE</a></td>
<td align="center" width="15%" class="t_name"><?=subject_sort_link("bo_subject")?>제목</a></td>
<td align="center" width="15%" class="t_name"><?=subject_sort_link("a.gr_id")?>그룹</a></td>
<td align="center" width="10%" class="t_name"><?=subject_sort_link("bo_submenu")?>서브메뉴</a></td>
<td align="center" width="8%" class="t_name"><?=subject_sort_link("bo_skin", "", "desc")?>스킨</a></td>
<td align="center" width="6%" class="t_name"><?=subject_sort_link("bo_read_point")?>읽기 포인트</a></td>
<td align="center" width="6%" class="t_name"><?=subject_sort_link("bo_write_point")?>쓰기 포인트</a></td>
<td align="center" width="6%" class="t_name"><?=subject_sort_link("bo_comment_point")?>코멘트 포인트</a></td>
<td align="center" width="6%" class="t_name"><?=subject_sort_link("bo_download_point")?>다운 포인트</a></td>
<td align="center" width="4%" class="t_name"><?=subject_sort_link("bo_use_search")?>검색 사용</a></td>
<td align="center" width="5%" class="t_name"><?=subject_sort_link("bo_order_search")?>검색 순서</a></td>
<td align="center" width="10%" class="t_name"><a href="./board_form.php"><img src='<?=$g4[admin_path]?>/img/icon_insert.gif' border=0 title='생성'></a></td>
</tr>
</tr>
<?
// 스킨디렉토리
$skin_options = "";
$arr = get_skin_dir("board");
for ($k=0; $k<count($arr); $k++)
{
$option = $arr[$k];
if (strlen($option) > 10)
$option = substr($arr[$k], 0, 18) . "…";
$skin_options .= "<option value='$arr[$k]'>$option</option>";
}
for ($i=0; $row=sql_fetch_array($result); $i++) {
$s_upd = "<a href='./board_form.php?w=u&bo_table=$row[bo_table]&$qstr'><img src='img/icon_modify.gif' border=0 title='수정'></a>";
$s_del = "";
if ($is_admin == "super") {
$s_del = "<a href=\"javascript:post_delete('board_delete.php', '$row[bo_table]');\"><img src='img/icon_delete.gif' border=0 title='삭제'></a>";
}
$s_copy = "<a href=\"javascript:board_copy('$row[bo_table]');\"><img src='img/icon_copy.gif' border=0 title='복사'></a>";
/*
// 스킨디렉토리
$skin_options = "";
$arr = get_skin_dir("board");
for ($k=0; $k<count($arr); $k++)
{
$option = $arr[$k];
if (strlen($option) > 10)
$option = substr($arr[$k], 0, 18) . "…";
$skin_options .= "<option value='$arr[$k]'";
if ($arr[$k] == $row[bo_skin])
$skin_options .= " selected";
$skin_options .= ">$option</option>";
}
*/
$list = $i % 2;
echo "<input type=hidden name=board_table[$i] value='$row[bo_table]'>";
echo "<tr class='list$list col1 ht center'>";
echo "<td class='t_value'><input type=checkbox name=chk[] value='$i'></td>";
echo "<td class='t_value'><a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]'><b>$row[bo_table]</b></a></td>";
echo "<td align=left class='t_value'><input type=text class=ed name=bo_subject[$i] value='".get_text($row[bo_subject])."' style='width:99%;'></td>";
if ($is_admin == "super")
echo "<td align=center class='t_value'>".get_group_select("gr_id[$i]", $row[gr_id])."</td>";
else
echo "<td align=center class='t_value'><input type=hidden name='gr_id[$i]' value='$row[gr_id]'>$row[gr_subject]</td>";
?>
<td align=center class='t_value'>
<!-------------------------------------------------------------------->
셀렉트박스 들어가야할곳
<!-------------------------------------------------------------------->
</td>
<?
echo "<td align=center class='t_value'><select id=bo_skin_$i name=bo_skin[$i]>$skin_options</select></td>";
echo "<td title='읽기 포인트' class='t_value'><input type=text class=ed name=bo_read_point[$i] value='$row[bo_read_point]' style='width:99%;'></td>";
echo "<td title='쓰기 포인트' class='t_value'><input type=text class=ed name=bo_write_point[$i] value='$row[bo_write_point]' style='width:99%;'></td>";
echo "<td title='댓글쓰기 포인트' class='t_value'><input type=text class=ed name=bo_comment_point[$i] value='$row[bo_comment_point]' style='width:99%;'></td>";
echo "<td title='다운로드 포인트' class='t_value'><input type=text class=ed name=bo_download_point[$i] value='$row[bo_download_point]' style='width:99%;'></td>";
echo "<td title='검색사용' class='t_value'><input type=checkbox name=bo_use_search[$i] ".($row[bo_use_search]?'checked':'')." value='1'></td>";
echo "<td title='검색순서' class='t_value'><input type=text class=ed name=bo_order_search[$i] value='$row[bo_order_search]' size=2></td>";
echo "<td class='t_value'>$s_upd $s_del $s_copy</td>";
echo "</tr>";
echo "<script type='text/javascript'>document.getElementById('bo_skin_$i').value='$row[bo_skin]';</script>";
}
if ($i == 0)
echo "<tr height=100><td colspan='12' align=center class='t_value'>자료가 없습니다.</td></tr>";
echo "</table>";
echo "<div class='margin2'></div>";
$pagelist = get_paging($config[cf_write_pages], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr&page=");
echo "<table width=100% cellpadding=3 cellspacing=1>";
echo "<tr><td width=70%>";
echo "<input type=button class='btn1' value='선택수정' onclick=\"btn_check(this.form, 'update')\"> ";
if ($is_admin == "super")
echo "<input type=button class='btn1' value='선택삭제' onclick=\"btn_check(this.form, 'delete')\">";
echo "</td>";
echo "<td width=30% align=right>$pagelist</td></tr></table>\n";
if ($stx)
echo "<script>document.fsearch.sfl.value = '$sfl';</script>";
?>
</form>
<script type="text/javascript">
function board_copy(bo_table) {
window.open("./board_copy.php?bo_table="+bo_table, "BoardCopy", "left=10,top=10,width=500,height=200");
}
</script>
<script>
// POST 방식으로 삭제
function post_delete(action_url, val)
{
var f = document.fpost;
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
f.bo_table.value = val;
f.action = action_url;
f.submit();
}
}
</script>
<form name='fpost' method='post'>
<input type='hidden' name='sst' value='<?=$sst?>'>
<input type='hidden' name='sod' value='<?=$sod?>'>
<input type='hidden' name='sfl' value='<?=$sfl?>'>
<input type='hidden' name='stx' value='<?=$stx?>'>
<input type='hidden' name='page' value='<?=$page?>'>
<input type='hidden' name='token' value='<?=$token?>'>
<input type='hidden' name='bo_table'>
</form>
<script type="text/javascript">
{
document.fboardlist.bo_submenu.value = '<?=$row[bo_submenu]?>';
}
</script>
<?
include_once("./admin.tail.php");
?>
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.