영카트 리스트 스킨 만들어 주실분~!! 정보
영카트 리스트 스킨 만들어 주실분~!!
관련링크
첨부파일
본문
링크페이지를 완성할려고 합니다.
스킨을 제작하는거구요.
제품 상세페이지가 아닌 리스트 페이지에서 구매,장바구니,추천,보관 기능을 사용할려고 합니다.
자바스크립트를 잘 몰라서요.
혹시 만들어 주실분 계실까요?
스킨을 제작하는거구요.
제품 상세페이지가 아닌 리스트 페이지에서 구매,장바구니,추천,보관 기능을 사용할려고 합니다.
자바스크립트를 잘 몰라서요.
혹시 만들어 주실분 계실까요?
댓글 전체
테스트는 못해봤습니다. 백업해놓고 적용해 보시길 바랍니다.
수정할 파일은 총 2개입니다.
1. list.php
2. list.skin.xx.php (사용하고 있는 스킨)
1. list.php 파일에 다음 4가지 javascript를 추가합니다.
2. list.skin.xx.php 파일에서 1번에서 추가한 javascrpt를 제거합니다. (fitemcheck, amount_change, qty_add, get_amount)
====================================================
<script type="text/javascript">
// 바로구매 또는 장바구니 담기
function fitemcheck(f, act)
{
// 판매가격이 0 보다 작다면
if (f.it_amount.value < 0)
{
alert("전화로 문의해 주시면 감사하겠습니다.");
return;
}
for (i=1; i<=6; i++)
{
if (typeof(f.elements["it_opt"+i]) != 'undefined')
{
if (f.elements["it_opt"+i].value == '선택') {
alert(f.elements["it_opt"+i+"_subject"].value + '을(를) 선택하여 주십시오.');
f.elements["it_opt"+i].focus();
return;
}
}
}
if (act == "direct_buy") {
f.sw_direct.value = 1;
} else {
f.sw_direct.value = 0;
}
if (!f.ct_qty.value) {
alert("수량을 입력해 주십시오.");
f.ct_qty.focus();
return;
} else if (isNaN(f.ct_qty.value)) {
alert("수량을 숫자로 입력해 주십시오.");
f.ct_qty.select();
f.ct_qty.focus();
return;
} else if (parseInt(f.ct_qty.value) < 1) {
alert("수량은 1 이상 입력해 주십시오.");
f.ct_qty.focus();
return;
}
amount_change(f);
f.submit();
}
function amount_change(f)
{
var basic_amount = parseInt(f.it_amount.value); // 판매가격
var basic_point = parseFloat(f.it_point.value); //포인트
var cust_amount = parseFloat(f.it_cust_amount.value); // 시중가격
var opt1 = 0;
var opt2 = 0;
var opt3 = 0;
var opt4 = 0;
var opt5 = 0;
var opt6 = 0;
var ct_qty = 0;
if (typeof(f.ct_qty) != 'undefined')
ct_qty = parseInt(f.ct_qty.value);
if (typeof(f.it_opt1) != 'undefined') opt1 = get_amount(f.it_opt1.value);
if (typeof(f.it_opt2) != 'undefined') opt2 = get_amount(f.it_opt2.value);
if (typeof(f.it_opt3) != 'undefined') opt3 = get_amount(f.it_opt3.value);
if (typeof(f.it_opt4) != 'unde격ined') opt4 = get_amount(f.it_opt4.value);
if (typeof(f.it_opt5) != 'undefined') opt5 = get_amount(f.it_opt5.value);
if (typeof(f.it_opt6) != 'undefined') opt6 = get_amount(f.it_opt6.value);
var amount = basic_amount + opt1 + opt2 + opt3 + opt4 + opt5 + opt6;
var point = parseInt(basic_point);
if (typeof(f.it_amount) != 'undefined')
f.it_amount.value = amount;
if (typeof(f.disp_sell_amount) != 'undefined')
f.disp_sell_amount.value = number_format(String(amount * ct_qty));
if (typeof(f.disp_cust_amount) != 'undefined')
f.disp_cust_amount.value = number_format(String(cust_amount * ct_qty));
if (typeof(f.it_point) != 'undefined') {
f.it_point.value = point;
f.disp_point.value = number_format(String(point * ct_qty));
}
}
function qty_add(f, num)
{
var qty = parseInt(f.ct_qty.value);
if (num < 0 && qty <= 1)
{
alert("수량은 1 이상만 가능합니다.");
qty = 1;
}
else if (num > 0 && qty >= 9999)
{
alert("수량은 9999 이하만 가능합니다.");
qty = 9999;
}
else
{
qty = qty + num;
}
f.ct_qty.value = qty;
amount_change(f);
}
function get_amount(data)
{
var str = data.split(";");
var num = parseInt(str[1]);
if (isNaN(num)) {
return 0;
} else {
return num;
}
}
</script>
====================================================
3. list.skin.xx.php (사용하고 있는 스킨)
====================================================
3-1. fitem 폼의 수량 input 태그를 다음과 같이 수정
<input type=text name=ct_qty value='1' onkeyup='amount_change(this.form)'>
3-2. 구매, 장바구니 javascript 수정
<a href="javascript:fitemcheck(this.form, 'direct_buy');">구매</a>
<a href="javascript:fitemcheck(this.form, 'cart_update');">장바구니</a>
3-3. fitem 폼에 다음 input 태그 추가
<input type=hidden name=it_point value='<?=$row[it_point];?>'>
<input type=hidden name=it_cust_amount value='<?=$row[it_cust_amount];?>'>
3-4. fitem 폼의 가격 input 태그를 다음과 같이 수정
<? if ($member[mb_level] >= $default[de_level_sell]) { ?><input type=text name=disp_sell_amount size=12 style='text-align:right; border:none; border-width:0px; font-weight:bold; width:80px; font-family:Tahoma;' class=amount readonly> 원<input type=hidden name=it_amount value='<?=$row[it_amount];?>'><? } else { ?> 상품 구입 권한이 없습니다.<input type=hidden name=it_amount value='0'><? } ?>
3-5. 수량 변경 화살표 부분의 javascript를 다음과 같이 수정합니다.
<area shape="rect" coords="0, 0, 10, 9" href="javascript:qty_add(this.form, +1);">
<area shape="rect" coords="0, 10, 10, 19" href="javascript:qty_add(this.form, -1);">
====================================================
수정할 파일은 총 2개입니다.
1. list.php
2. list.skin.xx.php (사용하고 있는 스킨)
1. list.php 파일에 다음 4가지 javascript를 추가합니다.
2. list.skin.xx.php 파일에서 1번에서 추가한 javascrpt를 제거합니다. (fitemcheck, amount_change, qty_add, get_amount)
====================================================
<script type="text/javascript">
// 바로구매 또는 장바구니 담기
function fitemcheck(f, act)
{
// 판매가격이 0 보다 작다면
if (f.it_amount.value < 0)
{
alert("전화로 문의해 주시면 감사하겠습니다.");
return;
}
for (i=1; i<=6; i++)
{
if (typeof(f.elements["it_opt"+i]) != 'undefined')
{
if (f.elements["it_opt"+i].value == '선택') {
alert(f.elements["it_opt"+i+"_subject"].value + '을(를) 선택하여 주십시오.');
f.elements["it_opt"+i].focus();
return;
}
}
}
if (act == "direct_buy") {
f.sw_direct.value = 1;
} else {
f.sw_direct.value = 0;
}
if (!f.ct_qty.value) {
alert("수량을 입력해 주십시오.");
f.ct_qty.focus();
return;
} else if (isNaN(f.ct_qty.value)) {
alert("수량을 숫자로 입력해 주십시오.");
f.ct_qty.select();
f.ct_qty.focus();
return;
} else if (parseInt(f.ct_qty.value) < 1) {
alert("수량은 1 이상 입력해 주십시오.");
f.ct_qty.focus();
return;
}
amount_change(f);
f.submit();
}
function amount_change(f)
{
var basic_amount = parseInt(f.it_amount.value); // 판매가격
var basic_point = parseFloat(f.it_point.value); //포인트
var cust_amount = parseFloat(f.it_cust_amount.value); // 시중가격
var opt1 = 0;
var opt2 = 0;
var opt3 = 0;
var opt4 = 0;
var opt5 = 0;
var opt6 = 0;
var ct_qty = 0;
if (typeof(f.ct_qty) != 'undefined')
ct_qty = parseInt(f.ct_qty.value);
if (typeof(f.it_opt1) != 'undefined') opt1 = get_amount(f.it_opt1.value);
if (typeof(f.it_opt2) != 'undefined') opt2 = get_amount(f.it_opt2.value);
if (typeof(f.it_opt3) != 'undefined') opt3 = get_amount(f.it_opt3.value);
if (typeof(f.it_opt4) != 'unde격ined') opt4 = get_amount(f.it_opt4.value);
if (typeof(f.it_opt5) != 'undefined') opt5 = get_amount(f.it_opt5.value);
if (typeof(f.it_opt6) != 'undefined') opt6 = get_amount(f.it_opt6.value);
var amount = basic_amount + opt1 + opt2 + opt3 + opt4 + opt5 + opt6;
var point = parseInt(basic_point);
if (typeof(f.it_amount) != 'undefined')
f.it_amount.value = amount;
if (typeof(f.disp_sell_amount) != 'undefined')
f.disp_sell_amount.value = number_format(String(amount * ct_qty));
if (typeof(f.disp_cust_amount) != 'undefined')
f.disp_cust_amount.value = number_format(String(cust_amount * ct_qty));
if (typeof(f.it_point) != 'undefined') {
f.it_point.value = point;
f.disp_point.value = number_format(String(point * ct_qty));
}
}
function qty_add(f, num)
{
var qty = parseInt(f.ct_qty.value);
if (num < 0 && qty <= 1)
{
alert("수량은 1 이상만 가능합니다.");
qty = 1;
}
else if (num > 0 && qty >= 9999)
{
alert("수량은 9999 이하만 가능합니다.");
qty = 9999;
}
else
{
qty = qty + num;
}
f.ct_qty.value = qty;
amount_change(f);
}
function get_amount(data)
{
var str = data.split(";");
var num = parseInt(str[1]);
if (isNaN(num)) {
return 0;
} else {
return num;
}
}
</script>
====================================================
3. list.skin.xx.php (사용하고 있는 스킨)
====================================================
3-1. fitem 폼의 수량 input 태그를 다음과 같이 수정
<input type=text name=ct_qty value='1' onkeyup='amount_change(this.form)'>
3-2. 구매, 장바구니 javascript 수정
<a href="javascript:fitemcheck(this.form, 'direct_buy');">구매</a>
<a href="javascript:fitemcheck(this.form, 'cart_update');">장바구니</a>
3-3. fitem 폼에 다음 input 태그 추가
<input type=hidden name=it_point value='<?=$row[it_point];?>'>
<input type=hidden name=it_cust_amount value='<?=$row[it_cust_amount];?>'>
3-4. fitem 폼의 가격 input 태그를 다음과 같이 수정
<? if ($member[mb_level] >= $default[de_level_sell]) { ?><input type=text name=disp_sell_amount size=12 style='text-align:right; border:none; border-width:0px; font-weight:bold; width:80px; font-family:Tahoma;' class=amount readonly> 원<input type=hidden name=it_amount value='<?=$row[it_amount];?>'><? } else { ?> 상품 구입 권한이 없습니다.<input type=hidden name=it_amount value='0'><? } ?>
3-5. 수량 변경 화살표 부분의 javascript를 다음과 같이 수정합니다.
<area shape="rect" coords="0, 0, 10, 9" href="javascript:qty_add(this.form, +1);">
<area shape="rect" coords="0, 10, 10, 19" href="javascript:qty_add(this.form, -1);">
====================================================
수정해도 안되네요..실력이 영 부족한가봐요.
스킨 파일 올릴께요...한번만 봐 주시면 감사하겠습니다.
폼(form)이 여러개가 되는데.....
f 가 정의가 되지 않은것 같은데....
스킨 파일 올릴께요...한번만 봐 주시면 감사하겠습니다.
폼(form)이 여러개가 되는데.....
f 가 정의가 되지 않은것 같은데....
==============
list.php 입니다.
=============
<?
include_once("./_common.php");
$sql = " select *
from $g4[yc4_category_table]
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca[ca_id])
alert("등록된 분류가 없습니다.");
$g4[title] = $ca[ca_name] . " 상품리스트";
if ($ca[ca_include_head])
@include_once($ca[ca_include_head]);
else
include_once("./_head.php");
// 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화)
//if ($skin) $ca[ca_skin] = $skin;
$nav_ca_id = $ca_id;
include "$g4[shop_path]/navigation1.inc.php";
$himg = "$g4[path]/data/category/{$ca_id}_h";
if (file_exists($himg)) {
echo "<img src='$himg' border=0><br>";
}
// 상단 HTML
echo stripslashes($ca[ca_head_html]);
if ($is_admin)
echo "<p align=center><a href='$g4[shop_admin_path]/categoryform.php?w=u&ca_id=$ca_id'><img src='$g4[shop_img_path]/btn_admin_modify.gif' border=0></a></p>";
include "$g4[shop_path]/listcategory2.inc.php";
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<?
// 상품 출력순서가 있다면
if ($sort != "") {
$order_by = $sort . " , ";
}
// 상품 (하위 분류의 상품을 모두 포함한다.)
$sql_list1 = " select * ";
$sql_list2 = " order by $order_by it_order, it_id desc ";
// 하위분류 포함
// 판매가능한 상품만
$sql_common = " from $g4[yc4_item_table]
where (ca_id like '{$ca_id}%'
or ca_id2 like '{$ca_id}%'
or ca_id3 like '{$ca_id}%')
and it_use = '1' ";
$error = "<img src='$g4[shop_img_path]/no_item.gif' border=0>";
// 리스트 유형별로 출력
$list_file = "$g4[shop_path]/$ca[ca_skin]";
if (file_exists($list_file)) {
//display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]);
$list_mod = $ca[ca_list_mod];
$list_row = $ca[ca_list_row];
$img_width = $ca[ca_img_width];
$img_height = $ca[ca_img_height];
include "$g4[shop_path]/list.sub.php";
include "$g4[shop_path]/list.sort.php";
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
$result = sql_query($sql);
include $list_file;
}
else
{
$i = 0;
$error = "<p>$ca[ca_skin] 파일을 찾을 수 없습니다.<p>관리자에게 알려주시면 감사하겠습니다.";
}
if ($i==0)
{
echo "<br>";
echo "<div align=center>$error</div>";
}
?>
</td>
</tr>
</table>
<br>
<div align=center style='clear:both;'>
<?
$qstr1 .= "ca_id=$ca_id&skin=$skin&ev_id=$ev_id&sort=$sort";
echo get_paging($config[cf_write_pages], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr1&page=");
?>
</div><br>
<?
// 하단 HTML
echo stripslashes($ca[ca_tail_html]);
$timg = "$g4[path]/data/category/{$ca_id}_t";
if (file_exists($timg))
echo "<br><img src='$timg' border=0>";
if ($ca[ca_include_tail])
@include_once($ca[ca_include_tail]);
else
include_once("./_tail.php");
echo "\n<!-- $ca[ca_skin] -->\n";
?>
<script type="text/javascript">
// 바로구매 또는 장바구니 담기
function fitemcheck(f, act)
{
// 판매가격이 0 보다 작다면
if (f.it_amount.value < 0)
{
alert("전화로 문의해 주시면 감사하겠습니다.");
return;
}
for (i=1; i<=6; i++)
{
if (typeof(f.elements["it_opt"+i]) != 'undefined')
{
if (f.elements["it_opt"+i].value == '선택') {
alert(f.elements["it_opt"+i+"_subject"].value + '을(를) 선택하여 주십시오.');
f.elements["it_opt"+i].focus();
return;
}
}
}
if (act == "direct_buy") {
f.sw_direct.value = 1;
} else {
f.sw_direct.value = 0;
}
if (!f.ct_qty.value) {
alert("수량을 입력해 주십시오.");
f.ct_qty.focus();
return;
} else if (isNaN(f.ct_qty.value)) {
alert("수량을 숫자로 입력해 주십시오.");
f.ct_qty.select();
f.ct_qty.focus();
return;
} else if (parseInt(f.ct_qty.value) < 1) {
alert("수량은 1 이상 입력해 주십시오.");
f.ct_qty.focus();
return;
}
amount_change(f);
f.submit();
}
function amount_change(f)
{
var basic_amount = parseInt(f.it_amount.value); // 판매가격
var basic_point = parseFloat(f.it_point.value); //포인트
var cust_amount = parseFloat(f.it_cust_amount.value); // 시중가격
var opt1 = 0;
var opt2 = 0;
var opt3 = 0;
var opt4 = 0;
var opt5 = 0;
var opt6 = 0;
var ct_qty = 0;
if (typeof(f.ct_qty) != 'undefined')
ct_qty = parseInt(f.ct_qty.value);
if (typeof(f.it_opt1) != 'undefined') opt1 = get_amount(f.it_opt1.value);
if (typeof(f.it_opt2) != 'undefined') opt2 = get_amount(f.it_opt2.value);
if (typeof(f.it_opt3) != 'undefined') opt3 = get_amount(f.it_opt3.value);
if (typeof(f.it_opt4) != 'unde격ined') opt4 = get_amount(f.it_opt4.value);
if (typeof(f.it_opt5) != 'undefined') opt5 = get_amount(f.it_opt5.value);
if (typeof(f.it_opt6) != 'undefined') opt6 = get_amount(f.it_opt6.value);
var amount = basic_amount + opt1 + opt2 + opt3 + opt4 + opt5 + opt6;
var point = parseInt(basic_point);
if (typeof(f.it_amount) != 'undefined')
f.it_amount.value = amount;
if (typeof(f.disp_sell_amount) != 'undefined')
f.disp_sell_amount.value = number_format(String(amount * ct_qty));
if (typeof(f.disp_cust_amount) != 'undefined')
f.disp_cust_amount.value = number_format(String(cust_amount * ct_qty));
if (typeof(f.it_point) != 'undefined') {
f.it_point.value = point;
f.disp_point.value = number_format(String(point * ct_qty));
}
}
function qty_add(f, num)
{
var qty = parseInt(f.ct_qty.value);
if (num < 0 && qty <= 1)
{
alert("수량은 1 이상만 가능합니다.");
qty = 1;
}
else if (num > 0 && qty >= 9999)
{
alert("수량은 9999 이하만 가능합니다.");
qty = 9999;
}
else
{
qty = qty + num;
}
f.ct_qty.value = qty;
amount_change(f);
}
function get_amount(data)
{
var str = data.split(";");
var num = parseInt(str[1]);
if (isNaN(num)) {
return 0;
} else {
return num;
}
}
</script>
list.php 입니다.
=============
<?
include_once("./_common.php");
$sql = " select *
from $g4[yc4_category_table]
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca[ca_id])
alert("등록된 분류가 없습니다.");
$g4[title] = $ca[ca_name] . " 상품리스트";
if ($ca[ca_include_head])
@include_once($ca[ca_include_head]);
else
include_once("./_head.php");
// 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화)
//if ($skin) $ca[ca_skin] = $skin;
$nav_ca_id = $ca_id;
include "$g4[shop_path]/navigation1.inc.php";
$himg = "$g4[path]/data/category/{$ca_id}_h";
if (file_exists($himg)) {
echo "<img src='$himg' border=0><br>";
}
// 상단 HTML
echo stripslashes($ca[ca_head_html]);
if ($is_admin)
echo "<p align=center><a href='$g4[shop_admin_path]/categoryform.php?w=u&ca_id=$ca_id'><img src='$g4[shop_img_path]/btn_admin_modify.gif' border=0></a></p>";
include "$g4[shop_path]/listcategory2.inc.php";
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<?
// 상품 출력순서가 있다면
if ($sort != "") {
$order_by = $sort . " , ";
}
// 상품 (하위 분류의 상품을 모두 포함한다.)
$sql_list1 = " select * ";
$sql_list2 = " order by $order_by it_order, it_id desc ";
// 하위분류 포함
// 판매가능한 상품만
$sql_common = " from $g4[yc4_item_table]
where (ca_id like '{$ca_id}%'
or ca_id2 like '{$ca_id}%'
or ca_id3 like '{$ca_id}%')
and it_use = '1' ";
$error = "<img src='$g4[shop_img_path]/no_item.gif' border=0>";
// 리스트 유형별로 출력
$list_file = "$g4[shop_path]/$ca[ca_skin]";
if (file_exists($list_file)) {
//display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]);
$list_mod = $ca[ca_list_mod];
$list_row = $ca[ca_list_row];
$img_width = $ca[ca_img_width];
$img_height = $ca[ca_img_height];
include "$g4[shop_path]/list.sub.php";
include "$g4[shop_path]/list.sort.php";
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
$result = sql_query($sql);
include $list_file;
}
else
{
$i = 0;
$error = "<p>$ca[ca_skin] 파일을 찾을 수 없습니다.<p>관리자에게 알려주시면 감사하겠습니다.";
}
if ($i==0)
{
echo "<br>";
echo "<div align=center>$error</div>";
}
?>
</td>
</tr>
</table>
<br>
<div align=center style='clear:both;'>
<?
$qstr1 .= "ca_id=$ca_id&skin=$skin&ev_id=$ev_id&sort=$sort";
echo get_paging($config[cf_write_pages], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr1&page=");
?>
</div><br>
<?
// 하단 HTML
echo stripslashes($ca[ca_tail_html]);
$timg = "$g4[path]/data/category/{$ca_id}_t";
if (file_exists($timg))
echo "<br><img src='$timg' border=0>";
if ($ca[ca_include_tail])
@include_once($ca[ca_include_tail]);
else
include_once("./_tail.php");
echo "\n<!-- $ca[ca_skin] -->\n";
?>
<script type="text/javascript">
// 바로구매 또는 장바구니 담기
function fitemcheck(f, act)
{
// 판매가격이 0 보다 작다면
if (f.it_amount.value < 0)
{
alert("전화로 문의해 주시면 감사하겠습니다.");
return;
}
for (i=1; i<=6; i++)
{
if (typeof(f.elements["it_opt"+i]) != 'undefined')
{
if (f.elements["it_opt"+i].value == '선택') {
alert(f.elements["it_opt"+i+"_subject"].value + '을(를) 선택하여 주십시오.');
f.elements["it_opt"+i].focus();
return;
}
}
}
if (act == "direct_buy") {
f.sw_direct.value = 1;
} else {
f.sw_direct.value = 0;
}
if (!f.ct_qty.value) {
alert("수량을 입력해 주십시오.");
f.ct_qty.focus();
return;
} else if (isNaN(f.ct_qty.value)) {
alert("수량을 숫자로 입력해 주십시오.");
f.ct_qty.select();
f.ct_qty.focus();
return;
} else if (parseInt(f.ct_qty.value) < 1) {
alert("수량은 1 이상 입력해 주십시오.");
f.ct_qty.focus();
return;
}
amount_change(f);
f.submit();
}
function amount_change(f)
{
var basic_amount = parseInt(f.it_amount.value); // 판매가격
var basic_point = parseFloat(f.it_point.value); //포인트
var cust_amount = parseFloat(f.it_cust_amount.value); // 시중가격
var opt1 = 0;
var opt2 = 0;
var opt3 = 0;
var opt4 = 0;
var opt5 = 0;
var opt6 = 0;
var ct_qty = 0;
if (typeof(f.ct_qty) != 'undefined')
ct_qty = parseInt(f.ct_qty.value);
if (typeof(f.it_opt1) != 'undefined') opt1 = get_amount(f.it_opt1.value);
if (typeof(f.it_opt2) != 'undefined') opt2 = get_amount(f.it_opt2.value);
if (typeof(f.it_opt3) != 'undefined') opt3 = get_amount(f.it_opt3.value);
if (typeof(f.it_opt4) != 'unde격ined') opt4 = get_amount(f.it_opt4.value);
if (typeof(f.it_opt5) != 'undefined') opt5 = get_amount(f.it_opt5.value);
if (typeof(f.it_opt6) != 'undefined') opt6 = get_amount(f.it_opt6.value);
var amount = basic_amount + opt1 + opt2 + opt3 + opt4 + opt5 + opt6;
var point = parseInt(basic_point);
if (typeof(f.it_amount) != 'undefined')
f.it_amount.value = amount;
if (typeof(f.disp_sell_amount) != 'undefined')
f.disp_sell_amount.value = number_format(String(amount * ct_qty));
if (typeof(f.disp_cust_amount) != 'undefined')
f.disp_cust_amount.value = number_format(String(cust_amount * ct_qty));
if (typeof(f.it_point) != 'undefined') {
f.it_point.value = point;
f.disp_point.value = number_format(String(point * ct_qty));
}
}
function qty_add(f, num)
{
var qty = parseInt(f.ct_qty.value);
if (num < 0 && qty <= 1)
{
alert("수량은 1 이상만 가능합니다.");
qty = 1;
}
else if (num > 0 && qty >= 9999)
{
alert("수량은 9999 이하만 가능합니다.");
qty = 9999;
}
else
{
qty = qty + num;
}
f.ct_qty.value = qty;
amount_change(f);
}
function get_amount(data)
{
var str = data.split(";");
var num = parseInt(str[1]);
if (isNaN(num)) {
return 0;
} else {
return num;
}
}
</script>
==============
list.skin.irumad.garo.php 입니다.
=============
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script language="JavaScript" src="<?=$g4[path]?>/js/shop.js"></script>
<script language="JavaScript" src="<?=$g4[path]?>/js/md5.js"></script>
<table width=100% cellpadding=4 cellspacing=1>
<tr>
<td colspan=5>
<table width=100% cellpadding=4 cellspacing=0>
<?
$total_rows = mysql_num_rows($result); // 전체겟수
?>
<? for ($i=0; $row=sql_fetch_array($result); $i++) { ?>
<? if($i>0){ ?>
<tr><td colspan=5 background="<?=$g4[shop_img_path]?>/line_h.gif" height=1></td></tr>
<? } ?>
<tr><td colspan="5" height="15"></td></tr>
<form name="fitem" method=post action="./cartupdate.php">
<input type=hidden name=it_point value='<?=$row[it_point];?>'>
<input type=hidden name=it_cust_amount value='<?=$row[it_cust_amount];?>'>
<input type=hidden name=it_id value='<?=$row[it_id]?>'>
<input type=hidden name=it_name value='<?=$row[it_name]?>'>
<input type=hidden name=sw_direct>
<input type=hidden name=url>
<tr>
<td width="<?=($img_width+10)?>" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td><?=it_name_icon($row)?></td></tr>
<tr><td><?=get_it_image_nolink($row[it_id]."_s", $img_width , $img_height, $row[it_id]) ?></td></tr>
</table>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<?
// 선택옵션 출력
for ($i=1; $i<=6; $i++)
{
// 옵션에 문자가 존재한다면
$str = get_item_options(trim($row["it_opt{$i}_subject"]), trim($row["it_opt{$i}"]), $i);
if ($str)
{
echo "<tr>\n";
echo "<td>";
echo $row["it_opt{$i}_subject"].":";
echo "</td>\n";
echo "<td>";
echo $str;
echo "</td>\n";
echo "</tr>\n";
}
}
?>
<tr>
<td>수 량 : </td>
<td>
<input type=text name=ct_qty value='1' onkeyup='amount_change(this.form)'>
<img src='<?=$g4[shop_img_path]?>/qty_control.gif' border=0 align=absmiddle usemap="#qty_control_map"> 개
<map name="qty_control_map">
<area shape="rect" coords="0, 0, 10, 9" href="javascript:qty_add(this.form, +1);">
<area shape="rect" coords="0, 10, 10, 19" href="javascript:qty_add(this.form, -1);">
</map>
</td>
</tr>
<tr>
<td>가격 : </td>
<td><? if ($member[mb_level] >= $default[de_level_sell]) { ?>
<input type=text name=disp_sell_amount size=12 style='text-align:right; border:none; border-width:0px; font-weight:bold; width:80px; font-family:Tahoma;' class=amount readonly> 원
<input type=hidden name=it_amount value='<?=$row[it_amount];?>'>
<? } else { ?>
상품 구입 권한이 없습니다.
<input type=hidden name=it_amount value='0'>
<? } ?>
</td>
</tr>
<tr>
<td colspan="2">
<? if (!$row[it_tel_inq] && !$row[it_gallery]) { ?>
<a href="javascript:fitemcheck(this.form, 'direct_buy');">구매</a>
<a href="javascript:fitemcheck(this.form, 'cart_update');">장바구니</a>
<? } ?>
<? if (!$row[it_gallery]) { ?>
<a href='./wishupdate.php?it_id=<?=$row[it_id]?>'>보관</a>
<a href="javascript:popup_item_recommend('<?=$row[it_id]?>');">추천</a>
<? } ?>
<script language="JavaScript">
// 상품보관
function item_wish(f, it_id)
{
f.url.value = "<?=$g4[shop_path]?>/wishupdate.php?it_id="+it_id;
f.action = "<?=$g4[shop_path]?>/wishupdate.php";
f.submit();
}
// 추천메일
function popup_item_recommend(it_id)
{
if (!g4_is_member)
{
if (confirm("회원만 추천하실 수 있습니다."))
document.location.href = "<?=$g4[bbs_path]?>/login.php?url=<?=urlencode("$g4[shop_path]/item.php?it_id=$it_id")?>";
}
else
{
url = "./itemrecommend.php?it_id=" + it_id;
opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
popup_window(url, "itemrecommend", opt);
}
}
</script>
</td>
</tr>
</table>
</td>
</tr>
</form>
<? } ?>
<? mysql_free_result($result); ?>
<? if($i==0){ ?>
<tr><td colspan=5 align=center><span class=point>자료가 한건도 없습니다.</span></td></tr>
<? } ?>
</table>
</td>
</tr>
<tr><td colspan=5 background='<?="$g4[shop_img_path]/line_h.gif"?>' height=1></td></tr>
</table>
list.skin.irumad.garo.php 입니다.
=============
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script language="JavaScript" src="<?=$g4[path]?>/js/shop.js"></script>
<script language="JavaScript" src="<?=$g4[path]?>/js/md5.js"></script>
<table width=100% cellpadding=4 cellspacing=1>
<tr>
<td colspan=5>
<table width=100% cellpadding=4 cellspacing=0>
<?
$total_rows = mysql_num_rows($result); // 전체겟수
?>
<? for ($i=0; $row=sql_fetch_array($result); $i++) { ?>
<? if($i>0){ ?>
<tr><td colspan=5 background="<?=$g4[shop_img_path]?>/line_h.gif" height=1></td></tr>
<? } ?>
<tr><td colspan="5" height="15"></td></tr>
<form name="fitem" method=post action="./cartupdate.php">
<input type=hidden name=it_point value='<?=$row[it_point];?>'>
<input type=hidden name=it_cust_amount value='<?=$row[it_cust_amount];?>'>
<input type=hidden name=it_id value='<?=$row[it_id]?>'>
<input type=hidden name=it_name value='<?=$row[it_name]?>'>
<input type=hidden name=sw_direct>
<input type=hidden name=url>
<tr>
<td width="<?=($img_width+10)?>" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td><?=it_name_icon($row)?></td></tr>
<tr><td><?=get_it_image_nolink($row[it_id]."_s", $img_width , $img_height, $row[it_id]) ?></td></tr>
</table>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<?
// 선택옵션 출력
for ($i=1; $i<=6; $i++)
{
// 옵션에 문자가 존재한다면
$str = get_item_options(trim($row["it_opt{$i}_subject"]), trim($row["it_opt{$i}"]), $i);
if ($str)
{
echo "<tr>\n";
echo "<td>";
echo $row["it_opt{$i}_subject"].":";
echo "</td>\n";
echo "<td>";
echo $str;
echo "</td>\n";
echo "</tr>\n";
}
}
?>
<tr>
<td>수 량 : </td>
<td>
<input type=text name=ct_qty value='1' onkeyup='amount_change(this.form)'>
<img src='<?=$g4[shop_img_path]?>/qty_control.gif' border=0 align=absmiddle usemap="#qty_control_map"> 개
<map name="qty_control_map">
<area shape="rect" coords="0, 0, 10, 9" href="javascript:qty_add(this.form, +1);">
<area shape="rect" coords="0, 10, 10, 19" href="javascript:qty_add(this.form, -1);">
</map>
</td>
</tr>
<tr>
<td>가격 : </td>
<td><? if ($member[mb_level] >= $default[de_level_sell]) { ?>
<input type=text name=disp_sell_amount size=12 style='text-align:right; border:none; border-width:0px; font-weight:bold; width:80px; font-family:Tahoma;' class=amount readonly> 원
<input type=hidden name=it_amount value='<?=$row[it_amount];?>'>
<? } else { ?>
상품 구입 권한이 없습니다.
<input type=hidden name=it_amount value='0'>
<? } ?>
</td>
</tr>
<tr>
<td colspan="2">
<? if (!$row[it_tel_inq] && !$row[it_gallery]) { ?>
<a href="javascript:fitemcheck(this.form, 'direct_buy');">구매</a>
<a href="javascript:fitemcheck(this.form, 'cart_update');">장바구니</a>
<? } ?>
<? if (!$row[it_gallery]) { ?>
<a href='./wishupdate.php?it_id=<?=$row[it_id]?>'>보관</a>
<a href="javascript:popup_item_recommend('<?=$row[it_id]?>');">추천</a>
<? } ?>
<script language="JavaScript">
// 상품보관
function item_wish(f, it_id)
{
f.url.value = "<?=$g4[shop_path]?>/wishupdate.php?it_id="+it_id;
f.action = "<?=$g4[shop_path]?>/wishupdate.php";
f.submit();
}
// 추천메일
function popup_item_recommend(it_id)
{
if (!g4_is_member)
{
if (confirm("회원만 추천하실 수 있습니다."))
document.location.href = "<?=$g4[bbs_path]?>/login.php?url=<?=urlencode("$g4[shop_path]/item.php?it_id=$it_id")?>";
}
else
{
url = "./itemrecommend.php?it_id=" + it_id;
opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
popup_window(url, "itemrecommend", opt);
}
}
</script>
</td>
</tr>
</table>
</td>
</tr>
</form>
<? } ?>
<? mysql_free_result($result); ?>
<? if($i==0){ ?>
<tr><td colspan=5 align=center><span class=point>자료가 한건도 없습니다.</span></td></tr>
<? } ?>
</table>
</td>
</tr>
<tr><td colspan=5 background='<?="$g4[shop_img_path]/line_h.gif"?>' height=1></td></tr>
</table>
고맙습니다... 신경써 주셔서....
위 파일내용을 그대로 적용했는데 에러가 나네요...쩝..
http://www.irumad.co.kr/shop/list.php?ca_id=10
샤방님이 알려주신 파일내용그대로 적용해 놓은 상태입니다.
보시고 좀 살펴주시면 고맙겠습니다.
위 파일내용을 그대로 적용했는데 에러가 나네요...쩝..
http://www.irumad.co.kr/shop/list.php?ca_id=10
샤방님이 알려주신 파일내용그대로 적용해 놓은 상태입니다.
보시고 좀 살펴주시면 고맙겠습니다.
테스트 해보고 다시 올려드립니다.
------------------------------
list.php
------------------------------
<?
include_once("./_common.php");
$sql = " select *
from $g4[yc4_category_table]
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca[ca_id])
alert("등록된 분류가 없습니다.");
$g4[title] = $ca[ca_name] . " 상품리스트";
if ($ca[ca_include_head])
@include_once($ca[ca_include_head]);
else
include_once("./_head.php");
// 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화)
//if ($skin) $ca[ca_skin] = $skin;
$nav_ca_id = $ca_id;
include "$g4[shop_path]/navigation1.inc.php";
$himg = "$g4[path]/data/category/{$ca_id}_h";
if (file_exists($himg)) {
echo "<img src='$himg' border=0><br>";
}
// 상단 HTML
echo stripslashes($ca[ca_head_html]);
if ($is_admin)
echo "<p align=center><a href='$g4[shop_admin_path]/categoryform.php?w=u&ca_id=$ca_id'><img src='$g4[shop_img_path]/btn_admin_modify.gif' border=0></a></p>";
include "$g4[shop_path]/listcategory2.inc.php";
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<?
// 상품 출력순서가 있다면
if ($sort != "") {
$order_by = $sort . " , ";
}
// 상품 (하위 분류의 상품을 모두 포함한다.)
$sql_list1 = " select * ";
$sql_list2 = " order by $order_by it_order, it_id desc ";
// 하위분류 포함
// 판매가능한 상품만
$sql_common = " from $g4[yc4_item_table]
where (ca_id like '{$ca_id}%'
or ca_id2 like '{$ca_id}%'
or ca_id3 like '{$ca_id}%')
and it_use = '1' ";
$error = "<img src='$g4[shop_img_path]/no_item.gif' border=0>";
// 리스트 유형별로 출력
$list_file = "$g4[shop_path]/$ca[ca_skin]";
if (file_exists($list_file)) {
//display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]);
$list_mod = $ca[ca_list_mod];
$list_row = $ca[ca_list_row];
$img_width = $ca[ca_img_width];
$img_height = $ca[ca_img_height];
include "$g4[shop_path]/list.sub.php";
include "$g4[shop_path]/list.sort.php";
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
$result = sql_query($sql);
include $list_file;
}
else
{
$i = 0;
$error = "<p>$ca[ca_skin] 파일을 찾을 수 없습니다.<p>관리자에게 알려주시면 감사하겠습니다.";
}
if ($i==0)
{
echo "<br>";
echo "<div align=center>$error</div>";
}
?>
</td>
</tr>
</table>
<br>
<div align=center style='clear:both;'>
<?
$qstr1 .= "ca_id=$ca_id&skin=$skin&ev_id=$ev_id&sort=$sort";
echo get_paging($config[cf_write_pages], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr1&page=");
?>
</div><br>
<?
// 하단 HTML
echo stripslashes($ca[ca_tail_html]);
$timg = "$g4[path]/data/category/{$ca_id}_t";
if (file_exists($timg))
echo "<br><img src='$timg' border=0>";
if ($ca[ca_include_tail])
@include_once($ca[ca_include_tail]);
else
include_once("./_tail.php");
echo "\n<!-- $ca[ca_skin] -->\n";
?>
<script type="text/javascript">
// 바로구매 또는 장바구니 담기
function fitemcheck(f, act)
{
// 판매가격이 0 보다 작다면
if (f.it_amount.value < 0)
{
alert("전화로 문의해 주시면 감사하겠습니다.");
return;
}
for (i=1; i<=6; i++)
{
if (typeof(f.elements["it_opt"+i]) != 'undefined')
{
if (f.elements["it_opt"+i].value == '선택') {
alert(f.elements["it_opt"+i+"_subject"].value + '을(를) 선택하여 주십시오.');
f.elements["it_opt"+i].focus();
return;
}
}
}
if (act == "direct_buy") {
f.sw_direct.value = 1;
} else {
f.sw_direct.value = 0;
}
if (!f.ct_qty.value) {
alert("수량을 입력해 주십시오.");
f.ct_qty.focus();
return;
} else if (isNaN(f.ct_qty.value)) {
alert("수량을 숫자로 입력해 주십시오.");
f.ct_qty.select();
f.ct_qty.focus();
return;
} else if (parseInt(f.ct_qty.value) < 1) {
alert("수량은 1 이상 입력해 주십시오.");
f.ct_qty.focus();
return;
}
amount_change(f);
f.submit();
}
function amount_change(f)
{
var basic_amount = parseInt(f.it_amount.value); // 판매가격
var basic_point = parseFloat(f.it_point.value); //포인트
var cust_amount = parseFloat(f.it_cust_amount.value); // 시중가격
var opt1 = 0;
var opt2 = 0;
var opt3 = 0;
var opt4 = 0;
var opt5 = 0;
var opt6 = 0;
var ct_qty = 0;
if (typeof(f.ct_qty) != 'undefined')
ct_qty = parseInt(f.ct_qty.value);
if (typeof(f.it_opt1) != 'undefined') opt1 = get_amount(f.it_opt1.value);
if (typeof(f.it_opt2) != 'undefined') opt2 = get_amount(f.it_opt2.value);
if (typeof(f.it_opt3) != 'undefined') opt3 = get_amount(f.it_opt3.value);
if (typeof(f.it_opt4) != 'undefined') opt4 = get_amount(f.it_opt4.value);
if (typeof(f.it_opt5) != 'undefined') opt5 = get_amount(f.it_opt5.value);
if (typeof(f.it_opt6) != 'undefined') opt6 = get_amount(f.it_opt6.value);
var amount = basic_amount + opt1 + opt2 + opt3 + opt4 + opt5 + opt6;
var point = parseInt(basic_point);
if (typeof(f.it_amount) != 'undefined')
f.it_amount.value = amount;
if (typeof(f.disp_sell_amount) != 'undefined')
f.disp_sell_amount.value = number_format(String(amount * ct_qty));
if (typeof(f.disp_cust_amount) != 'undefined')
f.disp_cust_amount.value = number_format(String(cust_amount * ct_qty));
if (typeof(f.it_point) != 'undefined') {
f.it_point.value = point;
f.disp_point.value = number_format(String(point * ct_qty));
}
}
function qty_add(f, num)
{
var qty = parseInt(f.ct_qty.value);
if (num < 0 && qty <= 1)
{
alert("수량은 1 이상만 가능합니다.");
qty = 1;
}
else if (num > 0 && qty >= 9999)
{
alert("수량은 9999 이하만 가능합니다.");
qty = 9999;
}
else
{
qty = qty + num;
}
f.ct_qty.value = qty;
amount_change(f);
}
function get_amount(data)
{
var str = data.split(";");
var num = parseInt(str[1]);
if (isNaN(num)) {
return 0;
} else {
return num;
}
}
// 상품보관
function item_wish(f, it_id)
{
f.url.value = "<?=$g4[shop_path]?>/wishupdate.php?it_id="+it_id;
f.action = "<?=$g4[shop_path]?>/wishupdate.php";
f.submit();
}
// 추천메일
function popup_item_recommend(it_id)
{
if (!g4_is_member)
{
if (confirm("회원만 추천하실 수 있습니다."))
document.location.href = "<?=$g4[bbs_path]?>/login.php?url=<?=urlencode("$g4[shop_path]/item.php?it_id=$it_id")?>";
}
else
{
url = "./itemrecommend.php?it_id=" + it_id;
opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
popup_window(url, "itemrecommend", opt);
}
}
</script>
------------------------------
list.php
------------------------------
<?
include_once("./_common.php");
$sql = " select *
from $g4[yc4_category_table]
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca[ca_id])
alert("등록된 분류가 없습니다.");
$g4[title] = $ca[ca_name] . " 상품리스트";
if ($ca[ca_include_head])
@include_once($ca[ca_include_head]);
else
include_once("./_head.php");
// 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화)
//if ($skin) $ca[ca_skin] = $skin;
$nav_ca_id = $ca_id;
include "$g4[shop_path]/navigation1.inc.php";
$himg = "$g4[path]/data/category/{$ca_id}_h";
if (file_exists($himg)) {
echo "<img src='$himg' border=0><br>";
}
// 상단 HTML
echo stripslashes($ca[ca_head_html]);
if ($is_admin)
echo "<p align=center><a href='$g4[shop_admin_path]/categoryform.php?w=u&ca_id=$ca_id'><img src='$g4[shop_img_path]/btn_admin_modify.gif' border=0></a></p>";
include "$g4[shop_path]/listcategory2.inc.php";
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<?
// 상품 출력순서가 있다면
if ($sort != "") {
$order_by = $sort . " , ";
}
// 상품 (하위 분류의 상품을 모두 포함한다.)
$sql_list1 = " select * ";
$sql_list2 = " order by $order_by it_order, it_id desc ";
// 하위분류 포함
// 판매가능한 상품만
$sql_common = " from $g4[yc4_item_table]
where (ca_id like '{$ca_id}%'
or ca_id2 like '{$ca_id}%'
or ca_id3 like '{$ca_id}%')
and it_use = '1' ";
$error = "<img src='$g4[shop_img_path]/no_item.gif' border=0>";
// 리스트 유형별로 출력
$list_file = "$g4[shop_path]/$ca[ca_skin]";
if (file_exists($list_file)) {
//display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]);
$list_mod = $ca[ca_list_mod];
$list_row = $ca[ca_list_row];
$img_width = $ca[ca_img_width];
$img_height = $ca[ca_img_height];
include "$g4[shop_path]/list.sub.php";
include "$g4[shop_path]/list.sort.php";
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
$result = sql_query($sql);
include $list_file;
}
else
{
$i = 0;
$error = "<p>$ca[ca_skin] 파일을 찾을 수 없습니다.<p>관리자에게 알려주시면 감사하겠습니다.";
}
if ($i==0)
{
echo "<br>";
echo "<div align=center>$error</div>";
}
?>
</td>
</tr>
</table>
<br>
<div align=center style='clear:both;'>
<?
$qstr1 .= "ca_id=$ca_id&skin=$skin&ev_id=$ev_id&sort=$sort";
echo get_paging($config[cf_write_pages], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr1&page=");
?>
</div><br>
<?
// 하단 HTML
echo stripslashes($ca[ca_tail_html]);
$timg = "$g4[path]/data/category/{$ca_id}_t";
if (file_exists($timg))
echo "<br><img src='$timg' border=0>";
if ($ca[ca_include_tail])
@include_once($ca[ca_include_tail]);
else
include_once("./_tail.php");
echo "\n<!-- $ca[ca_skin] -->\n";
?>
<script type="text/javascript">
// 바로구매 또는 장바구니 담기
function fitemcheck(f, act)
{
// 판매가격이 0 보다 작다면
if (f.it_amount.value < 0)
{
alert("전화로 문의해 주시면 감사하겠습니다.");
return;
}
for (i=1; i<=6; i++)
{
if (typeof(f.elements["it_opt"+i]) != 'undefined')
{
if (f.elements["it_opt"+i].value == '선택') {
alert(f.elements["it_opt"+i+"_subject"].value + '을(를) 선택하여 주십시오.');
f.elements["it_opt"+i].focus();
return;
}
}
}
if (act == "direct_buy") {
f.sw_direct.value = 1;
} else {
f.sw_direct.value = 0;
}
if (!f.ct_qty.value) {
alert("수량을 입력해 주십시오.");
f.ct_qty.focus();
return;
} else if (isNaN(f.ct_qty.value)) {
alert("수량을 숫자로 입력해 주십시오.");
f.ct_qty.select();
f.ct_qty.focus();
return;
} else if (parseInt(f.ct_qty.value) < 1) {
alert("수량은 1 이상 입력해 주십시오.");
f.ct_qty.focus();
return;
}
amount_change(f);
f.submit();
}
function amount_change(f)
{
var basic_amount = parseInt(f.it_amount.value); // 판매가격
var basic_point = parseFloat(f.it_point.value); //포인트
var cust_amount = parseFloat(f.it_cust_amount.value); // 시중가격
var opt1 = 0;
var opt2 = 0;
var opt3 = 0;
var opt4 = 0;
var opt5 = 0;
var opt6 = 0;
var ct_qty = 0;
if (typeof(f.ct_qty) != 'undefined')
ct_qty = parseInt(f.ct_qty.value);
if (typeof(f.it_opt1) != 'undefined') opt1 = get_amount(f.it_opt1.value);
if (typeof(f.it_opt2) != 'undefined') opt2 = get_amount(f.it_opt2.value);
if (typeof(f.it_opt3) != 'undefined') opt3 = get_amount(f.it_opt3.value);
if (typeof(f.it_opt4) != 'undefined') opt4 = get_amount(f.it_opt4.value);
if (typeof(f.it_opt5) != 'undefined') opt5 = get_amount(f.it_opt5.value);
if (typeof(f.it_opt6) != 'undefined') opt6 = get_amount(f.it_opt6.value);
var amount = basic_amount + opt1 + opt2 + opt3 + opt4 + opt5 + opt6;
var point = parseInt(basic_point);
if (typeof(f.it_amount) != 'undefined')
f.it_amount.value = amount;
if (typeof(f.disp_sell_amount) != 'undefined')
f.disp_sell_amount.value = number_format(String(amount * ct_qty));
if (typeof(f.disp_cust_amount) != 'undefined')
f.disp_cust_amount.value = number_format(String(cust_amount * ct_qty));
if (typeof(f.it_point) != 'undefined') {
f.it_point.value = point;
f.disp_point.value = number_format(String(point * ct_qty));
}
}
function qty_add(f, num)
{
var qty = parseInt(f.ct_qty.value);
if (num < 0 && qty <= 1)
{
alert("수량은 1 이상만 가능합니다.");
qty = 1;
}
else if (num > 0 && qty >= 9999)
{
alert("수량은 9999 이하만 가능합니다.");
qty = 9999;
}
else
{
qty = qty + num;
}
f.ct_qty.value = qty;
amount_change(f);
}
function get_amount(data)
{
var str = data.split(";");
var num = parseInt(str[1]);
if (isNaN(num)) {
return 0;
} else {
return num;
}
}
// 상품보관
function item_wish(f, it_id)
{
f.url.value = "<?=$g4[shop_path]?>/wishupdate.php?it_id="+it_id;
f.action = "<?=$g4[shop_path]?>/wishupdate.php";
f.submit();
}
// 추천메일
function popup_item_recommend(it_id)
{
if (!g4_is_member)
{
if (confirm("회원만 추천하실 수 있습니다."))
document.location.href = "<?=$g4[bbs_path]?>/login.php?url=<?=urlencode("$g4[shop_path]/item.php?it_id=$it_id")?>";
}
else
{
url = "./itemrecommend.php?it_id=" + it_id;
opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
popup_window(url, "itemrecommend", opt);
}
}
</script>
------------------------------
list.skin.irumad.garo.php
------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script language="JavaScript" src="<?=$g4[path]?>/js/shop.js"></script>
<script language="JavaScript" src="<?=$g4[path]?>/js/md5.js"></script>
<table width=100% cellpadding=4 cellspacing=1>
<tr>
<td colspan=5>
<table width=100% cellpadding=4 cellspacing=0>
<?
$total_rows = mysql_num_rows($result); // 전체겟수
?>
<? for ($i=0; $row=sql_fetch_array($result); $i++) { ?>
<? if($i>0){ ?>
<tr><td colspan=5 background="<?=$g4[shop_img_path]?>/line_h.gif" height=1></td></tr>
<? } ?>
<tr><td colspan="5" height="15"></td></tr>
<form name="fitem" method=post action="./cartupdate.php">
<input type=hidden name=it_point value='<?=$row[it_point];?>'>
<input type=hidden name=disp_point>
<input type=hidden name=it_cust_amount value='<?=$row[it_cust_amount];?>'>
<input type=hidden name=it_id value='<?=$row[it_id]?>'>
<input type=hidden name=it_name value='<?=$row[it_name]?>'>
<input type=hidden name=sw_direct>
<input type=hidden name=url>
<tr>
<td width="<?=($img_width+10)?>" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td><?=it_name_icon($row)?></td></tr>
<tr><td><?//=get_it_image_nolink($row[it_id]."_s", $img_width , $img_height, $row[it_id]) ?></td></tr>
</table>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<?
// 선택옵션 출력
for ($i=1; $i<=6; $i++)
{
// 옵션에 문자가 존재한다면
$str = get_item_options(trim($row["it_opt{$i}_subject"]), trim($row["it_opt{$i}"]), $i);
if ($str)
{
echo "<tr>\n";
echo "<td>";
echo $row["it_opt{$i}_subject"].":";
echo "</td>\n";
echo "<td>";
echo $str;
echo "</td>\n";
echo "</tr>\n";
}
}
?>
<tr>
<td>수 량 : </td>
<td>
<input type=text name=ct_qty value='1' onkeyup='amount_change(this.form)'>
<div style='display:inline; height:10px; vertical-align:middle;line-height:-1px;'>
<button style='display:block;margin:0px;padding:0px;border:none;background:none;cursor:pointer' onclick="qty_add(this.form, +1);">▲</button>
<button style='display:block;margin:0px;padding:0px;border:none;background:none;cursor:pointer' onclick="qty_add(this.form, -1);">▼</button>
</div>
개
</td>
</tr>
<tr>
<td>가격 : </td>
<td><? if ($member[mb_level] >= $default[de_level_sell]) { ?>
<input type=text name=disp_sell_amount size=12 style='text-align:right; border:none; border-width:0px; font-weight:bold; width:80px; font-family:Tahoma;' class=amount readonly> 원
<input type=hidden name=it_amount value='<?=$row[it_amount];?>'>
<? } else { ?>
상품 구입 권한이 없습니다.
<input type=hidden name=it_amount value='0'>
<? } ?>
</td>
</tr>
<tr>
<td colspan="2">
<? if (!$row[it_tel_inq] && !$row[it_gallery]) { ?>
<button onclick="fitemcheck(this.form, 'direct_buy');">구매</button>
<button onclick="fitemcheck(this.form, 'cart_update');">장바구니</button>
<? } ?>
<? if (!$row[it_gallery]) { ?>
<a href='./wishupdate.php?it_id=<?=$row[it_id]?>'>보관</a>
<a href="javascript:popup_item_recommend('<?=$row[it_id]?>');">추천</a>
<? } ?>
</td>
</tr>
</table>
</td>
</tr>
</form>
<? } ?>
<? mysql_free_result($result); ?>
<? if($i==0){ ?>
<tr><td colspan=5 align=center><span class=point>자료가 한건도 없습니다.</span></td></tr>
<? } ?>
</table>
</td>
</tr>
<tr><td colspan=5 background='<?="$g4[shop_img_path]/line_h.gif"?>' height=1></td></tr>
</table>
list.skin.irumad.garo.php
------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script language="JavaScript" src="<?=$g4[path]?>/js/shop.js"></script>
<script language="JavaScript" src="<?=$g4[path]?>/js/md5.js"></script>
<table width=100% cellpadding=4 cellspacing=1>
<tr>
<td colspan=5>
<table width=100% cellpadding=4 cellspacing=0>
<?
$total_rows = mysql_num_rows($result); // 전체겟수
?>
<? for ($i=0; $row=sql_fetch_array($result); $i++) { ?>
<? if($i>0){ ?>
<tr><td colspan=5 background="<?=$g4[shop_img_path]?>/line_h.gif" height=1></td></tr>
<? } ?>
<tr><td colspan="5" height="15"></td></tr>
<form name="fitem" method=post action="./cartupdate.php">
<input type=hidden name=it_point value='<?=$row[it_point];?>'>
<input type=hidden name=disp_point>
<input type=hidden name=it_cust_amount value='<?=$row[it_cust_amount];?>'>
<input type=hidden name=it_id value='<?=$row[it_id]?>'>
<input type=hidden name=it_name value='<?=$row[it_name]?>'>
<input type=hidden name=sw_direct>
<input type=hidden name=url>
<tr>
<td width="<?=($img_width+10)?>" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td><?=it_name_icon($row)?></td></tr>
<tr><td><?//=get_it_image_nolink($row[it_id]."_s", $img_width , $img_height, $row[it_id]) ?></td></tr>
</table>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<?
// 선택옵션 출력
for ($i=1; $i<=6; $i++)
{
// 옵션에 문자가 존재한다면
$str = get_item_options(trim($row["it_opt{$i}_subject"]), trim($row["it_opt{$i}"]), $i);
if ($str)
{
echo "<tr>\n";
echo "<td>";
echo $row["it_opt{$i}_subject"].":";
echo "</td>\n";
echo "<td>";
echo $str;
echo "</td>\n";
echo "</tr>\n";
}
}
?>
<tr>
<td>수 량 : </td>
<td>
<input type=text name=ct_qty value='1' onkeyup='amount_change(this.form)'>
<div style='display:inline; height:10px; vertical-align:middle;line-height:-1px;'>
<button style='display:block;margin:0px;padding:0px;border:none;background:none;cursor:pointer' onclick="qty_add(this.form, +1);">▲</button>
<button style='display:block;margin:0px;padding:0px;border:none;background:none;cursor:pointer' onclick="qty_add(this.form, -1);">▼</button>
</div>
개
</td>
</tr>
<tr>
<td>가격 : </td>
<td><? if ($member[mb_level] >= $default[de_level_sell]) { ?>
<input type=text name=disp_sell_amount size=12 style='text-align:right; border:none; border-width:0px; font-weight:bold; width:80px; font-family:Tahoma;' class=amount readonly> 원
<input type=hidden name=it_amount value='<?=$row[it_amount];?>'>
<? } else { ?>
상품 구입 권한이 없습니다.
<input type=hidden name=it_amount value='0'>
<? } ?>
</td>
</tr>
<tr>
<td colspan="2">
<? if (!$row[it_tel_inq] && !$row[it_gallery]) { ?>
<button onclick="fitemcheck(this.form, 'direct_buy');">구매</button>
<button onclick="fitemcheck(this.form, 'cart_update');">장바구니</button>
<? } ?>
<? if (!$row[it_gallery]) { ?>
<a href='./wishupdate.php?it_id=<?=$row[it_id]?>'>보관</a>
<a href="javascript:popup_item_recommend('<?=$row[it_id]?>');">추천</a>
<? } ?>
</td>
</tr>
</table>
</td>
</tr>
</form>
<? } ?>
<? mysql_free_result($result); ?>
<? if($i==0){ ?>
<tr><td colspan=5 align=center><span class=point>자료가 한건도 없습니다.</span></td></tr>
<? } ?>
</table>
</td>
</tr>
<tr><td colspan=5 background='<?="$g4[shop_img_path]/line_h.gif"?>' height=1></td></tr>
</table>
정말 고맙습니다.
덕분에 해결되었습니다.
고맙습니다.
덕분에 해결되었습니다.
고맙습니다.
다행입니다. ^^