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

This commit is contained in:
chicpro
2013-11-06 10:06:30 +09:00
14 changed files with 126 additions and 50 deletions

View File

@ -650,7 +650,7 @@ $pg_anchor = '<ul class="anchor">
<tr>
<th scope="row"><label for="de_delivery_company">배송업체</label></th>
<td>
<?php echo help("이용중 이거나 이용하실 배송업체를 선택하세요.", 50); ?>
<?php echo help("이용 중이거나 이용하실 배송업체를 선택하세요.", 50); ?>
<select name="de_delivery_company" id="de_delivery_company">
<option value="">없음</option>
<option value="자체배송" <?php echo get_selected($default['de_delivery_company'], "자체배송"); ?>>자체배송</option>

View File

@ -215,9 +215,23 @@ $pg_anchor ='<ul class="anchor">
<tr>
<th scope="row"><label for="it_name">상품명</label></th>
<td colspan="2">
<?php echo help("HTML 입력이 불가합니다."); ?>
<input type="text" name="it_name" value="<?php echo get_text(cut_str($it['it_name'], 250, "")); ?>" id="it_name" required class="frm_input required" size="95">
</td>
</tr>
<tr>
<th scope="row"><label for="it_basic">기본설명</label></th>
<td>
<?php echo help("상품명 하단에 상품에 대한 추가적인 설명이 필요한 경우에 입력합니다. HTML 입력도 가능합니다."); ?>
<input type="text" name="it_basic" value="<?php echo get_text($it['it_basic']); ?>" id="it_basic" class="frm_input" size="95">
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_ca_it_basic" value="1" id="chk_ca_it_basic">
<label for="chk_ca_it_basic">분류적용</label>
<input type="checkbox" name="chk_all_it_basic" value="1" id="chk_all_it_basic">
<label for="chk_all_it_basic">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="it_mobile_name">모바일 상품명</label></th>
<td colspan="2">
@ -338,19 +352,6 @@ $pg_anchor ='<ul class="anchor">
<label for="chk_all_it_use">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="it_basic">기본설명</label></th>
<td>
<?php echo help("상품상세페이지의 상품설명 상단에 표시되는 설명입니다. HTML 입력도 가능합니다."); ?>
<input type="text" name="it_basic" value="<?php echo get_text($it['it_basic']); ?>" id="it_basic" class="frm_input" size="80">
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_ca_it_basic" value="1" id="chk_ca_it_basic">
<label for="chk_ca_it_basic">분류적용</label>
<input type="checkbox" name="chk_all_it_basic" value="1" id="chk_all_it_basic">
<label for="chk_all_it_basic">전체적용</label>
</td>
</tr>
<tr>
<th scope="row">상품설명</th>
<td colspan="2"> <?php echo editor_html('it_explan', $it['it_explan']); ?></td>

View File

@ -256,6 +256,10 @@ $it_info_value = serialize($value_array);
if($it_point_type == 1 && $it_point > 99)
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
$it_name = strip_tags(trim($_POST['it_name']));
if ($it_name == "")
alert("상품명을 입력해 주십시오.");
$sql_common = " ca_id = '$ca_id',
ca_id2 = '$ca_id2',
ca_id3 = '$ca_id3',

View File

@ -21,31 +21,11 @@ sql_query($sql);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// 주문포인트를 적립한다.
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
// 설정일이 0 이면 주문서 완료 설정 시점에서 포인트를 바로 부여합니다.
//------------------------------------------------------------------------------
function save_order_point($ct_status="완료")
{
global $default;
$beforedays = date("Y-m-d H:i:s", ( time() - (86400 * (int)$default['de_point_days']) ) ); // 86400초는 하루
$sql = " select * from {$g5['g5_shop_cart_table']} where ct_status = '$ct_status' and ct_point_use = '0' and ct_time <= '$beforedays' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 회원 ID 를 얻는다.
$od_row = sql_fetch("select od_id, mb_id from {$g5['g5_shop_order_table']} where od_id = '{$row['od_id']}' ");
if ($od_row['mb_id'] && $row['ct_point'] > 0) { // 회원이면서 포인트가 0보다 크다면
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "주문번호 {$od_row['od_id']} ({$row['ct_id']}) 배송완료";
insert_point($od_row['mb_id'], $po_point, $po_content, "@delivery", $od_row['mb_id'], "{$od_row['od_id']},{$row['ct_id']}");
}
sql_query("update {$g5['g5_shop_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");
}
}
// 완료된 주문에 포인트를 적립한다.
save_order_point("완료");
/*
//------------------------------------------------------------------------------
// 주문완료 포인트
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
@ -75,6 +55,7 @@ if (!isset($order_not_point)) {
}
}
//------------------------------------------------------------------------------
*/
//------------------------------------------------------------------------------

View File

@ -65,7 +65,8 @@ if ($od_receipt_point) {
}
if ($od_coupon) {
$where[] = " od_coupon != 0 ";
// 개별상품쿠폰, 배송비쿠폰, 주문금액쿠폰
$where[] = " (od_cart_coupon + od_send_coupon + od_coupon) != 0 ";
}
if ($fr_date && $to_date) {
@ -180,7 +181,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<input type="checkbox" name="od_receipt_point" value="Y" id="od_misu04" <?php echo get_checked($od_receipt_point, 'Y'); ?>>
<label for="od_misu04">포인트주문</label>
<input type="checkbox" name="od_coupon" value="Y" id="od_misu05" <?php echo get_checked($od_coupon, 'Y'); ?>>
<label for="od_misu05">쿠폰</label>
<label for="od_misu05">쿠폰할인</label>
</div>
<div class="sch_last">

View File

@ -3,14 +3,15 @@
/* 초기화 */
html {overflow-y:scroll}
body {margin:0;padding:0;background:#fff;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, input, textarea, select, button {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}
#hd ul, nav ul, #ft ul {margin:0;padding:0;list-style:none}
legend {position:absolute;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}
label, input, select, img {vertical-align:middle}
input {margin:0;padding:0;border-radius:0}
button {border-radius:0}
input, button {margin:0;padding:0;font-family:dotum;font-size:1em}
textarea, select {font-family:dotum;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}

View File

@ -10,7 +10,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav,
header ul, nav ul, footer ul {margin:0;padding:0;list-style:none}
legend {position:absolute;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}
label, input, select, img {vertical-align:middle}
input,button {margin:0;padding:0;font-size:1em}
input, button {margin:0;padding:0;font-size:1em}
input[type=text], input[type=password], input[type=submit], input[type=image], button {border-radius:0;font-size:1em;-webkit-appearance:none}
textarea, select {font-size:1em}
textarea {border-radius:0;-webkit-appearance:none}

View File

@ -77,6 +77,7 @@ class item_list
protected $view_it_id = false; // 상품코드
protected $view_it_img = true; // 상품이미지
protected $view_it_name = true; // 상품명
protected $view_it_basic = true; // 기본설명
protected $view_it_price = true; // 판매가격
protected $view_it_cust_price = false; // 소비자가
protected $view_it_icon = false; // 아이콘
@ -389,6 +390,7 @@ function get_image($img, $width=0, $height=0, $img_id='')
return $str;
}
// 상품 이미지를 얻는다
function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='')
{
@ -448,6 +450,8 @@ function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='')
return $img;
}
// 상품이미지 썸네일 생성
function get_it_thumbnail($img, $width, $height=0, $id='')
{
$str = '';
@ -481,7 +485,8 @@ function get_it_thumbnail($img, $width, $height=0, $id='')
return $str;
}
//
// 이미지 URL 을 얻는다.
function get_it_imageurl($it_id)
{
global $g5;
@ -513,6 +518,7 @@ function get_it_imageurl($it_id)
return $str;
}
// 상품의 재고 (창고재고수량 - 주문대기수량)
function get_it_stock_qty($it_id)
{
@ -535,6 +541,7 @@ function get_it_stock_qty($it_id)
return $jaego - $daegi;
}
// 옵션의 재고 (창고재고수량 - 주문대기수량)
function get_option_stock_qty($it_id, $io_id, $type)
{
@ -560,6 +567,7 @@ function get_option_stock_qty($it_id, $io_id, $type)
return $jaego - $daegi;
}
// 큰 이미지
function get_large_image($img, $it_id, $btn_image=true)
{
@ -579,6 +587,7 @@ function get_large_image($img, $it_id, $btn_image=true)
return $str;
}
// 금액 표시
function display_price($price, $tel_inq=false)
{
@ -590,6 +599,7 @@ function display_price($price, $tel_inq=false)
return $price;
}
// 금액표시
// $it : 상품 배열
function get_price($it)
@ -610,12 +620,14 @@ function display_point($point)
return number_format($point, 0).'점';
}
// 포인트를 구한다
function get_point($amount, $point)
{
return (int)($amount * $point / 100);
}
// HTML 특수문자 변환 htmlspecialchars
function htmlspecialchars2($str)
{
@ -624,6 +636,7 @@ function htmlspecialchars2($str)
return $str;
}
// 상품이미지 업로드
function it_img_upload($srcfile, $filename, $dir)
{
@ -654,6 +667,7 @@ function it_img_upload($srcfile, $filename, $dir)
return $file;
}
// 파일을 업로드 함
function upload_file($srcfile, $destfile, $dir)
{
@ -664,6 +678,7 @@ function upload_file($srcfile, $destfile, $dir)
return true;
}
function message($subject, $content, $align="left", $width="450")
{
$str = "
@ -689,6 +704,7 @@ function message($subject, $content, $align="left", $width="450")
return $str;
}
// 시간이 비어 있는지 검사
function is_null_time($datetime)
{
@ -701,6 +717,7 @@ function is_null_time($datetime)
return false;
}
// 출력유형, 스킨파일, 1라인이미지수, 총라인수, 이미지폭, 이미지높이
// 1.02.01 $ca_id 추가
//function display_type($type, $skin_file, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
@ -745,6 +762,7 @@ function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_wid
}
}
// 모바일 유형별 상품 출력
function mobile_display_type($type, $skin_file, $list_row, $img_width, $img_height, $ca_id="")
{
@ -774,6 +792,7 @@ function mobile_display_type($type, $skin_file, $list_row, $img_width, $img_heig
}
}
// 분류별 출력
// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호
function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
@ -801,6 +820,7 @@ function display_category($no, $list_mod, $list_row, $img_width, $img_height, $c
}
}
// 별
function get_star($score)
{
@ -814,6 +834,7 @@ function get_star($score)
return $star;
}
// 별 이미지
function get_star_image($it_id)
{
@ -825,6 +846,7 @@ function get_star_image($it_id)
return (int)get_star($row['score']);
}
// 메일 보내는 내용을 HTML 형식으로 만든다.
function email_content($str)
{
@ -840,6 +862,7 @@ function email_content($str)
return $s;
}
// 타임스탬프 형식으로 넘어와야 한다.
// 시작시간, 종료시간
function gap_time($begin_time, $end_time)
@ -864,6 +887,7 @@ function continue_cut_str($str, $len=80)
return preg_replace($pattern, "\\0\n", $str);
}
// 제목별로 컬럼 정렬하는 QUERY STRING
// $type 이 1이면 반대
function title_sort($col, $type=0)
@ -903,6 +927,7 @@ function session_check()
gotourl(G5_SHOP_URL);
}
// 상품 선택옵션
function get_item_options($it_id, $subject)
{
@ -990,6 +1015,7 @@ function get_item_options($it_id, $subject)
return $str;
}
// 상품 추가옵션
function get_item_supply($it_id, $subject)
{
@ -1059,6 +1085,7 @@ function get_item_supply($it_id, $subject)
return $str;
}
function print_item_options($it_id, $cart_id)
{
global $g5;
@ -1079,6 +1106,7 @@ function print_item_options($it_id, $cart_id)
return $str;
}
// 일자형식변환
function date_conv($date, $case=1)
{
@ -1091,6 +1119,7 @@ function date_conv($date, $case=1)
return $date;
}
// 배너출력
function display_banner($position, $num="")
{
@ -1101,6 +1130,7 @@ function display_banner($position, $num="")
include G5_SHOP_SKIN_PATH.'/boxbanner'.$num.'.skin.php';
}
// 1.00.02
// 파일번호, 이벤트번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이
// 1.02.01 $ca_id 추가
@ -1130,6 +1160,7 @@ function display_event($no, $event, $list_mod, $list_row, $img_width, $img_heigh
}
}
function get_yn($val, $case='')
{
switch ($case) {
@ -1139,6 +1170,7 @@ function get_yn($val, $case='')
return $result;
}
// 상품명과 건수를 반환
function get_goods($cart_id)
{
@ -1213,6 +1245,7 @@ function check_datetime($datetime)
return false;
}
// 경고메세지를 경고창으로
function alert_opener($msg='', $url='')
{
@ -1229,6 +1262,7 @@ function alert_opener($msg='', $url='')
exit;
}
// option 리스트에 selected 추가
function conv_selected_option($options, $value)
{
@ -1240,6 +1274,7 @@ function conv_selected_option($options, $value)
return $options;
}
// 주문서 번호를 얻는다.
function get_new_od_id()
{
@ -1266,6 +1301,7 @@ function get_new_od_id()
return $od_id;
}
// cart id 설정
function set_cart_id($direct)
{
@ -1314,6 +1350,7 @@ function set_cart_id($direct)
}
}
// 상품 목록 : 관련 상품 출력
function relation_item($it_id, $width, $height, $rows=3)
{
@ -1349,6 +1386,7 @@ function relation_item($it_id, $width, $height, $rows=3)
return $str;
}
// 상품이미지에 유형 아이콘 출력
function item_icon($it)
{
@ -1378,6 +1416,7 @@ function item_icon($it)
return $icon;
}
// sns 공유하기
function get_sns_share_link($sns, $url, $title, $img)
{
@ -1399,6 +1438,7 @@ function get_sns_share_link($sns, $url, $title, $img)
return $str;
}
// 상품이미지 썸네일 삭제
function delete_item_thumbnail($dir, $file)
{
@ -1416,6 +1456,7 @@ function delete_item_thumbnail($dir, $file)
}
}
// 쿠폰번호 생성함수
function get_coupon_id()
{
@ -1439,6 +1480,7 @@ function get_coupon_id()
return $str;
}
// array_map() 대체
function array_add_callback($func, $array)
{
@ -1461,6 +1503,7 @@ function array_add_callback($func, $array)
return $array;
}
// 주문의 금액, 배송비 과세금액 등의 정보를 가져옴
function get_order_info($od_id)
{
@ -1605,6 +1648,7 @@ function get_order_info($od_id)
return $info;
}
// 상품포인트
function get_item_point($it)
{
@ -1619,6 +1663,7 @@ function get_item_point($it)
return $it_point;
}
// 배송비 구함
function get_sendcost($cart_id, $selected=1)
{
@ -1672,6 +1717,7 @@ function get_sendcost($cart_id, $selected=1)
return ($total_send_cost + $send_cost);
}
// 상품별 배송비
function get_item_sendcost($it_id, $price, $qty)
{
@ -1708,6 +1754,7 @@ function get_item_sendcost($it_id, $price, $qty)
return $sendcost;
}
// 쿠폰 사용체크
function is_used_coupon($mb_id, $cp_id)
{
@ -1723,6 +1770,33 @@ function is_used_coupon($mb_id, $cp_id)
return $used;
}
//------------------------------------------------------------------------------
// 주문포인트를 적립한다.
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
// 설정일이 0 이면 주문서 완료 설정 시점에서 포인트를 바로 부여합니다.
//------------------------------------------------------------------------------
function save_order_point($ct_status="완료")
{
global $default;
$beforedays = date("Y-m-d H:i:s", ( time() - (86400 * (int)$default['de_point_days']) ) ); // 86400초는 하루
$sql = " select * from {$g5['g5_shop_cart_table']} where ct_status = '$ct_status' and ct_point_use = '0' and ct_time <= '$beforedays' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 회원 ID 를 얻는다.
$od_row = sql_fetch("select od_id, mb_id from {$g5['g5_shop_order_table']} where od_id = '{$row['od_id']}' ");
if ($od_row['mb_id'] && $row['ct_point'] > 0) { // 회원이면서 포인트가 0보다 크다면
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "주문번호 {$od_row['od_id']} ({$row['ct_id']}) 배송완료";
insert_point($od_row['mb_id'], $po_point, $po_content, "@delivery", $od_row['mb_id'], "{$od_row['od_id']},{$row['ct_id']}");
}
sql_query("update {$g5['g5_shop_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");
}
}
//==============================================================================
// 쇼핑몰 라이브러리 모음 끝
//==============================================================================

View File

@ -32,6 +32,7 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
@ -52,6 +53,7 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
$list->set_type(2);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
@ -72,6 +74,7 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
$list->set_type(3);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
@ -92,6 +95,7 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
$list->set_type(4);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
@ -112,6 +116,7 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
$list->set_type(5);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);

View File

@ -97,6 +97,7 @@ var itemlist_ca_id = "<?php echo $ca_id; ?>";
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);

View File

@ -149,12 +149,12 @@ if(openwin != null) {
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_price']); ?> 원</strong></dd>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">상품할인</dt>
<dt class="sod_bsk_dvr">개별상품 쿠폰할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">결제할인</dt>
<dt class="sod_bsk_dvr">주문금액 쿠폰할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
<?php } ?>
@ -164,7 +164,7 @@ if(openwin != null) {
<?php } ?>
<?php if($od['od_send_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비할인</dt>
<dt class="sod_bsk_dvr">배송비 쿠폰할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
<?php } ?>

View File

@ -83,9 +83,9 @@ $total_count = $row['cnt'];
$save['it_id'][$save['cnt']] = $row['it_id'];
$save[cnt]++;
}
mysql_free_result($result);
}
mysql_free_result($result);
write_search_save($save);
function write_search_save($save)
@ -106,7 +106,7 @@ $total_count = $row['cnt'];
?>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $ca_temp?><a href="./list.php?ca_id=<?php echo $save['ca_id']; ?>"><?php echo $row['ca_name']; ?></a> 상품<?php echo $save['cnt']; ?>개</caption>
<caption><?php echo $ca_temp?><a href="./list.php?ca_id=<?php echo $save['ca_id']; ?>"><?php echo $row['ca_name']; ?></a> 상품<?php echo (int)$save['cnt']; ?>개</caption>
<thead>
<tr>
<th scope="col">이미지</td>

View File

@ -41,6 +41,10 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
echo "<b>".stripslashes($row['it_name'])."</b>\n";
}
if ($this->view_it_basic) {
echo "<b>".stripslashes($row['it_basic'])."</b>\n";
}
if ($this->view_it_cust_price) {
echo "<span class=\"sct_cost\">".display_price($row['it_cust_price'])."</span>\n";
}

View File

@ -41,6 +41,10 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
echo "<b>".stripslashes($row['it_name'])."</b>\n";
}
if ($this->view_it_basic) {
echo "<b>".stripslashes($row['it_basic'])."</b>\n";
}
if ($this->view_it_cust_price) {
echo "<span class=\"sct_cost\">".display_price($row['it_cust_price'])."</span>\n";
}