댓글 수정시 이름 수정이 안됩니다.
본문
글읽기에서 댓글로 프로그램 신청을 받는 게시판입니다.
신청목록에서 관리자가 수정을 할 수 있는데, 수정 시 "참여자성명"이 보이지 않습니다.
또 직접 입력해서 저장(프로그램 신청하기)해도 수정이 되지 않습니다.
최초 등록시에만 값이 입력이 되고 이후 수정이 안됩니다.
해당 댓글등록 파일은 "view_comment.skin.php"입니다.
아래는 해당 파일 소스 및 캡쳐 이미지입니다.
"참여자성명" 수정할 수 있는 방법 안내해 주시면 감사하겠습니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<!-- 댓글 시작 { -->
<?php if ($is_comment_write && $view['wr_4'] ==2) {
if($w == '')
$w = 'c';
?>
<div class="fmform_title" style="font-weight:700; text-align:center; font-size:110%">프로그램 신청 접수</div>
<aside id="bo_vc_w" class="bo_vc_w">
<h2>댓글쓰기</h2>
<form name="fviewcomment" id="fviewcomment" action="<?php echo $comment_action_url; ?>" onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="comment_id" value="<?php echo $c_id ?>" id="comment_id">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="is_good" value="">
<input type="hidden" name="wr_content" value="신청합니다">
<style>
.text-justify {width:105px; margin:auto; padding-top:4px}
.text-justify span {display:inline-block; font-size:14px; letter-spacing:-2px}
.text-justify ul li {text-align:justify; font-size:1px; font-weight:bold}
.text-justify ul li:after {content:'';display:inline-block; width:100%}
</style>
<div class="tbl_frm01 tbl_wrap">
<table class="text_justify">
<tbody>
<tr>
<th colspan="2" scope="row" style="padding:10px 0">신청자 정보 ※ 신청서를 작성하는 본인(장애인 또는 장애인 가족) 정보 작성</th>
</tr>
<tr>
<th scope="row" style="width:15%"><label for="wr_name"><div class="text-justify">
<ul>
<li>
<span>신</span>
<span>청</span>
<span>자</span>
<span>성</span>
<span>명</span>
</li>
</ul>
</div><strong class="sound_only"> 필수</strong></label></th>
<td><input type="text" name="wr_name" value="<?php echo get_cookie("ck_sns_name"); ?>" id="wr_name" required class="frm_input required" size="20"></td>
</tr>
<tr>
<th scope="row">
<div class="text-justify">
<ul>
<li>
<span>신</span>
<span>청</span>
<span>자</span>
<span>성</span>
<span>별</span>
</li>
</ul>
</div>
</th>
<td><input type="text" name="fm_dadtel" id="fm_dadtel" value="<?php echo $fm_dadtel ?>" class="frm_input"> (예: 남/여)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>신</span>
<span>청</span>
<span>자</span>
<span>생</span>
<span>년</span>
<span>월</span>
<span>일</span>
</li>
</ul>
</div></th>
<td><input type="text" name="fm_extra4" id="fm_extra4" value="<?php echo $fm_extra4 ?>" class="frm_input"> (예: 2003년 12월 15일)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>장</span>
<span>애</span>
<span>유</span>
<span>형</span>
<!--<span>/</span>
<span>급</span>
<span>수</span>-->
</li>
</ul>
</div></th>
<td><input type="text" name="fm_extra5" id="fm_extra5" value="<?php echo $fm_extra5 ?>" class="frm_input"> (예: 지적장애/해당사항 없음)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>신</span>
<span>청</span>
<span>자</span>
<span>연</span>
<span>락</span>
<span>처</span>
</li>
</ul> </th>
<td><input type="text" name="fm_dadname" id="fm_dadname" value="<?php echo $fm_dadname ?>" class="frm_input">
(예: *** 개인정보보호를 위한 휴대폰번호 노출방지 ***)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>주</span>
<span>소</span>
</li>
</ul> </th>
<td><input type="text" name="fm_addr" id="fm_addr" value="<?php echo $fm_addr ?>" class="frm_input full_input"> </td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>기</span>
<span>타</span>
</li>
</ul> </th>
<td><input type="text" name="fm_extra6" id="fm_extra6" value="<?php echo $fm_extra6 ?>" class="frm_input"> </td>
</tr>
<tr>
<th colspan="2" scope="row" style="padding:10px 0">참여자정보 ※ 장애인 정보 작성 </th>
</tr>
<tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>참</span>
<span>여</span>
<span>자</span>
<span>성</span>
<span>명</span>
</li>
</ul> </th>
<td><input type="text" name="fm_momname" id="fm_momname" value="<?php echo $fm_momname ?>" class="frm_input"></td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>신</span>
<span>청</span>
<span>자</span>
<span>와</span>
<span>의</span>
<span>관</span>
<span>계</span>
</li>
</ul>
</div></th>
<td><input type="text" name="fm_extra2" id="fm_extra2" value="<?php echo $fm_extra2 ?>" class="frm_input"> (예: 자/녀/본인)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>참</span>
<span>여</span>
<span>자</span>
<span>성</span>
<span>별</span>
</li>
</ul> </th>
<td><input type="text" name="fm_extra1" id="fm_extra1" value="<?php echo $fm_extra1 ?>" class="frm_input"> (예: 남/여)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>참</span>
<span>여</span>
<span>자</span>
<span>생</span>
<span>년</span>
<span>월</span>
<span>일</span>
</li>
</ul>
</div></th>
<td><input type="text" name="fm_birth" id="fm_birth" value="<?php echo $fm_birth ?>" class="frm_input"> (예: 2003년 12월 15일) </td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>학</span>
<span>교</span>
<span>및</span>
<span>학</span>
<span>년</span>
</li>
</ul> </th>
<td><input type="text" name="fm_extra3" id="fm_extra3" value="<?php echo $fm_extra3 ?>" class="frm_input"> (예 : 홍성고등학교 3학년)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>장</span>
<span>애</span>
<span>유</span>
<span>형</span>
<!--<span>/</span>
<span>급</span>
<span>수</span>-->
</li>
</ul> </th>
<td><input type="text" name="fm_type" id="fm_type" value="<?php echo $fm_type ?>" class="frm_input"> (예 : 지적장애/특수교육대상자)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>참</span>
<span>여</span>
<span>자</span>
<span>연</span>
<span>락</span>
<span>처</span>
</li>
</ul> </th>
<td><input type="text" name="fm_momtel" id="fm_momtel" value="<?php echo $fm_momtel ?>" class="frm_input">
(예: *** 개인정보보호를 위한 휴대폰번호 노출방지 ***)</td>
</tr>
<?php if ($is_guest) { ?>
<tr>
<th scope="row"><label for="wr_password"><div class="text-justify">
<ul>
<li>
<span>비</span>
<span>밀</span>
<span>번</span>
<span>호</span>
</li>
</ul> <strong class="sound_only"> 필수</strong></label></th>
<td><input type="password" name="wr_password" id="wr_password" required class="frm_input required" size="20"> (접수 취소시 필요)</td>
</tr>
<tr>
<th scope="row"><div class="text-justify">
<ul>
<li>
<span>스</span>
<span>팸</span>
<span>등</span>
<span>록</span>
<span>방</span>
<span>지</span>
</li>
</ul> </th>
<td><?php echo $captcha_html; ?></td>
</tr>
<?php } ?>
<tr>
<td colspan="2" style="background:#f7f7f7">
<div class="formagree_wrap">
<h3>사진촬영 & 개인정보 제공 동의서</h3>
상기 본인은 홍성군장애인가족지원센터에서 진행하는 프로그램을 위와 같이 신청하며, 프로그램 사업보고를 위한 사진 촬영 및 보고서류에 개인정보(성명,생년월일 등)와 사진자료 제출에 동의합니다.</div>
<div style="margin:10px 5px">
<input type="checkbox" name="agree" value="1">
<label for="agree">위와 같이 동의하고 프로그램 참가를 신청합니다.</label>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bo_vc_w_wr">
<div class="btn_confirm">
<input type="submit" id="btn_submit" class="btn_submit" value="프로그램 신청하기">
</div>
</div>
</form>
</aside>
<?php } ?>
<?php if ($is_admin || $view['wr_4']!=4) { ?>
<section id="bo_vc">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $board['bo_subject'] ?> 목록</caption>
<thead>
<tr>
<th colspan="9" class="fmlist_title"><i class="fa fa-id-card-o" aria-hidden="true"></i> 접수 신청자 명단 <?php if ($is_admin == 'group') { ?><span><a href="<?php echo $board_skin_url ?>/excel.php?bo_table=<?php echo $bo_table ?>&wr_id=<?php echo $wr_id ?>">엑셀출력</a></span><?php } ?></th>
</tr>
<tr>
<th scope="col">번호</th>
<th scope="col">신청일</th>
<th scope="col">신청자</th>
<th scope="col">신청자<br>
연락처</th>
<th scope="col">참여자</th>
<th scope="col">연락처<br>생년월일</th>
<th scope="col">학교및학년<br>장애유형</th>
<th scope="col">주소</th>
<th scope="col">접수취소</th>
</tr>
</thead>
<tbody>
<?php
$cmt_amt = count($list);
for ($i=0; $i<$cmt_amt; $i++) {
$comment_id = $list[$i]['wr_id'];
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
$comment = $list[$i]['content'];
$comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
if ($is_admin != 'group') {
$list[$i]['wr_name'] = preg_replace('/(?<=.{1})./u','*',$list[$i]['wr_name']);
$list[$i]['fm_dadname'] = preg_replace('/(?<=.{4})./u','*',$list[$i]['fm_dadname']);
$list[$i]['fm_dadtel'] = preg_replace('/(?<=.{4})./u','*',$list[$i]['fm_dadtel']);
$list[$i]['fm_momname'] = preg_replace('/(?<=.{1})./u','*',$list[$i]['fm_momname']);
$list[$i]['fm_extra1'] = "****";;
$list[$i]['fm_extra2'] = "****";;
$list[$i]['fm_momtel'] = preg_replace('/(?<=.{4})./u','*',$list[$i]['fm_momtel']);
$list[$i]['fm_birth'] = preg_replace('/(?<=.{2})./u','*',$list[$i]['fm_birth']);
$list[$i]['fm_extra3'] = preg_replace('/(?<=.{1})./u','*',$list[$i]['fm_extra3']);
$list[$i]['fm_type'] = preg_replace('/(?<=.{1})./u','*',$list[$i]['fm_type']);
$list[$i]['fm_addr'] = "**********";
}
?>
<tr>
<td class="td_num"><?php echo $i+1 ?></td>
<td class="td_w_data" style="width:110px; text-align:center"> <?php echo $list[$i]['datetime'] ?></td>
<td class="td_name"><?php echo $list[$i]['wr_name'] ?></td>
<td class="td_type" style="width:110px"><?php echo $list[$i]['fm_dadname'] ?></td>
<td class="td_birth"><?php echo $list[$i]['fm_momname'] ?><br><?php echo $list[$i]['fm_extra1'] ?></td>
<td class="td_tel"><?php echo $list[$i]['fm_momtel'] ?><br><?php echo $list[$i]['fm_birth'] ?></td>
<td class="td_tel" style="width:130px"><?php echo $list[$i]['fm_extra3'] ?><br><?php echo $list[$i]['fm_type'] ?></td>
<td class="td_addr"><?php echo $list[$i]['fm_addr'] ?></td>
<td class="td_config">
<?php if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']);
if($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
$cmt['wr_content'] = '';
$c_wr_content = $cmt['wr_content'];
}
$c_reply_href = './board.php?'.$query_string.'&c_id='.$comment_id.'&w=c#bo_vc_w';
$c_edit_href = './board.php?'.$query_string.'&c_id='.$comment_id.'&w=cu#bo_vc_w';
?>
<ul class="bo_vc_act">
<?php if ($view['wr_4'] ==2 && $list[$i]['is_edit']) { ?><li><a href="<?php echo $c_edit_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'cu'); return false;" class="btn_b03">수정</a></li><?php } ?>
<?php if ($view['wr_4'] ==2 && $list[$i]['is_del'] || $is_admin) { ?><li><a href="<?php echo $list[$i]['del_link']; ?>" onclick="return comment_delete();" class="btn_b03">취소</a></li><?php } ?>
</ul>
<?php } ?>
</td>
</tr>
<span id="edit_<?php echo $comment_id ?>" class="bo_vc_w"></span><!-- 수정 -->
<span id="reply_<?php echo $comment_id ?>" class="bo_vc_w"></span><!-- 답변 -->
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_type'] ?>" id="save_comment_type_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_birth'] ?>" id="save_comment_birth_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_addr'] ?>" id="save_comment_addr_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_dadname'] ?>" id="save_comment_dadname_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_dadtel'] ?>" id="save_comment_dadtel_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_momname'] ?>" id="save_comment_momname_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_momtel'] ?>" id="save_comment_momtel_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_extra1'] ?>" id="save_comment_extra1_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_extra2'] ?>" id="save_comment_extra2_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_extra3'] ?>" id="save_comment_extra3_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_extra4'] ?>" id="save_comment_extra4_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_extra5'] ?>" id="save_comment_extra5_<?php echo $comment_id ?>">
<input type="hidden" value="<?php echo $list[$i]['fm_extra6'] ?>" id="save_comment_extra6_<?php echo $comment_id ?>">
<?php } ?>
<?php if ($i == 0) { //댓글이 없다면 ?><tr><td colspan="9"><p id="bo_vc_empty"> </p></td><tr><?php } ?>
</tbody>
</table>
</div>
</section>
<?php } ?>
<!-- } 댓글 끝 -->
<?php if ($is_comment_write) {
if($w == '')
$w = 'c';
?>
<script>
var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML;
function fviewcomment_submit(f)
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.is_good.value = 0;
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
if (typeof(f.wr_name) != 'undefined')
{
f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '')
{
alert('이름이 입력되지 않았습니다.');
f.wr_name.focus();
return false;
}
}
if (typeof(f.wr_password) != 'undefined')
{
f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '')
{
alert('비밀번호가 입력되지 않았습니다.');
f.wr_password.focus();
return false;
}
}
if (!f.agree.checked) {
alert("개인정보 제공에 동의하셔야 신청할 수 있습니다.");
f.agree.focus();
return false;
}
<?php if($is_guest) echo chk_captcha_js(); ?>
set_comment_token(f);
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
function comment_box(comment_id, work)
{
var el_id,
form_el = 'fviewcomment',
respond = document.getElementById(form_el);
// 댓글 아이디가 넘어오면 답변, 수정
if (comment_id)
{
if (work == 'c')
el_id = 'reply_' + comment_id;
else
el_id = 'edit_' + comment_id;
}
else
el_id = 'bo_vc_w';
if (save_before != el_id)
{
if (save_before)
{
document.getElementById(save_before).style.display = 'none';
}
document.getElementById(el_id).style.display = '';
document.getElementById(el_id).appendChild(respond);
//입력값 초기화
// 댓글 수정
if (work == 'cu')
{
document.getElementById('fm_type').value = document.getElementById('save_comment_type_' + comment_id).value;
document.getElementById('fm_birth').value = document.getElementById('save_comment_birth_' + comment_id).value;
document.getElementById('fm_addr').value = document.getElementById('save_comment_addr_' + comment_id).value;
document.getElementById('fm_dadname').value = document.getElementById('save_comment_dadname_' + comment_id).value;
document.getElementById('fm_dadtel').value = document.getElementById('save_comment_dadtel_' + comment_id).value;
document.getElementById('fm_momname').value = document.getElementById('save_comment_momname_' + comment_id).value;
document.getElementById('fm_momtel').value = document.getElementById('save_comment_momtel_' + comment_id).value;
document.getElementById('fm_extra1').value = document.getElementById('save_comment_extra1_' + comment_id).value;
document.getElementById('fm_extra2').value = document.getElementById('save_comment_extra2_' + comment_id).value;
document.getElementById('fm_extra3').value = document.getElementById('save_comment_extra3_' + comment_id).value;
document.getElementById('fm_extra4').value = document.getElementById('save_comment_extra4_' + comment_id).value;
document.getElementById('fm_extra5').value = document.getElementById('save_comment_extra5_' + comment_id).value;
document.getElementById('fm_extra6').value = document.getElementById('save_comment_extra6_' + comment_id).value;
}
document.getElementById('comment_id').value = comment_id;
document.getElementById('w').value = work;
if(save_before)
$("#captcha_reload").trigger("click");
save_before = el_id;
}
}
function comment_delete()
{
return confirm("이 접수 내역을 삭제하시겠습니까?");
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
</script>
<?php } ?>
답변 4
기본 구조가 댓글 수정시 이름은 수정되지않습니다
스킨폴더에 write_comment_update.skin.php 화일을 만들고 다음 코드를 넣으세요
if ($w == 'cu'){
$wr_name = clean_xss_tags(trim($_POST['wr_name']));
sql_query("update $write_table set wr_name='$wr_name' where wr_id = '$comment_id' ");
}
해당스킨 업로드 했습니다.
참고 부탁드립니다.
https://drive.google.com/file/d/1ep-x5GpuKFFR21DZbBEF5ci_LSGq142h/view?usp=sharing
신청자 성명이 get_cookie("ck_sns_name"); 쿠키값으로 되어 있는데 이게 값이 없는게 아닌가 싶은데
구조를 알수 없다보니 신청자 성명을 쿠키로 적용한 이유가 있을까요?
쓰기 부분이 아니라 수정시 코드를 가져오셔야 알수 있습니다.
wr_name 쪽 hidden 으로 되어있을것 같은데 채크해보세요.