Merge branch 'master' of github.com:gnuboard/yc4s

This commit is contained in:
whitedot
2013-06-11 11:46:58 +09:00
89 changed files with 3159 additions and 745 deletions

View File

@ -73,7 +73,7 @@ $colspan = 5;
<h2>설정된 관리권한 내역</h2> <h2>설정된 관리권한 내역</h2>
<p>권한 <strong>r</strong>은 읽기권한, <strong>w</strong>는 쓰기권한, <strong>d</strong>는 삭제권한입니다.</p> <p>권한 <strong>r</strong>은 읽기권한, <strong>w</strong>는 쓰기권한, <strong>d</strong>는 삭제권한입니다.</p>
<form name="fauthlist" id="fauthlist" method="post" action="./auth_list_delete.php"> <form name="fauthlist" id="fauthlist" method="post" action="./auth_list_delete.php" onsubmit="return fauthlist_submit(this);">
<input type="hidden" name="sst" value="<?php echo $sst ?>"> <input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
@ -129,7 +129,7 @@ $colspan = 5;
</table> </table>
<div class="btn_list"> <div class="btn_list">
<button onclick="btn_check(this.form, 'delete')">선택삭제</button> <input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div> </div>
<?php <?php
@ -211,16 +211,21 @@ $colspan = 5;
</form> </form>
<script> <script>
$(function() { function fauthlist_submit(f)
$('#fauthlist').submit(function() { {
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert("선택삭제 하실 항목을 하나 이상 선택하세요."); alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false; return false;
} }
}
return true; return true;
}); }
});
</script> </script>
<?php <?php

View File

@ -9,7 +9,12 @@ if ($is_admin != 'super')
check_token(); check_token();
for ($i=0; $i<count($chk); $i++) $count = count($_POST['chk']);
if (!$count)
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
for ($i=0; $i<$count; $i++)
{ {
// 실제 번호를 넘김 // 실제 번호를 넘김
$k = $chk[$i]; $k = $chk[$i];

View File

@ -199,7 +199,7 @@ if (count($file_copy)) {
delete_cache_latest($bo_table); delete_cache_latest($bo_table);
delete_cache_latest($target_table); delete_cache_latest($target_table);
echo "<script>opener.document.location.reload();</script>"; //echo "<script>opener.document.location.reload();</script>";
alert("복사에 성공 했습니다.", './board_copy.php?bo_table='.$bo_table.'&amp;'.$qstr); alert("복사에 성공 했습니다.", './board_copy.php?bo_table='.$bo_table.'&amp;'.$qstr);
?> ?>

View File

@ -68,7 +68,8 @@ $colspan = 15;
<option value="bo_subject"<?php echo get_selected($_GET['sfl'], "bo_subject"); ?>>제목</option> <option value="bo_subject"<?php echo get_selected($_GET['sfl'], "bo_subject"); ?>>제목</option>
<option value="a.gr_id"<?php echo get_selected($_GET['sfl'], "a.gr_id"); ?>>그룹ID</option> <option value="a.gr_id"<?php echo get_selected($_GET['sfl'], "a.gr_id"); ?>>그룹ID</option>
</select> </select>
<input type="text" name="stx" value="<?php echo $stx ?>" title="검색어(필수)" required class="required frm_input"> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit"> <input type="submit" value="검색" class="btn_submit">
</fieldset> </fieldset>
</form> </form>

View File

@ -123,7 +123,7 @@ include_once('./admin.head.php');
</tr> </tr>
<?php for ($i=1;$i<=10;$i++) { ?> <?php for ($i=1;$i<=10;$i++) { ?>
<tr> <tr>
<th scope="row">회원여분필드<?php echo $i ?></th> <th scope="row">여분필드<?php echo $i ?></th>
<td class="td_gr_extra"> <td class="td_gr_extra">
<label for="gr_<?php echo $i ?>_subj">여분필드 <?php echo $i ?> 제목</label> <label for="gr_<?php echo $i ?>_subj">여분필드 <?php echo $i ?> 제목</label>
<input type="text" name="gr_<?php echo $i ?>_subj" value="<?php echo get_text($group['gr_'.$i.'_subj']) ?>" id="gr_<?php echo $i ?>_subj" class="frm_input"> <input type="text" name="gr_<?php echo $i ?>_subj" value="<?php echo get_text($group['gr_'.$i.'_subj']) ?>" id="gr_<?php echo $i ?>_subj" class="frm_input">

View File

@ -72,7 +72,8 @@ $colspan = 8;
<option value="gr_id"<?php echo get_selected($_GET['sfl'], "gr_id"); ?>>ID</option> <option value="gr_id"<?php echo get_selected($_GET['sfl'], "gr_id"); ?>>ID</option>
<option value="gr_admin"<?php echo get_selected($_GET['sfl'], "gr_admin"); ?>>그룹관리자</option> <option value="gr_admin"<?php echo get_selected($_GET['sfl'], "gr_admin"); ?>>그룹관리자</option>
</select> </select>
<input type="text" name="stx" value="<?php echo $stx ?>" title="검색어(필수)" required class="required frm_input"> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit"> <input type="submit" value="검색" class="btn_submit">
</fieldset> </fieldset>
</form> </form>

View File

@ -63,7 +63,8 @@ $colspan = 7;
<select id="sfl" name="sfl"> <select id="sfl" name="sfl">
<option value="a.mb_id"<?php echo get_selected($_GET['sfl'], "a.mb_id") ?>>회원아이디</option> <option value="a.mb_id"<?php echo get_selected($_GET['sfl'], "a.mb_id") ?>>회원아이디</option>
</select> </select>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" title="검색어(필수)" required class="required frm_input"> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit"> <input type="submit" value="검색" class="btn_submit">
</fieldset> </fieldset>
</form> </form>

View File

@ -83,6 +83,7 @@ $pg_anchor = '<ul class="anchor">
<li><a href="#anc_cf_join_mail">가입메일</a></li> <li><a href="#anc_cf_join_mail">가입메일</a></li>
<li><a href="#anc_cf_vote_mail">투표메일</a></li> <li><a href="#anc_cf_vote_mail">투표메일</a></li>
<li><a href="#anc_cf_sns">SNS</a></li> <li><a href="#anc_cf_sns">SNS</a></li>
<li><a href="#anc_cf_lay">레이아웃 추가설정</a></li>
<li><a href="#anc_cf_extra">여분필드</a></li> <li><a href="#anc_cf_extra">여분필드</a></li>
</ul>'; </ul>';
?> ?>
@ -108,34 +109,6 @@ $pg_anchor = '<ul class="anchor">
<th scope="row"><label for="cf_admin">최고관리자<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="cf_admin">최고관리자<strong class="sound_only">필수</strong></label></th>
<td><?php echo get_member_id_select('cf_admin', 10, $config['cf_admin'], 'required') ?></td> <td><?php echo get_member_id_select('cf_admin', 10, $config['cf_admin'], 'required') ?></td>
</tr> </tr>
<tr>
<th scope="row"><label for="cf_include_index">초기화면 파일 경로</label></th>
<td colspan="3">
<?php echo help('입력이 없으면 index.php가 초기화면 파일의 기본 경로로 설정됩니다.') ?>
<input type="text" name="cf_include_index" value="<?php echo $config['cf_include_index'] ?>" id="cf_include_index" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_include_head">상단 파일 경로</label></th>
<td colspan="3">
<?php echo help('입력이 없으면 head.php가 상단 파일의 기본 경로로 설정됩니다.') ?>
<input type="text" name="cf_include_head" value="<?php echo $config['cf_include_head'] ?>" id="cf_include_head" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_include_tail">하단 파일 경로</label></th>
<td colspan="3">
<?php echo help('입력이 없으면 tail.php가 상단 파일의 기본 경로로 설정됩니다.') ?>
<input type="text" name="cf_include_tail" value="<?php echo $config['cf_include_tail'] ?>" id="cf_include_tail" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_add_script">추가 script, css</label></th>
<td colspan="3">
<?php echo help('HTML의 &lt;/HEAD&gt; 태그위로 추가될 JavaScript와 css 코드를 설정합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.') ?>
<textarea name="cf_add_script" id="cf_add_script"><?php echo $config['cf_add_script'] ?></textarea>
</td>
</tr>
<tr> <tr>
<th scope="row"><label for="cf_use_point">포인트 사용</label></th> <th scope="row"><label for="cf_use_point">포인트 사용</label></th>
<td colspan="3"><input type="checkbox" name="cf_use_point" value="1" id="cf_use_point" <?php echo $config['cf_use_point']?'checked':''; ?>> 사용</td> <td colspan="3"><input type="checkbox" name="cf_use_point" value="1" id="cf_use_point" <?php echo $config['cf_use_point']?'checked':''; ?>> 사용</td>
@ -765,6 +738,47 @@ $pg_anchor = '<ul class="anchor">
</table> </table>
</section> </section>
<section id="anc_cf_lay" class="cbox">
<h2>레이아웃 추가설정</h2>
<?php echo $pg_anchor; ?>
<p>기본 설정된 파일 경로 및 script, css 를 추가하거나 변경할 수 있습니다.</p>
<table class="frm_tbl">
<colgroup>
<col class="grid_3">
<col class="grid_15">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="cf_include_index">초기화면 파일 경로</label></th>
<td>
<?php echo help('입력이 없으면 index.php가 초기화면 파일의 기본 경로로 설정됩니다.') ?>
<input type="text" name="cf_include_index" value="<?php echo $config['cf_include_index'] ?>" id="cf_include_index" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_include_head">상단 파일 경로</label></th>
<td>
<?php echo help('입력이 없으면 head.php가 상단 파일의 기본 경로로 설정됩니다.') ?>
<input type="text" name="cf_include_head" value="<?php echo $config['cf_include_head'] ?>" id="cf_include_head" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_include_tail">하단 파일 경로</label></th>
<td>
<?php echo help('입력이 없으면 tail.php가 상단 파일의 기본 경로로 설정됩니다.') ?>
<input type="text" name="cf_include_tail" value="<?php echo $config['cf_include_tail'] ?>" id="cf_include_tail" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_add_script">추가 script, css</label></th>
<td>
<?php echo help('HTML의 &lt;/HEAD&gt; 태그위로 추가될 JavaScript와 css 코드를 설정합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.') ?>
<textarea name="cf_add_script" id="cf_add_script"><?php echo $config['cf_add_script'] ?></textarea>
</td>
</tr>
</tbody>
</table>
</section>
<section id="anc_cf_extra" class="cbox"> <section id="anc_cf_extra" class="cbox">
<h2>여분필드 기본 설정</h2> <h2>여분필드 기본 설정</h2>

View File

@ -53,7 +53,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
$mb = array(); $mb = array();
if ($sfl == 'mb_id' && $stx) if ($sfl == 'mb_id' && $stx)
$mb = get_member(isset($stx)); $mb = get_member($stx);
$g4['title'] = '포인트관리'; $g4['title'] = '포인트관리';
include_once ('./admin.head.php'); include_once ('./admin.head.php');
@ -61,11 +61,6 @@ include_once ('./admin.head.php');
$colspan = 8; $colspan = 8;
?> ?>
<script>
var list_update_php = '';
var list_delete_php = 'point_list_delete.php';
</script>
<script> <script>
function point_clear() function point_clear()
{ {
@ -96,7 +91,8 @@ function point_clear()
<option value="mb_id"<?php echo get_selected($_GET['sfl'], "mb_id"); ?>>회원아이디</option> <option value="mb_id"<?php echo get_selected($_GET['sfl'], "mb_id"); ?>>회원아이디</option>
<option value="po_content"<?php echo get_selected($_GET['sfl'], "po_content"); ?>>내용</option> <option value="po_content"<?php echo get_selected($_GET['sfl'], "po_content"); ?>>내용</option>
</select> </select>
<input type="text" name="stx" value="<?php echo $stx ?>" title="검색어(필수)" required class="required frm_input"> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" class="btn_submit" value="검색"> <input type="submit" class="btn_submit" value="검색">
</fieldset> </fieldset>
</form> </form>
@ -104,7 +100,7 @@ function point_clear()
<section class="cbox"> <section class="cbox">
<h2>포인트 내역</h2> <h2>포인트 내역</h2>
<form name="fpointlist" id="fpointlist" method="post"> <form name="fpointlist" id="fpointlist" method="post" action="./point_list_delete.php" onsubmit="return fpointlist_submit(this);">
<input type="hidden" name="sst" value="<?php echo $sst ?>"> <input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
@ -167,7 +163,7 @@ function point_clear()
</table> </table>
<div class="btn_list"> <div class="btn_list">
<button onclick="btn_check(this.form, 'delete')">선택삭제</button> <input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div> </div>
</form> </form>
@ -215,6 +211,24 @@ function point_clear()
</section> </section>
<script>
function fpointlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>
<?php <?php
include_once ('./admin.tail.php'); include_once ('./admin.tail.php');
?> ?>

View File

@ -10,7 +10,7 @@ check_token();
$count = count($_POST['chk']); $count = count($_POST['chk']);
if(!$count) if(!$count)
alert("선택삭제 하실 항목을 하나이상 선택해 주세요."); alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
for ($i=0; $i<$count; $i++) for ($i=0; $i<$count; $i++)
{ {

View File

@ -64,7 +64,8 @@ $colspan = 6;
<select name="sfl" id="sfl" title="검색대상"> <select name="sfl" id="sfl" title="검색대상">
<option value="po_subject"<?php echo get_selected($_GET['sfl'], "po_subject"); ?>>제목</option> <option value="po_subject"<?php echo get_selected($_GET['sfl'], "po_subject"); ?>>제목</option>
</select> </select>
<input type="text" name="stx" value="<?php echo $stx ?>" title="검색어(필수)" required class="required frm_input"> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" class="btn_submit" value="검색"> <input type="submit" class="btn_submit" value="검색">
</fieldset> </fieldset>
</form> </form>

View File

@ -82,7 +82,8 @@ var list_delete_php = 'popular_list.php';
<option value="pp_word"<?php echo get_selected($_GET['sfl'], "pp_word"); ?>>검색어</option> <option value="pp_word"<?php echo get_selected($_GET['sfl'], "pp_word"); ?>>검색어</option>
<option value="pp_date"<?php echo get_selected($_GET['sfl'], "pp_date"); ?>>등록일</option> <option value="pp_date"<?php echo get_selected($_GET['sfl'], "pp_date"); ?>>등록일</option>
</select> </select>
<input type="text" name="stx" value="<?php echo $stx ?>" title="검색어(필수)" required class="required frm_input"> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit"> <input type="submit" value="검색" class="btn_submit">
</fieldset> </fieldset>
</form> </form>

View File

@ -0,0 +1,17 @@
<?php
include_once('./_common.php');
$ca_id = trim($_POST['ca_id']);
if (preg_match("/[^0-9a-z]/i", $ca_id)) {
die("{\"error\":\"분류코드는 영문자 숫자 만 입력 가능합니다.\"}");
}
$sql = " select ca_name from {$g4['shop_category_table']} where ca_id = '{$ca_id}' ";
$row = sql_fetch($sql);
if ($row['ca_name']) {
$ca_name = addslashes($row['ca_name']);
die("{\"error\":\"이미 등록된 분류코드 입니다.\\n\\n분류명 : {$ca_name}\"}");
}
die("{\"error\":\"\"}"); // 정상
?>

View File

@ -0,0 +1,17 @@
<?php
include_once('./_common.php');
$it_id = trim($_POST['it_id']);
if (preg_match("/[^\w\-]/", $it_id)) { // \w : 0-9 A-Z a-z _
die("{\"error\":\"상품코드는 영문자 숫자 _ - 만 입력 가능합니다.\"}");
}
$sql = " select it_name from {$g4['shop_item_table']} where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
if ($row['it_name']) {
$it_name = addslashes($row['it_name']);
die("{\"error\":\"이미 등록된 상품코드 입니다.\\n\\n상품명 : {$it_name}\"}");
}
die("{\"error\":\"\"}"); // 정상
?>

View File

@ -131,7 +131,7 @@ $pg_anchor .= '</ul>';
<?php if ($w == "") { ?> <?php if ($w == "") { ?>
<?php echo help("자동으로 보여지는 분류코드를 사용하시길 권해드리지만 직접 입력한 값으로도 사용할 수 있습니다.\n분류코드는 나중에 수정이 되지 않으므로 신중하게 결정하여 사용하십시오.\n\n분류코드는 2자리씩 10자리를 사용하여 5단계를 표현할 수 있습니다.\n0~z까지 입력이 가능하며 한 분류당 최대 1296가지를 표현할 수 있습니다.\n그러므로 총 3656158440062976가지의 분류를 사용할 수 있습니다."); ?> <?php echo help("자동으로 보여지는 분류코드를 사용하시길 권해드리지만 직접 입력한 값으로도 사용할 수 있습니다.\n분류코드는 나중에 수정이 되지 않으므로 신중하게 결정하여 사용하십시오.\n\n분류코드는 2자리씩 10자리를 사용하여 5단계를 표현할 수 있습니다.\n0~z까지 입력이 가능하며 한 분류당 최대 1296가지를 표현할 수 있습니다.\n그러므로 총 3656158440062976가지의 분류를 사용할 수 있습니다."); ?>
<input type="text" name="ca_id" value="<?php echo $subid; ?>" id="ca_id" class="frm_input" size="<?php echo $sublen; ?>" maxlength="<?php echo $sublen; ?>"> <input type="text" name="ca_id" value="<?php echo $subid; ?>" id="ca_id" class="frm_input" size="<?php echo $sublen; ?>" maxlength="<?php echo $sublen; ?>">
<?php if ($default['de_code_dup_use']) { ?><a href="javascript:;" onclick="codedupcheck(document.getElementById('ca_id').value)">코드 중복검사</a><?php } ?> <!-- <?php if ($default['de_code_dup_use']) { ?><a href="javascript:;" onclick="codedupcheck(document.getElementById('ca_id').value)">코드 중복검사</a><?php } ?> -->
<?php } else { ?> <?php } else { ?>
<input type="hidden" name="ca_id" value="<?php echo $ca['ca_id']; ?>"> <input type="hidden" name="ca_id" value="<?php echo $ca['ca_id']; ?>">
<span class="frm_ca_id"><?php echo $ca['ca_id']; ?></span> <span class="frm_ca_id"><?php echo $ca['ca_id']; ?></span>
@ -393,44 +393,36 @@ $pg_anchor .= '</ul>';
<script> <script>
function fcategoryformcheck(f) function fcategoryformcheck(f)
{ {
if (f.w.value == "") {
var error = "";
$.ajax({
url: "./ajax.ca_id.php",
type: "POST",
data: {
"ca_id": f.ca_id.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
error = data.error;
}
});
if (error) {
alert(error);
return false;
}
}
<?php echo get_editor_js('ca_head_html'); ?> <?php echo get_editor_js('ca_head_html'); ?>
<?php echo get_editor_js('ca_tail_html'); ?> <?php echo get_editor_js('ca_tail_html'); ?>
<?php echo get_editor_js('ca_mobile_head_html'); ?> <?php echo get_editor_js('ca_mobile_head_html'); ?>
<?php echo get_editor_js('ca_mobile_tail_html'); ?> <?php echo get_editor_js('ca_mobile_tail_html'); ?>
if (f.w.value == "") {
if (f.codedup.value == '1') {
alert("코드 중복검사를 하셔야 합니다.");
return false;
}
}
return true; return true;
} }
function codedupcheck(id)
{
if (!id) {
alert("분류코드를 입력하십시오.");
f.ca_id.focus();
return;
}
$.post(
"./codedupcheck.php",
{ ca_id: id },
function(data) {
if(data.name) {
alert("코드 '"+data.code+"' 는 '".data.name+"' (으)로 이미 등록되어 있으므로\n\n사용하실 수 없습니다.");
return false;
} else {
alert("'"+data.code+"' 은(는) 등록된 코드가 없으므로 사용하실 수 있습니다.");
document.fcategoryform.codedup.value = '';
}
}, "json"
);
}
/*document.fcategoryform.ca_name.focus(); 포커스 해제*/ /*document.fcategoryform.ca_name.focus(); 포커스 해제*/
</script> </script>

View File

@ -571,74 +571,6 @@ $pg_anchor = '<ul class="anchor">
<td> <td>
<input type="text" name="de_dacom_mertkey" value="<?php echo $default['de_dacom_mertkey']; ?>" id="de_dacom_mertkey" size="40"> <input type="text" name="de_dacom_mertkey" value="<?php echo $default['de_dacom_mertkey']; ?>" id="de_dacom_mertkey" size="40">
</td> </td>
<!-- <td>LG텔레콤 테스트 모드</td>
<td>
<input type="checkbox" name="de_dacom_test" value="1" <?php echo $default['de_dacom_test']?"checked":""; ?>>
테스트로 결제하실 경우에 체크하세요.
</td> -->
</tr>
<tr style="display:none;">
<th scope="row"><label for="de_inicis_mid">이니시스 아이디</label></th>
<td>
<input type="text" name="de_inicis_mid" value="<?php echo $default['de_inicis_mid']; ?>" id="de_inicis_mid" size="40">
</td>
<th scope="row"><label for="de_inicis_passwd">이니시스 패스워드</label></th>
<td>
<input type="text" name="de_inicis_passwd" value="<?php echo $default['de_inicis_passwd']; ?>" id="de_inicis_passwd">
</td>
</tr>
<tr style="display:none">
<th scope="row"><label for="de_banktown_mid">뱅크타운 상점ID</label></th>
<td>
<input type="text" name="de_banktown_mid" value="<?php echo $default['de_banktown_mid']; ?>" id="de_banktown_mid" size="40">
</td>
<th scope="row"><label for="de_banktown_auth_key">뱅크타운 라이센스 키<!-- AuthKey --></label></th>
<td>
<input type="text" name="de_banktown_auth_key" value="<?php echo $default['de_banktown_auth_key']; ?>" id="de_banktown_auth_key" size="40" maxlength="32">
</td>
</tr>
<tr style="display:none">
<th scope="row"><label for="de_allthegate_mid">올더게이트 몰ID</label></th>
<td>
<input type="text" name="de_allthegate_mid" value="<?php echo $default['de_allthegate_mid']; ?>" id="de_allthegate_mid" size="40">
</td>
</tr>
<tr style="display:none">
<th scope="row"><label for="de_allat_partner_id">올앳 파트너 ID</label></th>
<td>
<input type="text" name="de_allat_partner_id" value="<?php echo $default['de_allat_partner_id']; ?>" id="de_allat_partner_id" size="40">
</td>
<th scope="row"><label for="de_allat_prefix">주문번호 Prefix</label></th>
<td>
<input type="text" name="de_allat_prefix" value="<?php echo $default['de_allat_prefix']; ?>" id="de_allat_prefix"> 3자리
</td>
</tr>
<tr style="display:none">
<th scope="row"><label for="de_allat_formkey">올앳 FormKey 값</label></th>
<td>
<input type="text" name="de_allat_formkey" value="<?php echo $default['de_allat_formkey']; ?>" id="de_allat_formkey" size="40">
</td>
<th scope="row"><label for="de_allat_crosskey">올앳 CrossKey 값</label></th>
<td>
<input type="text" name="de_allat_crosskey" value="<?php echo $default['de_allat_crosskey']; ?>" id="de_allat_crosskey" size="40">
</td>
</tr>
<tr style="display:none">
<th scope="row"><label for="de_tgcorp_mxid">티지코프 ID</label></th>
<td>
<input type="text" name="de_tgcorp_mxid" value="<?php echo $default['de_tgcorp_mxid']; ?>" id="de_tgcorp_mxid" size="40">
</td>
<th scope="row"><label for="de_tgcorp_mxotp">티지코프 접근키</label></th>
<td>
<input type="text" name="de_tgcorp_mxotp" value="<?php echo $default['de_tgcorp_mxotp']; ?>" id="de_tgcorp_mxotp" size="40">
</td>
</tr>
<tr style="display:none">
<th scope="row"><label for="de_kspay_id">KSPAY 상점아이디</label></th>
<td>
<input type="text" name="de_kspay_id" value="<?php echo $default['de_kspay_id']; ?>" id="de_kspay_id" size="40">
</td>
</tr>
</tbody> </tbody>
</table> </table>
</section> </section>
@ -885,13 +817,6 @@ $pg_anchor = '<ul class="anchor">
<th scope="row">서버 IP</th> <th scope="row">서버 IP</th>
<td><?php echo ($_SERVER['SERVER_ADDR']?$_SERVER['SERVER_ADDR']:$_SERVER['LOCAL_ADDR']); ?></td> <td><?php echo ($_SERVER['SERVER_ADDR']?$_SERVER['SERVER_ADDR']:$_SERVER['LOCAL_ADDR']); ?></td>
</tr> </tr>
<tr>
<th scope="row"><label for="de_register">프로그램 등록번호</label></th>
<td>
<?php echo help("정품에 한해 발급해 드립니다. 등록번호가 없거나 틀리면, 주문서를 확인할 수 없습니다.\n등록번호는 서버 IP, MYSQL USER, DB 를 알려주셔야 발급이 가능합니다.", -180, -160); ?>
<input type="text" name="de_register" value="<?php echo $default['de_register']; ?>" id="de_register" class="frm_input required" required size="30">
</td>
</tr>
</tbody> </tbody>
</table> </table>
</section> </section>

View File

@ -120,21 +120,8 @@ $sql = " update {$g4['shop_default_table']}
de_scroll_banner_use = '$de_scroll_banner_use', de_scroll_banner_use = '$de_scroll_banner_use',
de_cart_skin = '$de_cart_skin', de_cart_skin = '$de_cart_skin',
de_register = '$de_register', de_register = '$de_register',
de_inicis_mid = '$de_inicis_mid',
de_inicis_passwd = '$de_inicis_passwd',
de_dacom_mid = '$de_dacom_mid',
de_dacom_test = '$de_dacom_test',
de_dacom_mertkey = '$de_dacom_mertkey',
de_allthegate_mid = '$de_allthegate_mid',
de_kcp_mid = '$de_kcp_mid', de_kcp_mid = '$de_kcp_mid',
de_iche_use = '$de_iche_use', de_iche_use = '$de_iche_use',
de_allat_partner_id = '$de_allat_partner_id',
de_allat_prefix = '$de_allat_prefix',
de_allat_formkey = '$de_allat_formkey',
de_allat_crosskey = '$de_allat_crosskey',
de_tgcorp_mxid = '$de_tgcorp_mxid',
de_tgcorp_mxotp = '$de_tgcorp_mxotp',
de_kspay_id = '$de_kspay_id',
de_sms_cont1 = '$de_sms_cont1', de_sms_cont1 = '$de_sms_cont1',
de_sms_cont2 = '$de_sms_cont2', de_sms_cont2 = '$de_sms_cont2',
de_sms_cont3 = '$de_sms_cont3', de_sms_cont3 = '$de_sms_cont3',
@ -145,7 +132,6 @@ $sql = " update {$g4['shop_default_table']}
de_sms_use3 = '$de_sms_use3', de_sms_use3 = '$de_sms_use3',
de_sms_use4 = '$de_sms_use4', de_sms_use4 = '$de_sms_use4',
de_sms_use5 = '$de_sms_use5', de_sms_use5 = '$de_sms_use5',
de_xonda_id = '$de_xonda_id',
de_sms_hp = '$de_sms_hp', de_sms_hp = '$de_sms_hp',
de_item_ps_use = '$de_item_ps_use', de_item_ps_use = '$de_item_ps_use',
de_code_dup_use = '$de_code_dup_use', de_code_dup_use = '$de_code_dup_use',

View File

@ -10,7 +10,7 @@ $g4['title'] = $html_title;
include_once(G4_PATH.'/head.sub.php'); include_once(G4_PATH.'/head.sub.php');
$sql_common = " from {$g4['member_table']} "; $sql_common = " from {$g4['member_table']} ";
$sql_where = " where mb_leave_date = '' and mb_intercept_date ='' "; $sql_where = " where mb_id <> '{$config['cf_admin']}' and mb_leave_date = '' and mb_intercept_date ='' ";
if($_GET['mb_name']) if($_GET['mb_name'])
$sql_where .= " and mb_name like '%$mb_name%' "; $sql_where .= " and mb_name like '%$mb_name%' ";

View File

@ -0,0 +1,106 @@
<?php
// itemlistdelete.php 에서 include 하는 파일
if (!defined('_GNUBOARD_')) exit;
if (!defined('_ITEM_DELETE_')) exit; // 개별 페이지 접근 불가
if (!function_exists("itemdelete")) {
// 상품삭제
// 메세지출력후 주문개별내역페이지로 이동
function itemdelete($it_id)
{
global $g4, $is_admin;
$sql = " select it_explan, it_mobile_explan, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g4['shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
// 상품 이미지 삭제
$dir_list = array();
for($i=1; $i<=10; $i++) {
$file = G4_DATA_PATH.'/item/'.$it['it_img'.$i];
if(is_file($file) && $it['it_img'.$i]) {
@unlink($file);
$dir = dirname($file);
delete_item_thumbnail($dir, basename($file));
if(!in_array($dir, $dir_list))
$dir_list[] = $dir;
}
}
// 이미지디렉토리 삭제
for($i=0; $i<count($dir_list); $i++) {
if(is_dir($dir_list[$i]))
rmdir($dir_list[$i]);
}
// 상, 하단 이미지 삭제
@unlink(G4_DATA_PATH."/item/$it_id"."_h");
@unlink(G4_DATA_PATH."/item/$it_id"."_t");
// 장바구니 삭제
$sql = " delete from {$g4['shop_cart_table']} where it_id = '$it_id' ";
sql_query($sql);
// 이벤트삭제
$sql = " delete from {$g4['shop_event_item_table']} where it_id = '$it_id' ";
sql_query($sql);
// 사용후기삭제
$sql = " delete from {$g4['shop_item_ps_table']} where it_id = '$it_id' ";
sql_query($sql);
// 상품문의삭제
$sql = " delete from {$g4['shop_item_qa_table']} where it_id = '$it_id' ";
sql_query($sql);
// 관련상품삭제
$sql = " delete from {$g4['shop_item_relation_table']} where it_id = '$it_id' or it_id2 = '$it_id' ";
sql_query($sql);
//------------------------------------------------------------------------
// HTML 내용에서 에디터에 올라간 이미지의 경로를 얻어 삭제함
//------------------------------------------------------------------------
$imgs = get_editor_image($it['it_explan']);
for($i=0;$i<count($imgs[1]);$i++) {
$p = parse_url($imgs[1][$i]);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
$data_path = $p['path'];
$destfile = G4_PATH.$data_path;
if(is_file($destfile))
@unlink($destfile);
}
$imgs = get_editor_image($it['it_mobile_explan']);
for($i=0;$i<count($imgs[1]);$i++) {
$p = parse_url($imgs[1][$i]);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
$data_path = $p['path'];
$destfile = G4_PATH.$data_path;
if(is_file($destfile))
@unlink($destfile);
}
//------------------------------------------------------------------------
// 상품 삭제
$sql = " delete from {$g4['shop_item_table']} where it_id = '$it_id' ";
sql_query($sql);
}
}
itemdelete($it_id);
?>

View File

@ -194,7 +194,7 @@ $pg_anchor ='<ul class="anchor">
<!-- <input type=text class=required name=it_id value="<?php echo 10000000000-time()?>" size=12 maxlength=10 required> <a href='javascript:;' onclick="codedupcheck(document.all.it_id.value)"><img src='./img/btn_code.gif' border=0 align=absmiddle></a> --> <!-- <input type=text class=required name=it_id value="<?php echo 10000000000-time()?>" size=12 maxlength=10 required> <a href='javascript:;' onclick="codedupcheck(document.all.it_id.value)"><img src='./img/btn_code.gif' border=0 align=absmiddle></a> -->
<?php echo help("상품의 코드는 10자리 숫자로 자동생성합니다. <b>직접 상품코드를 입력할 수도 있습니다.</b>\n상품코드는 영문자, 숫자, - 만 입력 가능합니다."); ?> <?php echo help("상품의 코드는 10자리 숫자로 자동생성합니다. <b>직접 상품코드를 입력할 수도 있습니다.</b>\n상품코드는 영문자, 숫자, - 만 입력 가능합니다."); ?>
<input type="text" name="it_id" value="<?php echo time(); ?>" id="it_id" required class="frm_input required" size="20" maxlength="20"> <input type="text" name="it_id" value="<?php echo time(); ?>" id="it_id" required class="frm_input required" size="20" maxlength="20">
<?php if ($default['de_code_dup_use']) { ?><button type="button" class="btn_frmline" onclick="codedupcheck(document.all.it_id.value)">중복검사</a><?php } ?> <!-- <?php if ($default['de_code_dup_use']) { ?><button type="button" class="btn_frmline" onclick="codedupcheck(document.all.it_id.value)">중복검사</a><?php } ?> -->
<?php } else { ?> <?php } else { ?>
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>"> <input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
<span class="frm_ca_id"><?php echo $it['it_id']; ?></span> <span class="frm_ca_id"><?php echo $it['it_id']; ?></span>
@ -1334,8 +1334,23 @@ function fitemformcheck(f)
} }
if (f.w.value == "") { if (f.w.value == "") {
if (f.codedup.value == '1') { var error = "";
alert("코드 중복검사를 하셔야 합니다."); $.ajax({
url: "./ajax.it_id.php",
type: "POST",
data: {
"it_id": f.it_id.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
error = data.error;
}
});
if (error) {
alert(error);
return false; return false;
} }
} }

View File

@ -10,102 +10,6 @@ if ($w == '' || $w == 'u')
else if ($w == 'd') else if ($w == 'd')
auth_check($auth[$sub_menu], "d"); auth_check($auth[$sub_menu], "d");
// 상품삭제
// 메세지출력후 주문개별내역페이지로 이동
function itemdelete($it_id)
{
global $g4, $is_admin;
$sql = " select it_explan, it_mobile_explan, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g4['shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
// 상품 이미지 삭제
$dir_list = array();
for($i=1; $i<=10; $i++) {
$file = G4_DATA_PATH.'/item/'.$it['it_img'.$i];
if(is_file($file) && $it['it_img'.$i]) {
@unlink($file);
$dir = dirname($file);
delete_item_thumbnail($dir, basename($file));
if(!in_array($dir, $dir_list))
$dir_list[] = $dir;
}
}
// 이미지디렉토리 삭제
for($i=0; $i<count($dir_list); $i++) {
if(is_dir($dir_list[$i]))
rmdir($dir_list[$i]);
}
// 상, 하단 이미지 삭제
@unlink(G4_DATA_PATH."/item/$it_id"."_h");
@unlink(G4_DATA_PATH."/item/$it_id"."_t");
// 장바구니 삭제
$sql = " delete from {$g4['shop_cart_table']} where it_id = '$it_id' ";
sql_query($sql);
// 이벤트삭제
$sql = " delete from {$g4['shop_event_item_table']} where it_id = '$it_id' ";
sql_query($sql);
// 사용후기삭제
$sql = " delete from {$g4['shop_item_ps_table']} where it_id = '$it_id' ";
sql_query($sql);
// 상품문의삭제
$sql = " delete from {$g4['shop_item_qa_table']} where it_id = '$it_id' ";
sql_query($sql);
// 관련상품삭제
$sql = " delete from {$g4['shop_item_relation_table']} where it_id = '$it_id' or it_id2 = '$it_id' ";
sql_query($sql);
//------------------------------------------------------------------------
// HTML 내용에서 에디터에 올라간 이미지의 경로를 얻어 삭제함
//------------------------------------------------------------------------
$imgs = get_editor_image($it['it_explan']);
for($i=0;$i<count($imgs[1]);$i++) {
$p = parse_url($imgs[1][$i]);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
$data_path = $p['path'];
$destfile = G4_PATH.$data_path;
if(is_file($destfile))
@unlink($destfile);
}
$imgs = get_editor_image($it['it_mobile_explan']);
for($i=0;$i<count($imgs[1]);$i++) {
$p = parse_url($imgs[1][$i]);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
$data_path = $p['path'];
$destfile = G4_PATH.$data_path;
if(is_file($destfile))
@unlink($destfile);
}
//------------------------------------------------------------------------
// 상품 삭제
$sql = " delete from {$g4['shop_item_table']} where it_id = '$it_id' ";
sql_query($sql);
}
@mkdir(G4_DATA_PATH."/item", 0707); @mkdir(G4_DATA_PATH."/item", 0707);
@chmod(G4_DATA_PATH."/item", 0707); @chmod(G4_DATA_PATH."/item", 0707);
@ -428,6 +332,7 @@ else if ($w == "u")
where it_id = '$it_id' "; where it_id = '$it_id' ";
sql_query($sql); sql_query($sql);
} }
/*
else if ($w == "d") else if ($w == "d")
{ {
if ($is_admin != 'super') if ($is_admin != 'super')
@ -443,6 +348,7 @@ else if ($w == "d")
itemdelete($it_id); itemdelete($it_id);
} }
*/
if ($w == "" || $w == "u") if ($w == "" || $w == "u")
{ {

View File

@ -135,7 +135,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
<a href="./itemsellrank.php" class="btn_add_optional">상품판매순위</a> <a href="./itemsellrank.php" class="btn_add_optional">상품판매순위</a>
</div> </div>
<form name="fitemlistupdate" method="post" action="./itemlistupdate.php" autocomplete="off"> <form name="fitemlistupdate" method="post" action="./itemlistupdate.php" onsubmit="return fitemlist_submit(this);" autocomplete="off">
<input type="hidden" name="sca" value="<?php echo $sca; ?>"> <input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>"> <input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>"> <input type="hidden" name="sod" value="<?php echo $sod; ?>">
@ -146,6 +146,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
<table> <table>
<thead> <thead>
<tr> <tr>
<th scope="col" rowspan="2"><input type="checkbox" name="chkall" value="1" id="chkall" title="현재 페이지 게시판 전체선택" onclick="check_all(this.form)"></th>
<th scope="col" rowspan="2"><?php echo subject_sort_link('it_id', 'sca='.$sca); ?>상품코드 <span class="sound_only">순 정렬</span></a></th> <th scope="col" rowspan="2"><?php echo subject_sort_link('it_id', 'sca='.$sca); ?>상품코드 <span class="sound_only">순 정렬</span></a></th>
<th scope="col" colspan="2" rowspan="2">분류 및 <?php echo subject_sort_link('it_name', 'sca='.$sca); ?>상품명 <span class="sound_only">순 정렬</span></a></th> <th scope="col" colspan="2" rowspan="2">분류 및 <?php echo subject_sort_link('it_name', 'sca='.$sca); ?>상품명 <span class="sound_only">순 정렬</span></a></th>
<th scope="col" id="sit_amt"><?php echo subject_sort_link('it_price', 'sca='.$sca); ?>판매가격 <span class="sound_only">순 정렬</span></a></th> <th scope="col" id="sit_amt"><?php echo subject_sort_link('it_price', 'sca='.$sca); ?>판매가격 <span class="sound_only">순 정렬</span></a></th>
@ -169,6 +170,9 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
$gallery = $row['it_gallery'] ? 'Y' : ''; $gallery = $row['it_gallery'] ? 'Y' : '';
?> ?>
<tr> <tr>
<td rowspan="2">
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>" title="<?php echo get_text($row['bo_subject']) ?> 게시판선택">
</td>
<td rowspan="2"> <td rowspan="2">
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>"> <input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<?php echo $row['it_id']; ?> <?php echo $row['it_id']; ?>
@ -191,7 +195,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
<a href="<?php echo $href; ?>"><img src="./img/icon_view.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 보기"></a> <a href="<?php echo $href; ?>"><img src="./img/icon_view.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 보기"></a>
<a href="./item_copy.php?it_id=<?php echo $row['it_id']; ?>&amp;ca_id=<?php echo $row['ca_id']; ?>" class="item_copy" target="_blank"><img src="./img/icon_copy.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 복사"></a> <a href="./item_copy.php?it_id=<?php echo $row['it_id']; ?>&amp;ca_id=<?php echo $row['ca_id']; ?>" class="item_copy" target="_blank"><img src="./img/icon_copy.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 복사"></a>
<a href="./itemform.php?w=u&amp;it_id=<?php echo $row['it_id']; ?>&amp;ca_id=<?php echo $row['ca_id']; ?>&amp;<?php echo $qstr; ?>"><img src="./img/icon_mod.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 수정"></a> <a href="./itemform.php?w=u&amp;it_id=<?php echo $row['it_id']; ?>&amp;ca_id=<?php echo $row['ca_id']; ?>&amp;<?php echo $qstr; ?>"><img src="./img/icon_mod.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 수정"></a>
<a href="./itemformupdate.php?w=d&amp;it_id=<?php echo $row['it_id']; ?>&amp;ca_id=<?php echo $row['ca_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return delete_confirm();"><img src="./img/icon_del.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 삭제"></a> <!-- <a href="./itemformupdate.php?w=d&amp;it_id=<?php echo $row['it_id']; ?>&amp;ca_id=<?php echo $row['ca_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return delete_confirm();"><img src="./img/icon_del.jpg" alt="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> 삭제"></a> -->
</td> </td>
</tr> </tr>
<tr> <tr>
@ -206,9 +210,15 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
</tbody> </tbody>
</table> </table>
<div class="btn_confirm"> <div class="btn_list">
<input type="submit" value="일괄수정" class="btn_submit" accesskey="s"> <input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<?php if ($is_admin == 'super') { ?>
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<?php } ?>
</div> </div>
<!-- <div class="btn_confirm">
<input type="submit" value="일괄수정" class="btn_submit" accesskey="s">
</div> -->
</form> </form>
</section> </section>
@ -216,6 +226,22 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
<?php echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page="); ?> <?php echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page="); ?>
<script> <script>
function fitemlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
$(function() { $(function() {
$(".item_copy").click(function() { $(".item_copy").click(function() {
var href = $(this).attr("href"); var href = $(this).attr("href");

View File

@ -4,24 +4,50 @@ include_once('./_common.php');
check_demo(); check_demo();
auth_check($auth[$sub_menu], "w"); if (!count($_POST['chk'])) {
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
// 판매가격 일괄수정 }
for ($i=0; $i<count($_POST['it_id']); $i++)
{ if ($_POST['act_button'] == "선택수정") {
$sql = "update {$g4['shop_item_table']}
set ca_id = '{$_POST['ca_id'][$i]}', auth_check($auth[$sub_menu], 'w');
it_name = '{$_POST['it_name'][$i]}',
it_cust_price = '{$_POST['it_cust_price'][$i]}', for ($i=0; $i<count($_POST['chk']); $i++) {
it_price = '{$_POST['it_price'][$i]}',
it_point = '{$_POST['it_point'][$i]}', // 실제 번호를 넘김
it_stock_qty = '{$_POST['it_stock_qty'][$i]}', $k = $_POST['chk'][$i];
it_use = '{$_POST['it_use'][$i]}',
it_order = '{$_POST['it_order'][$i]}' $sql = "update {$g4['shop_item_table']}
where it_id = '{$_POST['it_id'][$i]}' "; set ca_id = '{$_POST['ca_id'][$k]}',
sql_query($sql); it_name = '{$_POST['it_name'][$k]}',
it_cust_price = '{$_POST['it_cust_price'][$k]}',
it_price = '{$_POST['it_price'][$k]}',
it_point = '{$_POST['it_point'][$k]}',
it_stock_qty = '{$_POST['it_stock_qty'][$k]}',
it_use = '{$_POST['it_use'][$k]}',
it_order = '{$_POST['it_order'][$k]}'
where it_id = '{$_POST['it_id'][$k]}' ";
sql_query($sql);
}
} else if ($_POST['act_button'] == "선택삭제") {
if ($is_admin != 'super')
alert('상품 삭제는 최고관리자만 가능합니다.');
auth_check($auth[$sub_menu], 'd');
// _ITEM_DELETE_ 상수를 선언해야 itemdelete.inc.php 가 정상 작동함
define('_ITEM_DELETE_', true);
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
// include 전에 $it_id 값을 반드시 넘겨야 함
$it_id = $_POST['it_id'][$k];
include ('./itemdelete.inc.php');
}
} }
//goto_url("./itemlist.php?sort1=$sort1&amp;sort2=$sort2&amp;sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page");
goto_url("./itemlist.php?sca=$sca&amp;sst=$sst&amp;sod=$sod&amp;sfl=$sfl&amp;stx=$stx&amp;page=$page"); goto_url("./itemlist.php?sca=$sca&amp;sst=$sst&amp;sod=$sod&amp;sfl=$sfl&amp;stx=$stx&amp;page=$page");
?> ?>

View File

@ -100,7 +100,8 @@ $total_order = $row['sum_order'];
// 상품목록 // 상품목록
$sql = " select it_id, $sql = " select it_id,
it_name it_name,
cp_amount
from {$g4['shop_cart_table']} from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}' where uq_id = '{$od['uq_id']}'
and ct_num = '0' and ct_num = '0'
@ -215,6 +216,7 @@ $pg_anchor = '<ul class="anchor">
</li> </li>
<? <?
$t_cp_amount += $row['cp_amount']; // 쿠폰사용금액
$t_ct_amount['합계'] += $ct_amount['소계']; $t_ct_amount['합계'] += $ct_amount['소계'];
$t_ct_point['합계'] += $ct_point['소계']; $t_ct_point['합계'] += $ct_point['소계'];
} }
@ -247,8 +249,11 @@ $pg_anchor = '<ul class="anchor">
// 입금액 = 무통장(가상계좌, 계좌이체 포함) + 신용카드 + 휴대폰 + 포인트 // 입금액 = 무통장(가상계좌, 계좌이체 포함) + 신용카드 + 휴대폰 + 포인트
$amount['입금'] = $od['od_receipt_bank'] + $od['od_receipt_card'] + $od['od_receipt_hp'] + $od['od_receipt_point']; $amount['입금'] = $od['od_receipt_bank'] + $od['od_receipt_card'] + $od['od_receipt_hp'] + $od['od_receipt_point'];
// 미수금 = (주문금액 - DC + 환불액) - (입금액 - 신용카드승인취소) // 쿠폰금액
$amount['미수'] = ($amount['정상'] - $od['od_dc_amount'] + $od['od_refund_amount']) - ($amount['입금'] - $od['od_cancel_card']); $amount['쿠폰'] = $t_cp_amount + $od['od_coupon'];
// 미수금 = (주문금액 - DC + 환불액) - (입금액 - 신용카드승인취소) - 쿠폰금액
$amount['미수'] = ($amount['정상'] - $od['od_dc_amount'] + $od['od_refund_amount']) - ($amount['입금'] - $od['od_cancel_card']) - $amount['쿠폰'];
// 결제방법 // 결제방법
$s_receipt_way = $od['od_settle_case']; $s_receipt_way = $od['od_settle_case'];
@ -267,6 +272,7 @@ $pg_anchor = '<ul class="anchor">
<th scope="col">주문총액</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>
<th scope="col">DC</th> <th scope="col">DC</th>
<th scope="col">환불액</th> <th scope="col">환불액</th>
<th scope="col">주문취소</th> <th scope="col">주문취소</th>
@ -279,6 +285,7 @@ $pg_anchor = '<ul class="anchor">
<td class="td_bignum"><?php echo display_price($amount['정상']); ?></td> <td class="td_bignum"><?php echo display_price($amount['정상']); ?></td>
<td class="td_bignum"><?php echo display_point($od['od_receipt_point']); ?></td> <td class="td_bignum"><?php echo display_point($od['od_receipt_point']); ?></td>
<td class="td_bignum"><?php echo number_format($amount['입금']); ?>원</td> <td class="td_bignum"><?php echo number_format($amount['입금']); ?>원</td>
<td class="td_bignum"><?php echo display_price($amount['쿠폰']); ?></td>
<td class="td_bignum"><?php echo display_price($od['od_dc_amount']); ?></td> <td class="td_bignum"><?php echo display_price($od['od_dc_amount']); ?></td>
<td class="td_bignum"><?php echo display_price($od['od_refund_amount']); ?></td> <td class="td_bignum"><?php echo display_price($od['od_refund_amount']); ?></td>
<td class="td_bignum"><?php echo number_format($t_ct_amount['취소']); ?>원</td> <td class="td_bignum"><?php echo number_format($t_ct_amount['취소']); ?>원</td>

View File

@ -122,7 +122,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
if ($row['od_settle_case']) if ($row['od_settle_case'])
{ {
$s_receipt_way = $row['od_settle_case']; $s_receipt_way = $row['od_settle_case'];
$s_br = '<br/>'; $s_br = '+';
} }
else else
{ {
@ -130,7 +130,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
{ {
//$s_receipt_way = "무통장입금"; //$s_receipt_way = "무통장입금";
$s_receipt_way = cut_str($row['od_bank_account'],8,""); $s_receipt_way = cut_str($row['od_bank_account'],8,"");
$s_br = "<br>"; $s_br = "+";
} }
if ($row['od_temp_card'] > 0 || $row['od_receipt_card'] > 0) if ($row['od_temp_card'] > 0 || $row['od_receipt_card'] > 0)
@ -161,6 +161,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
$tot_dc_amount += $row['od_dc_amount']; $tot_dc_amount += $row['od_dc_amount'];
$tot_receiptamount += $row['receiptamount']; $tot_receiptamount += $row['receiptamount'];
$tot_receiptcancel += $row['receiptcancel']; $tot_receiptcancel += $row['receiptcancel'];
$tot_couponamount += $row['couponamount'];
$tot_misu += $row['misu']; $tot_misu += $row['misu'];
?> ?>
<li> <li>
@ -200,6 +201,8 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<dd class="sodr_pay_1"><?php echo number_format($row['od_dc_amount']); ?></dd> <dd class="sodr_pay_1"><?php echo number_format($row['od_dc_amount']); ?></dd>
<dt class="sodr_pay_1">입금합계</dt> <dt class="sodr_pay_1">입금합계</dt>
<dd class="sodr_pay_1"><?php echo number_format($row['receiptamount']); ?></dd> <dd class="sodr_pay_1"><?php echo number_format($row['receiptamount']); ?></dd>
<dt>쿠폰사용</dt>
<dd><?php echo number_format($row['couponamount']); ?></dd>
<dt>주문취소</dt> <dt>주문취소</dt>
<dd><?php echo number_format($row['ordercancel']); ?></dd> <dd><?php echo number_format($row['ordercancel']); ?></dd>
<dt>입금취소</dt> <dt>입금취소</dt>
@ -300,6 +303,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<tr> <tr>
<th scope="col">주문건수</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>
<th scope="col">DC</th> <th scope="col">DC</th>
<th scope="col">입금완료</th> <th scope="col">입금완료</th>
@ -311,6 +315,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<tr> <tr>
<td><?php echo (int)$tot_itemcount; ?>건</td> <td><?php echo (int)$tot_itemcount; ?>건</td>
<td><?php echo number_format($tot_orderamount); ?></td> <td><?php echo number_format($tot_orderamount); ?></td>
<td><?php echo number_format($tot_couponamount); ?></td>
<td><?php echo number_format($tot_ordercancel); ?></td> <td><?php echo number_format($tot_ordercancel); ?></td>
<td><?php echo number_format($tot_dc_amount); ?></td> <td><?php echo number_format($tot_dc_amount); ?></td>
<td><?php echo number_format($tot_receiptamount); ?></td> <td><?php echo number_format($tot_receiptamount); ?></td>

View File

@ -1,8 +1,6 @@
<?php <?php
include_once('./_common.php'); include_once('./_common.php');
header("Content-Type: text/html; charset=utf-8");
$subject = strtolower($_POST['subject']); $subject = strtolower($_POST['subject']);
$content = strtolower(strip_tags($_POST['content'])); $content = strtolower(strip_tags($_POST['content']));

View File

@ -28,10 +28,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<div style="float:left;<?php echo $lt_style ?>"> <div style="float:left;<?php echo $lt_style ?>">
<?php <?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다. // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다. // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest('basic', $row['bo_table'], 5, 70); echo latest('basic', $row['bo_table'], 5, 70);
?> ?>
</div> </div>

View File

@ -43,7 +43,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
?> ?>
<div id="copymove" class="new_win"> <div id="copymove" class="new_win">
<h1><?php echo $g4['title'] ?></h1> <h1 id="new_win_title"><?php echo $g4['title'] ?></h1>
<form name="fboardmoveall" method="post" action="./move_update.php" onsubmit="return fboardmoveall_submit(this);"> <form name="fboardmoveall" method="post" action="./move_update.php" onsubmit="return fboardmoveall_submit(this);">
<input type="hidden" name="sw" value="<?php echo $sw ?>"> <input type="hidden" name="sw" value="<?php echo $sw ?>">

View File

@ -38,7 +38,7 @@ for($i=0; $row=sql_fetch_array($result); $i++) {
?> ?>
<div id="point" class="new_win"> <div id="point" class="new_win">
<h1><?php echo $g4['title'] ?></h1> <h1 id="new_win_title"><?php echo $g4['title'] ?></h1>
<table class="basic_tbl"> <table class="basic_tbl">
<caption>포인트 사용내역 목록</caption> <caption>포인트 사용내역 목록</caption>

View File

@ -182,8 +182,6 @@ if ($w == '') {
set mb_id = '{$mb_id}', set mb_id = '{$mb_id}',
mb_password = '".sql_password($mb_password)."', mb_password = '".sql_password($mb_password)."',
mb_name = '{$mb_name}', mb_name = '{$mb_name}',
mb_sex = '{$mb_sex}',
mb_birth = '{$mb_birth}',
mb_nick = '{$mb_nick}', mb_nick = '{$mb_nick}',
mb_nick_date = '".G4_TIME_YMD."', mb_nick_date = '".G4_TIME_YMD."',
mb_email = '{$mb_email}', mb_email = '{$mb_email}',
@ -286,10 +284,6 @@ if ($w == '') {
if ($mb_open_default != $mb_open) if ($mb_open_default != $mb_open)
$sql_open_date = " , mb_open_date = '".G4_TIME_YMD."' "; $sql_open_date = " , mb_open_date = '".G4_TIME_YMD."' ";
$sql_sex = "";
if (isset($mb_sex))
$sql_sex = " , mb_sex = '{$mb_sex}' ";
// 이전 메일주소와 수정한 메일주소가 틀리다면 인증을 다시 해야하므로 값을 삭제 // 이전 메일주소와 수정한 메일주소가 틀리다면 인증을 다시 해야하므로 값을 삭제
$sql_email_certify = ''; $sql_email_certify = '';
if ($old_email != $mb_email && $config['cf_use_email_certify']) if ($old_email != $mb_email && $config['cf_use_email_certify'])
@ -323,7 +317,6 @@ if ($w == '') {
{$sql_icon} {$sql_icon}
{$sql_nick_date} {$sql_nick_date}
{$sql_open_date} {$sql_open_date}
{$sql_sex}
{$sql_email_certify} {$sql_email_certify}
{$sql_hp_certify} {$sql_hp_certify}
where mb_id = '$mb_id' "; where mb_id = '$mb_id' ";

View File

@ -214,7 +214,7 @@ if ($stx) {
$write_pages = get_paging(G4_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$search_query.'&amp;gr_id='.$gr_id.'&amp;srows='.$srows.'&amp;onetable='.$onetable.'&amp;page='); $write_pages = get_paging(G4_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$search_query.'&amp;gr_id='.$gr_id.'&amp;srows='.$srows.'&amp;onetable='.$onetable.'&amp;page=');
} }
$group_select = '<select id="gr_id" name="gr_id" class="select" title="그룹선택"><option value="">전체 분류'; $group_select = '<label for="gr_id" class="sound_only">게시판 그룹선택</label><select name="gr_id" id="gr_id" class="select"><option value="">전체 분류';
$sql = " select gr_id, gr_subject from {$g4['group_table']} order by gr_id "; $sql = " select gr_id, gr_subject from {$g4['group_table']} order by gr_id ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i=0; $row=sql_fetch_array($result); $i++)

View File

@ -22,8 +22,16 @@ if (!($w == '' || $w == 'u' || $w == 'r')) {
alert('w 값이 제대로 넘어오지 않았습니다.'); alert('w 값이 제대로 넘어오지 않았습니다.');
} }
if (($w == 'u' || $w == 'r') && !$write['wr_id']) { if ($w == 'u' || $w == 'r') {
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G4_URL); if ($write['wr_id']) {
// 가변 변수로 $wr_1 .. $wr_10 까지 만든다.
for ($i=1; $i<=10; $i++) {
$vvar = "wr_".$i;
$$vvar = $write['wr_'.$i];
}
} else {
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G4_URL);
}
} }
if ($w == '') { if ($w == '') {

View File

@ -134,6 +134,8 @@ if ($w == 'c') // 댓글 입력
$tmp_comment_reply = ''; $tmp_comment_reply = '';
} }
$wr_subject = get_text(stripslashes($wr['wr_subject']));
// SNS 등록 // SNS 등록
include_once("./write_comment_update.sns.php"); include_once("./write_comment_update.sns.php");
@ -185,9 +187,6 @@ if ($w == 'c') // 댓글 입력
// 포인트 부여 // 포인트 부여
insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 댓글쓰기", $bo_table, $comment_id, '댓글'); insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 댓글쓰기", $bo_table, $comment_id, '댓글');
$wr_subject = get_text(stripslashes($wr['wr_subject']));
// 메일발송 사용 // 메일발송 사용
if ($config['cf_email_use'] && $board['bo_use_email']) if ($config['cf_email_use'] && $board['bo_use_email'])
{ {

View File

@ -545,36 +545,36 @@ input.required:focus {border:1px solid #b8c9c2;background:#21272e !important;col
#sit_inf_open th {padding:7px 10px;border:1px solid #fff;background:#f5f6fa;vertical-align:top;text-align:left} #sit_inf_open th {padding:7px 10px;border:1px solid #fff;background:#f5f6fa;vertical-align:top;text-align:left}
#sit_inf_open td {padding:7px 10px;border:1px solid #fff;background:#f5f6fa;vertical-align:top} #sit_inf_open td {padding:7px 10px;border:1px solid #fff;background:#f5f6fa;vertical-align:top}
/* 상품 상세보기 - 용후기 */ /* 상품 상세보기 - 용후기 */
#sit_ps {margin:0 0 10px;padding:10px 10px 20px;border-bottom:1px solid #e9e9e9} #sit_use {margin:0 0 10px;padding:10px 10px 20px;border-bottom:1px solid #e9e9e9}
#sit_ps h2 {margin:0 0 10px} #sit_use h2 {margin:0 0 10px}
/* 상품 상세보기 - 상품문의 */ /* 상품 상세보기 - 상품문의 */
#sit_qna {margin:0 0 10px;padding:10px 10px 20px;border-bottom:1px solid #e9e9e9} #sit_qa {margin:0 0 10px;padding:10px 10px 20px;border-bottom:1px solid #e9e9e9}
#sit_qna h2 {margin:0 0 10px} #sit_qa h2 {margin:0 0 10px}
#sit_qna h3 {margin:0 0 10px} #sit_qa h3 {margin:0 0 10px}
#sit_qna_ol {margin:0 0 5px;padding:0;border-top:1px solid #e9e9e9;list-style:none} #sit_qa_ol {margin:0 0 5px;padding:0;border-top:1px solid #e9e9e9;list-style:none}
.sit_qna_li {position:relative;padding:0 0 10px;border-bottom:1px solid #e9e9e9;background:#f5f6fa} .sit_qa_li {position:relative;padding:0 0 10px;border-bottom:1px solid #e9e9e9;background:#f5f6fa}
.sit_qna_li_title {display:block;margin:0;padding:10px;width:100%;border:0;background:transparent;text-align:left;cursor:pointer} .sit_qa_li_title {display:block;margin:0;padding:10px;width:100%;border:0;background:transparent;text-align:left;cursor:pointer}
.sit_qna_dl {margin:0;padding:0 10px;zoom:1} .sit_qa_dl {margin:0;padding:0 10px;zoom:1}
.sit_qna_dl:after {display:block;visibility:hidden;clear:both;content:""} .sit_qa_dl:after {display:block;visibility:hidden;clear:both;content:""}
.sit_qna_dl dt {float:left} .sit_qa_dl dt {float:left}
.sit_qna_dl dd {float:left;margin:0 20px 0 5px} .sit_qa_dl dd {float:left;margin:0 20px 0 5px}
.sit_qna_con {display:none;padding:10px 10px 0} .sit_qa_con {display:none;padding:10px 10px 0}
.sit_qna_con p {padding:0} .sit_qa_con p {padding:0}
.sit_qna_qaq {margin:0 0 5px} .sit_qa_qaq {margin:0 0 5px}
.sit_qna_con textarea {display:none} .sit_qa_con textarea {display:none}
.sit_qna_cmd {text-align:right} .sit_qa_cmd {text-align:right}
.sit_qna_pw {display:none;position:absolute;top:30px;left:175px;padding:10px;width:348px;border:1px solid #000;background:#fff;text-align:center} .sit_qa_pw {display:none;position:absolute;top:30px;left:175px;padding:10px;width:348px;border:1px solid #000;background:#fff;text-align:center}
.sit_qna_pw span {display:block;margin:0 0 5px} .sit_qa_pw span {display:block;margin:0 0 5px}
#sit_qna_wbtn {margin:0 0 5px;text-align:right} #sit_qa_wbtn {margin:0 0 5px;text-align:right}
#sit_qna_w {display:none} #sit_qa_w {display:none}
/* 상품 상세보기 - 배송정보 */ /* 상품 상세보기 - 배송정보 */
#sit_dvr {margin:0 0 10px;padding:10px 10px 20px;border-bottom:1px solid #e9e9e9} #sit_dvr {margin:0 0 10px;padding:10px 10px 20px;border-bottom:1px solid #e9e9e9}

View File

@ -132,7 +132,7 @@ a:active {color:#000;text-decoration:underline}
.basic_tbl thead th input {vertical-align:top} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */ .basic_tbl thead th input {vertical-align:top} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */
.basic_tbl tfoot th {border-top:1px solid #666;border-bottom:1px solid #666;background:#484848;color:#fff} .basic_tbl tfoot th {border-top:1px solid #666;border-bottom:1px solid #666;background:#484848;color:#fff}
.basic_tbl tfoot td {border-color:#666;background:#484848;color:#fff;font-weight:bold;text-align:center} .basic_tbl tfoot td {border-color:#666;background:#484848;color:#fff;font-weight:bold;text-align:center}
.basic_tbl td {padding:0.5em 0;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;line-height:1.5em;word-break:break-all} .basic_tbl td {padding:0.5em;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;line-height:1.5em;word-break:break-all}
.basic_tbl a {display:block;padding:0.5em;color:#000;text-decoration:none} .basic_tbl a {display:block;padding:0.5em;color:#000;text-decoration:none}
.bo_sideview td {} /* 사이드뷰 사용하는 테이블 셀 패딩값 */ .bo_sideview td {} /* 사이드뷰 사용하는 테이블 셀 패딩값 */
td.empty_table {padding:5em 0;text-align:center} td.empty_table {padding:5em 0;text-align:center}
@ -166,7 +166,7 @@ td.empty_table {padding:5em 0;text-align:center}
.td_nick {width:100px;text-align:center} .td_nick {width:100px;text-align:center}
.td_name {width:100px;text-align:left} .td_name {width:100px;text-align:left}
.td_date {width:60px;text-align:center} .td_date {width:60px;text-align:center}
.td_datetime {width:130px;text-align:center} .td_datetime {width:150px;text-align:center}
.td_mng {width:80px;text-align:center} .td_mng {width:80px;text-align:center}
/* 광고 레이아웃 */ /* 광고 레이아웃 */

View File

@ -218,35 +218,35 @@ a.sanchor_on {background:#626870;color:#fff !important;text-decoration:none}
#sit_inf_open td {padding:0.5em 1em;border:1px solid #fff;background:#f5f6fa} #sit_inf_open td {padding:0.5em 1em;border:1px solid #fff;background:#f5f6fa}
/* 상품 상세보기 - 사용후기 */ /* 상품 상세보기 - 사용후기 */
#sit_ps {margin:0 0 1em;padding:1em 1em 2em;border-bottom:1px solid #e9e9e9} #sit_use {margin:0 0 1em;padding:1em 1em 2em;border-bottom:1px solid #e9e9e9}
#sit_ps h2 {margin:0 0 1em} #sit_use h2 {margin:0 0 1em}
/* 상품 상세보기 - 상품문의 */ /* 상품 상세보기 - 상품문의 */
#sit_qna {margin:0 0 1em;padding:1em 1em 2em;border-bottom:1px solid #e9e9e9} #sit_qa {margin:0 0 1em;padding:1em 1em 2em;border-bottom:1px solid #e9e9e9}
#sit_qna h2 {margin:0 0 1em} #sit_qa h2 {margin:0 0 1em}
#sit_qna h3 {margin:0 0 1em} #sit_qa h3 {margin:0 0 1em}
#sit_qna_ol {margin:0 0 0.5em;padding:0;border-top:1px solid #e9e9e9;list-style:none} #sit_qa_ol {margin:0 0 0.5em;padding:0;border-top:1px solid #e9e9e9;list-style:none}
.sit_qna_li {position:relative;padding:0 0 1em;border-bottom:1px solid #e9e9e9;background:#f5f6fa} .sit_qa_li {position:relative;padding:0 0 1em;border-bottom:1px solid #e9e9e9;background:#f5f6fa}
.sit_qna_li_title {display:block;margin:0;padding:1em;width:100%;border:0;background:transparent;text-align:left;cursor:pointer} .sit_qa_li_title {display:block;margin:0;padding:1em;width:100%;border:0;background:transparent;text-align:left;cursor:pointer}
.sit_qna_dl {margin:0;padding:0 1em;zoom:1} .sit_qa_dl {margin:0;padding:0 1em;zoom:1}
.sit_qna_dl:after {display:block;visibility:hidden;clear:both;content:""} .sit_qa_dl:after {display:block;visibility:hidden;clear:both;content:""}
.sit_qna_dl dt {float:left} .sit_qa_dl dt {float:left}
.sit_qna_dl dd {float:left;margin:0 1.8em 0 0.3em} .sit_qa_dl dd {float:left;margin:0 1.8em 0 0.3em}
.sit_qna_con {display:none;padding:1em 1em 0} .sit_qa_con {display:none;padding:1em 1em 0}
.sit_qna_con p {padding:0} .sit_qa_con p {padding:0}
.sit_qna_qaq {margin:0 0 0.3em} .sit_qa_qaq {margin:0 0 0.3em}
.sit_qna_con textarea {display:none} .sit_qa_con textarea {display:none}
.sit_qna_cmd {text-align:right} .sit_qa_cmd {text-align:right}
.sit_qna_pw {display:none;position:absolute;top:30px;left:175px;padding:1em;width:348px;border:1px solid #000;background:#fff;text-align:center} .sit_qa_pw {display:none;position:absolute;top:30px;left:175px;padding:1em;width:348px;border:1px solid #000;background:#fff;text-align:center}
.sit_qna_pw span {display:block;margin:0 0 0.3em} .sit_qa_pw span {display:block;margin:0 0 0.3em}
#sit_qna_wbtn {margin:0 0 0.3em;text-align:right} #sit_qa_wbtn {margin:0 0 0.3em;text-align:right}
#sit_qna_w {display:none} #sit_qa_w {display:none}
/* 상품 상세보기 - 배송정보 */ /* 상품 상세보기 - 배송정보 */
#sit_dvr {margin:0 0 1em;padding:1em 1em 2em;border-bottom:1px solid #e9e9e9} #sit_dvr {margin:0 0 1em;padding:1em 1em 2em;border-bottom:1px solid #e9e9e9}

View File

@ -33,6 +33,7 @@ define(_MISU_QUERY_, "
count(distinct a.od_id) as ordercount, /* 주문서건수 */ count(distinct a.od_id) as ordercount, /* 주문서건수 */
count(b.ct_id) as itemcount, /* 상품건수 */ count(b.ct_id) as itemcount, /* 상품건수 */
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost) as orderamount, /* 주문합계 */ (SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost) as orderamount, /* 주문합계 */
(SUM(b.cp_amount) + a.od_coupon) as couponamount, /* 쿠폰합계*/
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) as ordercancel, /* 주문취소 */ (SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) as ordercancel, /* 주문취소 */
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) as receiptamount, /* 입금합계 */ (a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) as receiptamount, /* 입금합계 */
(a.od_refund_amount + a.od_cancel_card) as receiptcancel, /* 입금취소 */ (a.od_refund_amount + a.od_cancel_card) as receiptcancel, /* 입금취소 */
@ -41,8 +42,9 @@ define(_MISU_QUERY_, "
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) - (SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) -
a.od_dc_amount - a.od_dc_amount -
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) + (a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) +
(a.od_refund_amount + a.od_cancel_card) (a.od_refund_amount + a.od_cancel_card) -
) as misu /* 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소 */"); (SUM(b.cp_amount) + a.od_coupon)
) as misu /* 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소 - 쿠폰합계 */");
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// 쇼핑몰 상수 모음 끝 // 쇼핑몰 상수 모음 끝
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -254,4 +254,24 @@ if(!$result) {
KEY `mb_id` (`mb_id`) KEY `mb_id` (`mb_id`)
)", false); )", false);
} }
// 쿠폰관련필드 추가
$sql = " select cp_amount from {$g4['shop_cart_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
ADD `cp_amount` INT(11) NOT NULL DEFAULT '0' AFTER `ct_point` ", false);
sql_query(" ALTER TABLE `{$g4['shop_order_table']}`
ADD `od_coupon` INT(11) NOT NULL DEFAULT '0' AFTER `od_dc_amount`,
ADD `od_send_coupon` INT(11) NOT NULL DEFAULT '0' AFTER `od_send_cost` ", false);
}
// 쿠폰사용정보필드추가
$sql = " select od_id from {$g4['shop_coupon_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_coupon_table']}`
ADD `od_id` BIGINT(20) UNSIGNED NOT NULL AFTER `cp_maximum`,
ADD `cp_used_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `cp_used` ", false);
}
?> ?>

View File

@ -78,7 +78,7 @@ if ($is_admin) {
if(G4_IS_MOBILE) { if(G4_IS_MOBILE) {
echo '<script> set_cookie("device_width", screen.width, 6, g4_cookie_domain); </script>'.PHP_EOL; echo '<script> set_cookie("device_width", screen.width, 6, g4_cookie_domain); </script>'.PHP_EOL;
} }
if(!defined('G4_IS_ADMIN')) //if(!defined('G4_IS_ADMIN'))
echo $config['cf_add_script']; echo $config['cf_add_script'];
?> ?>
</head> </head>

View File

@ -31,10 +31,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<div style="float:left;<?php echo $lt_style ?>"> <div style="float:left;<?php echo $lt_style ?>">
<?php <?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다. // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다. // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("basic", $row['bo_table'], 5, 25); echo latest("basic", $row['bo_table'], 5, 25);
?> ?>
</div> </div>

View File

@ -63,6 +63,7 @@ CREATE TABLE IF NOT EXISTS `shop_cart` (
`ct_history` text NOT NULL, `ct_history` text NOT NULL,
`ct_price` int(11) NOT NULL DEFAULT '0', `ct_price` int(11) NOT NULL DEFAULT '0',
`ct_point` int(11) NOT NULL DEFAULT '0', `ct_point` int(11) NOT NULL DEFAULT '0',
`cp_amount` int(11) NOT NULL DEFAULT '0',
`ct_point_use` tinyint(4) NOT NULL DEFAULT '0', `ct_point_use` tinyint(4) NOT NULL DEFAULT '0',
`ct_stock_use` tinyint(4) NOT NULL DEFAULT '0', `ct_stock_use` tinyint(4) NOT NULL DEFAULT '0',
`ct_option` varchar(255) NOT NULL DEFAULT '', `ct_option` varchar(255) NOT NULL DEFAULT '',
@ -152,7 +153,9 @@ CREATE TABLE IF NOT EXISTS `shop_coupon` (
`cp_trunc` INT(11) NOT NULL DEFAULT '0', `cp_trunc` INT(11) NOT NULL DEFAULT '0',
`cp_minimum` INT(11) NOT NULL DEFAULT '0', `cp_minimum` INT(11) NOT NULL DEFAULT '0',
`cp_maximum` INT(11) NOT NULL DEFAULT '0', `cp_maximum` INT(11) NOT NULL DEFAULT '0',
`od_id` bigint(20) unsigned NOT NULL,
`cp_used` TINYINT(4) NOT NULL DEFAULT '0', `cp_used` TINYINT(4) NOT NULL DEFAULT '0',
`cp_used_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`cp_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `cp_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`cp_no`), PRIMARY KEY (`cp_no`),
UNIQUE KEY `cp_id` (`cp_id`), UNIQUE KEY `cp_id` (`cp_id`),
@ -588,6 +591,7 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
`od_b_addr2` varchar(100) NOT NULL DEFAULT '', `od_b_addr2` varchar(100) NOT NULL DEFAULT '',
`od_memo` text NOT NULL, `od_memo` text NOT NULL,
`od_send_cost` int(11) NOT NULL DEFAULT '0', `od_send_cost` int(11) NOT NULL DEFAULT '0',
`od_send_coupon` int(11) NOT NULL DEFAULT '0',
`od_temp_bank` int(11) NOT NULL DEFAULT '0', `od_temp_bank` int(11) NOT NULL DEFAULT '0',
`od_temp_card` int(11) NOT NULL DEFAULT '0', `od_temp_card` int(11) NOT NULL DEFAULT '0',
`od_temp_hp` int(11) NOT NULL, `od_temp_hp` int(11) NOT NULL,
@ -602,6 +606,7 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
`od_hp_time` datetime NOT NULL, `od_hp_time` datetime NOT NULL,
`od_cancel_card` int(11) NOT NULL DEFAULT '0', `od_cancel_card` int(11) NOT NULL DEFAULT '0',
`od_dc_amount` int(11) NOT NULL DEFAULT '0', `od_dc_amount` int(11) NOT NULL DEFAULT '0',
`od_coupon` int(11) NOT NULL DEFAULT '0',
`od_refund_amount` int(11) NOT NULL DEFAULT '0', `od_refund_amount` int(11) NOT NULL DEFAULT '0',
`od_shop_memo` text NOT NULL, `od_shop_memo` text NOT NULL,
`dl_id` int(11) NOT NULL DEFAULT '0', `dl_id` int(11) NOT NULL DEFAULT '0',

View File

@ -1139,6 +1139,42 @@ function get_coupon_id()
return $str; return $str;
} }
// array_map() 대체
function array_add_callback($func, $array)
{
if(!$func) {
return;
}
if(is_array($array)) {
foreach($array as $key => $value) {
if(is_array($value)) {
$array[$key] = array_add_callback($func, $value);
} else {
$array[$key] = call_user_func($func, $value);
}
}
} else {
$array = call_user_func($func, $array);
}
return $array;
}
// 상품포인트
function get_item_point($it)
{
$it_point = 0;
if($it['it_point_type']) {
$it_point = floor(($it['it_price'] * ($it['it_point'] / 100) / 10)) * 10;
} else {
$it_point = $it['it_point'];
}
return $it_point;
}
//============================================================================== //==============================================================================
// 쇼핑몰 함수 모음 끝 // 쇼핑몰 함수 모음 끝
//============================================================================== //==============================================================================

View File

@ -3,18 +3,257 @@ include_once('./_common.php');
$g4['title'] = '장바구니'; $g4['title'] = '장바구니';
include_once(G4_MSHOP_PATH.'/_head.php'); include_once(G4_MSHOP_PATH.'/_head.php');
$s_uq_id = get_session('ss_uq_id');
?> ?>
<script src="<?php echo G4_JS_URL; ?>/shop.js"></script>
<div id="sod_bsk"> <div id="sod_bsk">
<form name="frmcartlist" id="sod_bsk_list" method="post">
<table class="basic_tbl">
<thead>
<tr>
<th scope="col">상품이미지</th>
<th scope="col">상품명</th>
<th scope="col">총수량</th>
<th scope="col">판매가</th>
<th scope="col">소계</th>
<th scope="col">포인트</th>
<th scope="col"><input type="checkbox" name="ct_all" value="1"></th>
</tr>
</thead>
<tbody>
<?php <?php
$s_page = 'cart.php'; $tot_point = 0;
$s_uq_id = get_session('ss_uq_id'); $tot_sell_amount = 0;
include G4_MSHOP_PATH.'/cartsub.inc.php';
// $s_uq_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
b.ca_id
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and a.ct_time > '$ctime' ";
}
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$good_info = '';
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_point * ct_qty) as point,
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
$sum = sql_fetch($sql);
if ($i==0) { // 계속쇼핑
$continue_ca_id = $row['ca_id'];
}
$a1 = '<a href="./item.php?it_id='.$row['it_id'].'"><b>';
$a2 = '</b></a>';
$image = get_it_image($row['it_id'], 70, 70);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_uq_id);
if($it_options) {
$mod_options = '<div class="sod_option_btn"><button type="button" class="mod_options">선택사항수정</button></div>';
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';
}
$point = $sum['point'];
$sell_amount = $sum['price'];
?> ?>
<tr>
<td class="sod_bsk_img"><?php echo $image; ?></td>
<td>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<?php echo $it_name.$mod_options; ?>
</td>
<td class="td_num"><?php echo number_format($sum['qty']); ?></td>
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
<td class="td_bignum"><?php echo number_format($sell_amount); ?></td>
<td class="td_num"><?php echo number_format($sum['point']); ?></td>
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1"></td>
</tr>
<?php
$tot_point += $point;
$tot_sell_amount += $sell_amount;
} // for 끝
if ($i == 0) {
echo '<tr><td colspan="7" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
} else {
// 배송비 계산
if ($default['de_send_cost_case'] == '없음')
$send_cost = 0;
else {
// 배송비 상한 : 여러단계의 배송비 적용 가능
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
$send_cost_list = explode(";", $default['de_send_cost_list']);
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < $send_cost_limit[$k]) {
$send_cost = $send_cost_list[$k];
break;
}
}
}
}
?>
</tbody>
</table>
<?php
// 배송비가 0 보다 크다면 (있다면)
if ($send_cost > 0)
{
?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span>
<strong><?php echo number_format($send_cost); ?> 원</strong>
</div>
<?php } ?>
<?php
// 총계 = 주문상품금액합계 + 배송비
$tot_amount = $tot_sell_amount + $send_cost;
if ($tot_amount > 0) {
?>
<div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>총계</span>
<strong><?php echo number_format($tot_amount); ?> 원 <?php echo number_format($tot_point); ?> 점</strong>
</div>
<?php } ?>
<div id="sod_bsk_act">
<?php if ($i == 0) { ?>
<a href="<?php echo G4_SHOP_URL; ?>/" class="btn01">쇼핑 계속하기</a>
<?php } else { ?>
<input type="hidden" name="url" value="<?php echo G4_SHOP_URL; ?>/orderform.php">
<input type="hidden" name="act" value="">
<input type="hidden" name="records" value="<?php echo $i; ?>">
<p>장바구니의 상품을 주문하시려면 <strong>주문하기</strong>를 클릭하세요. <strong>비우기</strong>는 장바구니의 상품을 모두 비웁니다.</p>
<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('seldelete');" class="btn01">선택삭제</a>
<a href="javascript:form_check('alldelete');" class="btn01">비우기</a>
<?php } ?>
</div>
</form>
</div> </div>
<script>
$(function() {
var close_btn_idx;
// 선택사항수정
$(".mod_options").click(function() {
var it_id = $(this).closest("tr").find("input[name^=it_id]").val();
var $this = $(this);
close_btn_idx = $(".mod_options").index($(this));
winMask(); // 모달 윈도우 배경 출력
$.post(
"./cartoption.php",
{ it_id: it_id },
function(data) {
$("#mod_option_frm").remove();
$this.after("<div id=\"mod_option_frm\"></div>");
$("#mod_option_frm").html(data);
price_calculate();
}
);
});
// 모두선택
$("input[name=ct_all]").click(function() {
if($(this).is(":checked"))
$("input[name^=ct_chk]").attr("checked", true);
else
$("input[name^=ct_chk]").attr("checked", false);
});
// 옵션수정 닫기
$("#mod_option_close").live("click", function() {
$("#mod_option_frm").remove();
$("#win_mask, .window").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
$("#win_mask").click(function () {
$("#mod_option_frm").remove();
$("#win_mask").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
});
function form_check(act) {
var f = document.frmcartlist;
var cnt = f.records.value;
if (act == "buy")
{
f.act.value = act;
<?php
if (get_session('ss_mb_id')) // 회원인 경우
{
echo "f.action = './orderform.php';";
echo "f.submit();";
}
else
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 = "./cartupdate.php";
f.submit();
}
else if (act == "seldelete")
{
if($("input[name^=ct_chk]:checked").size() < 1) {
alert("삭제하실 상품을 하나이상 선택해 주십시오.");
return false;
}
f.act.value = act;
f.action = "./cartupdate.php";
f.submit();
}
return true;
}
</script>
<?php <?php
include_once(G4_MSHOP_PATH.'/_tail.php'); include_once(G4_MSHOP_PATH.'/_tail.php');
?> ?>

View File

@ -145,8 +145,8 @@ function pg_anchor_m($anc_id) {
?> ?>
<ul class="sanchor"> <ul class="sanchor">
<li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li> <li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li>
<li><a href="#sit_ps" <?php if ($anc_id == 'ps') echo 'class="sanchor_on"'; ?>>사용후기 <span class="item_use_count"></span></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_qna" <?php if ($anc_id == 'qna') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_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>
<?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_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 } ?> <?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"></span></a></li>
@ -334,12 +334,7 @@ else
<th scope="row"><label for="disp_point">포인트</label></th> <th scope="row"><label for="disp_point">포인트</label></th>
<td> <td>
<?php <?php
if($it['it_point_type']) { $it_point = get_item_point($it);
$it_point = floor(($it['it_price'] * ($it['it_point'] / 100) / 10)) * 10;
} else {
$it_point = $it['it_point'];
}
echo number_format($it_point); echo number_format($it_point);
?> 점 ?> 점
<input type="hidden" name="it_point" value="<?php echo $it_point; ?>"> <input type="hidden" name="it_point" value="<?php echo $it_point; ?>">
@ -554,9 +549,9 @@ else
</section> </section>
<!-- 상품설명 end --> <!-- 상품설명 end -->
<section id="sit_ps"> <section id="sit_use">
<h2>사용후기</h2> <h2>사용후기</h2>
<?php echo pg_anchor_m('ps'); ?> <?php echo pg_anchor_m('use'); ?>
<?php <?php
$use_page_rows = 10; // 페이지당 목록수 $use_page_rows = 10; // 페이지당 목록수
@ -564,9 +559,9 @@ else
?> ?>
</section> </section>
<section id="sit_qna"> <section id="sit_qa">
<h2>상품문의</h2> <h2>상품문의</h2>
<?php echo pg_anchor_m('qna'); ?> <?php echo pg_anchor_m('qa'); ?>
<?php <?php
$qa_page_rows = 10; // 페이지당 목록수 $qa_page_rows = 10; // 페이지당 목록수

View File

@ -2,7 +2,7 @@
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?> ?>
<section id="sit_qna_list"> <section id="sit_qa_list">
<h3>등록된 상품문의</h3> <h3>등록된 상품문의</h3>
<?php <?php
@ -51,12 +51,12 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$iq_flag = 1; $iq_flag = 1;
} }
if ($i == 0) echo '<ol id="sit_qna_ol">'; if ($i == 0) echo '<ol id="sit_qa_ol">';
?> ?>
<li class="sit_qna_li"> <li class="sit_qa_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> <button type="button" class="sit_qa_li_title" onclick="javascript:qa_menu('sit_qa_con_<?php echo $i; ?>')"><b><?php echo $num; ?>.</b> <?php echo $iq_subject; ?></button>
<dl class="sit_qna_dl"> <dl class="sit_qa_dl">
<dt>작성자</dt> <dt>작성자</dt>
<dd><?php echo $iq_name; ?></dd> <dd><?php echo $iq_name; ?></dd>
<dt>작성일</dt> <dt>작성일</dt>
@ -65,12 +65,12 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<dd><?php echo $iq_stats; ?></dd> <dd><?php echo $iq_stats; ?></dd>
</dl> </dl>
<div id="sit_qna_con_<?php echo $i; ?>" class="sit_qna_con"> <div id="sit_qa_con_<?php echo $i; ?>" class="sit_qa_con">
<p class="sit_qna_qaq"> <p class="sit_qa_qaq">
<strong>문의내용</strong><br> <strong>문의내용</strong><br>
<?php echo $iq_question; // 상품 문의 내용 ?> <?php echo $iq_question; // 상품 문의 내용 ?>
</p> </p>
<p class="sit_qna_qaa"> <p class="sit_qa_qaa">
<strong>답변</strong><br> <strong>답변</strong><br>
<?php echo $iq_answer; ?> <?php echo $iq_answer; ?>
</p> </p>
@ -81,14 +81,14 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<textarea id="tmp_iq_question<?php echo $i; ?>"><?php echo $row['iq_question']; ?></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) { ?> <?php if ($row['mb_id'] == $member['mb_id'] && $iq_answer == 0) { ?>
<div class="sit_qna_cmd"> <div class="sit_qa_cmd">
<button type="button" onclick="javascript:itemqa_update(<?php echo $i; ?>);" class="btn01">수정</button> <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> <button type="button" onclick="javascript:itemqa_delete(fitemqa_password<?php echo $i; ?>, <?php echo $i; ?>);" class="btn01">삭제</button>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div id="sit_qna_pw_<?php echo $i; ?>" class="sit_qna_pw"> <div id="sit_qa_pw_<?php echo $i; ?>" class="sit_qa_pw">
<form name="fitemqa_password<?php echo $i; ?>" method="post" action="./itemqaupdate.php" autocomplete="off"> <form name="fitemqa_password<?php echo $i; ?>" method="post" action="./itemqaupdate.php" autocomplete="off">
<input type="hidden" name="w" value=""> <input type="hidden" name="w" value="">
<input type="hidden" name="iq_id" value=""> <input type="hidden" name="iq_id" value="">
@ -109,11 +109,11 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?> ?>
</section> </section>
<div id="sit_qna_wbtn"> <div id="sit_qa_wbtn">
<button type="button" id="iq_write" class="btn_submit" onclick="javascript:itemqa_insert();">상품문의 쓰기</button> <button type="button" id="iq_write" class="btn_submit" onclick="javascript:itemqa_insert();">상품문의 쓰기</button>
</div> </div>
<section id="sit_qna_w"> <section id="sit_qa_w">
<h3>상품문의 작성</h3> <h3>상품문의 작성</h3>
<form name="fitemqa" method="post" onsubmit="return fitemqa_submit(this);" autocomplete="off"> <form name="fitemqa" method="post" onsubmit="return fitemqa_submit(this);" autocomplete="off">
@ -185,7 +185,7 @@ if (!g4_is_member) {
*/ */
var f = document.fitemqa; var f = document.fitemqa;
var id = document.getElementById('sit_qna_w'); var id = document.getElementById('sit_qa_w');
id.style.display = 'block'; id.style.display = 'block';
@ -204,7 +204,7 @@ f.iq_question.value = '';
function itemqa_update(idx) function itemqa_update(idx)
{ {
var f = document.fitemqa; var f = document.fitemqa;
var id = document.getElementById('sit_qna_w'); var id = document.getElementById('sit_qa_w');
id.style.display = 'block'; id.style.display = 'block';
@ -221,7 +221,7 @@ f.iq_question.value = document.getElementById('tmp_iq_question'+idx).value;
function itemqa_delete(f, idx) function itemqa_delete(f, idx)
{ {
var id = document.getElementById('sit_qna_w'); var id = document.getElementById('sit_qa_w');
f.w.value = 'd'; f.w.value = 'd';
f.iq_id.value = document.getElementById('tmp_iq_id'+idx).value; f.iq_id.value = document.getElementById('tmp_iq_id'+idx).value;

View File

@ -151,6 +151,18 @@
$c_PayPlus->m_res_msg = "연동 오류|tran_cd값이 설정되지 않았습니다."; $c_PayPlus->m_res_msg = "연동 오류|tran_cd값이 설정되지 않았습니다.";
} }
if ($res_cd != '0000')
{
$res_msg = iconv("euc-kr", "utf-8", $res_msg);
echo "<script>
var openwin = window.open( './kcp/proc_win.php', 'proc_win', '' );
openwin.close();
</script>";
alert("$res_cd : $res_msg");
exit;
}
/* = -------------------------------------------------------------------------- = */ /* = -------------------------------------------------------------------------- = */
/* = 04. 실행 END = */ /* = 04. 실행 END = */

View File

@ -13,9 +13,6 @@ else {
if (get_cart_count($tmp_uq_id) == 0) if (get_cart_count($tmp_uq_id) == 0)
alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php'); alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php');
// 포인트 결제 대기 필드 추가
//sql_query(" ALTER TABLE `$g4[shop_order_table]` ADD `od_temp_point` INT NOT NULL AFTER `od_temp_card` ", false);
$g4['title'] = '주문서 작성'; $g4['title'] = '주문서 작성';
include_once(G4_MSHOP_PATH.'/_head.php'); include_once(G4_MSHOP_PATH.'/_head.php');
@ -24,35 +21,213 @@ include_once(G4_MSHOP_PATH.'/_head.php');
$od_id = get_uniqid(); $od_id = get_uniqid();
set_session('ss_order_uniqid', $od_id); set_session('ss_order_uniqid', $od_id);
$s_uq_id = $tmp_uq_id;
$order_action_url = G4_HTTPS_MSHOP_URL.'/orderformupdate.php';
if (file_exists('./settle_'.$default['de_card_pg'].'.inc.php')) {
include './settle_'.$default['de_card_pg'].'.inc.php';
}
// 결제등록 요청시 사용할 입금마감일 // 결제등록 요청시 사용할 입금마감일
$ipgm_date = date("Ymd", (G4_SERVER_TIME + 86400 * 5)); $ipgm_date = date("Ymd", (G4_SERVER_TIME + 86400 * 5));
$tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정(갤럭시탭,아이패드 - 1.85, 스마트폰 - 1.0) $tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정(갤럭시탭,아이패드 - 1.85, 스마트폰 - 1.0)
?> ?>
<div id="sod_frm"> <div id="sod_approval_frm">
<?php
ob_start();
?>
<p>주문하실 상품을 확인하세요.</p>
<table class="basic_tbl">
<thead>
<tr>
<th scope="col">상품이미지</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
$tot_point = 0;
$tot_sell_amount = 0;
$goods = $goods_it_id = "";
$goods_count = -1;
// $s_uq_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
b.ca_id
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and a.ct_time > '$ctime' ";
}
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$good_info = '';
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_point * ct_qty) as point,
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
$sum = sql_fetch($sql);
if (!$goods)
{
//$goods = addslashes($row[it_name]);
//$goods = get_text($row[it_name]);
$goods = preg_replace("/\'|\"|\||\,|\&|\;/", "", $row['it_name']);
$goods_it_id = $row['it_id'];
}
$goods_count++;
// 에스크로 상품정보
if($default['de_escrow_use']) {
if ($i>0)
$good_info .= chr(30);
$good_info .= "seq=".($i+1).chr(31);
$good_info .= "ordr_numb={$od_id}_".sprintf("%04d", $i).chr(31);
$good_info .= "good_name=".addslashes($row['it_name']).chr(31);
$good_info .= "good_cntx=".$row['ct_qty'].chr(31);
$good_info .= "good_amtx=".$row['ct_price'].chr(31);
}
$a1 = '<b>';
$a2 = '</b>';
$image = get_it_image($row['it_id'], 50, 50);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_uq_id);
if($it_options) {
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';
}
$point = $sum['point'];
$sell_amount = $sum['price'];
// 쿠폰
if($is_member) {
$cp_button = '';
$sql = " select count(*) as cnt
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_used = '0'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and (
( cp_method = '0' and cp_target = '{$row['it_id']}' )
OR
( cp_method = '1' and ( cp_target IN ( '{$row['ca_id']}', '{$row['ca_id2']}', '{$row['ca_id3']}' ) ) )
) ";
$cp = sql_fetch($sql);
if($cp['cnt'])
$cp_button = '<button type="button" class="it_coupon_btn">적용</button>';
}
?>
<tr>
<td class="sod_bsk_img"><?php echo $image; ?></td>
<td>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<input type="hidden" name="it_amount[<?php echo $i; ?>]" value="<?php echo $sell_amount; ?>">
<input type="hidden" name="cp_id[<?php echo $i; ?>]" value="">
<input type="hidden" name="cp_amount[<?php echo $i; ?>]" value="0">
<?php echo $it_name.$mod_options; ?>
</td>
<td class="td_num"><?php echo number_format($sum['qty']); ?></td>
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
<td><?php echo $cp_button; ?></td>
<td class="td_bignum"><span class="ct_sell_amount"><?php echo number_format($sell_amount); ?></span></td>
<td class="td_num"><?php echo number_format($sum['point']); ?></td>
</tr>
<?php <?php
$s_page = 'orderform.php'; $tot_point += $point;
$s_uq_id = $tmp_uq_id; $tot_sell_amount += $sell_amount;
} // for 끝
echo '<p>주문하실 상품을 확인하세요.</p>'; if ($i == 0) {
include_once(G4_MSHOP_PATH.'/cartsub.inc.php'); echo '<tr><td colspan="'.$colspan.'" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
} else {
if (file_exists(G4_MSHOP_PATH.'/settle_'.$default['de_card_pg'].'.inc.php')) { // 배송비 계산
include G4_MSHOP_PATH.'/settle_'.$default['de_card_pg'].'.inc.php'; if ($default['de_send_cost_case'] == '없음')
$send_cost = 0;
else {
// 배송비 상한 : 여러단계의 배송비 적용 가능
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
$send_cost_list = explode(";", $default['de_send_cost_list']);
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < $send_cost_limit[$k]) {
$send_cost = $send_cost_list[$k];
break;
}
}
}
} }
$good_mny = (int)$tot_sell_amount + (int)$send_cost;
$order_action_url = G4_HTTPS_MSHOP_URL.'/orderformupdate.php';
?> ?>
</tbody>
</table>
<?php if ($goods_count) $goods .= ' 외 '.$goods_count.'건'; ?>
<?php
// 배송비가 0 보다 크다면 (있다면)
if ($send_cost > 0)
{
?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span>
<strong><?php echo number_format($send_cost); ?> 원</strong>
</div>
<?php } ?>
<?php
// 총계 = 주문상품금액합계 + 배송비
$tot_amount = $tot_sell_amount + $send_cost;
if ($tot_amount > 0) {
?>
<div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>총계</span>
<strong><span id="ct_tot_amount"><?php echo number_format($tot_amount); ?></span> 원 <?php echo number_format($tot_point); ?> 점</strong>
</div>
<?php } ?>
<?php
$content = ob_get_contents();
ob_end_clean();
?>
<!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트--> <!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트-->
<script src="<?php echo G4_MSHOP_URL; ?>/kcp/approval_key.js"></script> <script src="<?php echo G4_MSHOP_URL; ?>/kcp/approval_key.js"></script>
<form name="sm_form" method="POST" action="<?php echo G4_MSHOP_URL; ?>/kcp/order_approval_form.php"> <form name="sm_form" method="POST" action="<?php echo G4_MSHOP_URL; ?>/kcp/order_approval_form.php">
<input type="hidden" name="good_name" value="<?php echo $goods; ?>"> <input type="hidden" name="good_name" value="<?php echo $goods; ?>">
<input type="hidden" name="good_mny" value="<?php echo $good_mny; ?>" > <input type="hidden" name="good_mny" value="<?php echo $tot_amount ?>" >
<input type="hidden" name="buyr_name" value=""> <input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_tel1" value=""> <input type="hidden" name="buyr_tel1" value="">
<input type="hidden" name="buyr_tel2" value=""> <input type="hidden" name="buyr_tel2" value="">
@ -108,10 +283,16 @@ $tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */ <input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
--> -->
</form> </form>
</div>
<div id="sod_frm">
<form name="forderform" method="post" action="<?php echo $order_action_url; ?>" onsubmit="return forderform_check(this);" autocomplete="off"> <form name="forderform" method="post" action="<?php echo $order_action_url; ?>" onsubmit="return forderform_check(this);" autocomplete="off">
<input type="hidden" name="od_amount" value="<?php echo $tot_sell_amount; ?>"> <input type="hidden" name="od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="org_od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>"> <input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="org_send_cost" value="<?php echo $send_cost; ?>">
<?php echo $content; ?>
<section id="sod_frm_orderer"> <section id="sod_frm_orderer">
<h2>주문하시는 분</h2> <h2>주문하시는 분</h2>
@ -240,9 +421,64 @@ $tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정
</table> </table>
</section> </section>
<?php
if($is_member) {
// 주문쿠폰
$sql = " select count(*) as cnt
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_method = '2'
and cp_start <= '".G4_TIM_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0' ";
$row = sql_fetch($sql);
$oc_cnt = $row['cnt'];
if($send_cost > 0) {
// 배송비쿠폰
$sql = " select count(*) as cnt
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_method = '3'
and cp_start <= '".G4_TIM_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0' ";
$row = sql_fetch($sql);
$sc_cnt = $row['cnt'];
}
}
?>
<section id="sod_frm_pay"> <section id="sod_frm_pay">
<h2>결제정보 입력</h2> <h2>결제정보 입력</h2>
<table class="frm_tbl">
<tbody>
<?php if($oc_cnt > 0) { ?>
<tr>
<th scope="row">결제할인쿠폰</th>
<td>
<input type="hidden" name="od_cp_id" value="">
<button type="button" id="od_coupon_btn">쿠폰적용</button>
</td>
</tr>
<?php } ?>
<?php if($sc_cnt > 0) { ?>
<tr>
<th scope="row">배송비할인쿠폰</th>
<td>
<input type="hidden" name="sc_cp_id" value="">
<button type="button" id="sc_coupon_btn">쿠폰적용</button>
</td>
</tr>
<?php } ?>
<tr>
<th>총 주문금액</th>
<td><span id="od_tot_amount"><?php echo number_format($tot_amount); ?></span>원</td>
</tr>
</tbody>
</table>
<?php <?php
$multi_settle == 0; $multi_settle == 0;
$checked = ''; $checked = '';
@ -339,8 +575,8 @@ $tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정
if ($temp_point > $member_mileage) if ($temp_point > $member_mileage)
$temp_point = $member_mileage; $temp_point = $member_mileage;
echo '<div>결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>'; echo '<div><input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>';
echo '<div>회원님의 보유포인트('.display_point($member['mb_mileage']).')중 <strong>'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>'; echo '<div>회원님의 보유포인트('.display_point($member['mb_mileage']).')중 <strong id="use_max_point">'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>';
$multi_settle++; $multi_settle++;
} }
} }
@ -358,8 +594,8 @@ $tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정
if ($temp_point > $member_point) if ($temp_point > $member_point)
$temp_point = $member_point; $temp_point = $member_point;
echo '<div>결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>'; echo '<div><input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>';
echo '<div>회원님의 보유포인트('.display_point($member['mb_point']).')중 <strong>'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>'; echo '<div>회원님의 보유포인트('.display_point($member['mb_point']).')중 <strong id="use_max_point">'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>';
$multi_settle++; $multi_settle++;
} }
} }
@ -459,6 +695,279 @@ $tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정
</div> </div>
<script> <script>
$(function() {
var $cp_btn_el;
var $cp_row_el;
$(".it_coupon_btn").click(function() {
$cp_btn_el = $(this);
$cp_row_el = $(this).closest("tr");
$("#it_coupon_frm").remove();
var it_id = $cp_btn_el.closest("tr").find("input[name^=it_id]").val();
$.post(
"./orderitemcoupon.php",
{ it_id: it_id },
function(data) {
$cp_btn_el.after(data);
}
);
});
$(".cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='f_cp_id[]']").val();
var amount = $el.find("input[name='f_cp_amt[]']").val();
var subj = $el.find("input[name='f_cp_subj[]']").val();
var sell_amount;
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
// 이미 사용한 쿠폰이 있는지
var cp_dup = false;
var cp_dup_idx;
var $cp_dup_el;
$("input[name^=cp_id]").each(function(index) {
var id = $(this).val();
if(id == cp_id) {
cp_dup_idx = index;
cp_dup = true;
$cp_dup_el = $(this).closest("tr");;
return false;
}
});
if(cp_dup) {
var it_name = $("input[name='it_name["+cp_dup_idx+"]']").val();
if(!confirm(subj+ "쿠폰은 "+it_name+"에 사용되었습니다.\n"+it_name+"의 쿠폰을 취소한 후 적용하시겠습니까?")) {
return false;
} else {
coupon_cancel($cp_dup_el);
}
}
var $s_el = $cp_row_el.find(".ct_sell_amount");;
sell_amount = parseInt($cp_row_el.find("input[name^=it_amount]").val());
sell_amount = sell_amount - parseInt(amount);
$s_el.text(number_format(String(sell_amount)));
$cp_row_el.find("input[name^=cp_id]").val(cp_id);
$cp_row_el.find("input[name^=cp_amount]").val(amount);
calculate_total_amount();
$("#it_coupon_frm").remove();
$cp_btn_el.focus();
});
$("#it_coupon_close").live("click", function() {
$("#it_coupon_frm").remove();
$cp_btn_el.focus();
});
$("#it_coupon_cancel").live("click", function() {
coupon_cancel($cp_row_el);
calculate_total_amount();
$("#it_coupon_frm").remove();
$cp_btn_el.focus();
});
$("#od_coupon_btn").click(function() {
$("#od_coupon_frm").remove();
var $this = $(this);
var amount = parseInt($("input[name=org_od_amount]").val());
var send_cost = parseInt($("input[name=org_send_cost]").val());
$.post(
"./ordercoupon.php",
{ amount: amount },
function(data) {
$this.after(data);
}
);
});
$(".od_cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='o_cp_id[]']").val();
var amount = parseInt($el.find("input[name='o_cp_amt[]']").val());
var subj = $el.find("input[name='o_cp_subj[]']").val();
var od_amount = parseInt($("input[name=org_od_amount]").val());
var send_cost = $("input[name=org_send_cost]").val();
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
$("input[name=od_send_cost]").val(send_cost);
$("input[name=sc_cp_id]").val("");
$("input[name=od_amount]").val(od_amount - amount);
$("input[name=od_cp_id]").val(cp_id);
calculate_order_amount();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#od_coupon_close").live("click", function() {
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#od_coupon_cancel").live("click", function() {
var org_amount = $("input[name=org_od_amount]").val();
$("input[name=od_amount]").val(org_amount);
calculate_order_amount();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#sc_coupon_btn").click(function() {
$("#sc_coupon_frm").remove();
var $this = $(this);
var amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=org_send_cost]").val());
$.post(
"./ordersendcostcoupon.php",
{ amount: (amount + send_cost), send_cost: send_cost },
function(data) {
$this.after(data);
}
);
});
$(".sc_cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='s_cp_id[]']").val();
var amount = parseInt($el.find("input[name='s_cp_amt[]']").val());
var subj = $el.find("input[name='s_cp_subj[]']").val();
var send_cost = parseInt($("input[name=org_send_cost]").val());
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
$("input[name=od_send_cost]").val(send_cost - amount);
$("input[name=sc_cp_id]").val(cp_id);
calculate_order_amount();
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#sc_coupon_close").live("click", function() {
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#sc_coupon_cancel").live("click", function() {
var send_cost = $("input[name=org_send_cost]").val();
$("input[name=od_send_cost]").val(send_cost);
calculate_order_amount();
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#od_settle_bank").bind("click", function() {
$("[name=od_deposit_name]").val( $("[name=od_b_name]").val() );
$("#settle_bank").show();
$("#show_req_btn").css("display", "none");
$("#show_pay_btn").css("display", "inline");
});
$("#od_settle_iche,#od_settle_card,#od_settle_vbank,#od_settle_hp").bind("click", function() {
$("#settle_bank").hide();
$("#show_req_btn").css("display", "inline");
$("#show_pay_btn").css("display", "none");
});
});
function coupon_cancel($el)
{
var $dup_sell_el = $el.find(".ct_sell_amount");
var $dup_amount_el = $el.find("input[name^=cp_amount]");
var org_sell_amount = $el.find("input[name^=it_amount]").val();
$dup_sell_el.text(number_format(String(org_sell_amount)));
$dup_amount_el.val(0);
$el.find("input[name^=cp_id]").val("");
}
function calculate_total_amount()
{
var $it_amt = $("input[name^=it_amount]");
var $cp_amt = $("input[name^=cp_amount]");
var tot_sell_amount = sell_amount = 0;
var it_amount, cp_amount;
var send_cost = parseInt($("input[name=org_send_cost]").val());
$it_amt.each(function(index) {
it_amount = parseInt($(this).val());
cp_amount = parseInt($cp_amt.eq(index).val());
sell_amount += (it_amount - cp_amount);
});
tot_sell_amount = sell_amount + send_cost;
$("#ct_tot_amount").text(number_format(String(tot_sell_amount)));
$("form[name=sm_form] input[name=good_mny]").val(tot_sell_amount);
$("input[name=od_amount]").val(sell_amount);
$("input[name=org_od_amount]").val(sell_amount);
$("input[name=od_send_cost]").val(send_cost);
<?php if($od_cnt > 0) { ?>
$("input[name=od_cp_id]").val("");
<?php } ?>
<?php if($sc_cnt > 0) { ?>
$("input[name=sc_cp_id]").val("");
<?php } ?>
$("input[name=od_temp_point]").val(0);
<?php if($temp_point > 0 && $is_member) { ?>
calculate_temp_point();
<?php } ?>
calculate_order_amount();
}
function calculate_order_amount()
{
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var tot_amount = sell_amount + send_cost;
$("form[name=sm_form] input[name=good_mny]").val(tot_amount);
$("#od_tot_amount").text(number_format(String(tot_amount)));
<?php if($temp_point > 0 && $is_member) { ?>
calculate_temp_point();
<?php } ?>
}
function calculate_temp_point()
{
<?php
if($default['de_mileage_use']) {
$point = (int)$member_mileage;
} else {
$point = (int)$member_point;
}
?>
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var point_per = <?php echo $default['de_point_per']; ?>;
var temp_point = parseInt((sell_amount + send_cost) * (point_per / 100) / 100) * 100;
var point = <?php echo $point; ?>
if(temp_point > point)
temp_point = point;
$("#use_max_point").text(number_format(String(temp_point))+"점");
$("input[name=max_temp_point]").val(temp_point);
}
/* 결제방법에 따른 처리 후 결제등록요청 실행 */ /* 결제방법에 따른 처리 후 결제등록요청 실행 */
function kcp_approval() function kcp_approval()
{ {
@ -484,7 +993,9 @@ function kcp_approval()
} }
var tot_amount = <?php echo (int)$tot_amount; ?>; var tot_amount = <?php echo (int)$tot_amount; ?>;
var max_point = <?php echo (int)$temp_point; ?>; var max_point = 0;
if (typeof(pf.max_temp_point) != "undefined")
max_point = parseInt(pf.max_temp_point.value);
if (typeof(pf.od_temp_point) != "undefined") { if (typeof(pf.od_temp_point) != "undefined") {
if (pf.od_temp_point.value) if (pf.od_temp_point.value)
@ -493,20 +1004,30 @@ function kcp_approval()
{ {
temp_point = parseInt(pf.od_temp_point.value); temp_point = parseInt(pf.od_temp_point.value);
<?php
if($default['de_mileage_use']) {
$mb_point = $member['mb_mileage'];
$p_msg = '마일리지';
} else {
$mb_point = $member['mb_point'];
$p_msg = '포인트';
}
?>
if (temp_point < 0) { if (temp_point < 0) {
alert("포인트를 0 이상 입력하세요."); alert("<?php echo $p_msg; ?>를 0 이상 입력하세요.");
pf.od_temp_point.select(); pf.od_temp_point.select();
return false; return false;
} }
if (temp_point > tot_amount) { if (temp_point > tot_amount) {
alert("주문금액 보다 많이 포인트결제할 수 없습니다."); alert("주문금액 보다 많이 <?php echo $p_msg; ?>결제할 수 없습니다.");
pf.od_temp_point.select(); pf.od_temp_point.select();
return false; return false;
} }
if (temp_point > <?php echo (int)$member['mb_point']; ?>) { if (temp_point > <?php echo (int)$mb_point; ?>) {
alert("회원님의 포인트보다 많이 결제할 수 없습니다."); alert("회원님의 <?php echo $p_msg; ?>보다 많이 결제할 수 없습니다.");
pf.od_temp_point.select(); pf.od_temp_point.select();
return false; return false;
} }
@ -518,7 +1039,7 @@ function kcp_approval()
} }
if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) { if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) {
alert("포인트를 100점 단위로 입력하세요."); alert("<?php echo $p_msg; ?>를 100점 단위로 입력하세요.");
pf.od_temp_point.select(); pf.od_temp_point.select();
return false; return false;
} }
@ -629,7 +1150,8 @@ function forderform_check(f)
} }
var tot_amount = <?php echo (int)$tot_amount; ?>; var tot_amount = <?php echo (int)$tot_amount; ?>;
var max_point = <?php echo (int)$temp_point; ?>; if (typeof(f.max_temp_point) != "undefined")
var max_point = parseInt(f.max_temp_point.value);
var temp_point = 0; var temp_point = 0;
if (typeof(f.od_temp_point) != "undefined") { if (typeof(f.od_temp_point) != "undefined") {
@ -637,20 +1159,30 @@ function forderform_check(f)
{ {
temp_point = parseInt(f.od_temp_point.value); temp_point = parseInt(f.od_temp_point.value);
<?php
if($default['de_mileage_use']) {
$mb_point = $member['mb_mileage'];
$p_msg = '마일리지';
} else {
$mb_point = $member['mb_point'];
$p_msg = '포인트';
}
?>
if (temp_point < 0) { if (temp_point < 0) {
alert("포인트를 0 이상 입력하세요."); alert("<?php echo $p_msg; ?>를 0 이상 입력하세요.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
if (temp_point > tot_amount) { if (temp_point > tot_amount) {
alert("주문금액 보다 많이 포인트결제할 수 없습니다."); alert("주문금액 보다 많이 <?php echo $p_msg; ?>결제할 수 없습니다.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
if (temp_point > <?php echo (int)$member['mb_point']; ?>) { if (temp_point > <?php echo (int)$mb_point; ?>) {
alert("회원님의 포인트보다 많이 결제할 수 없습니다."); alert("회원님의 <?php echo $p_msg; ?>보다 많이 결제할 수 없습니다.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
@ -662,7 +1194,7 @@ function forderform_check(f)
} }
if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) { if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) {
alert("포인트를 100점 단위로 입력하세요."); alert("<?php echo $p_msg; ?>를 100점 단위로 입력하세요.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
@ -710,21 +1242,6 @@ function gumae2baesong(f)
f.od_b_addr1.value = f.od_addr1.value; f.od_b_addr1.value = f.od_addr1.value;
f.od_b_addr2.value = f.od_addr2.value; f.od_b_addr2.value = f.od_addr2.value;
} }
$(function() {
$("#od_settle_bank").bind("click", function() {
$("[name=od_deposit_name]").val( $("[name=od_b_name]").val() );
$("#settle_bank").show();
$("#show_req_btn").css("display", "none");
$("#show_pay_btn").css("display", "inline");
});
$("#od_settle_iche,#od_settle_card,#od_settle_vbank,#od_settle_hp").bind("click", function() {
$("#settle_bank").hide();
$("#show_req_btn").css("display", "inline");
$("#show_pay_btn").css("display", "none");
});
});
</script> </script>
<?php <?php

View File

@ -3,11 +3,15 @@ include_once('./_common.php');
if(get_magic_quotes_gpc()) if(get_magic_quotes_gpc())
{ {
$_GET = array_map("stripslashes", $_GET); //$_GET = array_map("stripslashes", $_GET);
$_POST = array_map("stripslashes", $_POST); //$_POST = array_map("stripslashes", $_POST);
$_GET = array_add_callback("stripslashes", $_GET);
$_POST = array_add_callback("stripslashes", $_POST);
} }
$_GET = array_map("mysql_real_escape_string", $_GET); //$_GET = array_map("mysql_real_escape_string", $_GET);
$_POST = array_map("mysql_real_escape_string", $_POST); //$_POST = array_map("mysql_real_escape_string", $_POST);
$_GET = array_add_callback("mysql_real_escape_string", $_GET);
$_POST = array_add_callback("mysql_real_escape_string", $_POST);
// 결제등록 완료 체크 // 결제등록 완료 체크
if($od_settle_case != '무통장') { if($od_settle_case != '무통장') {
@ -63,7 +67,106 @@ $i_temp_point = (int)$_POST['od_temp_point'];
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' "; from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if ((int)$row['od_amount'] !== $i_amount) { $tot_ct_amount = $row['od_amount'];
// 쿠폰금액계산
$tot_cp_amount = 0;
if($is_member) {
// 상품쿠폰
$tot_it_cp_amount = $tot_od_cp_amount = 0;
$it_cp_cnt = count($_POST['cp_id']);
$arr_it_cp_amt = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $_POST['cp_id'][$i];
$it_id = $_POST['it_id'][$i];
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '$cid'
and mb_id = '{$member['mb_id']}'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_method IN ( 0, 1 ) ";
$cp = sql_fetch($sql);
if(!$cp['cp_id'])
continue;
// 분류할인인지
if($cp['cp_method']) {
$sql2 = " select it_id, ca_id, ca_id2, ca_id3
from {$g4['shop_item_table']}
where it_id = '$it_id' ";
$row2 = sql_fetch($sql2);
if(!$row2['it_id'])
continue;
if($row2['ca_id'] != $cp['cp_target'] && $row2['ca_id2'] != $cp['cp_target'] && $row2['ca_id3'] != $cp['cp_target'])
continue;
} else {
if($cp['cp_target'] != $it_id)
continue;
}
// 상품금액
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
and it_id = '$it_id' ";
$ct = sql_fetch($sql);
$item_price = $ct['sum_price'];
if($cp['cp_minimum'] > $item_price)
continue;
$dc = 0;
if($cp['cp_type']) {
$dc = floor(($item_price * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
$tot_it_cp_amount += $dc;
$arr_it_cp_amt[$it_id] = $dc;
}
$tot_od_amount = $tot_ct_amount - $tot_it_cp_amount;
// 주문쿠폰
if($_POST['od_cp_id']) {
$sql = " select cp_id, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '{$_POST['od_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_method = '2' ";
$cp = sql_fetch($sql);
$dc = 0;
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_amount)) {
if($cp['cp_type']) {
$dc = floor(($tot_od_amount * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
$tot_od_cp_amount = $dc;
$tot_od_amount -= $tot_od_cp_amount;
}
}
$tot_cp_amount = $tot_it_cp_amount + $tot_od_cp_amount;
}
if ((int)($row['od_amount'] - $tot_cp_amount) !== $i_amount) {
die("Error."); die("Error.");
} }
@ -85,7 +188,41 @@ if ($default['de_send_cost_case'] == "없음") {
} }
} }
} }
if ((int)$send_cost !== $i_send_cost) {
$tot_sc_cp_amount = 0;
if($is_member && $send_cost > 0) {
// 배송쿠폰
if($_POST['sc_cp_id']) {
$sql = " select cp_id, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '{$_POST['sc_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_method = '3' ";
$cp = sql_fetch($sql);
$dc = 0;
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_amount)) {
if($cp['cp_type']) {
$dc = floor(($tot_od_amount * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
if($dc > $send_cost)
$dc = $send_cost;
$tot_sc_cp_amount = $dc;
}
}
}
if ((int)($send_cost - $tot_sc_cp_amount) !== $i_send_cost) {
die("Error.."); die("Error..");
} }
@ -259,6 +396,8 @@ $sql = " insert {$g4['shop_order_table']}
od_deposit_name = '$od_deposit_name', od_deposit_name = '$od_deposit_name',
od_memo = '$od_memo', od_memo = '$od_memo',
od_send_cost = '$od_send_cost', od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_coupon = '$tot_od_cp_amount',
od_temp_bank = '$od_temp_bank', od_temp_bank = '$od_temp_bank',
od_temp_card = '$od_receipt_card', od_temp_card = '$od_receipt_card',
od_temp_hp = '$od_receipt_hp', od_temp_hp = '$od_receipt_hp',
@ -330,6 +469,54 @@ include_once(G4_MSHOP_PATH.'/kcp/pp_ax_hub_result.php');
$od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;"; $od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;";
// 쿠폰사용내역기록
if($is_member) {
$it_cp_cnt = count($_POST['cp_id']);
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $_POST['cp_id'][$i];
$cp_it_id = $_POST['it_id'][$i];
$sql = " update {$g4['shop_coupon_table']}
set od_id = '$od_id',
cp_used = '1',
cp_used_time = '".G4_TIME_YMDHIS."'
where cp_id = '$cid'
and mb_id = '{$member['mb_id']}'
and cp_method IN ( 0, 1 ) ";
sql_query($sql);
// 쿠폰사용금액 cart에 기록
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
$sql = " update {$g4['shop_cart_table']}
set cp_amount = '$cp_amt'
where uq_id = '$tmp_uq_id'
and it_id = '$cp_it_id'
and ct_num = '0' ";
sql_query($sql);
}
if($_POST['od_cp_id']) {
$sql = " update {$g4['shop_coupon_table']}
set od_id = '$od_id',
cp_used = '1',
cp_used_time = '".G4_TIME_YMDHIS."'
where cp_id = '{$_POST['od_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_method = '2' ";
sql_query($sql);
}
if($_POST['sc_cp_id']) {
$sql = " update {$g4['shop_coupon_table']}
set od_id = '$od_id',
cp_used = '1',
cp_used_time = '".G4_TIME_YMDHIS."'
where cp_id = '{$_POST['sc_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_method = '3' ";
sql_query($sql);
}
}
include_once(G4_SHOP_PATH.'/ordermail1.inc.php'); include_once(G4_SHOP_PATH.'/ordermail1.inc.php');
include_once(G4_SHOP_PATH.'/ordermail2.inc.php'); include_once(G4_SHOP_PATH.'/ordermail2.inc.php');

View File

@ -12,6 +12,7 @@ if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
<th scope="col">주문번호</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>
<th scope="col">입금액</th> <th scope="col">입금액</th>
</tr> </tr>
</thead> </thead>
@ -37,6 +38,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
</td> </td>
<td class="td_datetime"><?php echo substr($row['od_time'],0,16); ?> (<?php echo get_yoil($row['od_time']); ?>)</td> <td class="td_datetime"><?php echo substr($row['od_time'],0,16); ?> (<?php echo get_yoil($row['od_time']); ?>)</td>
<td class="td_bignum"><?php echo display_price($row['orderamount']); ?></td> <td class="td_bignum"><?php echo display_price($row['orderamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['couponamount']); ?></td>
<td class="td_stat"><?php echo display_price($row['receiptamount']); ?></td> <td class="td_stat"><?php echo display_price($row['receiptamount']); ?></td>
</tr> </tr>

View File

@ -44,7 +44,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<dd>상품 배송이 완료되었습니다.</dd> <dd>상품 배송이 완료되었습니다.</dd>
</dl> </dl>
<?php <?php
$sql = " select it_id, it_name $sql = " select it_id, it_name, cp_amount
from {$g4['shop_cart_table']} from {$g4['shop_cart_table']}
where uq_id = '$uq_id' where uq_id = '$uq_id'
and ct_num = '0' and ct_num = '0'
@ -112,36 +112,63 @@ include_once(G4_MSHOP_PATH.'/_head.php');
</table> </table>
</li> </li>
<?php <?php
$tot_cp_amount += $row['cp_amount'];
} }
$send_cost = $od['od_send_cost']; $send_cost = $od['od_send_cost'];
$send_coupon = $od['od_send_coupon'];
$org_send_cost = $send_cost + $send_coupon;
?> ?>
</ul> </ul>
<?php <?php
// 배송비가 0 보다 크다면 (있다면) // 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인
if ($send_cost > 0) $od_coupon = $od['od_coupon'];
{ $tot_amount = $tot_sell_amount + $send_cost - $tot_cp_amount - $od_coupon;
?> ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot"> <div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span> <span>주문총액</span>
<strong><?php echo number_format($send_cost); ?> 원</strong> <strong><?php echo number_format($tot_sell_amount); ?> 원</strong>
</div> </div>
<?php if($tot_cp_amount > 0) { ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>상품할인</span>
<strong><?php echo number_format($tot_cp_amount); ?> 원</strong>
</div>
<?php } ?> <?php } ?>
<?php <?php if($od_coupon > 0) { ?>
// 총계 = 주문상품금액합계 + 배송비 <div id="sod_bsk_dvr" class="sod_bsk_tot">
$tot_amount = $tot_sell_amount + $send_cost; <span>결제할인</span>
if ($tot_amount > 0) { <strong><?php echo number_format($od_coupon); ?> 원</strong>
?> </div>
<?php } ?>
<?php if ($org_send_cost > 0) { ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span>
<strong><?php echo number_format($org_send_cost); ?> 원</strong>
</div>
<?php } ?>
<?php if($send_coupon > 0) { ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비할인</span>
<strong><?php echo number_format($send_coupon); ?> 원</strong>
</div>
<?php } ?>
<div id="sod_bsk_cnt" class="sod_bsk_tot"> <div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>총계</span> <span>총계</span>
<strong><?php echo number_format($tot_amount); ?> 원 <?php echo number_format($tot_point); ?> 점</strong> <strong><?php echo number_format($tot_amount); ?> 원</strong>
</div> </div>
<?php } ?> <div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>포인트</span>
<strong><?php echo number_format($tot_point); ?> 점</strong>
</div>
</section> </section>
<div id="sod_fin_view"> <div id="sod_fin_view">

View File

@ -166,8 +166,7 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
} }
?> ?>
<?php <?php
// SNS 보내기 include(G4_SNS_PATH."/view.sns.skin.php");
@include(G4_SKIN_PATH."/board/basic/view.sns.skin.php");
?> ?>
</section> </section>

View File

@ -32,6 +32,9 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php } ?> <?php } ?>
작성일 작성일
<span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span> <span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span>
<?php
include(G4_SNS_PATH."/view_comment_list.sns.skin.php");
?>
</header> </header>
<!-- 댓글 출력 --> <!-- 댓글 출력 -->
@ -113,7 +116,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr> </tr>
<?php } ?> <?php } ?>
<?php <?php
@include(G4_SKIN_PATH."/board/basic/view_comment.sns.skin.php"); include(G4_SNS_PATH."/view_comment_write.sns.skin.php");
?> ?>
<tr> <tr>
<th scope="row">내용</th> <th scope="row">내용</th>
@ -168,7 +171,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": "", "subject": "",

View File

@ -202,7 +202,7 @@ function fwrite_submit(f)
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": f.wr_subject.value, "subject": f.wr_subject.value,

View File

@ -54,9 +54,9 @@
/* 게시판 읽기 */ /* 게시판 읽기 */
#bo_v {margin-bottom:1.5em;padding-bottom:1.5em} #bo_v {margin-bottom:1.5em;padding-bottom:1.5em}
#bo_v_cate {padding:0 1em;color:#999;font-size:0.9em;font-weight:bold} #bo_v_table {padding:0 1em;color:#999;font-size:0.9em;font-weight:bold}
#bo_v_h1 {padding:0 0.7em 0.5em;font-size:1.2em} #bo_v_title {padding:0 0.7em 0.5em;font-size:1.2em}
#bo_v_info {padding:0 0.9em 1em;border-bottom:1px solid #ddd} #bo_v_info {padding:0 0.9em 1em;border-bottom:1px solid #ddd}
#bo_v_info h2 {margin:0;padding:0;height:0;overflow:hidden} #bo_v_info h2 {margin:0;padding:0;height:0;overflow:hidden}
@ -116,6 +116,10 @@
#bo_v_act_good, #bo_v_act_good,
#bo_v_act_nogood {display:inline-block;width:1px;height:1px;font-size:0;line-height:0;overflow:hidden} #bo_v_act_nogood {display:inline-block;width:1px;height:1px;font-size:0;line-height:0;overflow:hidden}
#bo_v_sns {margin:0 0 2em;padding:0;list-style:none;zoom:1}
#bo_v_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_sns li {float:left;margin:0 0.5em 0 0}
#bo_v form {padding-top:1.5em} #bo_v form {padding-top:1.5em}
/* 게시판 댓글 */ /* 게시판 댓글 */
@ -146,4 +150,9 @@
#bo_vc_w #char_cnt {display:block;margin-bottom:0.3em} #bo_vc_w #char_cnt {display:block;margin-bottom:0.3em}
#bo_vc_w textarea {width:99%} #bo_vc_w textarea {width:99%}
#bo_vc_sns {margin:0;padding:0;list-style:none;zoom:1}
#bo_vc_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_vc_sns li {float:left;margin:0 1em 0 0}
#bo_vc_sns input {margin:0 0 0 0.5em}
#bo_vc form {padding:0} #bo_vc form {padding:0}

View File

@ -166,8 +166,7 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
} }
?> ?>
<?php <?php
// SNS 보내기 include(G4_SNS_PATH."/view.sns.skin.php");
@include(G4_SKIN_PATH."/board/basic/view.sns.skin.php");
?> ?>
</section> </section>

View File

@ -32,6 +32,9 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php } ?> <?php } ?>
작성일 작성일
<span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span> <span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span>
<?php
include(G4_SNS_PATH."/view_comment_list.sns.skin.php");
?>
</header> </header>
<!-- 댓글 출력 --> <!-- 댓글 출력 -->
@ -113,6 +116,9 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr> </tr>
<?php } ?> <?php } ?>
<?php <?php
include(G4_SNS_PATH."/view_comment_write.sns.skin.php");
?>
<?php
@include(G4_SKIN_PATH."/board/basic/view_comment.sns.skin.php"); @include(G4_SKIN_PATH."/board/basic/view_comment.sns.skin.php");
?> ?>
<tr> <tr>
@ -128,7 +134,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</table> </table>
<div class="btn_confirm"> <div class="btn_confirm">
<input type="submit" class="btn_submit" value="댓글등록"> <input type="submit" id="btn_submit" class="btn_submit" value="댓글등록">
</div> </div>
</form> </form>
@ -168,7 +174,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": "", "subject": "",
@ -236,6 +242,8 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php if($is_guest) echo chk_captcha_js(); ?> <?php if($is_guest) echo chk_captcha_js(); ?>
document.getElementById("btn_submit").disabled = "disabled";
return true; return true;
} }

View File

@ -202,7 +202,7 @@ function fwrite_submit(f)
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": f.wr_subject.value, "subject": f.wr_subject.value,

View File

@ -106,8 +106,8 @@ CKEDITOR.editorConfig = function( config ) {
'Arial;Comic Sans MS;Courier New;Lucida Sans Unicode;monospace;sans-serif;serif;Tahoma;Times New Roman;Verdana'; 'Arial;Comic Sans MS;Courier New;Lucida Sans Unicode;monospace;sans-serif;serif;Tahoma;Times New Roman;Verdana';
config.fontSize_defaultLabel = "10pt"; config.fontSize_defaultLabel = "10pt";
config.fontSize_sizes = "7pt/9px;8pt/11px;9pt/12px;10pt/13px;11pt/15px;14pt/19px;18pt/24px;24pt/32px;36/48px;"; config.fontSize_sizes = "7pt/9px;8pt/11px;9pt/12px;10pt/13px;11pt/15px;14pt/19px;18pt/24px;24pt/32px;36/48px;";
config.enterMode = CKEDITOR.ENTER_BR; config.enterMode = CKEDITOR.ENTER_DIV;
config.shiftEnterMode = CKEDITOR.ENTER_P; config.shiftEnterMode = CKEDITOR.ENTER_DIV;
config.filebrowserUploadUrl = g4_ckeditor_url+"/upload.php?type=Images"; config.filebrowserUploadUrl = g4_ckeditor_url+"/upload.php?type=Images";
config.keystrokes=[ config.keystrokes=[
// Formatting // Formatting

View File

@ -26,7 +26,7 @@ function chk_captcha()
$(function() { $(function() {
$("#captcha").click(function(e) { $("#captcha").click(function(e) {
this.setAttribute("src", g4_url+"/plugin/captcha/run.php?t="+(new Date).getTime()); this.setAttribute("src", g4_url+"/plugin/gcaptcha/run.php?t="+(new Date).getTime());
var keycode = (e.keyCode ? e.keyCode : e.which); var keycode = (e.keyCode ? e.keyCode : e.which);
// 첫 실행에서는 포커스를 주지 않음 // 첫 실행에서는 포커스를 주지 않음
if (typeof(keycode) != "undefined") { if (typeof(keycode) != "undefined") {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

View File

@ -0,0 +1,18 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$mobile_sns_icon = '';
if (G4_IS_MOBILE) $sns_mc_icon = '';
else $sns_mc_icon = '_cmt';
if (!$board['bo_use_sns']) return;
?>
<?php if ($list[$i]['wr_facebook_user']) { ?>
<a href="https://www.facebook.com/profile.php?id=<?php echo $list[$i]['wr_facebook_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/facebook<?php echo $sns_mc_icon; ?>.png" alt="페이스북에도 등록됨"></a>
<?php } ?>
<?php if ($list[$i]['wr_twitter_user']) { ?>
<a href="https://www.twitter.com/<?php echo $list[$i]['wr_twitter_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/twitter<?php echo $sns_mc_icon; ?>.png" alt="트위터에도 등록됨"></a>
<?php } ?>
<?php if ($list[$i]['wr_me2day_user']) { ?>
<a href="http://me2day.net/<?php echo $list[$i]['wr_me2day_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/me2day<?php echo $sns_mc_icon; ?>.png" alt="미투데이에도 등록됨"></a>
<?php } ?>

View File

@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!$board['bo_use_sns']) return; if (!$board['bo_use_sns']) return;
?> ?>
<tr> <tr>
<th scope="row">SNS 등록</th> <th scope="row">SNS 동시등록</th>
<td> <td>
<ul id="bo_vc_sns"> <ul id="bo_vc_sns">
<?php <?php

View File

@ -5,7 +5,8 @@ include_once('./_common.php');
set_unique_id($sw_direct); set_unique_id($sw_direct);
// 회원일 경우 자신의 장바구니 상품 uq_id 값을 변경 // 회원일 경우 자신의 장바구니 상품 uq_id 값을 변경
if($is_member) { /*
if($is_member && $sw_direct != 1) {
$tmp_uq_id = get_session('ss_uq_id'); $tmp_uq_id = get_session('ss_uq_id');
if(!$tmp_uq_id) { if(!$tmp_uq_id) {
$tmp_uq_id = get_uniqid(); $tmp_uq_id = get_uniqid();
@ -21,6 +22,7 @@ if($is_member) {
and ct_time > '$ctime' "; and ct_time > '$ctime' ";
sql_query($sql); sql_query($sql);
} }
*/
if (G4_IS_MOBILE) { if (G4_IS_MOBILE) {
include_once(G4_MSHOP_PATH.'/cart.php'); include_once(G4_MSHOP_PATH.'/cart.php');
@ -29,18 +31,269 @@ if (G4_IS_MOBILE) {
$g4['title'] = '장바구니'; $g4['title'] = '장바구니';
include_once('./_head.php'); include_once('./_head.php');
$s_uq_id = get_session('ss_uq_id');
?> ?>
<script src="<?php echo G4_JS_URL; ?>/shop.js"></script>
<div id="sod_bsk"> <div id="sod_bsk">
<form name="frmcartlist" id="sod_bsk_list" method="post">
<table class="basic_tbl">
<thead>
<tr>
<th scope="col">상품이미지</th>
<th scope="col">상품명</th>
<th scope="col">총수량</th>
<th scope="col">판매가</th>
<th scope="col">소계</th>
<th scope="col">포인트</th>
<th scope="col"><input type="checkbox" name="ct_all" value="1"></th>
</tr>
</thead>
<tbody>
<?php <?php
$s_page = 'cart.php'; $tot_point = 0;
$s_uq_id = get_session('ss_uq_id'); $tot_sell_amount = 0;
include G4_SHOP_PATH.'/cartsub.inc.php'; $tot_cancel_amount = 0;
$goods = $goods_it_id = "";
$goods_count = -1;
// $s_uq_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
b.ca_id,
b.ca_id2,
b.ca_id3
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and a.ct_time > '$ctime' ";
}
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$good_info = '';
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_point * ct_qty) as point,
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
$sum = sql_fetch($sql);
if ($i==0) { // 계속쇼핑
$continue_ca_id = $row['ca_id'];
}
$a1 = '<a href="./item.php?it_id='.$row['it_id'].'"><b>';
$a2 = '</b></a>';
$image = get_it_image($row['it_id'], 70, 70);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_uq_id);
if($it_options) {
$mod_options = '<div class="sod_option_btn"><button type="button" class="mod_options">선택사항수정</button></div>';
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';
}
$point = $sum['point'];
$sell_amount = $sum['price'];
?> ?>
<tr>
<td class="sod_bsk_img"><?php echo $image; ?></td>
<td>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<?php echo $it_name.$mod_options; ?>
</td>
<td class="td_num"><?php echo number_format($sum['qty']); ?></td>
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
<td class="td_bignum"><span id="sell_amount_<?php echo $i; ?>"><?php echo number_format($sell_amount); ?></span></td>
<td class="td_bignum"><?php echo number_format($point); ?></td>
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1"></td>
</tr>
<?php
if ($row['ct_status'] == '취소' || $row['ct_status'] == '반품' || $row['ct_status'] == '품절') {
$tot_cancel_amount += $sell_amount;
}
else {
$tot_point += $point;
$tot_sell_amount += $sell_amount;
}
} // for 끝
if ($i == 0) {
echo '<tr><td colspan="7" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
} else {
// 배송비 계산
if ($default['de_send_cost_case'] == '없음')
$send_cost = 0;
else {
// 배송비 상한 : 여러단계의 배송비 적용 가능
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
$send_cost_list = explode(";", $default['de_send_cost_list']);
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < $send_cost_limit[$k]) {
$send_cost = $send_cost_list[$k];
break;
}
}
}
}
?>
</tbody>
</table>
<?php if ($goods_count) $goods .= ' 외 '.$goods_count.'건'; ?>
<?php
// 배송비가 0 보다 크다면 (있다면)
if ($send_cost > 0)
{
?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span>
<strong><?php echo number_format($send_cost); ?> 원</strong>
</div>
<?php } ?>
<?php
// 총계 = 주문상품금액합계 + 배송비
$tot_amount = $tot_sell_amount + $send_cost;
if ($tot_amount > 0) {
?>
<div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>총계</span>
<strong><?php echo number_format($tot_amount); ?> 원 <?php echo number_format($tot_point); ?> 점</strong>
</div>
<?php } ?>
<div id="sod_bsk_act">
<?php if ($i == 0) { ?>
<a href="<?php echo G4_SHOP_URL; ?>/" class="btn01">쇼핑 계속하기</a>
<?php } else { ?>
<input type="hidden" name="url" value="./orderform.php">
<input type="hidden" name="records" value="<?php echo $i; ?>">
<input type="hidden" name="act" value="">
<p>장바구니의 상품을 주문하시려면 <strong>주문하기</strong>를 클릭하세요. <strong>비우기</strong>는 장바구니의 상품을 모두 비웁니다.</p>
<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('seldelete');" class="btn01">선택삭제</a>
<a href="javascript:form_check('alldelete');" class="btn01">비우기</a>
<?php } ?>
</div>
</form>
</div> </div>
<script>
$(function() {
var close_btn_idx;
// 선택사항수정
$(".mod_options").click(function() {
var it_id = $(this).closest("tr").find("input[name^=it_id]").val();
var $this = $(this);
close_btn_idx = $(".mod_options").index($(this));
winMask(); // 모달 윈도우 배경 출력
$.post(
"./cartoption.php",
{ it_id: it_id },
function(data) {
$("#mod_option_frm").remove();
$this.after("<div id=\"mod_option_frm\"></div>");
$("#mod_option_frm").html(data);
price_calculate();
}
);
});
// 모두선택
$("input[name=ct_all]").click(function() {
if($(this).is(":checked"))
$("input[name^=ct_chk]").attr("checked", true);
else
$("input[name^=ct_chk]").attr("checked", false);
});
// 옵션수정 닫기
$("#mod_option_close").live("click", function() {
$("#mod_option_frm").remove();
$("#win_mask, .window").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
$("#win_mask").click(function () {
$("#mod_option_frm").remove();
$("#win_mask").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
});
function form_check(act) {
var f = document.frmcartlist;
var cnt = f.records.value;
if (act == "buy")
{
f.act.value = act;
<?php
if (get_session('ss_mb_id')) // 회원인 경우
{
echo "f.action = './orderform.php';";
echo "f.submit();";
}
else
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 = "./cartupdate.php";
f.submit();
}
else if (act == "seldelete")
{
if($("input[name^=ct_chk]:checked").size() < 1) {
alert("삭제하실 상품을 하나이상 선택해 주십시오.");
return false;
}
f.act.value = act;
f.action = "./cartupdate.php";
f.submit();
}
return true;
}
</script>
<?php <?php
include_once('./_tail.php'); include_once('./_tail.php');
?> ?>

View File

@ -3,11 +3,12 @@ include_once('./_common.php');
$it_id = $_POST['it_id']; $it_id = $_POST['it_id'];
$sql = " select it_id, it_option_subject, it_supply_subject $sql = " select it_id, it_option_subject, it_supply_subject, it_price, it_point, it_point_type
from {$g4['shop_item_table']} from {$g4['shop_item_table']}
where it_id = '$it_id' where it_id = '$it_id'
and it_use = '1' "; and it_use = '1' ";
$it = sql_fetch($sql); $it = sql_fetch($sql);
$it_point = get_item_point($it);
if(!$it['it_id']) if(!$it['it_id'])
die('no-item'); die('no-item');
@ -18,7 +19,7 @@ $sql = " select * from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id
$result = sql_query($sql); $result = sql_query($sql);
// 판매가격 // 판매가격
$sql2 = " select ct_price, it_name from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' "; $sql2 = " select ct_price, it_name, ct_point from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' ";
$row2 = sql_fetch($sql2); $row2 = sql_fetch($sql2);
if(!mysql_num_rows($result)) if(!mysql_num_rows($result))
@ -30,6 +31,7 @@ if(!mysql_num_rows($result))
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>"> <input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
<input type="hidden" name="it_price" value="<?php echo $row2['ct_price']; ?>"> <input type="hidden" name="it_price" value="<?php echo $row2['ct_price']; ?>">
<input type="hidden" name="it_name" value="<?php echo $row2['it_name']; ?>"> <input type="hidden" name="it_name" value="<?php echo $row2['it_name']; ?>">
<input type="hidden" name="it_point" value="<?php echo $it_point; ?>">
<input type="hidden" name="total_price" value=""> <input type="hidden" name="total_price" value="">
<input type="hidden" name="sw_direct"> <input type="hidden" name="sw_direct">
<?php <?php

View File

@ -153,6 +153,8 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
<td> <td>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>"> <input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>"> <input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<input type="hidden" name="cp_id[<?php echo $i; ?>]" value="">
<input type="hidden" name="cp_amount[<?php echo $i; ?>]" value="">
<?php echo $it_name.$mod_options; ?> <?php echo $it_name.$mod_options; ?>
</td> </td>
<td class="td_num"><?php echo number_format($sum['qty']); ?></td> <td class="td_num"><?php echo number_format($sum['qty']); ?></td>
@ -160,7 +162,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
<?php if($s_page == 'orderform.php') { ?> <?php if($s_page == 'orderform.php') { ?>
<td><?php echo $cp_button; ?></td> <td><?php echo $cp_button; ?></td>
<?php } ?> <?php } ?>
<td class="td_bignum"><?php echo number_format($sell_amount); ?></td> <td class="td_bignum"><span id="sell_amount_<?php echo $i; ?>"><?php echo number_format($sell_amount); ?></span></td>
<td class="td_bignum"><?php echo number_format($point); ?></td> <td class="td_bignum"><?php echo number_format($point); ?></td>
<?php <?php
@ -267,8 +269,8 @@ if ($tot_amount > 0) {
</form> </form>
<?php <?php
if ($s_page == 'cart.php') { if ($i != 0) {
if ($i != 0) { if ($s_page == 'cart.php') {
?> ?>
<script> <script>
$(function() { $(function() {
@ -355,6 +357,83 @@ function form_check(act) {
return true; return true;
} }
</script> </script>
<?php
}
if($s_page == 'orderform.php') {
?>
<script>
$(function() {
var item_index;
$(".od_coupon_btn").click(function() {
var $this = $(this);
$("#it_coupon_frm").remove();
item_index = $(".od_coupon_btn").index($this);
var it_id = $("input[name^=it_id]:eq("+item_index+")").val();
$.post(
"./orderitemcoupon.php",
{ it_id: it_id },
function(data) {
$this.after(data);
}
);
});
$(".cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='f_cp_id[]']").val();
var amount = $el.find("input[name='f_cp_amt[]']").val();
var subj = $el.find("input[name='f_cp_subj[]']").val();
var sell_amount;
// 이미 사용한 쿠폰이 있는지
var cp_dup = false;
var cp_dup_idx;
$("input[name^=cp_id]").each(function(index) {
var id = $(this).val();
if(id == cp_id) {
cp_dup_idx = index;
cp_dup = true;
return false;
}
});
if(cp_dup) {
var it_name = $("input[name='it_name["+cp_dup_idx+"]']").val();
if(!confirm(subj+ "쿠폰은 "+it_name+"에 사용되었습니다.\n"+it_name+"의 쿠폰을 취소한 후 적용하시겠습니까?")) {
return false;
} else {
var $dup_sell_el = $("#sell_amount_"+cp_dup_idx);
var $dup_amount_el = $("input[name='cp_amount["+cp_dup_idx+"]']");
sell_amount = parseInt($dup_sell_el.text().replace(/[^0-9]/g, ""));
var cp_amount = parseInt($dup_amount_el.val());
var org_sell = sell_amount + cp_amount;
$dup_sell_el.text(number_format(String(org_sell)));
$dup_amount_el.val("");
$("input[name='cp_id["+cp_dup_idx+"]']").val("");
}
}
var $s_el = $("#sell_amount_"+item_index);
sell_amount = parseInt($s_el.text().replace(/[^0-9]/g, ""));
sell_amount = sell_amount - parseInt(amount);
$s_el.text(number_format(String(sell_amount)));
$("input[name='cp_id["+item_index+"]']").val(cp_id);
$("input[name='cp_amount["+item_index+"]']").val(amount);
$("#it_coupon_frm").remove();
});
$("#it_coupon_close").live("click", function() {
$("#it_coupon_frm").remove();
});
});
</script>
<?php <?php
} }
} }

View File

@ -122,9 +122,6 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
if (!$_POST['it_id']) if (!$_POST['it_id'])
alert('장바구니에 담을 상품을 선택하여 주십시오.'); alert('장바구니에 담을 상품을 선택하여 주십시오.');
// 기존 장바구니 자료를 먼저 삭제
sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and it_id = '$it_id' ");
$option_count = count($_POST['io_id']); $option_count = count($_POST['io_id']);
if($option_count) { if($option_count) {
@ -171,7 +168,7 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
if ((int)$_POST['total_price'] !== (int)$total_price) if ((int)$_POST['total_price'] !== (int)$total_price)
die("Error.."); die("Error..");
$point = $it['it_point']; $point = get_item_point($it);
// 포인트가 다름 // 포인트가 다름
if ((int)$point !== (int)$_POST['it_point'] && $config['cf_use_point']) if ((int)$point !== (int)$_POST['it_point'] && $config['cf_use_point'])
die("Error..."); die("Error...");
@ -204,6 +201,9 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
} }
//-------------------------------------------------------- //--------------------------------------------------------
// 기존 장바구니 자료를 먼저 삭제
sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and it_id = '$it_id' ");
// 포인트 사용하지 않는다면 // 포인트 사용하지 않는다면
if (!$config['cf_use_point']) { $_POST['it_point'] = 0; } if (!$config['cf_use_point']) { $_POST['it_point'] = 0; }
@ -271,11 +271,7 @@ else // 장바구니에 담기
if ((int)$_POST['total_price'] !== (int)$total_price) if ((int)$_POST['total_price'] !== (int)$total_price)
die("Error.."); die("Error..");
if($it['it_point_type']) { $point = get_item_point($it);
$point = floor(($it['it_price'] * ($it['it_point'] / 100) / 10)) * 10;
} else {
$point = $it['it_point'];
}
// 포인트가 다름 // 포인트가 다름
if ((int)$point !== (int)$_POST['it_point'] && $config['cf_use_point']) if ((int)$point !== (int)$_POST['it_point'] && $config['cf_use_point'])
die("Error..."); die("Error...");

View File

@ -162,8 +162,8 @@ function pg_anchor($anc_id) {
?> ?>
<ul class="sanchor"> <ul class="sanchor">
<li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li> <li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li>
<li><a href="#sit_ps" <?php if ($anc_id == 'ps') echo 'class="sanchor_on"'; ?>>용후기 <span class="item_use_count"></span></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_qna" <?php if ($anc_id == 'qna') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_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>
<?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_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 } ?> <?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"></span></a></li>
@ -338,12 +338,7 @@ else
<th scope="row">포인트</th> <th scope="row">포인트</th>
<td> <td>
<?php <?php
if($it['it_point_type']) { $it_point = get_item_point($it);
$it_point = floor(($it['it_price'] * ($it['it_point'] / 100) / 10)) * 10;
} else {
$it_point = $it['it_point'];
}
echo number_format($it_point); echo number_format($it_point);
?> 점 ?> 점
<input type="hidden" name="it_point" value="<?php echo $it_point; ?>"> <input type="hidden" name="it_point" value="<?php echo $it_point; ?>">
@ -558,9 +553,9 @@ else
</section> </section>
<!-- 상품설명 end --> <!-- 상품설명 end -->
<section id="sit_ps"> <section id="sit_use">
<h2>용후기</h2> <h2>용후기</h2>
<?php echo pg_anchor('ps'); ?> <?php echo pg_anchor('use'); ?>
<?php <?php
$use_page_rows = 10; // 페이지당 목록수 $use_page_rows = 10; // 페이지당 목록수
@ -568,9 +563,9 @@ else
?> ?>
</section> </section>
<section id="sit_qna"> <section id="sit_qa">
<h2>상품문의</h2> <h2>상품문의</h2>
<?php echo pg_anchor('qna'); ?> <?php echo pg_anchor('qa'); ?>
<?php <?php
$qa_page_rows = 10; // 페이지당 목록수 $qa_page_rows = 10; // 페이지당 목록수

View File

@ -2,7 +2,7 @@
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?> ?>
<section id="sit_qna_list"> <section id="sit_qa_list">
<h3>등록된 상품문의</h3> <h3>등록된 상품문의</h3>
<?php <?php
@ -51,12 +51,12 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$iq_flag = 1; $iq_flag = 1;
} }
if ($i == 0) echo '<ol id="sit_qna_ol">'; if ($i == 0) echo '<ol id="sit_qa_ol">';
?> ?>
<li class="sit_qna_li"> <li class="sit_qa_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> <button type="button" class="sit_qa_li_title" onclick="javascript:qa_menu('sit_qa_con_<?php echo $i; ?>')"><b><?php echo $num; ?>.</b> <?php echo $iq_subject; ?></button>
<dl class="sit_qna_dl"> <dl class="sit_qa_dl">
<dt>작성자</dt> <dt>작성자</dt>
<dd><?php echo $iq_name; ?></dd> <dd><?php echo $iq_name; ?></dd>
<dt>작성일</dt> <dt>작성일</dt>
@ -65,12 +65,12 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<dd><?php echo $iq_stats; ?></dd> <dd><?php echo $iq_stats; ?></dd>
</dl> </dl>
<div id="sit_qna_con_<?php echo $i; ?>" class="sit_qna_con"> <div id="sit_qa_con_<?php echo $i; ?>" class="sit_qa_con">
<p class="sit_qna_qaq"> <p class="sit_qa_qaq">
<strong>문의내용</strong><br> <strong>문의내용</strong><br>
<?php echo $iq_question; // 상품 문의 내용 ?> <?php echo $iq_question; // 상품 문의 내용 ?>
</p> </p>
<p class="sit_qna_qaa"> <p class="sit_qa_qaa">
<strong>답변</strong><br> <strong>답변</strong><br>
<?php echo $iq_answer; ?> <?php echo $iq_answer; ?>
</p> </p>
@ -81,14 +81,14 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<textarea id="tmp_iq_question<?php echo $i; ?>"><?php echo $row['iq_question']; ?></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) { ?> <?php if ($row['mb_id'] == $member['mb_id'] && $iq_answer == 0) { ?>
<div class="sit_qna_cmd"> <div class="sit_qa_cmd">
<button type="button" onclick="javascript:itemqa_update(<?php echo $i; ?>);" class="btn01">수정</button> <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> <button type="button" onclick="javascript:itemqa_delete(fitemqa_password<?php echo $i; ?>, <?php echo $i; ?>);" class="btn01">삭제</button>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div id="sit_qna_pw_<?php echo $i; ?>" class="sit_qna_pw"> <div id="sit_qa_pw_<?php echo $i; ?>" class="sit_qa_pw">
<form name="fitemqa_password<?php echo $i; ?>" method="post" action="./itemqaupdate.php" autocomplete="off"> <form name="fitemqa_password<?php echo $i; ?>" method="post" action="./itemqaupdate.php" autocomplete="off">
<input type="hidden" name="w" value=""> <input type="hidden" name="w" value="">
<input type="hidden" name="iq_id" value=""> <input type="hidden" name="iq_id" value="">
@ -109,11 +109,11 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?> ?>
</section> </section>
<div id="sit_qna_wbtn"> <div id="sit_qa_wbtn">
<button type="button" id="iq_write" class="btn_submit" onclick="javascript:itemqa_insert();">상품문의 쓰기</button> <button type="button" id="iq_write" class="btn_submit" onclick="javascript:itemqa_insert();">상품문의 쓰기</button>
</div> </div>
<section id="sit_qna_w"> <section id="sit_qa_w">
<h3>상품문의 작성</h3> <h3>상품문의 작성</h3>
<form name="fitemqa" method="post" onsubmit="return fitemqa_submit(this);" autocomplete="off"> <form name="fitemqa" method="post" onsubmit="return fitemqa_submit(this);" autocomplete="off">
@ -185,7 +185,7 @@ if (!g4_is_member) {
*/ */
var f = document.fitemqa; var f = document.fitemqa;
var id = document.getElementById('sit_qna_w'); var id = document.getElementById('sit_qa_w');
id.style.display = 'block'; id.style.display = 'block';
@ -204,7 +204,7 @@ f.iq_question.value = '';
function itemqa_update(idx) function itemqa_update(idx)
{ {
var f = document.fitemqa; var f = document.fitemqa;
var id = document.getElementById('sit_qna_w'); var id = document.getElementById('sit_qa_w');
id.style.display = 'block'; id.style.display = 'block';
@ -221,7 +221,7 @@ f.iq_question.value = document.getElementById('tmp_iq_question'+idx).value;
function itemqa_delete(f, idx) function itemqa_delete(f, idx)
{ {
var id = document.getElementById('sit_qna_w'); var id = document.getElementById('sit_qa_w');
f.w.value = 'd'; f.w.value = 'd';
f.iq_id.value = document.getElementById('tmp_iq_id'+idx).value; f.iq_id.value = document.getElementById('tmp_iq_id'+idx).value;

65
shop/ordercoupon.php Normal file
View File

@ -0,0 +1,65 @@
<?php
include_once('./_common.php');
if($is_guest)
exit;
$amount = $_POST['amount'];
// 쿠폰정보
$sql = " select *
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_method = '2'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_minimum <= '$amount' ";
$result = sql_query($sql);
$count = mysql_num_rows($result);
?>
<div id="od_coupon_frm">
<?php if($count > 0) { ?>
<ul>
<li>
<span>쿠폰명</span>
<span>할인금액</span>
<span>적용</span>
</li>
<?php
for($i=0; $row=sql_fetch_array($result); $i++) {
$dc = 0;
if($row['cp_type']) {
$dc = floor(($amount * ($row['cp_amount'] / 100)) / $row['cp_trunc']) * $row['cp_trunc'];
} else {
$dc = $row['cp_amount'];
}
if($row['cp_maximum'] && $dc > $row['cp_maximum'])
$dc = $row['cp_maximum'];
?>
<li>
<input type="hidden" name="o_cp_id[]" value="<?php echo $row['cp_id']; ?>">
<input type="hidden" name="o_cp_amt[]" value="<?php echo $dc; ?>">
<input type="hidden" name="o_cp_subj[]" value="<?php echo $row['cp_subject']; ?>">
<span><?php echo get_text($row['cp_subject']); ?></span>
<span><?php echo number_format($dc); ?></span>
<span><button type="button" class="od_cp_apply">적용</button></span>
</li>
<?php
}
?>
</ul>
<?php
} else {
echo '사용할 수 있는 쿠폰이 없습니다.';
}
?>
<div>
<button type="button" id="od_coupon_close">닫기</button>
<?php if($count > 0) { ?>
<button type="button" id="od_coupon_cancel">쿠폰적용취소</button>
<?php } ?>
</div>
</div>

View File

@ -28,106 +28,278 @@ include_once('./_head.php');
// 새로운 주문번호 생성 // 새로운 주문번호 생성
$od_id = get_uniqid(); $od_id = get_uniqid();
set_session('ss_order_uniqid', $od_id); set_session('ss_order_uniqid', $od_id);
$s_uq_id = $tmp_uq_id;
$order_action_url = G4_HTTPS_SHOP_URL.'/orderformupdate.php';
if (file_exists('./settle_'.$default['de_card_pg'].'.inc.php')) {
include './settle_'.$default['de_card_pg'].'.inc.php';
}
?> ?>
<div id="sod_frm"> <?php
/* ============================================================================== */
/* = Javascript source Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = -------------------------------------------------------------------------- = */
?>
<script src="<?php echo $g_conf_js_url; ?>"></script>
<?php
/* = -------------------------------------------------------------------------- = */
/* = Javascript source Include END = */
/* ============================================================================== */
?>
<script>
/* 플러그인 설치(확인) */
StartSmartUpdate();
<?php /* 해당 스크립트는 타브라우져에서 적용이 되지 않습니다.
$s_page = 'orderform.php'; if( document.Payplus.object == null )
$s_uq_id = $tmp_uq_id; {
openwin = window.open( "chk_plugin.html", "chk_plugin", "width=420, height=100, top=300, left=300" );
}
*/
echo '<p>주문하실 상품을 확인하세요.</p>'; /* Payplus Plug-in 실행 */
include_once('./cartsub.inc.php'); function jsf__pay( form )
{
var RetVal = false;
if (file_exists('./settle_'.$default['de_card_pg'].'.inc.php')) { /* Payplus Plugin 실행 */
include './settle_'.$default['de_card_pg'].'.inc.php'; if ( MakePayMessage( form ) == true )
{
openwin = window.open( "./kcp/proc_win.html", "proc_win", "width=449, height=209, top=300, left=300" );
RetVal = true ;
} }
$good_mny = (int)$tot_sell_amount + (int)$send_cost; else
$order_action_url = G4_HTTPS_SHOP_URL.'/orderformupdate.php';
?>
<?php
/* ============================================================================== */
/* = Javascript source Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = -------------------------------------------------------------------------- = */
?>
<script src="<?php echo $g_conf_js_url; ?>"></script>
<?php
/* = -------------------------------------------------------------------------- = */
/* = Javascript source Include END = */
/* ============================================================================== */
?>
<script>
/* 플러그인 설치(확인) */
StartSmartUpdate();
/* 해당 스크립트는 타브라우져에서 적용이 되지 않습니다.
if( document.Payplus.object == null )
{ {
openwin = window.open( "chk_plugin.html", "chk_plugin", "width=420, height=100, top=300, left=300" ); /* res_cd와 res_msg변수에 해당 오류코드와 오류메시지가 설정됩니다.
} ex) 고객이 Payplus Plugin에서 취소 버튼 클릭시 res_cd=3001, res_msg=사용자 취소
*/ 값이 설정됩니다.
/* Payplus Plug-in 실행 */
function jsf__pay( form )
{
var RetVal = false;
/* Payplus Plugin 실행 */
if ( MakePayMessage( form ) == true )
{
openwin = window.open( "./kcp/proc_win.html", "proc_win", "width=449, height=209, top=300, left=300" );
RetVal = true ;
}
else
{
/* res_cd와 res_msg변수에 해당 오류코드와 오류메시지가 설정됩니다.
ex) 고객이 Payplus Plugin에서 취소 버튼 클릭시 res_cd=3001, res_msg=사용자 취소
값이 설정됩니다.
*/
res_cd = document.forderform.res_cd.value ;
res_msg = document.forderform.res_msg.value ;
}
return RetVal ;
}
// Payplus Plug-in 설치 안내
function init_pay_button()
{
/*
if( document.Payplus.object == null )
document.getElementById("display_setup_message").style.display = "block" ;
else
document.getElementById("display_pay_button").style.display = "block" ;
*/ */
// 체크 방법이 변경 res_cd = document.forderform.res_cd.value ;
if( GetPluginObject() == null ){ res_msg = document.forderform.res_msg.value ;
document.getElementById("display_setup_message").style.display = "block" ;
}
else{
document.getElementById("display_pay_button").style.display = "block" ;
}
} }
/* return RetVal ;
* 인터넷 익스플로러와 파이어폭스(사파리, 크롬.. 등등)는 javascript 파싱법이 틀리기 때문에 object 가 인식 전에 실행 되는 문제 }
* 기존에는 onload 부분에 추가를 했지만 setTimeout 부분에 추가
* setTimeout 에 2번째 변수 0은 딜레이 시간 0은 딜래이 없음을 의미 // Payplus Plug-in 설치 안내
* - 김민수 - 20101018 - function init_pay_button()
*/ {
setTimeout("init_pay_button();",300); /*
</script> if( document.Payplus.object == null )
document.getElementById("display_setup_message").style.display = "block" ;
else
document.getElementById("display_pay_button").style.display = "block" ;
*/
// 체크 방법이 변경
if( GetPluginObject() == null ){
document.getElementById("display_setup_message").style.display = "block" ;
}
else{
document.getElementById("display_pay_button").style.display = "block" ;
}
}
/*
* 인터넷 익스플로러와 파이어폭스(사파리, 크롬.. 등등)는 javascript 파싱법이 틀리기 때문에 object 가 인식 전에 실행 되는 문제
* 기존에는 onload 부분에 추가를 했지만 setTimeout 부분에 추가
* setTimeout 에 2번째 변수 0은 딜레이 시간 0은 딜래이 없음을 의미
* - 김민수 - 20101018 -
*/
setTimeout("init_pay_button();",300);
</script>
<form name="forderform" method="post" action="<?php echo $order_action_url; ?>" onsubmit="return forderform_check(this);" autocomplete="off">
<div id="sod_frm">
<p>주문하실 상품을 확인하세요.</p>
<table class="basic_tbl">
<thead>
<tr>
<th scope="col">상품이미지</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
$tot_point = 0;
$tot_sell_amount = 0;
$goods = $goods_it_id = "";
$goods_count = -1;
// $s_uq_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
b.ca_id,
b.ca_id2,
b.ca_id3
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and a.ct_time > '$ctime' ";
}
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$good_info = '';
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_point * ct_qty) as point,
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
$sum = sql_fetch($sql);
if (!$goods)
{
//$goods = addslashes($row[it_name]);
//$goods = get_text($row[it_name]);
$goods = preg_replace("/\'|\"|\||\,|\&|\;/", "", $row['it_name']);
$goods_it_id = $row['it_id'];
}
$goods_count++;
// 에스크로 상품정보
if($default['de_escrow_use']) {
if ($i>0)
$good_info .= chr(30);
$good_info .= "seq=".($i+1).chr(31);
$good_info .= "ordr_numb={$od_id}_".sprintf("%04d", $i).chr(31);
$good_info .= "good_name=".addslashes($row['it_name']).chr(31);
$good_info .= "good_cntx=".$row['ct_qty'].chr(31);
$good_info .= "good_amtx=".$row['ct_price'].chr(31);
}
$image = get_it_image($row['it_id'], 50, 50);
$it_name = '<b>' . stripslashes($row['it_name']) . '</b>';
$it_options = print_item_options($row['it_id'], $s_uq_id);
if($it_options) {
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';
}
$point = $sum['point'];
$sell_amount = $sum['price'];
// 쿠폰
if($is_member) {
$cp_button = '';
$sql = " select count(*) as cnt
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_used = '0'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and (
( cp_method = '0' and cp_target = '{$row['it_id']}' )
OR
( cp_method = '1' and ( cp_target IN ( '{$row['ca_id']}', '{$row['ca_id2']}', '{$row['ca_id3']}' ) ) )
) ";
$cp = sql_fetch($sql);
if($cp['cnt'])
$cp_button = '<button type="button" class="it_coupon_btn">적용</button>';
}
?>
<tr>
<td class="sod_bsk_img"><?php echo $image; ?></td>
<td>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<input type="hidden" name="it_amount[<?php echo $i; ?>]" value="<?php echo $sell_amount; ?>">
<input type="hidden" name="cp_id[<?php echo $i; ?>]" value="">
<input type="hidden" name="cp_amount[<?php echo $i; ?>]" value="0">
<?php echo $it_name.$mod_options; ?>
</td>
<td class="td_num"><?php echo number_format($sum['qty']); ?></td>
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
<td><?php echo $cp_button; ?></td>
<td class="td_bignum"><span class="ct_sell_amount"><?php echo number_format($sell_amount); ?></span></td>
<td class="td_bignum"><?php echo number_format($point); ?></td>
</tr>
<?php
$tot_point += $point;
$tot_sell_amount += $sell_amount;
} // for 끝
if ($i == 0) {
echo '<tr><td colspan="7" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
} else {
// 배송비 계산
if ($default['de_send_cost_case'] == '없음')
$send_cost = 0;
else {
// 배송비 상한 : 여러단계의 배송비 적용 가능
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
$send_cost_list = explode(";", $default['de_send_cost_list']);
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < $send_cost_limit[$k]) {
$send_cost = $send_cost_list[$k];
break;
}
}
}
}
?>
</tbody>
</table>
<?php if ($goods_count) $goods .= ' 외 '.$goods_count.'건'; ?>
<?php
// 배송비가 0 보다 크다면 (있다면)
if ($send_cost > 0)
{
?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span>
<strong><?php echo number_format($send_cost); ?> 원</strong>
</div>
<?php } ?>
<?php
// 총계 = 주문상품금액합계 + 배송비
$tot_amount = $tot_sell_amount + $send_cost;
if ($tot_amount > 0) {
?>
<div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>총계</span>
<strong><span id="ct_tot_amount"><?php echo number_format($tot_amount); ?></span> 원 <?php echo number_format($tot_point); ?> 점</strong>
</div>
<?php } ?>
<form name="forderform" method="post" action="<?php echo $order_action_url; ?>" onsubmit="return forderform_check(this);" autocomplete="off">
<input type="hidden" name="od_amount" value="<?php echo $tot_sell_amount; ?>"> <input type="hidden" name="od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="org_od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>"> <input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="org_send_cost" value="<?php echo $send_cost; ?>">
<?php <?php
/* ============================================================================== */ /* ============================================================================== */
@ -152,7 +324,7 @@ set_session('ss_order_uniqid', $od_id);
<input type="hidden" name="pay_method" value=""> <input type="hidden" name="pay_method" value="">
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>"> <input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<input type="hidden" name="good_name" value="<?php echo $goods; ?>"> <input type="hidden" name="good_name" value="<?php echo $goods; ?>">
<input type="hidden" name="good_mny" value="<?php echo $good_mny; ?>"> <input type="hidden" name="good_mny" value="<?php echo $tot_amount; ?>">
<input type="hidden" name="buyr_name" value=""> <input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_mail" value=""> <input type="hidden" name="buyr_mail" value="">
<input type="hidden" name="buyr_tel1" value=""> <input type="hidden" name="buyr_tel1" value="">
@ -473,9 +645,64 @@ set_session('ss_order_uniqid', $od_id);
</table> </table>
</section> </section>
<?php
if($is_member) {
// 주문쿠폰
$sql = " select count(*) as cnt
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_method = '2'
and cp_start <= '".G4_TIM_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0' ";
$row = sql_fetch($sql);
$oc_cnt = $row['cnt'];
if($send_cost > 0) {
// 배송비쿠폰
$sql = " select count(*) as cnt
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_method = '3'
and cp_start <= '".G4_TIM_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0' ";
$row = sql_fetch($sql);
$sc_cnt = $row['cnt'];
}
}
?>
<section id="sod_frm_pay"> <section id="sod_frm_pay">
<h2>결제정보</h2> <h2>결제정보</h2>
<table class="frm_tbl">
<tbody>
<?php if($oc_cnt > 0) { ?>
<tr>
<th scope="row">결제할인쿠폰</th>
<td>
<input type="hidden" name="od_cp_id" value="">
<button type="button" id="od_coupon_btn">쿠폰적용</button>
</td>
</tr>
<?php } ?>
<?php if($sc_cnt > 0) { ?>
<tr>
<th scope="row">배송비할인쿠폰</th>
<td>
<input type="hidden" name="sc_cp_id" value="">
<button type="button" id="sc_coupon_btn">쿠폰적용</button>
</td>
</tr>
<?php } ?>
<tr>
<th>총 주문금액</th>
<td><span id="od_tot_amount"><?php echo number_format($tot_amount); ?></span>원</td>
</tr>
</tbody>
</table>
<?php <?php
if (!$default['de_card_point']) if (!$default['de_card_point'])
echo '<p><strong>무통장입금</strong> 이외의 결제 수단으로 결제하시는 경우 포인트를 적립해드리지 않습니다.</p>'; echo '<p><strong>무통장입금</strong> 이외의 결제 수단으로 결제하시는 경우 포인트를 적립해드리지 않습니다.</p>';
@ -543,7 +770,8 @@ set_session('ss_order_uniqid', $od_id);
if ($temp_point > $member_mileage) if ($temp_point > $member_mileage)
$temp_point = $member_mileage; $temp_point = $member_mileage;
?> ?>
<p>보유마일리지(<?php echo display_point($member['mb_mileage']); ?>)중 <strong>최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p> <p>보유마일리지(<?php echo display_point($member['mb_mileage']); ?>)중 <strong id="use_max_point">최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p>
<input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">
<label for="od_temp_point">사용 포인트</label> <label for="od_temp_point">사용 포인트</label>
<input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.) <input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.)
<?php <?php
@ -564,7 +792,8 @@ set_session('ss_order_uniqid', $od_id);
if ($temp_point > $member_point) if ($temp_point > $member_point)
$temp_point = $member_point; $temp_point = $member_point;
?> ?>
<p>보유포인트(<?php echo display_point($member['mb_point']); ?>)중 <strong>최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p> <p>보유포인트(<?php echo display_point($member['mb_point']); ?>)중 <strong id="use_max_point">최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p>
<input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">
<label for="od_temp_point">사용 포인트</label> <label for="od_temp_point">사용 포인트</label>
<input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.) <input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.)
<?php <?php
@ -674,6 +903,275 @@ set_session('ss_order_uniqid', $od_id);
</div> </div>
<script> <script>
$(function() {
var $cp_btn_el;
var $cp_row_el;
$(".it_coupon_btn").click(function() {
$cp_btn_el = $(this);
$cp_row_el = $(this).closest("tr");
$("#it_coupon_frm").remove();
var it_id = $cp_btn_el.closest("tr").find("input[name^=it_id]").val();
$.post(
"./orderitemcoupon.php",
{ it_id: it_id },
function(data) {
$cp_btn_el.after(data);
}
);
});
$(".cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='f_cp_id[]']").val();
var amount = $el.find("input[name='f_cp_amt[]']").val();
var subj = $el.find("input[name='f_cp_subj[]']").val();
var sell_amount;
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
// 이미 사용한 쿠폰이 있는지
var cp_dup = false;
var cp_dup_idx;
var $cp_dup_el;
$("input[name^=cp_id]").each(function(index) {
var id = $(this).val();
if(id == cp_id) {
cp_dup_idx = index;
cp_dup = true;
$cp_dup_el = $(this).closest("tr");;
return false;
}
});
if(cp_dup) {
var it_name = $("input[name='it_name["+cp_dup_idx+"]']").val();
if(!confirm(subj+ "쿠폰은 "+it_name+"에 사용되었습니다.\n"+it_name+"의 쿠폰을 취소한 후 적용하시겠습니까?")) {
return false;
} else {
coupon_cancel($cp_dup_el);
}
}
var $s_el = $cp_row_el.find(".ct_sell_amount");;
sell_amount = parseInt($cp_row_el.find("input[name^=it_amount]").val());
sell_amount = sell_amount - parseInt(amount);
$s_el.text(number_format(String(sell_amount)));
$cp_row_el.find("input[name^=cp_id]").val(cp_id);
$cp_row_el.find("input[name^=cp_amount]").val(amount);
calculate_total_amount();
$("#it_coupon_frm").remove();
$cp_btn_el.focus();
});
$("#it_coupon_close").live("click", function() {
$("#it_coupon_frm").remove();
$cp_btn_el.focus();
});
$("#it_coupon_cancel").live("click", function() {
coupon_cancel($cp_row_el);
calculate_total_amount();
$("#it_coupon_frm").remove();
$cp_btn_el.focus();
});
$("#od_coupon_btn").click(function() {
$("#od_coupon_frm").remove();
var $this = $(this);
var amount = parseInt($("input[name=org_od_amount]").val());
var send_cost = parseInt($("input[name=org_send_cost]").val());
$.post(
"./ordercoupon.php",
{ amount: amount },
function(data) {
$this.after(data);
}
);
});
$(".od_cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='o_cp_id[]']").val();
var amount = parseInt($el.find("input[name='o_cp_amt[]']").val());
var subj = $el.find("input[name='o_cp_subj[]']").val();
var od_amount = parseInt($("input[name=org_od_amount]").val());
var send_cost = $("input[name=org_send_cost]").val();
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
$("input[name=od_send_cost]").val(send_cost);
$("input[name=sc_cp_id]").val("");
$("input[name=od_amount]").val(od_amount - amount);
$("input[name=od_cp_id]").val(cp_id);
calculate_order_amount();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#od_coupon_close").live("click", function() {
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#od_coupon_cancel").live("click", function() {
var org_amount = $("input[name=org_od_amount]").val();
$("input[name=od_amount]").val(org_amount);
calculate_order_amount();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#sc_coupon_btn").click(function() {
$("#sc_coupon_frm").remove();
var $this = $(this);
var amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=org_send_cost]").val());
$.post(
"./ordersendcostcoupon.php",
{ amount: (amount + send_cost), send_cost: send_cost },
function(data) {
$this.after(data);
}
);
});
$(".sc_cp_apply").live("click", function() {
var $el = $(this).closest("li");
var cp_id = $el.find("input[name='s_cp_id[]']").val();
var amount = parseInt($el.find("input[name='s_cp_amt[]']").val());
var subj = $el.find("input[name='s_cp_subj[]']").val();
var send_cost = parseInt($("input[name=org_send_cost]").val());
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
$("input[name=od_send_cost]").val(send_cost - amount);
$("input[name=sc_cp_id]").val(cp_id);
calculate_order_amount();
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#sc_coupon_close").live("click", function() {
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#sc_coupon_cancel").live("click", function() {
var send_cost = $("input[name=org_send_cost]").val();
$("input[name=od_send_cost]").val(send_cost);
calculate_order_amount();
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#od_settle_bank").bind("click", function() {
$("[name=od_deposit_name]").val( $("[name=od_b_name]").val() );
$("#settle_bank").show();
});
$("#od_settle_iche,#od_settle_card,#od_settle_vbank,#od_settle_hp").bind("click", function() {
$("#settle_bank").hide();
});
});
function coupon_cancel($el)
{
var $dup_sell_el = $el.find(".ct_sell_amount");
var $dup_amount_el = $el.find("input[name^=cp_amount]");
var org_sell_amount = $el.find("input[name^=it_amount]").val();
$dup_sell_el.text(number_format(String(org_sell_amount)));
$dup_amount_el.val(0);
$el.find("input[name^=cp_id]").val("");
}
function calculate_total_amount()
{
var $it_amt = $("input[name^=it_amount]");
var $cp_amt = $("input[name^=cp_amount]");
var tot_sell_amount = sell_amount = 0;
var it_amount, cp_amount;
var send_cost = parseInt($("input[name=org_send_cost]").val());
$it_amt.each(function(index) {
it_amount = parseInt($(this).val());
cp_amount = parseInt($cp_amt.eq(index).val());
sell_amount += (it_amount - cp_amount);
});
tot_sell_amount = sell_amount + send_cost;
$("#ct_tot_amount").text(number_format(String(tot_sell_amount)));
$("input[name=good_mny]").val(tot_sell_amount);
$("input[name=od_amount]").val(sell_amount);
$("input[name=org_od_amount]").val(sell_amount);
$("input[name=od_send_cost]").val(send_cost);
<?php if($od_cnt > 0) { ?>
$("input[name=od_cp_id]").val("");
<?php } ?>
<?php if($sc_cnt > 0) { ?>
$("input[name=sc_cp_id]").val("");
<?php } ?>
$("input[name=od_temp_point]").val(0);
<?php if($temp_point > 0 && $is_member) { ?>
calculate_temp_point();
<?php } ?>
calculate_order_amount();
}
function calculate_order_amount()
{
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var tot_amount = sell_amount + send_cost;
$("input[name=good_mny]").val(tot_amount);
$("#od_tot_amount").text(number_format(String(tot_amount)));
<?php if($temp_point > 0 && $is_member) { ?>
calculate_temp_point();
<?php } ?>
}
function calculate_temp_point()
{
<?php
if($default['de_mileage_use']) {
$point = (int)$member_mileage;
} else {
$point = (int)$member_point;
}
?>
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var point_per = <?php echo $default['de_point_per']; ?>;
var temp_point = parseInt((sell_amount + send_cost) * (point_per / 100) / 100) * 100;
var point = <?php echo $point; ?>
if(temp_point > point)
temp_point = point;
$("#use_max_point").text("최대 "+number_format(String(temp_point))+"점");
$("input[name=max_temp_point]").val(temp_point);
}
function forderform_check(f) function forderform_check(f)
{ {
errmsg = ""; errmsg = "";
@ -748,7 +1246,9 @@ function forderform_check(f)
} }
var tot_amount = <?php echo (int)$tot_amount; ?>; var tot_amount = <?php echo (int)$tot_amount; ?>;
var max_point = <?php echo (int)$temp_point; ?>; var max_point = 0;
if (typeof(f.max_temp_point) != "undefined")
max_point = parseInt(f.max_temp_point.value);
var temp_point = 0; var temp_point = 0;
if (typeof(f.od_temp_point) != "undefined") { if (typeof(f.od_temp_point) != "undefined") {
@ -756,20 +1256,30 @@ function forderform_check(f)
{ {
temp_point = parseInt(f.od_temp_point.value); temp_point = parseInt(f.od_temp_point.value);
<?php
if($default['de_mileage_use']) {
$mb_point = $member['mb_mileage'];
$p_msg = '마일리지';
} else {
$mb_point = $member['mb_point'];
$p_msg = '포인트';
}
?>
if (temp_point < 0) { if (temp_point < 0) {
alert("포인트를 0 이상 입력하세요."); alert("<?php echo $p_msg; ?>를 0 이상 입력하세요.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
if (temp_point > tot_amount) { if (temp_point > tot_amount) {
alert("주문금액 보다 많이 포인트결제할 수 없습니다."); alert("주문금액 보다 많이 <?php echo $p_msg; ?>결제할 수 없습니다.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
if (temp_point > <?php echo (int)$member['mb_point']; ?>) { if (temp_point > <?php echo (int)$mb_point; ?>) {
alert("회원님의 포인트보다 많이 결제할 수 없습니다."); alert("회원님의 <?php echo $p_msg; ?>보다 많이 결제할 수 없습니다.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
@ -781,7 +1291,7 @@ function forderform_check(f)
} }
if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) { if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) {
alert("포인트를 100점 단위로 입력하세요."); alert("<?php echo $p_msg; ?>를 100점 단위로 입력하세요.");
f.od_temp_point.select(); f.od_temp_point.select();
return false; return false;
} }
@ -875,17 +1385,6 @@ function gumae2baesong(f)
f.od_b_addr1.value = f.od_addr1.value; f.od_b_addr1.value = f.od_addr1.value;
f.od_b_addr2.value = f.od_addr2.value; f.od_b_addr2.value = f.od_addr2.value;
} }
$(function() {
$("#od_settle_bank").bind("click", function() {
$("[name=od_deposit_name]").val( $("[name=od_b_name]").val() );
$("#settle_bank").show();
});
$("#od_settle_iche,#od_settle_card,#od_settle_vbank,#od_settle_hp").bind("click", function() {
$("#settle_bank").hide();
});
});
</script> </script>
<?php <?php

View File

@ -3,11 +3,15 @@ include_once('./_common.php');
if(get_magic_quotes_gpc()) if(get_magic_quotes_gpc())
{ {
$_GET = array_map("stripslashes", $_GET); //$_GET = array_map("stripslashes", $_GET);
$_POST = array_map("stripslashes", $_POST); //$_POST = array_map("stripslashes", $_POST);
$_GET = array_add_callback("stripslashes", $_GET);
$_POST = array_add_callback("stripslashes", $_POST);
} }
$_GET = array_map("mysql_real_escape_string", $_GET); //$_GET = array_map("mysql_real_escape_string", $_GET);
$_POST = array_map("mysql_real_escape_string", $_POST); //$_POST = array_map("mysql_real_escape_string", $_POST);
$_GET = array_add_callback("mysql_real_escape_string", $_GET);
$_POST = array_add_callback("mysql_real_escape_string", $_POST);
// 장바구니가 비어있는가? // 장바구니가 비어있는가?
if (get_session("ss_direct")) if (get_session("ss_direct"))
@ -57,7 +61,106 @@ $i_temp_point = (int)$_POST['od_temp_point'];
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' "; from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if ((int)$row['od_amount'] !== $i_amount) { $tot_ct_amount = $row['od_amount'];
// 쿠폰금액계산
$tot_cp_amount = 0;
if($is_member) {
// 상품쿠폰
$tot_it_cp_amount = $tot_od_cp_amount = 0;
$it_cp_cnt = count($_POST['cp_id']);
$arr_it_cp_amt = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $_POST['cp_id'][$i];
$it_id = $_POST['it_id'][$i];
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '$cid'
and mb_id = '{$member['mb_id']}'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_method IN ( 0, 1 ) ";
$cp = sql_fetch($sql);
if(!$cp['cp_id'])
continue;
// 분류할인인지
if($cp['cp_method']) {
$sql2 = " select it_id, ca_id, ca_id2, ca_id3
from {$g4['shop_item_table']}
where it_id = '$it_id' ";
$row2 = sql_fetch($sql2);
if(!$row2['it_id'])
continue;
if($row2['ca_id'] != $cp['cp_target'] && $row2['ca_id2'] != $cp['cp_target'] && $row2['ca_id3'] != $cp['cp_target'])
continue;
} else {
if($cp['cp_target'] != $it_id)
continue;
}
// 상품금액
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
and it_id = '$it_id' ";
$ct = sql_fetch($sql);
$item_price = $ct['sum_price'];
if($cp['cp_minimum'] > $item_price)
continue;
$dc = 0;
if($cp['cp_type']) {
$dc = floor(($item_price * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
$tot_it_cp_amount += $dc;
$arr_it_cp_amt[$it_id] = $dc;
}
$tot_od_amount = $tot_ct_amount - $tot_it_cp_amount;
// 주문쿠폰
if($_POST['od_cp_id']) {
$sql = " select cp_id, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '{$_POST['od_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_method = '2' ";
$cp = sql_fetch($sql);
$dc = 0;
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_amount)) {
if($cp['cp_type']) {
$dc = floor(($tot_od_amount * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
$tot_od_cp_amount = $dc;
$tot_od_amount -= $tot_od_cp_amount;
}
}
$tot_cp_amount = $tot_it_cp_amount + $tot_od_cp_amount;
}
if ((int)($row['od_amount'] - $tot_cp_amount) !== $i_amount) {
die("Error."); die("Error.");
} }
@ -79,12 +182,46 @@ if ($default['de_send_cost_case'] == "없음") {
} }
} }
} }
if ((int)$send_cost !== $i_send_cost) {
$tot_sc_cp_amount = 0;
if($is_member && $send_cost > 0) {
// 배송쿠폰
if($_POST['sc_cp_id']) {
$sql = " select cp_id, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '{$_POST['sc_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_method = '3' ";
$cp = sql_fetch($sql);
$dc = 0;
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_amount)) {
if($cp['cp_type']) {
$dc = floor(($tot_od_amount * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
if($dc > $send_cost)
$dc = $send_cost;
$tot_sc_cp_amount = $dc;
}
}
}
if ((int)($send_cost - $tot_sc_cp_amount) !== $i_send_cost) {
die("Error.."); die("Error..");
} }
// 결제포인트가 상이함 // 결제포인트가 상이함
$tot_amount = $tot_sell_amount + $send_cost; $tot_amount = $tot_od_amount + ($send_cost - $tot_sc_cp_amount);
// 회원이면서 포인트사용이면 // 회원이면서 포인트사용이면
$temp_point = 0; $temp_point = 0;
if($default['de_mileage_use']) { if($default['de_mileage_use']) {
@ -253,6 +390,8 @@ $sql = " insert {$g4['shop_order_table']}
od_deposit_name = '$od_deposit_name', od_deposit_name = '$od_deposit_name',
od_memo = '$od_memo', od_memo = '$od_memo',
od_send_cost = '$od_send_cost', od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_coupon = '$tot_od_cp_amount',
od_temp_bank = '$od_temp_bank', od_temp_bank = '$od_temp_bank',
od_temp_card = '$od_receipt_card', od_temp_card = '$od_receipt_card',
od_temp_hp = '$od_receipt_hp', od_temp_hp = '$od_receipt_hp',
@ -324,6 +463,55 @@ include_once(G4_SHOP_PATH.'/kcp/pp_ax_hub_result.php');
$od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;"; $od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;";
// 쿠폰사용내역기록
if($is_member) {
$it_cp_cnt = count($_POST['cp_id']);
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $_POST['cp_id'][$i];
$cp_it_id = $_POST['it_id'][$i];
$sql = " update {$g4['shop_coupon_table']}
set od_id = '$od_id',
cp_used = '1',
cp_used_time = '".G4_TIME_YMDHIS."'
where cp_id = '$cid'
and mb_id = '{$member['mb_id']}'
and cp_method IN ( 0, 1 ) ";
sql_query($sql);
// 쿠폰사용금액 cart에 기록
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
$sql = " update {$g4['shop_cart_table']}
set cp_amount = '$cp_amt'
where uq_id = '$tmp_uq_id'
and it_id = '$cp_it_id'
and ct_num = '0' ";
sql_query($sql);
}
if($_POST['od_cp_id']) {
$sql = " update {$g4['shop_coupon_table']}
set od_id = '$od_id',
cp_used = '1',
cp_used_time = '".G4_TIME_YMDHIS."'
where cp_id = '{$_POST['od_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_method = '2' ";
sql_query($sql);
}
if($_POST['sc_cp_id']) {
$sql = " update {$g4['shop_coupon_table']}
set od_id = '$od_id',
cp_used = '1',
cp_used_time = '".G4_TIME_YMDHIS."'
where cp_id = '{$_POST['sc_cp_id']}'
and mb_id = '{$member['mb_id']}'
and cp_method = '3' ";
sql_query($sql);
}
}
include_once(G4_SHOP_PATH.'/ordermail1.inc.php'); include_once(G4_SHOP_PATH.'/ordermail1.inc.php');
include_once(G4_SHOP_PATH.'/ordermail2.inc.php'); include_once(G4_SHOP_PATH.'/ordermail2.inc.php');

View File

@ -13,6 +13,7 @@ if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
<th scope="col">주문일시</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>
<th scope="col">입금액</th> <th scope="col">입금액</th>
<th scope="col">미입금액</th> <th scope="col">미입금액</th>
</tr> </tr>
@ -40,6 +41,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
<td><?php echo substr($row['od_time'],0,16); ?> (<?php echo get_yoil($row['od_time']); ?>)</td> <td><?php echo substr($row['od_time'],0,16); ?> (<?php echo get_yoil($row['od_time']); ?>)</td>
<td class="td_bignum"><?php echo $row['itemcount']; ?></td> <td class="td_bignum"><?php echo $row['itemcount']; ?></td>
<td class="td_bignum"><?php echo display_price($row['orderamount']); ?></td> <td class="td_bignum"><?php echo display_price($row['orderamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['couponamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['receiptamount']); ?></td> <td class="td_bignum"><?php echo display_price($row['receiptamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['misu']); ?></td> <td class="td_bignum"><?php echo display_price($row['misu']); ?></td>
</tr> </tr>

View File

@ -56,7 +56,7 @@ if(openwin != null) {
<dd>상품 배송이 완료되었습니다.</dd> <dd>상품 배송이 완료되었습니다.</dd>
</dl> </dl>
<?php <?php
$sql = " select it_id, it_name $sql = " select it_id, it_name, cp_amount
from {$g4['shop_cart_table']} from {$g4['shop_cart_table']}
where uq_id = '$uq_id' where uq_id = '$uq_id'
and ct_num = '0' and ct_num = '0'
@ -124,36 +124,63 @@ if(openwin != null) {
</table> </table>
</li> </li>
<?php <?php
$tot_cp_amount += $row['cp_amount'];
} }
$send_cost = $od['od_send_cost']; $send_cost = $od['od_send_cost'];
$send_coupon = $od['od_send_coupon'];
$org_send_cost = $send_cost + $send_coupon;
?> ?>
</ul> </ul>
<?php <?php
// 배송비가 0 보다 크다면 (있다면) // 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인
if ($send_cost > 0) $od_coupon = $od['od_coupon'];
{ $tot_amount = $tot_sell_amount + $send_cost - $tot_cp_amount - $od_coupon;
?> ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot"> <div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span> <span>주문총액</span>
<strong><?php echo number_format($send_cost); ?> 원</strong> <strong><?php echo number_format($tot_sell_amount); ?> 원</strong>
</div> </div>
<?php if($tot_cp_amount > 0) { ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>상품할인</span>
<strong><?php echo number_format($tot_cp_amount); ?> 원</strong>
</div>
<?php } ?> <?php } ?>
<?php <?php if($od_coupon > 0) { ?>
// 총계 = 주문상품금액합계 + 배송비 <div id="sod_bsk_dvr" class="sod_bsk_tot">
$tot_amount = $tot_sell_amount + $send_cost; <span>결제할인</span>
if ($tot_amount > 0) { <strong><?php echo number_format($od_coupon); ?> 원</strong>
?> </div>
<?php } ?>
<?php if ($org_send_cost > 0) { ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비</span>
<strong><?php echo number_format($org_send_cost); ?> 원</strong>
</div>
<?php } ?>
<?php if($send_coupon > 0) { ?>
<div id="sod_bsk_dvr" class="sod_bsk_tot">
<span>배송비할인</span>
<strong><?php echo number_format($send_coupon); ?> 원</strong>
</div>
<?php } ?>
<div id="sod_bsk_cnt" class="sod_bsk_tot"> <div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>총계</span> <span>총계</span>
<strong><?php echo number_format($tot_amount); ?> 원 <?php echo number_format($tot_point); ?> 점</strong> <strong><?php echo number_format($tot_amount); ?> 원</strong>
</div> </div>
<?php } ?> <div id="sod_bsk_cnt" class="sod_bsk_tot">
<span>포인트</span>
<strong><?php echo number_format($tot_point); ?> 점</strong>
</div>
</section> </section>
<div id="sod_fin_view"> <div id="sod_fin_view">

81
shop/orderitemcoupon.php Normal file
View File

@ -0,0 +1,81 @@
<?php
include_once('./_common.php');
if($is_guest)
exit;
// 상품정보
$it_id = $_POST['it_id'];
$sql = " select it_id, ca_id, ca_id2, ca_id3 from {$g4['shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
// 상품 총 금액
$uq_id = get_session('ss_uq_id');
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
and it_id = '$it_id' ";
$ct = sql_fetch($sql);
$item_price = $ct['sum_price'];
// 쿠폰정보
$sql = " select *
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_used = '0'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_minimum <= '$item_price'
and (
( cp_method = '0' and cp_target = '{$it['it_id']}' )
OR
( cp_method = '1' and ( cp_target IN ( '{$it['ca_id']}', '{$it['ca_id2']}', '{$it['ca_id3']}' ) ) )
) ";
$result = sql_query($sql);
$count = mysql_num_rows($result);
?>
<div id="it_coupon_frm">
<?php if($count > 0) { ?>
<ul>
<li>
<span>쿠폰명</span>
<span>할인금액</span>
<span>적용</span>
</li>
<?php
for($i=0; $row=sql_fetch_array($result); $i++) {
$dc = 0;
if($row['cp_type']) {
$dc = floor(($item_price * ($row['cp_amount'] / 100)) / $row['cp_trunc']) * $row['cp_trunc'];
} else {
$dc = $row['cp_amount'];
}
if($row['cp_maximum'] && $dc > $row['cp_maximum'])
$dc = $row['cp_maximum'];
?>
<li>
<input type="hidden" name="f_cp_id[]" value="<?php echo $row['cp_id']; ?>">
<input type="hidden" name="f_cp_amt[]" value="<?php echo $dc; ?>">
<input type="hidden" name="f_cp_subj[]" value="<?php echo $row['cp_subject']; ?>">
<span><?php echo get_text($row['cp_subject']); ?></span>
<span><?php echo number_format($dc); ?></span>
<span><button type="button" class="cp_apply">적용</button></span>
</li>
<?php
}
?>
</ul>
<?php
} else {
echo '사용할 수 있는 쿠폰이 없습니다.';
}
?>
<div>
<button type="button" id="it_coupon_close">닫기</button>
<?php if($count > 0) { ?>
<button type="button" id="it_coupon_cancel">쿠폰적용취소</button>
<?php } ?>
</div>
</div>

View File

@ -45,6 +45,15 @@ $sql = " select b.it_sell_email,
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i=0; $row=sql_fetch_array($result); $i++)
{ {
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_point * ct_qty) as point,
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$tmp_uq_id' ";
$sum = sql_fetch($sql);
// 옵션정보 // 옵션정보
$sql2 = " select ct_option, ct_qty $sql2 = " select ct_option, ct_qty
from {$g4['shop_cart_table']} from {$g4['shop_cart_table']}
@ -68,6 +77,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$list[$i]['it_simg'] = get_it_image($row['it_id'], $default['de_simg_width'], $default['de_simg_height']); $list[$i]['it_simg'] = get_it_image($row['it_id'], $default['de_simg_width'], $default['de_simg_height']);
$list[$i]['it_name'] = $row['it_name']; $list[$i]['it_name'] = $row['it_name'];
$list[$i]['it_opt'] = $options; $list[$i]['it_opt'] = $options;
$list[$i]['ct_price'] = $sum['price'];
$subject = $config['cf_title'].' - 주문 알림 메일 (주문자 '.$od_name.'님)'; $subject = $config['cf_title'].' - 주문 알림 메일 (주문자 '.$od_name.'님)';
ob_start(); ob_start();

View File

@ -0,0 +1,69 @@
<?php
include_once('./_common.php');
if($is_guest)
exit;
$amount = $_POST['amount'];
$send_cost = $_POST['send_cost'];
// 쿠폰정보
$sql = " select *
from {$g4['shop_coupon_table']}
where mb_id = '{$member['mb_id']}'
and cp_method = '3'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_used = '0'
and cp_minimum <= '$amount' ";
$result = sql_query($sql);
$count = mysql_num_rows($result);
?>
<div id="sc_coupon_frm">
<?php if($count > 0) { ?>
<ul>
<li>
<span>쿠폰명</span>
<span>할인금액</span>
<span>적용</span>
</li>
<?php
for($i=0; $row=sql_fetch_array($result); $i++) {
$dc = 0;
if($row['cp_type']) {
$dc = floor(($send_cost * ($row['cp_amount'] / 100)) / $row['cp_trunc']) * $row['cp_trunc'];
} else {
$dc = $row['cp_amount'];
}
if($row['cp_maximum'] && $dc > $row['cp_maximum'])
$dc = $row['cp_maximum'];
if($dc > $send_cost)
$dc = $send_cost;
?>
<li>
<input type="hidden" name="s_cp_id[]" value="<?php echo $row['cp_id']; ?>">
<input type="hidden" name="s_cp_amt[]" value="<?php echo $dc; ?>">
<input type="hidden" name="s_cp_subj[]" value="<?php echo $row['cp_subject']; ?>">
<span><?php echo get_text($row['cp_subject']); ?></span>
<span><?php echo number_format($dc); ?></span>
<span><button type="button" class="sc_cp_apply">적용</button></span>
</li>
<?php
}
?>
</ul>
<?php
} else {
echo '사용할 수 있는 쿠폰이 없습니다.';
}
?>
<div>
<button type="button" id="sc_coupon_close">닫기</button>
<?php if($count > 0) { ?>
<button type="button" id="sc_coupon_cancel">쿠폰적용취소</button>
<?php } ?>
</div>
</div>

View File

@ -115,7 +115,7 @@ if ($is_nogood) $colspan++;
?> ?>
</td> </td>
<td class="td_name"><?php echo $list[$i]['name'] ?></td> <td class="td_name sv_use"><?php echo $list[$i]['name'] ?></td>
<td class="td_date"><?php echo $list[$i]['datetime2'] ?></td> <td class="td_date"><?php echo $list[$i]['datetime2'] ?></td>
<td class="td_num"><?php echo $list[$i]['wr_hit'] ?></td> <td class="td_num"><?php echo $list[$i]['wr_hit'] ?></td>
<?php if ($is_good) { ?><td class="td_num"><?php echo $list[$i]['wr_good'] ?></td><?php } ?> <?php if ($is_good) { ?><td class="td_num"><?php echo $list[$i]['wr_good'] ?></td><?php } ?>

View File

@ -168,8 +168,7 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
</section> </section>
<?php <?php
// SNS 보내기 include(G4_SNS_PATH."/view.sns.skin.php");
include_once($board_skin_path."/view.sns.skin.php");
?> ?>
<?php <?php

View File

@ -12,7 +12,8 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<section id="bo_vc"> <section id="bo_vc">
<h2>댓글목록</h2> <h2>댓글목록</h2>
<?php <?php
for ($i=0; $i<count($list); $i++) { $cmt_amt = count($list);
for ($i=0; $i<$cmt_amt; $i++) {
$comment_id = $list[$i]['wr_id']; $comment_id = $list[$i]['wr_id'];
$cmt_depth = ""; // 댓글단계 $cmt_depth = ""; // 댓글단계
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 20; $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 20;
@ -23,9 +24,11 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
} }
*/ */
$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); $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 이하 사이드뷰 겹침 문제 해결
?> ?>
<article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>> <article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>>
<header> <header style="z-index:<?php echo $cmt_sv; ?>">
<h1><?php echo $list[$i]['wr_name'] ?>님의 댓글</h1> <h1><?php echo $list[$i]['wr_name'] ?>님의 댓글</h1>
<?php echo $list[$i]['name'] ?> <?php echo $list[$i]['name'] ?>
<?php if ($cmt_depth) { ?><img src="<?php echo $board_skin_url ?>/img/icon_reply.gif" class="icon_reply" alt="댓글의 댓글"><?php } ?> <?php if ($cmt_depth) { ?><img src="<?php echo $board_skin_url ?>/img/icon_reply.gif" class="icon_reply" alt="댓글의 댓글"><?php } ?>
@ -35,9 +38,9 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php } ?> <?php } ?>
작성일 작성일
<span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span> <span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span>
<?php if ($list[$i]['wr_facebook_user']) { ?><a href="https://www.facebook.com/profile.php?id=<?php echo $list[$i]['wr_facebook_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/facebook.png" alt="페이스북에도 등록됨"></a><?php } ?> <?php
<?php if ($list[$i]['wr_twitter_user']) { ?><a href="https://www.twitter.com/<?php echo $list[$i]['wr_twitter_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/twitter.png" alt="트위터에도 등록됨"></a><?php } ?> include(G4_SNS_PATH.'/view_comment_list.sns.skin.php');
<?php if ($list[$i]['wr_me2day_user']) { ?><a href="http://me2day.net/<?php echo $list[$i]['wr_me2day_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/me2day.png" alt="미투데이에도 등록됨"></a><?php } ?> ?>
</header> </header>
<!-- 댓글 출력 --> <!-- 댓글 출력 -->
@ -119,8 +122,12 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr> </tr>
<?php } ?> <?php } ?>
<?php <?php
include_once($board_skin_path."/view_comment.sns.skin.php"); include(G4_SNS_PATH."/view_comment_write.sns.skin.php");
?> ?>
<?php
@include(G4_SKIN_PATH."/board/basic/view_comment.sns.skin.php");
?>
<tr> <tr>
<th scope="row">내용</th> <th scope="row">내용</th>
<td> <td>
@ -174,7 +181,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": "", "subject": "",

View File

@ -173,7 +173,7 @@ function fwrite_submit(f)
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": f.wr_subject.value, "subject": f.wr_subject.value,

View File

@ -58,10 +58,6 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
} }
?> ?>
</ul> </ul>
<?php
// SNS 보내기
@include(G4_SKIN_PATH."/board/basic/view.sns.skin.php");
?>
</section> </section>
<?php } ?> <?php } ?>
@ -172,8 +168,7 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
</section> </section>
<?php <?php
// SNS 보내기 include(G4_SNS_PATH."/view.sns.skin.php");
include_once($board_skin_path."/view.sns.skin.php");
?> ?>
<?php <?php

View File

@ -12,18 +12,23 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<section id="bo_vc"> <section id="bo_vc">
<h2>댓글목록</h2> <h2>댓글목록</h2>
<?php <?php
for ($i=0; $i<count($list); $i++) { $cmt_amt = count($list);
for ($i=0; $i<$cmt_amt; $i++) {
$comment_id = $list[$i]['wr_id']; $comment_id = $list[$i]['wr_id'];
$cmt_depth = ""; // 댓글단계 $cmt_depth = ""; // 댓글단계
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 20; $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 20;
$str = $list[$i]['content']; $comment = $list[$i]['content'];
/*
if (strstr($list[$i]['wr_option'], "secret")) { if (strstr($list[$i]['wr_option'], "secret")) {
$str = $str; $str = $str;
} }
$str = 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>", $str); */
$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 이하 사이드뷰 겹침 문제 해결
?> ?>
<article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>> <article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>>
<header> <header style="z-index:<?php echo $cmt_sv; ?>">
<h1><?php echo $list[$i]['wr_name'] ?>님의 댓글</h1> <h1><?php echo $list[$i]['wr_name'] ?>님의 댓글</h1>
<?php echo $list[$i]['name'] ?> <?php echo $list[$i]['name'] ?>
<?php if ($cmt_depth) { ?><img src="<?php echo $board_skin_url ?>/img/icon_reply.gif" class="icon_reply" alt="댓글의 댓글"><?php } ?> <?php if ($cmt_depth) { ?><img src="<?php echo $board_skin_url ?>/img/icon_reply.gif" class="icon_reply" alt="댓글의 댓글"><?php } ?>
@ -33,12 +38,15 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php } ?> <?php } ?>
작성일 작성일
<span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span> <span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span>
<?php
include(G4_SNS_PATH.'/view_comment_list.sns.skin.php');
?>
</header> </header>
<!-- 댓글 출력 --> <!-- 댓글 출력 -->
<p> <p>
<?php if (strstr($list[$i]['wr_option'], "secret")) echo "<img src=\"".$board_skin_url."/img/icon_secret.gif\" alt=\"비밀글\">"; ?> <?php if (strstr($list[$i]['wr_option'], "secret")) { ?><img src="<?php echo $board_skin_url; ?>/img/icon_secret.gif" alt="비밀글"><?php } ?>
<?php echo $str ?> <?php echo $comment ?>
</p> </p>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 --> <span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
@ -113,7 +121,9 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<td><?php echo $captcha_html; ?></td> <td><?php echo $captcha_html; ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php
include(G4_SNS_PATH."/view_comment_write.sns.skin.php");
?>
<?php <?php
@include(G4_SKIN_PATH."/board/basic/view_comment.sns.skin.php"); @include(G4_SKIN_PATH."/board/basic/view_comment.sns.skin.php");
?> ?>
@ -122,7 +132,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<th scope="row">내용</th> <th scope="row">내용</th>
<td> <td>
<?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?php } ?> <?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?php } ?>
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" <textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" title="내용"
<?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?>><?php echo $c_wr_content; ?></textarea> <?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?>><?php echo $c_wr_content; ?></textarea>
<?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?> <?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?>
<script> <script>
@ -141,7 +151,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</table> </table>
<div class="btn_confirm"> <div class="btn_confirm">
<input type="submit" class="btn_submit" value="댓글등록"> <input type="submit" id="btn_submit" class="btn_submit" value="댓글등록">
</div> </div>
</form> </form>
@ -171,7 +181,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": "", "subject": "",

View File

@ -202,7 +202,7 @@ function fwrite_submit(f)
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g4_bbs_url+"/filter.ajax.php", url: g4_bbs_url+"/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": f.wr_subject.value, "subject": f.wr_subject.value,

View File

@ -219,7 +219,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<?php if ($w == "" && $config['cf_use_recommend']) { ?> <?php if ($w == "" && $config['cf_use_recommend']) { ?>
<tr> <tr>
<th scope="row"><label for="reg_mb_recommend">추천인아이디</label></th> <th scope="row"><label for="reg_mb_recommend">추천인아이디</label></th>
<td><input type="text" name="mb_recommend" id="reg_mb_recommend" class="frm_input" required></td> <td><input type="text" name="mb_recommend" id="reg_mb_recommend" class="frm_input"></td>
</tr> </tr>
<?php } ?> <?php } ?>
@ -342,7 +342,7 @@ function fregisterform_submit(f)
} }
} }
if (typeof(f.mb_recommend) != "undefined") { if (typeof(f.mb_recommend) != "undefined" && f.mb_recommend.value) {
if (f.mb_id.value == f.mb_recommend.value) { if (f.mb_id.value == f.mb_recommend.value) {
alert("본인을 추천할 수 없습니다."); alert("본인을 추천할 수 없습니다.");
f.mb_recommend.focus(); f.mb_recommend.focus();
@ -357,6 +357,7 @@ function fregisterform_submit(f)
} }
} }
/*
if (typeof(f.mb_hp) != "undefined" && f.mb_hp.value) { if (typeof(f.mb_hp) != "undefined" && f.mb_hp.value) {
var error = ""; var error = "";
$.ajax({ $.ajax({
@ -381,6 +382,7 @@ function fregisterform_submit(f)
return false; return false;
} }
} }
*/
<?php echo chk_captcha_js(); ?> <?php echo chk_captcha_js(); ?>

View File

@ -22,11 +22,6 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<!-- 검색결과 여기서부터 --> <!-- 검색결과 여기서부터 -->
<script>
document.fzip.addr1.focus();
</script>
<?php if ($search_count > 0) { ?> <?php if ($search_count > 0) { ?>
<dl> <dl>
<dt>총 <?php echo $search_count ?>건 가나다순 정렬</dt> <dt>총 <?php echo $search_count ?>건 가나다순 정렬</dt>

View File

@ -6,8 +6,8 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<form name="fsearch" onsubmit="return fsearch_submit(this);" method="get"> <form name="fsearch" onsubmit="return fsearch_submit(this);" method="get">
<input type="hidden" name="srows" value="<?php echo $srows ?>"> <input type="hidden" name="srows" value="<?php echo $srows ?>">
<fieldset id="sch_result_detail"> <fieldset id="sch_res_detail">
<legend class="sound_only">상세검색</legend> <legend>상세검색</legend>
<?php echo $group_select ?> <?php echo $group_select ?>
<script>document.getElementById("gr_id").value = "<?php echo $gr_id ?>";</script> <script>document.getElementById("gr_id").value = "<?php echo $gr_id ?>";</script>
@ -61,34 +61,33 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<div id="sch_result"> <div id="sch_result">
<?php if ($stx) { ?> <?php
<?php if ($board_count) { ?> if ($stx) {
<dl id="sch_result_hd"> if ($board_count) {
<dt><strong><?php echo $stx ?></strong>에 대한 검색 결과입니다.</dt> ?>
<dd> <section id="sch_res_ov">
<ul> <h2><?php echo $stx ?> 전체검색 결과</h2>
<li><span style="color:<?php echo $config['cf_search_color'] ?>"><?php echo $board_count ?></span>개의 게시판</li> <dl>
<li><span style="color:<?php echo $config['cf_search_color'] ?>"><?php echo number_format($total_count) ?></span>개의 게시</li> <dt>게시</dt>
<li>현재 <?php echo number_format($page) ?>/<?php echo number_format($total_page) ?> 페이지 열람 중</li> <dd><strong style="color:<?php echo $config['cf_search_color'] ?>"><?php echo $board_count ?>개</strong></dd>
</ul> <dt>게시물</dt>
</dd> <dd><strong style="color:<?php echo $config['cf_search_color'] ?>"><?php echo number_format($total_count) ?>개</strong></dd>
</dl> </dl>
<?php } ?> <p><?php echo number_format($page) ?>/<?php echo number_format($total_page) ?> 페이지 열람 중</p>
<?php } ?> </section>
<?php
}
}
?>
<?php <?php
if ($stx) { if ($stx) {
if ($board_count) { if ($board_count) {
?> ?>
<dl id="sch_result_bo"> <ul id="sch_res_board">
<dt>검색결과가 있는 게시판 목록</dt> <li><a href="?<?php echo $search_query ?>&amp;gr_id=<?php echo $gr_id ?>" <?php echo $sch_all ?>>전체게시판</a></li>
<dd> <?php echo $str_board_list; ?>
<ul> </ul>
<li><a href="?<?php echo $search_query ?>&amp;gr_id=<?php echo $gr_id ?>" <?php echo $sch_all ?>>전체게시판</a></li>
<?php echo $str_board_list; ?>
</ul>
</dd>
</dl>
<?php <?php
} else { } else {
?> ?>
@ -97,37 +96,37 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<hr> <hr>
<?php if ($stx && $board_count) { ?><dl id="sch_result_atc"><?php } ?> <?php if ($stx && $board_count) { ?><section class="sch_res_list"><?php } ?>
<?php <?php
$k=0; $k=0;
for ($idx=$table_index, $k=0; $idx<count($search_table) && $k<$rows; $idx++) { for ($idx=$table_index, $k=0; $idx<count($search_table) && $k<$rows; $idx++) {
$comment_def = ""; $comment_def = "";
$comment_href = ""; $comment_href = "";
?> ?>
<dt><a href="./board.php?bo_table=<?php echo $search_table[$idx] ?>&amp;<?php echo $search_query ?>"><?php echo $bo_subject[$idx] ?>에서</a></dt> <h2><a href="./board.php?bo_table=<?php echo $search_table[$idx] ?>&amp;<?php echo $search_query ?>"><?php echo $bo_subject[$idx] ?> 게시판 내 결과</a></h2>
<dd> <ul>
<ul> <?php
<?php for ($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++) {
for ($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++) { if ($list[$idx][$i][wr_is_comment])
if ($list[$idx][$i][wr_is_comment]) {
{ $comment_def = "<span class=\"cmt_def\">댓글 | </span>";
$comment_def = "<span class=\"cmt_def\">댓글</span>"; $comment_href = "#c_".$list[$idx][$i][wr_id];
$comment_href = "#c_".$list[$idx][$i][wr_id]; }
} ?>
?> <li>
<li> <a href="<?php echo $list[$idx][$i][href] ?><?php echo $comment_href ?>" class="sch_res_title"><?php echo $comment_def ?><?php echo $list[$idx][$i][subject] ?></a>
<a href="<?php echo $list[$idx][$i][href] ?><?php echo $comment_href ?>" class="sch_result_title"><?php echo $comment_def ?><?php echo $list[$idx][$i][subject] ?></a> <a href="<?php echo $list[$idx][$i][href] ?><?php echo $comment_href ?>" target="_blank">새창</a>
<a href="<?php echo $list[$idx][$i][href] ?><?php echo $comment_href ?>" target="_blank">새창</a> <p><?php echo $list[$idx][$i][content] ?></p>
<p><?php echo $list[$idx][$i][content] ?></p> <?php echo $list[$idx][$i][name] ?>
<?php echo $list[$idx][$i][name] ?> <span class="sch_datetime"><?php echo $list[$idx][$i][wr_datetime] ?></span>
<span class="sch_datetime"><?php echo $list[$idx][$i][wr_datetime] ?></span> </li>
</li> <?php } ?>
<?php } ?> </ul>
</ul> <div class="sch_more"><a href="./board.php?bo_table=<?php echo $search_table[$idx] ?>&amp;<?php echo $search_query ?>"><strong><?php echo $bo_subject[$idx] ?></strong> 결과 더보기</a></div>
<div class="sch_more"><a href="./board.php?bo_table=<?php echo $search_table[$idx] ?>&amp;<?php echo $search_query ?>"><?php echo $bo_subject[$idx] ?> 더보기</a></div>
</dd> <hr>
<?php } ?> <?php } ?>
<?php if ($stx && $board_count) { ?></dl><?php } ?> <?php if ($stx && $board_count) { ?></section><?php } ?>
<?php echo $write_pages ?> <?php echo $write_pages ?>