Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
@ -137,7 +137,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
|
||||
|
||||
<?php
|
||||
if ($s_page == 'cart.php')
|
||||
echo '<td class="td_smallmng"><a href="'.G4_MSHOP_URL.'/cartupdate.php?act=d&ct_id='.$row['ct_id'].'">삭제</a></td>';
|
||||
echo '<td class="td_smallmng"><a href="'.G4_SHOP_URL.'/cartupdate.php?act=d&ct_id='.$row['ct_id'].'">삭제</a></td>';
|
||||
else if ($s_page == 'orderinquiryview.php')
|
||||
echo '<td class="td_smallmng">'.$row['ct_status'].'</td>';
|
||||
?>
|
||||
@ -220,11 +220,11 @@ if ($tot_amount > 0) {
|
||||
<?php if ($s_page == 'cart.php') { ?>
|
||||
<div id="sod_bsk_act">
|
||||
<?php if ($i == 0) { ?>
|
||||
<a href="<?php echo G4_MSHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
|
||||
<a href="<?php echo G4_SHOP_URL; ?>/" class="btn01">쇼핑 계속하기</a>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="url" value="<?php echo G4_MSHOP_URL; ?>/orderform.php">
|
||||
<input type="hidden" name="url" value="<?php echo G4_SHOP_URL; ?>/orderform.php">
|
||||
<p>장바구니의 상품을 주문하시려면 <strong>주문하기</strong>를 클릭하세요. <strong>비우기</strong>는 장바구니의 상품을 모두 비웁니다.</p>
|
||||
<a href="<?php echo G4_MSHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
|
||||
<a href="<?php echo G4_SHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
|
||||
<a href="javascript:form_check('buy');" class="btn02">주문하기</a>
|
||||
<a href="javascript:form_check('allupdate');" class="btn01">수량변경</a>
|
||||
<a href="javascript:form_check('alldelete');" class="btn01">비우기</a>
|
||||
@ -250,17 +250,17 @@ function form_check(act) {
|
||||
<?php
|
||||
if (get_session('ss_mb_id')) // 회원인 겨우
|
||||
{
|
||||
echo "f.action = '".G4_MSHOP_URL."/orderform.php';";
|
||||
echo "f.action = '".G4_SHOP_URL."/orderform.php';";
|
||||
echo "f.submit();";
|
||||
}
|
||||
else
|
||||
echo "document.location.href = '".G4_BBS_URL."/login.php?url=".urlencode(G4_MSHOP_URL."/orderform.php")."';";
|
||||
echo "document.location.href = '".G4_BBS_URL."/login.php?url=".urlencode(G4_SHOP_URL."/orderform.php")."';";
|
||||
?>
|
||||
}
|
||||
else if (act == "alldelete")
|
||||
{
|
||||
f.act.value = act;
|
||||
f.action = "<?php echo G4_MSHOP_URL; ?>/cartupdate.php";
|
||||
f.action = "<?php echo G4_SHOP_URL; ?>/cartupdate.php";
|
||||
f.submit();
|
||||
}
|
||||
else if (act == "allupdate")
|
||||
@ -293,7 +293,7 @@ function form_check(act) {
|
||||
}
|
||||
}
|
||||
f.act.value = act;
|
||||
f.action = "<?php echo G4_MSHOP_URL; ?>/cartupdate.php";
|
||||
f.action = "<?php echo G4_SHOP_URL; ?>/cartupdate.php";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ function pg_anchor($anc_id) {
|
||||
if (G4_HTTPS_DOMAIN)
|
||||
$action_url = G4_HTTPS_DOMAIN.'/'.G4_SHOP_DIR.'/cartupdate.php';
|
||||
else
|
||||
$action_url = G4_MSHOP_URL.'/cartupdate.php';
|
||||
$action_url = G4_SHOP_URL.'/cartupdate.php';
|
||||
?>
|
||||
|
||||
<div id="sit">
|
||||
|
||||
240
mobile/shop/itemqa.inc.php
Normal file
240
mobile/shop/itemqa.inc.php
Normal file
@ -0,0 +1,240 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
|
||||
<section id="sit_qna_list">
|
||||
<h3>등록된 상품문의</h3>
|
||||
|
||||
<?php
|
||||
$sql_common = " from {$g4['shop_item_qa_table']} where it_id = '{$it['it_id']}' ";
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select COUNT(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$qa_total_count = $row['cnt'];
|
||||
|
||||
$qa_total_page = ceil($qa_total_count / $qa_page_rows); // 전체 페이지 계산
|
||||
if ($qa_page == "") $qa_page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$qa_from_record = ($qa_page - 1) * $qa_page_rows; // 시작 레코드 구함
|
||||
|
||||
$sql = "select *
|
||||
$sql_common
|
||||
order by iq_id desc
|
||||
limit $qa_from_record, $qa_page_rows ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
|
||||
$num = $qa_total_count - ($qa_page - 1) * $qa_page_rows - $i;
|
||||
|
||||
$iq_name = get_text($row['iq_name']);
|
||||
$iq_subject = conv_subject($row['iq_subject'],50, '…');
|
||||
$iq_question = conv_content($row['iq_question'],0);
|
||||
$iq_answer = conv_content($row['iq_answer'],0);
|
||||
|
||||
$iq_time = substr($row['iq_time'], 2, 14);
|
||||
|
||||
//$qa = "<img src='$g4[shop_img_path]/icon_poll_q.gif' border=0>";
|
||||
//if ($row[iq_answer]) $qa .= "<img src='$g4[shop_img_path]/icon_answer.gif' border=0>";
|
||||
//$qa = "$qa";
|
||||
|
||||
$iq_stats = '';
|
||||
$iq_answer = '';
|
||||
$iq_flag = 0;
|
||||
if ($row['iq_answer'])
|
||||
{
|
||||
$iq_answer = conv_content($row['iq_answer'],0);
|
||||
$iq_stats = '답변완료';
|
||||
} else {
|
||||
$iq_stats = '답변전';
|
||||
$iq_answer = '답변이 등록되지 않았습니다.';
|
||||
$iq_flag = 1;
|
||||
}
|
||||
|
||||
if ($i == 0) echo '<ol id="sit_qna_ol">';
|
||||
?>
|
||||
|
||||
<li class="sit_qna_li">
|
||||
<button type="button" class="sit_qna_li_title" onclick="javascript:qa_menu('sit_qna_con_<?php echo $i; ?>')"><b><?php echo $num; ?>.</b> <?php echo $iq_subject; ?></button>
|
||||
<dl class="sit_qna_dl">
|
||||
<dt>작성자</dt>
|
||||
<dd><?php echo $iq_name; ?></dd>
|
||||
<dt>작성일</dt>
|
||||
<dd><?php echo $iq_time; ?></dd>
|
||||
<dt>상태</dt>
|
||||
<dd><?php echo $iq_stats; ?></dd>
|
||||
</dl>
|
||||
|
||||
<div id="sit_qna_con_<?php echo $i; ?>" class="sit_qna_con">
|
||||
<p class="sit_qna_qaq">
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; // 상품 문의 내용 ?>
|
||||
</p>
|
||||
<p class="sit_qna_qaa">
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</p>
|
||||
|
||||
<textarea id="tmp_iq_id<?php echo $i; ?>"><?php echo $row['iq_id']; ?></textarea>
|
||||
<textarea id="tmp_iq_name<?php echo $i; ?>"><?php echo $row['iq_name']; ?></textarea>
|
||||
<textarea id="tmp_iq_subject<?php echo $i; ?>"><?php echo $row['iq_subject']; ?></textarea>
|
||||
<textarea id="tmp_iq_question<?php echo $i; ?>"><?php echo $row['iq_question']; ?></textarea>
|
||||
|
||||
<?php if ($row['mb_id'] == $member['mb_id'] && $iq_answer == 0) { ?>
|
||||
<div class="sit_qna_cmd">
|
||||
<button type="button" onclick="javascript:itemqa_update(<?php echo $i; ?>);" class="btn01">수정</button>
|
||||
<button type="button" onclick="javascript:itemqa_delete(fitemqa_password<?php echo $i; ?>, <?php echo $i; ?>);" class="btn01">삭제</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="sit_qna_pw_<?php echo $i; ?>" class="sit_qna_pw">
|
||||
<form name="fitemqa_password<?php echo $i; ?>" method="post" action="./itemqaupdate.php" autocomplete="off">
|
||||
<input type="hidden" name="w" value="">
|
||||
<input type="hidden" name="iq_id" value="">
|
||||
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
|
||||
<span>삭제하시려면 글 작성 시 입력하신 패스워드를 입력해주세요.</span>
|
||||
<label for="iq_password_<?=$i?>">패스워드</label>
|
||||
<input type="password" name="iq_password" id="iq_password_<?=$i?>" required class="frm_input">
|
||||
<input type="submit" value="확인" class="btn_frmline">
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php }
|
||||
|
||||
if ($i >= 0) echo '</ol>';
|
||||
|
||||
if (!$i) echo '<p class="sit_empty">상품문의가 없습니다.</p>';
|
||||
?>
|
||||
</section>
|
||||
|
||||
<div id="sit_qna_wbtn">
|
||||
<button type="button" id="iq_write" class="btn_submit" onclick="javascript:itemqa_insert();">상품문의 쓰기</button>
|
||||
</div>
|
||||
|
||||
<section id="sit_qna_w">
|
||||
<h3>상품문의 작성</h3>
|
||||
|
||||
<form name="fitemqa" method="post" onsubmit="return fitemqa_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="w" value="">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
<input type="hidden" name="iq_id" value="">
|
||||
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
|
||||
<table class="frm_tbl">
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<?php if (!$is_member) { ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_name">이름</label></th>
|
||||
<td><input type="text" name="iq_name" id="iq_name" required class="frm_input" maxlength="20" minlength="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_password">패스워드</label></th>
|
||||
<td>
|
||||
<span class="frm_info">패스워드는 최소 3글자 이상 입력하십시오.</span>
|
||||
<input type="password" name="iq_password" id="iq_password" required class="frm_input" maxlength="20" minlength="3">
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_subject">제목</label></th>
|
||||
<td><input type="text" name="iq_subject" id="iq_subject" required class="frm_input" size="71" maxlength="100"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_question">내용</label></th>
|
||||
<td><textarea name="iq_question" id="iq_question" required></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">자동등록방지</th>
|
||||
<td><?php echo $captcha_html; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="btn_confirm">
|
||||
<input type="submit" value="작성완료" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<?php if ($qa_pages) get_paging(10, $qa_page, $qa_total_page, './item.php?it_id='.$it_id.'&'.$qstr.'&qa_page=', '#qa'); // 페이징 ?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
});
|
||||
|
||||
function fitemqa_submit(f)
|
||||
{
|
||||
<?php echo chk_captcha_js(); ?>
|
||||
|
||||
f.action = "itemqaupdate.php";
|
||||
return true;
|
||||
}
|
||||
|
||||
function itemqa_insert()
|
||||
{
|
||||
/*
|
||||
if (!g4_is_member) {
|
||||
alert("로그인 하시기 바랍니다.");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
var f = document.fitemqa;
|
||||
var id = document.getElementById('sit_qna_w');
|
||||
|
||||
id.style.display = 'block';
|
||||
|
||||
f.w.value = '';
|
||||
f.iq_id.value = '';
|
||||
if (!g4_is_member)
|
||||
{
|
||||
f.iq_name.value = '';
|
||||
f.iq_name.readOnly = false;
|
||||
f.iq_password.value = '';
|
||||
}
|
||||
f.iq_subject.value = '';
|
||||
f.iq_question.value = '';
|
||||
}
|
||||
|
||||
function itemqa_update(idx)
|
||||
{
|
||||
var f = document.fitemqa;
|
||||
var id = document.getElementById('sit_qna_w');
|
||||
|
||||
id.style.display = 'block';
|
||||
|
||||
f.w.value = 'u';
|
||||
f.iq_id.value = document.getElementById('tmp_iq_id'+idx).value;
|
||||
if (!g4_is_member)
|
||||
{
|
||||
f.iq_name.value = document.getElementById('tmp_iq_name'+idx).value;
|
||||
f.iq_name.readOnly = true;
|
||||
}
|
||||
f.iq_subject.value = document.getElementById('tmp_iq_subject'+idx).value;
|
||||
f.iq_question.value = document.getElementById('tmp_iq_question'+idx).value;
|
||||
}
|
||||
|
||||
function itemqa_delete(f, idx)
|
||||
{
|
||||
var id = document.getElementById('sit_qna_w');
|
||||
|
||||
f.w.value = 'd';
|
||||
f.iq_id.value = document.getElementById('tmp_iq_id'+idx).value;
|
||||
|
||||
if (g4_is_member)
|
||||
{
|
||||
if (confirm("삭제하시겠습니까?"))
|
||||
f.submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
id.style.display = 'none';
|
||||
document.getElementById('itemqa_password'+idx).style.display = 'block';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
112
mobile/shop/itemqaupdate.php
Normal file
112
mobile/shop/itemqaupdate.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
include_once(G4_GCAPTCHA_PATH.'/gcaptcha.lib.php');
|
||||
|
||||
if ($w == '' || $w == 'u')
|
||||
{
|
||||
/*
|
||||
if (!(trim($iq_key) && trim($iq_key) == get_session('ss_norobot_key'))) {
|
||||
alert('자동등록방지 코드가 틀립니다.');
|
||||
}
|
||||
*/
|
||||
|
||||
if (!chk_captcha()) {
|
||||
alert('자동등록방지 숫자가 틀렸습니다.');
|
||||
}
|
||||
|
||||
/*
|
||||
// 두개씩 비교할 필요가 없음
|
||||
// 세션에 저장된 토큰과 폼으로 넘어온 토큰을 비교하여 틀리면 에러
|
||||
if ($token && get_session("ss_token") == $token) {
|
||||
// 맞으면 세션을 지워 다시 입력폼을 통해서 들어오도록 한다.
|
||||
set_session("ss_token", "");
|
||||
} else {
|
||||
alert_close("토큰 에러");
|
||||
}
|
||||
*/
|
||||
|
||||
if (!$is_member)
|
||||
{
|
||||
if (!trim($_POST['iq_name'])) alert('이름을 입력하여 주십시오.');
|
||||
if (!trim($_POST['iq_password'])) alert('패스워드를 입력하여 주십시오.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$iq_name = $member['mb_name'];
|
||||
$iq_password = $member['mb_password'];
|
||||
}
|
||||
|
||||
$iq_password = sql_password($iq_password);
|
||||
|
||||
if (!trim($_POST['iq_subject'])) alert('제목을 입력하여 주십시오.');
|
||||
if (!trim($_POST['iq_question'])) alert('내용을 입력하여 주십시오.');
|
||||
}
|
||||
|
||||
$url = "./item.php?it_id=$it_id";
|
||||
|
||||
if ($w == '')
|
||||
{
|
||||
$sql = " select max(iq_id) as max_iq_id from {$g4['shop_item_qa_table']} ";
|
||||
$row = sql_fetch($sql);
|
||||
$max_iq_id = $row['max_iq_id'];
|
||||
|
||||
$sql = " select max(iq_id) as max_iq_id from {$g4['shop_item_qa_table']}
|
||||
where it_id = '$it_id'
|
||||
and mb_id = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['max_iq_id'] && $row['max_iq_id'] == $max_iq_id)
|
||||
alert('같은 상품에 대하여 계속해서 질문 하실 수 없습니다.');
|
||||
|
||||
$sql = "insert {$g4['shop_item_qa_table']}
|
||||
set it_id = '$it_id',
|
||||
mb_id = '{$member['mb_id']}',
|
||||
iq_name = '$iq_name',
|
||||
iq_password = '$iq_password',
|
||||
iq_subject = '$iq_subject',
|
||||
iq_question = '$iq_question',
|
||||
iq_time = '".G4_TIME_YMDHIS."',
|
||||
iq_ip = '$REMOTE_ADDR' ";
|
||||
sql_query($sql);
|
||||
|
||||
goto_url($url);
|
||||
}
|
||||
else if ($w == 'u')
|
||||
{
|
||||
$sql = " select iq_password from {$g4['shop_item_qa_table']} where iq_id = '$iq_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['iq_password'] != $iq_password)
|
||||
alert('패스워드가 틀리므로 수정하실 수 없습니다.');
|
||||
|
||||
$sql = " update {$g4['shop_item_qa_table']}
|
||||
set iq_subject = '$iq_subject',
|
||||
iq_question = '$iq_question'
|
||||
where iq_id = '$iq_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
goto_url($url);
|
||||
}
|
||||
else if ($w == 'd')
|
||||
{
|
||||
if ($is_member)
|
||||
{
|
||||
$sql = " select count(*) as cnt from {$g4['shop_item_qa_table']} where mb_id = '{$member['mb_id']}' and iq_id = '$iq_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['cnt'])
|
||||
alert('자신의 상품문의만 삭제하실 수 있습니다.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$iq_password = sql_password($iq_password);
|
||||
|
||||
$sql = " select iq_password from {$g4['shop_item_qa_table']} where iq_id = '$iq_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['iq_password'] != $iq_password)
|
||||
alert('패스워드가 틀리므로 삭제하실 수 없습니다.');
|
||||
}
|
||||
|
||||
$sql = " delete from {$g4['shop_item_qa_table']} where mb_id = '{$member['mb_id']}' and iq_id = '$iq_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
goto_url($url);
|
||||
}
|
||||
?>
|
||||
217
mobile/shop/itemuse.inc.php
Normal file
217
mobile/shop/itemuse.inc.php
Normal file
@ -0,0 +1,217 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
include_once(G4_LIB_PATH.'/thumb.lib.php');
|
||||
?>
|
||||
|
||||
<table id="sit_ps_tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<th>제목</th>
|
||||
<th>작성자</th>
|
||||
<th>작성일</th>
|
||||
<th>평점</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$sql_common = " from {$g4['shop_item_ps_table']} where it_id = '{$it['it_id']}' and is_confirm = '1' ";
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select COUNT(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$use_total_count = $row['cnt'];
|
||||
|
||||
$use_total_page = ceil($use_total_count / $use_page_rows); // 전체 페이지 계산
|
||||
if ($use_page == "") $use_page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$use_from_record = ($use_page - 1) * $use_page_rows; // 시작 레코드 구함
|
||||
|
||||
$sql = "select * $sql_common order by is_id desc limit $use_from_record, $use_page_rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$num = $use_total_count - ($use_page - 1) * $use_page_rows - $i;
|
||||
|
||||
$star = get_star($row['is_score']);
|
||||
|
||||
$is_name = get_text($row['is_name']);
|
||||
$is_subject = conv_subject($row['is_subject'],50,"…");
|
||||
//$is_content = conv_content($row[is_content],0);
|
||||
$is_content = $row['is_content'];
|
||||
//$is_content = preg_replace_callback("#<img[^>]+>#iS", "g4_thumb", $is_content);
|
||||
|
||||
$thumb = new g4_thumb(G4_DATA_PATH.'/itemuse', 500);
|
||||
$is_content = $thumb->run($is_content);
|
||||
|
||||
$is_time = substr($row['is_time'], 2, 14);
|
||||
?>
|
||||
|
||||
<li class="sit_ps_li">
|
||||
<button type="button" class="sit_ps_li_title" onclick="javascript:qa_menu('sit_ps_con_<?php echo $i; ?>')"><?php echo $num; ?>. <?php echo $iq_subject; ?></button>
|
||||
<dl class="sit_ps_dl">
|
||||
<dt>작성자</dt>
|
||||
<dd><?php echo $iq_name; ?></dd>
|
||||
<dt>작성일</dt>
|
||||
<dd><?php echo $iq_time; ?></dd>
|
||||
<dt>상태</dt>
|
||||
<dd><?php echo $iq_stats; ?></dd>
|
||||
</dl>
|
||||
|
||||
<div id="sit_ps_con_<?php echo $i; ?>" class="sit_ps_con">
|
||||
<p class="sit_ps_qaq">
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; // 상품 문의 내용 ?>
|
||||
</p>
|
||||
<p class="sit_ps_qaa">
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</p>
|
||||
|
||||
<textarea id="tmp_iq_id<?php echo $i; ?>"><?php echo $row['iq_id']; ?></textarea>
|
||||
<textarea id="tmp_iq_name<?php echo $i; ?>"><?php echo $row['iq_name']; ?></textarea>
|
||||
<textarea id="tmp_iq_subject<?php echo $i; ?>"><?php echo $row['iq_subject']; ?></textarea>
|
||||
<textarea id="tmp_iq_question<?php echo $i; ?>"><?php echo $row['iq_question']; ?></textarea>
|
||||
|
||||
<?php if ($row['mb_id'] == $member['mb_id'] && $iq_answer == 0) { ?>
|
||||
<div class="sit_ps_cmd">
|
||||
<button onclick="javascript:itemqa_update(<?php echo $i; ?>);" class="btn01">수정</button>
|
||||
<button onclick="javascript:itemqa_delete(fitemqa_password<?php echo $i; ?>, <?php echo $i; ?>);" class="btn01">삭제</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td><?php echo $num; ?><span class="sound_only">번</span></td>
|
||||
<td>
|
||||
<a href="javascript:;" onclick="use_menu('is<?php echo $i; ?>')"><?php echo $is_subject; ?></a>
|
||||
<div>
|
||||
<div>
|
||||
<?php echo $is_content; ?>
|
||||
</div>
|
||||
<textarea id="tmp_is_id<?php echo $i; ?>"><?php echo $row['is_id']; ?></textarea>
|
||||
<textarea id="tmp_is_name<?php echo $i; ?>"><?php echo $row['is_name']; ?></textarea>
|
||||
<textarea id="tmp_is_subject<?php echo $i; ?>"><?php echo $row['is_subject']; ?></textarea>
|
||||
<textarea id="tmp_is_content<?php echo $i; ?>"><?php echo $row['is_content']; ?></textarea>
|
||||
|
||||
<?php if ($row[mb_id] == $member[mb_id]) { ?>
|
||||
<a href="javascript:itemusewin('is_id=<?php echo $row['is_id']; ?>&w=u');">수정</a>
|
||||
<a href="javascript:itemuse_delete(fitemuse_password<?php echo $i; ?>, <?php echo $i; ?>);">삭제</a>
|
||||
<?php } ?>
|
||||
<div id="is<?php echo $i; ?>">
|
||||
<!-- 사용후기 삭제 패스워드 입력 폼 -->
|
||||
<form name="fitemuse_password<?php echo $i; ?>" method="post" action="./itemuseupdate.php" autocomplete="off">
|
||||
<input type="hidden" name="w" value="">
|
||||
<input type="hidden" name="is_id" value="">
|
||||
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
|
||||
<label for="is_password_<?php echo $i; ?>">패스워드</label>
|
||||
<input type="password" name="is_password" id="is_password_<?php echo $i; ?>" required>
|
||||
<input type="submit" value="확인">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</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 $star; ?>.png" alt="별<?php echo $star; ?>개"></td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
}
|
||||
|
||||
if (!$i)
|
||||
{
|
||||
echo '<tr><td class="empty_class">등록된 사용후기가 없습니다.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if ($use_pages) {
|
||||
$use_pages = get_paging(10, $use_page, $use_total_page, "./item.php?it_id=$it_id&$qstr&use_page=", "#use");
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="javascript:itemusewin('it_id=<?php echo $it_id; ?>');">사용후기 쓰기<span class="sound_only"> 새 창</span></a>
|
||||
|
||||
<script>
|
||||
function itemusewin(query_string)
|
||||
{
|
||||
window.open("./itemusewin.php?"+query_string, "itemusewin", "width=800,height=700");
|
||||
}
|
||||
|
||||
function fitemuse_submit(f)
|
||||
{
|
||||
if (!check_kcaptcha(f.is_key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
f.action = "itemuseupdate.php"
|
||||
return true;
|
||||
}
|
||||
|
||||
function itemuse_insert()
|
||||
{
|
||||
/*
|
||||
if (!g4_is_member) {
|
||||
alert("로그인 하시기 바랍니다.");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
var f = document.fitemuse;
|
||||
var id = document.getElementById('itemuse');
|
||||
|
||||
id.style.display = 'block';
|
||||
|
||||
f.w.value = '';
|
||||
f.is_id.value = '';
|
||||
if (!g4_is_member)
|
||||
{
|
||||
f.is_name.value = '';
|
||||
f.is_name.readOnly = false;
|
||||
f.is_password.value = '';
|
||||
}
|
||||
f.is_subject.value = '';
|
||||
f.is_content.value = '';
|
||||
}
|
||||
|
||||
function itemuse_update(idx)
|
||||
{
|
||||
var f = document.fitemuse;
|
||||
var id = document.getElementById('itemuse');
|
||||
|
||||
id.style.display = 'block';
|
||||
|
||||
f.w.value = 'u';
|
||||
f.is_id.value = document.getElementById('tmp_is_id'+idx).value;
|
||||
if (!g4_is_member)
|
||||
{
|
||||
f.is_name.value = document.getElementById('tmp_is_name'+idx).value;
|
||||
f.is_name.readOnly = true;
|
||||
}
|
||||
f.is_subject.value = document.getElementById('tmp_is_subject'+idx).value;
|
||||
f.is_content.value = document.getElementById('tmp_is_content'+idx).value;
|
||||
}
|
||||
|
||||
function itemuse_delete(f, idx)
|
||||
{
|
||||
var id = document.getElementById('itemuse');
|
||||
|
||||
f.w.value = 'd';
|
||||
f.is_id.value = document.getElementById('tmp_is_id'+idx).value;
|
||||
|
||||
if (g4_is_member)
|
||||
{
|
||||
if (confirm("삭제하시겠습니까?"))
|
||||
f.submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
id.style.display = 'none';
|
||||
document.getElementById('itemuse_password'+idx).style.display = 'block';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
66
mobile/shop/largeimage.php
Normal file
66
mobile/shop/largeimage.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$it_id = $_GET['it_id'];
|
||||
$img = $_GET['img'];
|
||||
|
||||
$sql = " select it_id, it_name from {$g4['shop_item_table']} where it_id='$it_id' ";
|
||||
$row = sql_fetch_array(sql_query($sql));
|
||||
|
||||
if(!$row['it_id'])
|
||||
alert_close('상품정보가 존재하지 않습니다.');
|
||||
|
||||
$imagefile = G4_DATA_PATH."/item/$img";
|
||||
$imagefileurl = G4_DATA_URL."/item/$img";
|
||||
$size = getimagesize($imagefile);
|
||||
|
||||
$g4['title'] = "{$row['it_name']} ($it_id)";
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div id="sit_pvi_nw">
|
||||
<h1>상품 이미지 새 창 보기</h1>
|
||||
|
||||
<div id="sit_pvi_nwbig">
|
||||
<a href="javascript:window.close();">
|
||||
<img src="<?php echo $imagefileurl; ?>" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>" alt="<?php echo $row['it_name']; ?>" id="largeimage">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
for ($i=1; $i<=5; $i++)
|
||||
{
|
||||
if ($i == 1) echo '<ul>';
|
||||
if (file_exists(G4_DATA_PATH."/item/{$it_id}_l{$i}")) {
|
||||
$id = $it_id.'_l'.$i;
|
||||
?>
|
||||
<li><a href="<?php echo G4_SHOP_URL; ?>/largeimage.php?it_id=<?php echo $it_id; ?>&img=<?php echo $id; ?>" id="<?php echo $id; ?>" class="img_thumb"><img id="large<?php echo $i; ?>" src="<?php echo G4_DATA_URL; ?>/item/<?php echo $id; ?>" alt=""></a></li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
if ($i > 1) echo '</ul>';
|
||||
?>
|
||||
|
||||
<div class="btn_win">
|
||||
<button type="button" onclick="javascript:window.close();">창닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
// 창 사이즈 조절
|
||||
var w = <?php echo $size[0]; ?> + 50;
|
||||
var h = <?php echo $size[1]; ?> + 210;
|
||||
window.resizeTo(w, h);
|
||||
|
||||
// 이미지 미리보기
|
||||
$(".img_thumb").bind("hover focus", function(){
|
||||
var img_src = $(this).attr("id");
|
||||
$("#sit_pvi_nwbig img").attr("src","<?php echo G4_DATA_URL; ?>/item/"+img_src); // 이미지 소스 교체
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
?>
|
||||
34
mobile/shop/listcategory.inc.php
Normal file
34
mobile/shop/listcategory.inc.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$str = '';
|
||||
$exists = false;
|
||||
|
||||
$ca_id_len = strlen($ca_id);
|
||||
$len2 = $ca_id_len + 2;
|
||||
$len4 = $ca_id_len + 4;
|
||||
|
||||
$sql = " select ca_id, ca_name from {$g4['shop_category_table']}
|
||||
where ca_id like '$ca_id%'
|
||||
and length(ca_id) = $len2
|
||||
and ca_use = '1'
|
||||
order by ca_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row=sql_fetch_array($result)) {
|
||||
|
||||
//$row2 = sql_fetch(" select count(*) as cnt from $g4[shop_category_table] where ca_id like '$row[ca_id]%' ");
|
||||
$row2 = sql_fetch(" select count(*) as cnt from {$g4['shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' ");
|
||||
|
||||
$str .= '<li><a href="./list.php?ca_id='.$row['ca_id'].'">'.$row['ca_name'].' ('.$row2['cnt'].')</a></li>';
|
||||
$exists = true;
|
||||
}
|
||||
|
||||
if ($exists) {
|
||||
?>
|
||||
|
||||
<aside id="sct_ct_1" class="sct_ct">
|
||||
<h2>현재 상품 분류와 관련된 분류</h2>
|
||||
<ul>
|
||||
<?php echo $str; ?>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<?php } ?>
|
||||
68
mobile/shop/listcategory2.inc.php
Normal file
68
mobile/shop/listcategory2.inc.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
$str = '';
|
||||
$exists = false;
|
||||
|
||||
$ca_id_len = strlen($ca_id);
|
||||
$len2 = $ca_id_len + 2;
|
||||
$len4 = $ca_id_len + 4;
|
||||
|
||||
// 최하위 분류의 경우 상단에 동일한 레벨의 분류를 출력해주는 코드
|
||||
if (!$exists) {
|
||||
$str = '';
|
||||
|
||||
$tmp_ca_id = substr($ca_id, 0, strlen($ca_id)-2);
|
||||
$tmp_ca_id_len = strlen($tmp_ca_id);
|
||||
$len2 = $tmp_ca_id_len + 2;
|
||||
$len4 = $tmp_ca_id_len + 4;
|
||||
|
||||
// 차차기 분류의 건수를 얻음
|
||||
$sql = " select count(*) as cnt from {$g4['shop_category_table']}
|
||||
where ca_id like '$tmp_ca_id%'
|
||||
and ca_use = '1'
|
||||
and length(ca_id) = $len4 ";
|
||||
$row = sql_fetch($sql);
|
||||
$cnt = $row['cnt'];
|
||||
|
||||
$sql = " select ca_id, ca_name from {$g4['shop_category_table']}
|
||||
where ca_id like '$tmp_ca_id%'
|
||||
and ca_use = '1'
|
||||
and length(ca_id) = $len2 order by ca_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row=sql_fetch_array($result)) {
|
||||
$sct_ct_here = '';
|
||||
if ($ca_id == $row['ca_id']) // 활성 분류 표시
|
||||
$sct_ct_here = 'sct_ct_here';
|
||||
|
||||
$str .= '<li>';
|
||||
if ($cnt) {
|
||||
$str .= '<a href="./list.php?ca_id='.$row['ca_id'].'" class="sct_ct_parent '.$sct_ct_here.'">'.$row['ca_name'].'</a>';
|
||||
$sql2 = " select ca_id, ca_name from {$g4['shop_category_table']}
|
||||
where ca_id like '{$row['ca_id']}%'
|
||||
and ca_use = '1'
|
||||
and length(ca_id) = $len4 order by ca_id ";
|
||||
$result2 = sql_query($sql2);
|
||||
$k=0;
|
||||
while ($row2=sql_fetch_array($result2)) {
|
||||
$str .= '<a href="./list.php?ca_id='.$row2['ca_id'].'">'.$row2['ca_name'].'</a>';
|
||||
$k++;
|
||||
}
|
||||
} else {
|
||||
$str .= '<a href="./list.php?ca_id='.$row['ca_id'].'" class="sct_ct_parent '.$sct_ct_here.'">'.$row['ca_name'].'</a>';
|
||||
}
|
||||
$str .= '</li>';
|
||||
$exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($exists) {
|
||||
?>
|
||||
|
||||
<aside id="sct_ct_2" class="sct_ct">
|
||||
<h2>현재 상품 분류와 관련된 분류</h2>
|
||||
<ul>
|
||||
<?php echo $str; ?>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<?php } ?>
|
||||
32
mobile/shop/listcategory3.inc.php
Normal file
32
mobile/shop/listcategory3.inc.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$str = '';
|
||||
$exists = false;
|
||||
|
||||
$depth2_ca_id = substr($ca_id, 0, 2);
|
||||
|
||||
$sql = " select ca_id, ca_name from {$g4['shop_category_table']}
|
||||
where ca_id like '${depth2_ca_id}%'
|
||||
and length(ca_id) = 4
|
||||
and ca_use = '1'
|
||||
order by ca_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row=sql_fetch_array($result)) {
|
||||
if (preg_match("/^{$row['ca_id']}/", $ca_id))
|
||||
$sct_ct_here = 'sct_ct_here';
|
||||
else
|
||||
$sct_ct_here = '';
|
||||
$str .= '<li><a href="./list.php?ca_id='.$row['ca_id'].'" class="'.$sct_ct_here.'">'.$row['ca_name'].'</a></li>';
|
||||
$exists = true;
|
||||
}
|
||||
|
||||
if ($exists) {
|
||||
?>
|
||||
|
||||
<aside id="sct_ct_3" class="sct_ct">
|
||||
<h2>현재 상품 분류와 관련된 분류</h2>
|
||||
<ul>
|
||||
<?php echo $str; ?>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<?php } ?>
|
||||
@ -220,7 +220,7 @@ if ($tot_amount > 0) {
|
||||
<?php if ($s_page == 'cart.php') { ?>
|
||||
<div id="sod_bsk_act">
|
||||
<?php if ($i == 0) { ?>
|
||||
<a href="<?php echo G4_SHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
|
||||
<a href="<?php echo G4_SHOP_URL; ?>/" class="btn01">쇼핑 계속하기</a>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="url" value="./orderform.php">
|
||||
<p>장바구니의 상품을 주문하시려면 <strong>주문하기</strong>를 클릭하세요. <strong>비우기</strong>는 장바구니의 상품을 모두 비웁니다.</p>
|
||||
|
||||
Reference in New Issue
Block a user