Merge branch 'master' into itemuse
Conflicts: adm/shop_admin/index.php
This commit is contained in:
@ -1,106 +0,0 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
|
||||
$w = substr($_REQUEST['w'],0,1);
|
||||
$it_id = substr($_REQUEST['it_id'],0,10);
|
||||
$is_id = (int)$_REQUEST['is_id'];
|
||||
|
||||
if (!$is_member) {
|
||||
alert_close("사용후기는 회원만 평가가 가능합니다.");
|
||||
}
|
||||
|
||||
if ($w == "") {
|
||||
$is_score = 10;
|
||||
} else if ($w == "u") {
|
||||
$ps = sql_fetch(" select * from {$g4['shop_item_ps_table']} where is_id = '$is_id' ");
|
||||
if (!$ps) {
|
||||
alert_close("사용후기 정보가 없습니다.");
|
||||
}
|
||||
|
||||
$it_id = $ps['it_id'];
|
||||
$is_score = $ps['is_score'];
|
||||
}
|
||||
|
||||
if ($w == "u") {
|
||||
if (!$is_admin && $ps['mb_id'] != $member['mb_id']) {
|
||||
alert_close("자신의 사용후기만 수정이 가능합니다.");
|
||||
}
|
||||
}
|
||||
|
||||
include_once(G4_CKEDITOR_PATH.'/ckeditor.lib.php');
|
||||
include_once(G4_GCAPTCHA_PATH.'/gcaptcha.lib.php');
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
|
||||
$captcha_html = captcha_html();
|
||||
?>
|
||||
<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" 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' required itemname='제목' value='<?php echo get_text($ps['is_subject']); ?>'>
|
||||
</li>
|
||||
<li>
|
||||
<label for="" style="width:200px;">내용</label>
|
||||
<?php echo editor_html('is_content', $ps['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>
|
||||
<li>
|
||||
<label style="vertical-align:middle;"></label>
|
||||
<?php echo $captcha_html; ?>
|
||||
</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 > 5000) {
|
||||
alert('내용은 5000글자 까지만 입력해 주세요.');
|
||||
ed_is_content.returnFalse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
<?php echo get_editor_js('is_content'); ?>
|
||||
|
||||
<?php echo chk_captcha_js(); ?>
|
||||
|
||||
f.action = "./itemusewinupdate.php";
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#is_subject").focus();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
?>
|
||||
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
include_once(G4_GCAPTCHA_PATH.'/gcaptcha.lib.php');
|
||||
|
||||
if (!$is_member) {
|
||||
alert_close("사용후기는 회원만 평가가 가능합니다.");
|
||||
}
|
||||
|
||||
$is_subject = trim($_REQUEST['is_subject']);
|
||||
$is_content = trim($_REQUEST['is_content']);
|
||||
|
||||
if ($w == '' || $w == 'u') {
|
||||
if (!chk_captcha()) {
|
||||
alert('자동등록방지 숫자가 틀렸습니다.');
|
||||
}
|
||||
|
||||
$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_ps_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']} 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']}
|
||||
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_ps_use'])
|
||||
$sql .= ", is_confirm = '1' ";
|
||||
sql_query($sql);
|
||||
|
||||
if ($default['de_item_ps_use']) {
|
||||
alert_opener("평가하신 글은 관리자가 확인한 후에 표시됩니다.", $url);
|
||||
} else {
|
||||
alert_opener("사용후기가 등록 되었습니다.", $url);
|
||||
}
|
||||
}
|
||||
else if ($w == 'u')
|
||||
{
|
||||
$sql = " select is_password from {$g4['shop_item_ps_table']} where is_id = '$is_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['is_password'] != $is_password)
|
||||
alert("패스워드가 틀리므로 수정하실 수 없습니다.");
|
||||
|
||||
$sql = " update {$g4['shop_item_ps_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);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user