사용후기 관련된 코드 변경

This commit is contained in:
gnuboard
2013-06-14 16:56:34 +09:00
parent 8e05a87f05
commit 7dbff272b4
23 changed files with 700 additions and 82 deletions

View File

@ -136,7 +136,7 @@ function imageview(id, w, h)
</a>
</li>
<li>
<a href="<?php echo G4_ADMIN_URL; ?>/shop_admin/itempslist.php">
<a href="<?php echo G4_ADMIN_URL; ?>/shop_admin/itemuselist.php">
<img src="<?php echo G4_ADMIN_URL; ?>/shop_admin/img/qnb_sps.jpg" alt="" width="40" height="40">
사용후기
</a>

View File

@ -10,7 +10,7 @@ $menu['menu400'] = array (
array('400200', '분류관리', G4_ADMIN_URL.'/shop_admin/categorylist.php', 'scf_cate'),
array('400300', '상품관리', G4_ADMIN_URL.'/shop_admin/itemlist.php', 'scf_item'),
array('400660', '상품문의', G4_ADMIN_URL.'/shop_admin/itemqalist.php', 'scf_item_qna'),
array('400650', '사용후기', G4_ADMIN_URL.'/shop_admin/itempslist.php', 'scf_ps'),
array('400650', '사용후기', G4_ADMIN_URL.'/shop_admin/itemuselist.php', 'scf_ps'),
array('400620', '상품재고관리', G4_ADMIN_URL.'/shop_admin/itemstocklist.php', 'scf_item_stock'),
array('400610', '상품유형관리', G4_ADMIN_URL.'/shop_admin/itemtypelist.php', 'scf_item_type'),
array('400500', '상품옵션재고관리', G4_ADMIN_URL.'/shop_admin/optionstocklist.php', 'scf_item_option'),

View File

@ -754,12 +754,12 @@ $pg_anchor = '<ul class="anchor">
</td>
</tr>
<tr>
<th scope="row"><label for="de_item_ps_use">사용후기</label></th>
<th scope="row"><label for="de_item_use_use">사용후기</label></th>
<td>
<?php echo help("사용후기가 올라오면, 즉시 출력 혹은 관리자 승인 후 출력 여부를 설정합니다.", 50); ?>
<select name="de_item_ps_use" id="de_item_ps_use">
<option value="0" <?php echo get_selected($default['de_item_ps_use'], 0); ?>>즉시 출력</option>
<option value="1" <?php echo get_selected($default['de_item_ps_use'], 1); ?>>관리자 승인 후 출력</option>
<select name="de_item_use_use" id="de_item_use_use">
<option value="0" <?php echo get_selected($default['de_item_use_use'], 0); ?>>즉시 출력</option>
<option value="1" <?php echo get_selected($default['de_item_use_use'], 1); ?>>관리자 승인 후 출력</option>
</select>
</td>
</tr>

View File

@ -133,7 +133,7 @@ $sql = " update {$g4['shop_default_table']}
de_sms_use4 = '$de_sms_use4',
de_sms_use5 = '$de_sms_use5',
de_sms_hp = '$de_sms_hp',
de_item_ps_use = '$de_item_ps_use',
de_item_use_use = '$de_item_use_use',
de_code_dup_use = '$de_code_dup_use',
de_cart_keep_term = '$de_cart_keep_term',
de_guest_cart_use = '$de_guest_cart_use',

View File

@ -160,7 +160,7 @@ $pg_anchor = '<ul class="anchor">
</thead>
<tbody>
<?php
$sql = " select * from {$g4[shop_item_ps_table]}
$sql = " select * from {$g4[shop_item_use_table]}
where is_confirm = 0
order by is_id desc
limit $max_limit ";
@ -175,7 +175,7 @@ $pg_anchor = '<ul class="anchor">
<tr>
<td class="td_name"><?php echo $name; ?></td>
<td><?php echo cut_str($row['is_subject'],40); ?></td>
<td class="td_smallmng"><a href="./itempsform.php?w=u&amp;is_id=<?php echo $row['is_id']; ?>"><img src="./img/icon_mod.jpg" alt="<?php cut_str($row['is_subject'],40); ?> 수정"></a></td>
<td class="td_smallmng"><a href="./itemuseform.php?w=u&amp;is_id=<?php echo $row['is_id']; ?>"><img src="./img/icon_mod.jpg" alt="<?php cut_str($row['is_subject'],40); ?> 수정"></a></td>
</tr>
<?php
}
@ -185,7 +185,7 @@ $pg_anchor = '<ul class="anchor">
</table>
<div class="btn_ft">
<a href="./itempslist.php?sort1=is_confirm&amp;sort2=asc">사용후기 더보기</a>
<a href="./itemuselist.php?sort1=is_confirm&amp;sort2=asc">사용후기 더보기</a>
</div>
</section>

View File

@ -49,7 +49,7 @@ if (!function_exists("itemdelete")) {
sql_query($sql);
// 사용후기삭제
$sql = " delete from {$g4['shop_item_ps_table']} where it_id = '$it_id' ";
$sql = " delete from {$g4['shop_item_use_table']} where it_id = '$it_id' ";
sql_query($sql);
// 상품문의삭제

View File

@ -201,7 +201,7 @@ $pg_anchor ='<ul class="anchor">
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
<span class="frm_ca_id"><?php echo $it['it_id']; ?></span>
<a href="<?php echo G4_SHOP_URL; ?>/item.php?it_id=<?php echo $it_id; ?>" class="btn_frmline">상품확인</a>
<a href="<?php echo G4_ADMIN_URL; ?>/shop_admin/itempslist.php?sel_field=a.it_id&amp;search=<?php echo $it_id; ?>" class="btn_frmline">사용후기</a>
<a href="<?php echo G4_ADMIN_URL; ?>/shop_admin/itemuselist.php?sel_field=a.it_id&amp;search=<?php echo $it_id; ?>" class="btn_frmline">사용후기</a>
<a href="<?php echo G4_ADMIN_URL; ?>/shop_admin/itemqalist.php?sel_field=a.it_id&amp;search=<?php echo $it_id; ?>" class="btn_frmline">상품문의</a>
<?php } ?>
</td>

View File

@ -0,0 +1,96 @@
<?php
$sub_menu = '400650';
include_once('./_common.php');
include_once(G4_CKEDITOR_PATH.'/ckeditor.lib.php');
auth_check($auth[$sub_menu], "w");
$sql = " select *
from {$g4['shop_item_use_table']} a
left join {$g4['member_table']} b on (a.mb_id = b.mb_id)
left join {$g4['shop_item_table']} c on (a.it_id = c.it_id)
where is_id = '$is_id' ";
$is = sql_fetch($sql);
if (!$is['is_id'])
alert('등록된 자료가 없습니다.');
$name = get_sideview($is['mb_id'], get_text($is['is_name']), $is['mb_email'], $is['mb_homepage']);
// 확인
$is_confirm_yes = $is['is_confirm'] ? 'checked="checked"' : '';
$is_confirm_no = !$is['is_confirm'] ? 'checked="checked"' : '';
$g4['title'] = '사용후기';
include_once (G4_ADMIN_PATH.'/admin.head.php');
$qstr = 'page='.$page.'&amp;sort1='.$sort1.'&amp;sort2='.$sort2;
?>
<form name="fitemuseform" method="post" action="./itemuseformupdate.php" onsubmit="return fitemuseform_submit(this);">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="is_id" value="<?php echo $is_id; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="is_confirm" value="<?php echo $is['is_confirm']; ?>">
<section class="cbox">
<h2>사용후기 수정</h2>
<table class="frm_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">상품명</th>
<td><a href="<?php echo G4_SHOP_URL; ?>/item.php?it_id=<?php echo $is['it_id']; ?>"><?php echo $is['it_name']; ?></a></td>
</tr>
<tr>
<th scope="row">이름</th>
<td><?php echo $name; ?></td>
</tr>
<tr>
<th scope="row">점수</th>
<td><?php echo stripslashes($is['is_score']); ?> 점</td>
</tr>
<tr>
<th scope="row"><label for="is_subject">제목</label></th>
<td><input type="text" name="is_subject" required class="required frm_input" id="is_subject" size="100"
value='<?php echo conv_subject($is['is_subject'], 120); ?>'></td>
</tr>
<tr>
<th scope="row">내용</th>
<td><?php echo editor_html('is_content', $is['is_content']); ?></td>
</tr>
<tr>
<th scope="row">확인</th>
<td>
<input type="radio" name="is_confirm" value="1" id="is_confirm_yes" <?php echo $is_confirm_yes; ?>>
<label for="is_confirm_yes">예</label>
<input type="radio" name="is_confirm" value="0" id="is_confirm_no" <?php echo $is_confirm_no; ?>>
<label for="is_confirm_no">아니오</label>
</td>
</tr>
</tbody>
</table>
</section>
<div class="btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="./itemuselist.php?<?php echo $qstr; ?>">목록</a>
</div>
</form>
<script>
function fitemuseform_submit(f)
{
<?php echo get_editor_js('is_content'); ?>
return true;
}
</script>
<?php
include_once (G4_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,29 @@
<?php
$sub_menu = '400650';
include_once('./_common.php');
check_demo();
if ($w == 'd')
auth_check($auth[$sub_menu], "d");
else
auth_check($auth[$sub_menu], "w");
$qstr = "page=$page&amp;sort1=$sort1&amp;sort2=$sort2";
if ($w == "u")
{
$sql = "update {$g4['shop_item_use_table']}
set is_subject = '$is_subject',
is_content = '$is_content',
is_confirm = '$is_confirm'
where is_id = '$is_id' ";
sql_query($sql);
goto_url("./itemuseform.php?w=$w&amp;is_id=$is_id&amp;$qstr");
}
else
{
alert();
}
?>

View File

@ -0,0 +1,221 @@
<?php
$sub_menu = '400650';
include_once('./_common.php');
auth_check($auth[$sub_menu], "r");
$g4['title'] = '사용후기';
include_once (G4_ADMIN_PATH.'/admin.head.php');
$where = " where ";
$sql_search = "";
if ($stx != "") {
if ($sfl != "") {
$sql_search .= " $where $sfl like '%$stx%' ";
$where = " and ";
}
if ($save_stx != $stx)
$page = 1;
}
if ($sca != "") {
$sql_search .= " and ca_id like '$sca%' ";
}
if ($sfl == "") $sfl = "a.it_name";
if (!$sst) {
$sst = "is_id";
$sod = "desc";
}
$sql_common = " from {$g4['shop_item_use_table']} a
left join {$g4['shop_item_table']} b on (a.it_id = b.it_id)
left join {$g4['member_table']} c on (a.mb_id = c.mb_id) ";
$sql_common .= $sql_search;
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$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
order by $sst $sod, is_id desc
limit $from_record, $rows ";
$result = sql_query($sql);
//$qstr = 'page='.$page.'&amp;sst='.$sst.'&amp;sod='.$sod.'&amp;stx='.$stx;
$qstr = $qstr.'&amp;sca='.$sca.'&amp;save_stx='.$stx;
$listall = '';
if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
$listall = '<a href="'.$_SERVER['PHP_SELF'].'">전체목록</a>';
?>
<form name="flist">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
<fieldset>
<legend>사용후기 검색</legend>
<span>
<?php echo $listall; ?>
전체 후기내역 <?php echo $total_count; ?>건
</span>
<label for="sca" class="sound_only">분류선택</label>
<?php // ##### // 웹 접근성 취약 지점 시작 - 지운아빠 2013-04-12 ?>
<select name="sca" id="sca">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g4['shop_category_table']} order by ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
echo "<option value='{$row1['ca_id']}'>$nbsp{$row1['ca_name']}\n";
}
?>
</select>
<?php // ##### // 웹 접근성 취약 지점 끝 ?>
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="it_name" <?php echo get_selected($sfl, 'it_name'); ?>>상품명</option>
<option value="a.it_id" <?php echo get_selected($sfl, 'a.it_id'); ?>>상품코드</option>
<option value="is_name" <?php echo get_selected($sfl, 'is_name'); ?>>이름</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx; ?>" required class="frm_input required">
<input type="submit" value="검색" class="btn_submit">
</fieldset>
</form>
<section class="cbox">
<h2>사용후기 목록</h2>
<ul class="sort_odr">
<li><?php echo subject_sort_link("it_name"); ?>상품명</a></li>
<li><?php echo subject_sort_link("mb_name"); ?>이름</a></li>
<li><?php echo subject_sort_link("is_subject"); ?>제목</a></li>
<li><?php echo subject_sort_link("is_score"); ?>점수</a></li>
<li><?php echo subject_sort_link("is_confirm"); ?>확인</a></li>
</ul>
<form name="fitemuselist" method="post" action="./itemuselistupdate.php" onsubmit="return fitemuselist_submit(this);" autocomplete="off">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<table class="frm_basic">
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">사용후기 전체</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<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>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
$row['is_subject'] = cut_str($row['is_subject'], 30, "...");
$href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$name = get_sideview($row['mb_id'], get_text($row['is_name']), $row['mb_email'], $row['mb_homepage']);
$is_content = get_view_thumbnail($row['is_content'], 300);
?>
<tr>
<td>
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['is_subject']) ?> 사용후기</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
<input type="hidden" name="is_id[<?php echo $i; ?>]" value="<?php echo $row['is_id']; ?>">
</td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td class="td_name"><?php echo $name; ?></td>
<td class="sit_use_subject">
<a href="#" class="use_href" onclick="return false;" target="<?php echo $i; ?>"><?php echo $row['is_subject']; ?></a>
<div id="use_div<?php echo $i; ?>" class="use_div" style="display:none;">
<?php echo $is_content; ?>
</div>
</td>
<td class="td_num"><?php echo $row['is_score']; ?></td>
<td class="sit_use_confirm"><input type="checkbox" name="is_confirm[<?php echo $i; ?>]" <?php echo ($row['is_confirm'] ? 'checked' : ''); ?> value="1"></td>
<td class="td_smallmng">
<a href="./itemuseform.php?w=u&amp;is_id=<?php echo $row['is_id']; ?>&amp;$qstr"><span class="sound_only"><?php echo $row['is_subject']; ?> </span>수정</a>
</td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="7" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
<div class="btn_list">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div>
</form>
</section>
<?php echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page="); ?>
<script>
function fitemuselist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
$(function(){
$(".use_href").click(function(){
var $content = $("#use_div"+$(this).attr("target"));
$(".use_div").each(function(index, value){
if ($(this).get(0) == $content.get(0)) { // 객체의 비교시 .get(0) 를 사용한다.
$(this).is(":hidden") ? $(this).show() : $(this).hide();
} else {
$(this).hide();
}
});
});
});
</script>
<?php
include_once (G4_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,39 @@
<?php
$sub_menu = '400650';
include_once('./_common.php');
check_demo();
if (!count($_POST['chk'])) {
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
}
if ($_POST['act_button'] == "선택수정") {
auth_check($auth[$sub_menu], 'w');
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$sql = "update {$g4['shop_item_use_table']}
set is_confirm = '{$_POST['is_confirm'][$k]}'
where is_id = '{$_POST['is_id'][$k]}' ";
sql_query($sql);
}
} else if ($_POST['act_button'] == "선택삭제") {
auth_check($auth[$sub_menu], 'd');
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$sql = "delete from {$g4['shop_item_use_table']} where is_id = '{$_POST['is_id'][$k]}' ";
sql_query($sql);
}
}
goto_url("./itemuselist.php?sca=$sca&amp;sst=$sst&amp;sod=$sod&amp;sfl=$sfl&amp;stx=$stx&amp;page=$page");
?>