리스트에서 셀렉트박스 선택시 바로수정 채택완료
박가
11년 전
조회 8,411
관리자가 목록에서 예약상태 수정을 바로바로 할 수 있게하고싶어요!
"신청"으로 되어있는 셀렉트박스를 "처리중"으로 바꾸면 "업데이트되었습니다."라는
창이 뜨고 "처리중"으로 수정이 되는거예요.
부탁드립니다 ㅜ.ㅜ
list.skin.php
</div>
<div><? if($is_admin == "super"){ ?>
<td width="70">
<select onchange="javascript:change_status(this, <?=$list[$i][wr_id]?>)">
<option value="1" <? if ($list[$i][wr_1]=='1') echo 'selected'; ?>>신청
<option value="2" <? if ($list[$i][wr_1]=='2') echo 'selected'; ?>>처리중
<option value="3" <? if ($list[$i][wr_1]=='3') echo 'selected'; ?>>완료
</select>
</td>
<td width="1"></td>
<? } ?></div>
<div><form id=status_update name=status_update action='/skin/board/pension_reserve/update_status.php' target='status_result' method='post'>
<input type=hidden name='bo_table' value='<?=$write_table?>'>
<input type=hidden name='status_val'>
<input type=hidden name='wr_id'>
</form></div>
<div><iframe name="status_result" width="0" height="0"></iframe></div>
<div><script language="JavaScript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
if ('<?=$stx?>') {
document.fsearch.sfl.value = '<?=$sfl?>';
document.fsearch.sop.value = '<?=$sop?>';
}</div>
<div>function change_status(obj, wr_id) {
document.status_update.status_val.value = obj.selectedIndex;
document.status_update.wr_id.value = wr_id;
document.status_update.submit();
}
</script></div>
<div>
update_status.php
</div>
<div><?
include_once("./_common.php");</div>
<div>if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 </div>
<div>$sql1 = "update $bo_table set wr_1 = '$status_val' where wr_id = '$wr_id' ";
sql_query($sql1);</div>
<div>?>
<script>
alert("업데이트 되었습니다.");
</script></div>
<div>
댓글을 작성하려면 로그인이 필요합니다.
답변 4개
11년 전
폼으로 하지 않아도 됩니다.
히든 프레임으로 넘기실때 get 방식으로 넘겨보세요.
</div>
<div><a href='<span style="color: rgb(0, 0, 255); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 23.54400062561035px; font-size: 10pt">skin/board/pension_reserve/update_status.php?bo_tabe=<?php echo $bo_table?>&wr_id=<?php echo $wr_id?>&</span><span style="color: rgb(0, 0, 255); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 23.54400062561035px; font-size: 10pt">status_val=update</span><span style="font-size: 10pt; line-height: 1.5">' target='</span><span style="background-color: rgb(248, 248, 248); color: rgb(0, 0, 255); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 23.54400062561035px; font-size: 10pt">status_result</span><span style="font-size: 10pt; line-height: 1.5">'>[업데이트]</a></span></div>
<div>
<?include_once("./_common.php");
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$sql1 = "update $bo_table set wr_1 = '$status_val' where wr_id = '$wr_id' ";
sql_query($sql1);
?>
<script>
alert("업데이트 되었습니다."); //부모창을 리프레시 시켜주는 스크립트 넣으세요
top.location.reload();
</script>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
리스트스킨파일에 알려주신 소스 넣었더니 게시판관리자 모드로 넘어갑니다.
제가 초보라 값을 어떻게 확인하라고 하시는 지 ㅜ.ㅜ