사용후기 관련된 코드 변경

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");
?>

View File

@ -232,8 +232,8 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
.sit_qa_answer {width:30px;text-align:center}
/* 사용후기 */
.sit_ps_subject {width:290px}
.sit_ps_confirm {width:30px;text-align:center}
.sit_use_subject {width:290px}
.sit_use_confirm {width:30px;text-align:center}
/* 상품옵션재고관리 */
.sit_stock_qty_alert {color:#ff1133;font-weight:bold}

View File

@ -142,7 +142,7 @@ if(intval(preg_replace("/[^0-9]/", "", $row['Type'])) != 20) {
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_qa_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_ps_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_use_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_relation_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_relation_table']}` MODIFY COLUMN it_id2 VARCHAR(20) NOT NULL DEFAULT '' ", false);
sql_query(" ALTER TABLE `{$g4['shop_event_item_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);

View File

@ -284,7 +284,7 @@ if($shop_install) {
de_simg_height = '$simg_height',
de_mimg_width = '$mimg_width',
de_mimg_height = '$mimg_height',
de_item_ps_use = '1',
de_item_use_use = '1',
de_level_sell = '1',
de_code_dup_use = '1',
de_sms_cont1 = '{이름}님의 회원가입을 축하드립니다.\nID:{회원아이디}\n{회사명}',
@ -485,7 +485,7 @@ if($shop_install) {
fwrite($f, "\$g4['shop_faq_master_table'] = SHOP_TABLE_PREFIX.'faq_master'; // 자주하시는 질문 마스터 테이블\n");
fwrite($f, "\$g4['shop_item_table'] = SHOP_TABLE_PREFIX.'item'; // 상품 테이블\n");
fwrite($f, "\$g4['shop_item_option_table'] = SHOP_TABLE_PREFIX.'item_option'; // 상품옵션 테이블\n");
fwrite($f, "\$g4['shop_item_ps_table'] = SHOP_TABLE_PREFIX.'item_ps'; // 상품 사용후기 테이블\n");
fwrite($f, "\$g4['shop_item_use_table'] = SHOP_TABLE_PREFIX.'item_use'; // 상품 사용후기 테이블\n");
fwrite($f, "\$g4['shop_item_qa_table'] = SHOP_TABLE_PREFIX.'item_qa'; // 상품 질문답변 테이블\n");
fwrite($f, "\$g4['shop_item_relation_table'] = SHOP_TABLE_PREFIX.'item_relation'; // 관련 상품 테이블\n");
fwrite($f, "\$g4['shop_new_win_table'] = SHOP_TABLE_PREFIX.'new_win'; // 새창 테이블\n");

View File

@ -280,7 +280,7 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
`de_sms_hp` varchar(255) NOT NULL DEFAULT '',
`de_kcp_mid` varchar(255) NOT NULL DEFAULT '',
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_ps_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_use_use` tinyint(4) NOT NULL DEFAULT '0',
`de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0',
`de_cart_keep_term` int(11) NOT NULL DEFAULT '0',
`de_guest_cart_use` tinyint(4) NOT NULL DEFAULT '0',
@ -475,11 +475,11 @@ CREATE TABLE IF NOT EXISTS `shop_item_option` (
-- --------------------------------------------------------
--
-- Table structure for table `shop_item_ps`
-- Table structure for table `shop_item_use`
--
DROP TABLE IF EXISTS `shop_item_ps`;
CREATE TABLE IF NOT EXISTS `shop_item_ps` (
DROP TABLE IF EXISTS `shop_item_use`;
CREATE TABLE IF NOT EXISTS `shop_item_use` (
`is_id` int(11) NOT NULL AUTO_INCREMENT,
`it_id` varchar(20) NOT NULL DEFAULT '0',
`mb_id` varchar(20) NOT NULL DEFAULT '',

View File

@ -448,7 +448,7 @@ function get_star_image($it_id)
{
global $g4;
$sql = "select (SUM(is_score) / COUNT(*)) as score from {$g4['shop_item_ps_table']} where it_id = '$it_id' ";
$sql = "select (SUM(is_score) / COUNT(*)) as score from {$g4['shop_item_use_table']} where it_id = '$it_id' ";
$row = sql_fetch($sql);
return (int)get_star($row['score']);

View File

@ -14,7 +14,7 @@ include_once(G4_LIB_PATH.'/thumb.lib.php');
</tr>
</thead>
<?php
$sql_common = " from {$g4['shop_item_ps_table']} where it_id = '{$it['it_id']}' and is_confirm = '1' ";
$sql_common = " from {$g4['shop_item_use_table']} where it_id = '{$it['it_id']}' and is_confirm = '1' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;

View File

@ -147,6 +147,16 @@ if ($row['it_id']) {
$next_href2 = '';
}
// 관리자가 확인하 사용후기의 갯수를 얻음
$sql = " select count(*) as cnt from `{$g4['shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$row = sql_fetch($sql);
$item_use_count = $row['cnt'];
// 상품문의의 갯수를 얻음
$sql = " select count(*) as cnt from `{$g4['shop_item_qa_table']}` where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
// 관련상품의 갯수를 얻음
$sql = " select count(*) as cnt
from {$g4['shop_item_relation_table']} a
@ -159,14 +169,15 @@ $item_relation_count = $row['cnt'];
<?php
function pg_anchor($anc_id) {
global $default;
global $item_use_count, $item_qa_count, $item_relation_count;
?>
<ul class="sanchor">
<li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li>
<li><a href="#sit_use" <?php if ($anc_id == 'use') echo 'class="sanchor_on"'; ?>>사용후기 <span class="item_use_count"></span></a></li>
<li><a href="#sit_qa" <?php if ($anc_id == 'qa') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_count"></span></a></li>
<li><a href="#sit_use" <?php if ($anc_id == 'use') echo 'class="sanchor_on"'; ?>>사용후기 <span class="item_use_count"><?php echo $item_use_count; ?></span></a></li>
<li><a href="#sit_qa" <?php if ($anc_id == 'qa') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_count"><?php echo $item_qa_count; ?></span></a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="#sit_dvr" <?php if ($anc_id == 'dvr') echo 'class="sanchor_on"'; ?>>배송정보</a></li><?php } ?>
<?php if ($default['de_change_content']) { ?><li><a href="#sit_ex" <?php if ($anc_id == 'ex') echo 'class="sanchor_on"'; ?>>교환정보</a></li><?php } ?>
<li><a href="#sit_rel" <?php if ($anc_id == 'rel') echo 'class="sanchor_on"'; ?>>관련상품 <span class="item_relation_count"></span></a></li>
<li><a href="#sit_rel" <?php if ($anc_id == 'rel') echo 'class="sanchor_on"'; ?>>관련상품 <span class="item_relation_count"><?php echo $item_relation_count; ?></span></a></li>
</ul>
<?php } ?>
@ -659,9 +670,9 @@ else
return false;
});
$(".item_use_count").text("<?php echo $use_total_count; ?>");
$(".item_qa_count").text("<?php echo $qa_total_count; ?>");
$(".item_relation_count").text("<?php echo $item_relation_count; ?>");
//$(".item_use_count").text("<?php echo $use_total_count; ?>");
//$(".item_qa_count").text("<?php echo $qa_total_count; ?>");
//$(".item_relation_count").text("<?php echo $item_relation_count; ?>");
});
// 바로구매 또는 장바구니 담기

View File

@ -4,8 +4,8 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
$it_id = $_REQUEST['it_id'];
$itemuse_write = G4_BBS_URL.'/write.php?bo_table=itemuse&amp;wr_1='.$it_id;
$itemuse_board = G4_BBS_URL.'/board.php?bo_table=itemuse&amp;wr_1='.$it_id;
$itemuse_form = "./itemuseform.php?it_id=".$it_id;
$itemuse_list = "./itemuselist.php";
include_once(G4_PATH.'/head.sub.php');
?>
@ -30,7 +30,7 @@ include_once(G4_PATH.'/head.sub.php');
wr_4 : 관리자확인
*/
//$sql_common = " from `{$g4['write_prefix']}itemuse` where wr_is_comment = 0 and wr_1 = '{$it['it_id']}' and wr_4 = '1' ";
$sql_common = " from `{$g4['write_prefix']}itemuse` where wr_is_comment = 0 and wr_1 = '{$it_id}' ";
$sql_common = " from `{$g4['shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
@ -42,34 +42,34 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
$sql = "select * $sql_common order by wr_num limit $from_record, $rows ";
$sql = "select * $sql_common order by is_id desc limit $from_record, $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$use_num = $total_count - ($page - 1) * $rows - $i;
$use_star = get_star($row['wr_3']);
$use_name = get_text($row['wr_name']);
$use_subject = conv_subject($row['wr_subject'],50,"…");
//$use_content = ($row['wr_content']);
$use_content = get_view_thumbnail($row['wr_content'], 300);
$use_time = substr($row['wr_datetime'], 2, 8);
$use_href = G4_BBS_URL.'/board.php?bo_table=itemuse&amp;wr_id='.$row['wr_id'];
$is_num = $total_count - ($page - 1) * $rows - $i;
$is_star = get_star($row['is_score']);
$is_name = get_text($row['is_name']);
$is_subject = conv_subject($row['is_subject'],50,"…");
//$is_content = ($row['wr_content']);
$is_content = get_view_thumbnail($row['is_content'], 300);
$is_time = substr($row['is_time'], 2, 8);
$is_href = './itemuselist.php?bo_table=itemuse&amp;wr_id='.$row['wr_id'];
// http://stackoverflow.com/questions/6967081/show-hide-multiple-divs-with-jquery?answertab=votes#tab-top
?>
<tr>
<td class="td_num"><?php echo $use_num; ?><span class="sound_only">번</span></td>
<td class="td_num"><?php echo $is_num; ?><span class="sound_only">번</span></td>
<td>
<a href="<?php echo $use_href; ?>" class="use_href" onclick="return false;" target="<?php echo $i; ?>"><?php echo $use_subject; ?></a>
<a href="#sit_use" class="use_href" onclick="return false;" target="<?php echo $i; ?>"><?php echo $is_subject; ?></a>
<div id="use_div<?php echo $i; ?>" class="use_div" style="display:none;">
<?php echo $use_content; ?>
<?php echo $is_content; ?>
</div>
</td>
<td><?php echo $use_name; ?></td>
<td><?php echo $use_time; ?></td>
<td><img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $use_star; ?>.png" alt="별<?php echo $use_star; ?>개"></td>
<td><?php echo $is_name; ?></td>
<td><?php echo $is_time; ?></td>
<td><img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $is_star; ?>.png" alt="별<?php echo $is_star; ?>개"></td>
</tr>
<?php
@ -126,23 +126,25 @@ echo itemuse_page(10, $page, $total_page, "./itemuse.php?it_id=$it_id&amp;page="
<div class="sit_use_btn">
<!-- <a href="javascript:itemusewin('it_id=<?php echo $it_id; ?>');">사용후기 쓰기<span class="sound_only"> 새 창</span></a> -->
<a href="<?php echo $itemuse_write; ?>" id="itemuse_write" onclick="return false;" class="btn02">사용후기 쓰기<span class="sound_only"> 새 창</span></a>
<a href="<?php echo $itemuse_board; ?>" id="itemuse_board" target="_blank" class="btn01">더보기</a>
<a href="<?php echo $itemuse_form; ?>" id="itemuse_form" onclick="return false;" class="btn02">사용후기 쓰기<span class="sound_only"> 새 창</span></a>
<a href="<?php echo $itemuse_list; ?>" id="itemuse_list" class="btn01">더보기</a>
</div>
<script>
$(function(){
$("#itemuse_write").click(function(){
window.open(this.href, "itemuse_write", "width=800,height=550");
});
$("#itemuse_board").click(function(){
window.open(this.href, "itemuse_board", "width=800,height=550");
$("#itemuse_form").click(function(){
window.open(this.href, "itemuse_form", "width=800,height=550");
});
$(".use_href").click(function(){
$(".use_div").hide();
$("#use_div"+$(this).attr("target")).show();
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();
}
});
});
$(".pg_page").click(function(){

107
shop/itemuseform.php Normal file
View File

@ -0,0 +1,107 @@
<?php
include_once("./_common.php");
include_once(G4_CKEDITOR_PATH.'/ckeditor.lib.php');
// 사용후기의 내용에 쓸수 있는 최대 글자수 (한글은 영문3자)
$is_content_max_length = 10000;
$w = escape_trim($_REQUEST['w']);
$it_id = escape_trim($_REQUEST['it_id']);
$is_id = escape_trim($_REQUEST['is_id']);
if (!$is_member) {
alert("사용후기는 회원만 평가가 가능합니다.", G4_BBS_URL."/login.php");
}
if ($w == "") {
$is_score = 10;
} else if ($w == "u") {
$use = sql_fetch(" select * from {$g4['shop_item_use_table']} where is_id = '$is_id' ");
if (!$use) {
alert_close("사용후기 정보가 없습니다.");
}
$it_id = $use['it_id'];
$is_score = $use['is_score'];
if (!$is_admin && $use['mb_id'] != $member['mb_id']) {
alert_close("자신의 사용후기만 수정이 가능합니다.");
}
}
include_once(G4_PATH.'/head.sub.php');
?>
<style>
ul {list-style:none;margin:0px;padding:0px;}
label {width:130px;vertical-align:top;padding:3px 0;}
</style>
<div style="padding:10px;">
<form name="fitemuse" method="post" action="./itemuseformupdate.php" onsubmit="return fitemuse_submit(this);" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="it_id" value="<?php echo $it_id; ?>">
<input type="hidden" name="is_id" value="<?php echo $is_id; ?>">
<fieldset style="padding:0 10px 10px;">
<legend><strong>사용후기 쓰기</strong></legend>
<ul style="padding:10px;">
<li>
<label for="is_subject">제목</label>
<input type="text" id="is_subject" name="is_subject" size="100" class="ed" minlength="2" maxlength="250" required itemname="제목" value="<?php echo get_text($use['is_subject']); ?>">
</li>
<li>
<label for="" style="width:200px;">내용</label>
<?php echo editor_html('is_content', $use['is_content']); ?>
</li>
<li>
<label>평가</label>
<input type=radio name=is_score value='10' <?php echo ($is_score==10)?"checked='checked'":""; ?>><img src='<?php echo G4_SHOP_URL; ?>/img/star5.gif' align=absmiddle>
<input type=radio name=is_score value='8' <?php echo ($is_score==8)?"checked='checked'":""; ?>><img src='<?php echo G4_SHOP_URL; ?>/img/star4.gif' align=absmiddle>
<input type=radio name=is_score value='6' <?php echo ($is_score==6)?"checked='checked'":""; ?>><img src='<?php echo G4_SHOP_URL; ?>/img/star3.gif' align=absmiddle>
<input type=radio name=is_score value='4' <?php echo ($is_score==4)?"checked='checked'":""; ?>><img src='<?php echo G4_SHOP_URL; ?>/img/star2.gif' align=absmiddle>
<input type=radio name=is_score value='2' <?php echo ($is_score==2)?"checked='checked'":""; ?>><img src='<?php echo G4_SHOP_URL; ?>/img/star1.gif' align=absmiddle>
</li>
</ul>
<input type="submit" value=" 확 인 ">
</fieldset>
</form>
</div>
<script type="text/javascript">
self.focus();
function fitemuse_submit(f)
{
/*
if (document.getElementById('tx_is_content')) {
var len = ed_is_content.inputLength();
if (len == 0) {
alert('내용을 입력하십시오.');
ed_is_content.returnFalse();
return false;
} else if (len > 1000) {
alert('내용은 1000글자 까지만 입력해 주세요.');
ed_is_content.returnFalse();
return false;
}
}
*/
<?php echo get_editor_js('is_content'); ?>
if (is_content_editor_data.length > <?php echo $is_content_max_length; ?>) {
alert("내용은 <?php echo $is_content_max_length; ?> 글자 이내에서 작성해 주세요. (한글은 영문 3자)\n\n현재 : "+is_content_editor_data.length+" 글자");
CKEDITOR.instances.is_content.focus();
return false;
}
return true;
}
$(function() {
$("#is_subject").focus();
});
</script>
<?php
include_once(G4_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,67 @@
<?php
include_once('./_common.php');
if (!$is_member) {
alert_close("사용후기는 회원만 등록이 가능합니다.");
}
$is_subject = trim($_REQUEST['is_subject']);
$is_content = trim($_REQUEST['is_content']);
if ($w == "" || $w == "u") {
$is_name = $member['mb_name'];
$is_password = $member['mb_password'];
if (!$is_subject) alert("제목을 입력하여 주십시오.");
if (!$is_content) alert("내용을 입력하여 주십시오.");
}
$url = "./item.php?it_id=$it_id";
if ($w == "") {
/*
$sql = " select max(is_id) as max_is_id from {$g4['shop_item_use_table']} ";
$row = sql_fetch($sql);
$max_is_id = $row['max_is_id'];
$sql = " select max(is_id) as max_is_id from {$g4['shop_item_use_table']} where it_id = '$it_id' and mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if ($row['max_is_id'] && $row['max_is_id'] == $max_is_id)
alert("같은 상품에 대하여 계속해서 평가하실 수 없습니다.");
*/
$sql = "insert {$g4['shop_item_use_table']}
set it_id = '$it_id',
mb_id = '{$member['mb_id']}',
is_score = '$is_score',
is_name = '$is_name',
is_password = '$is_password',
is_subject = '$is_subject',
is_content = '$is_content',
is_time = '".G4_TIME_YMDHIS."',
is_ip = '{$_SERVER['REMOTE_ADDR']}' ";
if (!$default['de_item_use_use'])
$sql .= ", is_confirm = '1' ";
sql_query($sql);
if ($default['de_item_use_use']) {
alert_opener("평가하신 글은 관리자가 확인한 후에 출력됩니다.", $url);
} else {
alert_opener("사용후기가 등록 되었습니다.", $url);
}
} else if ($w == "u") {
$sql = " select is_password from {$g4['shop_item_use_table']} where is_id = '$is_id' ";
$row = sql_fetch($sql);
if ($row['is_password'] != $is_password)
alert("패스워드가 틀리므로 수정하실 수 없습니다.");
$sql = " update {$g4['shop_item_use_table']}
set is_subject = '$is_subject',
is_content = '$is_content',
is_score = '$is_score'
where is_id = '$is_id' ";
sql_query($sql);
alert_opener("사용후기가 수정 되었습니다.", $url);
}
?>

View File

@ -2,11 +2,42 @@
include_once('./_common.php');
include_once(G4_LIB_PATH.'/thumb.lib.php');
$sfl = escape_trim($_REQUEST['sfl']);
$stx = escape_trim($_REQUEST['stx']);
$g4['title'] = '사용후기';
include_once('./_head.php');
$sql_common = " from {$g4['shop_item_ps_table']} where is_confirm = '1' ";
$sql_order = " order by is_time desc ";
$sql_common = " from `{$g4['shop_item_use_table']}` a join `{$g4['shop_item_table']}` b on (a.it_id=b.it_id) ";
$sql_search = " where a.is_confirm = '1' ";
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "a.it_id" :
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.is_name" :
case "a.mb_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.is_id";
$sod = "desc";
}
$sql_order = " order by $sst $sod ";
/*
$sql_common = " from {$g4['shop_item_use_table']} where is_confirm = '1' ";
$sql_order = " order by is_id desc ";
*/
$sql = " select count(*) as cnt
$sql_common
@ -21,9 +52,25 @@ if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페
$from_record = ($page - 1) * $rows; // 시작 열을 구함
?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">전체보기</a>
<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<select name="sfl" required title="검색항목선택">
<option value="">선택</option>
<option value="b.it_name" <?php echo get_selected($_GET['sfl'], "b.it_name", true); ?>>상품명</option>
<option value="a.it_id" <?php echo get_selected($_GET['sfl'], "a.it_id"); ?>>상품코드</option>
<option value="a.is_subject"<?php echo get_selected($_GET['sfl'], "a.is_subject"); ?>>후기제목</option>
<option value="a.is_content">후기제목</option>
<option value="a.is_name">작성자명</option>
<option value="a.mb_id">작성자아이디</option>
</select>
<input type="text" name="stx" required title="검색어" value="<?php echo $stx; ?>">
<input type="submit" value="검색">
</form>
<div id="sps">
<p><?php echo $config['cf_title']; ?> 전체 사용후기 목록입니다.</p>
<!-- <p><?php echo $config['cf_title']; ?> 전체 사용후기 목록입니다.</p> -->
<?php
$sql = " select *
@ -37,8 +84,7 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
$num = $total_count - ($page - 1) * $rows - $i;
$star = get_star($row['is_score']);
$thumb = new g4_thumb(G4_DATA_PATH.'/itemuse', 500);
$is_content = $thumb->run($row['is_content']);
$is_content = get_view_thumbnail($row['is_content'], 500);
$is_time = substr($row['is_time'], 2, 14);
$small_image = $row['it_id'];
@ -68,11 +114,11 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
<dd><img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $star; ?>.png" alt="별<?php echo $star; ?>개"></dd>
</dl>
<p id="sps_con_<?php echo $i; ?>">
<div id="sps_con_<?php echo $i; ?>" style="display:none;">
<?php echo $is_content; // 상품 문의 내용 ?>
</p>
</div>
<div class="sps_con_btn"><button class="sps_con_<?php echo $i; ?>">보기</button></div>
<div class="sps_con_btn"><button class="sps_con_<?php echo $i; ?>">보기</button></div>
</section>
</li>
@ -89,15 +135,15 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
<script>
$(function(){
// 사용후기 더보기
$('.sps_con_btn button').click(function(){
$this = $(this);
sps_con_no = $this.attr('class');
$('#'+sps_con_no).toggleClass('sps_con_full');
$(".sps_con_btn button").click(function(){
var sps_con_no = $(this).attr("class");
$("#"+sps_con_no).is(":hidden") ? $("#"+sps_con_no).show() : $("#"+sps_con_no).hide();
});
$('.sps_con_btn button').toggle(function(){
$this.text('닫기');
$(".sps_con_btn button").toggle(function(){
$(this).text("닫기");
}, function(){
$this.text('더보기');
$(this).text("보기");
});
});
</script>

View File

@ -45,18 +45,18 @@ $url = "./item.php?it_id=$it_id";
if ($w == '')
{
$sql = " select max(is_id) as max_is_id from {$g4['shop_item_ps_table']} ";
$sql = " select max(is_id) as max_is_id from {$g4['shop_item_use_table']} ";
$row = sql_fetch($sql);
$max_is_id = $row['max_is_id'];
$sql = " select max(is_id) as max_is_id from {$g4['shop_item_ps_table']}
$sql = " select max(is_id) as max_is_id from {$g4['shop_item_use_table']}
where it_id = '$it_id'
and mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if ($row['max_is_id'] && $row['max_is_id'] == $max_is_id)
alert("같은 상품에 대하여 계속해서 평가하실 수 없습니다.");
$sql = "insert {$g4['shop_item_ps_table']}
$sql = "insert {$g4['shop_item_use_table']}
set it_id = '$it_id',
mb_id = '{$member['mb_id']}',
is_score = '$is_score',
@ -66,23 +66,23 @@ if ($w == '')
is_content = '$is_content',
is_time = '".G4_TIME_YMDHIS."',
is_ip = '{$_SERVER['REMOTE_ADDR']}' ";
if (!$default['de_item_ps_use'])
if (!$default['de_item_use_use'])
$sql .= ", is_confirm = '1' ";
sql_query($sql);
if ($default['de_item_ps_use'])
if ($default['de_item_use_use'])
alert("평가하신 글은 관리자가 확인한 후에 표시됩니다.", $url);
else
goto_url($url);
}
else if ($w == 'u')
{
$sql = " select is_password from {$g4['shop_item_ps_table']} where is_id = '$is_id' ";
$sql = " select is_password from {$g4['shop_item_use_table']} where is_id = '$is_id' ";
$row = sql_fetch($sql);
if ($row['is_password'] != $is_password)
alert("패스워드가 틀리므로 수정하실 수 없습니다.");
$sql = " update {$g4['shop_item_ps_table']}
$sql = " update {$g4['shop_item_use_table']}
set is_subject = '$is_subject',
is_content = '$is_content',
is_score = '$is_score'
@ -95,7 +95,7 @@ else if ($w == 'd')
{
if ($is_member)
{
$sql = " select count(*) as cnt from {$g4['shop_item_ps_table']} where mb_id = '{$member['mb_id']}' and is_id = '$is_id' ";
$sql = " select count(*) as cnt from {$g4['shop_item_use_table']} where mb_id = '{$member['mb_id']}' and is_id = '$is_id' ";
$row = sql_fetch($sql);
if (!$row['cnt'])
alert("자신의 사용후기만 삭제하실 수 있습니다.");
@ -104,13 +104,13 @@ else if ($w == 'd')
{
$is_password = sql_password($is_password);
$sql = " select is_password from {$g4['shop_item_ps_table']} where is_id = '$is_id' ";
$sql = " select is_password from {$g4['shop_item_use_table']} where is_id = '$is_id' ";
$row = sql_fetch($sql);
if ($row['is_password'] != $is_password)
alert("패스워드가 틀리므로 삭제하실 수 없습니다.");
}
$sql = " delete from {$g4['shop_item_ps_table']} where mb_id = '{$member['mb_id']}' and is_id = '$is_id' ";
$sql = " delete from {$g4['shop_item_use_table']} where mb_id = '{$member['mb_id']}' and is_id = '$is_id' ";
sql_query($sql);
goto_url($url);