Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
@ -186,7 +186,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
<th scope="row"><label for="gr_id">그룹<strong class="sound_only">필수</strong></label></th>
|
||||
<td colspan="2">
|
||||
<?php echo get_group_select('gr_id', $board['gr_id'], 'required'); ?>
|
||||
<!-- <?php if ($w=='u') { ?><script>document.write("<a href='javascript:;' onclick=\"location.href='./board_list.php?sfl=a.gr_id&stx='+document.getElementById('gr_id').value;\">동일 그룹 목록</a>");</script><?php } ?> -->
|
||||
<?php if ($w=='u') { ?><a href="javascript:document.location.href='./board_list.php?sfl=a.gr_id&stx='+document.fboardform.gr_id.value;" class="btn_frmline">동일그룹 게시판목록</a><?php } ?></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@ -63,13 +63,34 @@ if(!isset($config['cf_facebook_appid'])) {
|
||||
}
|
||||
|
||||
// uniqid 테이블이 없을 경우 생성
|
||||
if(!sql_query(" select uq_id from {$g4['uniqid_table']} limit 1 ", false)) {
|
||||
if(!sql_query(" DESC {$g4['uniqid_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['uniqid_table']}` (
|
||||
`uq_id` bigint(20) unsigned NOT NULL,
|
||||
`uq_ip` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`uq_id`)
|
||||
) ", false);
|
||||
}
|
||||
|
||||
if(!sql_query(" SELECT uq_ip from {$g4['uniqid_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE {$g4['uniqid_table']} ADD `uq_ip` VARCHAR(255) NOT NULL ");
|
||||
}
|
||||
|
||||
|
||||
// 임시저장 테이블이 없을 경우 생성
|
||||
if(!sql_query(" DESC {$g4['autosave_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['autosave_table']}` (
|
||||
`as_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`mb_id` varchar(20) NOT NULL,
|
||||
`as_uid` bigint(20) unsigned NOT NULL,
|
||||
`as_subject` varchar(255) NOT NULL,
|
||||
`as_content` text NOT NULL,
|
||||
`as_datetime` datetime NOT NULL,
|
||||
PRIMARY KEY (`as_id`),
|
||||
UNIQUE KEY `as_uid` (`as_uid`),
|
||||
KEY `mb_id` (`mb_id`)
|
||||
) ", false);
|
||||
}
|
||||
|
||||
$g4['title'] = '환경설정';
|
||||
include_once ('./admin.head.php');
|
||||
|
||||
|
||||
@ -91,22 +91,15 @@ if ($default['de_card_test']) {
|
||||
$g4['shop_cardpg']['kcp'] = "http://testadmin8.kcp.co.kr";
|
||||
}
|
||||
|
||||
// 주문총액
|
||||
$sql = " select SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_order
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '{$od['uq_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
$total_order = $row['sum_order'];
|
||||
|
||||
// 상품목록
|
||||
$sql = " select a.it_id,
|
||||
a.it_name,
|
||||
a.cp_amount,
|
||||
b.it_notax
|
||||
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.uq_id = '{$od['uq_id']}'
|
||||
and a.ct_num = '0'
|
||||
order by a.ct_id ";
|
||||
$sql = " select it_id,
|
||||
it_name,
|
||||
cp_amount,
|
||||
ct_notax
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '{$od['uq_id']}'
|
||||
and ct_num = '0'
|
||||
order by ct_id ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$pg_anchor = '<ul class="anchor">
|
||||
@ -123,7 +116,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
<section id="anc_sodr_list" class="cbox">
|
||||
<h2>주문상품 목록</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
<p>주문일시 <?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>) / 주문총액 <strong><?php echo number_format($total_order); ?></strong>원</p>
|
||||
<p>주문일시 <?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>) / 주문총액 <strong><?php echo number_format($od['od_temp_amount']); ?></strong>원</p>
|
||||
<?php if ($default['de_hope_date_use']) { ?><p>희망배송일은 <?php echo $od['od_hope_date']; ?> (<?php echo get_yoil($od['od_hope_date']); ?>) 입니다.</p><?php } ?>
|
||||
<?php if($od['od_mobile']) { ?>
|
||||
<p>모바일 쇼핑몰의 주문입니다.</p>
|
||||
@ -153,7 +146,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
<li>
|
||||
<p>
|
||||
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo stripslashes($row['it_name']); ?></a>
|
||||
<?php if($default['de_tax_flag_use'] && $row['it_notax']) echo '[비과세상품]'; ?>
|
||||
<?php if($default['de_tax_flag_use'] && $row['ct_notax']) echo '[비과세상품]'; ?>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
@ -338,7 +331,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
</tr>
|
||||
<?php if($od['od_settle_case'] == '계좌이체') { ?>
|
||||
<tr>
|
||||
<th scope="row" class="sodr_sppay">결제 취소금액</th>
|
||||
<th scope="row">결제 취소금액</th>
|
||||
<td><?php echo display_price($od['od_cancel_card']); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -525,10 +518,9 @@ $pg_anchor = '<ul class="anchor">
|
||||
</tr>
|
||||
<?php if($od['od_settle_case'] == '계좌이체') { ?>
|
||||
<tr>
|
||||
<th scope="row" class="sodr_sppay"><label for="od_cancel_card">결제 취소금액</label></th>
|
||||
<th scope="row"><label for="od_cancel_card">결제 취소금액</label></th>
|
||||
<td>
|
||||
<input type="text" name="od_cancel_card" value="<?php echo $od['od_cancel_card']; ?>" class="frm_input" size="10"> 원
|
||||
<a href="./partcancel.php?od_id=<?php echo $od['od_id']; ?>" target="_blank" id="win_partcancel">결제부분취소</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -598,7 +590,6 @@ $pg_anchor = '<ul class="anchor">
|
||||
<th scope="row" class="sodr_sppay"><label for="od_cancel_card">카드 승인취소</label></th>
|
||||
<td>
|
||||
<input type="text" name="od_cancel_card" value="<?php echo $od['od_cancel_card']; ?>" class="frm_input" size="10"> 원
|
||||
<a href="./partcancel.php?od_id=<?php echo $od['od_id']; ?>" target="_blank" id="win_partcancel">결제부분취소</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -667,6 +658,9 @@ $pg_anchor = '<ul class="anchor">
|
||||
</section>
|
||||
|
||||
<div class="btn_confirm">
|
||||
<?php if($od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == '신용카드') { ?>
|
||||
<a href="./partcancel.php?od_id=<?php echo $od['od_id']; ?>" target="_blank" id="win_partcancel">결제금액 부분취소</a>
|
||||
<?php } ?>
|
||||
<input type="submit" value="결제/배송내역 수정" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -7,7 +7,7 @@ auth_check($auth[$sub_menu], "w");
|
||||
$g4['title'] = $settle_method.' 부분취소 요청';
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
|
||||
$sql = " select od_id, od_settle_case, od_receipt_amount, od_cancel_card, od_tno, od_time
|
||||
$sql = " select *
|
||||
from {$g4['shop_order_table']}
|
||||
where od_id = '{$_GET['od_id']}' ";
|
||||
$od = sql_fetch($sql);
|
||||
@ -29,7 +29,7 @@ $available_cancel = $od['od_receipt_amount'] - $od['od_cancel_card'];
|
||||
?>
|
||||
|
||||
<div>
|
||||
<form name="fcardpartcancel" method="post" action="./partcancelupdate.php">
|
||||
<form name="fcardpartcancel" method="post" action="./partcancelupdate.php" onsubmit="return form_check(this);">
|
||||
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
|
||||
<input type="hidden" name="req_tx" value="mod">
|
||||
<input type="hidden" name="tno" value="<?php echo $od['od_tno']; ?>">
|
||||
@ -41,10 +41,21 @@ $available_cancel = $od['od_receipt_amount'] - $od['od_cancel_card'];
|
||||
<p>
|
||||
취소가능금액 : <?php echo number_format($available_cancel); ?> 원
|
||||
</p>
|
||||
<?php if($default['de_tax_flag_use']) { ?>
|
||||
<p>
|
||||
<label for="tax_mny">과세 취소요청금액</label>
|
||||
<input type="text" name="tax_mny" id="tax_mny" size="20"> 원
|
||||
</p>
|
||||
<p>
|
||||
<label for="mod_free_mny">비과세 취소요청금액</label>
|
||||
<input type="text" name="mod_free_mny" id="mod_free_mny" size="20"> 원
|
||||
</p>
|
||||
<?php } else { ?>
|
||||
<p>
|
||||
<label for="mod_mny">취소요청금액</label>
|
||||
<input type="text" name="mod_mny" id="mod_mny" size="20" required class="required"> 원
|
||||
</p>
|
||||
<?php } ?>
|
||||
<p>
|
||||
<label for="mod_desc">취소요청사유</label>
|
||||
<input type="text" name="mod_desc" id="mod_desc" size="50" required class="required">
|
||||
@ -56,6 +67,23 @@ $available_cancel = $od['od_receipt_amount'] - $od['od_cancel_card'];
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function form_check(f)
|
||||
{
|
||||
<?php if($default['de_tax_flag_use']) { ?>
|
||||
var tax_mny = f.tax_mny.value;
|
||||
var free_mny = f.mod_free_mny.value;
|
||||
|
||||
if(tax_mny == "" && free_mny == "") {
|
||||
alert("과세 또는 비과세 취소요청금액을입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
?>
|
||||
@ -21,9 +21,12 @@ if($od['od_settle_case'] != '신용카드' && $od['od_settle_case'] != '계좌
|
||||
if($od['od_settle_case'] == '계좌이체' && substr(0, 10, $od['od_time']) == G4_TIME_YMD)
|
||||
alert('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
|
||||
|
||||
if($_POST['mod_type'] != 'RN07' && $_POST['mod_type'] != 'STPA')
|
||||
alert('취소요청 구분이 올바르지 않습니다.mod_type 값을 확인해 주십시오.');
|
||||
|
||||
// 취소사유의 한글깨짐 방지처리
|
||||
$def_locale = setlocale(LC_CTYPE, 0);
|
||||
$_POST['mod_desc'] = iconv("utf-8", "euc-kr", $_POST['mod_desc']);
|
||||
$_POST = array_map('iconv_euckr', $_POST);
|
||||
$locale_change = false;
|
||||
if(preg_match("/utf[\-]?8/i", $def_locale)) {
|
||||
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
|
||||
@ -47,7 +50,8 @@ else {
|
||||
$default['de_kcp_mid'] = "SR".$default['de_kcp_mid'];
|
||||
}
|
||||
|
||||
$g_conf_site_cd = $default['de_kcp_mid'];
|
||||
$g_conf_site_cd = $default['de_kcp_mid'];
|
||||
$g_conf_site_key = $default['de_kcp_site_key'];
|
||||
$g_conf_home_dir = G4_SHOP_PATH.'/kcp';
|
||||
$g_conf_key_dir = '';
|
||||
$g_conf_log_dir = '';
|
||||
@ -70,38 +74,55 @@ else {
|
||||
$g_conf_log_level = "3";
|
||||
$g_conf_gw_port = "8090";
|
||||
|
||||
include_once(G4_SHOP_PATH.'/kcp/pp_ax_hub_lib.php');
|
||||
include G4_SHOP_PATH.'/kcp/pp_cli_hub_lib.php';
|
||||
|
||||
$tno = $_POST['tno'];
|
||||
$req_tx = $_POST['req_tx'];
|
||||
$mod_type = $_POST['mod_type'];
|
||||
$mod_desc = $_POST['mod_desc'];
|
||||
$cust_ip = getenv("REMOTE_ADDR");
|
||||
$cust_ip = getenv('REMOTE_ADDR');
|
||||
$rem_mny = $_POST['rem_mny'];
|
||||
$mod_mny = $_POST['mod_mny'];
|
||||
$tax_mny = $_POST['tax_mny'];
|
||||
$mod_free_mny = $_POST['mod_free_mny'];
|
||||
|
||||
$c_PayPlus = new C_PP_CLI;
|
||||
if($default['de_tax_flag_use']) {
|
||||
$mod_mny = strval($tax_mny + $mod_free_mny);
|
||||
}
|
||||
|
||||
$c_PayPlus = new C_PAYPLUS_CLI;
|
||||
$c_PayPlus->mf_clear();
|
||||
|
||||
if ( $req_tx == "mod" )
|
||||
{
|
||||
$tran_cd = "00200000";
|
||||
|
||||
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
|
||||
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
|
||||
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
|
||||
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
|
||||
$c_PayPlus->mf_set_modx_data( "tno" , $tno ); // KCP 원거래 거래번호
|
||||
$c_PayPlus->mf_set_modx_data( "mod_type" , $mod_type ); // 원거래 변경 요청 종류
|
||||
$c_PayPlus->mf_set_modx_data( "mod_ip" , $cust_ip ); // 변경 요청자 IP
|
||||
$c_PayPlus->mf_set_modx_data( "mod_desc" , $mod_desc ); // 변경 사유
|
||||
$c_PayPlus->mf_set_modx_data( "rem_mny" , $rem_mny ); // 취소 가능 잔액
|
||||
$c_PayPlus->mf_set_modx_data( "mod_mny" , $mod_mny ); // 취소 요청 금액
|
||||
|
||||
if ( $mod_type == "RN07" || $mod_type == "STPA" ) // 부분취소의 경우
|
||||
if($default['de_tax_flag_use'])
|
||||
{
|
||||
$c_PayPlus->mf_set_modx_data( "mod_mny", $_POST[ "mod_mny" ] ); // 취소요청금액
|
||||
$c_PayPlus->mf_set_modx_data( "rem_mny", $_POST[ "rem_mny" ] ); // 취소가능잔액
|
||||
$mod_tax_mny = round((int)$tax_mny / 1.1);
|
||||
$mod_vat_mny = (int)$tax_mny - $mod_tax_mny;
|
||||
|
||||
$c_PayPlus->mf_set_modx_data( "tax_flag" , "TG03" ); // 복합과세 구분
|
||||
$c_PayPlus->mf_set_modx_data( "mod_tax_mny" , strval($mod_tax_mny) ); // 공급가 부분 취소 요청 금액
|
||||
$c_PayPlus->mf_set_modx_data( "mod_vat_mny" , strval($mod_vat_mny) ); // 부과세 부분 취소 요청 금액
|
||||
$c_PayPlus->mf_set_modx_data( "mod_free_mny" , $mod_free_mny ); // 비관세 부분 취소 요청 금액
|
||||
}
|
||||
}
|
||||
|
||||
if ( $tran_cd != "" )
|
||||
{
|
||||
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, "", $tran_cd, "",
|
||||
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
|
||||
$cust_ip, "3" , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리
|
||||
$c_PayPlus->mf_do_tx( "", $g_conf_home_dir, $g_conf_site_cd,
|
||||
$g_conf_site_key, $tran_cd, "",
|
||||
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib",
|
||||
$ordr_idxx, $cust_ip, $g_conf_log_level,
|
||||
"", 0 );
|
||||
|
||||
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
|
||||
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
|
||||
@ -128,21 +149,14 @@ if ( $req_tx == "mod" )
|
||||
if ( $res_cd == "0000" )
|
||||
{
|
||||
$tno = $c_PayPlus->mf_get_res_data( "tno" ); // KCP 거래 고유 번호
|
||||
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // 원 거래금액
|
||||
$mod_mny = $c_PayPlus->mf_get_res_data( "panc_mod_mny" ); // 취소요청된 금액
|
||||
$rem_mny = $c_PayPlus->mf_get_res_data( "panc_rem_mny" ); // 취소요청후 잔액
|
||||
|
||||
/* = -------------------------------------------------------------------------- = */
|
||||
/* = 부분취소 결과 처리 = */
|
||||
/* = -------------------------------------------------------------------------- = */
|
||||
if ( $mod_type == "RN07" || $mod_type == "STPA" ) // 부분취소의 경우
|
||||
{
|
||||
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // 원 거래금액
|
||||
$mod_mny = $c_PayPlus->mf_get_res_data( "panc_mod_mny" ); // 취소요청된 금액
|
||||
$rem_mny = $c_PayPlus->mf_get_res_data( "panc_rem_mny" ); // 취소요청후 잔액
|
||||
|
||||
$sql = " update {$g4['shop_order_table']}
|
||||
set od_cancel_card = od_cancel_card + '$mod_mny'
|
||||
where od_id = '{$od['od_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
$sql = " update {$g4['shop_order_table']}
|
||||
set od_cancel_card = od_cancel_card + '$mod_mny'
|
||||
where od_id = '{$od['od_id']}' ";
|
||||
sql_query($sql);
|
||||
} // End of [res_cd = "0000"]
|
||||
|
||||
/* = -------------------------------------------------------------------------- = */
|
||||
|
||||
20
bbs/ajax.autosave.php
Normal file
20
bbs/ajax.autosave.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
if (!$is_member) die('0');
|
||||
|
||||
$uid = escape_trim($_REQUEST['uid']);
|
||||
$subject = escape_trim(stripslashes($_REQUEST['subject']));
|
||||
$content = escape_trim(stripslashes($_REQUEST['content']));
|
||||
|
||||
if ($subject && $content) {
|
||||
$sql = " select count(*) as cnt from {$g4['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['cnt']) {
|
||||
$sql = " insert into {$g4['autosave_table']} set mb_id = '{$member['mb_id']}', as_uid = '{$uid}', as_subject = '$subject', as_content = '$content', as_datetime = '".G4_TIME_YMDHIS."' on duplicate key update as_subject = '$subject', as_content = '$content', as_datetime = '".G4_TIME_YMDHIS."' ";
|
||||
$result = sql_query($sql, false);
|
||||
|
||||
echo autosave_count($member['mb_id']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
15
bbs/ajax.autosavedel.php
Normal file
15
bbs/ajax.autosavedel.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
|
||||
if (!$is_member) die("0");
|
||||
|
||||
$as_id = (int)$_REQUEST['as_id'];
|
||||
|
||||
$sql = " delete from {$g4['autosave_table']} where mb_id = '{$member['mb_id']}' and as_id = {$as_id} ";
|
||||
$result = sql_query($sql);
|
||||
if (!$result) {
|
||||
echo "-1";
|
||||
}
|
||||
|
||||
echo autosave_count($member['mb_id']);
|
||||
?>
|
||||
21
bbs/ajax.autosavelist.php
Normal file
21
bbs/ajax.autosavelist.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
if (!$is_member) die('');
|
||||
|
||||
$sql = " select as_id, as_uid, as_subject, as_datetime from {$g4['autosave_table']} where mb_id = '{$member['mb_id']}' order by as_id desc ";
|
||||
$result = sql_query($sql);
|
||||
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
|
||||
echo "<list>\n";
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$subject = htmlspecialchars(utf8_strcut($row['as_subject'], 25), ENT_QUOTES);
|
||||
$datetime = substr($row['as_datetime'],2,14);
|
||||
echo "<item>\n";
|
||||
echo "<id>{$row['as_id']}</id>\n";
|
||||
echo "<uid>{$row['as_uid']}</uid>\n";
|
||||
echo "<subject><![CDATA[{$subject}]]></subject>\n";
|
||||
echo "<datetime>{$datetime}</datetime>\n";
|
||||
echo "</item>\n";
|
||||
}
|
||||
echo "</list>";
|
||||
?>
|
||||
18
bbs/ajax.autosaveload.php
Normal file
18
bbs/ajax.autosaveload.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
if (!$is_member) die('');
|
||||
|
||||
$as_id = (int)$_REQUEST['as_id'];
|
||||
|
||||
$sql = " select as_subject, as_content from {$g4['autosave_table']} where mb_id = '{$member['mb_id']}' and as_id = {$as_id} ";
|
||||
$row = sql_fetch($sql);
|
||||
$subject = $row['as_subject'];
|
||||
$content = $row['as_content'];
|
||||
|
||||
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
|
||||
echo "<item>\n";
|
||||
echo "<subject><![CDATA[{$subject}]]></subject>\n";
|
||||
echo "<content><![CDATA[{$content}]]></content>\n";
|
||||
echo "</item>\n";
|
||||
?>
|
||||
@ -380,6 +380,9 @@ if (!G4_IS_MOBILE && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $bo
|
||||
}
|
||||
$editor_html = editor_html('wr_content', $content, $is_dhtml_editor);
|
||||
|
||||
// 임시 저장된 글 갯수
|
||||
$autosave_count = autosave_count($member['mb_id']);
|
||||
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
@include_once ($board_skin_path.'/write.head.skin.php');
|
||||
include_once('./board_head.php');
|
||||
|
||||
@ -555,6 +555,9 @@ for ($i=(int)$row['max_bf_no']; $i>=0; $i--)
|
||||
// 파일의 갯수를 게시물에 업데이트 한다.
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ");
|
||||
sql_query(" update {$write_table} set wr_file = '{$row['cnt']}' where wr_id = '{$wr_id}' ");
|
||||
|
||||
// 자동저장된 레코드를 삭제한다.
|
||||
sql_query(" delete from g4s_autosave where as_uid = '{$uid}' ");
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// 비밀글이라면 세션에 비밀글의 아이디를 저장한다. 자신의 글은 다시 패스워드를 묻지 않기 위함
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
|
||||
/* 초기화 */
|
||||
html {overflow-y:scroll}
|
||||
body {margin:0;padding:0;background:#f5f6fa;color:#000;font-size:0.75em;font-family:"dotum"}
|
||||
body {margin:0;padding:0;background:#f5f6fa;color:#000;font-size:0.75em;font-family:dotum}
|
||||
html, h1, h2, h3, h4, h5, h6, form, fieldset, img {margin:0;padding:0;border:0}
|
||||
h1, h2, h3, h4, h5, h6 {font-size:1em;font-family:"dotum"}
|
||||
h1, h2, h3, h4, h5, h6 {font-size:1em;font-family:dotum}
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display:block}
|
||||
header ul, nav ul, aside ul, footer ul {margin:0;padding:0;list-style:none}
|
||||
label, input, select, img {vertical-align:middle}
|
||||
input {margin:0;padding:0;border-radius:0;font-family:"dotum"}
|
||||
input {margin:0;padding:0;border-radius:0;font-family:dotum}
|
||||
input[type=text], input[type=password], input[type=submit], input[type=image] {-webkit-appearance:none}
|
||||
button {border-radius:0;font-size:1em;-webkit-appearance:none}
|
||||
p {margin:0;padding:10px 0;line-height:1.7em;word-break:break-all}
|
||||
@ -18,7 +18,7 @@ pre {overflow-x:scroll;font-size:1.1em}
|
||||
a {color:#000;text-decoration:none}
|
||||
a:focus, a:hover, a:active {text-decoration:underline}
|
||||
/* 헤딩 */
|
||||
h1 {margin-bottom:20px;color:#333;font-size:1.5em;font-family:"dotum";letter-spacing:-0.1em}
|
||||
h1 {margin-bottom:20px;color:#333;font-size:1.5em;font-family:dotum;letter-spacing:-0.1em}
|
||||
h2 {font-size:1.2em}
|
||||
|
||||
/* 레이아웃 */
|
||||
@ -567,8 +567,9 @@ td {padding:8px 5px 6px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9
|
||||
.new_win_ul {margin:-20px 0 20px 0;padding:0 0 0 20px;border-bottom:1px solid #515151;background:#484848;list-style:none;zoom:1}
|
||||
.new_win_ul:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
.new_win_ul li {float:left;margin-left:-1px}
|
||||
.new_win_ul a {display:block;padding:10px 10px 8px;border-right:1px solid #595959;border-left:1px solid #595959;color:#fff;font-family:"dotum";font-weight:bold;text-decoration:none}
|
||||
.new_win_desc {display:block;margin:0 auto;width:93%}
|
||||
|
||||
.new_win_ul a {display:block;padding:10px 10px 8px;border-right:1px solid #595959;border-left:1px solid #595959;color:#fff;font-family:dotum;font-weight:bold;text-decoration:none}
|
||||
.new_win_desc {margin:0 auto;width:93%}
|
||||
|
||||
/* 자바스크립트 alert 대안 */
|
||||
#validation_check {margin:100px auto;width:500px}
|
||||
|
||||
@ -3,22 +3,19 @@
|
||||
|
||||
/* 초기화 */
|
||||
html {overflow-y:scroll}
|
||||
body {margin:0;padding:0;background:#f9fafe;color:#000;font-size:0.75em;font-family:"dotum"}
|
||||
body {margin:0;padding:0;background:#f9fafe;color:#000;font-size:0.75em;font-family:dotum}
|
||||
html, h1, h2, h3, h4, h5, h6, form, fieldset, img {margin:0;padding:0;border:0}
|
||||
h1, h2, h3, h4, h5, h6 {font-size:1em;font-family:"dotum"}
|
||||
h1, h2, h3, h4, h5, h6 {font-size:1em;font-family:dotum}
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display:block}
|
||||
header ul, nav ul, footer ul {margin:0;padding:0;list-style:none}
|
||||
label, input, select, img {vertical-align:middle}
|
||||
input {margin:0;padding:0;border-radius:0;font-family:"dotum"}
|
||||
input {margin:0;padding:0;border-radius:0;font-family:dotum}
|
||||
button {border-radius:0;font-size:1em}
|
||||
p {margin:0;padding:10px 0;line-height:1.7em;word-break:break-all}
|
||||
hr {display:none}
|
||||
pre {overflow-x:scroll;font-size:1.1em}
|
||||
a:link,
|
||||
a:visited {color:#000;text-decoration:none}
|
||||
a:hover,
|
||||
a:focus,
|
||||
a:active {color:#000;text-decoration:underline}
|
||||
a:link, a:visited {color:#000;text-decoration:none}
|
||||
a:hover, a:focus, a:active {color:#000;text-decoration:underline}
|
||||
|
||||
/* 상단 레이아웃 */
|
||||
#hd {z-index:10;position:relative;border-top:3px solid #151515;background:#fff}
|
||||
@ -176,8 +173,7 @@ td.empty_table {padding:85px 0;text-align:center}
|
||||
.frm_tbl caption {padding:10px 0;font-weight:bold;text-align:left}
|
||||
.frm_tbl th {width:100px;padding:7px 13px;border:1px solid #e9e9e9;border-left:0;background:#f7f7f7;text-align:left}
|
||||
.frm_tbl td {padding:7px 10px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;background:transparent}
|
||||
.frm_tbl textarea, .frm_input {padding:2px 2px 3px;border:1px solid #b8c9c2;background:#f7f7f7;vertical-align:middle}
|
||||
.frm_input:focus, input.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important;color:#fff}
|
||||
.frm_tbl textarea, .frm_input {padding:2px 2px 3px;border:1px solid #b8c9c2;background:#f7f7f7;color:#000;vertical-align:middle}
|
||||
.frm_tbl textarea {width:98%;height:100px}
|
||||
.frm_address {display:block;margin-top:5px}
|
||||
.frm_file {display:block;margin-bottom:5px}
|
||||
@ -208,7 +204,7 @@ td.empty_table {padding:85px 0;text-align:center}
|
||||
.new_win_ul {margin:-20px 0 20px 0;padding:0 0 0 20px;border-bottom:1px solid #455255;background:#484848;list-style:none;zoom:1}
|
||||
.new_win_ul:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
.new_win_ul li {float:left;margin-left:-1px}
|
||||
.new_win_ul a {display:block;padding:10px 10px 8px;border-right:1px solid #455255;border-left:1px solid #455255;color:#fff;font-family:"dotum";font-weight:bold;text-decoration:none}
|
||||
.new_win_ul a {display:block;padding:10px 10px 8px;border-right:1px solid #455255;border-left:1px solid #455255;color:#fff;font-family:dotum;font-weight:bold;text-decoration:none}
|
||||
.new_win_desc {margin:0 auto;width:93%}
|
||||
|
||||
/* 자바스크립트 alert 대안 */
|
||||
|
||||
@ -646,4 +646,23 @@ CREATE TABLE IF NOT EXISTS `g4s_syndi_log` (
|
||||
PRIMARY KEY (`content_id`,`bbs_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `g4s_autosave`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `g4s_autosave`;
|
||||
CREATE TABLE IF NOT EXISTS `g4s_autosave` (
|
||||
`as_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`mb_id` varchar(20) NOT NULL,
|
||||
`as_uid` bigint(20) unsigned NOT NULL,
|
||||
`as_subject` varchar(255) NOT NULL,
|
||||
`as_content` text NOT NULL,
|
||||
`as_datetime` datetime NOT NULL,
|
||||
PRIMARY KEY (`as_id`),
|
||||
UNIQUE KEY `as_uid` (`as_uid`),
|
||||
KEY `mb_id` (`mb_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -466,7 +466,8 @@ fwrite($f, "\$g4['visit_table'] = G4_TABLE_PREFIX.'visit'; // 방문자 테이
|
||||
fwrite($f, "\$g4['visit_sum_table'] = G4_TABLE_PREFIX.'visit_sum'; // 방문자 합계 테이블\n");
|
||||
fwrite($f, "\$g4['uniqid_table'] = G4_TABLE_PREFIX.'uniqid'; // 유니크한 값을 만드는 테이블\n");
|
||||
fwrite($f, "\$g4['syndi_log_table'] = G4_TABLE_PREFIX.'syndi_log'; // 네이버 신디케이션 컨텐츠 삭제 로그 테이블\n");
|
||||
fwrite($f, "?>");
|
||||
fwrite($f, "\$g4['autosave_table'] = G4_TABLE_PREFIX.'autosave'; // 게시글 작성시 일정시간마다 글을 임시 저장하는 테이블\n");
|
||||
fwrite($f, " ?>");
|
||||
|
||||
if($shop_install) {
|
||||
fwrite($f, "\n\n<?php\n");
|
||||
|
||||
@ -69,6 +69,7 @@ CREATE TABLE IF NOT EXISTS `shop_cart` (
|
||||
`ct_option` varchar(255) NOT NULL DEFAULT '',
|
||||
`ct_qty` int(11) NOT NULL DEFAULT '0',
|
||||
`ct_num` int(11) NOT NULL DEFAULT '0',
|
||||
`ct_notax` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`io_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`io_type` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`io_price` int(11) NOT NULL DEFAULT '0',
|
||||
|
||||
98
js/autosave.js
Normal file
98
js/autosave.js
Normal file
@ -0,0 +1,98 @@
|
||||
// 임시 저장하는 시간을 초단위로 설정한다.
|
||||
var AUTOSAVE_INTERVAL = 60; // 초
|
||||
|
||||
// 글의 제목과 내용을 바뀐 부분이 있는지 비교하기 위하여 저장해 놓는 변수
|
||||
var save_wr_subject = null;
|
||||
var save_wr_content = null;
|
||||
|
||||
function autosave() {
|
||||
$("form#fwrite").each(function() {
|
||||
if (typeof(CKEDITOR.instances.wr_content)!="undefined")
|
||||
this.wr_content.value = CKEDITOR.instances.wr_content.getData();
|
||||
// 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함
|
||||
if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) {
|
||||
$.ajax({
|
||||
url: g4_bbs_url+"/ajax.autosave.php",
|
||||
data: {
|
||||
"uid" : this.uid.value,
|
||||
"subject": this.wr_subject.value,
|
||||
"content": this.wr_content.value
|
||||
},
|
||||
type: "POST",
|
||||
success: function(data){
|
||||
if (data) {
|
||||
$("#autosave_count").html(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
save_wr_subject = this.wr_subject.value;
|
||||
save_wr_content = this.wr_content.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
||||
if (g4_is_member) {
|
||||
setInterval(autosave, AUTOSAVE_INTERVAL * 1000);
|
||||
}
|
||||
|
||||
// 임시저장된 글목록을 가져옴
|
||||
$("#btn_autosave").click(function(){
|
||||
if ($("#autosave_pop").is(":hidden")) {
|
||||
$.get(g4_bbs_url+"/ajax.autosavelist.php", function(data){
|
||||
//alert(data);
|
||||
//console.log( "Data: " + data);
|
||||
$("#autosave_pop ul").empty();
|
||||
if ($(data).find("list").find("item").length > 0) {
|
||||
$(data).find("list").find("item").each(function(i) {
|
||||
var id = $(this).find("id").text();
|
||||
var uid = $(this).find("uid").text();
|
||||
var subject = $(this).find("subject").text();
|
||||
var datetime = $(this).find("datetime").text();
|
||||
$("#autosave_pop ul").append('<li><a href="#none" class="autosave_load">'+subject+'</a><span>'+datetime+' <button type="button" class="autosave_del">삭제</button></span></li>');
|
||||
$.data(document.body, "autosave_id"+i, id);
|
||||
$.data(document.body, "autosave_uid"+i, uid);
|
||||
});
|
||||
}
|
||||
}, "xml");
|
||||
$("#autosave_pop").show();
|
||||
} else {
|
||||
$("#autosave_pop").hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 임시저장된 글 제목과 내용을 가져와서 제목과 내용 입력박스에 노출해 줌
|
||||
$(".autosave_load").live("click", function(){
|
||||
var i = $(this).parents("li").index();
|
||||
var as_id = $.data(document.body, "autosave_id"+i);
|
||||
var as_uid = $.data(document.body, "autosave_uid"+i);
|
||||
$("#fwrite input[name='uid']").val(as_uid);
|
||||
$.get(g4_bbs_url+"/ajax.autosaveload.php", {"as_id":as_id}, function(data){
|
||||
var subject = $(data).find("item").find("subject").text();
|
||||
var content = $(data).find("item").find("content").text();
|
||||
$("#wr_subject").val(subject);
|
||||
if (typeof(CKEDITOR.instances.wr_content)!="undefined") {
|
||||
CKEDITOR.instances.wr_content.setData(content);
|
||||
} else {
|
||||
$("#fwrite #wr_content").val(content);
|
||||
}
|
||||
}, "xml");
|
||||
$("#autosave_pop").hide();
|
||||
});
|
||||
|
||||
$(".autosave_del").live("click", function(){
|
||||
var i = $(this).parents("li").index();
|
||||
var as_id = $.data(document.body, "autosave_id"+i);
|
||||
$.get(g4_bbs_url+"/ajax.autosavedel.php", {"as_id":as_id}, function(data){
|
||||
if (data == -1) {
|
||||
alert("임시 저장된글을 삭제중에 오류가 발생하였습니다.");
|
||||
} else {
|
||||
$("#autosave_count").html(data);
|
||||
$("#autosave_pop ul > li").eq(i).remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".autosave_close").click(function(){ $("#autosave_pop").hide(); });
|
||||
});
|
||||
@ -1737,7 +1737,7 @@ function get_uniqid()
|
||||
// 년월일시분초에 100분의 1초 두자리를 추가함 (1/100 초 앞에 자리가 모자르면 0으로 채움)
|
||||
$key = date('YmdHis', time()) . str_pad((int)(microtime()*100), 2, "0", STR_PAD_LEFT);
|
||||
|
||||
$result = sql_query(" insert into {$g4['uniqid_table']} values ('$key') ", false);
|
||||
$result = sql_query(" insert into {$g4['uniqid_table']} set uq_id = '$key', uq_ip = '{$_SERVER['REMOTE_ADDR']}' ", false);
|
||||
if ($result) break; // 쿼리가 정상이면 빠진다.
|
||||
|
||||
// insert 하지 못했으면 일정시간 쉰다음 다시 유일키를 만든다.
|
||||
@ -2090,4 +2090,18 @@ function googl_short_url($longUrl)
|
||||
|
||||
return $json->id;
|
||||
}
|
||||
|
||||
|
||||
// 임시 저장된 글 갯수
|
||||
function autosave_count($mb_id)
|
||||
{
|
||||
global $g4;
|
||||
|
||||
if ($mb_id) {
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['autosave_table']} where mb_id = '$mb_id' ");
|
||||
return (int)$row['cnt'];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -530,18 +530,18 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
||||
<?php
|
||||
// 취소한 내역이 없다면
|
||||
if ($tot_cancel_amount == 0) {
|
||||
if ($od['od_temp_amount'] > 0 && $od['od_receipt_amount'] == 0) {
|
||||
if ($od_count1 == $od_count2 && ($od['od_settle_case'] != '가상계좌' || $od['od_receipt_amount'] == 0)) {
|
||||
?>
|
||||
<button type="button" onclick="document.getElementById('sod_fin_cancelfrm').style.display='block';">주문 취소하기</button>
|
||||
|
||||
<div id="sod_fin_cancelfrm">
|
||||
<form method="post" action="<?php echo G4_SHOP_URL; ?>/orderinquirycancel.php">
|
||||
<form method="post" action="<?php echo G4_SHOP_URL; ?>/orderinquirycancel.php" onsubmit="return fcancel_check(this);">
|
||||
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
|
||||
<input type="hidden" name="uq_id" value="<?php echo $od['uq_id']; ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
|
||||
<label for="cancel_memo">취소사유</label>
|
||||
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input" size="40" maxlength="100">
|
||||
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input required" size="40" maxlength="100">
|
||||
<input type="submit" value="확인" class="btn_frmline">
|
||||
|
||||
</form>
|
||||
@ -574,6 +574,22 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function fcancel_check(f)
|
||||
{
|
||||
if(!confirm("주문을 정말 취소하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
var memo = f.cancel_memo.value;
|
||||
if(memo == "") {
|
||||
alert("취소사유를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G4_MSHOP_PATH.'/_tail.php');
|
||||
?>
|
||||
@ -57,7 +57,7 @@ function get_editor_js($id, $ckeditor=true)
|
||||
function chk_editor_js($id, $ckeditor=true, $textarea_name="내용을")
|
||||
{
|
||||
if ( $ckeditor ) {
|
||||
return "if (!{$id}_editor_data) { alert(\"$textarea_name 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\n";
|
||||
return "if (!{$id}_editor_data) { alert(\"$textarea_name 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\nif (typeof(f.wr_content)!=\"undefined\") f.wr_content.value = {$id}_editor_data;\n";
|
||||
} else {
|
||||
return "if (!{$id}_editor.value) { alert(\"$textarea_name 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
|
||||
}
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
|
||||
// prepare an array of wavfiles
|
||||
$wavs_dir = $g4['path'].'/plugin/captcha/wavs/';
|
||||
$wav = $wavs_dir.'0.wav';
|
||||
|
||||
$fields = join('/',array( 'H8ChunkID', 'VChunkSize', 'H8Format',
|
||||
'H8Subchunk1ID', 'VSubchunk1Size',
|
||||
'vAudioFormat', 'vNumChannels', 'VSampleRate',
|
||||
'VByteRate', 'vBlockAlign', 'vBitsPerSample' ));
|
||||
|
||||
$fp = fopen($wav,'rb');
|
||||
$header = fread($fp,36);
|
||||
$info = unpack($fields,$header);
|
||||
print_r2($info);
|
||||
?>
|
||||
@ -22,6 +22,14 @@ if ($member['mb_level'] < $default['de_level_sell'])
|
||||
alert('상품을 구입할 수 있는 권한이 없습니다.');
|
||||
}
|
||||
|
||||
// notax 필드추가
|
||||
$sql = " select ct_notax from {$g4['shop_cart_table']} limit 1 ";
|
||||
$result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
|
||||
ADD `ct_notax` TINYINT(4) NOT NULL DEFAULT '0' AFTER `ct_num` ", true);
|
||||
}
|
||||
|
||||
if($act == "buy")
|
||||
{
|
||||
if(!count($_POST['ct_chk']))
|
||||
@ -75,6 +83,7 @@ else if ($act == "seldelete") // 선택삭제
|
||||
else if ($act == "multi") // 여러개의 상품이 한꺼번에 들어옴.
|
||||
{
|
||||
$fldcnt = count($_POST['it_name']);
|
||||
$arr_item = array();
|
||||
|
||||
// 재고등을 검사
|
||||
$error = "";
|
||||
@ -83,15 +92,20 @@ else if ($act == "multi") // 여러개의 상품이 한꺼번에 들어옴.
|
||||
if ($_POST['it_id'][$i] == "" || $_POST['ct_qty'][$i] <= 0) { continue; }
|
||||
|
||||
//옵션있는 상품은 건너뜀
|
||||
$arr_item[$i]['opt_skip'] = 0;
|
||||
$sql = " select count(*) as cnt from {$g4['shop_item_option_table']} where it_id = '{$_POST['it_id'][$i]}' and io_type = '0' ";
|
||||
$tmp = sql_fetch($sql);
|
||||
if($tmp['cnt']) continue;
|
||||
if($tmp['cnt']) {
|
||||
$arr_item[$i]['opt_skip'] = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// 변조 검사
|
||||
//--------------------------------------------------------
|
||||
$sql = " select * from {$g4['shop_item_table']} where it_id = '{$_POST['it_id'][$i]}' ";
|
||||
$it = sql_fetch($sql);
|
||||
$arr_item[$i]['notax'] = $it['it_notax'];
|
||||
|
||||
$price = get_price($it);
|
||||
// 상품가격이 다름
|
||||
@ -122,7 +136,7 @@ else if ($act == "multi") // 여러개의 상품이 한꺼번에 들어옴.
|
||||
$ct_count = 0;
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g4['shop_cart_table']}
|
||||
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select )
|
||||
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select )
|
||||
VALUES ";
|
||||
$ct_select = 0;
|
||||
if($sw_direct)
|
||||
@ -132,6 +146,10 @@ else if ($act == "multi") // 여러개의 상품이 한꺼번에 들어옴.
|
||||
{
|
||||
if ($_POST['it_id'][$i] == "" || $_POST['ct_qty'][$i] <= 0) continue;
|
||||
|
||||
// 옵션있는 상품이라면 건너뜀
|
||||
if($arr_item[$i]['opt_skip'])
|
||||
continue;
|
||||
|
||||
// 포인트 사용하지 않는다면
|
||||
if (!$config['cf_use_point']) $_POST['it_point'][$i] = 0;
|
||||
|
||||
@ -151,7 +169,7 @@ else if ($act == "multi") // 여러개의 상품이 한꺼번에 들어옴.
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id'][$i]}', '{$_POST['it_name'][$i]}', '쇼핑', '{$_POST['it_price'][$i]}', '{$_POST['it_point'][$i]}', '0', '0', '{$_POST['it_name'][$i]}', '{$_POST['ct_qty'][$i]}', '0', '', '0', '0', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id'][$i]}', '{$_POST['it_name'][$i]}', '쇼핑', '{$_POST['it_price'][$i]}', '{$_POST['it_point'][$i]}', '0', '0', '{$_POST['it_name'][$i]}', '{$_POST['ct_qty'][$i]}', '0', '{$arr_item[$i]['notax']}', '', '0', '0', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
|
||||
$comma = ' , ';
|
||||
$ct_count++;
|
||||
}
|
||||
@ -252,11 +270,11 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
|
||||
// 장바구니에 Insert
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g4['shop_cart_table']}
|
||||
( uq_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_direct, ct_send_cost )
|
||||
( uq_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_direct, ct_send_cost )
|
||||
VALUES ";
|
||||
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$i', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct', '$ct_send_cost' )";
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$i', '{$it['it_notax']}', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct', '$ct_send_cost' )";
|
||||
$comma = ' , ';
|
||||
}
|
||||
|
||||
@ -379,7 +397,7 @@ else // 장바구니에 담기
|
||||
$ct_count = 0;
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g4['shop_cart_table']}
|
||||
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select )
|
||||
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select )
|
||||
VALUES ";
|
||||
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
@ -400,7 +418,7 @@ else // 장바구니에 담기
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$it['it_notax']}', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
|
||||
$comma = ' , ';
|
||||
$ct_num++;
|
||||
$ct_count++;
|
||||
|
||||
@ -15,10 +15,45 @@ if (!$od['od_id']) {
|
||||
alert("존재하는 주문이 아닙니다.");
|
||||
}
|
||||
|
||||
if ($od['od_temp_amount'] > 0 && $od['od_receipt_amount'] == 0) {
|
||||
;
|
||||
} else {
|
||||
// 주문상품의 상태가 주문인지 체크
|
||||
$sql = " select SUM(IF(ct_status = '주문', 1, 0)) as od_count2,
|
||||
COUNT(*) as od_count1
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '$uq_id' ";
|
||||
$ct = sql_fetch($sql);
|
||||
|
||||
if($ct['od_count1'] != $ct['od_count2'] || ($od['od_settle_case'] == '가상계좌' && $od['od_receipt_amount'] > 0))
|
||||
alert("취소할 수 있는 주문이 아닙니다.", G4_SHOP_URL."/orderinquiryview.php?od_id=$od_id&uq_id=$uq_id");
|
||||
|
||||
// PG 결제 취소
|
||||
if($od['od_tno']) {
|
||||
if (file_exists('./settle_'.$default['de_card_pg'].'.inc.php')) {
|
||||
include './settle_'.$default['de_card_pg'].'.inc.php';
|
||||
}
|
||||
$_POST['tno'] = $od['od_tno'];
|
||||
$_POST['req_tx'] = 'mod';
|
||||
$_POST['mod_type'] = 'STSC';
|
||||
if($od['od_escrow']) {
|
||||
$_POST['req_tx'] = 'mod_escrow';
|
||||
$_POST['mod_type'] = 'STE2';
|
||||
if($od['od_settle_case'] == '가상계좌')
|
||||
$_POST['mod_type'] = 'STE5';
|
||||
}
|
||||
$_POST['mod_desc'] = iconv("utf-8", "euc-kr", '주문자 본인 취소-'.$cancel_memo);
|
||||
$_POST['site_cd'] = $default['de_kcp_mid'];
|
||||
|
||||
// 취소내역 한글깨짐방지
|
||||
$def_locale = setlocale(LC_CTYPE, 0);
|
||||
$locale_change = false;
|
||||
if(preg_match("/utf[\-]?8/i", $def_locale)) {
|
||||
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
|
||||
$locale_change = true;
|
||||
}
|
||||
|
||||
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||
|
||||
if($locale_change)
|
||||
setlocale(LC_CTYPE, $def_locale);
|
||||
}
|
||||
|
||||
// 장바구니 자료 취소
|
||||
@ -27,7 +62,7 @@ sql_query(" update {$g4['shop_cart_table']} set ct_status = '취소' where uq_id
|
||||
// 주문 취소
|
||||
$cancel_memo = addslashes($cancel_memo);
|
||||
//sql_query(" update $g4[shop_order_table] set od_temp_point = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - {$g4['time_ymdhis']} (취소이유 : {$cancel_memo})\") where uq_id = '$uq_id' ");
|
||||
sql_query(" update {$g4['shop_order_table']} set od_send_cost = '0', od_send_cost2 = '0', od_temp_point = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - ".G4_TIME_YMDHIS." (취소이유 : {$cancel_memo})\") where uq_id = '$uq_id' ");
|
||||
sql_query(" update {$g4['shop_order_table']} set od_send_cost = '0', od_send_cost2 = '0', od_temp_point = '0', od_receipt_amount = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - ".G4_TIME_YMDHIS." (취소이유 : {$cancel_memo})\") where uq_id = '$uq_id' ");
|
||||
|
||||
// 주문취소 회원의 포인트를 되돌려 줌
|
||||
if ($od['od_receipt_point'] > 0) {
|
||||
|
||||
@ -57,6 +57,8 @@ if(openwin != null) {
|
||||
<dd>상품 배송이 완료되었습니다.</dd>
|
||||
</dl>
|
||||
<?php
|
||||
$od_count1 = $od_count2 = 0;
|
||||
|
||||
$sql = " select it_id, it_name, cp_amount
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '$uq_id'
|
||||
@ -119,6 +121,11 @@ if(openwin != null) {
|
||||
$tot_point += $point;
|
||||
$tot_sell_amount += $sell_amount;
|
||||
}
|
||||
|
||||
// 전체 상품의 상태가 주문인지 비교할 때 사용
|
||||
$od_count1++;
|
||||
if($opt['ct_status'] == '주문')
|
||||
$od_count2++;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
@ -541,18 +548,18 @@ if(openwin != null) {
|
||||
<?php
|
||||
// 취소한 내역이 없다면
|
||||
if ($tot_cancel_amount == 0) {
|
||||
if ($od['od_temp_amount'] > 0 && $od['od_receipt_amount'] == 0) {
|
||||
if ($od_count1 == $od_count2 && ($od['od_settle_case'] != '가상계좌' || $od['od_receipt_amount'] == 0)) {
|
||||
?>
|
||||
<button type="button" onclick="document.getElementById('sod_fin_cancelfrm').style.display='block';">주문 취소하기</button>
|
||||
|
||||
<div id="sod_fin_cancelfrm">
|
||||
<form method="post" action="./orderinquirycancel.php">
|
||||
<form method="post" action="./orderinquirycancel.php" onsubmit="return fcancel_check(this);">
|
||||
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
|
||||
<input type="hidden" name="uq_id" value="<?php echo $od['uq_id']; ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
|
||||
<label for="cancel_memo">취소사유</label>
|
||||
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input" size="40" maxlength="100">
|
||||
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input required" size="40" maxlength="100">
|
||||
<input type="submit" value="확인" class="btn_frmline">
|
||||
|
||||
</form>
|
||||
@ -586,6 +593,22 @@ if(openwin != null) {
|
||||
</div>
|
||||
<!-- } 주문상세내역 끝 -->
|
||||
|
||||
<script>
|
||||
function fcancel_check(f)
|
||||
{
|
||||
if(!confirm("주문을 정말 취소하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
var memo = f.cancel_memo.value;
|
||||
if(memo == "") {
|
||||
alert("취소사유를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once('./_tail.php');
|
||||
?>
|
||||
BIN
skin/board/basic/img/btn_close.gif
Normal file
BIN
skin/board/basic/img/btn_close.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 211 B |
@ -33,6 +33,21 @@
|
||||
#bo_sch {margin-bottom:10px;padding-top:5px;text-align:center}
|
||||
#bo_sch legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}
|
||||
|
||||
/* 게시판 쓰기 */
|
||||
#autosave_wrapper {position:relative}
|
||||
#autosave_pop {display:none;z-index:10;position:absolute;top:24px;right:117px;padding:8px;width:350px;height:auto !important;height:180px;max-height:180px;border:1px solid #565656;background:#fff;overflow-y:scroll}
|
||||
html.no-overflowscrolling #autosave_pop {height:auto;max-height:10000px !important} /* overflow 미지원 기기 대응 */
|
||||
#autosave_pop strong {position:absolute;font-size:0;line-height:0;overflow:hidden}
|
||||
#autosave_pop div {text-align:right}
|
||||
#autosave_pop button {margin:0;padding:0;border:0;background:transparent}
|
||||
#autosave_pop ul {margin:10px 0;padding:0;border-top:1px solid #e9e9e9;list-style:none}
|
||||
#autosave_pop li {padding:8px 5px;border-bottom:1px solid #e9e9e9;zoom:1}
|
||||
#autosave_pop li:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#autosave_pop a {display:block;float:left}
|
||||
#autosave_pop span {display:block;float:right}
|
||||
.autosave_close {cursor:pointer;}
|
||||
.autosave_content {display:none;}
|
||||
|
||||
/* 게시판 읽기 */
|
||||
#bo_v {margin-bottom:20px;padding-bottom:20px}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<!-- 게시물 작성/수정 시작 { -->
|
||||
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">
|
||||
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
|
||||
<input type="hidden" name="w" value="<?php echo $w ?>">
|
||||
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
|
||||
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
|
||||
@ -102,7 +103,21 @@ echo $option_hidden;
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255"></td>
|
||||
<td>
|
||||
<div id="autosave_wrapper">
|
||||
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255">
|
||||
<?php if ($is_member) { // 임시 저장된 글 기능 ?>
|
||||
<script src="<?php echo G4_JS_URL; ?>/autosave.js"></script>
|
||||
<button type="button" id="btn_autosave" class="btn_frmline">임시 저장된 글 (<span id="autosave_count"><?php echo $autosave_count; ?></span>)</button>
|
||||
<div id="autosave_pop">
|
||||
<strong>임시 저장된 글 목록</strong>
|
||||
<div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
|
||||
<ul></ul>
|
||||
<div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@ -211,4 +226,4 @@ function fwrite_submit(f)
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<!-- } 게시물 작성/수정 끝 -->
|
||||
<!-- } 게시물 작성/수정 끝 -->
|
||||
|
||||
@ -102,7 +102,19 @@ echo $option_hidden;
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255"></td>
|
||||
<td>
|
||||
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255">
|
||||
<?php if ($is_member) { // 임시 저장된 글 기능 ?>
|
||||
<script src="<?php echo G4_JS_URL; ?>/autosave.js"></script>
|
||||
<button type="button" id="btn_autosave" class="btn_frmline">임시 저장된 글 (<span id="autosave_count"><?php echo $autosave_count; ?></span>)</button>
|
||||
<div id="autosave_pop">
|
||||
<strong>임시 저장된 글 목록</strong>
|
||||
<div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
|
||||
<ul></ul>
|
||||
<div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -16,7 +16,8 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $i<count($list); $i++) {
|
||||
$location = conv_content($list[$i]['lo_location'], 0);
|
||||
//$location = conv_content($list[$i]['lo_location'], 0);
|
||||
$location = $list[$i]['lo_location'];
|
||||
// 최고관리자에게만 허용
|
||||
// 이 조건문은 가능한 변경하지 마십시오.
|
||||
if ($list[$i]['lo_url'] && $is_admin == 'super') $display_location = "<a href=\"".$list[$i]['lo_url']."\">".$location."</a>";
|
||||
|
||||
@ -6,10 +6,8 @@
|
||||
#ol_before {}
|
||||
#ol_before fieldset {position:relative}
|
||||
#ol_id {display:block;margin:0 0 5px !important;margin:0 0 3px;padding:0 5px;width:168px;height:22px;border:1px solid #b8c9c2;background:#f7f7f7;line-height:1.6em}
|
||||
#ol_id:focus {border-color:#333;background:#21272e;color:#fff}
|
||||
.ol_idlabel {position:absolute;top:6px;left:5px;color:#333;font-size:0.95em}
|
||||
#ol_pw {display:block;margin:0 0 5px !important;margin:0 0 3px;padding:0 5px;width:168px;height:22px;border:1px solid #b8c9c2;background:#f7f7f7;vertical-align:top;line-height:1.6em}
|
||||
#ol_pw:focus {border-color:#333;background:#21272e;color:#fff}
|
||||
.ol_pwlabel {position:absolute;top:35px;left:5px;color:#333;font-size:0.95em}
|
||||
#auto_login {}
|
||||
#auto_login_label {letter-spacing:-0.1em}
|
||||
|
||||
Reference in New Issue
Block a user