diff --git a/adm/admin.menu400.shop_1of2.php b/adm/admin.menu400.shop_1of2.php new file mode 100644 index 000000000..84243bbcc --- /dev/null +++ b/adm/admin.menu400.shop_1of2.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/adm/admin.menu500.shop_2of2.php b/adm/admin.menu500.shop_2of2.php new file mode 100644 index 000000000..9b05b5d8a --- /dev/null +++ b/adm/admin.menu500.shop_2of2.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/adm/shop_admin/_common.php b/adm/shop_admin/_common.php new file mode 100644 index 000000000..8828a7346 --- /dev/null +++ b/adm/shop_admin/_common.php @@ -0,0 +1,5 @@ + diff --git a/adm/shop_admin/bannerform.php b/adm/shop_admin/bannerform.php new file mode 100644 index 000000000..259b21c4f --- /dev/null +++ b/adm/shop_admin/bannerform.php @@ -0,0 +1,141 @@ + + + + +
+ + + + + + + + + + +"; } ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 이미지 + + 삭제"; + $bimg_str = ""; + //$size = getimagesize($bimg); + //echo "삭제"; + //echo ""; + } + ?> +
$bimg_str
 이미지 설명 + + +
 링크 + + +
 출력위치 + + +
 테두리 + + +
 새창 + + +
 시작일시 + + " onclick="if (this.checked == true) this.form.bn_begin_time.value=this.form.bn_begin_chk.value; else this.form.bn_begin_time.value = this.form.bn_begin_time.defaultValue;">오늘 + +
 종료일시 + + " onclick="if (this.checked == true) this.form.bn_end_time.value=this.form.bn_end_chk.value; else this.form.bn_end_time.value = this.form.bn_end_time.defaultValue;">오늘+31일 +
 출력 순서 + + +
+ +

+   +   +

+ + + + + + diff --git a/adm/shop_admin/bannerformupdate.php b/adm/shop_admin/bannerformupdate.php new file mode 100644 index 000000000..f444c713e --- /dev/null +++ b/adm/shop_admin/bannerformupdate.php @@ -0,0 +1,72 @@ + diff --git a/adm/shop_admin/bannerlist.php b/adm/shop_admin/bannerlist.php new file mode 100644 index 000000000..29335a2ca --- /dev/null +++ b/adm/shop_admin/bannerlist.php @@ -0,0 +1,105 @@ + + + + + + + +
건수 :  
+ + + +++++++++ + + + + + + + + + + + +"; + $bn_img .= "$row[bn_alt]"; + + $bn_begin_time = substr($row[bn_begin_time], 2, 14); + $bn_end_time = substr($row[bn_end_time], 2, 14); + + $s_mod = icon("수정", "./bannerform.php?w=u&bn_id=$row[bn_id]"); + $s_del = icon("삭제", "javascript:del('./bannerformupdate.php?w=d&bn_id=$row[bn_id]');"); + + $list = $i%2; + echo " + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
ID이미지위치시작일시종료일시출력순서조회
$row[bn_id]$bn_img$row[bn_position]$bn_begin_time$bn_end_time$row[bn_order]$row[bn_hit]$s_mod $s_del
자료가 한건도 없습니다.
+ + + + + + +
+ + diff --git a/adm/shop_admin/categoryform.php b/adm/shop_admin/categoryform.php new file mode 100644 index 000000000..675f43df7 --- /dev/null +++ b/adm/shop_admin/categoryform.php @@ -0,0 +1,352 @@ += 36 * 36) + { + //alert("분류를 더 이상 추가할 수 없습니다."); + // 빈상태로 + $subid = " "; + } + $subid = base_convert($subid, 10, 36); + $subid = substr("00" . $subid, -2); + $subid = $ca_id . $subid; + + $sublen = strlen($subid); + + if ($ca_id) // 2단계이상 분류 + { + $sql = " select * from $g4[yc4_category_table] where ca_id = '$ca_id' "; + $ca = sql_fetch($sql); + $html_title = $ca[ca_name] . " 하위분류추가"; + $ca[ca_name] = ""; + } + else // 1단계 분류 + { + $html_title = "1단계분류추가"; + $ca[ca_use] = 1; + $ca[ca_menu] = 1; + $ca[ca_explan_html] = 1; + $ca[ca_img_width] = $default[de_simg_width]; + $ca[ca_img_height] = $default[de_simg_height]; + $ca[ca_list_mod] = 4; + $ca[ca_list_row] = 5; + $ca[ca_stock_qty] = 99999; + } + $ca[ca_skin] = "list.skin.10.php"; +} +else if ($w == "u") +{ + $sql = " select * from $g4[yc4_category_table] where ca_id = '$ca_id' "; + $ca = sql_fetch($sql); + if (!$ca[ca_id]) + alert("자료가 없습니다."); + + $html_title = $ca[ca_name] . " 수정"; + $ca[ca_name] = get_text($ca[ca_name]); +} + +$qstr = "page=$page&sort1=$sort1&sort2=$sort2"; + +$g4[title] = $html_title; +include_once ("$g4[admin_path]/admin.head.php"); +?> + + + + + +
+ + + + + + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
분류코드 + + + + + + + + + "; ?> + 상품리스트 + + +
분류명 *
관리 회원아이디 + "; + else + echo "{$ca[ca_mb_id]}"; + ?> +
출력스킨 + + + +
출력이미지 폭 + 픽셀 + 이미지(소) 폭, 높이가 기본값으로 설정됩니다.\n\n$g4[shop_url]/list.php에서 출력되는 이미지의 폭과 높이입니다.");?> + 출력이미지 높이 + 픽셀 +
1라인 이미지수 + 개 + + 총라인수 + 라인 + +
옵션 제목 1 + + + 옵션 제목 2
옵션 제목 3옵션 제목 4
옵션 제목 5옵션 제목 6
재고수량 + 개 + +
판매자 E-mail + + +
메뉴표시 + value='1'>예 + + 판매가능 + value='1'>예 + +
쿠폰사용제외 + />예 + +
+ + +

+ + +++ + + + + + + + + + + + + +"; } ?> + + + + + +"; } ?> + + + + + + + + + + +
상단 파일 경로 입력이 없으면 기본 상단 파일을 사용합니다.

상단 내용과 달리 PHP 코드를 사용할 수 있습니다.");?>

하단 파일 경로 입력이 없으면 기본 하단 파일을 사용합니다.

하단 내용과 달리 PHP 코드를 사용할 수 있습니다.");?>

상단이미지 + + 삭제"; + $himg_str = ""; + //$size = getimagesize($himg); + //echo ""; + //echo ""; + } + ?> + +
$himg_str
하단이미지 + + 삭제"; + $timg_str = ""; + //$size = getimagesize($timg); + //echo "삭제"; + //echo ""; + } + ?> + +
$timg_str
상단 내용
하단 내용
+ + + +

+ + +++ + + + + + +
하위분류 + 이 분류의 설정과 같은 설정으로 반영 + +
+ + + +

+   + +

+ + + + + + \ No newline at end of file diff --git a/adm/shop_admin/categoryformupdate.php b/adm/shop_admin/categoryformupdate.php new file mode 100644 index 000000000..9ba561988 --- /dev/null +++ b/adm/shop_admin/categoryformupdate.php @@ -0,0 +1,177 @@ + '$ca_id' "; + $row = sql_fetch($sql); + if ($row[cnt] > 0) + alert("이 분류에 속한 하위 분류가 있으므로 삭제 할 수 없습니다.\\n\\n하위분류를 우선 삭제하여 주십시오."); + + $str = $comma = ""; + $sql = " select it_id from $g4[yc4_item_table] where ca_id = '$ca_id' "; + $result = sql_query($sql); + $i=0; + while ($row = mysql_fetch_array($result)) + { + $i++; + if ($i % 10 == 0) $str .= "\\n"; + $str .= "$comma$row[it_id]"; + $comma = " , "; + } + + if ($str) + alert("이 분류와 관련된 상품이 총 {$i} 건 존재하므로 상품을 삭제한 후 분류를 삭제하여 주십시오.\\n\\n$str"); + + // 분류 On, Off 이미지 삭제 + @unlink("{$g4[category_path]}/$ca_id"."_1"); + @unlink("{$g4[category_path]}/$ca_id"."_0"); + + // 상, 하단 이미지 삭제 + @unlink("{$g4[category_path]}/$ca_id"."_h"); + @unlink("{$g4[category_path]}/$ca_id"."_t"); + + // 분류 삭제 + $sql = " delete from $g4[yc4_category_table] where ca_id = '$ca_id' "; + sql_query($sql); +} + +$qstr = "page=$page&sort1=$sort1&sort2=$sort2"; + +if ($w == "" || $w == "u") +{ + if ($_FILES[ca_image1][name]) upload_file($_FILES[ca_image1][tmp_name], $ca_id."_1", $g4[category_path]); + if ($_FILES[ca_image0][name]) upload_file($_FILES[ca_image0][tmp_name], $ca_id."_0", $g4[category_path]); + + if ($_FILES[ca_himg][name]) upload_file($_FILES[ca_himg][tmp_name], $ca_id."_h", $g4[category_path]); + if ($_FILES[ca_timg][name]) upload_file($_FILES[ca_timg][tmp_name], $ca_id."_t", $g4[category_path]); + + goto_url("./categoryform.php?w=u&ca_id=$ca_id&$qstr"); +} else { + goto_url("./categorylist.php?$qstr"); +} +?> diff --git a/adm/shop_admin/categorylist.php b/adm/shop_admin/categorylist.php new file mode 100644 index 000000000..495962d55 --- /dev/null +++ b/adm/shop_admin/categorylist.php @@ -0,0 +1,277 @@ + '$org[ca_sort]' order by ca_sort asc limit 1 "; + $dst = sql_fetch($sql); + } + + // 옮겨갈 분류가 있다면 + if ($dst) { + $sql = " update $g4[yc4_category_table] set ca_sort = concat('$org[ca_sort]', mid(ca_sort,$level*4+1, 20)) where ca_id like '$dst[ca_id]%' "; + sql_query($sql); + + $sql = " update $g4[yc4_category_table] set ca_sort = concat('$dst[ca_sort]', mid(ca_sort,$level*4+1, 20)) where ca_id like '$org[ca_id]%' "; + sql_query($sql); + } +} + +$g4[title] = "분류관리"; +include_once ("$g4[admin_path]/admin.head.php"); + + +$where = " where "; +$sql_search = ""; +if ($stx != "") { + if ($sfl != "") { + $sql_search .= " $where $sfl like '%$stx%' "; + $where = " and "; + } + if ($save_stx != $stx) + $page = 1; +} + +$sql_common = " from $g4[yc4_category_table] "; +if ($is_admin != 'super') + $sql_common .= " $where ca_mb_id = '$member[mb_id]' "; +$sql_common .= $sql_search; + + +// 테이블의 전체 레코드수만 얻음 +$sql = " select count(*) as cnt " . $sql_common; +$row = sql_fetch($sql); +$total_count = $row[cnt]; + +$rows = $config[cf_page_rows]; +$total_page = ceil($total_count / $rows); // 전체 페이지 계산 +if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) +$from_record = ($page - 1) * $rows; // 시작 열을 구함 + +$sql_order = "order by ca_sort, ca_id "; + +// 출력할 레코드를 얻음 +$sql = " select * + $sql_common + $sql_order + limit $from_record, $rows "; +$result = sql_query($sql); + +//$qstr = "page=$page&sort1=$sort1&sort2=$sort2"; +$qstr = "$qstr&sca=$sca&page=$page&save_stx=$stx"; +?> + + + + + + + + + + +
처음 + + document.flist.sfl.value = '$sfl';"; ?> + + + + + + + 건수 :  
+ +
+ + + + + + + + + + + + + + + 0) // 2단계 이상 + { + $s_level = "  ".($level+1)."단계 분류"; + for ($k=1; $k<$level; $k++) + $s_level = "     " . $s_level; + $style = " "; + } + else // 1단계 + { + $style = " style='border:1 solid; border-color:#0071BD;' "; + } + + $s_add = icon("추가", "./categoryform.php?ca_id=$row[ca_id]&$qstr"); + $s_upd = icon("수정", "./categoryform.php?w=u&ca_id=$row[ca_id]&$qstr"); + $s_vie = icon("보기", "$g4[shop_path]/list.php?ca_id=$row[ca_id]"); + + if ($is_admin == 'super') + $s_del = icon("삭제", "javascript:del('./categoryformupdate.php?w=d&ca_id=$row[ca_id]&$qstr');"); + + + // 해당 분류에 속한 상품의 갯수 + $sql1 = " select COUNT(*) as cnt from $g4[yc4_item_table] where ca_id = '$row[ca_id]' or ca_id2 = '$row[ca_id]' or ca_id3 = '$row[ca_id]' "; + $row1 = sql_fetch($sql1); + + $list = $i%2; + echo " + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + + +
분류코드분류명메뉴표시판매가능출력순서상품수 + "; + else + echo " "; + ?> +
$row[ca_id]$s_level $row1[cnt]$s_upd $s_del $s_vie $s_add
자료가 한건도 없습니다.
+ + + + + + + + +
+ + + + + diff --git a/adm/shop_admin/categorylistupdate.php b/adm/shop_admin/categorylistupdate.php new file mode 100644 index 000000000..d57f51630 --- /dev/null +++ b/adm/shop_admin/categorylistupdate.php @@ -0,0 +1,21 @@ + diff --git a/adm/shop_admin/categoryorder.php b/adm/shop_admin/categoryorder.php new file mode 100644 index 000000000..702b445f3 --- /dev/null +++ b/adm/shop_admin/categoryorder.php @@ -0,0 +1,119 @@ + + + + +'.PHP_EOL; + echo ''.$i.'단계'.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; +} +?> + + + + \ No newline at end of file diff --git a/adm/shop_admin/categoryorderload.ajax.php b/adm/shop_admin/categoryorderload.ajax.php new file mode 100644 index 000000000..f74085a2d --- /dev/null +++ b/adm/shop_admin/categoryorderload.ajax.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/adm/shop_admin/categoryorderlowcode.ajax.php b/adm/shop_admin/categoryorderlowcode.ajax.php new file mode 100644 index 000000000..0496f98b2 --- /dev/null +++ b/adm/shop_admin/categoryorderlowcode.ajax.php @@ -0,0 +1,21 @@ + 10) + die('{"error":"마지막 레벨은 하위레벨이 없습니다."}'); + +$sql = " select ca_id, ca_name from {$g4['yc4_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len "; +$result = sql_query($sql); +while ($row = sql_fetch_array($result)) { + $id = $row['ca_id']; + $name = $row['ca_name']; + $list[] = "{\"ca_id\":\"$id\", \"ca_name\":\"$name\"}"; +} + +if ($list) + echo "{\"list\":[ ".implode(",", $list)." ]}"; +?> \ No newline at end of file diff --git a/adm/shop_admin/categoryorderupdate.ajax.php b/adm/shop_admin/categoryorderupdate.ajax.php new file mode 100644 index 000000000..9a43ee7cd --- /dev/null +++ b/adm/shop_admin/categoryorderupdate.ajax.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/adm/shop_admin/codedupcheck.php b/adm/shop_admin/codedupcheck.php new file mode 100644 index 000000000..48a141b22 --- /dev/null +++ b/adm/shop_admin/codedupcheck.php @@ -0,0 +1,30 @@ + + \ No newline at end of file diff --git a/adm/shop_admin/configform.php b/adm/shop_admin/configform.php new file mode 100644 index 000000000..de099d0d2 --- /dev/null +++ b/adm/shop_admin/configform.php @@ -0,0 +1,923 @@ + $res[0], // 결과코드 + 'coin' => $res[1], // 고객 잔액 (충전제만 해당) + 'gpay' => $res[2], // 고객의 건수 별 차감액 표시 (충전제만 해당) + 'payment' => $res[3] // 요금제 표시, A:충전제, C:정액제 + ); +} + + +$g4[title] = "쇼핑몰설정"; +include_once ("$g4[admin_path]/admin.head.php"); +?> + + + + + + +
+ + +

+ + + + + +
사업자정보 | 초기화면 | 결제정보 | 배송정보 | 기타정보 | SMS정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
회사명 + + + 사업자등록번호 + +
대표자명 + +
대표전화번호 + + 팩스번호 + +
통신판매업 신고번호 + + 부가통신 사업자번호 + +
사업장우편번호 + + 사업장주소 + +
정보관리책임자명 + + 정보책임자 e-mail + +
+ + + +

+ + + + + +
사업자정보 | 초기화면 | 결제정보 | 배송정보 | 기타정보 | SMS정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
히트상품출력 + 출력 : > + , 스킨 : + , 1라인이미지수 : + , 라인 : + , 폭 : + , 높이 : + +
추천상품출력 + 출력 : > + , 스킨 : + , 1라인이미지수 : + , 라인 : + , 폭 : + , 높이 : +
최신상품출력 + 출력 : > + , 스킨 : + , 1라인이미지수 : + , 라인 : + , 폭 : + , 높이 : +
인기상품출력 + 출력 : > + , 스킨 : + , 1라인이미지수 : + , 라인 : + , 폭 : + , 높이 : +
할인상품출력 + 출력 : > + , 스킨 : + , 1라인이미지수 : + , 라인 : + , 폭 : + , 높이 : +
+ + + +

+ + + + + +
사업자정보 | 초기화면 | 결제정보 | 배송정보 | 기타정보 | SMS정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
무통장입금사용 + + + + 은행계좌번호 + +
계좌이체 결제사용 + + + +
가상계좌 결제사용 + + + +
휴대폰결제사용 + + + +
신용카드결제사용 + + + + 카드결제최소금액 + 원 + +
현금영수증발급사용 + + + 수정에서 발급이 가능합니다.\n\n현금영수증의 취소 기능은 없으므로 PG사에서 지원하는 현금영수증 취소 기능을 사용하시기 바랍니다.", 50)?> +   현금영수증의 취소 기능은 없으므로 PG사에서 지원하는 현금영수증 취소 기능을 사용하시기 바랍니다. +
포인트 사용 + > 사용 + 기본환경설정과 동일한 설정입니다.")?> +
포인트 결제사용 + 점 + + 포인트결제 % + % + + +
포인트부여 + + + + 주문완료 포인트 + 주문 완료 일 이후에 포인트를 부여 + +
KCP SITE CODE + + SR 영대문자, 숫자 혼용 3자리 + SR 로 시작하는 영대문자, 숫자 혼용 총 5자리 코드를 입력하시면 됩니다.
만약, 사이트코드가 SR로 시작하지 않는다면 KCP에 사이트코드를 변경 요청해 주십시오.
예) SRZ89");?> +
KCP SITE KEY + SITE KEY 발급은 KCP로 문의하세요.
1544-8660
예) 1Q9YRV83gz6TukH8PjH0xFf__");?> +
에스크로 사용 + + + 반드시 KCP 관리자 > 고객센터 > 서비스변경 및 추가 > 에스크로 신청 메뉴에서 에스크로를 사용 선택하고, 결제수단별로 적용 신청한 후 사용하셔야 합니다.

에스크로 사용시 배송과의 연동은 되지 않으며 에스크로 결제만 지원됩니다.")?> +

복합과세 사용 + + + +
신용카드 결제테스트 + + + +   + [ 실결제 관리자  |  + 테스트 관리자 ] + 테스트결제 팁 더보기 +
공통 URL + /settle_kcp_common.php + 상점정보관리 > 정보변경 > 공통URL 정보 > 공통URL 변경후\"에 넣으셔야 상점에 자동으로 입금 통보됩니다.")?> +
네이버 체크아웃 + + +
체크아웃 테스트 + + +
체크아웃 쇼핑몰ID
체크아웃 인증키
체크아웃 버튼키
+ + + + +

+ + + + + +
사업자정보 | 초기화면 | 결제정보 | 배송정보 | 기타정보 | SMS정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
배송비유형 + + + +
기본배송비
배송비상한가 + 원 + ; 로 구분합니다.\n\n예를 들어 20000원 미만일 경우 4000원, 30000원 미만일 경우 3000원 으로 사용할 경우에는 배송비상한가를 20000;30000 으로 입력하고 배송비를 4000;3000 으로 입력합니다.", 50);?> +
배송비 + 원 +
지역별 배송비 + />사용 + />사용안함 +
희망배송일사용 + + + + 희망배송일날짜 + 일 + +
배송정보
교환/반품
+ + + +

+ + + + + +
사업자정보 | 초기화면 | 결제정보 | 배송정보 | 기타정보 | SMS정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
관련상품출력 + 1라인이미지수 : + , 이미지폭 : + , 이미지높이 : + +
이미지(소) 폭 + 픽셀 + + 이미지(소) 높이 + 픽셀 +
이미지(중) 폭 + 픽셀 + + 이미지(중) 높이 + 픽셀 +
로고이미지 + + 삭제"; + echo ""; + } + ?> + +
메인이미지 + + 삭제"; + echo ""; + } + ?> + +
사용후기 + + + +
스크롤배너 사용 + + + +
상품구입 권한 + + +
코드 중복검사 + > 사용 + +
비회원 장바구니 + > 사용 + +
장바구니 메세지 + > + 비회원가격과 회원가격이 다른 상품을 장바구니에 담는 경우 "가격이 다릅니다"라는 메세지를 출력합니다. + +
비회원에 대한
개인정보수집 내용

MYSQL USERMYSQL DB
서버 IP프로그램 등록번호 + + +
+ + + +

+ + + + + +
사업자정보 | 초기화면 | 결제정보 | 배송정보 | 기타정보 | SMS정보
+ + + + + + +"회원가입시", "주문서작성시", "입금확인시", "상품배송시"); +$sms_daesang = array (1=>"고객님께 발송", "관리자께 발송", "고객님께 발송", "고객님께 발송"); +?> + + + + + + +
+ + + +
()

+ + + + +
+
0 / 80 바이트

>사용
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SMS 사용 + + + +
관리자 핸드폰번호 + + +
아이코드 회원아이디 + + +
아이코드 패스워드 + + +
요금제 + + + "; + } + else if ($userinfo[payment] == "C") { + echo "정액제"; + echo ""; + } + else { + echo "가입해주세요."; + echo ""; + } + ?> + 아이코드 서비스 신청 (회원가입) + http://www.icodekorea.com + +
충전 잔액 + 원. + +
건수별 금액 + 원. +
+
회원가입시 : {이름} {회원아이디} {회사명} +
주문서작성 : {이름} {보낸분} {받는분} {주문번호} {주문금액} {회사명} +
입금확인시 : {이름} {입금액} {주문번호} {회사명} +
상품배송시 : {이름} {택배회사} {운송장번호} {주문번호} {회사명} +

주의) 80 bytes 까지만 전송됩니다. (영문 한글자 : 1byte , 한글 한글자 : 2bytes , 특수문자의 경우 1 또는 2 bytes 임) +
+
+

+ + + +

+ +

+ + + + diff --git a/adm/shop_admin/configformupdate.php b/adm/shop_admin/configformupdate.php new file mode 100644 index 000000000..f35c4a73c --- /dev/null +++ b/adm/shop_admin/configformupdate.php @@ -0,0 +1,133 @@ + 포인트 사용 +sql_query(" update $g4[config_table] set cf_use_point = '$cf_use_point' "); + +goto_url("./configform.php"); +?> diff --git a/adm/shop_admin/contentform.php b/adm/shop_admin/contentform.php new file mode 100644 index 000000000..40a57026e --- /dev/null +++ b/adm/shop_admin/contentform.php @@ -0,0 +1,141 @@ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; } ?> + + + + + +"; } ?> + + +
ID + required itemname='ID'> + + (영문자, 숫자, _ 만 가능; 20자 이내; 공란 불가) +
제목
내용
상단 파일 경로 입력이 없으면 기본 상단 파일을 사용합니다.

상단 내용과 달리 PHP 코드를 사용할 수 있습니다.");?>

하단 파일 경로 입력이 없으면 기본 하단 파일을 사용합니다.

하단 내용과 달리 PHP 코드를 사용할 수 있습니다.");?>

상단이미지 + + 삭제"; + $himg_str = ""; + } + ?> +
$himg_str
하단이미지 + + 삭제"; + $timg_str = ""; + } + ?> +
$timg_str
+ + +

+   + + + + + + + diff --git a/adm/shop_admin/contentformupdate.php b/adm/shop_admin/contentformupdate.php new file mode 100644 index 000000000..6d06d5139 --- /dev/null +++ b/adm/shop_admin/contentformupdate.php @@ -0,0 +1,67 @@ + diff --git a/adm/shop_admin/contentlist.php b/adm/shop_admin/contentlist.php new file mode 100644 index 000000000..752cfbb11 --- /dev/null +++ b/adm/shop_admin/contentlist.php @@ -0,0 +1,78 @@ + + + + + + + + +
처음 건수 :  
+ + + ++++ + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
ID제목
$row[co_id]".htmlspecialchars2($row[co_subject])."$s_mod $s_del $s_vie
자료가 한건도 없습니다.
+ + + + + + +
+ + + diff --git a/adm/shop_admin/coupon_category.php b/adm/shop_admin/coupon_category.php new file mode 100644 index 000000000..778d7c3f5 --- /dev/null +++ b/adm/shop_admin/coupon_category.php @@ -0,0 +1,134 @@ + + + + +

+
+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + "; + } + ?> +
카테고리코드카테고리명
검색된 카테고리가 없습니다.
+
+
+
+
+ +
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/coupon_item.php b/adm/shop_admin/coupon_item.php new file mode 100644 index 000000000..0400201a6 --- /dev/null +++ b/adm/shop_admin/coupon_item.php @@ -0,0 +1,137 @@ + + + + +
+
+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + "; + } + ?> +
상품코드상품명가격
검색된 상품이 없습니다.
+
+
+
+
+ +
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/coupon_member.php b/adm/shop_admin/coupon_member.php new file mode 100644 index 000000000..f44057559 --- /dev/null +++ b/adm/shop_admin/coupon_member.php @@ -0,0 +1,145 @@ + + + + +
+
+
+ + + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + "; + } + ?> +
아이디이름별명
검색된 회원이 없습니다.
+
+
+
+
+ +
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/coupondelete.php b/adm/shop_admin/coupondelete.php new file mode 100644 index 000000000..e466ca299 --- /dev/null +++ b/adm/shop_admin/coupondelete.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/adm/shop_admin/couponform.php b/adm/shop_admin/couponform.php new file mode 100644 index 000000000..6fee01444 --- /dev/null +++ b/adm/shop_admin/couponform.php @@ -0,0 +1,353 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
쿠폰번호
쿠폰명
쿠폰종류 /> 상품할인    /> 결제금액할인    /> 배송비할인
사용대상 /> 상품    /> 카테고리    /> 전체상품    disabled="disabled" /> 주문서
할인방식 /> 정액할인    /> 정율(%)할인
할인금액
절사금액 + +
최대할인금액원  * 0이면 제한없음
최소주문금액원  * 0이면 제한없음
사용기한 ~   * 입력예:
적용상품 
적용카테고리  전체카테고리 
적용회원  전체회원 
쿠폰사용 /> 사용함    /> 사용안함
+ +

+   + +

+
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/couponformupdate.php b/adm/shop_admin/couponformupdate.php new file mode 100644 index 000000000..9e20222a1 --- /dev/null +++ b/adm/shop_admin/couponformupdate.php @@ -0,0 +1,454 @@ + 99) { + alert('할인비율을 1과 99 사이의 값으로 입력해 주세요.'); + } + } else { + if($cp_amount < 1) { + alert('할인금액을 1원이상 입력해 주세요.'); + } + } + } + + if(!$cp_minimum) { + $cp_minimum = 0; + } + + if(!$cp_minimum) { + $cp_minimum = 0; + } + + if(!preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $cp_start)) { + alert('사용기한은 '.date("Y-m-d", time()).'형식으로 입력해 주세요.'); + } + + if(!preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $cp_end)) { + alert('사용기한은 '.date("Y-m-d", time()).'형식으로 입력해 주세요.'); + } + + if($cp_start > $cp_end) { + alert('사용시작일은 종료일 이후 일 수 없습니다.'); + } + + if($cp_end < $g4['time_ymd']) { + alert('사용종료일은 오늘('.$g4['time_ymd'].') 이전일 수 없습니다.'); + } + + if($cp_type == 0) { // 상품할인 일때 + if($cp_target == 0) { + if(!$it_id) { + alert('적용상품을 선택해 주세요.'); + } + $ca_id = ''; + } else if($cp_target == 1) { + if(!$ca_id) { + alert('적용카테고리를 입력해 주세요.'); + } + $it_id = ''; + } else if($cp_target == 2) { // 전체상품이므로 $it_id 필요없음 + $it_id = ''; + } + } + + if(!$mb_id) { + alert('적용회원을 선택해 주세요'); + } + + // ca_id에 전체카테고리와 함께 다른 정보가 있을 경우 전체카테고리로 처리 + if(strstr($ca_id, '전체카테고리')) { + $ca_id = '전체카테고리'; + } + + // mb_id에 전체회원과 함께 다른 정보가 있을 경우 전체회원으로 처리 + if(strstr($mb_id, '전체회원')) { + $mb_id = '전체회원'; + } +} + +if($w == '') { + if($cp_type) { // 결제금액할인 or 배송비할인 + $arr_mb_id = explode(',', $mb_id); + $mb_id_count = count($arr_mb_id); + + for($i=0; $i<$mb_id_count; $i++) { + // 회원체크 + if($mb_id != '전체회원') { + $sql = " select mb_id from {$g4['member_table']} + where mb_leave_date = '' and mb_intercept_date = '' and mb_id = '{$arr_mb_id[$i]}' "; + $mb = sql_fetch($sql); + if(!$mb['mb_id']) { + continue; + } + } + + $j = 0; + do { + $cp_id = coupon_generator(); + + $sql = " insert into {$g4['yc4_coupon_table']} + set cp_id = '$cp_id', + cp_subject = '$cp_subject', + cp_type = '$cp_type', + cp_target = '$cp_target', + cp_method = '$cp_method', + it_id = '$it_id', + ca_id = '$ca_id', + mb_id = '{$arr_mb_id[$i]}', + cp_start = '$cp_start', + cp_end = '$cp_end', + cp_amount = '$cp_amount', + cp_trunc = '$cp_trunc', + cp_minimum = '$cp_minimum', + cp_maximum = '$cp_maximum', + cp_use = '$cp_use', + cp_datetime = '{$g4['time_ymdhis']}' "; + $result = sql_query($sql, false); + + if($result) { + break; // 에러가 없다면 빠진다. + } else { + if($j++ > 10) { + die('coupon id error.'); + } + } + } while (1); + } + } else { // 상품할인 + if($cp_target == 2) { // 전체상품 + $arr_mb_id = explode(',', $mb_id); + $mb_id_count = count($arr_mb_id); + + for($i=0; $i<$mb_id_count; $i++) { + // 회원체크 + if($mb_id != '전체회원') { + $sql = " select mb_id from {$g4['member_table']} + where mb_leave_date = '' and mb_intercept_date = '' and mb_id = '{$arr_mb_id[$i]}' "; + $mb = sql_fetch($sql); + if(!$mb['mb_id']) { + continue; + } + } + + $j = 0; + do { + $cp_id = coupon_generator(); + + $sql = " insert into {$g4['yc4_coupon_table']} + set cp_id = '$cp_id', + cp_subject = '$cp_subject', + cp_type = '$cp_type', + cp_target = '$cp_target', + cp_method = '$cp_method', + it_id = '$it_id', + ca_id = '$ca_id', + mb_id = '{$arr_mb_id[$i]}', + cp_start = '$cp_start', + cp_end = '$cp_end', + cp_amount = '$cp_amount', + cp_trunc = '$cp_trunc', + cp_minimum = '$cp_minimum', + cp_maximum = '$cp_maximum', + cp_use = '$cp_use', + cp_datetime = '{$g4['time_ymdhis']}' "; + $result = sql_query($sql, false); + + if($result) { + break; // 에러가 없다면 빠진다. + } else { + if($j++ > 10) { + die('coupon id error.'); + } + } + } while (1); + } + } else if($cp_target == 1) { // 카테고리 + $arr_ca_id = explode(',', $ca_id); + $arr_mb_id = explode(',', $mb_id); + $ca_id_count = count($arr_ca_id); + $mb_id_count = count($arr_mb_id); + + for($i=0; $i<$ca_id_count; $i++) { + // 카테고리체크 + if($ca_id != '전체카테고리') { + $sql = " select ca_id from {$g4['yc4_category_table']} + where ca_id = '{$arr_ca_id[$i]}' and ca_use = '1' and ca_nocoupon = '0' "; + $ca = sql_fetch($sql); + if(!$ca['ca_id']) { + continue; + } + } + + for($k=0; $k<$mb_id_count; $k++) { + // 회원체크 + if($mb_id != '전체회원') { + $sql = " select mb_id from {$g4['member_table']} + where mb_leave_date = '' and mb_intercept_date = '' and mb_id = '{$arr_mb_id[$k]}' "; + $mb = sql_fetch($sql); + if(!$mb['mb_id']) { + continue; + } + } + + $j = 0; + do { + $cp_id = coupon_generator(); + + $sql = " insert into {$g4['yc4_coupon_table']} + set cp_id = '$cp_id', + cp_subject = '$cp_subject', + cp_type = '$cp_type', + cp_target = '$cp_target', + cp_method = '$cp_method', + it_id = '$it_id', + ca_id = '{$arr_ca_id[$i]}', + mb_id = '{$arr_mb_id[$k]}', + cp_start = '$cp_start', + cp_end = '$cp_end', + cp_amount = '$cp_amount', + cp_trunc = '$cp_trunc', + cp_minimum = '$cp_minimum', + cp_maximum = '$cp_maximum', + cp_use = '$cp_use', + cp_datetime = '{$g4['time_ymdhis']}' "; + $result = sql_query($sql, false); + + if($result) { + break; // 에러가 없다면 빠진다. + } else { + if($j++ > 10) { + die('coupon id error.'); + } + } + } while (1); + } + } + } else { // 상품 + $arr_it_id = explode(',', $it_id); + $arr_mb_id = explode(',', $mb_id); + $it_id_count = count($arr_it_id); + $mb_id_count = count($arr_mb_id); + + for($i=0; $i<$it_id_count; $i++) { + // 상품체크 + if($it_id != '') { + $sql = " select it_id from {$g4['yc4_item_table']} + where it_id = '{$arr_it_id[$i]}' and it_use = '1' and it_nocoupon = '0' "; + $it = sql_fetch($sql); + if(!$it['it_id']) { + continue; + } + } + + for($k=0; $k<$mb_id_count; $k++) { + // 회원체크 + if($mb_id != '전체회원') { + $sql = " select mb_id from {$g4['member_table']} + where mb_leave_date = '' and mb_intercept_date = '' and mb_id = '{$arr_mb_id[$k]}' "; + $mb = sql_fetch($sql); + if(!$mb['mb_id']) { + continue; + } + } + + $j = 0; + do { + $cp_id = coupon_generator(); + + $sql = " insert into {$g4['yc4_coupon_table']} + set cp_id = '$cp_id', + cp_subject = '$cp_subject', + cp_type = '$cp_type', + cp_target = '$cp_target', + cp_method = '$cp_method', + it_id = '{$arr_it_id[$i]}', + ca_id = '$ca_id', + mb_id = '{$arr_mb_id[$k]}', + cp_start = '$cp_start', + cp_end = '$cp_end', + cp_amount = '$cp_amount', + cp_trunc = '$cp_trunc', + cp_minimum = '$cp_minimum', + cp_maximum = '$cp_maximum', + cp_use = '$cp_use', + cp_datetime = '{$g4['time_ymdhis']}' "; + $result = sql_query($sql, false); + + if($result) { + break; // 에러가 없다면 빠진다. + } else { + if($j++ > 10) { + die('coupon id error.'); + } + } + } while (1); + } + } + } + } +} else if($w == 'u') { + $sql = " select cp_id from {$g4['yc4_coupon_table']} where cp_no = '$cp_no' "; + $row = sql_fetch($sql); + + if(!$row['cp_id']) { + alert('쿠폰 정보가 존재하지 않습니다.'); + } + + $arr_it_id = explode(',', $it_id); + $arr_ca_id = explode(',', $ca_id); + $arr_mb_id = explode(',', $mb_id); + + if(count($arr_it_id) > 1) { + alert('수정시에는 1개의 상품만 입력할 수 있습니다.'); + } + + if(count($arr_ca_id) > 1) { + alert('수정시에는 1개의 카테고리만 입력할 수 있습니다.'); + } + + if(count($arr_mb_id) > 1) { + alert('수정시에는 1명의 회원만 입력할 수 있습니다.'); + } + + // 상품체크 + if($cp_type == 0 && $cp_target == 0) { + if($it_id != '전체상품') { + $sql = " select it_id from {$g4['yc4_item_table']} where it_id = '$it_id' and it_nocoupon = '0' "; + $row = sql_fetch($sql); + if(!$row['it_id']) { + alert('존재하지 않거나 쿠폰제외 상품입니다.'); + } + } + } + + // 카테고리체크 + if($cp_type == 0 && $cp_target == 1) { + if($ca_id != '전체카테고리') { + $sql = " select ca_id from {$g4['yc4_category_table']} where ca_id = '$ca_id' and ca_nocoupon = '0' "; + $row = sql_fetch($sql); + if(!$row['ca_id']) { + alert('존재하지 않거나 쿠폰제외 카테고리입니다.'); + } + } + } + + // 회원체크 + if($mb_id != '전체회원') { + $sql = " select mb_id from {$g4['member_table']} + where mb_leave_date = '' and mb_intercept_date = '' and mb_id = '$mb_id' "; + $row = sql_fetch($sql); + if(!$row['mb_id']) { + alert('회원정보가 없거나 탈퇴 또는 차단된 회원입니다.'); + } + } + + $sql = " update {$g4['yc4_coupon_table']} + set cp_subject = '$cp_subject', + cp_type = '$cp_type', + cp_target = '$cp_target', + cp_method = '$cp_method', + it_id = '$it_id', + ca_id = '$ca_id', + mb_id = '$mb_id', + cp_start = '$cp_start', + cp_end = '$cp_end', + cp_amount = '$cp_amount', + cp_trunc = '$cp_trunc', + cp_minimum = '$cp_minimum', + cp_maximum = '$cp_maximum', + cp_use = '$cp_use', + cp_datetime = '{$g4['time_ymdhis']}' + where cp_no = '$cp_no' "; + sql_query($sql); +} else if($w == 'd') { + $sql = " select cp_id from {$g4['yc4_coupon_table']} where cp_no = '$cp_no' "; + $row = sql_fetch($sql); + + if(!$row['cp_id']) { + alert('쿠폰 정보가 존재하지 않습니다.'); + } + + $sql = " delete from {$g4['yc4_coupon_table']} where cp_no = '$cp_no' "; + sql_query($sql); +} + +if($w == 'u') { + goto_url("./couponform.php?w=u&cp_no=$cp_no&$qstr"); +} else { + goto_url("./couponlist.php?$qstr"); +} +?> \ No newline at end of file diff --git a/adm/shop_admin/couponlist.php b/adm/shop_admin/couponlist.php new file mode 100644 index 000000000..aea918ef6 --- /dev/null +++ b/adm/shop_admin/couponlist.php @@ -0,0 +1,187 @@ + + + + + + + + + + + +
'>처음 + + document.flist.sel_field.value = '$sel_field';"; ?> + document.flist.sfl.value = '$sfl';"; ?> + + + + /img/btn_search.gif' align=absmiddle> + 건수 :  
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
쿠폰번호쿠폰명회원아이디적용범위할인사용기한사용수/img/icon_insert.gif' border=0 title='상품등록'>
".$row['cp_id']."".$cp_subject."".$mb_id."".$target."".number_format($row['cp_amount']).($row['cp_method'] ? '%' : '원')."".$cp_end."".$use_count."$s_mod $s_del
자료가 한건도 없습니다.
+ + + + + + +
+
+ + + + diff --git a/adm/shop_admin/deliverycodeform.php b/adm/shop_admin/deliverycodeform.php new file mode 100644 index 000000000..2f4438c15 --- /dev/null +++ b/adm/shop_admin/deliverycodeform.php @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
배송회사명
화물추적 URL
고객센터 전화
출력 순서 + + +
+ +

+   + + + + diff --git a/adm/shop_admin/deliverycodeformupdate.php b/adm/shop_admin/deliverycodeformupdate.php new file mode 100644 index 000000000..ab8d58b20 --- /dev/null +++ b/adm/shop_admin/deliverycodeformupdate.php @@ -0,0 +1,40 @@ + diff --git a/adm/shop_admin/deliverycodelist.php b/adm/shop_admin/deliverycodelist.php new file mode 100644 index 000000000..1fc8cc9fa --- /dev/null +++ b/adm/shop_admin/deliverycodelist.php @@ -0,0 +1,75 @@ + + + + + + + + +
  건수 :  
+ + + ++++++ + + + + + + + + + +"; + + $list = $i%2; + echo " + + + + + + + "; +} + +if ($i == 0) + echo "\n"; +?> + +
ID배송회사명고객센터순서
$row[dl_id]". stripslashes($row[dl_company]) . "$row[dl_tel]$row[dl_order]$s_mod $s_del $s_vie
자료가 한건도 없습니다.
+ + diff --git a/adm/shop_admin/deliverylist.php b/adm/shop_admin/deliverylist.php new file mode 100644 index 000000000..ebb1786a6 --- /dev/null +++ b/adm/shop_admin/deliverylist.php @@ -0,0 +1,214 @@ +$row[dl_company]"; +} +// 배송회사리스트 end --------------------------------------------- + +$where = " where "; +$sql_search = ""; +if ($search != "") { + if ($sel_field != "") { + $sql_search .= " $where $sel_field like '%$search%' "; + $where = " and "; + } +} + +if ($sel_ca_id != "") { + $sql_search .= " $where ca_id like '$sel_ca_id%' "; +} + +if ($sel_field == "") $sel_field = "od_id"; + +$sql_common = " from $g4[yc4_order_table] a + left join $g4[yc4_cart_table] b on (a.on_uid=b.on_uid) + $sql_search "; + +// 테이블의 전체 레코드수만 얻음 +if ($chk_misu) { + $sql = " select od_id, a.*, "._MISU_QUERY_." $sql_common group by od_id having misu <= 0 "; + $result = sql_query($sql); + $total_count = mysql_num_rows($result); +} +else { + $row = sql_fetch("select count(od_id) as cnt from {$g4['yc4_order_table']} $sql_search "); + $total_count = $row[cnt]; +} + +$rows = $config[cf_page_rows]; +$total_page = ceil($total_count / $rows); // 전체 페이지 계산 +if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) +$from_record = ($page - 1) * $rows; // 시작 열을 구함 + +if (!$sort1) { + $sort1 = "od_id"; +} + +if (!$sort2) { + $sort2 = "desc"; +} + +if ($sort2 == "desc") { + $unsort2 == "asc"; +} else { + $unsort2 == "desc"; +} + +$qstr1 = "sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&chk_misu=$chk_misu"; +$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; +?> + +

+ + + + + + + + +
처음 + +    + + document.flist.sel_field.value = '$sel_field';"; ?> + + + + 건수 :  
+
+ + +
+ + + + + + + ++++++++++ + + + + + + + + + + + + +-"; + + $list = $i%2; + echo " + + + + + + + + + + + + + + + + + "; + + if ($row[dl_id]) { + //echo ""; + // FF 3.0 에서 위의 코드는 에러를 발생함 (080626 수정) + echo ""; + } +} +if ($i == 0) + echo ""; +?> + +
주문번호주문자주문액입금액미수금희망배송일배송일시배송회사운송장번호
$row[od_id]$row[od_name]".display_amount($row[orderamount])." ".display_amount($row[receiptamount])." ".display_amount($row[misu])." $hope_date + + $row[it_hit]
자료가 한건도 없습니다.
+ + + + + + +
+ + + + + + +
메일발송  SMS 
+
+
+ +
+* 주문액은 취소, 반품, 품절, DC가 포함된 금액이 아닙니다.
+* 입금액은 환불, 승인취소가 포함된 금액이 아닙니다.
+* 배송일시, 배송회사는 입력의 편의성을 위하여 기본값으로 설정되어 있습니다. 운송장번호만 없는것이 미배송 주문자료입니다. + + diff --git a/adm/shop_admin/deliverylistupdate.php b/adm/shop_admin/deliverylistupdate.php new file mode 100644 index 000000000..2e27d8069 --- /dev/null +++ b/adm/shop_admin/deliverylistupdate.php @@ -0,0 +1,111 @@ +SMS_con($default['de_icode_server_ip'], $default['de_icode_id'], $default['de_icode_pw'], $default['de_icode_server_port']); +} + +for ($m=0; $mAdd($receive_number, $send_number, $default['de_icode_id'], stripslashes($sms_contents), ""); + } + } + //--------------------------------------- + } + } + else + { + $sql = "update $g4[yc4_order_table] + set od_invoice_time = '', + dl_id = '', + od_invoice = '' + where od_id = '{$_POST[od_id][$m]}' "; + sql_query($sql); + } +} + +if ($default[de_sms_use] == "icode") +{ + $SMS->Send(); +} + +goto_url("./deliverylist.php?sort1=$sort1&sort2=$sort2&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&page=$page"); +?> diff --git a/adm/shop_admin/faqform.php b/adm/shop_admin/faqform.php new file mode 100644 index 000000000..58b36241e --- /dev/null +++ b/adm/shop_admin/faqform.php @@ -0,0 +1,107 @@ + + +

+ + + + + +

+ + + + + + + + + + + + + + + + + + + + +
출력 순서 + + +
질문 + + + +
답변 + +
+ +

+   + +

+ + + + diff --git a/adm/shop_admin/faqformupdate.php b/adm/shop_admin/faqformupdate.php new file mode 100644 index 000000000..ba50f5f3e --- /dev/null +++ b/adm/shop_admin/faqformupdate.php @@ -0,0 +1,43 @@ + diff --git a/adm/shop_admin/faqlist.php b/adm/shop_admin/faqlist.php new file mode 100644 index 000000000..0d2fe8aa0 --- /dev/null +++ b/adm/shop_admin/faqlist.php @@ -0,0 +1,100 @@ + + + + + + + + +
 건수 :  
+ + + +++++ + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
번호제목순서 + + +
$num" . stripslashes($row[fa_subject]) . "$row[fa_order]$s_mod $s_del
자료가 한건도 없습니다.


+ + + + + +
+ + + + +
+ · FAQ 질문, 답변 등록하기
+ +   : FAQ는 무제한으로 등록할 수 있습니다.
+ 1. 를 눌러 세부적인 질문과 답변을 입력합니다.
+
+
+ +

+ + + + diff --git a/adm/shop_admin/faqmasterform.php b/adm/shop_admin/faqmasterform.php new file mode 100644 index 000000000..a75f722ee --- /dev/null +++ b/adm/shop_admin/faqmasterform.php @@ -0,0 +1,111 @@ + + + + + + + + +

+ + + + + + + + + + + + + + +"; } ?> + + + + + +"; } ?> + + + + + + + + + + +
제목 + + 상세보기"; + } + ?> +
상단이미지 + + 삭제"; + $himg_str = ""; + } + ?> +
$himg_str
하단이미지 + + 삭제"; + $timg_str = ""; + } + ?> +
$timg_str
상단 내용
하단 내용
+ +

+   + +

+ + + + diff --git a/adm/shop_admin/faqmasterformupdate.php b/adm/shop_admin/faqmasterformupdate.php new file mode 100644 index 000000000..443d29850 --- /dev/null +++ b/adm/shop_admin/faqmasterformupdate.php @@ -0,0 +1,61 @@ + diff --git a/adm/shop_admin/faqmasterlist.php b/adm/shop_admin/faqmasterlist.php new file mode 100644 index 000000000..4dc731450 --- /dev/null +++ b/adm/shop_admin/faqmasterlist.php @@ -0,0 +1,108 @@ + + + + + + + + +
처음 건수 :  
+ + + ++++++ + + + + + + + + + + + + + + + "; +} + +if ($i == 0) + echo "\n"; +?> + +
ID제목FAQ 수상세보기
$row[fm_id]" . stripslashes($row[fm_subject]) . "$cnt$s_detail_vie$s_mod $s_del $s_vie
자료가 한건도 없습니다.
+ + + + + + +

+ + + + + + +
+ + + + +
+ · FAQ 등록하기
+ + : FAQ는 무제한으로 등록할 수 있습니다.
+ 1. 먼저 를 눌러 FAQ Master를 생성합니다. (하나의 FAQ 타이틀 생성 : 자주하시는 질문, 이용안내..등 )
+ 2. 상세보기에 있는 을 눌러 세부 내용으로 들어갑니다. +
+
+ + diff --git a/adm/shop_admin/img/btn_code.gif b/adm/shop_admin/img/btn_code.gif new file mode 100644 index 000000000..6afef59af Binary files /dev/null and b/adm/shop_admin/img/btn_code.gif differ diff --git a/adm/shop_admin/img/btn_zip_find.gif b/adm/shop_admin/img/btn_zip_find.gif new file mode 100644 index 000000000..95c736784 Binary files /dev/null and b/adm/shop_admin/img/btn_zip_find.gif differ diff --git a/adm/shop_admin/img/icon_catlevel.gif b/adm/shop_admin/img/icon_catlevel.gif new file mode 100644 index 000000000..29055d4a9 Binary files /dev/null and b/adm/shop_admin/img/icon_catlevel.gif differ diff --git a/adm/shop_admin/img/skinL1_btnalldel.gif b/adm/shop_admin/img/skinL1_btnalldel.gif new file mode 100644 index 000000000..594e0d335 Binary files /dev/null and b/adm/shop_admin/img/skinL1_btnalldel.gif differ diff --git a/adm/shop_admin/img/skinL1_btncnl.gif b/adm/shop_admin/img/skinL1_btncnl.gif new file mode 100644 index 000000000..68cdf12e5 Binary files /dev/null and b/adm/shop_admin/img/skinL1_btncnl.gif differ diff --git a/adm/shop_admin/img/skinL1_btndel.gif b/adm/shop_admin/img/skinL1_btndel.gif new file mode 100644 index 000000000..bdbb0ca9c Binary files /dev/null and b/adm/shop_admin/img/skinL1_btndel.gif differ diff --git a/adm/shop_admin/img/skinL1_btnpls.gif b/adm/shop_admin/img/skinL1_btnpls.gif new file mode 100644 index 000000000..ce3314043 Binary files /dev/null and b/adm/shop_admin/img/skinL1_btnpls.gif differ diff --git a/adm/shop_admin/img/skinL1_btnsnd.gif b/adm/shop_admin/img/skinL1_btnsnd.gif new file mode 100644 index 000000000..d0192e94a Binary files /dev/null and b/adm/shop_admin/img/skinL1_btnsnd.gif differ diff --git a/adm/shop_admin/img/skinL1_icon.gif b/adm/shop_admin/img/skinL1_icon.gif new file mode 100644 index 000000000..49750f000 Binary files /dev/null and b/adm/shop_admin/img/skinL1_icon.gif differ diff --git a/adm/shop_admin/img/skinL1_img1.gif b/adm/shop_admin/img/skinL1_img1.gif new file mode 100644 index 000000000..14d631cc8 Binary files /dev/null and b/adm/shop_admin/img/skinL1_img1.gif differ diff --git a/adm/shop_admin/img/skinL1_img2.gif b/adm/shop_admin/img/skinL1_img2.gif new file mode 100644 index 000000000..3928b50c7 Binary files /dev/null and b/adm/shop_admin/img/skinL1_img2.gif differ diff --git a/adm/shop_admin/img/skinL1_img3.gif b/adm/shop_admin/img/skinL1_img3.gif new file mode 100644 index 000000000..679a45fe9 Binary files /dev/null and b/adm/shop_admin/img/skinL1_img3.gif differ diff --git a/adm/shop_admin/img/skinL1_top.gif b/adm/shop_admin/img/skinL1_top.gif new file mode 100644 index 000000000..4ccf46e33 Binary files /dev/null and b/adm/shop_admin/img/skinL1_top.gif differ diff --git a/adm/shop_admin/img/skinL1_under.gif b/adm/shop_admin/img/skinL1_under.gif new file mode 100644 index 000000000..9266ea45b Binary files /dev/null and b/adm/shop_admin/img/skinL1_under.gif differ diff --git a/adm/shop_admin/img/sms_back.gif b/adm/shop_admin/img/sms_back.gif new file mode 100644 index 000000000..1041a5d19 Binary files /dev/null and b/adm/shop_admin/img/sms_back.gif differ diff --git a/adm/shop_admin/index.php b/adm/shop_admin/index.php new file mode 100644 index 000000000..460c327ea --- /dev/null +++ b/adm/shop_admin/index.php @@ -0,0 +1,239 @@ + + + + + + + + +
+ + + + + +
 
+ + + + + + + + + + + + + + + + + + + "; + } + + if ($i == 0) { + echo ""; + } + ?> + +
주문번호주문자입금액결제방법수정
{$row['od_id']}$name".display_amount($row['receiptamount'])." $settle_method".icon("수정", "./orderform.php?od_id={$row['od_id']}")."
자료가 없습니다.
+
+ + + + + +
 
+ + + + + + + + + + + + 0 + order by b.od_id desc + limit $max_limit "; + $result = sql_query($sql); + for ($i=0; $row=sql_fetch_array($result); $i++) + { + $sql1 = " select * from {$g4['member_table']} where mb_id = '{$row['mb_id']}' "; + $row1 = sql_fetch($sql1); + + $name = get_sideview($row['mb_id'], get_text($row['od_name']), $row1['mb_email'], $row1['mb_homepage']); + + $settle_method = ""; + if ($row['od_settle_case']) + { + $settle_method = $row['od_settle_case']; + } + + $list = $i%2; + echo " + + + + + + + "; + } + + if ($i == 0) + echo ""; + ?> + +
주문번호주문자주문액결제방법수정
{$row['od_id']}$name".display_amount($row['orderamount'])." $settle_method".icon("수정", "./orderform.php?od_id={$row['od_id']}")."
자료가 없습니다.
+ + +

+ + + + + + + +
+ + + + + +
 
+ + + + + + + + + + + + + + "; + } + + if ($i == 0) + echo ""; + ?> + +
회원명제목수정
$name".cut_str($row['is_subject'],40)."".icon("수정", "./itempsform.php?w=u&is_id={$row['is_id']}")."
자료가 없습니다.
+
+ + + + + + +
/img/icon_more.gif' border=0> 
+ + + + + + + + + + + + + + "; + } + + if ($i == 0) + echo ""; + ?> + +
회원명제목수정
$name".cut_str($row['iq_subject'],40)."".icon("수정", "./itemqaform.php?w=u&iq_id={$row['iq_id']}")."
자료가 없습니다.
+

+ + diff --git a/adm/shop_admin/invoicebundle.php b/adm/shop_admin/invoicebundle.php new file mode 100644 index 000000000..f16e72e43 --- /dev/null +++ b/adm/shop_admin/invoicebundle.php @@ -0,0 +1,110 @@ + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CSV 파일 + +
주문내역출력에서 다운로드 받은 CSV 파일에 운송장번호만 입력하신 후 저장하여, + 반드시 이 CSV 파일로만 업로드 하시기 바랍니다. +
배송회사 + +
배송일시 + + " + onclick="if (this.checked == true) this.form.od_invoice_time.value=this.form.od_invoice_chk.value; else this.form.od_invoice_time.value = this.form.od_invoice_time.defaultValue;">현재 시간 +
주문상품 상태 + + 주문상품의 상태를 일괄 변경합니다. +
업데이트 + 이미 입력된 배송정보를 모두 새로 업데이트 합니다. +
+ +

+ + +

+ +
+ + + + diff --git a/adm/shop_admin/invoicebundleupdate.php b/adm/shop_admin/invoicebundleupdate.php new file mode 100644 index 000000000..096c548c5 --- /dev/null +++ b/adm/shop_admin/invoicebundleupdate.php @@ -0,0 +1,73 @@ +"; + //print_r2($row); + if (!$row[od_id]) continue; + + // 이미 입력된 운송장번호를 모두 새로 수정하지 않는다면... + if ($row[dl_id] && $row[od_invoice] && !$re) + continue; + + $sql = " update $g4[yc4_order_table] + set od_invoice = '$od_invoice', + od_invoice_time = '$od_invoice_time', + dl_id = '$_POST[dl_id]' + where od_id = '$od_id' "; + sql_query($sql); + + if ($ct_status) + { + $sql = " update $g4[yc4_cart_table] + set ct_status = '$ct_status' + where on_uid = '$row[on_uid]' + and ct_status in ('주문', '준비', '배송', '완료') "; + sql_query($sql); + } + + $i++; + $msg .= sprintf("%05d", $i) . ". 주문번호 : $od_id -> 송장번호 : $od_invoice
"; + } +} + +$g4[title] = "배송일괄등록 처리결과"; +include_once ("$g4[admin_path]/admin.head.php"); + +echo subtitle($g4[title]); +echo "

"; + +if ($msg) +{ + echo $msg; + echo "업데이트 완료
"; +} +else + echo "처리 내역이 없습니다."; +echo "

[끝]"; + +include_once ("$g4[admin_path]/admin.tail.php"); +?> \ No newline at end of file diff --git a/adm/shop_admin/item_copy.php b/adm/shop_admin/item_copy.php new file mode 100644 index 000000000..c24e9152e --- /dev/null +++ b/adm/shop_admin/item_copy.php @@ -0,0 +1,46 @@ + + + + +\n"; + + $date = preg_replace("/-/", "", $save[od_date]); + + echo " + + + + + + + + + + + \n"; +} +?> + + + +
+ + + + + + + + +
상품코드
+ +

+

+ +  + +
+ + + + + \ No newline at end of file diff --git a/adm/shop_admin/item_copy_update.php b/adm/shop_admin/item_copy_update.php new file mode 100644 index 000000000..8cb6a45ba --- /dev/null +++ b/adm/shop_admin/item_copy_update.php @@ -0,0 +1,88 @@ + \ No newline at end of file diff --git a/adm/shop_admin/item_option_check.php b/adm/shop_admin/item_option_check.php new file mode 100644 index 000000000..fb30fd470 --- /dev/null +++ b/adm/shop_admin/item_option_check.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/adm/shop_admin/item_option_stock.php b/adm/shop_admin/item_option_stock.php new file mode 100644 index 000000000..eed03ff62 --- /dev/null +++ b/adm/shop_admin/item_option_stock.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/adm/shop_admin/itemevent.php b/adm/shop_admin/itemevent.php new file mode 100644 index 000000000..6fd7c6e9a --- /dev/null +++ b/adm/shop_admin/itemevent.php @@ -0,0 +1,88 @@ + + + + + + + + +
  건수 :  
+ + + ++++++ + + + + + + + + +"; + } + + $list = $i%2; + echo " + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + + +
이벤트번호제목연결상품사용
$row[ev_id]$row[ev_subject]$href$ev[cnt]".($row[ev_use] ? "예" : "아니오")."$s_mod $s_del $s_vie
자료가 한건도 없습니다.
+ + + + + diff --git a/adm/shop_admin/itemeventform.php b/adm/shop_admin/itemeventform.php new file mode 100644 index 000000000..f332cbb19 --- /dev/null +++ b/adm/shop_admin/itemeventform.php @@ -0,0 +1,197 @@ + + +

+ + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; } ?> + + + + + +"; } ?> + + + + + +"; } ?> + + + + + + + + + + +
이벤트번호 + +
출력스킨 + + + + + + +
출력이미지 폭 + 픽셀 + 이미지(소) 폭, 높이가 기본값으로 설정됩니다.\n\n$cart_dir/event.php에서 출력되는 이미지의 폭과 높이입니다.", 50);?> + 출력이미지 높이 픽셀
1라인 이미지수 + 개 + + 총라인수 + 라인 + +
사용 + + + +
이벤트제목
메뉴이미지 + + 삭제"; + $mimg_str = ""; + } + ?> + +
$mimg_str
상단이미지 + + 삭제"; + $himg_str = ""; + } + ?> + +
$himg_str
하단이미지 + + 삭제"; + $timg_str = ""; + } + ?> + +
$timg_str
상단 내용
하단 내용
+ +

+   + +

+ + + + + + diff --git a/adm/shop_admin/itemeventformupdate.php b/adm/shop_admin/itemeventformupdate.php new file mode 100644 index 000000000..426322321 --- /dev/null +++ b/adm/shop_admin/itemeventformupdate.php @@ -0,0 +1,69 @@ + diff --git a/adm/shop_admin/itemeventlist.php b/adm/shop_admin/itemeventlist.php new file mode 100644 index 000000000..ebf01bb78 --- /dev/null +++ b/adm/shop_admin/itemeventlist.php @@ -0,0 +1,184 @@ + + +
+ + + + + + + + +
처음 + 이벤트를 선택하세요"; + $sql1 = " select ev_id, ev_subject from $g4[yc4_event_table] order by ev_id desc "; + $result1 = sql_query($sql1); + while ($row1=mysql_fetch_array($result1)) + $event_option .= " + + + + + document.flist.sel_field.value = '$sel_field';"; ?> + + + + 건수 :  
+
+ + +
+ + + + + + + + +++++ + + + + + + + + + + + + + "; +} + +if ($i == 0) + echo ""; +?> + +
이벤트사용상품코드상품명
$row[it_id]".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str(stripslashes($row[it_name]), 60, "…")."
자료가 한건도 없습니다.
+ + + + + + + +

+ +* 상품을 이벤트별로 일괄 처리합니다. + + + + diff --git a/adm/shop_admin/itemeventlistupdate.php b/adm/shop_admin/itemeventlistupdate.php new file mode 100644 index 000000000..1d81881ff --- /dev/null +++ b/adm/shop_admin/itemeventlistupdate.php @@ -0,0 +1,27 @@ + diff --git a/adm/shop_admin/itemeventwin.php b/adm/shop_admin/itemeventwin.php new file mode 100644 index 000000000..6f29ddd2d --- /dev/null +++ b/adm/shop_admin/itemeventwin.php @@ -0,0 +1,59 @@ + + + + +
+ + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) + echo ""; +?> + + +
상품명사용구분삭제
".get_it_image("$row[it_id]_s", 40, 40)."".cut_str(stripslashes($row[it_name]), 60, "…")."".($row[it_use]?"사용":"미사용")."".icon("삭제", "javascript:del('./itemeventwindel.php?ev_id=$ev_id&it_id=$row[it_id]');")."
자료가 한건도 없습니다.
+ +
+ + diff --git a/adm/shop_admin/itemeventwindel.php b/adm/shop_admin/itemeventwindel.php new file mode 100644 index 000000000..95d6ca885 --- /dev/null +++ b/adm/shop_admin/itemeventwindel.php @@ -0,0 +1,13 @@ + diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php new file mode 100644 index 000000000..bd5a1dfc8 --- /dev/null +++ b/adm/shop_admin/itemform.php @@ -0,0 +1,953 @@ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
분류명 + + + + + + + + +
상품코드 + + + + + + + + + + + + 사용후기 + 상품문의 + + +
상품명 + +
출력유형 + > 갤러리로 사용 + + 출력순서 + + +
상품유형 + > + > + > + > + > + +
제조사 + + + 원산지 + + +
브랜드 + + + 모델명 + + +
선택옵션 />등록안함    />등록함    + 선택옵션설정
추가옵션 />등록안함    />등록함    + 추가옵션설정
가격/포인트/재고 + + + + + + + + + + + + + + + + + +
비회원가격 회원가격 특별회원가격 시중가격 포인트 재고수량 재고는 규격, 색상별로 관리되지는 않으며 상품별로 관리됩니다.\n이곳에 100개를 설정하고 상품 10개가 주문,준비,배송,완료 상태에 있다면 현재고는 90개로 나타내어집니다.\n주문관리에서 상품별로 상태가 변경될때 재고를 가감하게 됩니다.", -450, -120);?>
+
상품구분 /> 과세상품 + /> 면세상품쿠폰제외상품 /> 예
기본설명 + + +
상품설명
배송비설정 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
배송비유형상세조건기본배송비결제방법
/>무료배송무조건 무료배송0원
/>조건부 무료상품구매액 함계 원 이상 무료배송 + +
/>유료배송고정배송비 부과
/>수량별 부과수량 개마다 반복부과
+
판매자 e-mail + + +
전화문의 + value='1'> 예 + + 판매가능 + value='1'> 예 + +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
이미지(대) + + 삭제"; + echo ""; + } + ?> + + 이미지(중), 이미지(소)를 자동생성 하시려면 체크하세요. JPG 파일만 가능합니다. "; + echo "
중, 소 이미지를 자동으로 생성하시는 경우에 체크하세요. (JPG 파일만 가능)"; + echo help("이미지(중) 이미지(소) 의 사이즈를 환경설정에서 정한 폭과 높이로 자동생성합니다.\n\nJPG 파일만 가능합니다."); + } + ?> +
이미지(중) + + 삭제"; + echo ""; + } + ?> +   +
이미지(소) + + 삭제"; + echo ""; + } + ?> +   +
이미지(대) + size=40> + 삭제"; + echo "
+ +

+   + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
선택된 목록등록된 목록
+
+ 선택된 관련상품 +
+
+ ※ 상품 선택후 더블클릭하면 삭제됨
※ 한 번 클릭시 상품이미지/상품금액 출력
+
+ + +
상품목록
+ + ※ 상품 선택후 더블클릭하면 왼쪽에 추가됨
※ 한 번 클릭시 상품이미지/상품금액 출력
+
+ + +
+ 선택된 이벤트
+ +
+ 이벤트 선택후 더블클릭하면 삭제됨
+ + +
이벤트목록 + 이벤트 선택후 더블클릭하면 왼쪽에 추가됨
+ + +
+ + + + + + + + +"; } ?> + + + + + +"; } ?> + + + + + + + + + + + + + + + + + +
상단이미지 + + 삭제"; + $himg_str = ""; + } + ?> + +
$himg_str
하단이미지 + + 삭제"; + $timg_str = ""; + } + ?> + +
$timg_str
상품상단내용
상품하단내용
입력일시 + + +

+ + +

+   + +

+ + + + diff --git a/adm/shop_admin/itemformrelation.php b/adm/shop_admin/itemformrelation.php new file mode 100644 index 000000000..955b90586 --- /dev/null +++ b/adm/shop_admin/itemformrelation.php @@ -0,0 +1,46 @@ + '$it_id' + order by ca_id, it_name "; +$result = sql_query($sql); +$num = @mysql_num_rows($result); +?> + + \ No newline at end of file diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php new file mode 100644 index 000000000..7599175e9 --- /dev/null +++ b/adm/shop_admin/itemformupdate.php @@ -0,0 +1,418 @@ +"; + echo ""; + } + else + { + // gd 버전에 따라 + if (function_exists("imagecopyresampled")) { + // 이미지(소) 생성 + $dst = imagecreatetruecolor($default[de_simg_width], $default[de_simg_height]); + imagecopyresampled($dst, $src, 0, 0, 0, 0, $default[de_simg_width], $default[de_simg_height], $size[0], $size[1]); + } else { + // 이미지(소) 생성 + $dst = imagecreate($default[de_simg_width], $default[de_simg_height]); + imagecopyresized($dst, $src, 0, 0, 0, 0, $default[de_simg_width], $default[de_simg_height], $size[0], $size[1]); + } + imagejpeg($dst, "$g4[path]/data/item/$it_id"."_s", 90); + + if (function_exists("imagecopyresampled")) { + // 이미지(중) 생성 + $dst = imagecreatetruecolor($default[de_mimg_width], $default[de_mimg_height]); + imagecopyresampled($dst, $src, 0, 0, 0, 0, $default[de_mimg_width], $default[de_mimg_height], $size[0], $size[1]); + } else { + // 이미지(중) 생성 + $dst = imagecreate($default[de_mimg_width], $default[de_mimg_height]); + imagecopyresized($dst, $src, 0, 0, 0, 0, $default[de_mimg_width], $default[de_mimg_height], $size[0], $size[1]); + } + @imagejpeg($dst, "$g4[path]/data/item/$it_id"."_m", 90); + } +} + +if ($w == "" || $w == "u") +{ + // 다음 입력을 위해서 옵션값을 쿠키로 한달동안 저장함 + //@setcookie("ck_ca_id", $ca_id, time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]); + //@setcookie("ck_maker", stripslashes($it_maker), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]); + //@setcookie("ck_origin", stripslashes($it_origin), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]); + @set_cookie("ck_ca_id", $ca_id, time() + 86400*31); + @set_cookie("ck_ca_id2", $ca_id2, time() + 86400*31); + @set_cookie("ck_ca_id3", $ca_id3, time() + 86400*31); + @set_cookie("ck_maker", stripslashes($it_maker), time() + 86400*31); + @set_cookie("ck_origin", stripslashes($it_origin), time() + 86400*31); +} + + +// 관련상품을 우선 삭제함 +sql_query(" delete from $g4[yc4_item_relation_table] where it_id = '$it_id' "); + +// 관련상품의 반대도 삭제 +sql_query(" delete from $g4[yc4_item_relation_table] where it_id2 = '$it_id' "); + +// 이벤트상품을 우선 삭제함 +sql_query(" delete from $g4[yc4_event_item_table] where it_id = '$it_id' "); + +// 개별배송비처리 +if($default['de_send_cost_case'] == "개별배송") { + if($it_sc_type == 3) { // 수량별 + $itcount = (int)preg_replace("/[^0-9]/", "", $_POST['it_count']); + if(!$itcount) { + alert('반복수량을 입력해 주세요.'); + } + + $condition = $itcount; + } else if($it_sc_type == 1) { // 조건부무료 + $itminimum = (int)preg_replace("/[^0-9]/", "", $_POST['it_minimum']); + if(!$itminimum) { + alert('구매합계 금액을 입력해 주세요.'); + } + + $condition = $itminimum; + } else { + $condition = 0; + } + + $it_sc_basic = preg_replace("/[^0-9]/", "", $it_sc_basic); + if($it_sc_type && !$it_sc_basic) { + alert('기본배송비를 입력해 주세요.'); + } +} + + +$sql_common = " ca_id = '$ca_id', + ca_id2 = '$ca_id2', + ca_id3 = '$ca_id3', + it_name = '$it_name', + it_gallery = '$it_gallery', + it_maker = '$it_maker', + it_origin = '$it_origin', + it_brand = '$it_brand', + it_model = '$it_model', + it_option_use = '$it_option_use', + it_opt1_subject = '$it_opt1_subject', + it_opt2_subject = '$it_opt2_subject', + it_opt3_subject = '$it_opt3_subject', + it_opt4_subject = '$it_opt4_subject', + it_opt5_subject = '$it_opt5_subject', + it_opt6_subject = '$it_opt6_subject', + it_opt1 = '$it_opt1', + it_opt2 = '$it_opt2', + it_opt3 = '$it_opt3', + it_opt4 = '$it_opt4', + it_opt5 = '$it_opt5', + it_opt6 = '$it_opt6', + it_supplement_use = '$it_supplement_use', + it_type1 = '$it_type1', + it_type2 = '$it_type2', + it_type3 = '$it_type3', + it_type4 = '$it_type4', + it_type5 = '$it_type5', + it_basic = '$it_basic', + it_explan = '$it_explan', + it_explan_html = '$it_explan_html', + it_notax = '$it_notax', + it_cust_amount = '$it_cust_amount', + it_amount = '$it_amount', + it_amount2 = '$it_amount2', + it_amount3 = '$it_amount3', + it_point = '$it_point', + it_sell_email = '$it_sell_email', + it_use = '$it_use', + it_stock_qty = '$it_stock_qty', + it_nocoupon = '$it_nocoupon', + it_sc_type = '$it_sc_type', + it_sc_method = '$it_sc_method', + it_sc_basic = '$it_sc_basic', + it_sc_condition = '$condition', + it_head_html = '$it_head_html', + it_tail_html = '$it_tail_html', + it_time = '$g4[time_ymdhis]', + it_ip = '$_SERVER[REMOTE_ADDR]', + it_order = '$it_order', + it_tel_inq = '$it_tel_inq' + "; + +if ($w == "") +{ + if (!trim($it_id)) { + alert("상품 코드가 없으므로 상품을 추가하실 수 없습니다."); + } + + $sql = " insert $g4[yc4_item_table] + set it_id = '$it_id', + $sql_common "; + sql_query($sql); + + // 상품등록시 등록된 선택옵션의 it_id 가 변경됐을 경우 처리 + if($it_option_use) { + $op_item_code = get_session('ss_op_item_code'); + + if($it_id != $op_item_code) { + $sql = " update {$g4['yc4_option_table']} set it_id = '$it_id' where it_id = '$op_item_code' "; + sql_query($sql); + } + } + + // 상품등록시 등록된 추가옵션의 it_id 가 변경됐을 경우 처리 + if($it_supplement_use) { + $sp_item_code = get_session('ss_sp_item_code'); + + if($it_id != $sp_item_code) { + $sql = " update {$g4['yc4_supplement_table']} set it_id = '$it_id' where it_id = '$sp_item_code' "; + sql_query($sql); + } + } + + unset($_SESSION['ss_op_item_code']); + unset($_SESSION['ss_sp_item_code']); +} +else if ($w == "u") +{ + $sql = " update $g4[yc4_item_table] + set $sql_common + where it_id = '$it_id' "; + sql_query($sql); + + // 선택옵션정보 삭제 + if(!$it_option_use) { + $sql = " delete from {$g4['yc4_option_table']} where it_id = '$it_id' "; + sql_query($sql); + } + + // 추가옵션정보 삭제 + if(!$it_supplement_use) { + $sql = " delete from {$g4['yc4_supplement_table']} where it_id = '$it_id' "; + sql_query($sql); + } +} +else if ($w == "d") +{ + if ($is_admin != 'super') + { + $sql = " select it_id from $g4[yc4_item_table] a, $g4[yc4_category_table] b + where a.it_id = '$it_id' + and a.ca_id = b.ca_id + and b.ca_mb_id = '$member[mb_id]' "; + $row = sql_fetch($sql); + if (!$row[it_id]) + alert("\'{$member[mb_id]}\' 님께서 삭제 할 권한이 없는 상품입니다."); + } + + itemdelete($it_id); +} + +if ($w == "" || $w == "u") +{ + // 관련상품 등록 + $it_id2 = explode(",", $it_list); + for ($i=0; $i"; +?> + diff --git a/adm/shop_admin/itemlist.php b/adm/shop_admin/itemlist.php new file mode 100644 index 000000000..1a0769dcd --- /dev/null +++ b/adm/shop_admin/itemlist.php @@ -0,0 +1,245 @@ +$nbsp$row[ca_name]"; +} +$ca_list .= ""; + + +$where = " and "; +$sql_search = ""; +if ($stx != "") { + if ($sfl != "") { + $sql_search .= " $where $sfl like '%$stx%' "; + $where = " and "; + } + if ($save_stx != $stx) + $page = 1; +} + +if ($sca != "") { + $sql_search .= " $where (a.ca_id like '$sca%' or a.ca_id2 like '$sca%' or a.ca_id3 like '$sca%') "; +} + +if ($sfl == "") $sfl = "it_name"; + +$sql_common = " from $g4[yc4_item_table] a , + $g4[yc4_category_table] b + where (a.ca_id = b.ca_id"; +if ($is_admin != 'super') + $sql_common .= " and b.ca_mb_id = '$member[mb_id]'"; +$sql_common .= ") "; +$sql_common .= $sql_search; + +// 테이블의 전체 레코드수만 얻음 +$sql = " select count(*) as cnt " . $sql_common; +$row = sql_fetch($sql); +$total_count = $row[cnt]; + +$rows = $config[cf_page_rows]; +$total_page = ceil($total_count / $rows); // 전체 페이지 계산 +if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) +$from_record = ($page - 1) * $rows; // 시작 열을 구함 + +if (!$sst) { + $sst = "it_id"; + $sod = "desc"; +} +$sql_order = "order by $sst $sod"; + + +$sql = " select * + $sql_common + $sql_order + limit $from_record, $rows "; +$result = sql_query($sql); + +//$qstr = "$qstr&sca=$sca&page=$page"; +$qstr = "$qstr&sca=$sca&page=$page&save_stx=$stx"; +?> + + + + + + + + + +
처음 + + + + + document.flist.sel_field.value = '$sel_field';"; ?> + document.flist.sfl.value = '$sfl';"; ?> + + + + + 건수 :  
+ + + + + + + + + + + + + + + + + + + + + + + + + +"; + //$s_copy = icon("복사", "javascript:_copy('".get_text(htmlspecialchars2($row[it_name]))."', 'item_copy_update.php?it_id=$row[it_id]&ca_id=$row[ca_id]&$qstr');"); + $s_copy = icon("복사", "javascript:_copy('$row[it_id]', '$row[ca_id]');"); + + $gallery = $row[it_gallery] ? "Y" : ""; + + $tmp_ca_list = " + + + + + + + + + + "; +} +if ($i == 0) + echo ""; +?> + +
상품코드상품명비회원가격
시중가격
회원가격
포인트
특별가격
재고
순서판매조회
$row[it_id]".get_it_image("{$row[it_id]}_s", 50, 50)."$tmp_ca_list
+ + + + + + + +
+ + + + + + +
+ + + + + + +
$row[it_hit]$s_mod $s_del $s_vie $s_copy
자료가 한건도 없습니다.
+ + + + + + +
+ + + + + diff --git a/adm/shop_admin/itemlistupdate.php b/adm/shop_admin/itemlistupdate.php new file mode 100644 index 000000000..e6f9362c4 --- /dev/null +++ b/adm/shop_admin/itemlistupdate.php @@ -0,0 +1,29 @@ + diff --git a/adm/shop_admin/itempsform.php b/adm/shop_admin/itempsform.php new file mode 100644 index 000000000..fb5e66526 --- /dev/null +++ b/adm/shop_admin/itempsform.php @@ -0,0 +1,88 @@ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 상품명
 이 름
 점 수
 제 목
 내 용 + + +
 확 인 id=is_confirm>
+ +

+   + +

+ + + + diff --git a/adm/shop_admin/itempsformupdate.php b/adm/shop_admin/itempsformupdate.php new file mode 100644 index 000000000..82b66e01b --- /dev/null +++ b/adm/shop_admin/itempsformupdate.php @@ -0,0 +1,40 @@ + diff --git a/adm/shop_admin/itempslist.php b/adm/shop_admin/itempslist.php new file mode 100644 index 000000000..5e219fe9a --- /dev/null +++ b/adm/shop_admin/itempslist.php @@ -0,0 +1,156 @@ + + +
+ + + + + + + +
처음 + + + + + document.flist.sfl.value = '$sfl';"; ?> + + + + + 건수 :  
+
+ + ++++++++ + + + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
상품명이름제목점수확인수정 삭제
".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str($row[it_name],30)."$name$row[is_subject]$row[is_score]$confirm$s_mod $s_del
자료가 한건도 없습니다.
+ + + + + + + +
 
+ + diff --git a/adm/shop_admin/itemqaform.php b/adm/shop_admin/itemqaform.php new file mode 100644 index 000000000..a8ed7c1ac --- /dev/null +++ b/adm/shop_admin/itemqaform.php @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 이 름
 제 목
 질 문 + + +
 답 변 + + +
+ +

+   + + + + diff --git a/adm/shop_admin/itemqaformupdate.php b/adm/shop_admin/itemqaformupdate.php new file mode 100644 index 000000000..b61280209 --- /dev/null +++ b/adm/shop_admin/itemqaformupdate.php @@ -0,0 +1,36 @@ + diff --git a/adm/shop_admin/itemqalist.php b/adm/shop_admin/itemqalist.php new file mode 100644 index 000000000..c0be29bfa --- /dev/null +++ b/adm/shop_admin/itemqalist.php @@ -0,0 +1,153 @@ + + +

+ + + + + + + +
처음 + + + + + document.flist.sfl.value = '$sfl';"; ?> + + + + + 건수 :  
+
+ + +++++++ + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
상품명이름질문답변수정 삭제
".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str($row[it_name],30)."$name$row[iq_subject]$answer$s_mod $s_del
자료가 한건도 없습니다.
+ + + + + + + +
 
+ + + diff --git a/adm/shop_admin/itemsellrank.php b/adm/shop_admin/itemsellrank.php new file mode 100644 index 000000000..c4f8534a6 --- /dev/null +++ b/adm/shop_admin/itemsellrank.php @@ -0,0 +1,149 @@ + + + + + + + + + + + + + +
처음 + + + + 기간 : ~ + + 건수 :  
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
순위상품명쇼핑주문준비배송완료취소반품품절합계
$num".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str($row[it_name],30)."$row[ct_status_1]$row[ct_status_2]$row[ct_status_3]$row[ct_status_4]$row[ct_status_5]$row[ct_status_6]$row[ct_status_7]$row[ct_status_8]$row[ct_status_sum]
자료가 한건도 없습니다.
+ + + + + + + +
 
+ +* 수량을 합산하여 순위를 출력합니다. + + diff --git a/adm/shop_admin/itemstocklist.php b/adm/shop_admin/itemstocklist.php new file mode 100644 index 000000000..c394c7e35 --- /dev/null +++ b/adm/shop_admin/itemstocklist.php @@ -0,0 +1,173 @@ + + + + + + + + + + + + + +
처음 + + + + + document.flist.sel_field.value = '$sel_field';"; ?> + + + + 건수 :  
+ + + +
+ + + + + + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + "; +} + +if (!$i) + echo ""; +?> + +
상품코드상품명창고재고주문대기가재고재고수정판매수정
$row[it_id]".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str(stripslashes($row[it_name]), 60, "…")."".number_format($row[it_stock_qty])."".number_format($wait_qty)."".number_format($temporary_qty)."$s_mod
자료가 한건도 없습니다.
+ + + + + + + +

+ +* 상품의 재고와 판매를 일괄 처리합니다.
+* 가재고는 창고재고 - 주문대기 수량입니다.
+* 재고수정의 수량은 창고재고를 수정하는것입니다. + + diff --git a/adm/shop_admin/itemstocklistupdate.php b/adm/shop_admin/itemstocklistupdate.php new file mode 100644 index 000000000..cf4dfbf38 --- /dev/null +++ b/adm/shop_admin/itemstocklistupdate.php @@ -0,0 +1,20 @@ + diff --git a/adm/shop_admin/itemtypelist.php b/adm/shop_admin/itemtypelist.php new file mode 100644 index 000000000..c812288ff --- /dev/null +++ b/adm/shop_admin/itemtypelist.php @@ -0,0 +1,187 @@ + + +
+ + + + + + + + + + +
처음 + + + + + document.flist.slf.value = '$sfl';"; ?> + + + + 건수 :  
+
+ + +
+ + + + + + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + "; +} + +if (!$i) + echo ""; +?> + +
상품코드상품명히트상품추천상품신규상품인기상품할인상품수정
$row[it_id]".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str(stripslashes($row[it_name]), 60, "…")."$s_mod
자료가 한건도 없습니다.
+ + + + + + + +

+ +* 상품의 유형을 일괄 처리합니다. + + diff --git a/adm/shop_admin/itemtypelistupdate.php b/adm/shop_admin/itemtypelistupdate.php new file mode 100644 index 000000000..6ae9fdfbe --- /dev/null +++ b/adm/shop_admin/itemtypelistupdate.php @@ -0,0 +1,23 @@ + diff --git a/adm/shop_admin/newwinform.php b/adm/shop_admin/newwinform.php new file mode 100644 index 000000000..9aff91a9e --- /dev/null +++ b/adm/shop_admin/newwinform.php @@ -0,0 +1,111 @@ + + + + + + + +
+ + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
시간 시간 동안 다시 띄우지 않음
시작일시 + + " onclick="if (this.checked == true) this.form.nw_begin_time.value=this.form.nw_begin_chk.value; else this.form.nw_begin_time.value = this.form.nw_begin_time.defaultValue;">오늘 + 종료일시 + + " onclick="if (this.checked == true) this.form.nw_end_time.value=this.form.nw_end_chk.value; else this.form.nw_end_time.value = this.form.nw_end_time.defaultValue;">오늘+7일 +
창위치 왼쪽창위치 위
창크기 폭창크기 높이
창제목
내용
+ +

+   + +

+ + + + diff --git a/adm/shop_admin/newwinformupdate.php b/adm/shop_admin/newwinformupdate.php new file mode 100644 index 000000000..cda7e084e --- /dev/null +++ b/adm/shop_admin/newwinformupdate.php @@ -0,0 +1,53 @@ + diff --git a/adm/shop_admin/newwinlist.php b/adm/shop_admin/newwinlist.php new file mode 100644 index 000000000..31d979709 --- /dev/null +++ b/adm/shop_admin/newwinlist.php @@ -0,0 +1,88 @@ + + + + + + + + +
  건수 :  
+ + + +++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
번호시작일시종료일시시간LeftTopHeightWidth제목
$row[nw_id]".substr($row[nw_begin_time],2,14)."".substr($row[nw_end_time],2,14)."$row[nw_disable_hours]$row[nw_left]$row[nw_top]$row[nw_height]$row[nw_width]$row[nw_subject]$s_mod $s_del
자료가 한건도 없습니다.
+ + + diff --git a/adm/shop_admin/optiondata.php b/adm/shop_admin/optiondata.php new file mode 100644 index 000000000..908824c82 --- /dev/null +++ b/adm/shop_admin/optiondata.php @@ -0,0 +1,218 @@ + 1 && count($arr_subj) != count($option_subject)) { + echo '동일한 옵션명이 있습니다.'; + exit; + } +} else { + $list = array(); + $sql = " select opt_id, opt_amount, opt_qty, opt_notice, opt_use + from `{$g4['yc4_option_table']}` + where it_id = '$it_id' + order by opt_no asc "; + $result = sql_query($sql); + + $rec_count = mysql_num_rows($result); + + // 옵션정보 + if($rec_count) { + for($i = 0; $row = sql_fetch_array($result); $i++) { + $list[$i] = $row; + } + + $opt = explode(chr(30), $list[0]['opt_id']); + $option_count = count($opt); + $option_list = count($list); + } +} +?> + + + + + + + + + + + + + + + + + + + + + +'; + $opt_id = $list[$i]['opt_id']; + + $str .= ''; + + if(trim($opt[0])) { + $str .= ''; + } + + if(trim($opt[1])) { + $str .= ''; + } + + if(trim($opt[2])) { + $str .= ''; + } + + if($list[$i]['opt_use']) { + $opt_use1 = ' selected="selected"'; + $opt_use0 = ''; + } else { + $opt_use1 = ''; + $opt_use0 = ' selected="selected"'; + } + + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + } +} else { + $str = ''; + $opt1_item = explode(',', $option_item[0]); + $opt2_item = explode(',', $option_item[1]); + $opt3_item = explode(',', $option_item[2]); + + $opt1_item_count = count($opt1_item); + $opt2_item_count = count($opt2_item); + $opt3_item_count = count($opt3_item); + + for($i = 0; $i < $opt1_item_count; $i++) { + for($j = 0; $j < $opt2_item_count; $j++) { + for($k = 0; $k < $opt3_item_count; $k++) { + $str .= ''; + $opt_id = ''; + + if(trim($opt1_item[$i])) { + $str1 = ''; + $opt_id .= $opt1_item[$i]; + } + + if(trim($opt2_item[$j])) { + $str2 = ''; + $opt_id .= chr(30) . $opt2_item[$j]; + } + + if(trim($opt3_item[$k])) { + $str3 = ''; + $opt_id .= chr(30) . $opt3_item[$k]; + } + + $str .= ''; + $str .= $str1 . $str2 . $str3; + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + } + } + } +} + +echo $str; +?> + + + + + + +
+ 추가금액    재고수량    통보수량 +    사용여부     +
옵션항목추가금액재고수량통보수량사용여부
' . $opt[0] . '' . $opt[1] . '' . $opt[2] . ''; + $str .= '
' . $opt1_item[$i] . '' . $opt2_item[$j] . '' . $opt3_item[$k] . ''; + $str .= '
+ + \ No newline at end of file diff --git a/adm/shop_admin/optiondelete.php b/adm/shop_admin/optiondelete.php new file mode 100644 index 000000000..2d658901a --- /dev/null +++ b/adm/shop_admin/optiondelete.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/adm/shop_admin/optionform.php b/adm/shop_admin/optionform.php new file mode 100644 index 000000000..511ff9100 --- /dev/null +++ b/adm/shop_admin/optionform.php @@ -0,0 +1,292 @@ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
옵션명옵션항목(,로 구분)
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/optionformupdate.php b/adm/shop_admin/optionformupdate.php new file mode 100644 index 000000000..42c4948b1 --- /dev/null +++ b/adm/shop_admin/optionformupdate.php @@ -0,0 +1,51 @@ +self.close();'; + exit; +} + +for($i = 0; $i < $count; $i++) { + $sql_common = " opt_amount = '{$_POST['opt_amount'][$i]}', + opt_qty = '{$_POST['opt_qty'][$i]}', + opt_notice = '{$_POST['opt_notice'][$i]}', + opt_use = '{$_POST['opt_use'][$i]}' "; + + $row = sql_fetch(" select opt_id from `{$g4['yc4_option_table']}` where it_id = '$it_id' and opt_id = '{$_POST['opt_id'][$i]}' "); + + if($row['opt_id']) { + $sql = " update `{$g4['yc4_option_table']}` set $sql_common where it_id = '$it_id' and opt_id = '{$_POST['opt_id'][$i]}' "; + } else { + $sql = " insert into `{$g4['yc4_option_table']}` set it_id = '$it_id', opt_id = '{$_POST['opt_id'][$i]}', $sql_common "; + } + + sql_query($sql); + + if($w == '') { + set_session('ss_op_item_code', $it_id); + } +} + +echo ''; +?> \ No newline at end of file diff --git a/adm/shop_admin/ordercardhistory.php b/adm/shop_admin/ordercardhistory.php new file mode 100644 index 000000000..58cd6492a --- /dev/null +++ b/adm/shop_admin/ordercardhistory.php @@ -0,0 +1,125 @@ + + +
+ + + + + + + + +
처음 + + document.flist.sel_field.value = '$sel_field';"; ?> + + + + 건수 :  
+ + + +++++++ + + + + + + + + + + + + + + + + + "; +} + +if ($i == 0) + echo "\n"; +?> + +
">주문번호">승인금액">승인번호">승인결과">승인일시">결제자
$row[od_id]".display_amount($row[cd_amount])."$row[cd_app_no]$row[cd_app_rt]$row[cd_app_time]$row[cd_opt01]
자료가 한건도 없습니다.
+ + + + + + +
+
+ +* 신용카드, 실시간 계좌이체로 승인한 내역이며, 주문번호를 클릭하시면 주문상세 페이지로 이동합니다. + + + diff --git a/adm/shop_admin/ordercartupdate.php b/adm/shop_admin/ordercartupdate.php new file mode 100644 index 000000000..188ae964c --- /dev/null +++ b/adm/shop_admin/ordercartupdate.php @@ -0,0 +1,86 @@ + 포인트관리에서 수작업으로 포인트를 맞추어 주셔야 합니다.\\n\\n만약, 미수금이 발생하는 경우에는 DC에 금액을 음수로 입력하시면 해결됩니다.", $url); +else + goto_url($url); +?> diff --git a/adm/shop_admin/orderdelete.php b/adm/shop_admin/orderdelete.php new file mode 100644 index 000000000..be70cd0c7 --- /dev/null +++ b/adm/shop_admin/orderdelete.php @@ -0,0 +1,30 @@ + diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php new file mode 100644 index 000000000..4e65a19f7 --- /dev/null +++ b/adm/shop_admin/orderform.php @@ -0,0 +1,859 @@ + 0) + { + $po_point = $row['ct_point'] * $row['ct_qty']; + $po_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4"; + insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['ct_id']}"); + } + + sql_query("update {$g4['yc4_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' "); + } +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// 주문서 정보 +//------------------------------------------------------------------------------ +$sql = " select * from {$g4['yc4_order_table']} where od_id = '$od_id' "; +$od = sql_fetch($sql); +if (!$od['od_id']) { + alert($alt_msg1); +} + +if ($od['mb_id'] == "") { + $od['mb_id'] = $mb_guest; +} +//------------------------------------------------------------------------------ + + +$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page"; + +// PG사를 KCP 사용하면서 테스트 상점아이디라면 +if ($default['de_card_test']) { + // 로그인 아이디 / 비번 + // 일반 : test1234 / test12345 + // 에스크로 : escrow / escrow913 + $g4['yc4_cardpg']['kcp'] = "http://testadmin8.kcp.co.kr"; +} + +$sql_common = " from ( select * from {$g4['yc4_cart_table']} + where uq_id = '{$od['od_id']}' + order by ct_id asc ) as a + left join {$g4['yc4_item_table']} as b on ( a.it_id = b.it_id )"; + +$sql = " select a.ct_id, + a.uq_id, + a.it_id, + a.it_amount, + a.ct_amount, + a.ct_qty, + a.cp_amount, + (SUM((a.ct_amount + a.it_amount) * a.ct_qty) - a.cp_amount) as orderamount, + SUM(a.ct_point * a.ct_qty) as pointamount, + (SUM(IF(a.ct_status = '취소' OR a.ct_status = '반품' OR a.ct_status = '품절', (a.ct_amount + a.it_amount) * a.ct_qty, 0))) as ordercancel, + a.ct_status, + a.ct_time, + a.ct_point_use, + a.ct_stock_use, + a.ct_option, + a.is_option, + a.it_name + $sql_common + group by a.it_id + order by a.ct_id "; +$result = sql_query($sql); +?> + + + +

+ + + + + +
+ + 희망배송일은 + () 입니다. + +
+ + +

+ + +'> +'> + + + + + + +++++++++++ + + + + + + + + + + + + +".stripslashes($row['it_name'])."
"; + if($row['is_option']) { + $it_name .= "\n".'선택사항보기'."\n"; + $it_name .= '
'."\n".'' . print_cart_options($row['uq_id'], $row['it_id']) . ''; + } + + $ct_amount['소계'] = $row['orderamount']; + $ct_point['소계'] = $row['pointamount']; + $t_ct_amount['정상'] += ($row['orderamount'] - $row['ordercancel']); + $t_ct_amount['취소'] += $row['ordercancel']; + + $image = get_it_image("{$row['it_id']}_s", (int)($default['de_simg_width'] / $image_rate), (int)($default['de_simg_height'] / $image_rate), $row['it_id']); + + $list = $i%2; + echo " + + + + + + + + + + "; + echo ""; + + $t_ct_amount['합계'] += $ct_amount['소계']; + $t_ct_point['합계'] += $ct_point['소계']; +} +?> + + + + + + + + +
전체
상품명상태수량판매가소계포인트포인트
반영
재고
반영
$image$it_name
{$row['ct_status']}$row[ct_qty]".number_format($row['it_amount'] + $row['ct_amount'])."".number_format($ct_amount['소계'])."".number_format($ct_point['소계'])."".get_yn($row['ct_point_use'])."".get_yn($row['ct_stock_use'])."
    + 주문 | + 상품준비중 | + 배송중 | + 완료 | + 취소 | + 반품 | + 품절 + + 주문일시 : () + + 주문합계 :
+
+
+ + + + 0) + $s_receipt_way .= "+포인트"; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
주문번호결제방법주문총액포인트결제액결제액(포인트포함)DC환불액주문취소
미수금 :
+ + +

+

+ + + + + + + + + + + + + + +
+ + + + + + + + + "; + echo ""; + echo ""; + echo ""; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + } + } + } + ?> + +
계좌번호".$od['od_bank_account']."
입금액
입금자
입금확인일시 + +
휴대폰번호
결제액
결제 확인일시 + +
신용카드 입금액 + +
카드 승인일시 + +
카드 승인취소
포인트
결제금액 할인
DC
환불액
배송회사 + 0) { + // get 으로 날리는 경우 운송장번호를 넘김 + if (strpos($dl['dl_url'], "=")) $invoice = $od['od_invoice']; + echo "{$dl['dl_company']}   (고객센터 : {$dl['dl_tel']}) "; + } else + echo "배송회사를 선택해 주세요."; + ?> +
운송장번호 
배송일시 
주문자 배송비' class=ed size=10 style='text-align:right;'>원 +
배송비할인' class=ed size=10 style='text-align:right;'>원 +
추가배송비' class=ed size=10 style='text-align:right;'>원 +
현금영수증"; + if ($od['od_cash']) + echo "현금영수증 확인하기"; + else + echo "현금영수증을 발급하시려면 클릭하십시오."; + echo "
+
+ + + + + + + + \n"; + $bank_account .= ""; + echo ""; + echo ""; + } + + if ($od['od_settle_case'] == '무통장') + echo ""; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
계좌번호$bank_account
입금액 + '>원 + 결제대행사"; + } + ?> +
입금자명 + '> + + SMS 문자전송 + +
입금 확인일시 + '> + " + onclick="if (this.checked == true) this.form.od_receipt_time.value=this.form.od_bank_chk.value; else this.form.od_receipt_time.value = this.form.od_receipt_time.defaultValue;">현재 시간 +
휴대폰번호
결제액 + '>원 + 결제대행사"; + ?> +
휴대폰 결제일시 + '> + " + onclick="if (this.checked == true) this.form.od_receipt_time.value=this.form.od_card_chk.value; else this.form.od_receipt_time.value = this.form.od_receipt_time.defaultValue;">현재 시간 +
신용카드 결제액 + '>원 +   + + 결제대행사 +
카드 승인일시 + '> + " + onclick="if (this.checked == true) this.form.od_receipt_time.value=this.form.od_card_chk.value; else this.form.od_receipt_time.value = this.form.od_receipt_time.defaultValue;">현재 시간 +
카드 승인취소 + '>원 +
포인트 결제액 + '>점 +
결제금액 할인 + '>원 +
DC + '>원 +
환불액 + '>원 + +
배송회사 + +
운송장번호'> + + SMS 문자전송 + +
배송일시 + '> + " + onclick="if (this.checked == true) this.form.od_invoice_time.value=this.form.od_invoice_chk.value; else this.form.od_invoice_time.value = this.form.od_invoice_time.defaultValue;">현재 시간 +
메일발송 + 예 + +
+ + 0) + echo ""; + ?> + +
+   + +
+
+ + +
+ + + + + + + + + + + +
+ + + +
+ +
+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
주문하신 분
이름' required itemname='주문하신 분 이름'>
전화번호' required itemname='주문하신 분 전화번호'>
핸드폰'>
주소 + '> - + '> +  
+ '>
+ '>
E-mail'>
IP Address
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
받으시는 분
이름' required itemname='받으시는 분 이름'>
전화번호' required itemname='받으시는 분 전화번호'>
핸드폰'>
주소 + '> - + '> +  
+ '>
+ '>
희망배송일 + ' maxlength=10 minlength=10 required itemname='희망배송일'> + ()
전하는 말씀
+
+ +

+   +   + ');"> +

+ + + + \ No newline at end of file diff --git a/adm/shop_admin/orderformupdate.php b/adm/shop_admin/orderformupdate.php new file mode 100644 index 000000000..b086ada68 --- /dev/null +++ b/adm/shop_admin/orderformupdate.php @@ -0,0 +1,30 @@ + diff --git a/adm/shop_admin/orderlist.php b/adm/shop_admin/orderlist.php new file mode 100644 index 000000000..15d41a17b --- /dev/null +++ b/adm/shop_admin/orderlist.php @@ -0,0 +1,245 @@ + + + + + + + + + + + + + +
처음 + + + + + 건수 :  
+ + + +++++++++++++ + + + + + + + + + + + + + + + + +'; + } + else + { + if ($row[od_temp_bank] > 0 || $row[od_receipt_bank] > 0) + { + //$s_receipt_way = "무통장입금"; + $s_receipt_way = cut_str($row[od_bank_account],8,""); + $s_br = "
"; + } + + if ($row[od_temp_card] > 0 || $row[od_receipt_card] > 0) + { + // 미수금이 없고 카드결제를 하지 않았다면 카드결제를 선택후 무통장 입금한 경우임 + if ($row[misuamount] <= 0 && $row[od_receipt_card] == 0) + ; // 화면 출력하지 않음 + else + { + $s_receipt_way .= $s_br."카드"; + if ($row[od_receipt_card] == 0) + $s_receipt_way .= "(미승인)"; + $s_br = "
"; + } + } + } + + if ($row[od_receipt_point] > 0) + $s_receipt_way .= $s_br."포인트"; + + $s_mod = icon("수정", "./orderform.php?od_id=$row[od_id]&$qstr"); + $s_del = icon("삭제", "javascript:del('./orderdelete.php?od_id=$row[od_id]&on_uid=$row[on_uid]&mb_id=$row[mb_id]&$qstr');"); + + $mb_nick = get_sideview($row[mb_id], $row[od_name], $row[od_email], ''); + + $tot_cnt = ""; + if ($row[mb_id]) + { + $sql2 = " select count(*) as cnt from $g4[yc4_order_table] where mb_id = '$row[mb_id]' "; + $row2 = sql_fetch($sql2); + $tot_cnt = "($row2[cnt])"; + } + + $list = $i%2; + echo " + + + + + + + + + + + + + + + "; + + $tot_itemcount += $row[itemcount]; + $tot_orderamount += $row[orderamount]; + $tot_ordercancel += $row[ordercancel]; + $tot_dc_amount += $row[od_dc_amount]; + $tot_receiptamount += $row[receiptamount]; + $tot_receiptcancel += $row[receiptcancel]; + $tot_misu += $row[misu]; +} +mysql_free_result($result); +if ($i == 0) + echo "\n"; +?> + + + + + + + + + + + + + + +
주문번호주문자회원ID건수 (누적)주문합계주문취소DC입금합계입금취소미수금결제수단수정 삭제
$row[od_id]$mb_nick$row[mb_id]{$row[itemcount]}건 $tot_cnt".number_format($row[orderamount])."".number_format($row[ordercancel])."".number_format($row[od_dc_amount])."".number_format($row[receiptamount])."".number_format($row[receiptcancel])."".number_format($row[misu])."$s_receipt_way$s_mod $s_del
자료가 한건도 없습니다.
합 계
+ + + + + + +
 
+ +주의) 주문번호를 클릭하여 나오는 주문상세내역의 주소를 외부에서 조회가 가능한곳에 올리지 마십시오. + + + + diff --git a/adm/shop_admin/orderlist2.php b/adm/shop_admin/orderlist2.php new file mode 100644 index 000000000..f8005d437 --- /dev/null +++ b/adm/shop_admin/orderlist2.php @@ -0,0 +1,269 @@ + + + + + + + + + + + + + +
처음 + + + + + 건수 :  
+ + + +++++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +'; + } + else + { + if ($row[od_temp_bank] > 0 || $row[od_receipt_bank] > 0) + { + //$s_receipt_way = "무통장입금"; + $s_receipt_way = cut_str($row[od_bank_account],8,""); + $s_br = "
"; + } + + if ($row[od_temp_card] > 0 || $row[od_receipt_card] > 0) + { + // 미수금이 없고 카드결제를 하지 않았다면 카드결제를 선택후 무통장 입금한 경우임 + if ($row[misuamount] <= 0 && $row[od_receipt_card] == 0) + ; // 화면 출력하지 않음 + else + { + $s_receipt_way .= $s_br."카드"; + if ($row[od_receipt_card] == 0) + $s_receipt_way .= "(미승인)"; + $s_br = "
"; + } + } + } + + if ($row[od_receipt_point] > 0) + $s_receipt_way .= $s_br."포인트"; + + $s_mod = icon("수정", "./orderform.php?od_id=$row[od_id]&$qstr"); + $s_del = icon("삭제", "javascript:del('./orderdelete.php?od_id=$row[od_id]&on_uid=$row[on_uid]&mb_id=$row[mb_id]&$qstr&list=2');"); + + if ($i>0) + echo ""; + + $list = $i%2; + echo " + + + + + + + + + + + + + + "; + + $tot_itemcount += $row[itemcount]; + $tot_orderamount += $row[orderamount]; + $tot_ordercancel += $row[ordercancel]; + $tot_dc_amount += $row[od_dc_amount]; + $tot_receiptamount += $row[receiptamount]; + $tot_receiptcancel += $row[receiptcancel]; + $tot_misu += $row[misu]; + + // 상품개별출력 + $sql2 = " select c.it_name, + b.* + from $g4[yc4_order_table] a + left join $g4[yc4_cart_table] b on (a.on_uid = b.on_uid) + left join $g4[yc4_item_table] c on (b.it_id = c.it_id) + where od_id = '$row[od_id]' "; + $result2 = sql_query($sql2); + for ($k=0; $row2=sql_fetch_array($result2); $k++) + { + $href = "$g4[shop_path]/item.php?it_id=$row2[it_id]"; + $it_name = "".cut_str($row2[it_name],35)."
"; + $it_name .= print_item_options($row2[it_id], $row2[it_opt1], $row2[it_opt2], $row2[it_opt3], $row2[it_opt4], $row2[it_opt5], $row2[it_opt6]); + + $sub_amount = $row2[ct_qty] * $row2[ct_amount]; + $sub_point = $row2[ct_qty] * $row2[ct_point]; + + echo " + + + + + + + + + + + "; + } +} + +if ($i == 0) + echo "\n"; +?> + + + + + + + + + + + + + + +
주문번호주문자회원ID건수주문합계주문취소DC입금합계입금취소미수금결제수단수정 삭제
상품명판매가수량포인트상태소계
$row[od_id]".cut_str($row[od_name],30,"")."$row[mb_id]{$row[itemcount]}건".number_format($row[orderamount])."".number_format($row[ordercancel])."".number_format($row[od_dc_amount])."".number_format($row[receiptamount])."".number_format($row[receiptcancel])."".number_format($row[misu])."$s_receipt_way$s_mod $s_del
+ + + + + +
".get_it_image("{$row2[it_id]}_s", 50, 50)."$it_name
".number_format($row2[ct_amount])." $row2[ct_qty]".number_format($sub_point)." $row2[ct_status]".number_format($sub_amount)." 
자료가 한건도 없습니다.
합 계
+ + + + + + +
 
+ +주의) 주문번호를 클릭하여 나오는 주문상세내역의 주소를 외부에서 조회가 가능한곳에 올리지 마십시오. + + + + diff --git a/adm/shop_admin/ordermail.inc.php b/adm/shop_admin/ordermail.inc.php new file mode 100644 index 000000000..91d827149 --- /dev/null +++ b/adm/shop_admin/ordermail.inc.php @@ -0,0 +1,143 @@ +"; + } + + if ($s_option == "") { + $s_option = "없음"; + } + + $cart_list[$i][it_id] = $ct[it_id]; + $cart_list[$i][it_name] = $ct[it_name]; + $cart_list[$i][it_opt] = $s_option; + + $ct_status = $ct[ct_status]; + if ($ct_status == "준비") { + $ct_status = "상품준비중"; + } else if ($ct_status == "배송") { + $ct_status = "배송중"; + } + + $cart_list[$i][ct_status] = $ct_status; + $cart_list[$i][ct_qty] = $ct[ct_qty]; + } + + + /* + ** 입금정보 + */ + $is_receipt = false; + + // 신용카드 입금 + if ($od[od_receipt_card] > 0) { + $card_list[od_card_time] = $od[od_card_time]; + $card_list[od_receipt_card] = display_amount($od[od_receipt_card]); + + $is_receipt = true; + } + + // 무통장 입금 + if ($od[od_receipt_bank] > 0) { + $bank_list[od_bank_time] = $od[od_bank_time]; + $bank_list[od_receipt_bank] = display_amount($od[od_receipt_bank]); + $bank_list[od_deposit_name] = $od[od_deposit_name]; + + $is_receipt = true; + } + + // 포인트 입금 + if ($od[od_receipt_point] > 0) { + $point_list[od_time] = $od[od_time]; + $point_list[od_receipt_point] = display_point($od[od_receipt_point]); + + $is_receipt = true; + } + + // 배송정보 + $is_delivery = false; + if ((int)$od[dl_id] > 0) { + $dl = sql_fetch(" select * from $g4[yc4_delivery_table] where dl_id = '$od[dl_id]' "); + + $delivery_list[dl_url] = $dl[dl_url]; + if (strpos($delivery_list[dl_url], "=")) $delivery_list[dl_url] .= $od[od_invoice]; + $delivery_list[dl_company] = $dl[dl_company]; + $delivery_list[dl_tel] = $dl[dl_tel]; + $delivery_list[od_invoice] = $od[od_invoice]; + $delivery_list[od_invoice_time] = $od[od_invoice_time]; + + $is_delivery = true; + } + + // 입금 또는 배송내역이 있다면 메일 발송 + if ($is_receipt || $is_delivery) + { + ob_start(); + include "$g4[shop_path]/mail/ordermail.mail.php"; + $content = ob_get_contents(); + ob_end_clean(); + + $title = "{$od[od_name]}님께서 주문하신 내역을 다음과 같이 처리하였습니다."; + $email = $od[od_email]; + + // 메일 보낸 내역 상점메모에 update + $od_shop_memo = "$g4[time_ymdhis] - 결제/배송내역 메일발송\n" . $od[od_shop_memo];; + /* 1.00.06 + ** 주석처리 - 처리하지 않음 + if ($receipt_check) + $od_shop_memo .= ", 입금확인"; + if ($invoice_check) + $od_shop_memo .= ", 송장번호"; + */ + + sql_query(" update $g4[yc4_order_table] set od_shop_memo = '$od_shop_memo' where od_id = '$od_id' "); + + $admin = get_admin('super'); + + mailer($config[cf_title], $admin[mb_email], $email, $title, $content, 1); + } +} +?> diff --git a/adm/shop_admin/orderprint.php b/adm/shop_admin/orderprint.php new file mode 100644 index 000000000..470df5be3 --- /dev/null +++ b/adm/shop_admin/orderprint.php @@ -0,0 +1,116 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
출력기간 + + + + + + + +
+   +   +
+ " class=ed> + ∼ + " class=ed> +   + +   + +
+
주문번호구간 + + + + + + + +
+   +   +
+ 부터 + 까지 +   + +   + +
+
+ +
+ + + + diff --git a/adm/shop_admin/orderprintresult.php b/adm/shop_admin/orderprintresult.php new file mode 100644 index 000000000..66fda311e --- /dev/null +++ b/adm/shop_admin/orderprintresult.php @@ -0,0 +1,392 @@ +"; + echo ""; + echo "xls"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for ($i=0; $row=mysql_fetch_array($result); $i++) + { + $it_name = stripslashes($row[it_name]) . "
"; + $it_name .= print_item_options($row[it_id], $row[it_opt1], $row[it_opt2], $row[it_opt3], $row[it_opt4], $row[it_opt5], $row[it_opt6]); + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + if ($i == 0) + echo ""; + echo "
우편번호주소이름전화1전화2상품명수량상품코드주문번호운송장번호전하실말씀
" . $row[od_b_zip1] . '-' . $row[od_b_zip2] . "" . $row[od_b_addr1] . ' ' . $row[od_b_addr2] . "" . $row[od_b_name] . "" . $row[od_b_tel] . "" . $row[od_b_hp] . "" . $it_name . "" . $row[ct_qty] . "" . $row[it_id] . "'" . urlencode($row[od_id]) . "'" . $row[od_invoice] . "" . $row[od_memo] . "
자료가 없습니다.
"; + echo ""; + echo ""; + + exit; +} + +function get_order($on_uid) +{ + global $g4; + + $sql = " select * from $g4[yc4_order_table] where on_uid = '$on_uid' "; + return sql_fetch($sql); +} + +$g4[title] = "주문내역"; +include_once("$g4[path]/head.sub.php"); + +if ($case == 1) +{ + $fr_date = date_conv($fr_date); + $to_date = date_conv($to_date); + $sql = " SELECT DISTINCT a.on_uid FROM $g4[yc4_order_table] a, $g4[yc4_cart_table] b + where a.on_uid = b.on_uid + and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' "; +} +else +{ + $sql = " SELECT DISTINCT a.on_uid FROM $g4[yc4_order_table] a, $g4[yc4_cart_table] b + where a.on_uid = b.on_uid + and a.od_id between '$fr_od_id' and '$to_od_id' "; +} +if ($ct_status) + $sql .= " and b.ct_status = '$ct_status' "; +$sql .= " order by a.od_id "; +$result = sql_query($sql); +if (mysql_num_rows($result) == 0) +{ + echo ""; + exit; +} +?> + + + +주문내역 + + + + +[ $fr_date - $to_date $ct_status 내역 ]"; +else + echo "

[ $fr_od_id - $to_od_id $ct_status 내역 ]"; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; +} +?> + + + + +

주문번호보낸분주소전화번호핸드폰
받는분주소전화번호핸드폰

$row1[od_id]$row1[od_name]$row1[od_addr]$row1[od_tel]$row1[od_hp]
$row1[od_b_name]$row1[od_b_addr]$row1[od_b_tel]$row1[od_b_hp]
+ + "; + + $sql2 = " select a.*, + b.it_opt1_subject, + b.it_opt2_subject, + b.it_opt3_subject, + b.it_opt4_subject, + b.it_opt5_subject, + b.it_opt6_subject, + b.it_name + from $g4[yc4_cart_table] a, $g4[yc4_item_table] b + where a.it_id = b.it_id + and a.on_uid = '$row[on_uid]' "; + if ($ct_status) + $sql2 .= " and a.ct_status = '$ct_status' "; + $sql2 .= " order by a.ct_id "; + + $res2 = sql_query($sql2); + $cnt = $sub_tot_qty = $sub_tot_amount = 0; + while ($row2 = sql_fetch_array($res2)) + { + $row2_tot_amount = $row2[ct_amount] * $row2[ct_qty]; + $sub_tot_qty += $row2[ct_qty]; + $sub_tot_amount += $row2_tot_amount; + + $it_name = stripslashes($row2[it_name]); + $it_name = "$it_name ($row2[it_id])
"; + + $str_split = ""; + for ($k=1; $k<=6; $k++) + { + if ($row2["it_opt{$k}"] == "") continue; + $it_name .= $str_split; + $it_opt_subject = $row2["it_opt{$k}_subject"]; + $opt = explode( ";", trim($row2["it_opt{$k}"]) ); + $it_name .= "   $it_opt_subject = $opt[0]"; + + if ($opt[1] != 0) + { + $it_name .= " ("; + //if (ereg("[+]", $opt[1]) == true) + if (preg_match("/[+]/", $opt[1]) == true) + $it_name .= "+"; + // 금액을 전화문의 표시로 + $it_name .= display_amount($opt[1]) . ")"; + } + $str_split = "
"; + } + $it_name .= "
"; + + $fontqty1 = $fontqty2 = ""; + if ($row2[ct_qty] >= 2) + { + $fontqty1 = ""; + $fontqty2 = ""; + } + + echo " + + + + + + + "; + $cnt++; + } + + if ($cnt >= 2) + { + echo " + + + + + "; + } + + $tot_tot_qty += $sub_tot_qty; + $tot_tot_amount += $sub_tot_amount; + + if ($od_memo) $od_memo = "비고 : $od_memo"; + if ($od_shop_memo) $od_shop_memo = "
상점메모 : $od_shop_memo"; + + echo " +
$it_name".number_format($row2[ct_amount])." $fontqty1".number_format($row2[ct_qty])."$fontqty2".number_format($row2_tot_amount)." 
합 계  ".number_format($sub_tot_qty)."".number_format($sub_tot_amount)." 
+ $od_memo + $od_shop_memo +

+ + + 전 체 합 계   + + + "; + ?> + +
".number_format($tot_tot_qty)."".number_format($tot_tot_amount)." 
+
+ +
<끝> + + + \ No newline at end of file diff --git a/adm/shop_admin/orderreceiptupdate.php b/adm/shop_admin/orderreceiptupdate.php new file mode 100644 index 000000000..61d98e199 --- /dev/null +++ b/adm/shop_admin/orderreceiptupdate.php @@ -0,0 +1,62 @@ + diff --git a/adm/shop_admin/ordersms.inc.php b/adm/shop_admin/ordersms.inc.php new file mode 100644 index 000000000..2b3bb8791 --- /dev/null +++ b/adm/shop_admin/ordersms.inc.php @@ -0,0 +1,50 @@ +SMS_con($default['de_icode_server_ip'], $default['de_icode_id'], $default['de_icode_pw'], $default['de_icode_server_port']); + $SMS->Add($receive_number, $send_number, $default['de_icode_id'], stripslashes($sms_contents), ""); + $SMS->Send(); + } + } +} + +if ($od_sms_baesong_check) +{ + if ($dl_id && $od_invoice) + { + $sms_contents = $default[de_sms_cont4]; + $sms_contents = preg_replace("/{이름}/", $od_name, $sms_contents); + $sql = " select dl_company from $g4[yc4_delivery_table] where dl_id = '$dl_id' "; + $row = sql_fetch($sql); + $sms_contents = preg_replace("/{택배회사}/", $row[dl_company], $sms_contents); + $sms_contents = preg_replace("/{운송장번호}/", $od_invoice, $sms_contents); + $sms_contents = preg_replace("/{주문번호}/", $od_id, $sms_contents); + $sms_contents = preg_replace("/{회사명}/", $default[de_admin_company_name], $sms_contents); + + if ($default[de_sms_use] == "icode") + { + $SMS = new SMS; + $SMS->SMS_con($default['de_icode_server_ip'], $default['de_icode_id'], $default['de_icode_pw'], $default['de_icode_server_port']); + $SMS->Add($receive_number, $send_number, $default['de_icode_id'], stripslashes($sms_contents), ""); + $SMS->Send(); + } + } +} +?> diff --git a/adm/shop_admin/orderstatuslist.php b/adm/shop_admin/orderstatuslist.php new file mode 100644 index 000000000..fef01b6f4 --- /dev/null +++ b/adm/shop_admin/orderstatuslist.php @@ -0,0 +1,215 @@ + + +

+ + + + + + + + + +
처음 + + + '"> + '"> + '"> + '"> + '"> + '"> + '"> +   + + + + + 건수 :  
+ + + ++++++++++++ + + + + + + + + + + + + + + + + +".cut_str($row[it_name],35)."
"; + $it_name .= print_item_options($row[it_id], $row[it_opt1], $row[it_opt2], $row[it_opt3], $row[it_opt4], $row[it_opt5], $row[it_opt6]); + + $s_mod = icon("수정", "./orderform.php?od_id=$row[od_id]"); + + $list = $i%2; + echo " + + + + + + + + + + + + + "; + + $tot_amount += $row[ct_amount]; + $tot_qty += $row[ct_qty]; + $tot_sub_amount += $row[ct_sub_amount]; + $tot_sub_point += $row[ct_sub_point]; +} + +if ($i == 0) + echo "\n"; +?> + + + + + + + + + + +
">주문번호">주문자">회원ID">상품명">판매가">수량">소계">포인트">상태수정
$row[od_id]".cut_str($row[od_name],10,"")."$row[mb_id]".get_it_image("{$row[it_id]}_s", 50, 50)."$it_name".number_format($row[ct_amount])." $row[ct_qty]".number_format($row[ct_sub_amount])." ".number_format($row[ct_sub_point])." $row[ct_status]$s_mod
자료가 한건도 없습니다.
합 계     
+ + + + + + +
 
+
+ + + + + diff --git a/adm/shop_admin/price.php b/adm/shop_admin/price.php new file mode 100644 index 000000000..b8b03d937 --- /dev/null +++ b/adm/shop_admin/price.php @@ -0,0 +1,105 @@ + + + +

+사용하실 가격비교사이트에 입점하신 후 해당하는 엔진페이지 URL 을 해당 사이트에 알려주시면 됩니다. + +

+ + diff --git a/adm/shop_admin/sale1.php b/adm/shop_admin/sale1.php new file mode 100644 index 000000000..264a6ec6c --- /dev/null +++ b/adm/shop_admin/sale1.php @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
당일 매출현황 + ' class=ed> + 일 하루 + +
일별 매출현황 + ' class=ed> + 일 부터 + ' class=ed> + 일 까지 + +
월별 매출현황 + ' class=ed> + 월 부터 + ' class=ed> + 월 까지 + +
연별 매출현황 + ' class=ed> + 년 부터 + ' class=ed> + 년 까지 + +
+ + diff --git a/adm/shop_admin/sale1date.php b/adm/shop_admin/sale1date.php new file mode 100644 index 000000000..234cb16ff --- /dev/null +++ b/adm/shop_admin/sale1date.php @@ -0,0 +1,136 @@ + 0) + echo "
$save[od_date]".number_format($save[ordercount])."".number_format($save[orderamount])."".number_format($save[ordercancel] + $save[dc])."".number_format($save[receiptbank])."".number_format($save[receiptcard])."".number_format($save[receiptpoint])."".number_format($save[receiptcancel])."".number_format($save[misu])."
+ + + + + + + + + + + + + +"; +} else { + print_line($save); +} +?> + + + + + + + + + + + + + +
주문일주문수주문합계취소+DC무통장입금카드입금포인트입금입금취소미수금
자료가 한건도 없습니다.
합 계
+ + diff --git a/adm/shop_admin/sale1month.php b/adm/shop_admin/sale1month.php new file mode 100644 index 000000000..6dd93b0de --- /dev/null +++ b/adm/shop_admin/sale1month.php @@ -0,0 +1,136 @@ + 0) + echo "\n"; + + $date = preg_replace("/-/", "", $save[od_date]); + + echo " + + $save[od_date] + ".number_format($save[ordercount])." + ".number_format($save[orderamount])." + ".number_format($save[ordercancel] + $save[dc])." + ".number_format($save[receiptbank])." + ".number_format($save[receiptcard])." + ".number_format($save[receiptpoint])." + ".number_format($save[receiptcancel])." + ".number_format($save[misu])." + \n"; +} +?> + + + + + + + + + + + + + + + + + +"; +} else { + print_line($save); +} +?> + + + + + + + + + + + + + +
주문월주문수주문합계취소+DC무통장입금카드입금포인트입금입금취소미수금
자료가 한건도 없습니다.
합 계
+ + diff --git a/adm/shop_admin/sale1today.php b/adm/shop_admin/sale1today.php new file mode 100644 index 000000000..d96bc3c47 --- /dev/null +++ b/adm/shop_admin/sale1today.php @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + 0) + echo "\n"; + + // 장바구니 상태별 금액 + $sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */ + (SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */ + from $g4[yc4_cart_table] + where on_uid = '$row[on_uid]' "; + $row1 = sql_fetch($sql1); + + if ($row[mb_id] == "") { // 비회원일 경우는 주문자로 링크 + $href = ""; + } else { // 회원일 경우는 회원아이디로 링크 + $href = ""; + } + + $row1[orderamount] += $row[od_send_cost]; + $misu = $row1[orderamount] - $row1[ordercancel] - $row[od_dc_amount] - $row[receiptamount] + $row[receiptcancel]; + + echo " + + + + + + + + + + + \n"; + + $tot[orderamount] += $row1[orderamount]; + $tot[ordercancel] += $row1[ordercancel]; + $tot[dc] += $row[od_dc_amount]; + $tot[receipt_bank] += $row[od_receipt_bank]; + $tot[receipt_card] += $row[od_receipt_card]; + $tot[receipt_point] += $row[od_receipt_point]; + $tot[receiptamount] += $row[receiptamount]; + $tot[receiptcancel] += $row[receiptcancel]; + $tot[misu] += $misu; +} + +if ($i == 0) { + echo ""; +} +?> + + + + + + + + + + + + +
주문번호주문자주문합계취소+DC무통장입금카드입금포인트입금입금취소미수금
$row[od_id]$href$row[od_name]".number_format($row1[orderamount])."".number_format($row1[ordercancel] + $row[od_dc_amount])."".number_format($row[od_receipt_bank])."".number_format($row[od_receipt_card])."".number_format($row[od_receipt_point])."".number_format($row[receiptcancel])."".number_format($misu)."
자료가 한건도 없습니다.
합 계
+ + diff --git a/adm/shop_admin/sale1year.php b/adm/shop_admin/sale1year.php new file mode 100644 index 000000000..654ba50af --- /dev/null +++ b/adm/shop_admin/sale1year.php @@ -0,0 +1,131 @@ + 0) + echo "\n"; + + echo " + + $save[od_date] + ".number_format($save[ordercount])." + ".number_format($save[orderamount])." + ".number_format($save[ordercancel] + $save[dc])." + ".number_format($save[receiptbank])." + ".number_format($save[receiptcard])." + ".number_format($save[receiptpoint])." + ".number_format($save[receiptcancel])." + ".number_format($save[misu])." + \n"; +} +?> + + + + + + + + + + + + + + + + + +"; +} else { + print_line($save); +} +?> + + + + + + + + + + + + + +
주문년도주문수주문합계취소+DC무통장입금카드입금포인트입금입금취소미수금
자료가 한건도 없습니다.
합 계
+ + diff --git a/adm/shop_admin/sendcostdelete.php b/adm/shop_admin/sendcostdelete.php new file mode 100644 index 000000000..8efbd1526 --- /dev/null +++ b/adm/shop_admin/sendcostdelete.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/adm/shop_admin/sendcostlist.php b/adm/shop_admin/sendcostlist.php new file mode 100644 index 000000000..7418c4481 --- /dev/null +++ b/adm/shop_admin/sendcostlist.php @@ -0,0 +1,133 @@ + + + + +

+ + + + + + + + + + + + + + + + +
지역명
우편번호범위 ~
추가배송료
+
+

+ + ++++++ + + + + + + + + +'; + + $list = $i%2; + + $zip1 = preg_replace("/([0-9]{3})([0-9]{3})/", "\\1-\\2", $row['sc_zip1']); + $zip2 = preg_replace("/([0-9]{3})([0-9]{3})/", "\\1-\\2", $row['sc_zip2']); + echo " + + + + + + + "; + + $no--; +} + +if ($i == 0) + echo ''."\n"; +?> + +
번호지역명우편번호범위배송료삭제
$no". stripslashes($row['sc_name']) . "".$zip1." ~ ".$zip2."".number_format($row['sc_amount'])."원$s_del
자료가 한건도 없습니다.
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/sendcostupdate.php b/adm/shop_admin/sendcostupdate.php new file mode 100644 index 000000000..3012d5da9 --- /dev/null +++ b/adm/shop_admin/sendcostupdate.php @@ -0,0 +1,33 @@ += $sc_zip2) { + alert("우편번호 범위가 올바른지 확인해 주세요."); +} +if(!$sc_amount) { + alert("추가배송료를 입력해 주세요."); +} + +$sql = " insert into {$g4['yc4_sendcost_table']} + set sc_name = '$sc_name', + sc_zip1 = '$sc_zip1', + sc_zip2 = '$sc_zip2', + sc_amount = '$sc_amount' "; +sql_query($sql); + +goto_url("./sendcostlist.php"); +?> \ No newline at end of file diff --git a/adm/shop_admin/sendcostzipcode.php b/adm/shop_admin/sendcostzipcode.php new file mode 100644 index 000000000..1c068a94d --- /dev/null +++ b/adm/shop_admin/sendcostzipcode.php @@ -0,0 +1,145 @@ +검색된 자료가 없습니다.'; +$addr = trim($addr); + +if($addr) { + $option_list = ''; + $zipfile = array(); + $fp = fopen($g4['bbs_path']."/zip.db", "r"); + while(!feof($fp)) { + $zipfile[] = fgets($fp, 4096); + } + fclose($fp); + + $search_count = 0; + + while ($zipcode = each($zipfile)) + { + if(strstr(substr($zipcode[1],8,512), $addr)) + { + $address = trim($zipcode[1]); + + $list[$search_count] = $address; + + $search_count++; + } + } + + if($search_count) { + natsort($list); + + foreach($list as $value) { + $code = substr($value, 0, 7); + $option_list .= ''."\n"; + } + + $option = $option_list; + } +} + +$g4['title'] = "우편번호 찾기"; +include_once($g4['path']."/head.sub.php"); +?> + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
우편번호 찾기
주소지의 시/군을 입력하세요.
+ + +
검색결과
+ +
+ + +
+ 부터 + 까지 +
+
+
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/smssend.php b/adm/shop_admin/smssend.php new file mode 100644 index 000000000..46466f568 --- /dev/null +++ b/adm/shop_admin/smssend.php @@ -0,0 +1,363 @@ + + + + + + + + + + +
+ + + + + + + + + + +
+
0 / 80 바이트
+ + + + +
+ + + + + + + + + + + +



+
+ + + + + + + + + + + + + + + + + + + + +
  + + + + +
  + + + + + +
발신번호
  + + + + + + + +
수신번호
  + + + + + + + + + +
 
  + + + + +
+ + + + + + + + + + + + + +
 예약 
 
+ +
+
+ + + + + diff --git a/adm/shop_admin/smssendicode.php b/adm/shop_admin/smssendicode.php new file mode 100644 index 000000000..fa811fab5 --- /dev/null +++ b/adm/shop_admin/smssendicode.php @@ -0,0 +1,68 @@ +SMS_con($default['de_icode_server_ip'], $default['de_icode_id'], $default['de_icode_pw'], $default['de_icode_server_port']); + +$recv = explode(",", $receive_number); + +$tran_callback = preg_replace("/[^0-9]/", "", $send_number); +$sms_id = $default[de_icode_id]; +$tran_msg = $sms_contents; +$tran_date = ""; +if ($reserved_flag) // 예약전송 +{ + $tran_date = $reserved_year . + substr("0".$reserved_month, -2) . + substr("0".$reserved_day, -2). + substr("0".$reserved_hour, -2). + substr("0".$reserved_minute, -2); +} +for($i=0; $iAdd($tran_phone, $tran_callback, $sms_id, stripslashes($tran_msg), $tran_date); +} +$result = $SMS->Send(); +if ($result) +{ + //echo "SMS 서버에 접속했습니다.
"; + $success = $fail = 0; + foreach($SMS->Result as $result) + { + list($phone,$code)=explode(":",$result); + if ($code=="Error") + { + //echo $phone.'로 발송하는데 에러가 발생했습니다.
'; + $msg .= $phone."로 발송하는데 에러가 발생했습니다.\\n"; + $fail++; + } + else + { + //echo $phone."로 전송했습니다. (메시지번호:".$code.")
"; + $success++; + } + } + //echo $success."건을 전송했으며 ".$fail."건을 보내지 못했습니다.\\n"; + $SMS->Init(); // 보관하고 있던 결과값을 지웁니다. +} +else +{ + //echo "에러: SMS 서버와 통신이 불안정합니다.
"; + $msg .= "에러: SMS 서버와 통신이 불안정합니다.\\n"; +} + +if (!$msg) + $msg = "정상적으로 전송하였습니다."; + +alert($msg, "./smssend.php"); +?> diff --git a/adm/shop_admin/smssendresult.php b/adm/shop_admin/smssendresult.php new file mode 100644 index 000000000..0d6994271 --- /dev/null +++ b/adm/shop_admin/smssendresult.php @@ -0,0 +1,24 @@ +"; +if ($return_value == 1) { + echo "alert('정상적으로 전송하였습니다.');"; +} else { + echo "alert('오류발생 : $error_msg ($error_code)');"; +} +echo ""; + +goto_url("./smssend.php"); +?> diff --git a/adm/shop_admin/supplementdata.php b/adm/shop_admin/supplementdata.php new file mode 100644 index 000000000..fc2a2827d --- /dev/null +++ b/adm/shop_admin/supplementdata.php @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + +'; + $sp_id = $list[$i]['sp_id']; + + $str .= ''; + + if(trim($opt[0]) && trim($opt[1])) { + $str .= ''; + $str .= ''; + } + + if($list[$i]['sp_use']) { + $sp_use1 = ' selected="selected"'; + $sp_use0 = ''; + } else { + $sp_use1 = ''; + $sp_use0 = ' selected="selected"'; + } + + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + } +} else { + $str = ''; + $sp_subj_count = count($_POST['sp_subject']); + + for($i = 0; $i < $sp_subj_count; $i++) { + $str .= ''; + $sp_subj = $_POST['sp_subject'][$i]; + $sp_opt = explode(',', $_POST['sp_option'][$i]); + $sp_opt_count = count($sp_opt); + + for($k = 0; $k < $sp_opt_count; $k++) { + $sp_id = $sp_subj . chr(30) . $sp_opt[$k]; + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + $str .= ''; + } + } +} + +echo $str; +?> + + + + + + +
+ 추가금액    재고수량    통보수량 +    사용여부     +
추가옵션명추가옵션항목추가금액재고수량통보수량사용여부
' . $opt[0] . '' . $opt[1] . ''; + $str .= '
' . $sp_subj . '' . $sp_opt[$k] . ''; + $str .= '
+ + \ No newline at end of file diff --git a/adm/shop_admin/supplementdelete.php b/adm/shop_admin/supplementdelete.php new file mode 100644 index 000000000..67109e174 --- /dev/null +++ b/adm/shop_admin/supplementdelete.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/adm/shop_admin/supplementform.php b/adm/shop_admin/supplementform.php new file mode 100644 index 000000000..3dd566cb1 --- /dev/null +++ b/adm/shop_admin/supplementform.php @@ -0,0 +1,216 @@ + 0) { + $idx++; + $str = ''; + $deli = ''; + } + + $spl_subject[$idx] = $opt[0]; + } + + $str .= $deli . $opt[1]; + $deli = ','; + + $spl_item[$idx] = $str; + } +} + +$g4['title'] = $html_title; +include_once ($g4['path'].'/head.sub.php'); +?> + + + +
+
+ + + + + + + + + + + + 0) { + $rm_btn = ' 삭제'; + } + ?> + + + + + + + + + + + +
옵션명옵션항목(,로 구분)
입력행추가
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/adm/shop_admin/supplementformupdate.php b/adm/shop_admin/supplementformupdate.php new file mode 100644 index 000000000..f6a71d267 --- /dev/null +++ b/adm/shop_admin/supplementformupdate.php @@ -0,0 +1,42 @@ +self.close();'; + exit; +} + +for($i = 0; $i < $count; $i++) { + $sql_common = " sp_amount = '{$_POST['sp_amount'][$i]}', + sp_qty = '{$_POST['sp_qty'][$i]}', + sp_notice = '{$_POST['sp_notice'][$i]}', + sp_use = '{$_POST['sp_use'][$i]}' "; + + $row = sql_fetch(" select sp_id from `{$g4['yc4_supplement_table']}` where it_id = '$it_id' and sp_id = '{$_POST['sp_id'][$i]}' "); + + if($row['sp_id']) { + $sql = " update `{$g4['yc4_supplement_table']}` set $sql_common where it_id = '$it_id' and sp_id = '{$_POST['sp_id'][$i]}' "; + } else { + $sql = " insert into `{$g4['yc4_supplement_table']}` set it_id = '$it_id', sp_id = '{$_POST['sp_id'][$i]}', $sql_common "; + } + + sql_query($sql); + + if($w == '') { + set_session('ss_sp_item_code', $it_id); + } +} + +echo ''; +?> \ No newline at end of file diff --git a/adm/shop_admin/wishlist.php b/adm/shop_admin/wishlist.php new file mode 100644 index 000000000..a6967a9b0 --- /dev/null +++ b/adm/shop_admin/wishlist.php @@ -0,0 +1,128 @@ + + + + + + + + + + + + + +
처음 + + + + 기간 : ~ + + 건수 :  
+ + + + + + + + + + + + + + + + "; +} + +if ($i == 0) { + echo "\n"; +} +?> + +
순위상품명건수
$num".get_it_image("{$row[it_id]}_s", 50, 50)."".cut_str($row[it_name],30)."$row[it_id_cnt]
자료가 한건도 없습니다.
+ + + + + + + +
 
+ +* 수량을 합산하여 순위를 출력합니다. + + diff --git a/extend/shop.extend.php b/extend/shop.extend.php new file mode 100644 index 000000000..510c1562c --- /dev/null +++ b/extend/shop.extend.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/js/shop.js b/js/shop.js new file mode 100644 index 000000000..64801f872 --- /dev/null +++ b/js/shop.js @@ -0,0 +1,15 @@ +if (typeof(SHOP_JS) == 'undefined') { // 한번만 실행 + var SHOP_JS = true; + + // 큰이미지 창 + function popup_large_image(it_id, img, width, height, cart_dir) + { + var top = 10; + var left = 10; + url = cart_dir+"/largeimage.php?it_id=" + it_id + "&img=" + img; + width = width + 50; + height = height + 100; + opt = 'scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left; + popup_window(url, "largeimage", opt); + } +} \ No newline at end of file diff --git a/lib/shop.lib.php b/lib/shop.lib.php new file mode 100644 index 000000000..f0b843435 --- /dev/null +++ b/lib/shop.lib.php @@ -0,0 +1,956 @@ + utf-8 +function iconv_utf8($str) +{ + return iconv('euc-kr', 'utf-8', $str); +} + +// CHARSET 변경 : utf-8 -> euc-kr +function iconv_euckr($str) +{ + return iconv('utf-8', 'euc-kr', $str); +} + +// 상위 분류코드 반환 +function parent_ca_id($ca_id) +{ + return substr($ca_id, 0, strlen($ca_id) - 2); +} + +// 상위 분류순서 반환 +function parent_ca_order($ca_id) +{ + global $g4; + $upper_ca_id = parent_ca_id($ca_id); + if ($upper_ca_id) { + $row = sql_fetch(" select ca_order from {$g4['yc4_category_table']} where ca_id = '$upper_ca_id' "); + $ca_order = $row['ca_order']; + } else { + $ca_order = ""; + } + return $ca_order; +} + +// array_map() 대체 +function array_add_callback($func, $array) +{ + if(!$func) { + return; + } + + if(is_array($array)) { + foreach($array as $key => $value) { + if(is_array($value)) { + $array[$key] = array_add_callback($func, $value); + } else { + $array[$key] = call_user_func($func, $value); + } + } + } else { + $array = call_user_func($func, $array); + } + + return $array; +} +?> +"; + } + else + { + $str = " 선택옵션, 2->추가옵션, 0->옵션없는 상품 +function get_option_stock_qty($it_id, $opt_id, $is_option) +{ + global $g4; + + if($is_option == 1) { + $sql = " select opt_qty from {$g4['yc4_option_table']} where it_id = '$it_id' and opt_id = '$opt_id' and opt_use = '1' "; + $row = sql_fetch($sql); + $jaego = (int)$row['opt_qty']; + } else { + $sql = " select sp_qty from {$g4['yc4_supplement_table']} where it_id = '$it_id' and sp_id = '$opt_id' and sp_use = '1' "; + $row = sql_fetch($sql); + $jaego = (int)$row['sp_qty']; + } + + // 재고에서 빼지 않았고 주문인것만 + $sql = " select SUM(ct_qty) as sum_qty + from {$g4['yc4_cart_table']} + where it_id = '$it_id' + and opt_id = '$opt_id' + and ct_stock_use = '0' + and is_option = '$is_option' + and ct_status in ('주문', '준비') "; + $row = sql_fetch($sql); + $daegi = (int)$row['sum_qty']; + + return $jaego - $daegi; +} + +// 큰 이미지 +function get_large_image($img, $it_id, $btn_image=true) +{ + global $g4; + + if (file_exists("$g4[path]/data/item/$img") && $img != "") + { + $size = getimagesize("$g4[path]/data/item/$img"); + $width = $size[0]; + $height = $size[1]; + $str = ""; + if ($btn_image) + $str .= ""; + } + else + $str = ""; + return $str; +} + +// 금액 표시 +function display_amount($amount, $tel_inq=false) +{ + if ($tel_inq) + $amount = "전화문의"; + else + $amount = number_format($amount, 0) . "원"; + + return $amount; +} + +// 금액표시 +// $it : 상품 배열 +function get_amount($it) +{ + global $member; + + if ($it['it_tel_inq']) return '전화문의'; + + if ($member[mb_level] > 2) // 특별회원 + $amount = $it[it_amount3]; + + if ($member[mb_level] == 2 || $amount == 0) // 회원가격 + $amount = $it[it_amount2]; + + if ($member[mb_level] == 1 || $amount == 0) // 비회원가격 + $amount = $it[it_amount]; + + return (int)$amount; +} + + +// 포인트 표시 +function display_point($point) +{ + return number_format($point, 0) . "점"; +} + +// 포인트를 구한다 +function get_point($amount, $point) +{ + return (int)($amount * $point / 100); +} + +// HTML 특수문자 변환 htmlspecialchars +function htmlspecialchars2($str) +{ + $trans = array("\"" => """, "'" => "'", "<"=>"<", ">"=>">"); + $str = strtr($str, $trans); + return $str; +} + +// 파일을 업로드 함 +function upload_file($srcfile, $destfile, $dir) +{ + if ($destfile == "") return false; + // 업로드 한후 , 퍼미션을 변경함 + @move_uploaded_file($srcfile, "$dir/$destfile"); + @chmod("$dir/$destfile", 0606); + return true; +} + +// 유일키를 생성 +function get_unique_id($len=32) +{ + global $g4; + + $result = @mysql_query(" LOCK TABLES $g4[yc4_on_uid_table] WRITE, $g4[yc4_cart_table] READ, $g4[yc4_order_table] READ "); + if (!$result) { + $sql = " CREATE TABLE `$g4[yc4_on_uid_table]` ( + `on_id` int(11) NOT NULL auto_increment, + `on_uid` varchar(32) NOT NULL default '', + `on_datetime` datetime NOT NULL default '0000-00-00 00:00:00', + `session_id` varchar(32) NOT NULL default '', + PRIMARY KEY (`on_id`), + UNIQUE KEY `on_uid` (`on_uid`) ) "; + sql_query($sql, false); + } + + // 이틀전 자료는 모두 삭제함 + $ytime = date("Y-m-d", $g4['server_time'] - 86400 * 1); + $sql = " delete from $g4[yc4_on_uid_table] where on_datetime < '$ytime' "; + sql_query($sql); + + $unique = false; + + do { + sql_query(" INSERT INTO $g4[yc4_on_uid_table] set on_uid = NOW(), on_datetime = NOW(), session_id = '".session_id()."' ", false); + $id = @mysql_insert_id(); + $uid = md5($id); + sql_query(" UPDATE $g4[yc4_on_uid_table] set on_uid = '$uid' where on_id = '$id' "); + + // 장바구니에도 겹치는게 있을 수 있으므로 ... + $sql = "select COUNT(*) as cnt from $g4[yc4_cart_table] where on_uid = '$uid' "; + $row = sql_fetch($sql); + if (!$row[cnt]) { + // 주문서에도 겹치는게 있을 수 있으므로 ... + $sql = "select COUNT(*) as cnt from $g4[yc4_order_table] where on_uid = '$uid' "; + $row = sql_fetch($sql); + if (!$row[cnt]) + $unique = true; + } + } while (!$unique); // $unique 가 거짓인동안 실행 + + @mysql_query(" UNLOCK TABLES "); + + return $uid; +} + +// 주문서 번호를 얻는다. +function get_new_od_id() +{ + global $g4; + + // 주문서 테이블 Lock 걸고 + sql_query(" LOCK TABLES $g4[yc4_order_table] READ, $g4[yc4_order_table] WRITE ", FALSE); + // 주문서 번호를 만든다. + $date = date("ymd", time()); // 2002년 3월 7일 일경우 020307 + $sql = " select max(od_id) as max_od_id from $g4[yc4_order_table] where SUBSTRING(od_id, 1, 6) = '$date' "; + $row = sql_fetch($sql); + $od_id = $row[max_od_id]; + if ($od_id == 0) + $od_id = 1; + else + { + $od_id = (int)substr($od_id, -4); + $od_id++; + } + $od_id = $date . substr("0000" . $od_id, -4); + // 주문서 테이블 Lock 풀고 + sql_query(" UNLOCK TABLES ", FALSE); + + return $od_id; +} + +function message($subject, $content, $align="left", $width="450") +{ + $str = " + + + + + + + + + + +
$subject
+ + + + +
$content
+
+
+ "; + return $str; +} + +// 시간이 비어 있는지 검사 +function is_null_time($datetime) +{ + // 공란 0 : - 제거 + //$datetime = ereg_replace("[ 0:-]", "", $datetime); // 이 함수는 PHP 5.3.0 에서 배제되고 PHP 6.0 부터 사라집니다. + $datetime = preg_replace("/[ 0:-]/", "", $datetime); + if ($datetime == "") + return true; + else + return false; +} + +// 출력유형, 스킨파일, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 +// 1.02.01 $ca_id 추가 +function display_type($type, $skin_file, $list_mod, $list_row, $img_width, $img_height, $ca_id="") +{ + global $member, $g4; + + // 상품의 갯수 + $items = $list_mod * $list_row; + + // 1.02.00 + // it_order 추가 + $sql = " select * + from $g4[yc4_item_table] + where it_use = '1' + and it_type{$type} = '1' "; + if ($ca_id) $sql .= " and ca_id like '$ca_id%' "; + $sql .= " order by it_order, it_id desc + limit $items "; + $result = sql_query($sql); + if (!mysql_num_rows($result)) { + return false; + } + + $file = "$g4[shop_path]/$skin_file"; + if (!file_exists($file)) { + echo "{$file} 파일을 찾을 수 없습니다."; + } else { + $td_width = (int)(100 / $list_mod); + include $file; + } +} + +// 분류별 출력 +// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호 +function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="") +{ + global $member, $g4; + + // 상품의 갯수 + $items = $list_mod * $list_row; + + $sql = " select * from $g4[yc4_item_table] where it_use = '1'"; + if ($ca_id) + $sql .= " and ca_id LIKE '{$ca_id}%' "; + $sql .= " order by it_order, it_id desc limit $items "; + $result = sql_query($sql); + if (!mysql_num_rows($result)) { + return false; + } + + $file = "$g4[shop_path]/maintype{$no}.inc.php"; + if (!file_exists($file)) { + echo "{$file} 파일을 찾을 수 없습니다."; + } else { + $td_width = (int)(100 / $list_mod); + include $file; + } +} + +// 별 +function get_star($score) +{ + if ($score > 8) $star = "5"; + else if ($score > 6) $star = "4"; + else if ($score > 4) $star = "3"; + else if ($score > 2) $star = "2"; + else if ($score > 0) $star = "1"; + else $star = "5"; + + return $star; +} + +// 별 이미지 +function get_star_image($it_id) +{ + global $g4; + + $sql = "select (SUM(is_score) / COUNT(*)) as score from $g4[yc4_item_ps_table] where it_id = '$it_id' "; + $row = sql_fetch($sql); + + return (int)get_star($row[score]); +} + +// 메일 보내는 내용을 HTML 형식으로 만든다. +function email_content($str) +{ + global $g4; + + $s = ""; + $s .= "메일\n"; + $s .= "\n"; + $s .= $str; + $s .= "\n"; + $s .= ""; + + return $s; +} + +// 타임스탬프 형식으로 넘어와야 한다. +// 시작시간, 종료시간 +function gap_time($begin_time, $end_time) +{ + $gap = $end_time - $begin_time; + $time[days] = (int)($gap / 86400); + $time[hours] = (int)(($gap - ($time[days] * 86400)) / 3600); + $time[minutes] = (int)(($gap - ($time[days] * 86400 + $time[hours] * 3600)) / 60); + $time[seconds] = (int)($gap - ($time[days] * 86400 + $time[hours] * 3600 + $time[minutes] * 60)); + return $time; +} + + +// 공란없이 이어지는 문자 자르기 (wayboard 참고 (way.co.kr)) +function continue_cut_str($str, $len=80) +{ + /* + $pattern = "[^ \n<>]{".$len."}"; + return eregi_replace($pattern, "\\0\n", $str); + */ + $pattern = "/[^ \n<>]{".$len."}/"; + return preg_replace($pattern, "\\0\n", $str); +} + +// 제목별로 컬럼 정렬하는 QUERY STRING +// $type 이 1이면 반대 +function title_sort($col, $type=0) +{ + global $sort1, $sort2; + global $_SERVER; + global $page; + global $doc; + + $q1 = "sort1=$col"; + if ($type) { + $q2 = "sort2=desc"; + if ($sort1 == $col) { + if ($sort2 == "desc") { + $q2 = "sort2=asc"; + } + } + } else { + $q2 = "sort2=asc"; + if ($sort1 == $col) { + if ($sort2 == "asc") { + $q2 = "sort2=desc"; + } + } + } + #return "$_SERVER[PHP_SELF]?$q1&$q2&page=$page"; + return "$_SERVER[PHP_SELF]?$q1&$q2&page=$page"; +} + + +// 세션값을 체크하여 이쪽에서 온것이 아니면 메인으로 +function session_check() +{ + global $g4; + + if (!trim(get_session('ss_on_uid'))) + gotourl("$g4[path]/"); +} + +// 상품 옵션 +function get_item_options($subject, $option, $index) +{ + $subject = trim($subject); + $option = trim($option); + + if (!$subject || !$option) return ""; + + $str = ""; + + $arr = explode("\n", $option); + // 옵션이 하나일 경우 + if (count($arr) == 1) + { + $str = $option; + } + else + { + $str = "'; + + return $str; +} + +// 추가옵션명 +function get_supplement_subject($it_id) +{ + global $g4; + + // 추가옵션정보 + $sql = " select sp_id from {$g4['yc4_supplement_table']} where it_id = '$it_id' and sp_use = '1' order by sp_no asc "; + $result = sql_query($sql); + + $count = mysql_num_rows($result); + if(!$count) { + return false; + } + + // 추가옵션명 + $subject = array(); + for($i = 0; $row = sql_fetch_array($result); $i++) { + $str = explode('|*|', $row['sp_id']); + + if(!in_array($str[0], $subject)) { + array_push($subject, $str[0]); + } + } + + return $subject; +} + +// 추가옵션항목 +function get_supplement_option($it_id, $sp_id, $index) +{ + global $g4; + + // 추가옵션정보 + $sql = " select sp_id, sp_amount, sp_qty from {$g4['yc4_supplement_table']} where it_id = '$it_id' and sp_use = '1' and sp_id like '$sp_id%' order by sp_no asc "; + $result = sql_query($sql); + + $count = mysql_num_rows($result); + if(!$count) { + return ''; + } + + $str = ''; + + return $str; +} + +// 장바구니 옵션 출력 +function print_cart_options($uq_id, $it_id, $sw='') +{ + global $g4; + + if(!$uq_id || !$it_id) { + return ''; + } + + $str = ''; + $br = ''; + + $sql = " select ct_option, ct_qty, it_amount, ct_amount + from {$g4['yc4_cart_table']} + where uq_id = '$uq_id' + and it_id = '$it_id' "; + + if($sw == "0" || $sw == "1") { + $sql .= " and ct_direct = '$sw' "; + } + + $sql .= " order by ct_id, is_option "; + + $result = sql_query($sql); + + for($i=0; $row = sql_fetch_array($result); $i++) { + if($row['ct_option']) { + $str .= $br . $row['ct_option']; + + if($row['it_amount']) { + $str .= ' / ' . number_format($row['it_amount']) . '원'; + } + + if($row['ct_amount']) { + $str .= ' (+' . number_format($row['ct_amount']) . '원)'; + } + + $str .= ' / ' . number_format($row['ct_qty']) . '개'; + + $br = '
'; + } + } + + return $str; +} + +// 인수는 $it_id, $it_opt1, ..., $it_opt6 까지 넘어옴 +function print_item_options() +{ + global $g4; + + $it_id = func_get_arg(0); + $sql = " select it_opt1_subject, + it_opt2_subject, + it_opt3_subject, + it_opt4_subject, + it_opt5_subject, + it_opt6_subject + from $g4[yc4_item_table] + where it_id = '$it_id' "; + $it = sql_fetch($sql); + + $it_name = $str_split = ""; + for ($i=1; $i<=6; $i++) + { + $it_opt = trim(func_get_arg($i)); + // 상품옵션에서 0은 제외되는 현상을 수정 + if ($it_opt==null) continue; + + $it_name .= $str_split; + $it_opt_subject = $it["it_opt{$i}_subject"]; + $opt = explode( ";", $it_opt ); + $it_name .= "  $it_opt_subject = $opt[0]"; + + if ($opt[1] != 0) + { + $it_name .= " ("; + //if (ereg("[+]", $opt[1]) == true) + if (preg_match("/[+]/", $opt[1]) == true) + $it_name .= "+"; + $it_name .= display_amount($opt[1]) . ")"; + } + $str_split = "
"; + } + + return $it_name; +} + +function it_name_icon($it, $it_name="", $url=1) +{ + global $g4; + + $str = ""; + if ($it_name) + $str = $it_name; + else + $str = stripslashes($it[it_name]); + + if ($url) + $str = "$str"; + + if ($it[it_type1]) $str .= " "; + if ($it[it_type2]) $str .= " "; + if ($it[it_type3]) $str .= " "; + if ($it[it_type4]) $str .= " "; + if ($it[it_type5]) $str .= " "; + + // 품절 + $stock = get_it_stock_qty($it[it_id]); + if ($stock <= 0) + $str .= " "; + + return $str; +} + +// 일자형식변환 +function date_conv($date, $case=1) +{ + if ($case == 1) { // 년-월-일 로 만들어줌 + $date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $date); + } else if ($case == 2) { // 년월일 로 만들어줌 + $date = preg_replace("/-/", "", $date); + } + + return $date; +} + +// 배너출력 +function display_banner($position, $num="") +{ + global $g4; + + if (!$position) $position = "왼쪽"; + + include "$g4[shop_path]/boxbanner{$num}.inc.php"; +} + +// 1.00.02 +// 파일번호, 이벤트번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 +// 1.02.01 $ca_id 추가 +function display_event($no, $event, $list_mod, $list_row, $img_width, $img_height, $ca_id="") +{ + global $member, $g4; + + // 상품의 갯수 + $items = $list_mod * $list_row; + + // 1.02.00 + // b.it_order 추가 + $sql = " select b.* + from $g4[yc4_event_item_table] a, + $g4[yc4_item_table] b + where a.it_id = b.it_id + and b.it_use = '1' + and a.ev_id = '$event' "; + if ($ca_id) $sql .= " and ca_id = '$ca_id' "; + $sql .= " order by b.it_order, a.it_id desc + limit $items "; + $result = sql_query($sql); + if (!mysql_num_rows($result)) { + return false; + } + + $file = "$g4[shop_path]/maintype{$no}.inc.php"; + if (!file_exists($file)) { + echo "{$file} 파일을 찾을 수 없습니다."; + } else { + $td_width = (int)(100 / $list_mod); + include $file; + } +} + +function get_yn($val, $case='') +{ + switch ($case) { + case '1' : $result = ($val > 0) ? 'Y' : 'N'; break; + default : $result = ($val > 0) ? '예' : '아니오'; + } + return $result; +} + +// 상품명과 건수를 반환 +function get_goods($on_uid) +{ + global $g4; + + // 상품명만들기 + $row = sql_fetch(" select a.it_id, b.it_name from $g4[yc4_cart_table] a, $g4[yc4_item_table] b where a.it_id = b.it_id and a.on_uid = '$on_uid' order by ct_id limit 1 "); + // 상품명에 "(쌍따옴표)가 들어가면 오류 발생함 + $goods[it_id] = $row[it_id]; + $goods[full_name]= $goods[name] = addslashes($row[it_name]); + // 특수문자제거 + $goods[full_name] = preg_replace ("/[ #\&\+\-%@=\/\\\:;,\.'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/i", "", $goods[full_name]); + + // 상품건수 + $row = sql_fetch(" select count(*) as cnt from $g4[yc4_cart_table] where on_uid = '$on_uid' "); + $cnt = $row[cnt] - 1; + if ($cnt) + $goods[full_name] .= " 외 {$cnt}건"; + $goods[count] = $row[cnt]; + + return $goods; +} + + +// 패턴의 내용대로 해당 디렉토리에서 정렬하여 + + + + +   + + + + + + + + + + + + + + + +
+ + +
+ + + + +

+ + + + + +

+ + + + + +

+ + + + + +

+ + + + + +

+ + +
+ +
+ diff --git a/shop.php b/shop.php new file mode 100644 index 000000000..09c81164e --- /dev/null +++ b/shop.php @@ -0,0 +1,127 @@ + + + + + + + + + +
+

+ + + + + + + + + + + + + + + + + + + + + +
+
"; + display_type($type, $default["de_type{$type}_list_skin"], $default["de_type{$type}_list_mod"], $default["de_type{$type}_list_row"], $default["de_type{$type}_img_width"], $default["de_type{$type}_img_height"]); + } + ?> +
+
"; + display_type($type, $default["de_type{$type}_list_skin"], $default["de_type{$type}_list_mod"], $default["de_type{$type}_list_row"], $default["de_type{$type}_img_width"], $default["de_type{$type}_img_height"]); + } + ?> +
+
"; + display_type($type, $default["de_type{$type}_list_skin"], $default["de_type{$type}_list_mod"], $default["de_type{$type}_list_row"], $default["de_type{$type}_img_width"], $default["de_type{$type}_img_height"]); + } + ?> +
+
"; + display_type($type, $default["de_type{$type}_list_skin"], $default["de_type{$type}_list_mod"], $default["de_type{$type}_list_row"], $default["de_type{$type}_img_width"], $default["de_type{$type}_img_height"]); + } + ?> +
+ + +
+ + +
+
+ + + + +
+ + + + + +
+

+ +
"; + display_type($type, $default["de_type{$type}_list_skin"], $default["de_type{$type}_list_mod"], $default["de_type{$type}_list_row"], $default["de_type{$type}_img_width"], $default["de_type{$type}_img_height"]); + } + ?>

+ + +
+ + +
+ + +
+
+

+ + \ No newline at end of file diff --git a/shop.tail.php b/shop.tail.php new file mode 100644 index 000000000..cf342a6c8 --- /dev/null +++ b/shop.tail.php @@ -0,0 +1,62 @@ + + +
+ + + + + + + + + + + + +
+ + + +
+ 회사소개 | + 서비스이용약관 | + 개인정보 취급방침 +
+ + / + 전화 : / + 팩스 : / + 운영자 :
+ 사업자 등록번호 : / + 대표 : / + 개인정보관리책임자 :
+ 통신판매업신고번호 : + +
Copyright © 2001-2005 . All Rights Reserved.
+
+ + + + + + + +
+ + + + + + diff --git a/shop/_common.php b/shop/_common.php new file mode 100644 index 000000000..3dadd2a9e --- /dev/null +++ b/shop/_common.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/shop/_head.php b/shop/_head.php new file mode 100644 index 000000000..a3adcd264 --- /dev/null +++ b/shop/_head.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/shop/_tail.php b/shop/_tail.php new file mode 100644 index 000000000..ecb08437a --- /dev/null +++ b/shop/_tail.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/shop/bannerhit.php b/shop/bannerhit.php new file mode 100644 index 000000000..8ccc7e37a --- /dev/null +++ b/shop/bannerhit.php @@ -0,0 +1,13 @@ + diff --git a/shop/boxbanner.inc.php b/shop/boxbanner.inc.php new file mode 100644 index 000000000..6abd6120b --- /dev/null +++ b/shop/boxbanner.inc.php @@ -0,0 +1,34 @@ + + +\n"; + } +} +?> +
"; + if ($row[bn_url][0] == "#") + echo ""; + else if ($row[bn_url] && $row[bn_url] != "http://") { + echo ""; + } + echo "{$row[bn_alt]}"; + echo "
\ No newline at end of file diff --git a/shop/boxcart.inc.php b/shop/boxcart.inc.php new file mode 100644 index 000000000..f4b90a9ff --- /dev/null +++ b/shop/boxcart.inc.php @@ -0,0 +1,38 @@ + + + + +\n"; +} + +if ($i==0) + echo "\n"; +?> +
/cart.php'>/bar_cart.gif' border=0>
  · "; + $it_name = get_text($row['it_name']); + // 이미지로 할 경우 + //$it_name = get_it_image($row[it_id]."_s", 50, 50, $row[it_id]); + echo "$it_name
diff --git a/shop/boxcategory.inc.php b/shop/boxcategory.inc.php new file mode 100644 index 000000000..eb43d855a --- /dev/null +++ b/shop/boxcategory.inc.php @@ -0,0 +1,102 @@ + + + + +"; + // 맨밑줄은 출력하지 않음 + if ($j < $hnum2) + $menubody .= ""; + } + + if ($menubody) + { + $onmouseover = " layer_view('lmenu{$i}', 'lmenu_layer{$i}', 'view', $sub_menu_left, -22); "; + $onmouseout = " layer_view('lmenu{$i}', 'lmenu_layer{$i}', 'hide'); "; + } + + $category_link = ""; + echo ""; + echo "\n"; + + if ($i<$hnum-1) // 맨밑줄은 출력하지 않음 + echo "\n"; +} + +if ($i==0) + echo "\n"; +?> +
  · $row2[ca_name]
등록된 자료가 없습니다.
+ + + + diff --git a/shop/boxcommunity.inc.php b/shop/boxcommunity.inc.php new file mode 100644 index 000000000..41a60a48d --- /dev/null +++ b/shop/boxcommunity.inc.php @@ -0,0 +1,21 @@ + + + + + 0) + echo "\n"; + + echo "\n"; +} + +if ($i==0) + echo "\n"; +?> +
  · $row[bo_subject]
등록된 게시판이 없습니다.
diff --git a/shop/boxevent.inc.php b/shop/boxevent.inc.php new file mode 100644 index 000000000..53f4152ad --- /dev/null +++ b/shop/boxevent.inc.php @@ -0,0 +1,30 @@ + + + + + 0) + echo "\n"; + + $href = "$g4[shop_path]/event.php?ev_id=$row[ev_id]"; + + // 이벤트 메뉴이미지가 있다면 + $event_img = "$g4[path]/data/event/$row[ev_id]_m"; + if (file_exists($event_img)) { + echo ""; + } else { + echo "\n";; + } + +} + +if ($i==0) + echo "\n"; +?> +
  · $row[ev_subject]
등록된 자료가 없습니다.
diff --git a/shop/boxtodayview.inc.php b/shop/boxtodayview.inc.php new file mode 100644 index 000000000..b979ba6cb --- /dev/null +++ b/shop/boxtodayview.inc.php @@ -0,0 +1,180 @@ + + +
+
+ + + $tv_div[img_length]) + echo ""; + + // 오늘 본 상품 이미지 출력 + echo ""; + + // 오늘 본 상품갯수가 보여지는 최대 이미지 수 보다 크다면 아래로 화살표를 보임 + if ($tv_idx > $tv_div[img_length]) + echo ""; +} +else +{ + echo ""; +} +?> + +
  
"; + for ($i=1; $i<=$tv_div[img_length]; $i++) + { + echo ""; + } + echo "
"; + echo ""; + echo "
+
+ + + + + diff --git a/shop/boxwish.inc.php b/shop/boxwish.inc.php new file mode 100644 index 000000000..e32f30ee2 --- /dev/null +++ b/shop/boxwish.inc.php @@ -0,0 +1,25 @@ + + + + +\n"; +} + +if ($i==0) + echo "\n"; +?> +
  · "; + $it_name = get_text($row[it_name]); + // 이미지로 할 경우 + //$it_name = get_it_image($row[it_id]."_s", 50, 50, $row[it_id]); + echo "$it_name
diff --git a/shop/cart.php b/shop/cart.php new file mode 100644 index 000000000..e87b9b862 --- /dev/null +++ b/shop/cart.php @@ -0,0 +1,20 @@ + + +

+ + +

+ + \ No newline at end of file diff --git a/shop/cartcoupon.php b/shop/cartcoupon.php new file mode 100644 index 000000000..bbd214a72 --- /dev/null +++ b/shop/cartcoupon.php @@ -0,0 +1,384 @@ + 0) { + $no = $i + 1; + } + + $ca_id = $it["ca_id$no"]; + $sql = " select ca_nocoupon from {$g4['yc4_category_table']} where ca_id = '$ca_id' "; + $row = sql_fetch($sql); + + if($row['ca_nocoupon']) { + alert_close('쿠폰사용이 제한된 카테고리에 속한 상품입니다.'); + } +} + +// 장바구니정보 +$uq_id = get_session('ss_uniqid'); + +if($sw_direct != 1) + $sw_direct = 0; + +$sql_common = " from ( select * from {$g4['yc4_cart_table']} + where uq_id = '$uq_id' + and it_id = '$it_id' + and ct_direct = '$sw_direct' + order by ct_id asc ) as a "; + +$sql = " select a.ct_id, a.ct_send_cost_pay, + SUM((a.ct_amount + a.it_amount) * a.ct_qty) as item_amount, + SUM(a.ct_qty) as item_qty + $sql_common + group by a.it_id "; +$ct = sql_fetch($sql); + +// 상품총금액 +if($ct['item_amount']) { + $item_amount = $ct['item_amount']; +} else { + alert_close('상품의 주문금액이 0원입니다.'); +} + +// 총주문금액 +$sql = " select SUM((ct_amount + it_amount) * ct_qty) as total_amount + from {$g4['yc4_cart_table']} + where uq_id = '$uq_id' + and ct_direct = '$sw_direct' "; +$row = sql_fetch($sql); + +if($row['total_amount']) { + $total_amount = $row['total_amount']; +} else { + alert_close('주문하신 상품이 없습니다.'); +} + +// 배송비 계산 +if ($default['de_send_cost_case'] == "없음" || $default['de_send_cost_case'] == "착불") + $send_cost = 0; +else if($default['de_send_cost_case'] == "상한") { + // 배송비 상한 : 여러단계의 배송비 적용 가능 + $send_cost_limit = explode(";", $default['de_send_cost_limit']); + $send_cost_list = explode(";", $default['de_send_cost_list']); + $send_cost = 0; + for ($k=0; $k= $row['it_sc_condition']) { + $send_cost += 0; + } else { + $send_cost += $row['it_sc_basic']; + } + } else if($row['it_sc_type'] == 2) { // 유료 + $send_cost += $row['it_sc_basic']; + } else if($row['it_sc_type'] == 3) { // 수량별부과 + $qty = ceil($row['sum_qty'] / $row['it_sc_condition']); + $send_cost += ($row['it_sc_basic'] * $qty); + } else { + $send_cost += 0; + } + } + } +} + +// 쿠폰정보 +$sql = " select * + from {$g4['yc4_coupon_table']} + where cp_use = '1' + and cp_type = '0' + and cp_start <= '{$g4['time_ymd']}' + and cp_end >= '{$g4['time_ymd']}' + and ( it_id = '{$it['it_id']}' or cp_target = '2' ) + and mb_id in ( '{$member['mb_id']}', '전체회원' ) + and ca_id in ( '{$it['ca_id']}', '{$it['ca_id2']}', '{$it['ca_id3']}', '전체카테고리' ) + order by cp_no asc "; +$result = sql_query($sql); + +if(!mysql_num_rows($result)) { + alert_close('쿠폰 정보가 존재하지 않습니다.'); +} + +$coupon_list = '

  • 적용안함
  • '; + +$cnt = 0; +for($i=0; $row=sql_fetch_array($result); $i++) { + // 정액할인쿠폰에서 할인금액이 상품주문금액보다 크다면 + if(!$row['cp_method'] && $row['cp_amount'] > $item_amount) { + continue; + } + + // 쿠폰사용내역체크 + $sql = " select ch_no + from {$g4['yc4_coupon_history_table']} + where cp_id = '{$row['cp_id']}' + and it_id = '$it_id' + and mb_id = '{$member['mb_id']}' + and uq_id <> '$uq_id' "; + $ch = sql_fetch($sql); + if($ch['ch_no']) { // 이미 사용한 쿠폰 + continue; + } else { + $cnt++; + } + + $cp_limit = $row['cp_limit']; + if($row['cp_id'] == $coupon) { + $checked = ' checked="checked"'; + } else { + $checked = ''; + } + $coupon_list .= '
  • '."\n"; + $coupon_list .= ''."\n"; + $coupon_list .= ''."\n"; + $coupon_list .= ''."\n"; + $coupon_list .= ''."\n"; + $coupon_list .= ''."\n".$row['cp_subject']."\n"; + $coupon_list .= '
  • '."\n"; +} + +if(!$cnt) { + alert_close('사용할 수 있는 쿠폰이 없습니다.'); +} + +$g4['title'] = '쿠폰적용'; +include_once ($g4['path'].'/head.sub.php'); +?> + + + + + + + + + + + + + + + + + + + + + +
    쿠폰선택 +
      + +
    +
    상품금액할인금액최종결제금액
    0
    + + + + \ No newline at end of file diff --git a/shop/cartoption.php b/shop/cartoption.php new file mode 100644 index 000000000..120b14dd0 --- /dev/null +++ b/shop/cartoption.php @@ -0,0 +1,514 @@ + + + + +
    +
    + + 1) { + $disabled = 'disabled'; + } + + $str = conv_item_options(trim($it["it_opt{$i}_subject"]), trim($it["it_opt{$i}"]), $i, $disabled); + if($str) { + echo ''; + echo ''; + echo ''; + echo ''; + } + } + } + ?> + '; + echo ''; + echo ''; + echo ''; + + $index++; + } + } + } + } + ?> +
        · '.$it["it_opt{$i}_subject"].':'.$str.'
        · '.$value.':'.$opt.'
    +
    +
    + + + + +
    +
      + '; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''. $stock_qty . ''; + if($row['is_option'] == 1) { + echo '' . $ct_option . ''; + } else if($row['is_option'] == 2) { + echo '' . $ct_option . ''; + } else { + echo '' . $ct_option . ''; + } + echo '' . $option_price . ''; + echo ' '; + echo ' + - '; + echo ' 삭제'; + echo ''; + } + ?> +
    +
    총 금액 :
    +
    +
     
    +
    +
    + + + + \ No newline at end of file diff --git a/shop/cartoptionupdate.php b/shop/cartoptionupdate.php new file mode 100644 index 000000000..4f92f1501 --- /dev/null +++ b/shop/cartoptionupdate.php @@ -0,0 +1,116 @@ + 0 && $opt_count == 0) { + alert('추가옵션이 있을 경우 선택옵션을 모두 삭제할 수 없습니다.'); +} + +$ct_parent = $_POST['ct_parent']; +$ct_parent_check = true; + +for($i=0; $i<$count; $i++) { + $ct_id = $_POST['ct_id'][$i]; + + if($ct_id) { + $is_delete = $_POST['is_delete'][$i]; + + if($is_delete) { // 옵션삭제 + $sql = " delete from {$g4['yc4_cart_table']} where uq_id = '$s_uq_id' and ct_id = '$ct_id' "; + sql_query($sql); + } else { // 옵션수정 + $ct_qty = $_POST['ct_qty'][$i]; + $sql = " update {$g4['yc4_cart_table']} set ct_qty = '$ct_qty' where uq_id = '$s_uq_id' and ct_id = '$ct_id' "; + sql_query($sql); + } + } else { // 옵션추가 + $it_id = $_POST['it_id']; + $it_amount = $_POST['it_amount'][$i]; + $opt_id = $_POST['opt_id'][$i]; + $is_option = $_POST['is_option'][$i]; + $ct_option = $_POST['ct_option'][$i]; + $ct_amount = $_POST['ct_amount'][$i]; + $ct_qty = $_POST['ct_qty'][$i]; + $ct_point = 0; + $ct_send_cost_pay = $_POST['ct_send_cost_pay']; + if($is_option == 1 || $is_option == 0) { + $amount = $it_amount; + } else { + $amount = 0; + } + + $sql = " insert into {$g4['yc4_cart_table']} + set uq_id = '$s_uq_id', + ct_parent = '$ct_parent', + mb_id = '{$member['mb_id']}', + is_option = '$is_option', + it_id = '$it_id', + it_name = '$it_name', + opt_id = '$opt_id', + ct_option = '$ct_option', + ct_status = '쇼핑', + it_amount = '$it_amount', + ct_amount = '$ct_amount', + ct_qty = '$ct_qty', + ct_point = '$ct_point', + ct_stock_use = '0', + ct_point_use = '0', + ct_send_cost_pay = '$ct_send_cost_pay', + ct_time = '{$g4['time_ymdhis']}', + ct_ip = '$REMOTE_ADDR', + ct_direct = '$sw_direct' "; + + sql_query($sql); + + // ct_parent 처리 + if($ct_parent_check) { + $temp_ct_id = mysql_insert_id(); + + $sql1 = " select count(*) as cnt from {$g4['yc4_cart_table']} where uq_id = '$s_uq_id' and it_id = '$it_id' and ct_direct = '$sw_direct' "; + $row1 = sql_fetch($sql1); + + if($row1['cnt'] == 1) { + sql_query(" update {$g4['yc4_cart_table']} set ct_parent = '0' where ct_id = '$temp_ct_id' "); + $ct_parent = $temp_ct_id; + } + + $ct_parent_check = false; + } + } +} + +echo ''; +?> \ No newline at end of file diff --git a/shop/cartsub.inc.php b/shop/cartsub.inc.php new file mode 100644 index 000000000..3db96144c --- /dev/null +++ b/shop/cartsub.inc.php @@ -0,0 +1,585 @@ + + + + +
    + +++ ++ ++++'; ?> +'; ?> + + + + + + + + + + + + +'; +else if ($s_page == 'orderinquiryview.php') + echo ''; +?> + + +"; + $a2 = ""; + $image = get_it_image($row['it_id']."_s", 50, 50, $row['it_id']); + } else { // 붙이지 않고 + $a1 = ""; + $a2 = ""; + $image = get_it_image($row['it_id']."_s", 50, 50); + } + + $it_name = $a1 . stripslashes($row['it_name']) . $a2 . '
    '; + if($opt_count > 0 || $spl_count > 0) { + $it_name .= "\n".'선택사항보기'."\n"; + if($s_page == "cart.php") { + $it_name .= '  선택사항/수량변경'; + } + + $it_name .= '
    '."\n".'' . print_cart_options($row['uq_id'], $row['it_id'], $sw_direct) . ''; + } + + // 주문금액, 포인트 + $sell_amount = $sum['sum_amount']; + $point = $sum['sum_point']; + + if ($i > 0) + echo ''."\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + if($s_page == 'orderform.php') { // 쿠폰표시 + $coupon = '없음'; + if(!$row['it_nocoupon']) { + if($is_member) { + // 상품에 쿠폰 있는지 체크 + $sql3 = " select cp_id, ca_id + from {$g4['yc4_coupon_table']} + where cp_use = '1' + and cp_type = '0' + and cp_start <= '{$g4['time_ymd']}' + and cp_end >= '{$g4['time_ymd']}' + and ( it_id = '{$row['it_id']}' or cp_target = '2' ) + and mb_id in ( '{$member['mb_id']}', '전체회원' ) + and ca_id in ( '{$row['ca_id']}', '{$row['ca_id2']}', '{$row['ca_id3']}', '전체카테고리' ) "; + $result3 = sql_query($sql3); + + $cnt = 0; + for($k=0; $row3=sql_fetch_array($result3); $k++) { + // 쿠폰제외카테고리체크 + $sql4 = " select ca_nocoupon + from {$g4['yc4_category_table']} + where ca_id = '{$row3['ca_id']}' "; + $row4 = sql_fetch($sql4); + if($row4['ca_nocoupon']) { + continue; + } + + // 쿠폰사용여부체크 + $sql4 = " select uq_id + from {$g4['yc4_coupon_history_table']} + where cp_id = '{$row3['cp_id']}' + and it_id = '{$row['it_id']}' + and mb_id = '{$member['mb_id']}' "; + $row4 = sql_fetch($sql4); + + if(!$row4['uq_id'] || $row4['uq_id'] == $s_uq_id) { + $cnt++; + } + } + + if($cnt) { + $coupon = '쿠폰적용'; + } + } + } + echo "\n"; + } + + if($s_page == 'orderinquiryview.php') { // 할인금액 표시 + $dc_amount = $sum['dc_amount']; + echo "\n"; + } + + // 수량, 입력(수량) + if ($s_page == "cart.php") { + if($opt_count > 0 || $spl_count > 0) { + echo "\n"; + } else { + echo "\n"; + } + } else { + echo "\n"; + } + + echo "\n"; + echo "\n"; + + if ($s_page == "cart.php") + //echo ""; + echo ''."\n"; + else if ($s_page == "orderinquiryview.php") + { + switch($row['ct_status']) + { + case '주문' : $icon = ""; break; + case '준비' : $icon = ""; break; + case '배송' : $icon = ""; break; + case '완료' : $icon = ""; break; + default : $icon = $row['ct_status']; break; + } + echo "\n"; + } + + echo "\n"; + echo "\n"; + + //$tot_point += $point; + //$tot_sell_amount += $sell_amount; + + if ($row['ct_status'] == '취소' || $row['ct_status'] == '반품' || $row['ct_status'] == '품절') { + $tot_cancel_amount += $sell_amount; + } + else { + $tot_point += $point; + $tot_sell_amount += $sell_amount; + $item_dc_amount += $dc_amount; // 총 할인금액 + } +} + +if ($i == 0) { + echo "\n"; + echo "\n"; + echo ""; +} else { + // 배송비가 넘어왔다면 + if ($_POST['od_send_cost']) { + $send_cost = (int)$_POST['od_send_cost']; + } else { + // 배송비 계산 + if ($default['de_send_cost_case'] == "없음" || $default['de_send_cost_case'] == "착불") + $send_cost = 0; + else if($default['de_send_cost_case'] == "상한") { + // 배송비 상한 : 여러단계의 배송비 적용 가능 + $send_cost_limit = explode(";", $default['de_send_cost_limit']); + $send_cost_list = explode(";", $default['de_send_cost_list']); + $send_cost = 0; + for ($k=0; $k= $row['it_sc_condition']) { + $send_cost += 0; + } else { + $send_cost += $row['it_sc_basic']; + } + } else if($row['it_sc_type'] == 2) { // 유료 + $send_cost += $row['it_sc_basic']; + } else if($row['it_sc_type'] == 3) { // 수량별부과 + $qty = ceil($itemlist[$i]['qty'] / $row['it_sc_condition']); + $send_cost += ($row['it_sc_basic'] * $qty); + } else { + $send_cost += 0; + } + } + } + } + + // 이미 주문된 내역을 보여주는것이므로 주문서에서 얻는다. + $sql = "select od_send_cost, od_send_coupon, od_send_cost_area, od_coupon_amount from {$g4['yc4_order_table']} where od_id = '$od_id' "; + $row = sql_fetch($sql); + if ($row['od_send_cost'] > 0) + $send_cost = $row['od_send_cost'] - $row['od_send_coupon']; + + if($row['od_coupon_amount'] > 0) + $od_coupon_amount = $row['od_coupon_amount']; + + if($row['od_send_cost_area']) + $od_send_cost_area = $row['od_send_cost_area']; + } + + // 배송비가 0 보다 크다면 (있다면) + if ($send_cost > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($s_page == "cart.php" || $s_page == "orderinquiryview.php") + echo "\n"; + echo "\n"; + } + + // 추가배송비가 0 보다 크다면 (있다면) + if ($od_send_cost_area > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($s_page == "cart.php" || $s_page == "orderinquiryview.php") + echo "\n"; + echo "\n"; + } + + // 결제할인금액 0 보다 크다면 (있다면) + if ($od_coupon_amount > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($s_page == "cart.php" || $s_page == "orderinquiryview.php") + echo "\n"; + echo "\n"; + } + + // 총계 = 주문상품금액합계 - 할인금액합계 + 배송비 + 추가배송비 + $tot_amount = $tot_sell_amount - $item_dc_amount + $send_cost - $od_coupon_amount + $od_send_cost_area; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($s_page == "cart.php" || $s_page == "orderinquiryview.php") + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; +} +?> + + + + +
    상품명쿠폰쿠폰할인수량주문금액포인트상태
    $image\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // 복합과세 사용한다면 쿠폰 적용 시 사용하기 위해 필드 생성 + if($default['de_compound_tax_use']) { + $ct_tax_mny = 0; + $ct_vat_mny = 0; + $ct_free_mny = 0; + + // 과세, 면세금액 + if($row['it_notax']) { // 면세상품 + $ct_free_mny = (int)$sum['sum_amount']; + } else { // 과세상품 + $ct_tax_mny = round((int)$sum['sum_amount'] / 1.1); + $ct_vat_mny = (int)$sum['sum_amount'] - $ct_tax_mny; + } + echo "\n"; + echo "\n"; + echo "\n"; + } + echo $it_name; + echo "$coupon".number_format($sum['dc_amount'])."{$row['ct_qty']}" . number_format($sell_amount - $dc_amount) . "" . number_format($point) . " 삭제$icon
    장바구니가 비어 있습니다.
    배송비 : " . number_format($send_cost) . "  
    추가배송비 : " . number_format($od_send_cost_area) . "  
    결제할인 : " . number_format($od_coupon_amount) . "  
    총계 : " . number_format($tot_amount) . "" . number_format($tot_point) . "   
    + "; + } else { + echo " +
    + \"구매하기\"  + \"선택주문\"  + \"장바구니  + \"장바구니  + \"선택삭제\"  + \"계속쇼핑하기\""; + } + } + ?> +
    +
    + + + + + + + + +

    + + + + +
    + · 상품 주문하기 : 주문서를 작성하시려면 '주문하기' 버튼을 누르세요.
    + · 상품 수량변경 : 주문수량을 변경하시려면 원하시는 수량을 입력하신 후 '수량변경' 버튼을 누르세요.
    + · 상품 삭제하기 : 모든 주문내용을 삭제하시려면 '삭제하기' 버튼을 누르세요.
    + · 쇼핑 계속하기 : 쇼핑하시던 페이지로 돌아가시려면 '쇼핑 계속하기' 버튼을 누르세요. +


    + diff --git a/shop/cartupdate.php b/shop/cartupdate.php new file mode 100644 index 000000000..f21babe61 --- /dev/null +++ b/shop/cartupdate.php @@ -0,0 +1,330 @@ + 1) { + continue; + } + + // 재고 구함 + $stock_qty = get_it_stock_qty($_POST['it_id'][$i]); + + // 변경된 수량이 재고수량보다 크면 오류 + if ($_POST['ct_qty'][$i] > $stock_qty) { + $error .= "{$_POST['it_name'][$i]} 의 재고수량이 부족합니다. 현재 재고수량 : $stock_qty 개\\n\\n"; + continue; + } + + // 수량수정 + $sql = " update {$g4['yc4_cart_table']} + set ct_qty = '{$_POST['ct_qty'][$i]}' + where ct_id = '$ct_id' + and uq_id = '$uq_id' "; + sql_query($sql); + } + } + + // 오류가 있다면 오류메세지 출력 + if ($error != "") { alert($error); } +} +else // 장바구니에 담기 +{ + if (!$_POST['it_id']) + alert('장바구니에 담을 상품을 선택하여 주십시오.'); + + $ct_count = count($_POST['ct_qty']); + + // 상품정보 + $sql = " select it_id, it_use, it_gallery, it_tel_inq, it_option_use, it_supplement_use + from {$g4['yc4_item_table']} where it_id = '{$_POST['it_id']}' "; + $it = sql_fetch($sql); + + // 주문가능한 상품인지 + if(!$it['it_use'] || $it['it_gallery'] || $it['it_tel_inq']) { + alert($_POST['it_name'].'은(는) 주문할 수 없습니다.'); + } + + // 비회원가격과 회원가격이 다르다면 + if (!$is_member && $default['de_different_msg']) + { + $sql = " select it_amount, it_amount2 from {$g4['yc4_item_table']} where it_id = '{$_POST['it_id']}' "; + $row = sql_fetch($sql); + if ($row['it_amount2'] && $row['it_amount'] != $row['it_amount2']) { + echo ""; + echo ""; + } + } + + //-------------------------------------------------------- + // 변조 검사 + //-------------------------------------------------------- + //$is_option : 1-> 선택옵션, 2->추가옵션, 0->옵션없는 상품 + $total_amount = (int)$_POST['total_amount']; + $total_price = 0; + $item_price = (int)$_POST['it_amount']; + + for($i=0; $i<$ct_count; $i++) { + $is_option = (int)$_POST['is_option'][$i]; + $ct_price = (int)$_POST['ct_amount'][$i]; + $it_qty = $_POST['ct_qty'][$i]; + + if($is_option == 2) { + $total_price += ($ct_price * $it_qty); + } else { + $total_price += ($item_price + $ct_price) * $it_qty; + } + } + + // 총 금액 다름 + if($total_amount != $total_price) { + die('Error.'); + } + //-------------------------------------------------------- + + + //-------------------------------------------------------- + // 재고 및 사용여부 검사 + //-------------------------------------------------------- + // $is_option : 1-> 선택옵션, 2->추가옵션, 0->옵션없는 상품 + for($i=0; $i<$ct_count; $i++) { + $is_option = $_POST['is_option'][$i]; + $it_name = get_text($_POST['it_name']); + $opt_id = $_POST['opt_id'][$i]; + $ct_qty = $_POST['ct_qty'][$i]; + + if($is_option) { + // 주문가능한 옵션인지 + if($is_option == 1) { + $sql1 = " select opt_use as option_use from {$g4['yc4_option_table']} + where it_id = '{$_POST['it_id']}' and opt_id = '$opt_id' "; + } else { + $sql1 = " select sp_use as option_use from {$g4['yc4_supplement_table']} + where it_id = '{$_POST['it_id']}' and sp_id = '$opt_id' "; + } + $row1 = sql_fetch($sql1); + + if(!$row1['option_use']) { + $ct_option = $_POST['ct_option'][$i]; + $msg = '선택하신 상품 : '.$it_name.'('.$ct_option.')은(는) 구매할 수 없습니다.'; + + alert($msg); + } + + // 이미 장바구니에 있는 같은 옵션의 수량합계를 구한다. + $sql = " select SUM(ct_qty) as cnt from {$g4['yc4_cart_table']} + where it_id = '{$_POST['it_id']}' and opt_id = '$opt_id' and uq_id <> '$uq_id' and is_option = '$is_option' and ct_status = '쇼핑' "; + $row = sql_fetch($sql); + $cart_qty = $row['cnt']; + $stock_qty = get_option_stock_qty($_POST['it_id'], $opt_id, $is_option); + } else { + // 이미 장바구니에 있는 같은 상품의 수량합계를 구한다. + $sql = " select SUM(ct_qty) as cnt from {$g4['yc4_cart_table']} + where it_id = '{$_POST['it_id']}' and uq_id <> '$uq_id' and is_option = '$is_option' and ct_status = '쇼핑' "; + $row = sql_fetch($sql); + $cart_qty = $row['cnt']; + $stock_qty = get_it_stock_qty($_POST['it_id']); + } + + if($stock_qty < $ct_qty + $cart_qty) { + if($is_option) { + $ct_option = $_POST['ct_option'][$i]; + $msg = '선택하신 상품 : '.$it_name.'('.$ct_option.')은(는) 재고가 부족하여 구매할 수 없습니다.'; + } else { + $msg = '선택하신 상품 : '.$it_name.'은(는) 재고가 부족하여 구매할 수 없습니다.'; + } + + alert($msg); + } + } + //-------------------------------------------------------- + + // 바로구매에 있던 장바구니 자료를 지운다. + $result = sql_query(" delete from {$g4['yc4_cart_table']} where uq_id = '$uq_id' and ct_direct = 1 ", false); + if (!$result) { + // 삭제중 에러가 발생했다면 필드가 없다는 것이므로 바로구매 필드를 생성한다. + sql_query(" ALTER TABLE `{$g4['yc4_cart_table']}` ADD `ct_direct` TINYINT NOT NULL "); + } + + // 포인트 사용하지 않는다면 + if (!$config['cf_use_point']) { $_POST['it_point'] = 0; } + + // 장바구니에 Insert + $it_name = get_text($_POST['it_name']); + $ct_parent = 0; + + for($i=0; $i<$ct_count; $i++) { + $is_option = $_POST['is_option'][$i]; + if($is_option == 1 || $is_option == 0) { + $it_amount = $_POST['it_amount']; + } else { + $it_amount = 0; + } + $opt_id = $_POST['opt_id'][$i]; + $ct_amount = $_POST['ct_amount'][$i]; + $ct_qty = $_POST['ct_qty'][$i]; + $ct_point = 0; + $ct_option = get_text($_POST['ct_option'][$i]); + $opt_space = ''; + $ct_send_cost_pay = trim($_POST['ct_send_cost_pay']); + + // No옵션 상품이 장바구니에 있는치 체크, 있으면 수량변경 + $nopt_count = 0; + if($is_option == 0 && !$sw_direct) { + $sql2 = " select count(*) as cnt from {$g4['yc4_cart_table']} + where uq_id = '$uq_id' and it_id = '{$_POST['it_id']}' and is_option = '0' and ct_direct = '0' "; + $row2 = sql_fetch($sql2); + $nopt_count = (int)$row2['cnt']; + } + + if($nopt_count) { + $sql = " update {$g4['yc4_cart_table']} set ct_qty = ct_qty + $ct_qty + where uq_id = '$uq_id' and it_id = '{$_POST['it_id']}' and is_option = '0' and ct_direct = '0' "; + } else { + $sql = " insert into {$g4['yc4_cart_table']} + set uq_id = '$uq_id', + ct_parent = '$ct_parent', + mb_id = '{$member['mb_id']}', + is_option = '$is_option', + it_id = '{$_POST['it_id']}', + it_name = '$it_name', + opt_id = '$opt_id', + ct_option = '$ct_option', + ct_status = '쇼핑', + it_amount = '$it_amount', + ct_amount = '$ct_amount', + ct_qty = '$ct_qty', + ct_point = '$ct_point', + ct_send_cost_pay = '$ct_send_cost_pay', + ct_stock_use = '0', + ct_point_use = '0', + ct_time = '{$g4['time_ymdhis']}', + ct_ip = '$REMOTE_ADDR', + ct_direct = '$sw_direct' "; + } + + sql_query($sql); + + if($ct_parent == 0) + $ct_parent = mysql_insert_id(); + } +} + +// 바로 구매일 경우 +if ($sw_direct) +{ + if ($is_member) + { + goto_url("{$g4['shop_url']}/orderform.php?sw_direct=$sw_direct"); + } + else + { + goto_url("{$g4['url']}/{$g4['bbs']}/login.php?url=".urlencode("{$g4['shop_path']}/orderform.php?sw_direct=$sw_direct")); + } +} +else +{ + goto_url("{$g4['shop_url']}/cart.php"); +} +?> diff --git a/shop/cat1.ajax.php b/shop/cat1.ajax.php new file mode 100644 index 000000000..26d5cb42c --- /dev/null +++ b/shop/cat1.ajax.php @@ -0,0 +1,93 @@ + 7) { + die("{\"error\":\"일주일 이내에 등록된 게시물에만 '신고' 할 수 있습니다.\"}"); +} + +// 글쓴이 회원정보 (신고가 되는 상대 회원정보) +$target = get_member($write['mb_id'], 'mb_id,mb_level,mb_jisu_rank'); + +if ($target['mb_level'] > $member['mb_level']) { + die("{\"error\":\"자신보다 권한이 높은 회원의 게시물은 신고할 수 없습니다.\"}"); +} + +if ($target['mb_jisu_rank'] <= $member['mb_jisu_rank']) { + die("{\"error\":\"자신보다 활동지수 순위가 높거나 같은 회원의 게시물은 신고할 수 없습니다.\"}"); +} + +/* +// 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻 +$sql = " select (TO_DAYS('$g4[time_ymdhis]') - TO_DAYS('$target[mb_datetime]') + 1) as days "; +$row = sql_fetch($sql); +$mb_reg_after = $row[days]; +if ($mb_reg_after >= 365) { + die("{\"error\":\"회원가입후 1년이 지난 회원님의 글은 신고할 수 없습니다.\"}"); +} +*/ + +// '싫어요'도 하나 더 드세요. +$sql = " insert into $g4[board_good_table] ( bo_table, wr_id, mb_id, bg_flag, bg_datetime, bg_ip, tar_mb_id ) values ( '$bo_table', '$wr_id', '$member[mb_id]', 'nogood', '$g4[time_ymdhis]', '$_SERVER[REMOTE_ADDR]', '$write[mb_id]' ) "; +sql_query($sql); + +// 신고 테이블에 레코드를 추가한다. +$sql = " insert into `$g4[singo_table]` set bo_table = '$bo_table', wr_id = '$wr_id', wr_parent = '{$write['wr_parent']}', mb_id = '{$target['mb_id']}', sg_mb_id = '{$member['mb_id']}', sg_reason = '$reason', sg_datetime = '{$g4['time_ymdhis']}', sg_ip = '$_SERVER[REMOTE_ADDR]' "; +sql_query($sql); + +// 신고가 되면 일정 시간이 지난후 부터 글쓰기가 가능함 +$time = date("Y-m-d H:i:s", $g4[server_time] + (3600 * 3)); +// 상대 회원의 글쓰기등을 금지하기 위하여 상대 회원의 신고수를 누적하고 신고 시간을 업데이트 한다. +$sql = " UPDATE `{$g4['member_table']}` SET `mb_singo_count` = `mb_singo_count` + 1, `mb_singo_time` = '$time' WHERE `mb_id` = '{$target['mb_id']}' "; +sql_query($sql); + +// 게시글에 신고수를 누적한다. +$sql = " update `$write_table` set `wr_singo` = `wr_singo` + 1 where `wr_id` = '$wr_id' "; +sql_query($sql); + +// 게시글의 신고수를 얻는다. +$sql = " select `wr_singo` as cnt from `$write_table` where `wr_id` = '$wr_id' "; +$row = sql_fetch($sql); + +$message = "신고 하셨습니다."; + +die("{\"error\":\"\", \"message\":\"$message\", \"count\":\"$row[cnt]\"}"); +?> \ No newline at end of file diff --git a/shop/cat1.php b/shop/cat1.php new file mode 100644 index 000000000..830104190 --- /dev/null +++ b/shop/cat1.php @@ -0,0 +1,134 @@ + + + + + +jQuery UI Sortable - Default functionality + + + + + + + +
    +1단계 +
      +
      + +
      +2단계 +
        +
        + +
        +3단계 +
          +
          + +
          +
          +등록/수정 +단계 분류 선택중
          +분류명 : + + +
          +
          + + + + + \ No newline at end of file diff --git a/shop/category.ajax.php b/shop/category.ajax.php new file mode 100644 index 000000000..26d5cb42c --- /dev/null +++ b/shop/category.ajax.php @@ -0,0 +1,93 @@ + 7) { + die("{\"error\":\"일주일 이내에 등록된 게시물에만 '신고' 할 수 있습니다.\"}"); +} + +// 글쓴이 회원정보 (신고가 되는 상대 회원정보) +$target = get_member($write['mb_id'], 'mb_id,mb_level,mb_jisu_rank'); + +if ($target['mb_level'] > $member['mb_level']) { + die("{\"error\":\"자신보다 권한이 높은 회원의 게시물은 신고할 수 없습니다.\"}"); +} + +if ($target['mb_jisu_rank'] <= $member['mb_jisu_rank']) { + die("{\"error\":\"자신보다 활동지수 순위가 높거나 같은 회원의 게시물은 신고할 수 없습니다.\"}"); +} + +/* +// 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻 +$sql = " select (TO_DAYS('$g4[time_ymdhis]') - TO_DAYS('$target[mb_datetime]') + 1) as days "; +$row = sql_fetch($sql); +$mb_reg_after = $row[days]; +if ($mb_reg_after >= 365) { + die("{\"error\":\"회원가입후 1년이 지난 회원님의 글은 신고할 수 없습니다.\"}"); +} +*/ + +// '싫어요'도 하나 더 드세요. +$sql = " insert into $g4[board_good_table] ( bo_table, wr_id, mb_id, bg_flag, bg_datetime, bg_ip, tar_mb_id ) values ( '$bo_table', '$wr_id', '$member[mb_id]', 'nogood', '$g4[time_ymdhis]', '$_SERVER[REMOTE_ADDR]', '$write[mb_id]' ) "; +sql_query($sql); + +// 신고 테이블에 레코드를 추가한다. +$sql = " insert into `$g4[singo_table]` set bo_table = '$bo_table', wr_id = '$wr_id', wr_parent = '{$write['wr_parent']}', mb_id = '{$target['mb_id']}', sg_mb_id = '{$member['mb_id']}', sg_reason = '$reason', sg_datetime = '{$g4['time_ymdhis']}', sg_ip = '$_SERVER[REMOTE_ADDR]' "; +sql_query($sql); + +// 신고가 되면 일정 시간이 지난후 부터 글쓰기가 가능함 +$time = date("Y-m-d H:i:s", $g4[server_time] + (3600 * 3)); +// 상대 회원의 글쓰기등을 금지하기 위하여 상대 회원의 신고수를 누적하고 신고 시간을 업데이트 한다. +$sql = " UPDATE `{$g4['member_table']}` SET `mb_singo_count` = `mb_singo_count` + 1, `mb_singo_time` = '$time' WHERE `mb_id` = '{$target['mb_id']}' "; +sql_query($sql); + +// 게시글에 신고수를 누적한다. +$sql = " update `$write_table` set `wr_singo` = `wr_singo` + 1 where `wr_id` = '$wr_id' "; +sql_query($sql); + +// 게시글의 신고수를 얻는다. +$sql = " select `wr_singo` as cnt from `$write_table` where `wr_id` = '$wr_id' "; +$row = sql_fetch($sql); + +$message = "신고 하셨습니다."; + +die("{\"error\":\"\", \"message\":\"$message\", \"count\":\"$row[cnt]\"}"); +?> \ No newline at end of file diff --git a/shop/category.php b/shop/category.php new file mode 100644 index 000000000..292e2ac63 --- /dev/null +++ b/shop/category.php @@ -0,0 +1,88 @@ +'; + if ($i == 1) { + $sql = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = 2 order by ca_order, ca_id "; + $result = sql_query($sql); + while ($row=sql_fetch_array($result)) { + echo ''.PHP_EOL; + } + } + echo ''.PHP_EOL; +} +?> + +
          +단계 분류 선택중
          +분류명 : + + +
          + + + + \ No newline at end of file diff --git a/shop/community.php b/shop/community.php new file mode 100644 index 000000000..9e653d77c --- /dev/null +++ b/shop/community.php @@ -0,0 +1,48 @@ + + + + + 0) && ($i % $list_mod == 0)) + echo ""; + + echo " + "; + } + + if ($i > 0 && ($i % $list_mod == 1)) + echo ""; + ?> + +
          + + +
          "; + + // 이 함수가 바로 최신글을 추출하는 역할을 합니다. + // 사용방법 + // latest(스킨, 게시판아이디, 출력라인, 글자수); + // 스킨은 입력하지 않을 경우 운영자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다. + echo latest("", $row[bo_table], $list_row, $subject_len); + + echo "

           
          + + \ No newline at end of file diff --git a/shop/content.php b/shop/content.php new file mode 100644 index 000000000..dc503d0cc --- /dev/null +++ b/shop/content.php @@ -0,0 +1,72 @@ +
          "; + +if ($is_admin) + echo "

          "; + +$str = conv_content($co[co_content], $co[co_html]); + +// $src 를 $dst 로 변환 +unset($src); +unset($dst); +$src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/"; +//$dst[] = $default[de_subject]; +$dst[] = $config[cf_title]; +$src[] = "/{{회사명}}|{{상호}}/"; +$dst[] = $default[de_admin_company_name]; +$src[] = "/{{대표자명}}/"; +$dst[] = $default[de_admin_company_owner]; +$src[] = "/{{사업자등록번호}}/"; +$dst[] = $default[de_admin_company_saupja_no]; +$src[] = "/{{대표전화번호}}/"; +$dst[] = $default[de_admin_company_tel]; +$src[] = "/{{팩스번호}}/"; +$dst[] = $default[de_admin_company_fax]; +$src[] = "/{{통신판매업신고번호}}/"; +$dst[] = $default[de_admin_company_tongsin_no]; +$src[] = "/{{사업장우편번호}}/"; +$dst[] = $default[de_admin_company_zip]; +$src[] = "/{{사업장주소}}/"; +$dst[] = $default[de_admin_company_addr]; +$src[] = "/{{운영자명}}|{{관리자명}}/"; +$dst[] = $default[de_admin_name]; +$src[] = "/{{운영자e-mail}}|{{관리자e-mail}}/i"; +$dst[] = $default[de_admin_email]; +$src[] = "/{{정보관리책임자명}}/"; +$dst[] = $default[de_admin_info_name]; +$src[] = "/{{정보관리책임자e-mail}}|{{정보책임자e-mail}}/i"; +$dst[] = $default[de_admin_info_email]; + +$str = preg_replace($src, $dst, $str); + +echo $str; + +$timg = "$g4[path]/data/content/{$co_id}_t"; +if (file_exists($timg)) + echo "

          "; + +if ($co[co_include_tail]) + @include_once($co[co_include_tail]); +else + include_once("./_tail.php"); + +//include_once("./_tail.php"); +?> diff --git a/shop/event.php b/shop/event.php new file mode 100644 index 000000000..fc00c873c --- /dev/null +++ b/shop/event.php @@ -0,0 +1,129 @@ +
          "; + +if ($is_admin) + echo "

          "; + +// 상단 HTML +echo stripslashes($ev[ev_head_html]); +?> + + + + + +
          + +"; + +if ($skin) + $ev[ev_skin] = $skin; + +$td_width = (int)($mod / 100); + +// 리스트 유형별로 출력 +$list_file = "$g4[shop_path]/$ev[ev_skin]"; +if (file_exists($list_file)) +{ + $list_mod = $ev[ev_list_mod]; + $list_row = $ev[ev_list_row]; + $img_width = $ev[ev_img_width]; + $img_height = $ev[ev_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 = "

          $ev[ev_skin] 파일을 찾을 수 없습니다.

          관리자에게 알려주시면 감사하겠습니다."; +} + +if ($i==0) +{ + echo "
          "; + echo "

          $error
          "; +} +?> + +
          + +
          +
          + +

          + +
          "; + +include_once("./_tail.php"); +?> diff --git a/shop/faq.php b/shop/faq.php new file mode 100644 index 000000000..a955a0366 --- /dev/null +++ b/shop/faq.php @@ -0,0 +1,71 @@ + + +

          + +
          "; + +if ($is_admin) + echo "

          "; + +// 상단 HTML +echo stripslashes($fm[fm_head_html]); +echo "
          "; + +echo "\n"; +echo "
          \n"; + +$sql = " select * from $g4[yc4_faq_table] + where fm_id = '$fm_id' + order by fa_order , fa_id "; +$result = sql_query($sql); +$str = ""; +for ($i=1; $row=sql_fetch_array($result); $i++) +{ + echo ""; + echo ""; + echo ""; + echo "\n"; + + $str .= "
          $i." . stripslashes($row[fa_subject]) . "
          "; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= ""; + $str .= "
          " . stripslashes($row[fa_subject]) . "
          " . stripslashes($row[fa_content]) . "
          "; +} +echo "
          \n"; + +echo $str; + +echo "
          "; +echo stripslashes($fm[fm_tail_html]); + +$timg = "$g4[path]/data/faq/{$fm_id}_t"; +if (file_exists($timg)) + echo "

          "; + +include_once("./_tail.php"); +?> diff --git a/shop/img/bar0.gif b/shop/img/bar0.gif new file mode 100644 index 000000000..e38ac29e1 Binary files /dev/null and b/shop/img/bar0.gif differ diff --git a/shop/img/bar_auction.gif b/shop/img/bar_auction.gif new file mode 100644 index 000000000..6fb89c5eb Binary files /dev/null and b/shop/img/bar_auction.gif differ diff --git a/shop/img/bar_cart.gif b/shop/img/bar_cart.gif new file mode 100644 index 000000000..fbba5bd8a Binary files /dev/null and b/shop/img/bar_cart.gif differ diff --git a/shop/img/bar_category.gif b/shop/img/bar_category.gif new file mode 100644 index 000000000..0e66b24f0 Binary files /dev/null and b/shop/img/bar_category.gif differ diff --git a/shop/img/bar_community.gif b/shop/img/bar_community.gif new file mode 100644 index 000000000..8b734fd06 Binary files /dev/null and b/shop/img/bar_community.gif differ diff --git a/shop/img/bar_count.gif b/shop/img/bar_count.gif new file mode 100644 index 000000000..880b2c5dd Binary files /dev/null and b/shop/img/bar_count.gif differ diff --git a/shop/img/bar_event.gif b/shop/img/bar_event.gif new file mode 100644 index 000000000..268b16774 Binary files /dev/null and b/shop/img/bar_event.gif differ diff --git a/shop/img/bar_gong9.gif b/shop/img/bar_gong9.gif new file mode 100644 index 000000000..5627a9e56 Binary files /dev/null and b/shop/img/bar_gong9.gif differ diff --git a/shop/img/bar_notice.gif b/shop/img/bar_notice.gif new file mode 100644 index 000000000..e38646799 Binary files /dev/null and b/shop/img/bar_notice.gif differ diff --git a/shop/img/bar_search.gif b/shop/img/bar_search.gif new file mode 100644 index 000000000..c39baaa76 Binary files /dev/null and b/shop/img/bar_search.gif differ diff --git a/shop/img/bar_type1.gif b/shop/img/bar_type1.gif new file mode 100644 index 000000000..a82eb7b2f Binary files /dev/null and b/shop/img/bar_type1.gif differ diff --git a/shop/img/bar_type2.gif b/shop/img/bar_type2.gif new file mode 100644 index 000000000..15139c287 Binary files /dev/null and b/shop/img/bar_type2.gif differ diff --git a/shop/img/bar_type3.gif b/shop/img/bar_type3.gif new file mode 100644 index 000000000..a619870e1 Binary files /dev/null and b/shop/img/bar_type3.gif differ diff --git a/shop/img/bar_type4.gif b/shop/img/bar_type4.gif new file mode 100644 index 000000000..bbdafc9f8 Binary files /dev/null and b/shop/img/bar_type4.gif differ diff --git a/shop/img/bar_type5.gif b/shop/img/bar_type5.gif new file mode 100644 index 000000000..05763b602 Binary files /dev/null and b/shop/img/bar_type5.gif differ diff --git a/shop/img/bar_wishlist.gif b/shop/img/bar_wishlist.gif new file mode 100644 index 000000000..07b4ccbaa Binary files /dev/null and b/shop/img/bar_wishlist.gif differ diff --git a/shop/img/bg_item.gif b/shop/img/bg_item.gif new file mode 100644 index 000000000..1d75d15c6 Binary files /dev/null and b/shop/img/bg_item.gif differ diff --git a/shop/img/box_bg01.gif b/shop/img/box_bg01.gif new file mode 100644 index 000000000..c17fb84be Binary files /dev/null and b/shop/img/box_bg01.gif differ diff --git a/shop/img/box_bg02.gif b/shop/img/box_bg02.gif new file mode 100644 index 000000000..37fae08a4 Binary files /dev/null and b/shop/img/box_bg02.gif differ diff --git a/shop/img/box_bg03.gif b/shop/img/box_bg03.gif new file mode 100644 index 000000000..285810523 Binary files /dev/null and b/shop/img/box_bg03.gif differ diff --git a/shop/img/box_bg04.gif b/shop/img/box_bg04.gif new file mode 100644 index 000000000..e5a57724f Binary files /dev/null and b/shop/img/box_bg04.gif differ diff --git a/shop/img/btn2_cart.gif b/shop/img/btn2_cart.gif new file mode 100644 index 000000000..0872ea7b2 Binary files /dev/null and b/shop/img/btn2_cart.gif differ diff --git a/shop/img/btn2_now_buy.gif b/shop/img/btn2_now_buy.gif new file mode 100644 index 000000000..e0aa1a21a Binary files /dev/null and b/shop/img/btn2_now_buy.gif differ diff --git a/shop/img/btn2_wish.gif b/shop/img/btn2_wish.gif new file mode 100644 index 000000000..560d260d1 Binary files /dev/null and b/shop/img/btn2_wish.gif differ diff --git a/shop/img/btn_admin.gif b/shop/img/btn_admin.gif new file mode 100644 index 000000000..adf17872e Binary files /dev/null and b/shop/img/btn_admin.gif differ diff --git a/shop/img/btn_admin_modify.gif b/shop/img/btn_admin_modify.gif new file mode 100644 index 000000000..da107e8e4 Binary files /dev/null and b/shop/img/btn_admin_modify.gif differ diff --git a/shop/img/btn_ag1.gif b/shop/img/btn_ag1.gif new file mode 100644 index 000000000..d689e735d Binary files /dev/null and b/shop/img/btn_ag1.gif differ diff --git a/shop/img/btn_ag2.gif b/shop/img/btn_ag2.gif new file mode 100644 index 000000000..b46251244 Binary files /dev/null and b/shop/img/btn_ag2.gif differ diff --git a/shop/img/btn_ag3.gif b/shop/img/btn_ag3.gif new file mode 100644 index 000000000..2d538ca83 Binary files /dev/null and b/shop/img/btn_ag3.gif differ diff --git a/shop/img/btn_ag4.gif b/shop/img/btn_ag4.gif new file mode 100644 index 000000000..af6608d8d Binary files /dev/null and b/shop/img/btn_ag4.gif differ diff --git a/shop/img/btn_ag5.gif b/shop/img/btn_ag5.gif new file mode 100644 index 000000000..9fe70ec39 Binary files /dev/null and b/shop/img/btn_ag5.gif differ diff --git a/shop/img/btn_back1.gif b/shop/img/btn_back1.gif new file mode 100644 index 000000000..8ec64375a Binary files /dev/null and b/shop/img/btn_back1.gif differ diff --git a/shop/img/btn_buy.gif b/shop/img/btn_buy.gif new file mode 100644 index 000000000..1d15ecca4 Binary files /dev/null and b/shop/img/btn_buy.gif differ diff --git a/shop/img/btn_card.gif b/shop/img/btn_card.gif new file mode 100644 index 000000000..c65d0c50f Binary files /dev/null and b/shop/img/btn_card.gif differ diff --git a/shop/img/btn_cart_in.gif b/shop/img/btn_cart_in.gif new file mode 100644 index 000000000..58a458144 Binary files /dev/null and b/shop/img/btn_cart_in.gif differ diff --git a/shop/img/btn_cart_out.gif b/shop/img/btn_cart_out.gif new file mode 100644 index 000000000..1d790b195 Binary files /dev/null and b/shop/img/btn_cart_out.gif differ diff --git a/shop/img/btn_cart_quan.gif b/shop/img/btn_cart_quan.gif new file mode 100644 index 000000000..e438cbaed Binary files /dev/null and b/shop/img/btn_cart_quan.gif differ diff --git a/shop/img/btn_close.gif b/shop/img/btn_close.gif new file mode 100644 index 000000000..999ac74c0 Binary files /dev/null and b/shop/img/btn_close.gif differ diff --git a/shop/img/btn_confirm.gif b/shop/img/btn_confirm.gif new file mode 100644 index 000000000..cfcdcdae8 Binary files /dev/null and b/shop/img/btn_confirm.gif differ diff --git a/shop/img/btn_del.gif b/shop/img/btn_del.gif new file mode 100644 index 000000000..a57e665ab Binary files /dev/null and b/shop/img/btn_del.gif differ diff --git a/shop/img/btn_iche.gif b/shop/img/btn_iche.gif new file mode 100644 index 000000000..5c968a861 Binary files /dev/null and b/shop/img/btn_iche.gif differ diff --git a/shop/img/btn_item_ps.gif b/shop/img/btn_item_ps.gif new file mode 100644 index 000000000..80f8c7fe0 Binary files /dev/null and b/shop/img/btn_item_ps.gif differ diff --git a/shop/img/btn_item_recommend.gif b/shop/img/btn_item_recommend.gif new file mode 100644 index 000000000..57c50348a Binary files /dev/null and b/shop/img/btn_item_recommend.gif differ diff --git a/shop/img/btn_next2.gif b/shop/img/btn_next2.gif new file mode 100644 index 000000000..6e6cb4237 Binary files /dev/null and b/shop/img/btn_next2.gif differ diff --git a/shop/img/btn_order.gif b/shop/img/btn_order.gif new file mode 100644 index 000000000..8fac0a067 Binary files /dev/null and b/shop/img/btn_order.gif differ diff --git a/shop/img/btn_order_end.gif b/shop/img/btn_order_end.gif new file mode 100644 index 000000000..17853829f Binary files /dev/null and b/shop/img/btn_order_end.gif differ diff --git a/shop/img/btn_print.gif b/shop/img/btn_print.gif new file mode 100644 index 000000000..45017a45f Binary files /dev/null and b/shop/img/btn_print.gif differ diff --git a/shop/img/btn_qa.gif b/shop/img/btn_qa.gif new file mode 100644 index 000000000..0c20c28bd Binary files /dev/null and b/shop/img/btn_qa.gif differ diff --git a/shop/img/btn_settle.gif b/shop/img/btn_settle.gif new file mode 100644 index 000000000..f40cba662 Binary files /dev/null and b/shop/img/btn_settle.gif differ diff --git a/shop/img/btn_shopping.gif b/shop/img/btn_shopping.gif new file mode 100644 index 000000000..4da910ff1 Binary files /dev/null and b/shop/img/btn_shopping.gif differ diff --git a/shop/img/btn_story.gif b/shop/img/btn_story.gif new file mode 100644 index 000000000..9de0ac4bc Binary files /dev/null and b/shop/img/btn_story.gif differ diff --git a/shop/img/btn_tab01.gif b/shop/img/btn_tab01.gif new file mode 100644 index 000000000..c996aa709 Binary files /dev/null and b/shop/img/btn_tab01.gif differ diff --git a/shop/img/btn_tab02.gif b/shop/img/btn_tab02.gif new file mode 100644 index 000000000..4643f40e8 Binary files /dev/null and b/shop/img/btn_tab02.gif differ diff --git a/shop/img/btn_tab03.gif b/shop/img/btn_tab03.gif new file mode 100644 index 000000000..5e825f51b Binary files /dev/null and b/shop/img/btn_tab03.gif differ diff --git a/shop/img/btn_tab04.gif b/shop/img/btn_tab04.gif new file mode 100644 index 000000000..33faf4b2c Binary files /dev/null and b/shop/img/btn_tab04.gif differ diff --git a/shop/img/btn_tab05.gif b/shop/img/btn_tab05.gif new file mode 100644 index 000000000..c861dd17d Binary files /dev/null and b/shop/img/btn_tab05.gif differ diff --git a/shop/img/btn_tab06.gif b/shop/img/btn_tab06.gif new file mode 100644 index 000000000..fc21e3448 Binary files /dev/null and b/shop/img/btn_tab06.gif differ diff --git a/shop/img/btn_wish2.gif b/shop/img/btn_wish2.gif new file mode 100644 index 000000000..6840c450f Binary files /dev/null and b/shop/img/btn_wish2.gif differ diff --git a/shop/img/btn_zip_find.gif b/shop/img/btn_zip_find.gif new file mode 100644 index 000000000..95c736784 Binary files /dev/null and b/shop/img/btn_zip_find.gif differ diff --git a/shop/img/btn_zoom.gif b/shop/img/btn_zoom.gif new file mode 100644 index 000000000..bd83f3d26 Binary files /dev/null and b/shop/img/btn_zoom.gif differ diff --git a/shop/img/btn_zoom2.gif b/shop/img/btn_zoom2.gif new file mode 100644 index 000000000..d102f85c6 Binary files /dev/null and b/shop/img/btn_zoom2.gif differ diff --git a/shop/img/ca_bg01.gif b/shop/img/ca_bg01.gif new file mode 100644 index 000000000..627596401 Binary files /dev/null and b/shop/img/ca_bg01.gif differ diff --git a/shop/img/ca_bg02.gif b/shop/img/ca_bg02.gif new file mode 100644 index 000000000..7c0bc1208 Binary files /dev/null and b/shop/img/ca_bg02.gif differ diff --git a/shop/img/ca_bg03.gif b/shop/img/ca_bg03.gif new file mode 100644 index 000000000..bcbadece1 Binary files /dev/null and b/shop/img/ca_bg03.gif differ diff --git a/shop/img/ca_bg04.gif b/shop/img/ca_bg04.gif new file mode 100644 index 000000000..52870702e Binary files /dev/null and b/shop/img/ca_bg04.gif differ diff --git a/shop/img/ca_box01.gif b/shop/img/ca_box01.gif new file mode 100644 index 000000000..6319c5d36 Binary files /dev/null and b/shop/img/ca_box01.gif differ diff --git a/shop/img/ca_box02.gif b/shop/img/ca_box02.gif new file mode 100644 index 000000000..4bbccb557 Binary files /dev/null and b/shop/img/ca_box02.gif differ diff --git a/shop/img/ca_box03.gif b/shop/img/ca_box03.gif new file mode 100644 index 000000000..9d485779c Binary files /dev/null and b/shop/img/ca_box03.gif differ diff --git a/shop/img/ca_box04.gif b/shop/img/ca_box04.gif new file mode 100644 index 000000000..35b07acee Binary files /dev/null and b/shop/img/ca_box04.gif differ diff --git a/shop/img/corner01.gif b/shop/img/corner01.gif new file mode 100644 index 000000000..3ab5f765b Binary files /dev/null and b/shop/img/corner01.gif differ diff --git a/shop/img/corner02.gif b/shop/img/corner02.gif new file mode 100644 index 000000000..d2df43e85 Binary files /dev/null and b/shop/img/corner02.gif differ diff --git a/shop/img/corner03.gif b/shop/img/corner03.gif new file mode 100644 index 000000000..027093d79 Binary files /dev/null and b/shop/img/corner03.gif differ diff --git a/shop/img/corner04.gif b/shop/img/corner04.gif new file mode 100644 index 000000000..5f4406950 Binary files /dev/null and b/shop/img/corner04.gif differ diff --git a/shop/img/dot.gif b/shop/img/dot.gif new file mode 100644 index 000000000..1f60b3308 Binary files /dev/null and b/shop/img/dot.gif differ diff --git a/shop/img/dot_line.gif b/shop/img/dot_line.gif new file mode 100644 index 000000000..c0bcb8aa8 Binary files /dev/null and b/shop/img/dot_line.gif differ diff --git a/shop/img/dot_off.gif b/shop/img/dot_off.gif new file mode 100644 index 000000000..719b10748 Binary files /dev/null and b/shop/img/dot_off.gif differ diff --git a/shop/img/dot_on.gif b/shop/img/dot_on.gif new file mode 100644 index 000000000..f631ee0b7 Binary files /dev/null and b/shop/img/dot_on.gif differ diff --git a/shop/img/graph1.gif b/shop/img/graph1.gif new file mode 100644 index 000000000..11ba2dc23 Binary files /dev/null and b/shop/img/graph1.gif differ diff --git a/shop/img/graph2.gif b/shop/img/graph2.gif new file mode 100644 index 000000000..3b040eb11 Binary files /dev/null and b/shop/img/graph2.gif differ diff --git a/shop/img/graph3.gif b/shop/img/graph3.gif new file mode 100644 index 000000000..a25e65b3f Binary files /dev/null and b/shop/img/graph3.gif differ diff --git a/shop/img/graph_dot_front.gif b/shop/img/graph_dot_front.gif new file mode 100644 index 000000000..8fc86ab7e Binary files /dev/null and b/shop/img/graph_dot_front.gif differ diff --git a/shop/img/graph_dot_off.gif b/shop/img/graph_dot_off.gif new file mode 100644 index 000000000..924b8ff1e Binary files /dev/null and b/shop/img/graph_dot_off.gif differ diff --git a/shop/img/graph_dot_on.gif b/shop/img/graph_dot_on.gif new file mode 100644 index 000000000..68be18fca Binary files /dev/null and b/shop/img/graph_dot_on.gif differ diff --git a/shop/img/icon1.gif b/shop/img/icon1.gif new file mode 100644 index 000000000..1fe152a36 Binary files /dev/null and b/shop/img/icon1.gif differ diff --git a/shop/img/icon2.gif b/shop/img/icon2.gif new file mode 100644 index 000000000..8cc4177c1 Binary files /dev/null and b/shop/img/icon2.gif differ diff --git a/shop/img/icon3.gif b/shop/img/icon3.gif new file mode 100644 index 000000000..a9aa93baa Binary files /dev/null and b/shop/img/icon3.gif differ diff --git a/shop/img/icon4.gif b/shop/img/icon4.gif new file mode 100644 index 000000000..8f48e1bc6 Binary files /dev/null and b/shop/img/icon4.gif differ diff --git a/shop/img/icon5.gif b/shop/img/icon5.gif new file mode 100644 index 000000000..b1e6abbdc Binary files /dev/null and b/shop/img/icon5.gif differ diff --git a/shop/img/icon_01.gif b/shop/img/icon_01.gif new file mode 100644 index 000000000..4cb5179e6 Binary files /dev/null and b/shop/img/icon_01.gif differ diff --git a/shop/img/icon_answer.gif b/shop/img/icon_answer.gif new file mode 100644 index 000000000..1998e1c97 Binary files /dev/null and b/shop/img/icon_answer.gif differ diff --git a/shop/img/icon_directory.gif b/shop/img/icon_directory.gif new file mode 100644 index 000000000..f7b7de90c Binary files /dev/null and b/shop/img/icon_directory.gif differ diff --git a/shop/img/icon_email.gif b/shop/img/icon_email.gif new file mode 100644 index 000000000..48385c242 Binary files /dev/null and b/shop/img/icon_email.gif differ diff --git a/shop/img/icon_home.gif b/shop/img/icon_home.gif new file mode 100644 index 000000000..d6e00a199 Binary files /dev/null and b/shop/img/icon_home.gif differ diff --git a/shop/img/icon_image.gif b/shop/img/icon_image.gif new file mode 100644 index 000000000..e16611dd6 Binary files /dev/null and b/shop/img/icon_image.gif differ diff --git a/shop/img/icon_more.gif b/shop/img/icon_more.gif new file mode 100644 index 000000000..f45b50a9f Binary files /dev/null and b/shop/img/icon_more.gif differ diff --git a/shop/img/icon_nemo.gif b/shop/img/icon_nemo.gif new file mode 100644 index 000000000..8cc4177c1 Binary files /dev/null and b/shop/img/icon_nemo.gif differ diff --git a/shop/img/icon_notice2.gif b/shop/img/icon_notice2.gif new file mode 100644 index 000000000..757d227fd Binary files /dev/null and b/shop/img/icon_notice2.gif differ diff --git a/shop/img/icon_onlinecalc.gif b/shop/img/icon_onlinecalc.gif new file mode 100644 index 000000000..53c442395 Binary files /dev/null and b/shop/img/icon_onlinecalc.gif differ diff --git a/shop/img/icon_poll_q.gif b/shop/img/icon_poll_q.gif new file mode 100644 index 000000000..51dc6243b Binary files /dev/null and b/shop/img/icon_poll_q.gif differ diff --git a/shop/img/icon_pumjul.gif b/shop/img/icon_pumjul.gif new file mode 100644 index 000000000..da3e1a905 Binary files /dev/null and b/shop/img/icon_pumjul.gif differ diff --git a/shop/img/icon_text.gif b/shop/img/icon_text.gif new file mode 100644 index 000000000..0fb5d0d03 Binary files /dev/null and b/shop/img/icon_text.gif differ diff --git a/shop/img/icon_top.gif b/shop/img/icon_top.gif new file mode 100644 index 000000000..c2bf5fe45 Binary files /dev/null and b/shop/img/icon_top.gif differ diff --git a/shop/img/icon_type1.gif b/shop/img/icon_type1.gif new file mode 100644 index 000000000..47fecbdd4 Binary files /dev/null and b/shop/img/icon_type1.gif differ diff --git a/shop/img/icon_type2.gif b/shop/img/icon_type2.gif new file mode 100644 index 000000000..99a19a6d2 Binary files /dev/null and b/shop/img/icon_type2.gif differ diff --git a/shop/img/icon_type3.gif b/shop/img/icon_type3.gif new file mode 100644 index 000000000..08036124a Binary files /dev/null and b/shop/img/icon_type3.gif differ diff --git a/shop/img/icon_type4.gif b/shop/img/icon_type4.gif new file mode 100644 index 000000000..b033f847c Binary files /dev/null and b/shop/img/icon_type4.gif differ diff --git a/shop/img/icon_type5.gif b/shop/img/icon_type5.gif new file mode 100644 index 000000000..9e5a6aa4f Binary files /dev/null and b/shop/img/icon_type5.gif differ diff --git a/shop/img/icon_x.gif b/shop/img/icon_x.gif new file mode 100644 index 000000000..73ac99c31 Binary files /dev/null and b/shop/img/icon_x.gif differ diff --git a/shop/img/img_dc.gif b/shop/img/img_dc.gif new file mode 100644 index 000000000..61ae24336 Binary files /dev/null and b/shop/img/img_dc.gif differ diff --git a/shop/img/img_point.gif b/shop/img/img_point.gif new file mode 100644 index 000000000..983e78387 Binary files /dev/null and b/shop/img/img_point.gif differ diff --git a/shop/img/info_box01.gif b/shop/img/info_box01.gif new file mode 100644 index 000000000..1d897047f Binary files /dev/null and b/shop/img/info_box01.gif differ diff --git a/shop/img/info_box02.gif b/shop/img/info_box02.gif new file mode 100644 index 000000000..4017febf9 Binary files /dev/null and b/shop/img/info_box02.gif differ diff --git a/shop/img/info_box03.gif b/shop/img/info_box03.gif new file mode 100644 index 000000000..75979590f Binary files /dev/null and b/shop/img/info_box03.gif differ diff --git a/shop/img/inicis_ing.gif b/shop/img/inicis_ing.gif new file mode 100644 index 000000000..9bcab5a5c Binary files /dev/null and b/shop/img/inicis_ing.gif differ diff --git a/shop/img/item_t01.gif b/shop/img/item_t01.gif new file mode 100644 index 000000000..19dd677aa Binary files /dev/null and b/shop/img/item_t01.gif differ diff --git a/shop/img/item_t02.gif b/shop/img/item_t02.gif new file mode 100644 index 000000000..b917b79ac Binary files /dev/null and b/shop/img/item_t02.gif differ diff --git a/shop/img/item_t03.gif b/shop/img/item_t03.gif new file mode 100644 index 000000000..ebb0207dc Binary files /dev/null and b/shop/img/item_t03.gif differ diff --git a/shop/img/item_t04.gif b/shop/img/item_t04.gif new file mode 100644 index 000000000..3379fb197 Binary files /dev/null and b/shop/img/item_t04.gif differ diff --git a/shop/img/item_t05.gif b/shop/img/item_t05.gif new file mode 100644 index 000000000..e91f24bba Binary files /dev/null and b/shop/img/item_t05.gif differ diff --git a/shop/img/item_t06.gif b/shop/img/item_t06.gif new file mode 100644 index 000000000..98c10da4e Binary files /dev/null and b/shop/img/item_t06.gif differ diff --git a/shop/img/itembox_01.gif b/shop/img/itembox_01.gif new file mode 100644 index 000000000..ab0cb38a6 Binary files /dev/null and b/shop/img/itembox_01.gif differ diff --git a/shop/img/itembox_02.gif b/shop/img/itembox_02.gif new file mode 100644 index 000000000..987b04b03 Binary files /dev/null and b/shop/img/itembox_02.gif differ diff --git a/shop/img/latest_01.gif b/shop/img/latest_01.gif new file mode 100644 index 000000000..9e0bb1f2f Binary files /dev/null and b/shop/img/latest_01.gif differ diff --git a/shop/img/latest_02.gif b/shop/img/latest_02.gif new file mode 100644 index 000000000..89600e726 Binary files /dev/null and b/shop/img/latest_02.gif differ diff --git a/shop/img/line0.gif b/shop/img/line0.gif new file mode 100644 index 000000000..fa7a6e5f3 Binary files /dev/null and b/shop/img/line0.gif differ diff --git a/shop/img/line1.gif b/shop/img/line1.gif new file mode 100644 index 000000000..da4a770b9 Binary files /dev/null and b/shop/img/line1.gif differ diff --git a/shop/img/line2.gif b/shop/img/line2.gif new file mode 100644 index 000000000..7cbe1aa4f Binary files /dev/null and b/shop/img/line2.gif differ diff --git a/shop/img/line_h.gif b/shop/img/line_h.gif new file mode 100644 index 000000000..1934a9f02 Binary files /dev/null and b/shop/img/line_h.gif differ diff --git a/shop/img/line_textarea.gif b/shop/img/line_textarea.gif new file mode 100644 index 000000000..9dc7e863a Binary files /dev/null and b/shop/img/line_textarea.gif differ diff --git a/shop/img/line_v.gif b/shop/img/line_v.gif new file mode 100644 index 000000000..cf31de455 Binary files /dev/null and b/shop/img/line_v.gif differ diff --git a/shop/img/line_v2.gif b/shop/img/line_v2.gif new file mode 100644 index 000000000..b176a2de5 Binary files /dev/null and b/shop/img/line_v2.gif differ diff --git a/shop/img/main_icon.gif b/shop/img/main_icon.gif new file mode 100644 index 000000000..42ea8c404 Binary files /dev/null and b/shop/img/main_icon.gif differ diff --git a/shop/img/marks_escrow/01.jpg b/shop/img/marks_escrow/01.jpg new file mode 100644 index 000000000..ac574e300 Binary files /dev/null and b/shop/img/marks_escrow/01.jpg differ diff --git a/shop/img/marks_escrow/01_s.jpg b/shop/img/marks_escrow/01_s.jpg new file mode 100644 index 000000000..5b69eb14a Binary files /dev/null and b/shop/img/marks_escrow/01_s.jpg differ diff --git a/shop/img/marks_escrow/02.jpg b/shop/img/marks_escrow/02.jpg new file mode 100644 index 000000000..4e067a03f Binary files /dev/null and b/shop/img/marks_escrow/02.jpg differ diff --git a/shop/img/marks_escrow/02_s.jpg b/shop/img/marks_escrow/02_s.jpg new file mode 100644 index 000000000..54f72bb5b Binary files /dev/null and b/shop/img/marks_escrow/02_s.jpg differ diff --git a/shop/img/marks_escrow/03.jpg b/shop/img/marks_escrow/03.jpg new file mode 100644 index 000000000..8ae161a9f Binary files /dev/null and b/shop/img/marks_escrow/03.jpg differ diff --git a/shop/img/marks_escrow/03_s.jpg b/shop/img/marks_escrow/03_s.jpg new file mode 100644 index 000000000..23d896bfb Binary files /dev/null and b/shop/img/marks_escrow/03_s.jpg differ diff --git a/shop/img/marks_escrow/04.jpg b/shop/img/marks_escrow/04.jpg new file mode 100644 index 000000000..27eb671b2 Binary files /dev/null and b/shop/img/marks_escrow/04.jpg differ diff --git a/shop/img/marks_escrow/04_s.jpg b/shop/img/marks_escrow/04_s.jpg new file mode 100644 index 000000000..38caa25bf Binary files /dev/null and b/shop/img/marks_escrow/04_s.jpg differ diff --git a/shop/img/marks_escrow/escrow_foot.gif b/shop/img/marks_escrow/escrow_foot.gif new file mode 100644 index 000000000..6de73c44b Binary files /dev/null and b/shop/img/marks_escrow/escrow_foot.gif differ diff --git a/shop/img/marks_escrow/escrow_side.gif b/shop/img/marks_escrow/escrow_side.gif new file mode 100644 index 000000000..c91e6f62e Binary files /dev/null and b/shop/img/marks_escrow/escrow_side.gif differ diff --git a/shop/img/marks_escrow/txt2_3_2.gif b/shop/img/marks_escrow/txt2_3_2.gif new file mode 100644 index 000000000..61235df0c Binary files /dev/null and b/shop/img/marks_escrow/txt2_3_2.gif differ diff --git a/shop/img/my_bg.gif b/shop/img/my_bg.gif new file mode 100644 index 000000000..114ff1f6e Binary files /dev/null and b/shop/img/my_bg.gif differ diff --git a/shop/img/my_box01.gif b/shop/img/my_box01.gif new file mode 100644 index 000000000..2ef9d1b21 Binary files /dev/null and b/shop/img/my_box01.gif differ diff --git a/shop/img/my_box02.gif b/shop/img/my_box02.gif new file mode 100644 index 000000000..3f296d92c Binary files /dev/null and b/shop/img/my_box02.gif differ diff --git a/shop/img/my_icon.gif b/shop/img/my_icon.gif new file mode 100644 index 000000000..65a288ea4 Binary files /dev/null and b/shop/img/my_icon.gif differ diff --git a/shop/img/my_leave.gif b/shop/img/my_leave.gif new file mode 100644 index 000000000..bc800da0c Binary files /dev/null and b/shop/img/my_leave.gif differ diff --git a/shop/img/my_modify.gif b/shop/img/my_modify.gif new file mode 100644 index 000000000..944e9500c Binary files /dev/null and b/shop/img/my_modify.gif differ diff --git a/shop/img/my_title01.gif b/shop/img/my_title01.gif new file mode 100644 index 000000000..ab7926cd7 Binary files /dev/null and b/shop/img/my_title01.gif differ diff --git a/shop/img/my_title02.gif b/shop/img/my_title02.gif new file mode 100644 index 000000000..c3c9a5498 Binary files /dev/null and b/shop/img/my_title02.gif differ diff --git a/shop/img/mypage_icon1.gif b/shop/img/mypage_icon1.gif new file mode 100644 index 000000000..e68019cce Binary files /dev/null and b/shop/img/mypage_icon1.gif differ diff --git a/shop/img/mypage_icon2.gif b/shop/img/mypage_icon2.gif new file mode 100644 index 000000000..073f83419 Binary files /dev/null and b/shop/img/mypage_icon2.gif differ diff --git a/shop/img/mypage_icon3.gif b/shop/img/mypage_icon3.gif new file mode 100644 index 000000000..54cdad537 Binary files /dev/null and b/shop/img/mypage_icon3.gif differ diff --git a/shop/img/mypage_icon4.gif b/shop/img/mypage_icon4.gif new file mode 100644 index 000000000..1dda66d4c Binary files /dev/null and b/shop/img/mypage_icon4.gif differ diff --git a/shop/img/mypage_icon5.gif b/shop/img/mypage_icon5.gif new file mode 100644 index 000000000..078c4dff3 Binary files /dev/null and b/shop/img/mypage_icon5.gif differ diff --git a/shop/img/mypage_icon6.gif b/shop/img/mypage_icon6.gif new file mode 100644 index 000000000..150cc2308 Binary files /dev/null and b/shop/img/mypage_icon6.gif differ diff --git a/shop/img/mypage_tdsl.gif b/shop/img/mypage_tdsl.gif new file mode 100644 index 000000000..91cd57641 Binary files /dev/null and b/shop/img/mypage_tdsl.gif differ diff --git a/shop/img/navi_icon.gif b/shop/img/navi_icon.gif new file mode 100644 index 000000000..e569203fe Binary files /dev/null and b/shop/img/navi_icon.gif differ diff --git a/shop/img/next.gif b/shop/img/next.gif new file mode 100644 index 000000000..898ec7b2f Binary files /dev/null and b/shop/img/next.gif differ diff --git a/shop/img/no_image.gif b/shop/img/no_image.gif new file mode 100644 index 000000000..1ca45c78c Binary files /dev/null and b/shop/img/no_image.gif differ diff --git a/shop/img/no_item.gif b/shop/img/no_item.gif new file mode 100644 index 000000000..6d1f09974 Binary files /dev/null and b/shop/img/no_item.gif differ diff --git a/shop/img/nocart.gif b/shop/img/nocart.gif new file mode 100644 index 000000000..cded1eed1 Binary files /dev/null and b/shop/img/nocart.gif differ diff --git a/shop/img/nowishlist.gif b/shop/img/nowishlist.gif new file mode 100644 index 000000000..05eeb9264 Binary files /dev/null and b/shop/img/nowishlist.gif differ diff --git a/shop/img/prev.gif b/shop/img/prev.gif new file mode 100644 index 000000000..96cea17e7 Binary files /dev/null and b/shop/img/prev.gif differ diff --git a/shop/img/qty_control.gif b/shop/img/qty_control.gif new file mode 100644 index 000000000..ad30874a5 Binary files /dev/null and b/shop/img/qty_control.gif differ diff --git a/shop/img/saving.gif b/shop/img/saving.gif new file mode 100644 index 000000000..592a52e35 Binary files /dev/null and b/shop/img/saving.gif differ diff --git a/shop/img/star1.gif b/shop/img/star1.gif new file mode 100644 index 000000000..4b2d6e2bb Binary files /dev/null and b/shop/img/star1.gif differ diff --git a/shop/img/star2.gif b/shop/img/star2.gif new file mode 100644 index 000000000..447928e5a Binary files /dev/null and b/shop/img/star2.gif differ diff --git a/shop/img/star3.gif b/shop/img/star3.gif new file mode 100644 index 000000000..078ff8b85 Binary files /dev/null and b/shop/img/star3.gif differ diff --git a/shop/img/star4.gif b/shop/img/star4.gif new file mode 100644 index 000000000..a7f6ead9f Binary files /dev/null and b/shop/img/star4.gif differ diff --git a/shop/img/star5.gif b/shop/img/star5.gif new file mode 100644 index 000000000..95d72c77d Binary files /dev/null and b/shop/img/star5.gif differ diff --git a/shop/img/status01.gif b/shop/img/status01.gif new file mode 100644 index 000000000..48442661d Binary files /dev/null and b/shop/img/status01.gif differ diff --git a/shop/img/status02.gif b/shop/img/status02.gif new file mode 100644 index 000000000..6643baeb8 Binary files /dev/null and b/shop/img/status02.gif differ diff --git a/shop/img/status03.gif b/shop/img/status03.gif new file mode 100644 index 000000000..a828d6c33 Binary files /dev/null and b/shop/img/status03.gif differ diff --git a/shop/img/status04.gif b/shop/img/status04.gif new file mode 100644 index 000000000..e05f641db Binary files /dev/null and b/shop/img/status04.gif differ diff --git a/shop/img/t_data01.gif b/shop/img/t_data01.gif new file mode 100644 index 000000000..032cae251 Binary files /dev/null and b/shop/img/t_data01.gif differ diff --git a/shop/img/t_data02.gif b/shop/img/t_data02.gif new file mode 100644 index 000000000..ca23b70c3 Binary files /dev/null and b/shop/img/t_data02.gif differ diff --git a/shop/img/t_data03.gif b/shop/img/t_data03.gif new file mode 100644 index 000000000..bd5ec089c Binary files /dev/null and b/shop/img/t_data03.gif differ diff --git a/shop/img/t_data04.gif b/shop/img/t_data04.gif new file mode 100644 index 000000000..c2553e3a9 Binary files /dev/null and b/shop/img/t_data04.gif differ diff --git a/shop/img/t_data05.gif b/shop/img/t_data05.gif new file mode 100644 index 000000000..88aa45ad2 Binary files /dev/null and b/shop/img/t_data05.gif differ diff --git a/shop/img/tail_img01.gif b/shop/img/tail_img01.gif new file mode 100644 index 000000000..df6166282 Binary files /dev/null and b/shop/img/tail_img01.gif differ diff --git a/shop/img/tail_img02.gif b/shop/img/tail_img02.gif new file mode 100644 index 000000000..acef79239 Binary files /dev/null and b/shop/img/tail_img02.gif differ diff --git a/shop/img/todayview.gif b/shop/img/todayview.gif new file mode 100644 index 000000000..1020a11a9 Binary files /dev/null and b/shop/img/todayview.gif differ diff --git a/shop/img/todayview01.gif b/shop/img/todayview01.gif new file mode 100644 index 000000000..007cda7c4 Binary files /dev/null and b/shop/img/todayview01.gif differ diff --git a/shop/img/todayview02.gif b/shop/img/todayview02.gif new file mode 100644 index 000000000..779408a13 Binary files /dev/null and b/shop/img/todayview02.gif differ diff --git a/shop/img/todayview03.gif b/shop/img/todayview03.gif new file mode 100644 index 000000000..6c25b35b7 Binary files /dev/null and b/shop/img/todayview03.gif differ diff --git a/shop/img/todayview04.gif b/shop/img/todayview04.gif new file mode 100644 index 000000000..f2485605e Binary files /dev/null and b/shop/img/todayview04.gif differ diff --git a/shop/img/todayview05.gif b/shop/img/todayview05.gif new file mode 100644 index 000000000..a212050ab Binary files /dev/null and b/shop/img/todayview05.gif differ diff --git a/shop/img/todayview06.gif b/shop/img/todayview06.gif new file mode 100644 index 000000000..cf53a6038 Binary files /dev/null and b/shop/img/todayview06.gif differ diff --git a/shop/img/top_cart.gif b/shop/img/top_cart.gif new file mode 100644 index 000000000..9752459fb Binary files /dev/null and b/shop/img/top_cart.gif differ diff --git a/shop/img/top_faq.gif b/shop/img/top_faq.gif new file mode 100644 index 000000000..7a36dde2a Binary files /dev/null and b/shop/img/top_faq.gif differ diff --git a/shop/img/top_mblogin.gif b/shop/img/top_mblogin.gif new file mode 100644 index 000000000..b9e6b9dd1 Binary files /dev/null and b/shop/img/top_mblogin.gif differ diff --git a/shop/img/top_message.gif b/shop/img/top_message.gif new file mode 100644 index 000000000..7bdd73bcb Binary files /dev/null and b/shop/img/top_message.gif differ diff --git a/shop/img/top_mypage.gif b/shop/img/top_mypage.gif new file mode 100644 index 000000000..26c2a8cad Binary files /dev/null and b/shop/img/top_mypage.gif differ diff --git a/shop/img/top_notice.gif b/shop/img/top_notice.gif new file mode 100644 index 000000000..33e6f06a5 Binary files /dev/null and b/shop/img/top_notice.gif differ diff --git a/shop/img/top_onlinecalc.gif b/shop/img/top_onlinecalc.gif new file mode 100644 index 000000000..df10341fb Binary files /dev/null and b/shop/img/top_onlinecalc.gif differ diff --git a/shop/img/top_orderconfirm.gif b/shop/img/top_orderconfirm.gif new file mode 100644 index 000000000..de90011eb Binary files /dev/null and b/shop/img/top_orderconfirm.gif differ diff --git a/shop/img/top_orderform.gif b/shop/img/top_orderform.gif new file mode 100644 index 000000000..44132e19e Binary files /dev/null and b/shop/img/top_orderform.gif differ diff --git a/shop/img/top_orderform.jpg b/shop/img/top_orderform.jpg new file mode 100644 index 000000000..50ed8121d Binary files /dev/null and b/shop/img/top_orderform.jpg differ diff --git a/shop/img/top_orderinquiry.gif b/shop/img/top_orderinquiry.gif new file mode 100644 index 000000000..22f715cd3 Binary files /dev/null and b/shop/img/top_orderinquiry.gif differ diff --git a/shop/img/top_orderinquiryview.gif b/shop/img/top_orderinquiryview.gif new file mode 100644 index 000000000..b8b52fe5d Binary files /dev/null and b/shop/img/top_orderinquiryview.gif differ diff --git a/shop/img/top_orderreceipt.gif b/shop/img/top_orderreceipt.gif new file mode 100644 index 000000000..77b1020f2 Binary files /dev/null and b/shop/img/top_orderreceipt.gif differ diff --git a/shop/img/top_qa.gif b/shop/img/top_qa.gif new file mode 100644 index 000000000..fb65fbf00 Binary files /dev/null and b/shop/img/top_qa.gif differ diff --git a/shop/img/top_search.gif b/shop/img/top_search.gif new file mode 100644 index 000000000..b87786309 Binary files /dev/null and b/shop/img/top_search.gif differ diff --git a/shop/img/top_sitemap.gif b/shop/img/top_sitemap.gif new file mode 100644 index 000000000..b19e5c382 Binary files /dev/null and b/shop/img/top_sitemap.gif differ diff --git a/shop/img/top_type1.gif b/shop/img/top_type1.gif new file mode 100644 index 000000000..b99a601d1 Binary files /dev/null and b/shop/img/top_type1.gif differ diff --git a/shop/img/top_type1.jpg b/shop/img/top_type1.jpg new file mode 100644 index 000000000..6d701fb5d Binary files /dev/null and b/shop/img/top_type1.jpg differ diff --git a/shop/img/top_type2.jpg b/shop/img/top_type2.jpg new file mode 100644 index 000000000..2c540220a Binary files /dev/null and b/shop/img/top_type2.jpg differ diff --git a/shop/img/top_type3.jpg b/shop/img/top_type3.jpg new file mode 100644 index 000000000..525b0b61e Binary files /dev/null and b/shop/img/top_type3.jpg differ diff --git a/shop/img/top_type4.jpg b/shop/img/top_type4.jpg new file mode 100644 index 000000000..09e566eda Binary files /dev/null and b/shop/img/top_type4.jpg differ diff --git a/shop/img/top_type5.jpg b/shop/img/top_type5.jpg new file mode 100644 index 000000000..65a544a08 Binary files /dev/null and b/shop/img/top_type5.jpg differ diff --git a/shop/img/top_wishlist.gif b/shop/img/top_wishlist.gif new file mode 100644 index 000000000..4ea800a27 Binary files /dev/null and b/shop/img/top_wishlist.gif differ diff --git a/shop/item.php b/shop/item.php new file mode 100644 index 000000000..c18454b68 --- /dev/null +++ b/shop/item.php @@ -0,0 +1,1142 @@ + 0) { + for ($i=1; $i<=$tv_idx; $i++) { + if (get_session("ss_tv[$i]") == $it_id) { + $saved = true; + break; + } + } +} + +if (!$saved) { + $tv_idx++; + set_session("ss_tv_idx", $tv_idx); + set_session("ss_tv[$tv_idx]", $it_id); +} +// 오늘 본 상품 저장 끝 + +// 조회수 증가 +if ($_COOKIE['ck_it_id'] != $it_id) { + sql_query(" update {$g4['yc4_item_table']} set it_hit = it_hit + 1 where it_id = '$it_id' "); // 1증가 + setcookie("ck_it_id", $it_id, time() + 3600, $config['cf_cookie_dir'], $config['cf_cookie_domain']); // 1시간동안 저장 +} + +// 분류사용, 상품사용하는 상품의 정보를 얻음 +$sql = " select a.*, + b.ca_name, + b.ca_use + from {$g4['yc4_item_table']} a, + {$g4['yc4_category_table']} b + where a.it_id = '$it_id' + and a.ca_id = b.ca_id "; +$it = sql_fetch($sql); +if (!$it['it_id']) + alert('자료가 없습니다.'); +if (!($it['ca_use'] && $it['it_use'])) { + if (!$is_admin) + alert('판매가능한 상품이 아닙니다.'); +} + +// 분류 테이블에서 분류 상단, 하단 코드를 얻음 +$sql = " select ca_include_head, ca_include_tail + from {$g4['yc4_category_table']} + where ca_id = '{$it['ca_id']}' "; +$ca = sql_fetch($sql); + +$g4['title'] = "상품 상세보기 : {$it['ca_name']} - {$it['it_name']} "; + +// 분류 상단 코드가 있으면 출력하고 없으면 기본 상단 코드 출력 +if ($ca['ca_include_head']) + @include_once($ca['ca_include_head']); +else + include_once('./_head.php'); + +// 분류 위치 +// HOME > 1단계 > 2단계 ... > 6단계 분류 +$ca_id = $it['ca_id']; +include $g4['shop_path'].'/navigation1.inc.php'; + +$himg = $g4['path'].'/data/item/'.$it_id.'_h'; +if (file_exists($himg)) + echo '
          '; + +// 상단 HTML +echo stripslashes($it['it_head_html']); + +if ($is_admin) + echo "

          "; + +// 이 분류에 속한 하위분류 출력 +include $g4['shop_path'].'/listcategory.inc.php'; + +// 이전 상품보기 +$sql = " select it_id, it_name from {$g4['yc4_item_table']} + where it_id > '$it_id' + and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' + and it_use = '1' + order by it_id asc + limit 1 "; +$row = sql_fetch($sql); +if ($row['it_id']) { + $prev_title = "[이전상품보기] $row[it_name]"; + $prev_href = ""; +} else { + $prev_title = "[이전상품없음]"; + $prev_href = ""; +} + +// 다음 상품보기 +$sql = " select it_id, it_name from {$g4['yc4_item_table']} + where it_id < '$it_id' + and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' + and it_use = '1' + order by it_id desc + limit 1 "; +$row = sql_fetch($sql); +if ($row[it_id]) { + $next_title = "[다음상품보기] {$row['it_name']}"; + $next_href = ""; +} else { + $next_title = "[다음상품없음]"; + $next_href = ""; +} + +// 관련상품의 갯수를 얻음 +$sql = " select count(*) as cnt + from {$g4['yc4_item_relation_table']} a + left join {$g4['yc4_item_table']} b on (a.it_id2=b.it_id and b.it_use='1') + where a.it_id = '{$it['it_id']}' "; +$row = sql_fetch($sql); +$item_relation_count = $row['cnt']; + +// 선택옵션 존재하는지 체크 +$it_option_count = 0; +if($it['it_option_use']) { + $sql = " select COUNT(*) as cnt from {$g4['yc4_option_table']} where it_id = '{$it['it_id']}' "; + $row = sql_fetch($sql); + $it_option_count = (int)$row['cnt']; +} + +// 추가옵션 존재하는지 체크 +$it_supplement_count = 0; +if($it['it_supplement_use']) { + $sql = " select COUNT(*) as cnt from {$g4['yc4_supplement_table']} where it_id = '{$it['it_id']}' "; + $row = sql_fetch($sql); + $it_supplement_count = (int)$row['cnt']; +} +?> + + + + + + +
          +
          + + + +
          +'> +'> + + + + + + + + + + + + + + +
          + + + + + + + + + + + +
          +
          + "; + echo "  "; + } + } + ?> +
          /prev.gif' border=0 title=''>
          +
          +
          + + /bg_item.gif'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + ?> + + + + + + + + + + 수령후 지불'; + } else { + if($it['it_sc_method'] == 1) { // 착불 + $pay_option = ''; + } else if($it['it_sc_method'] == 2) { // 선불 또는 착불 + $pay_option = ''."\n"; + $pay_option .= ''; + } + } + ?> + + + + + + + + + 0) { + $disabled = ''; + for($i = 1; $i <= 3; $i++) { + if($i > 1) { + $disabled = 'disabled'; + } + + $str = conv_item_options(trim($it["it_opt{$i}_subject"]), trim($it["it_opt{$i}"]), $i, $disabled); + if($str) { + echo ''."\n"; + echo ''."\n"; + echo ''; + echo ''; + echo ''."\n"; + } + } + } + ?> + + 0) { + $subject = get_supplement_subject($it_id); + if($subject) { + $index = 1; + + foreach($subject as $value) { + $sp_id = $value; + $opt = get_supplement_option($it_id, $sp_id, $index); + + if($opt) { + echo ''."\n"; + echo ''."\n"; + echo ''; + echo ''; + echo ''."\n"; + + $index++; + } + } + } + } + ?> + + + + + + + + + + +
          /itembox_01.gif' width=430>
              · 고객선호도:' border=0>
          /dot_line.gif'>
              · 제조사:
          /dot_line.gif'>
              · 브랜드:
          /dot_line.gif'>
              · 모델명:
          /dot_line.gif'>
              · 원산지:
          /dot_line.gif'>
              · 상품구분:
          /dot_line.gif'>
              · 판매가격:전화문의
          /dot_line.gif'>
              · 시중가격:'> 원
          /dot_line.gif'>
              · 판매가격: 원 + +
          /dot_line.gif'>
              · 재고수량:
          /dot_line.gif'>
              · 포 인 트: 점 + '> +
          /dot_line.gif'>
              · 배 송 비: + +
              · '.$it["it_opt{$i}_subject"].':'.$str.'
              · '.$value.':'.$opt.'
          +
            + '."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''. $it['it_stock_qty'] . ''."\n"; + echo '' . $it['it_name'] . ''."\n"; + echo ' (+0원)'."\n"; + echo ' '."\n"; + echo ' + - '."\n"; + echo ''."\n"; + } + ?> +
          +
            +
          +
          총 금액 :
          +
          /itembox_02.gif' width=430>

          + + + + +
          + + + + + + + + /btn_item_recommend.gif' border=0> + +
          + /bg_tab.gif'> + + + + + + + + + +
          /btn_tab01.gif' border=0>/btn_tab02.gif' border=0 style='padding-top:2px;'>                    (0)/btn_tab03.gif' border=0 style='padding-top:2px;'>                    (0)/btn_tab04.gif' border=0>/btn_tab05.gif' border=0>/btn_tab06.gif' border=0 style='padding-top:2px;'>                    (0)
          +
          +
          + + +
          + + + + +
          /item_t01.gif'>
          + + + + + + + + +
          +
          +
          + + + + + + + + + +
          + + + + +
          /item_t04.gif'>
          +
          + + + + + + +
          + + + + +
          /item_t05.gif'>
          +
          + + + + + +
          + + + + + +
          /item_t06.gif'>
          + +
          +
          +
          + + + + +
          + + + + + + + +
          "; + +if ($ca[ca_include_tail]) + @include_once($ca[ca_include_tail]); +else + include_once("./_tail.php"); +?> diff --git a/shop/itemoptiondata.php b/shop/itemoptiondata.php new file mode 100644 index 000000000..f1d09f972 --- /dev/null +++ b/shop/itemoptiondata.php @@ -0,0 +1,52 @@ +' . $opt_subj . '선택'.PHP_EOL; + +// 옵션항목 +$sql = " select opt_id from `{$g4['yc4_option_table']}` where it_id = '$it_id' and opt_use = '1' and opt_id like '$opt_id%' order by opt_no asc "; +$result = sql_query($sql); +$arr_item = array(); + +for($i = 0; $row = sql_fetch_array($result); $i++) { + $opt_item = explode(chr(30), $row['opt_id']); + $item = trim($opt_item[$idx+1]); + array_push($arr_item, $item); +} + +// 중복옵션 제거 +$arr = array_unique($arr_item); + +$deli = ''; +foreach($arr as $value) { + if($value) { + if($showinfo) { + // 옵션정보 + if($idx >= 0) { + $deli = chr(30); + } + $new_opt_id = $opt_id . $deli . $value; + $sql = " select opt_amount, opt_qty from {$g4['yc4_option_table']} where it_id = '$it_id' and opt_id = '$new_opt_id' and opt_use = '1' "; + $row = sql_fetch($sql); + $opt_info = ''; + if($row['opt_qty']) { + if($row['opt_amount']) { + $opt_info = ' (+' . number_format($row['opt_amount']) . '원)'; + } + } else { + $opt_info = ' [품절]'; + } + } + + $str .= ''.PHP_EOL; + } +} + +echo $str; +?> \ No newline at end of file diff --git a/shop/itemoptioninfo.php b/shop/itemoptioninfo.php new file mode 100644 index 000000000..5720fe805 --- /dev/null +++ b/shop/itemoptioninfo.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/shop/itemqa.inc.php b/shop/itemqa.inc.php new file mode 100644 index 000000000..a4fb2a66d --- /dev/null +++ b/shop/itemqa.inc.php @@ -0,0 +1,292 @@ + + + +
          +
          + + + + + +
          + + + + + + + 0) + echo ""; + + $num = $qa_total_count - ($qa_page - 1) * $qa_page_rows - $i; + + $iq_name = get_text($row[iq_name]); + $iq_subject = conv_subject($row[iq_subject],50,"…"); + $iq_question = conv_content($row[iq_question],0); + $iq_answer = conv_content($row[iq_answer],0); + + $iq_time = substr($row[iq_time], 2, 14); + + //$qa = ""; + //if ($row[iq_answer]) $qa .= ""; + //$qa = "$qa"; + + $icon_answer = ""; + $iq_answer = ""; + if ($row[iq_answer]) + { + $iq_answer = "

          : ".conv_content($row[iq_answer],0) . ""; + $icon_answer = ""; + } + + echo " + + + + + + + "; + } + + + if (!$i) + { + echo " + + + + + "; + } + + + $qa_pages = get_paging(10, $qa_page, $qa_total_page, "./item.php?it_id=$it_id&$qstr&qa_page=", "#qa"); + if ($qa_pages) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + ?> + + + + + +
          + + + + + + + + +
          번호제목작성자작성일답변
          + + + + + + + +
          $num + $iq_subject + $iq_name$iq_time$icon_answer
          + +
           
          + 이 상품에 대한 질문이 아직 없습니다.
          + 궁금하신 사항은 이곳에 질문하여 주십시오.
           
          $qa_pages 
          + + + + +
          * 이 상품에 대한 궁금한 사항이 있으신 분은 질문해 주십시오. +
          + + + +
          +
          + + + + diff --git a/shop/itemqaupdate.php b/shop/itemqaupdate.php new file mode 100644 index 000000000..1af4f1395 --- /dev/null +++ b/shop/itemqaupdate.php @@ -0,0 +1,113 @@ + diff --git a/shop/itemrecommend.php b/shop/itemrecommend.php new file mode 100644 index 000000000..f5b23798f --- /dev/null +++ b/shop/itemrecommend.php @@ -0,0 +1,105 @@ + + + + + + +
          + + + + + + +
          + + +
          + + + + + + + + + + + + + + + +
          + + + + + + + + + + + + + +
          + + + + + + + + +
            추천하실 분 E-mail
          +
          + + + + + + + + + + + +
            제목
            내용
          +   + +
          +
          + + + + \ No newline at end of file diff --git a/shop/itemrecommendmail.php b/shop/itemrecommendmail.php new file mode 100644 index 000000000..0badc305f --- /dev/null +++ b/shop/itemrecommendmail.php @@ -0,0 +1,58 @@ + 3) alert("최대 3명까지만 메일을 발송할 수 있습니다."); +if (substr_count($to_email, "@") > 1) alert('메일 주소는 하나씩만 입력해 주십시오.'); + +if ($_SESSION["ss_recommend_datetime"] >= ($g4[server_time] - 120)) + alert("너무 빠른 시간내에 메일을 연속해서 보낼 수 없습니다."); +set_session("ss_recommend_datetime", $g4[server_time]); + +$recommendmail_count = (int)get_session('ss_recommendmail_count') + 1; +if ($recommendmail_count > 3) + alert_close('한번 접속후 일정수의 메일만 발송할 수 있습니다.\n\n계속해서 메일을 보내시려면 다시 로그인 또는 접속하여 주십시오.'); +set_session('ss_recommendmail_count', $recommendmail_count); + +// 세션에 저장된 토큰과 폼값으로 넘어온 토큰을 비교하여 틀리면 메일을 발송할 수 없다. +if ($_POST["token"] && get_session("ss_token") == $_POST["token"]) { + // 맞으면 세션을 지워 다시 입력폼을 통해서 들어오도록 한다. + set_session("ss_token", ""); +} else { + alert_close("메일 발송시 오류가 발생하였습니다."); + exit; +} + +// 상품 +$sql = " select * from $g4[yc4_item_table] where it_id = '$it_id' "; +$it = sql_fetch($sql); +if (!$it[it_id]) + alert("등록된 상품이 아닙니다."); + +$subject = stripslashes($subject); +$content = nl2br(stripslashes($content)); + +$from_name = $member[mb_name]; +$from_email = $member[mb_email]; +$it_id = $it[it_id]; +$it_name = $it[it_name]; +$it_mimg = $it[it_id]."_m"; + +ob_start(); +include "./mail/itemrecommend.mail.php"; +$content = ob_get_contents(); +ob_end_clean(); + +mailer($from_name, $from_email, $to_email, $subject, $content, 1); + +echo ""; +?> + + diff --git a/shop/itemsupplementinfo.php b/shop/itemsupplementinfo.php new file mode 100644 index 000000000..1f1bee357 --- /dev/null +++ b/shop/itemsupplementinfo.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/shop/itemuse.inc.php b/shop/itemuse.inc.php new file mode 100644 index 000000000..83a9981e1 --- /dev/null +++ b/shop/itemuse.inc.php @@ -0,0 +1,289 @@ + + + + +
          + + + + + +
          + + + + + + + 0) + echo ""; + + $num = $use_total_count - ($use_page - 1) * $use_page_rows - $i; + + $star = get_star($row[is_score]); + + $is_name = get_text($row[is_name]); + $is_subject = conv_subject($row[is_subject],50,"…"); + //$is_content = conv_content($row[is_content],0); + $is_content = $row[is_content]; + //$is_content = preg_replace_callback("#]+>#iS", "g4_thumb", $is_content); + + $thumb = new g4_thumb("$g4[path]/data/itemuse", 500); + $is_content = $thumb->run($is_content); + + $is_time = substr($row[is_time], 2, 14); + + echo " + + + + + + "; + } + + if (!$i) + { + echo " + + + + + "; + } + + $use_pages = get_paging(10, $use_page, $use_total_page, "./item.php?it_id=$it_id&$qstr&use_page=", "#use"); + if ($use_pages) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + ?> + + + + + +
          + + + + + + + + +
          번호제목작성자작성일평가점수
          + + + + + + + +
          $num + $is_subject + $is_name$is_time
          + +
           
          + 이 상품에 대한 사용후기가 아직 없습니다.
          + 사용후기를 작성해 주시면 다른 분들께 많은 도움이 됩니다.
           
          $use_pages 
          + + + + + +
          * 이 상품을 사용해 보셨다면 사용후기를 써 주십시오. + +
          + + + + + +
          +
          + + + + diff --git a/shop/itemuselist.php b/shop/itemuselist.php new file mode 100644 index 000000000..d1032fb3d --- /dev/null +++ b/shop/itemuselist.php @@ -0,0 +1,107 @@ + + + + +
          + + + + + + + + + + + + + + + +run($row[is_content]); + $is_time = substr($row[is_time], 2, 14); + $small_image = $row[it_id]."_s"; + + $row2 = sql_fetch(" select it_name from $g4[yc4_item_table] where it_id = '$row[it_id]' "); + $it_href = "$g4[shop_path]/item.php?it_id=$row[it_id]"; + + echo " + + + + + + + + + + "; +} +if ($i == 0) + echo ""; +?> +
          번호상품후기작성자작성일평가점수
          $num + + + + + +
          ".get_it_image($small_image, 100, 100)." + +
          $row[is_subject]
          +
          $row[is_name]".substr($row[is_time],0,10)."
          자료가 없습니다.
          +

          + +
          + +
          + + diff --git a/shop/itemuseupdate.php b/shop/itemuseupdate.php new file mode 100644 index 000000000..d2d93b849 --- /dev/null +++ b/shop/itemuseupdate.php @@ -0,0 +1,119 @@ + diff --git a/shop/itemusewin.php b/shop/itemusewin.php new file mode 100644 index 000000000..0bb3c62f3 --- /dev/null +++ b/shop/itemusewin.php @@ -0,0 +1,122 @@ +"; +echo cheditor1('is_content', '100%', '250'); +?> + + +
          +
          + + + +
          + 사용후기 쓰기 +
            +
          • + + +
          • +
          • + + +
          • +
          • + + > + > + > + > + > +
          • +
          • + + +  * 왼쪽의 자동등록방지 코드를 입력하세요. +
          • +
          + +
          +
          +
          + + + + \ No newline at end of file diff --git a/shop/itemusewinupdate.php b/shop/itemusewinupdate.php new file mode 100644 index 000000000..214b2cbb2 --- /dev/null +++ b/shop/itemusewinupdate.php @@ -0,0 +1,75 @@ + \ No newline at end of file diff --git a/shop/jstree/_demo/_dump.sql b/shop/jstree/_demo/_dump.sql new file mode 100644 index 000000000..c4a32a8db --- /dev/null +++ b/shop/jstree/_demo/_dump.sql @@ -0,0 +1,20 @@ +CREATE TABLE IF NOT EXISTS `tree` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `parent_id` bigint(20) unsigned NOT NULL, + `position` bigint(20) unsigned NOT NULL, + `left` bigint(20) unsigned NOT NULL, + `right` bigint(20) unsigned NOT NULL, + `level` bigint(20) unsigned NOT NULL, + `title` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; + +INSERT INTO `tree` (`id`, `parent_id`, `position`, `left`, `right`, `level`, `title`, `type`) VALUES +(1, 0, 2, 1, 14, 0, 'ROOT', ''), +(2, 1, 0, 2, 11, 1, 'C:', 'drive'), +(3, 2, 0, 3, 6, 2, '_demo', 'folder'), +(4, 3, 0, 4, 5, 3, 'index.html', 'default'), +(5, 2, 1, 7, 10, 2, '_docs', 'folder'), +(6, 1, 1, 12, 13, 1, 'D:', 'drive'), +(12, 5, 0, 8, 9, 3, 'zmei.html', 'default'); diff --git a/shop/jstree/_demo/_inc/__mysql_errors.log b/shop/jstree/_demo/_inc/__mysql_errors.log new file mode 100644 index 000000000..e69de29bb diff --git a/shop/jstree/_demo/_inc/class._database.php b/shop/jstree/_demo/_inc/class._database.php new file mode 100644 index 000000000..993cf1d40 --- /dev/null +++ b/shop/jstree/_demo/_inc/class._database.php @@ -0,0 +1,146 @@ + "localhost", + "serverport"=> "3306", + "username" => false, + "password" => false, + "database" => false, + "persist" => false, + "dieonerror"=> false, + "showerror" => false, + "error_file"=> true + ); + + function __construct() { + global $db_config; + $this->settings = array_merge($this->settings, $db_config); + if($this->settings["error_file"] === true) $this->settings["error_file"] = dirname(__FILE__)."/__mysql_errors.log"; + } + + function connect() { + if (!$this->link) { + $this->link = ($this->settings["persist"]) ? + mysql_pconnect( + $this->settings["servername"].":".$this->settings["serverport"], + $this->settings["username"], + $this->settings["password"] + ) : + mysql_connect( + $this->settings["servername"].":".$this->settings["serverport"], + $this->settings["username"], + $this->settings["password"] + ) or $this->error(); + } + if (!mysql_select_db($this->settings["database"], $this->link)) $this->error(); + if($this->link) mysql_query("SET NAMES 'utf8'"); + return ($this->link) ? true : false; + } + + function query($sql) { + if (!$this->link && !$this->connect()) $this->error(); + if (!($this->result = mysql_query($sql, $this->link))) $this->error($sql); + return ($this->result) ? true : false; + } + + function nextr() { + if(!$this->result) { + $this->error("No query pending"); + return false; + } + unset($this->row); + $this->row = mysql_fetch_array($this->result, MYSQL_BOTH); + return ($this->row) ? true : false ; + } + + function get_row($mode = "both") { + if(!$this->row) return false; + + $return = array(); + switch($mode) { + case "assoc": + foreach($this->row as $k => $v) { + if(!is_int($k)) $return[$k] = $v; + } + break; + case "num": + foreach($this->row as $k => $v) { + if(is_int($k)) $return[$k] = $v; + } + break; + default: + $return = $this->row; + break; + } + return array_map("stripslashes",$return); + } + + function get_all($mode = "both", $key = false) { + if(!$this->result) { + $this->error("No query pending"); + return false; + } + $return = array(); + while($this->nextr()) { + if($key !== false) $return[$this->f($key)] = $this->get_row($mode); + else $return[] = $this->get_row($mode); + } + return $return; + } + + function f($index) { + return stripslashes($this->row[$index]); + } + + function go_to($row) { + if(!$this->result) { + $this->error("No query pending"); + return false; + } + if(!mysql_data_seek($this->result, $row)) $this->error(); + } + + function nf() { + if ($numb = mysql_num_rows($this->result) === false) $this->error(); + return mysql_num_rows($this->result); + } + function af() { + return mysql_affected_rows(); + } + function error($string="") { + $error = mysql_error(); + if($this->settings["show_error"]) echo $error; + if($this->settings["error_file"] !== false) { + $handle = @fopen($this->settings["error_file"], "a+"); + if($handle) { + @fwrite($handle, "[".date("Y-m-d H:i:s")."] ".$string." <".$error.">\n"); + @fclose($handle); + } + } + if($this->settings["dieonerror"]) { + if(isset($this->result)) mysql_free_result($this->result); + mysql_close($this->link); + die(); + } + } + function insert_id() { + if(!$this->link) return false; + return mysql_insert_id(); + } + function escape($string){ + if(!$this->link) return addslashes($string); + return mysql_real_escape_string($string); + } + + function destroy(){ + if (isset($this->result)) mysql_free_result($this->result); + if (isset($this->link)) mysql_close($this->link); + } + + +} +?> \ No newline at end of file diff --git a/shop/jstree/_demo/_inc/class._database_i.php b/shop/jstree/_demo/_inc/class._database_i.php new file mode 100644 index 000000000..5f6d93b5a --- /dev/null +++ b/shop/jstree/_demo/_inc/class._database_i.php @@ -0,0 +1,152 @@ + "localhost", + "serverport"=> "3306", + "username" => false, + "password" => false, + "database" => false, + "persist" => false, + "dieonerror"=> false, + "showerror" => false, + "error_file"=> true + ); + + function __construct() { + global $db_config; + $this->settings = array_merge($this->settings, $db_config); + if($this->settings["error_file"] === true) $this->settings["error_file"] = dirname(__FILE__)."/__mysql_errors.log"; + } + + function connect() { + $this->data = new mysqli( + $this->settings["servername"], + $this->settings["username"], + $this->settings["password"], + $this->settings["database"], + $this->settings["serverport"] + ); + + if(mysqli_connect_errno()) { + $this->error("Connection error: ".mysqli_connect_error() ); + return false; + } + if(!$this->data->set_charset("utf8")) { + $this->error("Error loading character set utf8"); + return false; + } + return true; + } + + function query($sql) { + if(!$this->data && !$this->connect()) { + $this->error("Could node connect for query: ".$sql); + return false; + } + //echo $sql."
          :"; + if(!($this->result = $this->data->query($sql))) $this->error($sql); + return ($this->result) ? true : false; + } + + function nextr(){ + if(!$this->result) { + $this->error("No query pending"); + return false; + } + unset($this->row); + $this->row = $this->result->fetch_array(MYSQL_BOTH); + return ($this->row) ? true : false ; + } + + function get_row($mode = "both") { + if(!$this->row) return false; + + $return = array(); + switch($mode) { + case "assoc": + foreach($this->row as $k => $v) { + if(!is_int($k)) $return[$k] = $v; + } + break; + case "num": + foreach($this->row as $k => $v) { + if(is_int($k)) $return[$k] = $v; + } + break; + default: + $return = $this->row; + break; + } + return array_map("stripslashes",$return); + } + + function get_all($mode = "both", $key = false) { + if(!$this->result) { + $this->error("No query pending"); + return false; + } + $return = array(); + while($this->nextr()) { + if($key !== false) $return[$this->f($key)] = $this->get_row($mode); + else $return[] = $this->get_row($mode); + } + return $return; + } + + function f($index) { + return stripslashes($this->row[$index]); + } + + function go_to($row) { + if(!$this->result) { + $this->error("No query pending"); + return false; + } + if(!$this->data->data_seek($row)) $this->error(); + } + + function nf() { + if (!$this->result) { + $this->error("nf: no result set"); + return false; + } + return $this->result->num_rows; + } + function af() { + return $this->data->affected_rows; + } + function error($string = "") { + $error = $this->data->error; + if($this->settings["show_error"]) echo $error; + if($this->settings["error_file"] !== false) { + $handle = @fopen($this->settings["error_file"], "a+"); + if($handle) { + @fwrite($handle, "[".date("Y-m-d H:i:s")."] ".$string." <".$error.">\n"); + @fclose($handle); + } + } + if($this->settings["dieonerror"]) { + if(isset($this->result)) $this->result->free(); + @$this->data->close(); + die(); + } + } + function insert_id() { + return $this->data->insert_id; + } + function escape($string) { + if(!$this->data) return addslashes($string); + return $this->data->escape_string($string); + } + + function destroy() { + if(isset($this->result)) $this->result->free(); + if($this->data) $this->data->close(); + } + + +} \ No newline at end of file diff --git a/shop/jstree/_demo/_inc/class.tree.php b/shop/jstree/_demo/_inc/class.tree.php new file mode 100644 index 000000000..f10a57208 --- /dev/null +++ b/shop/jstree/_demo/_inc/class.tree.php @@ -0,0 +1,602 @@ + false, + "parent_id" => false, + "position" => false, + "left" => false, + "right" => false, + "level" => false + ); + + // Constructor + function __construct($table = "tree", $fields = array()) { + $this->table = $table; + if(!count($fields)) { + foreach($this->fields as $k => &$v) { $v = $k; } + } + else { + foreach($fields as $key => $field) { + switch($key) { + case "id": + case "parent_id": + case "position": + case "left": + case "right": + case "level": + $this->fields[$key] = $field; + break; + } + } + } + // Database + $this->db = new _database; + } + + function _get_node($id) { + $this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["id"]."` = ".(int) $id); + $this->db->nextr(); + return $this->db->nf() === 0 ? false : $this->db->get_row("assoc"); + } + function _get_children($id, $recursive = false) { + $children = array(); + if($recursive) { + $node = $this->_get_node($id); + $this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["left"]."` >= ".(int) $node[$this->fields["left"]]." AND `".$this->fields["right"]."` <= ".(int) $node[$this->fields["right"]]." ORDER BY `".$this->fields["left"]."` ASC"); + } + else { + $this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["parent_id"]."` = ".(int) $id." ORDER BY `".$this->fields["position"]."` ASC"); + } + while($this->db->nextr()) $children[$this->db->f($this->fields["id"])] = $this->db->get_row("assoc"); + return $children; + } + function _get_path($id) { + $node = $this->_get_node($id); + $path = array(); + if(!$node === false) return false; + $this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["left"]."` <= ".(int) $node[$this->fields["left"]]." AND `".$this->fields["right"]."` >= ".(int) $node[$this->fields["right"]]); + while($this->db->nextr()) $path[$this->db->f($this->fields["id"])] = $this->db->get_row("assoc"); + return $path; + } + + function _create($parent, $position) { + return $this->_move(0, $parent, $position); + } + function _remove($id) { + if((int)$id === 1) { return false; } + $data = $this->_get_node($id); + $lft = (int)$data[$this->fields["left"]]; + $rgt = (int)$data[$this->fields["right"]]; + $dif = $rgt - $lft + 1; + + // deleting node and its children + $this->db->query("" . + "DELETE FROM `".$this->table."` " . + "WHERE `".$this->fields["left"]."` >= ".$lft." AND `".$this->fields["right"]."` <= ".$rgt + ); + // shift left indexes of nodes right of the node + $this->db->query("". + "UPDATE `".$this->table."` " . + "SET `".$this->fields["left"]."` = `".$this->fields["left"]."` - ".$dif." " . + "WHERE `".$this->fields["left"]."` > ".$rgt + ); + // shift right indexes of nodes right of the node and the node's parents + $this->db->query("" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["right"]."` = `".$this->fields["right"]."` - ".$dif." " . + "WHERE `".$this->fields["right"]."` > ".$lft + ); + + $pid = (int)$data[$this->fields["parent_id"]]; + $pos = (int)$data[$this->fields["position"]]; + + // Update position of siblings below the deleted node + $this->db->query("" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["position"]."` = `".$this->fields["position"]."` - 1 " . + "WHERE `".$this->fields["parent_id"]."` = ".$pid." AND `".$this->fields["position"]."` > ".$pos + ); + return true; + } + function _move($id, $ref_id, $position = 0, $is_copy = false) { + if((int)$ref_id === 0 || (int)$id === 1) { return false; } + $sql = array(); // Queries executed at the end + $node = $this->_get_node($id); // Node data + $nchildren = $this->_get_children($id); // Node children + $ref_node = $this->_get_node($ref_id); // Ref node data + $rchildren = $this->_get_children($ref_id);// Ref node children + + $ndif = 2; + $node_ids = array(-1); + if($node !== false) { + $node_ids = array_keys($this->_get_children($id, true)); + // TODO: should be !$is_copy && , but if copied to self - screws some right indexes + if(in_array($ref_id, $node_ids)) return false; + $ndif = $node[$this->fields["right"]] - $node[$this->fields["left"]] + 1; + } + if($position >= count($rchildren)) { + $position = count($rchildren); + } + + // Not creating or copying - old parent is cleaned + if($node !== false && $is_copy == false) { + $sql[] = "" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["position"]."` = `".$this->fields["position"]."` - 1 " . + "WHERE " . + "`".$this->fields["parent_id"]."` = ".$node[$this->fields["parent_id"]]." AND " . + "`".$this->fields["position"]."` > ".$node[$this->fields["position"]]; + $sql[] = "" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["left"]."` = `".$this->fields["left"]."` - ".$ndif." " . + "WHERE `".$this->fields["left"]."` > ".$node[$this->fields["right"]]; + $sql[] = "" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["right"]."` = `".$this->fields["right"]."` - ".$ndif." " . + "WHERE " . + "`".$this->fields["right"]."` > ".$node[$this->fields["left"]]." AND " . + "`".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") "; + } + // Preparing new parent + $sql[] = "" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["position"]."` = `".$this->fields["position"]."` + 1 " . + "WHERE " . + "`".$this->fields["parent_id"]."` = ".$ref_id." AND " . + "`".$this->fields["position"]."` >= ".$position." " . + ( $is_copy ? "" : " AND `".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") "); + + $ref_ind = $ref_id === 0 ? (int)$rchildren[count($rchildren) - 1][$this->fields["right"]] + 1 : (int)$ref_node[$this->fields["right"]]; + $ref_ind = max($ref_ind, 1); + + $self = ($node !== false && !$is_copy && (int)$node[$this->fields["parent_id"]] == $ref_id && $position > $node[$this->fields["position"]]) ? 1 : 0; + foreach($rchildren as $k => $v) { + if($v[$this->fields["position"]] - $self == $position) { + $ref_ind = (int)$v[$this->fields["left"]]; + break; + } + } + if($node !== false && !$is_copy && $node[$this->fields["left"]] < $ref_ind) { + $ref_ind -= $ndif; + } + + $sql[] = "" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["left"]."` = `".$this->fields["left"]."` + ".$ndif." " . + "WHERE " . + "`".$this->fields["left"]."` >= ".$ref_ind." " . + ( $is_copy ? "" : " AND `".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") "); + $sql[] = "" . + "UPDATE `".$this->table."` " . + "SET `".$this->fields["right"]."` = `".$this->fields["right"]."` + ".$ndif." " . + "WHERE " . + "`".$this->fields["right"]."` >= ".$ref_ind." " . + ( $is_copy ? "" : " AND `".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") "); + + $ldif = $ref_id == 0 ? 0 : $ref_node[$this->fields["level"]] + 1; + $idif = $ref_ind; + if($node !== false) { + $ldif = $node[$this->fields["level"]] - ($ref_node[$this->fields["level"]] + 1); + $idif = $node[$this->fields["left"]] - $ref_ind; + if($is_copy) { + $sql[] = "" . + "INSERT INTO `".$this->table."` (" . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."`, " . + "`".$this->fields["left"]."`, " . + "`".$this->fields["right"]."`, " . + "`".$this->fields["level"]."`" . + ") " . + "SELECT " . + "".$ref_id.", " . + "`".$this->fields["position"]."`, " . + "`".$this->fields["left"]."` - (".($idif + ($node[$this->fields["left"]] >= $ref_ind ? $ndif : 0))."), " . + "`".$this->fields["right"]."` - (".($idif + ($node[$this->fields["left"]] >= $ref_ind ? $ndif : 0))."), " . + "`".$this->fields["level"]."` - (".$ldif.") " . + "FROM `".$this->table."` " . + "WHERE " . + "`".$this->fields["id"]."` IN (".implode(",", $node_ids).") " . + "ORDER BY `".$this->fields["level"]."` ASC"; + } + else { + $sql[] = "" . + "UPDATE `".$this->table."` SET " . + "`".$this->fields["parent_id"]."` = ".$ref_id.", " . + "`".$this->fields["position"]."` = ".$position." " . + "WHERE " . + "`".$this->fields["id"]."` = ".$id; + $sql[] = "" . + "UPDATE `".$this->table."` SET " . + "`".$this->fields["left"]."` = `".$this->fields["left"]."` - (".$idif."), " . + "`".$this->fields["right"]."` = `".$this->fields["right"]."` - (".$idif."), " . + "`".$this->fields["level"]."` = `".$this->fields["level"]."` - (".$ldif.") " . + "WHERE " . + "`".$this->fields["id"]."` IN (".implode(",", $node_ids).") "; + } + } + else { + $sql[] = "" . + "INSERT INTO `".$this->table."` (" . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."`, " . + "`".$this->fields["left"]."`, " . + "`".$this->fields["right"]."`, " . + "`".$this->fields["level"]."` " . + ") " . + "VALUES (" . + $ref_id.", " . + $position.", " . + $idif.", " . + ($idif + 1).", " . + $ldif. + ")"; + } + foreach($sql as $q) { $this->db->query($q); } + $ind = $this->db->insert_id(); + if($is_copy) $this->_fix_copy($ind, $position); + return $node === false || $is_copy ? $ind : true; + } + function _fix_copy($id, $position) { + $node = $this->_get_node($id); + $children = $this->_get_children($id, true); + + $map = array(); + for($i = $node[$this->fields["left"]] + 1; $i < $node[$this->fields["right"]]; $i++) { + $map[$i] = $id; + } + foreach($children as $cid => $child) { + if((int)$cid == (int)$id) { + $this->db->query("UPDATE `".$this->table."` SET `".$this->fields["position"]."` = ".$position." WHERE `".$this->fields["id"]."` = ".$cid); + continue; + } + $this->db->query("UPDATE `".$this->table."` SET `".$this->fields["parent_id"]."` = ".$map[(int)$child[$this->fields["left"]]]." WHERE `".$this->fields["id"]."` = ".$cid); + for($i = $child[$this->fields["left"]] + 1; $i < $child[$this->fields["right"]]; $i++) { + $map[$i] = $cid; + } + } + } + + function _reconstruct() { + $this->db->query("" . + "CREATE TEMPORARY TABLE `temp_tree` (" . + "`".$this->fields["id"]."` INTEGER NOT NULL, " . + "`".$this->fields["parent_id"]."` INTEGER NOT NULL, " . + "`". $this->fields["position"]."` INTEGER NOT NULL" . + ") type=HEAP" + ); + $this->db->query("" . + "INSERT INTO `temp_tree` " . + "SELECT " . + "`".$this->fields["id"]."`, " . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."` " . + "FROM `".$this->table."`" + ); + + $this->db->query("" . + "CREATE TEMPORARY TABLE `temp_stack` (" . + "`".$this->fields["id"]."` INTEGER NOT NULL, " . + "`".$this->fields["left"]."` INTEGER, " . + "`".$this->fields["right"]."` INTEGER, " . + "`".$this->fields["level"]."` INTEGER, " . + "`stack_top` INTEGER NOT NULL, " . + "`".$this->fields["parent_id"]."` INTEGER, " . + "`".$this->fields["position"]."` INTEGER " . + ") type=HEAP" + ); + $counter = 2; + $this->db->query("SELECT COUNT(*) FROM temp_tree"); + $this->db->nextr(); + $maxcounter = (int) $this->db->f(0) * 2; + $currenttop = 1; + $this->db->query("" . + "INSERT INTO `temp_stack` " . + "SELECT " . + "`".$this->fields["id"]."`, " . + "1, " . + "NULL, " . + "0, " . + "1, " . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."` " . + "FROM `temp_tree` " . + "WHERE `".$this->fields["parent_id"]."` = 0" + ); + $this->db->query("DELETE FROM `temp_tree` WHERE `".$this->fields["parent_id"]."` = 0"); + + while ($counter <= $maxcounter) { + $this->db->query("" . + "SELECT " . + "`temp_tree`.`".$this->fields["id"]."` AS tempmin, " . + "`temp_tree`.`".$this->fields["parent_id"]."` AS pid, " . + "`temp_tree`.`".$this->fields["position"]."` AS lid " . + "FROM `temp_stack`, `temp_tree` " . + "WHERE " . + "`temp_stack`.`".$this->fields["id"]."` = `temp_tree`.`".$this->fields["parent_id"]."` AND " . + "`temp_stack`.`stack_top` = ".$currenttop." " . + "ORDER BY `temp_tree`.`".$this->fields["position"]."` ASC LIMIT 1" + ); + + if ($this->db->nextr()) { + $tmp = $this->db->f("tempmin"); + + $q = "INSERT INTO temp_stack (stack_top, `".$this->fields["id"]."`, `".$this->fields["left"]."`, `".$this->fields["right"]."`, `".$this->fields["level"]."`, `".$this->fields["parent_id"]."`, `".$this->fields["position"]."`) VALUES(".($currenttop + 1).", ".$tmp.", ".$counter.", NULL, ".$currenttop.", ".$this->db->f("pid").", ".$this->db->f("lid").")"; + $this->db->query($q); + $this->db->query("DELETE FROM `temp_tree` WHERE `".$this->fields["id"]."` = ".$tmp); + $counter++; + $currenttop++; + } + else { + $this->db->query("" . + "UPDATE temp_stack SET " . + "`".$this->fields["right"]."` = ".$counter.", " . + "`stack_top` = -`stack_top` " . + "WHERE `stack_top` = ".$currenttop + ); + $counter++; + $currenttop--; + } + } + + $temp_fields = $this->fields; + unset($temp_fields["parent_id"]); + unset($temp_fields["position"]); + unset($temp_fields["left"]); + unset($temp_fields["right"]); + unset($temp_fields["level"]); + if(count($temp_fields) > 1) { + $this->db->query("" . + "CREATE TEMPORARY TABLE `temp_tree2` " . + "SELECT `".implode("`, `", $temp_fields)."` FROM `".$this->table."` " + ); + } + $this->db->query("TRUNCATE TABLE `".$this->table."`"); + $this->db->query("" . + "INSERT INTO ".$this->table." (" . + "`".$this->fields["id"]."`, " . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."`, " . + "`".$this->fields["left"]."`, " . + "`".$this->fields["right"]."`, " . + "`".$this->fields["level"]."` " . + ") " . + "SELECT " . + "`".$this->fields["id"]."`, " . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."`, " . + "`".$this->fields["left"]."`, " . + "`".$this->fields["right"]."`, " . + "`".$this->fields["level"]."` " . + "FROM temp_stack " . + "ORDER BY `".$this->fields["id"]."`" + ); + if(count($temp_fields) > 1) { + $sql = "" . + "UPDATE `".$this->table."` v, `temp_tree2` SET v.`".$this->fields["id"]."` = v.`".$this->fields["id"]."` "; + foreach($temp_fields as $k => $v) { + if($k == "id") continue; + $sql .= ", v.`".$v."` = `temp_tree2`.`".$v."` "; + } + $sql .= " WHERE v.`".$this->fields["id"]."` = `temp_tree2`.`".$this->fields["id"]."` "; + $this->db->query($sql); + } + } + + function _analyze() { + $report = array(); + + $this->db->query("" . + "SELECT " . + "`".$this->fields["left"]."` FROM `".$this->table."` s " . + "WHERE " . + "`".$this->fields["parent_id"]."` = 0 " + ); + $this->db->nextr(); + if($this->db->nf() == 0) { + $report[] = "[FAIL]\tNo root node."; + } + else { + $report[] = ($this->db->nf() > 1) ? "[FAIL]\tMore than one root node." : "[OK]\tJust one root node."; + } + $report[] = ($this->db->f(0) != 1) ? "[FAIL]\tRoot node's left index is not 1." : "[OK]\tRoot node's left index is 1."; + + $this->db->query("" . + "SELECT " . + "COUNT(*) FROM `".$this->table."` s " . + "WHERE " . + "`".$this->fields["parent_id"]."` != 0 AND " . + "(SELECT COUNT(*) FROM `".$this->table."` WHERE `".$this->fields["id"]."` = s.`".$this->fields["parent_id"]."`) = 0 "); + $this->db->nextr(); + $report[] = ($this->db->f(0) > 0) ? "[FAIL]\tMissing parents." : "[OK]\tNo missing parents."; + + $this->db->query("SELECT MAX(`".$this->fields["right"]."`) FROM `".$this->table."`"); + $this->db->nextr(); + $n = $this->db->f(0); + $this->db->query("SELECT COUNT(*) FROM `".$this->table."`"); + $this->db->nextr(); + $c = $this->db->f(0); + $report[] = ($n/2 != $c) ? "[FAIL]\tRight index does not match node count." : "[OK]\tRight index matches count."; + + $this->db->query("" . + "SELECT COUNT(`".$this->fields["id"]."`) FROM `".$this->table."` s " . + "WHERE " . + "(SELECT COUNT(*) FROM `".$this->table."` WHERE " . + "`".$this->fields["right"]."` < s.`".$this->fields["right"]."` AND " . + "`".$this->fields["left"]."` > s.`".$this->fields["left"]."` AND " . + "`".$this->fields["level"]."` = s.`".$this->fields["level"]."` + 1" . + ") != " . + "(SELECT COUNT(*) FROM `".$this->table."` WHERE " . + "`".$this->fields["parent_id"]."` = s.`".$this->fields["id"]."`" . + ") " + ); + $this->db->nextr(); + $report[] = ($this->db->f(0) > 0) ? "[FAIL]\tAdjacency and nested set do not match." : "[OK]\tNS and AJ match"; + + return implode("
          ",$report); + } + + function _dump($output = false) { + $nodes = array(); + $this->db->query("SELECT * FROM ".$this->table." ORDER BY `".$this->fields["left"]."`"); + while($this->db->nextr()) $nodes[] = $this->db->get_row("assoc"); + if($output) { + echo "
          ";
          +			foreach($nodes as $node) {
          +				echo str_repeat(" ",(int)$node[$this->fields["level"]] * 2);
          +				echo $node[$this->fields["id"]]." (".$node[$this->fields["left"]].",".$node[$this->fields["right"]].",".$node[$this->fields["level"]].",".$node[$this->fields["parent_id"]].",".$node[$this->fields["position"]].")
          "; + } + echo str_repeat("-",40); + echo "
          "; + } + return $nodes; + } + function _drop() { + $this->db->query("TRUNCATE TABLE `".$this->table."`"); + $this->db->query("" . + "INSERT INTO `".$this->table."` (" . + "`".$this->fields["id"]."`, " . + "`".$this->fields["parent_id"]."`, " . + "`".$this->fields["position"]."`, " . + "`".$this->fields["left"]."`, " . + "`".$this->fields["right"]."`, " . + "`".$this->fields["level"]."` " . + ") " . + "VALUES (" . + "1, " . + "0, " . + "0, " . + "1, " . + "2, " . + "0 ". + ")"); + } +} + +class json_tree extends _tree_struct { + function __construct($table = "tree", $fields = array(), $add_fields = array("title" => "title", "type" => "type")) { + parent::__construct($table, $fields); + $this->fields = array_merge($this->fields, $add_fields); + $this->add_fields = $add_fields; + } + + function create_node($data) { + $id = parent::_create((int)$data[$this->fields["id"]], (int)$data[$this->fields["position"]]); + if($id) { + $data["id"] = $id; + $this->set_data($data); + return "{ \"status\" : 1, \"id\" : ".(int)$id." }"; + } + return "{ \"status\" : 0 }"; + } + function set_data($data) { + if(count($this->add_fields) == 0) { return "{ \"status\" : 1 }"; } + $s = "UPDATE `".$this->table."` SET `".$this->fields["id"]."` = `".$this->fields["id"]."` "; + foreach($this->add_fields as $k => $v) { + if(isset($data[$k])) $s .= ", `".$this->fields[$v]."` = \"".$this->db->escape($data[$k])."\" "; + else $s .= ", `".$this->fields[$v]."` = `".$this->fields[$v]."` "; + } + $s .= "WHERE `".$this->fields["id"]."` = ".(int)$data["id"]; + $this->db->query($s); + return "{ \"status\" : 1 }"; + } + function rename_node($data) { return $this->set_data($data); } + + function move_node($data) { + $id = parent::_move((int)$data["id"], (int)$data["ref"], (int)$data["position"], (int)$data["copy"]); + if(!$id) return "{ \"status\" : 0 }"; + if((int)$data["copy"] && count($this->add_fields)) { + $ids = array_keys($this->_get_children($id, true)); + $data = $this->_get_children((int)$data["id"], true); + + $i = 0; + foreach($data as $dk => $dv) { + $s = "UPDATE `".$this->table."` SET `".$this->fields["id"]."` = `".$this->fields["id"]."` "; + foreach($this->add_fields as $k => $v) { + if(isset($dv[$k])) $s .= ", `".$this->fields[$v]."` = \"".$this->db->escape($dv[$k])."\" "; + else $s .= ", `".$this->fields[$v]."` = `".$this->fields[$v]."` "; + } + $s .= "WHERE `".$this->fields["id"]."` = ".$ids[$i]; + $this->db->query($s); + $i++; + } + } + return "{ \"status\" : 1, \"id\" : ".$id." }"; + } + function remove_node($data) { + $id = parent::_remove((int)$data["id"]); + return "{ \"status\" : 1 }"; + } + function get_children($data) { + $tmp = $this->_get_children((int)$data["id"]); + if((int)$data["id"] === 1 && count($tmp) === 0) { + $this->_create_default(); + $tmp = $this->_get_children((int)$data["id"]); + } + $result = array(); + if((int)$data["id"] === 0) return json_encode($result); + foreach($tmp as $k => $v) { + $result[] = array( + "attr" => array("id" => "node_".$k, "rel" => $v[$this->fields["type"]]), + "data" => $v[$this->fields["title"]], + "state" => ((int)$v[$this->fields["right"]] - (int)$v[$this->fields["left"]] > 1) ? "closed" : "" + ); + } + return json_encode($result); + } + function search($data) { + $this->db->query("SELECT `".$this->fields["left"]."`, `".$this->fields["right"]."` FROM `".$this->table."` WHERE `".$this->fields["title"]."` LIKE '%".$this->db->escape($data["search_str"])."%'"); + if($this->db->nf() === 0) return "[]"; + $q = "SELECT DISTINCT `".$this->fields["id"]."` FROM `".$this->table."` WHERE 0 "; + while($this->db->nextr()) { + $q .= " OR (`".$this->fields["left"]."` < ".(int)$this->db->f(0)." AND `".$this->fields["right"]."` > ".(int)$this->db->f(1).") "; + } + $result = array(); + $this->db->query($q); + while($this->db->nextr()) { $result[] = "#node_".$this->db->f(0); } + return json_encode($result); + } + + function _create_default() { + $this->_drop(); + $this->create_node(array( + "id" => 1, + "position" => 0, + "title" => "C:", + "type" => "drive" + )); + $this->create_node(array( + "id" => 1, + "position" => 1, + "title" => "D:", + "type" => "drive" + )); + $this->create_node(array( + "id" => 2, + "position" => 0, + "title" => "_demo", + "type" => "folder" + )); + $this->create_node(array( + "id" => 2, + "position" => 1, + "title" => "_docs", + "type" => "folder" + )); + $this->create_node(array( + "id" => 4, + "position" => 0, + "title" => "index.html", + "type" => "default" + )); + $this->create_node(array( + "id" => 5, + "position" => 1, + "title" => "doc.html", + "type" => "default" + )); + } +} + +?> \ No newline at end of file diff --git a/shop/jstree/_demo/_install.txt b/shop/jstree/_demo/_install.txt new file mode 100644 index 000000000..3cd5735b7 --- /dev/null +++ b/shop/jstree/_demo/_install.txt @@ -0,0 +1,6 @@ +1) Create a database and a user with all privileges for this database. +2) Edit the config.php file and update the configuration for the database at the top of the file +3) Import the _dump.sql in your newly created database +4) You are ready to go + +*) PLEASE NOTE THAT THE PHP TREE CLASS HAS NOT BEEN THOROUGHLY TESTED \ No newline at end of file diff --git a/shop/jstree/_demo/config.php b/shop/jstree/_demo/config.php new file mode 100644 index 000000000..f8e30ac94 --- /dev/null +++ b/shop/jstree/_demo/config.php @@ -0,0 +1,14 @@ + "localhost", + "username" => "fs4s", + "password" => "", + "database" => "fs4s" +); +if(extension_loaded("mysqli")) require_once("_inc/class._database_i.php"); +else require_once("_inc/class._database.php"); + +// Tree class +require_once("_inc/class.tree.php"); +?> \ No newline at end of file diff --git a/shop/jstree/_demo/file.png b/shop/jstree/_demo/file.png new file mode 100644 index 000000000..58959687b Binary files /dev/null and b/shop/jstree/_demo/file.png differ diff --git a/shop/jstree/_demo/folder.png b/shop/jstree/_demo/folder.png new file mode 100644 index 000000000..30eedea1d Binary files /dev/null and b/shop/jstree/_demo/folder.png differ diff --git a/shop/jstree/_demo/index.html b/shop/jstree/_demo/index.html new file mode 100644 index 000000000..b16d8b9c1 --- /dev/null +++ b/shop/jstree/_demo/index.html @@ -0,0 +1,461 @@ + + + + + jsTree v.1.0 - Demo + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          DEMO

          +

          Creating a tree, binding events, using the instance

          +
          +

          Here is how you create an instance, bind an event and then get the instance.

          +
          + +
          + +
          + +

          Doing something when the tree is loaded

          +
          +

          You can use a few events to do that.

          +
          + +
          + +
          + +

          Doing something when a node is clicked

          +
          +
          + +
          + +
          + +

          Using CSS to make nodes wrap

          +
          + + + +
          + +

          Using CSS to make the nodes bigger

          +
          + + + +
          + +

          PHP & mySQL demo + event order

          +
          +

          Here is a PHP & mySQL enabled demo. You can use the classes/DB structure included, but those are not thoroughly tested and not officially a part of jstree. In the log window you can also see all function calls as they happen on the instance.

          + + + +
          +
          + + + +
          +
          + + + +
          + +
          + + + \ No newline at end of file diff --git a/shop/jstree/_demo/root.png b/shop/jstree/_demo/root.png new file mode 100644 index 000000000..a27e6a39c Binary files /dev/null and b/shop/jstree/_demo/root.png differ diff --git a/shop/jstree/_demo/server.php b/shop/jstree/_demo/server.php new file mode 100644 index 000000000..e05e9a10a --- /dev/null +++ b/shop/jstree/_demo/server.php @@ -0,0 +1,69 @@ +_create_default(); +//die(); + +if(isset($_GET["reconstruct"])) { + $jstree->_reconstruct(); + die(); +} +if(isset($_GET["analyze"])) { + echo $jstree->_analyze(); + die(); +} + +if($_REQUEST["operation"] && strpos($_REQUEST["operation"], "_") !== 0 && method_exists($jstree, $_REQUEST["operation"])) { + header("HTTP/1.0 200 OK"); + header('Content-type: application/json; charset=utf-8'); + header("Cache-Control: no-cache, must-revalidate"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Pragma: no-cache"); + echo $jstree->{$_REQUEST["operation"]}($_REQUEST); + die(); +} +header("HTTP/1.0 404 Not Found"); +?> + +_drop(); +$jstree->create_node(array("id"=>0,"position"=>0)); +$jstree->create_node(array("id"=>1,"position"=>0)); +$jstree->create_node(array("id"=>1,"position"=>0)); +$jstree->create_node(array("id"=>3,"position"=>0,"name"=>"Pesho")); +$jstree->move(3,2,0,true); +$jstree->_dump(true); +$jstree->_reconstruct(); +echo $jstree->_analyze(); +die(); + +$tree = new _tree_struct; +$tree->drop(); +$tree->create(0, 0); +$tree->create(0, 0); +$tree->create(1, 0); +$tree->create(0, 3); +$tree->create(2, 3); +$tree->create(2, 0); +$tree->dump(true); +$tree->move(6,4,0); +$tree->move(1,0,0); +$tree->move(3,2,99,true); +$tree->move(7,1,0,true); +$tree->move(1,7,0); +$tree->move(1,0,1,true); +$tree->move(2, 0, 0, true); +$tree->move(13, 12, 2, true); +$tree->dump(true); +$tree->move(15, 16, 2, true); +$tree->dump(true); +$tree->move(4, 0, 0); +$tree->dump(true); +$tree->move(4, 0, 2); +$tree->dump(true); +echo $tree->analyze(); +$tree->drop(); +*/ +?> \ No newline at end of file diff --git a/shop/jstree/_docs/!style.css b/shop/jstree/_docs/!style.css new file mode 100644 index 000000000..dc0486d67 --- /dev/null +++ b/shop/jstree/_docs/!style.css @@ -0,0 +1,48 @@ +html, body { margin:0; padding:0; background:#D9E3CB; } +body, td, th, pre, code, select, option, input, textarea { font-family:"lucida grande",tahoma,verdana,arial,sans-serif; font-size:10pt; } +#dhead { margin:0 0 0 -10px; padding:0; line-height:80px; font-size:18pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ border-bottom:10px solid #73796B; margin-bottom:0.5em; text-align:center; width:820px; background:black; color:white; -moz-border-radius:5px 5px 0 0; border-radius:5px 5px 0 0; -webkit-border-radius:5px 5px 0 0; text-indent:-2000px; background:black url("logo.png") center center no-repeat; } +h1 { margin:0 0 0 0px; padding:0; font-size:14pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ margin-bottom:1em; text-align:center; text-transform:uppercase;} +h2 { margin:0.5em 0 0.5em 0; padding:0.5em 0 0.5em 20px; font-size:12pt; font-family:Georgia; color:white; background:silver; text-shadow:1px 1px 2px gray; clear:both; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; } +h3 { margin:0; padding:0.5em 0 0.5em 0; font-size:11.5pt; font-family:Georgia; color:gray; clear:both; } +p { padding:0em 0 0.5em 0; margin:0; line-height:1.8em; } +p.meta { font-size:9pt; color:gray; margin-top:-5px; } +.arguments .tp, p code { color:green; padding:0 4px; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size:13px; } +#description, .panel { margin:0 20px; } +#container { width:800px; margin:10px auto; overflow:hidden; background:white; padding:0 10px 10px 10px; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow: 0px 0px 10px #000; } +.demo { width:255px; float:left; margin:0; border:1px solid gray; background:white; overflow:auto; } +.code { width:490px; float:right; margin:0 0 10px 0; border:1px solid gray; font-size:12px; } +pre { display:block; } +.code_f { border:1px solid gray; margin-bottom:1em; } +.syntaxhighlighter { margin:0 0 0 0 !important; padding:0 !important; line-height:18px; } + +.log { padding:4px; border:1px solid gray; margin-bottom:1em; } +.button { display:block; margin-bottom:0.5em; } +.arguments { margin:0em 1em; padding:0; list-style-type:none; } +.arguments .tp { padding:0 0 0 0; float:left; width:70px; } +.arguments strong { display:block; } + +.api h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; } +.api .arguments li strong { color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:13px; } + +.configuration h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; } +.note { background:#ffffee; padding:10px 20px; border:1px solid #333; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; margin-bottom:15px; text-align:center; font-weight:bold; } + +.plugins, .demos { margin:0 auto 20px auto; } + +ul.columns { list-style-type:none; width:700px; margin:0px auto 15px auto; padding:0; overflow:hidden; } +ul.columns li { float:left; margin:0; padding:0 0 0 0px; line-height:18px; width:345px; } +ul.demos li, ul.plugins li { width:220px; text-align:left; padding:5px 0; } +ul.demos li a, ul.plugins li a { text-decoration:none; color:#3B5998; } +ul.demos li a:hover, ul.plugins li a:hover { text-decoration:underline; } +ul.plugins li p { text-align:left; font-size:9px; color:#333; margin:0 5px 0 0; } + +ul.demos li { width:auto; } + +.demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; } + +#demo_body .demo, #demo_body .code { width:auto; float:none; clear:both; margin:10px auto; } +#demo_body .code { margin-bottom:20px; } + +ul.jstree { width:700px; margin:0px auto 15px auto; padding:0; } +ul.jstree li { margin:0; padding:2px 0; } +ul.jstree li a { color:#3B5998; text-decoration:underline; } \ No newline at end of file diff --git a/shop/jstree/_docs/_drive.png b/shop/jstree/_docs/_drive.png new file mode 100644 index 000000000..a27e6a39c Binary files /dev/null and b/shop/jstree/_docs/_drive.png differ diff --git a/shop/jstree/_docs/_html_data.html b/shop/jstree/_docs/_html_data.html new file mode 100644 index 000000000..f91ca7942 --- /dev/null +++ b/shop/jstree/_docs/_html_data.html @@ -0,0 +1,2 @@ +
        • Node 1
        • +
        • Node 2
        • diff --git a/shop/jstree/_docs/_json_data.json b/shop/jstree/_docs/_json_data.json new file mode 100644 index 000000000..e0cac24eb --- /dev/null +++ b/shop/jstree/_docs/_json_data.json @@ -0,0 +1,4 @@ +[ + { "data" : "A node", "children" : [ { "data" : "Only child", "state" : "closed" } ], "state" : "open" }, + "Ajax node" +] \ No newline at end of file diff --git a/shop/jstree/_docs/_search_data.json b/shop/jstree/_docs/_search_data.json new file mode 100644 index 000000000..efa8230bc --- /dev/null +++ b/shop/jstree/_docs/_search_data.json @@ -0,0 +1,6 @@ +[ + "Ajax node 1", + "Ajax node 2", + "TARGET", + "Ajax node 4" +] \ No newline at end of file diff --git a/shop/jstree/_docs/_search_result.json b/shop/jstree/_docs/_search_result.json new file mode 100644 index 000000000..1d292f3e4 --- /dev/null +++ b/shop/jstree/_docs/_search_result.json @@ -0,0 +1 @@ +[ "#root_node" ] \ No newline at end of file diff --git a/shop/jstree/_docs/_xml_flat.xml b/shop/jstree/_docs/_xml_flat.xml new file mode 100644 index 000000000..06162db51 --- /dev/null +++ b/shop/jstree/_docs/_xml_flat.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/shop/jstree/_docs/_xml_nest.xml b/shop/jstree/_docs/_xml_nest.xml new file mode 100644 index 000000000..f882624db --- /dev/null +++ b/shop/jstree/_docs/_xml_nest.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/shop/jstree/_docs/checkbox.html b/shop/jstree/_docs/checkbox.html new file mode 100644 index 000000000..0e5efbf1d --- /dev/null +++ b/shop/jstree/_docs/checkbox.html @@ -0,0 +1,171 @@ + + + + + jsTree v.1.0 - checkbox documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          checkbox plugin

          +

          Description

          +
          +

          The checkbox plugin makes multiselection possible using three-state checkboxes.

          +
          + +

          Configuration

          +
          + +

          override_ui

          +

          A boolean. Default is false.

          +

          If set to true all selection will be handled by checkboxes. The checkbox plugin will map UI's get_selected function to its own get_checked function and overwrite the UI reselect function. It will also disable the select_node, deselect_node and deselect_all functions. If left as false nodes can be selected and checked independently.

          + +

          checked_parent_open

          +

          A Boolean. Default is true.

          +

          When set to true when programatically checking a node in the tree all of its closed parents are opened automatically.

          + +

          two_state

          +

          A boolean. Default is false.

          +

          If set to true checkboxes will be two-state only, meaning that you will be able to select parent and children independently and there will be no undetermined state.

          + +

          real_checkboxes

          +

          A boolean. Default is false.

          +

          If set to true real hidden checkboxes will be created for each element, so if the tree is part of a form, checked nodes will be submitted automatically. By default the name of the checkbox is "check_" + the ID of the LI element and the value is 1, this can be changed using the real_checkboxes_names config option.

          + +

          real_checkboxes_names

          +

          A function. Default is function (n) { return [("check_" + (n[0].id || Math.ceil(Math.random() * 10000))), 1]; }.

          +

          If real checkboxes are used this function is invoked in the current tree's scope for each new checkbox that is created. It receives a single argument - the node that will contain the checkbox. The function must return an array consisting of two values - the name for the checkbox and the value for the checkbox.

          + +
          + +

          Demos

          +
          +

          Using the checkbox plugin - all you need to do is include it in the list of active plugins.

          +
          + +
          + + +
          + +

          API

          +
          +

          ._prepare_checkboxes ( node )

          +

          Inserts the checkbox icons on the node. Used internally.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          ._repair_state ( node )

          +

          Repairs the checkbox state inside the node. Used internally.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .change_state ( node , uncheck )

          +

          Changes the state of a node. Used mostly internally - you'd be better off using the check_node and uncheck_node functions. Triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          • + boolean uncheck +

            If set to true the node is unchecked, if set to false the node is checked, otherwise - the state is toggled.

            +
          • +
          + +

          .check_node ( node )

          +

          Checks a node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .uncheck_node ( node )

          +

          Unchecks a node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .check_all ( )

          +

          Checks all nodes.

          + +

          .uncheck_all ( )

          +

          Unchecks all nodes.

          + +

          .is_checked ( node )

          +

          Checks if a node is checked. Returns boolean.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +
           
          +

          .get_checked ( context, get_all ), .get_unchecked ( context, get_all )

          +

          Both functions return jQuery collections.

          +
            +
          • + mixed context +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If specified only nodes inside the specified context are returned, otherwise the whole tree is searched.

            +
          • +
          • + boolean get_all +

            By default these functions return only top level checked/unchecked nodes (if a node is checked its children are note returned), if this parameter is set to true they will return all checked/unchecked nodes.

            +
          • +
          + +
           
          +

          .show_checkboxes ( ), .hide_checkboxes ( )

          +

          Show or hide the checkbox icons.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/contextmenu.html b/shop/jstree/_docs/contextmenu.html new file mode 100644 index 000000000..e56881f5d --- /dev/null +++ b/shop/jstree/_docs/contextmenu.html @@ -0,0 +1,121 @@ + + + + + jsTree v.1.0 - contextmenu documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          contextmenu plugin

          +

          Description

          +
          +

          The contextmenu plugin enables a contextual menu to be shown, when the user right-clicks a node (or when triggered programatically by the developer).

          +
          + +

          Configuration

          +
          +

          select_node

          +

          Boolean. Default is false.

          +

          Whether to select the right clicked node when showing the context menu. If this is set to true and the node is not selected all currently selected nodes will be deselected.

          + +

          show_at_node

          +

          Boolean. Default is true.

          +

          Whether to show the context menu just below the node, or at the clicked point exactly.

          + +

          items

          +

          Expects an object or a function, which should return an object. If a function is used it fired in the tree's context and receives one argument - the node that was right clicked. The object format is:

          +
          +
          +{
          +// Some key
          +"rename" : {
          +	// The item label
          +	"label"				: "Rename",
          +	// The function to execute upon a click
          +	"action"			: function (obj) { this.rename(obj); },
          +	// All below are optional 
          +	"_disabled"			: true,		// clicking the item won't do a thing
          +	"_class"			: "class",	// class is applied to the item LI node
          +	"separator_before"	: false,	// Insert a separator before the item
          +	"separator_after"	: true,		// Insert a separator after the item
          +	// false or string - if does not contain `/` - used as classname
          +	"icon"				: false,
          +	"submenu"			: { 
          +		/* Collection of objects (the same structure) */
          +	}
          +}
          +/* MORE ENTRIES ... */
          +}
          +
          +
          +
          + +

          Demos

          +
          + +

          Using the contextmenu

          +
          + +
          + + +
          + +

          API

          +
          + +

          .show_contextmenu ( node , x, y )

          +

          Shows the contextmenu next to a node. Triggered automatically when right-clicking a node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          • + number x +

            The X-coordinate to show the menu at - may be overwritten by show_at_node. If you omit this the menu is shown aligned with the left of the node.

            +
          • +
          • + number y +

            The Y-coordinate to show the menu at - may be overwritten by show_at_node. If you omit this the menu is shown just below the node.

            +
          • +
          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/cookies.html b/shop/jstree/_docs/cookies.html new file mode 100644 index 000000000..ce9a1281a --- /dev/null +++ b/shop/jstree/_docs/cookies.html @@ -0,0 +1,97 @@ + + + + + jsTree v.1.0 - cookies documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          cookies plugin

          +

          Description

          +
          +

          The cookies enables jstree to save the state of the tree across sessions. What this does is save the opened and selected nodes in a cookie, and reopen & reselect them the next time the user loads the tree. Depends on the jQuery.cookie plugin.

          The nodes need to have IDs for this plugin to work.

          +
          + +

          Configuration

          +
          + +

          save_opened

          +

          A string (or false). Default is "jstree_open".

          +

          The name of the cookie to save opened nodes in. If set to false - opened nodes won't be saved.

          + +

          save_selected

          +

          A string (or false). Default is "jstree_select".

          +

          The name of the cookie to save selected nodes in. If set to false - selected nodes won't be saved.

          + +

          auto_save

          +

          A Boolean. Default is true.

          +

          If set to true jstree will automatically update the cookies every time a change in the state occurs.

          + +

          cookie_options

          +

          An object. Default is {}.

          +

          The options accepted by the jQuery.cookie plugin.

          + +
          + +

          Demos

          +
          +

          Check your data plugin documentation (html_data, xml_data, json_data) or take a close look at these examples for information on how to specify multilanguage nodes.

          + +

          Using the cookies plugin

          +

          Go ahead and make changes to the tree and then refresh this page.

          +
          + +
          + + +
          + +

          API

          +
          + + +

          Save the current state.

          +
            +
          • + string event +

            Used internally with the auto_save option. Do not set this manually.

            +
          • +
          +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/core.html b/shop/jstree/_docs/core.html new file mode 100644 index 000000000..fc8713851 --- /dev/null +++ b/shop/jstree/_docs/core.html @@ -0,0 +1,689 @@ + + + + + jsTree v.1.0 Core documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          CORE

          +

          Description

          +
          +

          Including the files

          +

          First of all, as jsTree is a jQuery component, you need to include jQuery itself. jsTree v.1.0 requires jQuery version 1.4.2

          + +
          +<script type="text/javascript" src="_lib/jquery.js"></script>
          +
          + +

          Then you need to include jsTree:

          + +
          +<script type="text/javascript" src="jquery.jstree.js"></script>
          +
          + +

          Or you could use the minified version:

          + +
          +<script type="text/javascript" src="jquery.jstree.min.js"></script>
          +
          + +

          You may change the path to whatever you like, but it is recommended not to rename jquery.tree.js or jquery.tree.min.js as the filenames may be used for path autodetection (for example in the themes plugin, but if you really need to rename the file most plugins will give you the option to set the path manually).

          + +

          Additionally some plugins have dependencies - plugins that detect a dependency is missing will throw an error.

          + +

          Creating and configuring an instance

          +

          You can create a tree in the following manner:

          + +
          +jQuery("some-selector-to-container-node-here").jstree([ config_object ]);
          +
          + +

          In the optional config object you specify all the options that you want to set. Each plugin will describe its configuration and defaults. In the configuration section below you will find the options defined by the core. Each plugin's options (even the core) are set in their own subobject, which is named after the plugin. For example all of the core's options are set in the core key of the config object:

          +
          +jQuery("some-selector-to-container-node-here")
          +	.jstree({
          +		core : {
          +			/* core options go here */
          +		}
          +	});
          +
          + +

          Please note that if your options for a given plugin are the same as the defaults you may omit those options or omit the subobject completely (if you do not need to modify the defaults).

          + +

          There is only one special config option that is not a part of any plugin - this is the plugins option, which defines a list of active plugins for the instance being created. Although many plugins may be included, only the ones listed in this option will be active. The only autoincluded "plugin" is the jstree core.

          + +
          +jQuery("some-selector-to-container-node-here")
          +	.jstree({
          +		core : { /* core options go here */ },
          +		plugins : [ "themes", "html_data", "some-other-plugin" ]
          +	});
          +
          + +

          Interacting with the tree

          + +

          To perform an operation programatically on a given instance you can use two methods:

          +
          +/* METHOD ONE */
          +jQuery("some-selector-to-container-node-here")
          +	.jstree("operation_name" [, argument_1, argument_2, ...]);
          +
          +/* METHOD TWO */
          +jQuery.jstree._reference(needle) 
          +	/* NEEDLE can be a DOM node or selector for the container or a node within the container */
          +	.operation_name([ argument_1, argument_2, ...]);
          +
          +

          NOTE: Functions prefixed with _ can not be called with method one.

          + +

          jsTree uses events to notify of any changes happening in the tree. All events fire on the tree container in the jstree namespace and are named after the function that triggered them. Please note that for some events it is best to bind before creating the instance. For example:

          +
          +jQuery("some-container")
          +	.bind("loaded.jstree", function (event, data) {
          +		alert("TREE IS LOADED");
          +	})
          +	.jstree({ /* configuration here */ });
          +
          +

          Please note the second parameter data. Its structure is as follows:

          +
          +{ 
          +	"inst" : /* the actual tree instance */, 
          +	"args" : /* arguments passed to the function */, 
          +	"rslt" : /* any data the function passed to the event */, 
          +	"rlbk" : /* an optional rollback object - it is not always present */
          +}
          +
          +

          There is also one special event - before.jstree. This events enables you to prevent an operation from executing. Look at the demo below.

          + +
          + +

          Configuration

          +
          + +

          html_titles

          +

          Boolean. Default is false.

          +

          Defines whether titles can contain HTML code.

          + +

          animation

          +

          A number. Default is 500.

          +

          Defines the duration of open/close animations. 0 means no animation.

          + +

          initially_open

          +

          An array. Default is [].

          +

          Defines which nodes are to be automatically opened (if they are not present they will first be loaded) when the tree finishes loading - a list of IDs is expected.

          + +

          initially_load

          +

          An array. Default is [].

          +

          Defines which nodes are to be automatically loaded (but not opened) when the tree finishes loading - a list of IDs is expected.

          + +

          load_open

          +

          A Boolean. Default is false.

          +

          When set to true forces loading of nodes marked as open, which do not have children. Otherwise nodes are only visualized as open without any children and opening/closing such a node won't cause it to load (make a server call).

          + +

          open_parents

          +

          Boolean. Default is true.

          +

          If set to true opening a node will also open any closed ancestors it has (will open the whole chain down to this node).

          + +

          notify_plugins

          +

          Boolean. Default is true.

          +

          If set to true loading nodes with some metadata will trigger some actions on the corresponding plugin. So you can actually set the selected/checked/etc

          + +

          rtl

          +

          Boolean. Default is false.

          +

          Defines whether the tree is in right-to-left mode (also make sure you are using a RTL theme - for example the included default-rtl).

          + +

          strings

          +

          Object. Default is { loading : "Loading ...", new_node : "New node" }.

          +

          Contains strings needed for the operation of the tree so that you can localize.

          + + +
          + +

          Demos

          +
          + +

          Binding to an event and executing an action

          + +
          + +
          + +

           

          + +

          Preventing an action

          +

          This is the same demo as above, but this time the operation will be prevented.

          + +
          + +
          + + +

           

          +

          The important part is e.stopImmediatePropagation(); return false.

          +
          + +

          API

          +
          +

          Use extra caution when working with functions prefixed with an underscore - _!
          Those functions are probably for internal usage only.

          + + +

          jQuery.jstree.defaults

          +

          An object. Default is a collection of all included plugin's defaults.

          +

          This object is exposed so that you can apply standart settings to all future instances

          + +

          jQuery.jstree.plugin ( plugin_name , plugin_data )

          +

          This function is used by developers to extend jstree (add "plugins").

          +
            +
          • + string plugin_name +

            The plugin name - it should be unique.

            +
          • +
          • + object plugin_data +

            The plugin itself. It consists of __init & __destroy functions, defaults object (that of course could be an array or a simple value) and a _fn object, whose keys are all the functions you are extending jstree with. You can overwrite functions (but you can in your function call the overriden old function), and you are responsible for triggering events and setting rollback points. You can omit any of the elements in the plugin_data param. Keep in mind jstree will automatically clear classes prepended with jstree- and all events in the jstree namespace when destroying a tree, so you do not need to worry about those.

            +

            Read jstree's code for examples on how to develop plugins.

            +
          • +
          + +

          jQuery.jstree.rollback ( rollback_object )

          +

          This function will roll the tree back to the state specified by the rollback object

          +
            +
          • + string rollback_object +

            Normally you will get this object from the event you are handling. You can of course use .get_rollback() to get the current state of the tree as a rollback object.

            +
            +$("some-container").bind("some-event.jstree", function (e, data) {
            +	$.jstree.rollback(data.rlbk);
            +});
            +

            Keep in mind that not all events will give you a rollback object - sometimes data.rlbk will be false.

            +
          • +
          + +

          jQuery.jstree._focused ()

          +

          Returns the currently focused tree instance on the page. If not interaction has been made - it is the last one to be created.

          + +

          jQuery.jstree._reference ( needle )

          +

          Returns the tree instance for the specified needle.

          +
            +
          • + mixed needle +

            This can be a DOM node, jQuery node or selector pointing to the tree container, or an element within the tree.

            +
          • +
          + +

          jQuery.jstree._instance ( index , container , settings )

          +

          This function is used internally when creating new tree instances. Calling this function by itself is not enough to create a new instance. To create a tree use the documented method $("selector").jstree([ options ]).

          + +

          jQuery.jstree._fn

          +

          This object stores all functions included by plugins. It is used internally as a prototype for all instances - do not modify manually.

          + +

          .data

          +

          An object where all plugins store instance specific data. Do not modify manually.

          + +

          .get_settings ()

          +

          Returns a copy of the instance's settings object - the defaults, extended by your own config object.

          + +

          ._get_settings ()

          +

          Returns the instance's settings object - the defaults, extended by your own config object.

          + +

          .get_index ()

          +

          Returns the internal instance index.

          + +

          .get_container ()

          +

          Returns the jQuery extended container node of the tree.

          + +

          .get_container_ul ()

          +

          Returns the jQuery extended first UL node in the container of the tree.

          + +

          ._set_settings ( settings )

          +

          Replace the settings object with the settings param. Please note that not all plugins will react to the change. Unless you know exactly what you are doing you'd be better off recreating the tree with the new settings.

          + +

          .init ()

          +

          This function is used internally when creating a new instance. Triggers an event, which fires after the tree is initialized, but not yet loaded.

          + +

          .destroy ()

          +

          Destroys the instance - it will automatically remove all bound events in the jstree namespace & remove all classes starting with jstree-. Triggers an event.

          + +

          .save_opened ()

          +

          Stores the currently open nodes before refreshing. Used internally. Triggers an event.

          + +

          .reopen ( is_callback )

          +

          Reopens all the nodes stored by save_opened or set in the initially_open config option on first load. It is called multiple times while reopening nodes - the is_callback param determines if this is the first call (false) or not. Used internally. Triggers an event.

          + +

          .refresh ( node )

          +

          Refreshes the tree. Saves all open nodes, and reloads and then reopens all saved nodes. Triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If set this will reload only the given node - otherwise - the whole tree. Passing -1 also reloads the whole tree.

            +
          • +
          + +

          .loaded ()

          +

          A dummy function, whose purpose is only to trigger the loaded event. This event is triggered once after the tree's root nodes are loaded, but before any nodes set in initially_open are opened.

          + +

          .set_focus ()

          +

          Makes the current instance the focused one on the page. Triggers an event.

          + +

          .unset_focus ()

          +

          If the current instance is focused this removes the focus. Triggers an event.

          + +

          .is_focused ()

          +

          Returns true if the current instance is the focused one, otherwise returns false.

          + +

          .lock ()

          +

          Sets the tree to a locked state - no methods can be called on that instance except for unlock and is_locked.

          +

          .unlock ()

          +

          Sets the tree to a unlocked state (the default state).

          +

          .is_locked ()

          +

          Returns true if the tree is locked, otherwise returns false.

          + +

          ._get_node ( node )

          +

          Return the jQuery extended LI element of the node, -1 if the container node is passed, or false otherwise.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          ._get_next ( node , strict )

          +

          Gets the LI element representing the node next to the passed node. Returns false on failure.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose next sibling we want.

            +
          • +
          • + bool strict +

            If set to true only immediate siblings are calculated. Otherwise if the node is the last child of its parent this function will "jump out" and return the parent's next sibling, etc. Default is false.

            +
          • +
          + +

          ._get_prev ( node , strict )

          +

          Gets the LI element representing the node previous to the passed node. Returns false on failure.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose previous sibling we want.

            +
          • +
          • + bool strict +

            If set to true only immediate siblings are calculated. Otherwise if the node is the first child of its parent this function will "jump out" and return the parent itself. Default is false.

            +
          • +
          + +

          ._get_parent ( node )

          +

          Gets the LI element representing the parent of the passed node. Returns false on failure.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose parent we want.

            +
          • +
          + +

          ._get_children ( node )

          +

          Gets the LI elements representing the children of the passed node. Returns false on failure (or if the node has no children).

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose children we want. Use -1 to return all root nodes.

            +
          • +
          + +

          .get_path ( node , id_mode )

          +

          Return the path to a node, either as an array of IDs or as an array of node names.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose path we want.

            +
          • +
          • + bool id_mode +

            If set to true IDs are returned instead of the names of the parents. Default is false.

            +
          • +
          + +

          .correct_state ( node )

          +

          Corrects closed items to leaf items, if no children are found. Used internally, triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element we want corrected.

            +
          • + + +

            .open_node ( node , callback , skip_animation )

            +

            Opens a closed node, so that its children are visible. If the animation config option is greater than 0 the children are revealed using a slide down animation, whose duration is the value of the animation config option in milliseconds. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element we want opened.

              +
            • +
            • + function callback +

              A callback function executed once the node is opened. Used mostly internally, you'd be better of waiting for the event. You can skip this, by not specifying it, or by passing false.

              +
            • +
            • + bool skip_animation +

              If set to true the animation set in the animation config option is skipped. Default is false.

              +
            • +
            + +

            .after_open ( node )

            +

            A dummy function, it triggers an event after the open animation has finished.

            + +

            .close_node ( node , skip_animation )

            +

            Closes an open node, so that its children are not visible. If the animation config option is greater than 0 the children are hidden using a slide up animation, whose duration is the value of the animation config option in milliseconds. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element we want closed.

              +
            • +
            • + bool skip_animation +

              If set to true the animation set in the animation config option is skipped. Default is false.

              +
            • +
            + +

            .after_close ( node )

            +

            A dummy function, it triggers an event after the close animation has finished.

            + +

            .toggle_node ( node )

            +

            If a node is closed - this function opens it, if it is open - calling this function will close it.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element we want toggled.

              +
            • +
            + +

            .open_all ( node , do_animation, original_obj )

            +

            Opens all descendants of the node node.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element whose descendants you want opened. If this param is omitted or set to -1 all nodes in the tree are opened.

              +
            • +
            • + boolean do_animation +

              If set to true all nodes are opened with an animation. This can be slow on large trees.

              +
            • +
            • + mixed original_obj +

              Used internally when recursively calling the same function - do not pass this param.

              +
            • +
            + +

            .close_all ( node, do_animation )

            +

            Closes all descendants of the node node.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element whose descendants you want closed. If this param is omitted or set to -1 all nodes in the tree are closed.

              +
            • +
            • + boolean do_animation +

              If set to true all nodes are closed with an animation. This can be slow on large trees.

              +
            • +
            + +
              
            +

            .is_open ( node ), .is_closed ( node ), .is_leaf ( node )

            +

            Those function check if the node is in a state.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element you want checked.

              +
            • +
            + +

            .clean_node ( node )

            +

            Applies all necessary classes to the node and its descendants. Used internally. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element you want cleaned. If this param is omitted or set to -1 all nodes in the tree are cleaned.

              +
            • +
            + +

            .get_rollback ()

            +

            Get the current tree's state in the rollback format. Used mainly internally by plugins.

            + +

            .set_rollback ( html , data )

            +

            Rollback the tree. Used ONLY internally! Both arguments are part of the rollback object. If you need to rollback - take a look at jQuery.jstree.rollback(). Triggers event.

            + +

            .load_node ( node , success_callback , error_callback )

            +

            A dummy function that is overwritten by data plugins. Triggers event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use -1 for root nodes.

              +
            • +
            • + function success_callback +

              A function to be executed once the node is loaded successfully - used internally. You should wait for the event.

              +
            • +
            • + function error_callback +

              A function to be executed if the node is not loaded due to an error - used internally. You should wait for the event.

              +
            • +
            + +

            ._is_loaded ( node )

            +

            A dummy function that should return true if the node's children are loaded or false otherwise.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to an element you want to check.

              +
            • +
            + +

            .create_node ( node , position , js , callback , is_loaded )

            +

            Creates the DOM structure necessary for a new node. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to the element you want to create in (or next to).

              +
            • +
            • + mixed position +

              The position of the newly created node. This can be a zero based index to position the element at a specific point among the current children. You can also pass in one of those strings: "before", "after", "inside", "first", "last".

              +
            • +
            • + object js +

              The data for the newly created node. Consists of three keys:

              attr - an object of attributes (same used for jQuery.attr(). You can omit this key;
              state - a string - either "open" or "closed", for a leaf node - omit this key;
              data - a string or an object - if a string is passed it is used for the title of the node, if an object is passed there are two keys you can specify: attr and title;

              +
            • +
            • + function callback +

              A function to be executed once the node is created - used internally. You should wait for the event.

              +
            • +
            • + bool is_loaded +

              Specifies if the parent of the node is loaded or not - used ONLY internally.

              +
            • +
            + +

            ._get_string ( node )

            +

            Returns the needed string from the config object. If the key does not exist the key itself is returned.

            +
              +
            • + string key +

              The name of the string you are looking for.

              +
            • +
            + +

            .get_text ( node )

            +

            Returns the title of a node.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to the element whose title you need.

              +
            • +
            + +

            .set_text ( node , text )

            +

            Sets the title of a node. Triggers an event. This is used mostly internally - wait for a .rename_node event to avoid confusion.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.

              +
            • +
            • + string text +

              The new title.

              +
            • +
            + +

            .rename_node ( node , text )

            +

            Sets the title of a node. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.

              +
            • +
            • + string text +

              The new title.

              +
            • +
            + +

            .delete_node ( node )

            +

            Removes a node. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to the element you want to remove.

              +
            • +
            + +

            .prepare_move ( o , r , pos , cb , is_cb )

            +

            This function is used internally to prepare all necessary variables and nodes when moving a node around. It is automatically called as needed - you do not need to call it manually. Triggers an event.

            + +

            .check_move ()

            +

            Checks if the prepared move is a valid one.

            + +

            .move_node ( node , ref , position , is_copy , is_prepared , skip_check )

            +

            Moves a node to a new place. Triggers an event.

            +
              +
            • + mixed node +

              This can be a DOM node, jQuery node or selector pointing to the element you want to move.

              +
            • +
            • + mixed ref +

              This can be a DOM node, jQuery node or selector pointing to the element which will be the reference element in the move. -1 may be used too (to indicate the container node).

              +
            • +
            • + mixed position +

              The new position of the moved node. This can be a zero based index to position the element at a specific point among the reference node's current children. You can also use one of these strings: "before", "after", "inside", "first", "last".

              +
            • +
            • + bool is_copy +

              Should this be a copy or a move operation.

              +
            • +
            • + bool is_prepared +

              Used internally when this function is called recursively.

              +
            • +
            • + bool skip_check +

              If this is set to true check_move is not called.

              +
            • +
            + +

            ._get_move ()

            +

            Returns the lastly prepared move. The returned object contains:
            +.o - the node being moved
            +.r - the reference node in the move
            +.ot - the origin tree instance
            +.rt - the reference tree instance
            +.p - the position to move to (may be a string - "last", "first", etc)
            +.cp - the calculated position to move to (always a number)
            +.np - the new parent
            +.oc - the original node (if there was a copy)
            +.cy - boolen indicating if the move was a copy
            +.cr - same as np, but if a root node is created this is -1
            +.op - the former parent
            +.or - the node that was previously in the position of the moved node
            +

            + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/crrm.html b/shop/jstree/_docs/crrm.html new file mode 100644 index 000000000..0f8271873 --- /dev/null +++ b/shop/jstree/_docs/crrm.html @@ -0,0 +1,316 @@ + + + + + jsTree v.1.0 - CRRM documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          crrm plugin

          +

          Description

          +
          +

          The CRRM plugin handles creating, renaming, removing and moving nodes by the user.

          +
          + +

          Configuration

          +
          +

          input_width_limit

          +

          A number. Default is 200.

          +

          When renaming (or creating) nodes the input for the text will autosize - this number sets the maximum size for the input.

          + +

          move

          +

          An object, containing various settings - see below for more.

          + +

          move.always_copy

          +

          true, false or "multitree". Default is false.

          +

          Defines how moves are handled - if set to true every move will be forced to a copy (leaving the original node in place). If set to "multitree" only moves between trees will be forced to a copy.

          + +

          move.open_onmove

          +

          A Boolean. Default is true.

          +

          If set to true, when moving a node to a new, closed parent, the parent node will be opened when the move completes.

          + +

          move.default_position

          +

          A string or a number. Default is "last".

          +

          The default position to move to if no position is specified. This can be a zero based index to position the element at a specific point among the new parent's current children. You can also use one of these strings: "before", "after", "inside", "first", "last".

          + +

          move.check_move

          +

          A function. Default is function (m) { return true; }.

          +

          The callback function enabling you to prevent some moves - just return false. The m parameter is the move object generated by jstree. The object follows the structure described in ._get_move.

          + +
          + +

          Demos

          +
          + +

          Creating nodes

          + + + +
          + +
          + + +

          Removing nodes

          + + +
          + +
          + + +

          Renaming nodes

          + + +
          + +
          + + +

          Moving nodes

          +

          move_1 uses the default position - "first"

          +

          move_2 specifies a position - "before" - meaning that the node specified as a first argument will come above the node specified as the second argument

          +

          move_3 will never work, because of the specified check_move function which prevents the first root node from being moved

          + + + +
          + +
          + + +
          + +

          API

          +
          + +

          ._show_input ( node , callback )

          +

          Renders an input field in a node. Used only internally.

          + +

          .rename ( node )

          +

          Sets a node in rename mode and when the user has entered changes, an event is triggered.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass null to use the currently selected item.

            +
          • +
          + +

          .create ( node , position , js , callback , skip_rename )

          +

          Creates a new node. Triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element you want to create in (or next to). If you use the UI plugin - pass null to use the currently selected item.

            +
          • +
          • + mixed position +

            The position of the newly created node. This can be a zero based index to position the element at a specific point among the current children. You can also pass in one of those strings: "before", "after", "inside", "first", "last".

            +
          • +
          • + object js +

            The data for the newly created node. Consists of three keys:

            attr - an object of attributes (same used for jQuery.attr(). You can omit this key;
            state - a string - either "open" or "closed", for a leaf node - omit this key;
            data - a string or an object - if a string is passed it is used for the title of the node, if an object is passed there are two keys you can specify: attr and title;

            +
          • +
          • + function callback +

            A function to be executed once the node is created. You'd be better off waiting for the event.

            +
          • +
          • + bool skip_rename +

            Skips the user input step. The node is created with the data you have supplied.

            +
          • +
          + +

          .remove ( node )

          +

          Removes a node. Triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass null to use the currently selected items.

            +
          • +
          + +
           
          +

          .check_move ( ), .move_node ( )

          +

          Both functions are overwritten from the core in order to implement the new functionality.

          + +

          .cut ( node )

          +

          Cuts a node (prepares it for pasting).

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass null to use the currently selected item.

            +
          • +
          + +

          .copy ( node )

          +

          Copies a node (prepares it for pasting).

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass null to use the currently selected item.

            +
          • +
          + +

          .paste ( node )

          +

          Pastes copied or cut nodes inside a node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass null to use the currently selected item.

            +
          • +
          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/dnd.html b/shop/jstree/_docs/dnd.html new file mode 100644 index 000000000..076112d38 --- /dev/null +++ b/shop/jstree/_docs/dnd.html @@ -0,0 +1,199 @@ + + + + + jsTree v.1.0 - dnd documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          dnd plugin

          +

          Description

          +
          +

          The dnd plugin enables drag'n'drop support for jstree, also using foreign nodes and drop targets.

          +

          All foreign node options and callback functions in the config (drop_target, drop_check, drop_finish, drag_target, drag_check, drag_finish) are to be used ONLY when nodes that are not part of any tree are involved.
          If moving nodes from one tree instance to another - just listen for the "move_node.jstree" event on the receiving tree.
          DO NOT SET drag_target AND drop_target to match tree nodes!

          +
          + +

          Configuration

          +
          + +

          copy_modifier

          +

          A string. Default is "ctrl".

          +

          The special key used to make a drag copy instead of move ("ctrl", "shift", "alt", "meta").

          + +

          check_timeout

          +

          A number. Default is 200.

          +

          The number of milliseconds to wait before checking if a move is valid upon hovering a node (while dragging). 200 is a reasonable value - a higher number means better performance but slow feedback to the user, a lower number means lower performance (possibly) but the user will get feedback faster.

          + +

          open_timeout

          +

          A number. Default is 500.

          +

          The number of milliseconds to wait before opening a hovered if it has children (while dragging). This means that the user has to stop over the node for half a second in order to trigger the open operation. Keep in mind that a low value in combination with async data could mean a lot of unneeded traffic, so 500 is quite reasonable.

          + +

          drop_target

          +

          A string (jQuery selector) (or false). Default is ".jstree-drop".

          +

          A jquery selector matching all drop targets (you can also use the comma , in the string to specify multiple valid targets). If set to false drop targets are disabled.

          + +

          drop_check

          +

          A function. Default is function (data) { return true; }.

          +

          Return false to mark the move as invalid, otherwise return true. The data parameter is as follows:

          +

          data.o - the object being dragged

          +

          data.r - the drop target

          + +

          drop_finish

          +

          A function. Default is $.noop.

          +

          Gets executed after a valid drop, you get one parameter, which is as follows:

          +

          data.o - the object being dragged

          +

          data.r - the drop target

          + +

          drag_target

          +

          A string (jQuery selector) (or false). Default is ".jstree-draggable".

          +

          A jquery selector matching all foreign nodes that can be dropped on the tree (you can also use the comma , in the string to specify multiple valid foreign nodes). If set to false dragging foreign nodes is disabled.

          + +

          drag_check

          +

          A function. Default is function (data) { return { after : false, before : false, inside : true }; }.

          +

          Return a boolean for each position. The data parameter is as follows:

          +

          data.o - the foreign object being dragged

          +

          data.r - the hovered node

          + +

          drag_finish

          +

          A function. Default is $.noop.

          +

          Gets executed after a dropping a foreign element on a tree item, you get one parameter, which is as follows:

          +

          data.o - the foreign object being dragged

          +

          data.r - the target node

          + + +
          + +

          Demos

          +
          +

          Using the dnd plugin

          +

          Drag stuff around!

          +
          I have the jstree-drop class
          +
          I have the jstree-draggable class
          +
          + +
          + + +

          Reorder only demo

          +
          + +
          + + +
          + +

          API

          +
          + +
          +   +   +   +   +   +
          +

          .dnd_prepare ( ), .dnd_show ( ), .dnd_open ( ), .dnd_finish ( ), .dnd_enter ( ), .dnd_leave ( ), .start_drag ( )

          +

          All those functions are used internally only. If you want more information - examine the source code.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/hotkeys.html b/shop/jstree/_docs/hotkeys.html new file mode 100644 index 000000000..ad1bd9ab7 --- /dev/null +++ b/shop/jstree/_docs/hotkeys.html @@ -0,0 +1,82 @@ + + + + + jsTree v.1.0 - hotkeys documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          hotkeys plugin

          +

          Description

          +
          +

          The hotkeys plugin enables keyboard navigation and shortcuts. Depends on the jquery.hotkeys plugin.

          +
          + +

          Configuration

          +
          +

          Expects an object:
          each key is the keyboard shortcut (for possible values check the hotkeys plugin)
          each value is a function executed in the instance's context, the return value is used as a return value for the event.

          +

          Simple example:

          +

          "del" : function () { this.remove(); }

          +

          By default "up", "ctrl+up", "shift+up", "down", "ctrl+down", "shift+down", "left", "ctrl+left", "shift+left", "right", "ctrl+right", "shift+right", "space", "ctrl+space", "shift+space", "f2", "del" are bound.
          To override any of those - just specify your own function, to disable - just set to false. +

          + +

          Demos

          +
          + +

          Using the hotkeys plugin

          +

          Try pressing up/down/left/right/space/f2/del.

          +
          + +
          + + +
          + +

          API

          +
          + +

          .enable_hotkeys ( )

          +

          Enable shortcuts on the instance (enabled by default).

          + +

          .disable_hotkeys ( )

          +

          Disable shortcuts on the instance.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/html_data.html b/shop/jstree/_docs/html_data.html new file mode 100644 index 000000000..3e41595c8 --- /dev/null +++ b/shop/jstree/_docs/html_data.html @@ -0,0 +1,175 @@ + + + + + jsTree v.1.0 - html_data documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          html_data plugin

          +

          Description

          +
          +

          The html_data plugin enables jsTree to convert nested unordered lists to interactive trees. jsTree can also get HTML from the server insert it into the DOM and convert that to a tree.

          +

          The basic structure you need to follow when supplying data in the HTML format is:

          +
          +
          +<li>
          +	<a href="some_value_here">Node title</a>
          +	<!-- UL node only needed for children - omit if there are no children -->
          +	<ul>
          +		<!-- Children LI nodes here -->
          +	</ul>
          +</li>
          +
          +
          +

          If you inspect the resulting structure you will find it a bit different - that is because jstree will automatically do some corrections.

          +
          +
          +<!-- one of the three classes will be applied depending on node structure -->
          +<li class="[ jstree-open | jstree-closed | jstree-leaf ]">
          +	<!-- an INS element is inserted -->
          +	<ins class="jstree-icon">&#160;</ins>
          +	<a href="some_value_here">
          +		<!-- another INS element is inserted -->
          +		<ins class="jstree-icon">&#160;</ins>
          +		Node title
          +	</a>
          +</li>
          +
          +
          +

          Both ins elements are inserted for visualization purposes. As for the class (jstree-open, jstree-closed) - you can specify that yourself to force the node to appear either closed or opened. Making a node with no children appear closed is often used - if you use ajax, opening a closed node with no children will result in jstree making a server call for the children (see the demo below).

          +
          + +

          Configuration

          +
          +

          data

          +

          A HTML string (or false if not used). Default is false.

          +

          Specifies the content to load into the container and convert to a tree.

          +

          ajax

          +

          An object (or false if not used). Default is false.

          +

          The ajax config object is pretty much the same as the jQuery ajax settings object.

          +

          You can set the data option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the node about to be open as a paramater (or -1 for initial load). Whatever you return in the function will be sent to the server as data (so for example you can send the node's ID).

          +

          You can set the url option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the node about to be open as a paramater (or -1 for initial load). Whatever you return in the url function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).

          +

          The error and success functions (if present) also fire in the context of the tree, and if you return a value in the success function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree.

          +

          correct_state

          +

          A Boolean. Default is true.

          +

          If this option is set to true if an AJAX request returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).

          + +

          NOTE:
          If both data and ajax are not set, the current container's HTML is used to build the tree.
          If both data and ajax are set the initial tree is rendered from the data string. When opening a closed node (that has no loaded children) an AJAX request is made.

          +
          + +

          Demos

          +
          + +

          Using initial content (convert an existing list)

          +
          + +
          + + +

          Using the data config option

          +
          + + +

          Using the ajax config option

          +
          + + +

          Using both the data & ajax config options

          +
          + +
          + +

          API

          +
          +

          Both dummy functions - _is_loaded and load_node are overwritten.

          +

          .load_node_html ( node , success_callback , error_callback )

          +

          This function is called instead of load_node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use -1 for root nodes.

            +
          • +
          • + function success_callback +

            A function to be executed once the node is loaded successfully - used internally. You should wait for the load_node event.

            +
          • +
          • + function error_callback +

            A function to be executed if the node is not loaded due to an error - used internally. You should wait for the load_node event.

            +
          • +
          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/index.html b/shop/jstree/_docs/index.html new file mode 100644 index 000000000..7303a3e4b --- /dev/null +++ b/shop/jstree/_docs/index.html @@ -0,0 +1,86 @@ + + + + + jsTree v.1.0 Documentation + + + + + + + + + + +
          + +

          jsTree - jquery tree plugin

          + +

          Description

          +
          + +

          jsTree:

          +
            +
          • ♦  is a javascript based, cross browser tree component. It is packaged as a jQuery plugin.
          • +
          • ♦  is absolutely free (licensed same as jQuery – under the terms of either the MIT License or the GPL v2 License).
          • +
          • ♦  is a one man project and relies on its great community for feature requests & bug reports. Join in!
          • +
          • ♦  passes jslint validation, minifies nicely and does not modify the global scope in any way.
          • +
          • ♦  uses plugins so feel free to remove any plugins you do not use (for an even smaller download) or create your own plugins.
          • +
          + +

          Features at a glance

          +
            +
          • Various data sources - HTML, JSON, XML
          • +
          • Supports AJAX loading
          • +
          • Drag & drop support
          • +
          • Highly configurable
          • +
          • Theme support + included themes
          • +
          • Uses jQuery's event system
          • +
          • Optional keyboard navigation
          • +
          • Maintain the same tree in many languages
          • +
          • Inline editing
          • +
          • Open/close optional animation
          • +
          • Define node types and fine tune them
          • +
          • Configurable multitree drag & drop
          • +
          • Optional checkbox tree support
          • +
          • Search function
          • +
          • Supports plugins
          • +
          • Optional state saving using cookies
          • +
          • RTL support
          • +
          • Optional sorting / unique management
          • +
          +

          if you like the project - consider supporting jstree.

          +
          + +

          Plugins documentation

          +
          +

          As of version 1.0 jsTree is extremely plugin friendly, so all functionality is now wrapped in plugins, which take care of various aspects of the tree and can be removed without affecting the functionality of other plugins. Below you will find a list of plugins - each with its own documentation page. Probably a good place to start is the core.

          +
            +
          • Core functionality

            all core functions for manipulating the tree + basic examples of including, configuring and working with the tree, along with demos of the new event system

          • +
          • HTML_DATA plugin

            enables jsTree to convert nested unordered lists to interactive trees, an already existing UL may be used or data could be retrieved from a server

          • +
          • JSON_DATA plugin

            enables jsTree to convert JSON objects to interactive trees, data can be set up in the config or retrieved from a server

          • +
          • XML_DATA plugin

            enables jsTree to convert XML objects to interactive trees (using XSL), data can be set up in the config or retrieved from a server

          • +
          • Themes plugin

            controls the looks of jstree - without this plugin you will get a functional tree, but it will look just like an ordinary UL list

          • +
          • UI plugin

            handles selecting, deselecting and hovering tree items

          • +
          • CRRM plugin

            handles creating, renaming, removing and moving nodes by the user, also includes cut/copy/paste functions

          • +
          • Hotkeys plugin

            enables support for keyboard navigation & shortcuts, highly configurable

          • +
          • Languages plugin

            enables multilanguage support - each node can have multiple titles, but only one is visible

          • +
          • Cookies plugin

            enables jstree to save the state of the tree across sessions, by saving selected and opened nodes in a cookie

          • +
          • Sort plugin

            enables jstree to automatically sort all nodes
            using a specified function

          • +
          • DND plugin

            enables drag'n'drop support for jstree, also using foreign nodes and drop targets

          • +
          • Checkbox plugin

            makes multiselection possible using three-state checkboxes

          • +
          • Search plugin

            enables searching for nodes whose title contains a given string, works on async trees too

          • +
          • Contextmenu plugin

            enables a multilevel context menu on tree items

          • +
          • Types plugin

            each node can have a type, and you can define rules on how that type should behave

          • +
          • Themeroller plugin

            adds support for jQuery UI's themes

          • +
          • Unique plugin

            adds unique checking to jsTree

          • +
          • Wholerow plugin

            enhances UIs select & hover functions

          • +
          +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/json_data.html b/shop/jstree/_docs/json_data.html new file mode 100644 index 000000000..6312a037e --- /dev/null +++ b/shop/jstree/_docs/json_data.html @@ -0,0 +1,249 @@ + + + + + jsTree v.1.0 - json_data documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          json_data plugin

          +

          Description

          +
          +

          The json_data plugin enables jsTree to convert JSON objects to interactive trees. The data (JSON) can be set up in the config or retrieved from a server (also ondemand). Version 1.0 also introduces the experimental progressive render feature, which is suitable for large heavy trees, when the DOM would be too heavy to manipulate.

          +

          The basic structure you need to follow when supplying data in the JSON format is:

          +
          +
          +{ 
          +	"data" : "node_title", 
          +	// omit `attr` if not needed; the `attr` object gets passed to the jQuery `attr` function
          +	"attr" : { "id" : "node_identificator", "some-other-attribute" : "attribute_value" }, 
          +	// `state` and `children` are only used for NON-leaf nodes
          +	"state" : "closed", // or "open", defaults to "closed"
          +	"children" : [ /* an array of child nodes objects */ ]
          +}
          +
          +
          +

          The attr object will appear as attributes on the resulting li node.

          +

          You may need to pass some attributes to the a node, or set some metadata, or use language versions (for the languages plugin):

          +
          +
          +{
          +	// `data` can also be an object
          +	"data" : { 
          +		"title" : "The node title", 
          +		// omit when not needed
          +		"attr" : {}, 
          +		// if `icon` contains a slash / it is treated as a file, used for background
          +		// otherwise - it is added as a class to the <ins> node
          +		"icon" : "folder"
          +	},
          +
          +	// the `metadata` property will be saved using the jQuery `data` function on the `li` node
          +	"metadata" : "a string, array, object, etc",
          +
          +	// if you use the language plugin - just set this property
          +	// also make sure that `data` is an array of objects
          +	"language" : "en" // any code you are using
          +}
          +
          +
          +

          As seen in the first example below - you can also use a simple string to define a node (Child 1 & Child 2).

          +
          + +

          Configuration

          +
          +

          data

          +

          A JSON object (or false if not used). Default is false.

          +

          Specifies the content to load into the container and convert to a tree. You can also set this to a function - it will be executed in the tree's scope for every node that needs to be loaded, the function will receive two arguments - the node being loaded & a function to call with the data once your processing is done.

          +

          ajax

          +

          An object (or false if not used). Default is false.

          +

          The ajax config object is pretty much the same as the jQuery ajax settings object.

          +

          You can set the data option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the node about to be open as a paramater (or -1 for initial load). Whatever you return in the data function will be sent to the server as data (so for example you can send the node's ID).

          +

          You can set the url option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the node about to be open as a paramater (or -1 for initial load). Whatever you return in the url function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).

          +

          The error and success functions (if present) also fire in the context of the tree, and if you return a value in the success function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree (for example some .NET json implementations require this to work: "success" : function (data) { return data.d; }.

          +

          correct_state

          +

          A Boolean. Default is true.

          +

          If this option is set to true if an AJAX returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).

          +

          progressive_render

          +

          A Boolean. Default is false.

          +

          If this option is set to true only the visible (open nodes) parts of the returned JSON are converted to DOM nodes, any hidden parts are saved away and parsed ondemand (when a node becomes visible). This is useful when you have a large nested tree which would result in a heavy DOM.

          +

          progressive_unload

          +

          A Boolean. Default is false.

          +

          If this option is set to true when a node is closed its children are removed from the DOM and saved as metadata on the node itself, on reopen that metadata is used (much like progressive_render).

          + +

          NOTE:
          If both data and ajax are set the initial tree is rendered from the data string. When opening a closed node (that has no loaded children) an AJAX request is made.

          +
          + +

          Demos

          +
          + +

          Using the data config option

          +
          + + +

          Using the ajax config option

          +
          + + +

          Using the progressive render config option

          +
          + + +

          Using both the data & ajax config options

          +
          + +
          + +

          API

          +
          +

          Both dummy functions - _is_loaded and load_node are overwritten.

          +

          .load_node_json ( node , success_callback , error_callback )

          +

          This function is called instead of load_node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use -1 for root nodes.

            +
          • +
          • + function success_callback +

            A function to be executed once the node is loaded successfully - used internally. You should wait for the load_node event.

            +
          • +
          • + function error_callback +

            A function to be executed if the node is not loaded due to an error - used internally. You should wait for the load_node event.

            +
          • +
          +

          ._parse_json ( data , node , is_callback )

          +

          This function converts JSON nodes to the DOM structure required by jstree. Returns a jQuery object.

          +
            +
          • + mixed node +

            This can be a tree node in the JSON format described above, or an array of such JSON nodes, may also be a string.

            +
          • +
          • + mixed node +

            This is the DOM node, jQuery node or selector pointing to the element for which data is parsed. -1 means root nodes.

            +
          • +
          • + bool is_callback +

            Specifies if the function is called recursively - used ONLY internally.

            +
          • +
          +

          .get_json ( node , li_attr , a_attr )

          +

          This function returns an array of tree nodes converted back to JSON.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element you want returned. Use -1 or omit to get the whole tree.

            +
          • +
          • + array li_attr +

            The attributes to collect from the LI node. Defaults to [ "id" , "class" ]

            +
          • +
          • + array a_attr +

            The attributes to collect from the A node. Defaults to [ ]

            +
          • +
          • + boolean is_callback +

            Used internally.

            +
          • +
          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/languages.html b/shop/jstree/_docs/languages.html new file mode 100644 index 000000000..73c10344c --- /dev/null +++ b/shop/jstree/_docs/languages.html @@ -0,0 +1,152 @@ + + + + + jsTree v.1.0 - languages documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          languages plugin

          +

          Description

          +
          +

          The languages plugin enables multilanguage trees. This means that each node has a specified number of titles - each in a different "language". Only one language set is visible at any given time. This is useful for maintaining the same structure in many languages (hence the name of the plugin)

          +
          + +

          Configuration

          +
          +

          Expects an array of language codes. Each of the items is used as a CSS class name, so make sure you specify only valid CSS class name strings. The first langauge will be visible onload. For example:

          +

          [ "en", "de", "bg" ]

          +
          + +

          Demos

          +
          +

          Check your data plugin documentation (html_data, xml_data, json_data) or take a close look at these examples for information on how to specify multilanguage nodes.

          + +

          Using the languages plugin with HTML data

          + + + + + + + +
          + +

          API

          +
          + +

          .set_lang ( lang )

          +

          Set the tree's visible language. Triggers an event.

          +
            +
          • + string
            number
            lang +

            Either the language code string (as specified in the config) or an index from the config array.

            +
          • +
          +

          .get_lang ( )

          +

          Returns the name of the currently visible language.

          + +

          ._get_string ( node , lang )

          +

          Returns the needed string from the core config object. Overwrites the get_string function from the core. If the key does not exist in that language, but exists in the root of the object - that is returned, if even that does not exist - the key itself is returned.

          +
            +
          • + string key +

            The name of the string you are looking for. If you want to use the localize option just set the strings core config option to an object like this one: strings : { "lang-code-here" : { "string-key" : "string-value" ... }, "other-lang" : { ... } }, otherwise _get_strings won't be affected.

            +
          • +
          • + string lang +

            The language code string (as specified in the config) to get the key in. If not specified the currently visible language is used.

            +
          • +
          + +

          .get_text ( node , lang )

          +

          Returns the title of a node. Overwrites the get_text function from the core.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element whose title you need.

            +
          • +
          • + string lang +

            The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.

            +
          • +
          + +

          .set_text ( node , text , lang )

          +

          Sets the title of a node. Overwrites the set_text function from the core. This is used internally - you should use rename_node. Since rename_node uses set_text internally you can pass a language string as a third parameter to rename_node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.

            +
          • +
          • + string text +

            The new title.

            +
          • +
          • + string lang +

            The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.

            +
          • +
          + +

          ._load_css ( )

          +

          used only internally to include the CSS necessary for the plugin onload.

          + +

          .create_node ( obj , position , js , callback )

          +

          Overwrites the create_node function from the core. To create a node with a few titles use an array for the data property of the js parameter:

          +

          { "data" : [ { "title" : "EN title", language : "en" }, { "title" : "BG заглавие", language : "bg" } ] }

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/logo.png b/shop/jstree/_docs/logo.png new file mode 100644 index 000000000..9f7a35be1 Binary files /dev/null and b/shop/jstree/_docs/logo.png differ diff --git a/shop/jstree/_docs/search.html b/shop/jstree/_docs/search.html new file mode 100644 index 000000000..4040832e9 --- /dev/null +++ b/shop/jstree/_docs/search.html @@ -0,0 +1,153 @@ + + + + + jsTree v.1.0 - Search documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          search plugin

          +

          Description

          +
          +

          The search plugin enables searching for nodes whose title contains a given string, works on async trees too. All found nodes get the jstree-search class applied to their contained a nodes - you can use that class to style search results.

          +
          + +

          Configuration

          +
          + +

          search_method

          +

          A string. Default is "contains".

          +

          The method to use for searching. The other options bundled with jstree are "jstree_contains" (case insensitive search) and "jstree_title_contains" (case insensitive based on the title tag of the A node). For multiple word search take a look this: https://github.com/vakata/jstree/issues/10 - you can easily write your own method too.

          + +

          show_only_matches

          +

          A boolean. Default is false.

          +

          If set to true all non-matching nodes are hidden and only the matching nodes (and their parents) are left visible, until the search is cleared. Keep in mind show_only_matches is heavy on the browser/DOM and is still experimental.

          + +

          ajax

          +

          An object (or false if not used). Default is false.

          +

          This object can be used to make a request to the server on each search - useful if you are using async trees. That way you can return an array of IDs that need to be loaded before the actual DOM search is performed (so that all the nodes that will match the search are loaded). For example if the user searches for "string", you get that on the server side, check the database and find out that there is a node containing that string. But the node is the child of some other node, etc - so in your response you must return the path to the node (without the node itself) as ids: ["#root_node","#child_node_3"]. This means that jstree will load those two nodes before doing the client side search, ensuring that your node will be visible.

          +

          The ajax config object is pretty much the same as the jQuery ajax settings object.

          +

          You can set the data option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the search string as a paramater. Whatever you return in the function will be sent to the server as data.

          +

          You can set the url option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the search string as a paramater. Whatever you return in the function will be used as the URL of the ajax request.

          +

          The error and success functions (if present) also fire in the context of the tree, and if you return a value in the success function it will be used as the array of IDs.

          + +
          + +

          Demos

          +
          + +

          Searching nodes

          +

          Do not open the node - instead - just press the button.

          + +
          + + +

          Using adv_search

          +

          Try pressing the buttons. It will also work with AJAX searching.

          + + + + + + + +
          + +

          API

          +
          + + +

          Searches for nodes matching the supplied string. Triggers an event.

          +
            +
          • + string str +

            The string to search for.

            +
          • +
          • + boolean skip_async +

            If set to true - skip the async search (if setup in the config). This is used mostly internally.

            +
          • +
          + + +

          Clears the current search. This function is automatically called when doing a new search. Triggers an event.

          + +

          ._search_open ( is_callback )

          +

          Used internally if async is setup in the config. This functions loads the nodes returned by the server one by one.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/sort.html b/shop/jstree/_docs/sort.html new file mode 100644 index 000000000..9d3a8ae55 --- /dev/null +++ b/shop/jstree/_docs/sort.html @@ -0,0 +1,85 @@ + + + + + jsTree v.1.0 - sort documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          sort plugin

          +

          Description

          +
          +

          The sort enables jstree to automatically sort all nodes using a specified function. This means that when the user creates, renames or moves nodes around - they will automatically sort.

          +
          + +

          Configuration

          +
          + +

          Expects a function. The functions receives two arguments - two nodes to be compared. Return -1 or 1 (or any other different from -1). Default is:

          +

          function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; }

          + +
          + +

          Demos

          +
          +

          Using the sort plugin

          + +
          + +
          + + +
          + +

          API

          +
          + +

          .sort ( node )

          +

          Sorts the children of the specified node - this function is called automatically.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element.

            +
          • +
          +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/syntax/!script.js b/shop/jstree/_docs/syntax/!script.js new file mode 100644 index 000000000..3796b0134 --- /dev/null +++ b/shop/jstree/_docs/syntax/!script.js @@ -0,0 +1,2232 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { + +// Shortcut object which will be assigned to the SyntaxHighlighter variable. +// This is a shorthand for local reference in order to avoid long namespace +// references to SyntaxHighlighter.whatever... +var sh = { + defaults : { + /** Additional CSS class names to be added to highlighter elements. */ + 'class-name' : '', + + /** First line number. */ + 'first-line' : 1, + + /** + * Pads line numbers. Possible values are: + * + * false - don't pad line numbers. + * true - automaticaly pad numbers with minimum required number of leading zeroes. + * [int] - length up to which pad line numbers. + */ + 'pad-line-numbers' : true, + + /** Lines to highlight. */ + 'highlight' : null, + + /** Enables or disables smart tabs. */ + 'smart-tabs' : true, + + /** Gets or sets tab size. */ + 'tab-size' : 4, + + /** Enables or disables gutter. */ + 'gutter' : true, + + /** Enables or disables toolbar. */ + 'toolbar' : true, + + /** Forces code view to be collapsed. */ + 'collapse' : false, + + /** Enables or disables automatic links. */ + 'auto-links' : true, + + /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ + 'light' : false, + + /** Enables or disables automatic line wrapping. */ + 'wrap-lines' : true, + + 'html-script' : false + }, + + config : { + /** Enables use of tags. */ + scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } + }, + + toolbar : { + /** + * Creates new toolbar for a highlighter. + * @param {Highlighter} highlighter Target highlighter. + */ + create : function(highlighter) + { + var div = document.createElement('DIV'), + items = sh.toolbar.items + ; + + div.className = 'toolbar'; + + for (var name in items) + { + var constructor = items[name], + command = new constructor(highlighter), + element = command.create() + ; + + highlighter.toolbarCommands[name] = command; + + if (element == null) + continue; + + if (typeof(element) == 'string') + element = sh.toolbar.createButton(element, highlighter.id, name); + + element.className += 'item ' + name; + div.appendChild(element); + } + + return div; + }, + + /** + * Create a standard anchor button for the toolbar. + * @param {String} label Label text to display. + * @param {String} highlighterId Highlighter ID that this button would belong to. + * @param {String} commandName Command name that would be executed. + * @return {Element} Returns an 'A' element. + */ + createButton : function(label, highlighterId, commandName) + { + var a = document.createElement('a'), + style = a.style, + config = sh.config, + width = config.toolbarItemWidth, + height = config.toolbarItemHeight + ; + + a.href = '#' + commandName; + a.title = label; + a.highlighterId = highlighterId; + a.commandName = commandName; + a.innerHTML = label; + + if (isNaN(width) == false) + style.width = width + 'px'; + + if (isNaN(height) == false) + style.height = height + 'px'; + + a.onclick = function(e) + { + try + { + sh.toolbar.executeCommand( + this, + e || window.event, + this.highlighterId, + this.commandName + ); + } + catch(e) + { + sh.utils.alert(e.message); + } + + return false; + }; + + return a; + }, + + /** + * Executes a toolbar command. + * @param {Element} sender Sender element. + * @param {MouseEvent} event Original mouse event object. + * @param {String} highlighterId Highlighter DIV element ID. + * @param {String} commandName Name of the command to execute. + * @return {Object} Passes out return value from command execution. + */ + executeCommand : function(sender, event, highlighterId, commandName, args) + { + var highlighter = sh.vars.highlighters[highlighterId], + command + ; + + if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null) + return null; + + return command.execute(sender, event, args); + }, + + /** Collection of toolbar items. */ + items : { + expandSource : function(highlighter) + { + this.create = function() + { + if (highlighter.getParam('collapse') != true) + return; + + return sh.config.strings.expandSource; + }; + + this.execute = function(sender, event, args) + { + var div = highlighter.div; + + sender.parentNode.removeChild(sender); + div.className = div.className.replace('collapsed', ''); + }; + }, + + /** + * Command to open a new window and display the original unformatted source code inside. + */ + viewSource : function(highlighter) + { + this.create = function() + { + return sh.config.strings.viewSource; + }; + + this.execute = function(sender, event, args) + { + var code = sh.utils.fixInputString(highlighter.originalCode).replace(/' + code + ''); + wnd.document.close(); + }; + }, + + /** + * Command to copy the original source code in to the clipboard. + * Uses Flash method if clipboardSwf is configured. + */ + copyToClipboard : function(highlighter) + { + var flashDiv, flashSwf, + highlighterId = highlighter.id + ; + + this.create = function() + { + var config = sh.config; + + // disable functionality if running locally + if (config.clipboardSwf == null) + return null; + + function params(list) + { + var result = ''; + + for (var name in list) + result += ""; + + return result; + }; + + function attributes(list) + { + var result = ''; + + for (var name in list) + result += " " + name + "='" + list[name] + "'"; + + return result; + }; + + var args1 = { + width : config.toolbarItemWidth, + height : config.toolbarItemHeight, + id : highlighterId + '_clipboard', + type : 'application/x-shockwave-flash', + title : sh.config.strings.copyToClipboard + }, + + // these arguments are used in IE's collection + args2 = { + allowScriptAccess : 'always', + wmode : 'transparent', + flashVars : 'highlighterId=' + highlighterId, + menu : 'false' + }, + swf = config.clipboardSwf, + html + ; + + if (/msie/i.test(navigator.userAgent)) + { + html = '' + + params(args2) + + params({ movie : swf }) + + '' + ; + } + else + { + html = '' + ; + } + + flashDiv = document.createElement('div'); + flashDiv.innerHTML = html; + + return flashDiv; + }; + + this.execute = function(sender, event, args) + { + var command = args.command; + + switch (command) + { + case 'get': + var code = sh.utils.unindent( + sh.utils.fixInputString(highlighter.originalCode) + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') + ); + + if(window.clipboardData) + // will fall through to the confirmation because there isn't a break + window.clipboardData.setData('text', code); + else + return sh.utils.unindent(code); + + case 'ok': + sh.utils.alert(sh.config.strings.copyToClipboardConfirmation); + break; + + case 'error': + sh.utils.alert(args.message); + break; + } + }; + }, + + /** Command to print the colored source code. */ + printSource : function(highlighter) + { + this.create = function() + { + return sh.config.strings.print; + }; + + this.execute = function(sender, event, args) + { + var iframe = document.createElement('IFRAME'), + doc = null + ; + + // make sure there is never more than one hidden iframe created by SH + if (sh.vars.printFrame != null) + document.body.removeChild(sh.vars.printFrame); + + sh.vars.printFrame = iframe; + + // this hides the iframe + iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; + + document.body.appendChild(iframe); + doc = iframe.contentWindow.document; + + copyStyles(doc, window.document); + doc.write('
          ' + highlighter.div.innerHTML + '
          '); + doc.close(); + + iframe.contentWindow.focus(); + iframe.contentWindow.print(); + + function copyStyles(destDoc, sourceDoc) + { + var links = sourceDoc.getElementsByTagName('link'); + + for(var i = 0; i < links.length; i++) + if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href)) + destDoc.write(''); + }; + }; + }, + + /** Command to display the about dialog window. */ + about : function(highlighter) + { + this.create = function() + { + return sh.config.strings.help; + }; + + this.execute = function(sender, event) + { + var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'), + doc = wnd.document + ; + + doc.write(sh.config.strings.aboutDialog); + doc.close(); + wnd.focus(); + }; + } + } + }, + + utils : { + /** + * Finds an index of element in the array. + * @ignore + * @param {Object} searchElement + * @param {Number} fromIndex + * @return {Number} Returns index of element if found; -1 otherwise. + */ + indexOf : function(array, searchElement, fromIndex) + { + fromIndex = Math.max(fromIndex || 0, 0); + + for (var i = fromIndex; i < array.length; i++) + if(array[i] == searchElement) + return i; + + return -1; + }, + + /** + * Generates a unique element ID. + */ + guid : function(prefix) + { + return prefix + Math.round(Math.random() * 1000000).toString(); + }, + + /** + * Merges two objects. Values from obj2 override values in obj1. + * Function is NOT recursive and works only for one dimensional objects. + * @param {Object} obj1 First object. + * @param {Object} obj2 Second object. + * @return {Object} Returns combination of both objects. + */ + merge: function(obj1, obj2) + { + var result = {}, name; + + for (name in obj1) + result[name] = obj1[name]; + + for (name in obj2) + result[name] = obj2[name]; + + return result; + }, + + /** + * Attempts to convert string to boolean. + * @param {String} value Input string. + * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise. + */ + toBoolean: function(value) + { + switch (value) + { + case "true": + return true; + + case "false": + return false; + } + + return value; + }, + + /** + * Opens up a centered popup window. + * @param {String} url URL to open in the window. + * @param {String} name Popup name. + * @param {int} width Popup width. + * @param {int} height Popup height. + * @param {String} options window.open() options. + * @return {Window} Returns window instance. + */ + popup: function(url, name, width, height, options) + { + var x = (screen.width - width) / 2, + y = (screen.height - height) / 2 + ; + + options += ', left=' + x + + ', top=' + y + + ', width=' + width + + ', height=' + height + ; + options = options.replace(/^,/, ''); + + var win = window.open(url, name, options); + win.focus(); + return win; + }, + + /** + * Adds event handler to the target object. + * @param {Object} obj Target object. + * @param {String} type Name of the event. + * @param {Function} func Handling function. + */ + addEvent: function(obj, type, func) + { + if (obj.attachEvent) + { + obj['e' + type + func] = func; + obj[type + func] = function() + { + obj['e' + type + func](window.event); + } + obj.attachEvent('on' + type, obj[type + func]); + } + else + { + obj.addEventListener(type, func, false); + } + }, + + /** + * Displays an alert. + * @param {String} str String to display. + */ + alert: function(str) + { + alert(sh.config.strings.alert + str) + }, + + /** + * Finds a brush by its alias. + * + * @param {String} alias Brush alias. + * @param {Boolean} alert Suppresses the alert if false. + * @return {Brush} Returns bursh constructor if found, null otherwise. + */ + findBrush: function(alias, alert) + { + var brushes = sh.vars.discoveredBrushes, + result = null + ; + + if (brushes == null) + { + brushes = {}; + + // Find all brushes + for (var brush in sh.brushes) + { + var aliases = sh.brushes[brush].aliases; + + if (aliases == null) + continue; + + // keep the brush name + sh.brushes[brush].name = brush.toLowerCase(); + + for (var i = 0; i < aliases.length; i++) + brushes[aliases[i]] = brush; + } + + sh.vars.discoveredBrushes = brushes; + } + + result = sh.brushes[brushes[alias]]; + + if (result == null && alert != false) + sh.utils.alert(sh.config.strings.noBrush + alias); + + return result; + }, + + /** + * Executes a callback on each line and replaces each line with result from the callback. + * @param {Object} str Input string. + * @param {Object} callback Callback function taking one string argument and returning a string. + */ + eachLine: function(str, callback) + { + var lines = str.split('\n'); + + for (var i = 0; i < lines.length; i++) + lines[i] = callback(lines[i]); + + return lines.join('\n'); + }, + + /** + * This is a special trim which only removes first and last empty lines + * and doesn't affect valid leading space on the first line. + * + * @param {String} str Input string + * @return {String} Returns string without empty first and last lines. + */ + trimFirstAndLastLines: function(str) + { + return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, ''); + }, + + /** + * Parses key/value pairs into hash object. + * + * Understands the following formats: + * - name: word; + * - name: [word, word]; + * - name: "string"; + * - name: 'string'; + * + * For example: + * name1: value; name2: [value, value]; name3: 'value' + * + * @param {String} str Input string. + * @return {Object} Returns deserialized object. + */ + parseParams: function(str) + { + var match, + result = {}, + arrayRegex = new XRegExp("^\\[(?(.*?))\\]$"), + regex = new XRegExp( + "(?[\\w-]+)" + + "\\s*:\\s*" + + "(?" + + "[\\w-%#]+|" + // word + "\\[.*?\\]|" + // [] array + '".*?"|' + // "" string + "'.*?'" + // '' string + ")\\s*;?", + "g" + ) + ; + + while ((match = regex.exec(str)) != null) + { + var value = match.value + .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings + ; + + // try to parse array value + if (value != null && arrayRegex.test(value)) + { + var m = arrayRegex.exec(value); + value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : []; + } + + result[match.name] = value; + } + + return result; + }, + + /** + * Wraps each line of the string into tag with given style applied to it. + * + * @param {String} str Input string. + * @param {String} css Style name to apply to the string. + * @return {String} Returns input string with each line surrounded by tag. + */ + decorate: function(str, css) + { + if (str == null || str.length == 0 || str == '\n') + return str; + + str = str.replace(/... to them so that + // leading spaces aren't included. + if (css != null) + str = sh.utils.eachLine(str, function(line) + { + if (line.length == 0) + return ''; + + var spaces = ''; + + line = line.replace(/^( | )+/, function(s) + { + spaces = s; + return ''; + }); + + if (line.length == 0) + return spaces; + + return spaces + '' + line + ''; + }); + + return str; + }, + + /** + * Pads number with zeros until it's length is the same as given length. + * + * @param {Number} number Number to pad. + * @param {Number} length Max string length with. + * @return {String} Returns a string padded with proper amount of '0'. + */ + padNumber : function(number, length) + { + var result = number.toString(); + + while (result.length < length) + result = '0' + result; + + return result; + }, + + /** + * Measures width of a single space character. + * @return {Number} Returns width of a single space character. + */ + measureSpace : function() + { + var container = document.createElement('div'), + span, + result = 0, + body = document.body, + id = sh.utils.guid('measureSpace'), + + // variable names will be compressed, so it's better than a plain string + divOpen = '
          ' + + divOpen + 'lines">' + + divOpen + 'line">' + + divOpen + 'content' + + '"> ' + closeSpan + closeSpan + + closeDiv + + closeDiv + + closeDiv + + closeDiv + ; + + body.appendChild(container); + span = document.getElementById(id); + + if (/opera/i.test(navigator.userAgent)) + { + var style = window.getComputedStyle(span, null); + result = parseInt(style.getPropertyValue("width")); + } + else + { + result = span.offsetWidth; + } + + body.removeChild(container); + + return result; + }, + + /** + * Replaces tabs with spaces. + * + * @param {String} code Source code. + * @param {Number} tabSize Size of the tab. + * @return {String} Returns code with all tabs replaces by spaces. + */ + processTabs : function(code, tabSize) + { + var tab = ''; + + for (var i = 0; i < tabSize; i++) + tab += ' '; + + return code.replace(/\t/g, tab); + }, + + /** + * Replaces tabs with smart spaces. + * + * @param {String} code Code to fix the tabs in. + * @param {Number} tabSize Number of spaces in a column. + * @return {String} Returns code with all tabs replaces with roper amount of spaces. + */ + processSmartTabs : function(code, tabSize) + { + var lines = code.split('\n'), + tab = '\t', + spaces = '' + ; + + // Create a string with 1000 spaces to copy spaces from... + // It's assumed that there would be no indentation longer than that. + for (var i = 0; i < 50; i++) + spaces += ' '; // 20 spaces * 50 + + // This function inserts specified amount of spaces in the string + // where a tab is while removing that given tab. + function insertSpaces(line, pos, count) + { + return line.substr(0, pos) + + spaces.substr(0, count) + + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab + ; + }; + + // Go through all the lines and do the 'smart tabs' magic. + code = sh.utils.eachLine(code, function(line) + { + if (line.indexOf(tab) == -1) + return line; + + var pos = 0; + + while ((pos = line.indexOf(tab)) != -1) + { + // This is pretty much all there is to the 'smart tabs' logic. + // Based on the position within the line and size of a tab, + // calculate the amount of spaces we need to insert. + var spaces = tabSize - pos % tabSize; + line = insertSpaces(line, pos, spaces); + } + + return line; + }); + + return code; + }, + + /** + * Performs various string fixes based on configuration. + */ + fixInputString : function(str) + { + var br = /|<br\s*\/?>/gi; + + if (sh.config.bloggerMode == true) + str = str.replace(br, '\n'); + + if (sh.config.stripBrs == true) + str = str.replace(br, ''); + + return str; + }, + + /** + * Removes all white space at the begining and end of a string. + * + * @param {String} str String to trim. + * @return {String} Returns string without leading and following white space characters. + */ + trim: function(str) + { + return str.replace(/^\s+|\s+$/g, ''); + }, + + /** + * Unindents a block of text by the lowest common indent amount. + * @param {String} str Text to unindent. + * @return {String} Returns unindented text block. + */ + unindent: function(str) + { + var lines = sh.utils.fixInputString(str).split('\n'), + indents = new Array(), + regex = /^\s*/, + min = 1000 + ; + + // go through every line and check for common number of indents + for (var i = 0; i < lines.length && min > 0; i++) + { + var line = lines[i]; + + if (sh.utils.trim(line).length == 0) + continue; + + var matches = regex.exec(line); + + // In the event that just one line doesn't have leading white space + // we can't unindent anything, so bail completely. + if (matches == null) + return str; + + min = Math.min(matches[0].length, min); + } + + // trim minimum common number of white space from the begining of every line + if (min > 0) + for (var i = 0; i < lines.length; i++) + lines[i] = lines[i].substr(min); + + return lines.join('\n'); + }, + + /** + * Callback method for Array.sort() which sorts matches by + * index position and then by length. + * + * @param {Match} m1 Left object. + * @param {Match} m2 Right object. + * @return {Number} Returns -1, 0 or -1 as a comparison result. + */ + matchesSortCallback: function(m1, m2) + { + // sort matches by index first + if(m1.index < m2.index) + return -1; + else if(m1.index > m2.index) + return 1; + else + { + // if index is the same, sort by length + if(m1.length < m2.length) + return -1; + else if(m1.length > m2.length) + return 1; + } + + return 0; + }, + + /** + * Executes given regular expression on provided code and returns all + * matches that are found. + * + * @param {String} code Code to execute regular expression on. + * @param {Object} regex Regular expression item info from regexList collection. + * @return {Array} Returns a list of Match objects. + */ + getMatches: function(code, regexInfo) + { + function defaultAdd(match, regexInfo) + { + return [new sh.Match(match[0], match.index, regexInfo.css)]; + }; + + var index = 0, + match = null, + result = [], + func = regexInfo.func ? regexInfo.func : defaultAdd + ; + + while((match = regexInfo.regex.exec(code)) != null) + result = result.concat(func(match, regexInfo)); + + return result; + }, + + processUrls: function(code) + { + var lt = '<', + gt = '>' + ; + + return code.replace(sh.regexLib.url, function(m) + { + var suffix = '', prefix = ''; + + // We include < and > in the URL for the common cases like + // The problem is that they get transformed into <http://google.com> + // Where as > easily looks like part of the URL string. + + if (m.indexOf(lt) == 0) + { + prefix = lt; + m = m.substring(lt.length); + } + + if (m.indexOf(gt) == m.length - gt.length) + { + m = m.substring(0, m.length - gt.length); + suffix = gt; + } + + return prefix + '' + m + '' + suffix; + }); + }, + + /** + * Finds all + + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          themeroller plugin

          +

          Description

          +
          +

          The themeroller plugin adds support for jQuery UI's themes. Add the plugin as last in your plugins config option. Also make sure that you have included the jquery theme you'd like to use and you should NOT use the native jstree themes plugin.

          +

          If using the search plugin - bind to "search.jstree" to style the found nodes, or apply some styles to the .jstree-search class (which is added by default) but make sure the selector is stronger than your current theme or use !important

          +
          + +

          Configuration

          +
          +

          opened

          +

          A string. Default is "ui-icon-triangle-1-se".

          +

          The class name to use for open nodes (shows the arrow to close).

          + +

          closed

          +

          A string. Default is "ui-icon-triangle-1-e".

          +

          The class name to use for closed nodes (shows the arrow to open).

          + +

          item

          +

          A string. Default is "ui-state-default".

          +

          The class name to use for the actual items.

          + +

          item_h

          +

          A string. Default is "ui-state-hover".

          +

          The class name to use for the hovered item.

          + +

          item_a

          +

          A string. Default is "ui-state-active".

          +

          The class name to use for selected items (UI plugin).

          + +

          item_open

          +

          A string. Default is "ui-icon-folder-open".

          +

          The class name to use for the opened items. If set to false the icon is not shown.

          +

          item_clsd

          +

          A string. Default is "ui-icon-folder-collapsed".

          +

          The class name to use for the opened items. If set to false the icon is not shown.

          +

          item_leaf

          +

          A string. Default is "ui-icon-document".

          +

          The class name to use for the opened items. If set to false the icon is not shown.

          + + +
          + +

          Demos

          +
          + +

          Using the themeroller plugin

          +
          + +
          + + +
          + +

          API

          +
          + +

          ._themeroller ( obj )

          +

          Fixes the tree on various events by applying the configured classes - used internally only.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/themes.html b/shop/jstree/_docs/themes.html new file mode 100644 index 000000000..e4c4d6272 --- /dev/null +++ b/shop/jstree/_docs/themes.html @@ -0,0 +1,127 @@ + + + + + jsTree v.1.0 - themes documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          themes plugin

          +

          Description

          +
          +

          The themes plugin controls the looks of jstree - without this plugin you will get a functional tree, but it will look just like an ordinary UL list.

          +
          + +

          Configuration

          +
          +

          theme

          +

          A string. Default is "default".

          +

          The name of the theme to use to style the tree.

          + +

          url

          +

          A string (or false if not used). Default is false.

          +

          The location of the theme's CSS file, if set to false jstree will look for the file in < theme folder >/themes/< theme name >/style.css. You can set the theme folder using $.jstree._themes = "PATH/TO/FOLDER/";, otherwise it is autodetected as <jquery.tree.js location>/themes/.

          + +

          dots

          +

          A Boolean. Default is true.

          +

          Whether to show the connecting dots or not.

          + +

          icons

          +

          A Boolean. Default is true.

          +

          Whether to show the node icons or not.

          + +
          + +

          Demos

          +
          + +

          Using the themes plugin

          + + + + +
          + +
          + + +
          + +

          API

          +
          + +

          .set_theme ( name , url )

          +

          Set the tree's theme. Triggers an event.

          +
            +
          • + string name +

            The name of the theme to use to style the tree.

            +
          • +
          • + string url +

            The location of the theme's CSS file, if omitted jstree will look for the file in:
            < theme folder >/themes/< name >/style.css.
            You can set the theme folder using:
            $.jstree._themes = "PATH/TO/FOLDER/";, otherwise it is autodetected as <jquery.tree.js location>/themes/.

            +
          • +
          +

          .get_theme ( )

          +

          Returns the name of the currently active theme.

          + +
            
          +

          .show_dots ( ), .hide_dots ( ), .toggle_dots ( )

          +

          Show, hide or toggle the visibility of the dots connecting the tree's nodes.

          + +
            
          +

          .show_icons ( ), .hide_icons ( ), .toggle_icons ( )

          +

          Show, hide or toggle the visibility of the icons next to the title of each the tree node.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/types.html b/shop/jstree/_docs/types.html new file mode 100644 index 000000000..eb2c448e6 --- /dev/null +++ b/shop/jstree/_docs/types.html @@ -0,0 +1,178 @@ + + + + + jsTree v.1.0 - types documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          types plugin

          +

          Description

          +
          +

          The types enables node types - each node can have a type, and you can define rules on how that type should behave - maximum children count, maximum depth, valid children types, selectable or not, etc.

          +
          + +

          Configuration

          +
          + +

          max_children

          +

          A number. Default is -1.

          +

          Defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking in the tree).

          + +

          max_depth

          +

          A number. Default is -1.

          +

          Defines maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking in the tree).

          + +

          valid_children

          +

          A string or array. Default is "all".

          +

          Defines valid root node types (could be "all", "none", or an array of type strings).

          + +

          use_data

          +

          A boolean. Default is false.

          +

          If set to true jstree will check every node for $.metadata or $.data for rules (valid_children, max_depth & the function rules). Keep in mind jstree will look for this data in $("li-node-here").metadata().jstree.rule_name (or $.data respectively).

          + +

          type_attr

          +

          A string. Default is "rel".

          +

          Defines the attribute on each li node, where the type attribute will be stored. For correct usage in IE - do not assign to "type" - it triggers an IE bug.

          + +

          types

          +

          An object.

          +

          Defines all the active types in the tree. Each key is the type name, and each value represents the rules for this type. A default type is defined - all nodes with no explicit type set are treated as if they were of the default type.

          +
          +
          +types : {
          +	// the default type
          +	"default" : {
          +		"max_children"	: -1,
          +		"max_depth"		: -1,
          +		"valid_children": "all"
          +
          +		// Bound functions - you can bind any other function here (using boolean or function)
          +		//"select_node"	: true,
          +		//"open_node"	: true,
          +		//"close_node"	: true,
          +		//"create_node"	: true,
          +		//"delete_node"	: true
          +	}
          +}
          +
          +
          +

          For max_children, max_depth & valid_children use the same values as for the tree, but the value you set will only apply for that node type.

          +

          You can set an icon key - it should be an object consisting of two keys - image (string - location of the image to be used as an icon) & position (string - left and top pixels of the image - 10px 40px, only useful when using sprites - omit otherwise).

          +

          You can set more keys in that object - each key should be a function name, and each value - either a boolean (in order to allow or disallow that operation, on that node type) or a function. If you supply a function - your function will be called with two arguments - the name of the called function (the key) and the arguments passed to that function - you can then decide whether to return true or false.

          +

          For any type - for now you can control only functions that take the node being manipulated as the first argument.

          + +
          + +

          Demos

          +
          +

          Using the types plugin

          + +
          + +
          + + +
          + +

          API

          +
          + +

          ._get_type ( node )

          +

          Get the type of a node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element.

            +
          • +
          + +

          .set_type ( type , node )

          +

          Set the type of a node. Triggers an event.

          +
            +
          • + string type +

            The new type.

            +
          • +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element.

            +
          • +
          + +

          ._check ( rule , node , opts )

          +

          Checks a rule on a give node. Used mostly internally.

          +
            +
          • + string rule +

            The rule to check.

            +
          • +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to the element.

            +
          • +
          • + mixed opts +

            Any additional options regarding the rule. Used internally.

            +
          • +
          + +
           
          +

          .create_node ( ), .check_move ( )

          +

          Both functions are overwritten to accomodate the new functionality presented by the plugin.

          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/ui.html b/shop/jstree/_docs/ui.html new file mode 100644 index 000000000..1f8ef4593 --- /dev/null +++ b/shop/jstree/_docs/ui.html @@ -0,0 +1,197 @@ + + + + + jsTree v.1.0 - UI documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          ui plugin

          +

          Description

          +
          +

          The UI plugin handles selecting, deselecting and hovering tree items.

          +
          + +

          Configuration

          +
          +

          select_limit

          +

          A number. Default is -1.

          +

          Defines how many nodes can be selected at a given time (-1 means unlimited).

          + +

          select_multiple_modifier

          +

          A string. Default is "ctrl".

          +

          The special key used to make a click add to the selection and not replace it ("ctrl", "shift", "alt", "meta").
          You can also set this to "on" making every click add to the selection.

          + +

          select_range_modifier

          +

          A string. Default is "shift".

          +

          The special key used to make a click expand a range from the last selected item ("ctrl", "shift", "alt", "meta").
          Note that the last clicked elemtn should be a sibling of the currently clicked element so that a range will be created (same as common file explorers).

          + +

          selected_parent_close

          +

          A string (or false). Default is "select_parent".

          +

          What action to take when a selected node's parent is closed (making the selected node invisible). Possible values are false - do nothing, "select_parent" - select the closed node's parent and "deselect" - deselect the node.

          + +

          selected_parent_open

          +

          A Boolean. Default is true.

          +

          When set to true when programatically selecting a node in the tree all of its closed parents are opened automatically.

          + +

          select_prev_on_delete

          +

          A boolean. Default is true.

          +

          If set to true when a selected node is deleted, its previous sibling (or parent) is selected.

          + +

          disable_selecting_children

          +

          A boolean. Default is false.

          +

          If set to true you will not be able to select children of already selected nodes.

          + +

          initially_select

          +

          An array. Default is [].

          +

          Defines which nodes are to be automatically selected when the tree finishes loading - a list of IDs is expected.

          + +
          + +

          Demos

          +
          + +

          Using the UI plugin

          +
          + +
          + + +
          + +

          API

          +
          + +

          ._get_node ( node , allow_multiple )

          +

          Overrides the function from the core module.
          if node is undefined or null and allow_multiple is true all the currently selected nodes are returned
          if node is undefined or null and allow_multiple is NOT true only the last selected node is returned.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          • + boolean allow_multiple +

            Whether to return all selected nodes or only the last selected one if node is null.

            +
          • +
          + +

          .save_selected ( )

          +

          Saves away the current selection state of the tree (saves it in a variable, so do not expect a restore after a refresh - for that functionality refer to the cookies plugin. Used mostly internally. Triggers an event.

          + +

          .reselect ( )

          +

          Restores the state of the tree using the variable saved in the above function. Used mostly internally. Triggers an event.

          + +

          .refresh ( node )

          +

          Overrides the function form the core module.
          Enables saving the selection state before the refresh and restoring it afterwards.

          + +

          .hover_node ( node )

          +

          Sets the specified node as hovered. Triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .dehover_node ( )

          +

          Removes the hover state from the currently hovered node (if there is one). Triggers an event.

          + + +

          .select_node ( node , check , event )

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          • + bool check +

            Whether to check the specified rules and do appropriate actions (check select_limit, deselect other nodes respectively, etc) or to just force selection of the node regardless of select_limit.

            +
          • +
          • + event event +

            Used internally - when a click on a node caused this function to be executed.

            +
          • +
          + +
           
          +

          .deselect_node ( node ), .toggle_select ( node )

          +

          There functions control the selected state on a node. deselect_node triggers an event.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .deselect_all ( context )

          +

          Deselects all selected nodes. If context is set - only the selected nodes within that context are deselected. Triggers an event.

          +
            +
          • + mixed context +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .get_selected ( context )

          +

          Returns all selected nodes. If context is set - only the selected nodes within that context are returned.

          +
            +
          • + mixed context +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +

          .is_selected ( node )

          +

          Returns whether the specified node is selected or not.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element within the tree.

            +
          • +
          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/unique.html b/shop/jstree/_docs/unique.html new file mode 100644 index 000000000..cfadf2e6f --- /dev/null +++ b/shop/jstree/_docs/unique.html @@ -0,0 +1,85 @@ + + + + + jsTree v.1.0 - unique documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          unique plugin

          +

          Description

          +
          +

          The unique plugin prevents from nodes with same titles coexisting (create/move/rename) in the same parent.

          +
          + +

          Configuration

          +
          + +

          error_callback

          +

          A function. Default is $.noop.

          +

          Whenever the plugin stops an action (because it violates the unique policy) this function will bre triggered in current tree's scope, receiving the name, siblings and function name that caused the conflict.

          + +
          + +

          Demos

          +
          +

          Try moving the child nodes together (drag'n'drop).

          + +

          Using the unique plugin

          +
          + +
          + + +
          + +

          API

          +
          + + +

          Used internally - checks the names array against the sibling nodes for matches.

          +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_docs/xml_data.html b/shop/jstree/_docs/xml_data.html new file mode 100644 index 000000000..30e9f13bb --- /dev/null +++ b/shop/jstree/_docs/xml_data.html @@ -0,0 +1,218 @@ + + + + + jsTree v.1.0 - xml_data documentation + + + + + + + + + + +
          + +

          jsTree v.1.0

          +

          xml_data plugin

          +

          Description

          +
          +

          The xml_data plugin enables jsTree to convert XML objects to interactive trees (using XSL). The data (XML) can be set up in the config (as a string) or retrieved from a server (also ondemand).

          +

          Two types of XML structures are supported - flat and nested:

          +
          +
          +<!-- FLAT -->
          +<root>
          +	<item id="root_1" parent_id="0" state="closed">
          +		<content>
          +			<name><![CDATA[Node 1]]></name>
          +		</content>
          +	</item>
          +	<item id="node_2" parent_id="root_1">
          +		<content>
          +			<name><![CDATA[Node 2]]></name>
          +		</content>
          +	</item>
          +</root>
          +
          +<!-- NESTED -->
          +<root>
          +	<item id="xml_1">
          +		<content><name><![CDATA[Root node 1]]></name></content>
          +		<item id="xml_2">
          +			<content><name><![CDATA[Child node 1]]></name></content>
          +		</item>
          +	</item>
          +</root>
          +
          +
          +

          Aside from nesting the only difference is the parent_id attribute used in xml_flat.

          +

          parent_id defines the parent of the node in XML flat, use 0 for root nodes. Also when using async - use 0 for the first level.

          +

          state defines the state of the node (open or closed). You can omit it too - jstree will handle the data automatically - nodes with no children will be leaf nodes, nodes with children will be closed.

          +

          All attributes you set on the item node will be transfered to the resulting li node. All attributes you set on the name node will be transfered to the resulting a node.

          +

          If you are using the languages plugin you can have multiple name nodes in a every item node, just set a language attribute on each one (<name language="en" ...).

          +

          Remember to always set the XML header on your XML files.

          +
          + +

          Configuration

          +
          +

          data

          +

          A XML string (or false if not used). Default is false.

          +

          Specifies the content to load into the container and convert to a tree.

          +

          ajax

          +

          An object (or false if not used). Default is false.

          +

          The ajax config object is pretty much the same as the jQuery ajax settings object.

          +

          You can set the data option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the node about to be open as a parameter (or -1 for initial load). Whatever you return in the function will be sent to the server as data (so for example you can send the node's ID).

          +

          You can set the url option to a function, that will be executed in the current tree's scope (this will be the tree instance) and gets the node about to be open as a paramater (or -1 for initial load). Whatever you return in the url function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).

          +

          The error and success functions (if present) also fire in the context of the tree, and if you return a value in the success function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree. Please note that the success function receives a string as the first parameter, and also if you decide to return a value - return a string.

          +

          correct_state

          +

          A Boolean. Default is true.

          +

          If this option is set to true if an AJAX returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).

          +

          clean_node

          +

          A Boolean. Default is false.

          +

          Set to true if node needs to be cleaned - usually you should leave this to false.

          +

          xsl

          +

          A string. Default is "flat".

          +

          The type of structure you wiil be using - set either to "flat" or "nest".

          +

          get_skip_empty

          +

          A Boolean. Default is false.

          +

          If set to true empty attributes won't be returned by the get_xml function.

          + +

          NOTE:
          If both data and ajax are set the initial tree is rendered from the data string. When opening a closed node (that has no loaded children) an AJAX request is made.

          +
          + +

          Demos

          +
          + +

          Using the data config option (flat)

          +
          + + +

          Using the ajax config option (nested)

          +
          + + +

          Using both the data & ajax config options (flat)

          +
          + +
          + +

          API

          +
          +

          Both dummy functions - _is_loaded and load_node are overwritten.

          +

          .load_node_xml ( node , success_callback , error_callback )

          +

          This function is called instead of load_node.

          +
            +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use -1 for root nodes.

            +
          • +
          • + function success_callback +

            A function to be executed once the node is loaded successfully - used internally. You should wait for the load_node event.

            +
          • +
          • + function error_callback +

            A function to be executed if the node is not loaded due to an error - used internally. You should wait for the load_node event.

            +
          • +
          +

          .parse_xml ( data )

          +

          This function converts XML strings or objects to the DOM structure required by jstree. Returns a jQuery object.

          +
            +
          • + mixed data +

            The XML string/object.

            +
          • +
          +

          .get_xml ( type , node , li_attr , a_attr , is_callback )

          +

          This function returns an array of tree nodes converted back to XML.

          +
            +
          • + string type +

            Either "flat" or "nest". Default is "flat".

            +
          • +
          • + mixed node +

            This can be a DOM node, jQuery node or selector pointing to an element you want returned. Use -1 or omit to get the whole tree.

            +
          • +
          • + array li_attr +

            The attributes to collect from the LI node. Defaults to [ "id" , "class" ]

            +
          • +
          • + array a_attr +

            The attributes to collect from the A node. Defaults to [ ]

            +
          • +
          • + string is_callback +

            Used internally.

            +
          • +
          + +
          + +
          + + \ No newline at end of file diff --git a/shop/jstree/_lib/jquery.cookie.js b/shop/jstree/_lib/jquery.cookie.js new file mode 100644 index 000000000..6036754e8 --- /dev/null +++ b/shop/jstree/_lib/jquery.cookie.js @@ -0,0 +1,96 @@ +/** + * Cookie plugin + * + * Copyright (c) 2006 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * Create a cookie with the given name and value and other optional parameters. + * + * @example $.cookie('the_cookie', 'the_value'); + * @desc Set the value of a cookie. + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); + * @desc Create a cookie with all available options. + * @example $.cookie('the_cookie', 'the_value'); + * @desc Create a session cookie. + * @example $.cookie('the_cookie', null); + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain + * used when the cookie was set. + * + * @param String name The name of the cookie. + * @param String value The value of the cookie. + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. + * If set to null or omitted, the cookie will be a session cookie and will not be retained + * when the the browser exits. + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * require a secure protocol (like HTTPS). + * @type undefined + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ + +/** + * Get the value of a cookie with the given name. + * + * @example $.cookie('the_cookie'); + * @desc Get the value of a cookie. + * + * @param String name The name of the cookie. + * @return The value of the cookie. + * @type String + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ +jQuery.cookie = function(name, value, options) { + if (typeof value != 'undefined') { // name and value given, set cookie + options = options || {}; + if (value === null) { + value = ''; + options.expires = -1; + } + var expires = ''; + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { + var date; + if (typeof options.expires == 'number') { + date = new Date(); + date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); + } else { + date = options.expires; + } + expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE + } + // CAUTION: Needed to parenthesize options.path and options.domain + // in the following expressions, otherwise they evaluate to undefined + // in the packed version for some reason... + var path = options.path ? '; path=' + (options.path) : ''; + var domain = options.domain ? '; domain=' + (options.domain) : ''; + var secure = options.secure ? '; secure' : ''; + document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); + } else { // only name given, get cookie + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + } +}; \ No newline at end of file diff --git a/shop/jstree/_lib/jquery.hotkeys.js b/shop/jstree/_lib/jquery.hotkeys.js new file mode 100644 index 000000000..cd62905fb --- /dev/null +++ b/shop/jstree/_lib/jquery.hotkeys.js @@ -0,0 +1,99 @@ +/* + * jQuery Hotkeys Plugin + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Based upon the plugin by Tzury Bar Yochay: + * http://github.com/tzuryby/hotkeys + * + * Original idea by: + * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ +*/ + +(function(jQuery){ + + jQuery.hotkeys = { + version: "0.8", + + specialKeys: { + 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", + 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", + 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", + 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", + 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", + 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", + 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" + }, + + shiftNums: { + "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", + "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", + ".": ">", "/": "?", "\\": "|" + } + }; + + function keyHandler( handleObj ) { + // Only care when a possible input has been specified + if ( typeof handleObj.data !== "string" ) { + return; + } + + var origHandler = handleObj.handler, + keys = handleObj.data.toLowerCase().split(" "); + + handleObj.handler = function( event ) { + // Don't fire in text-accepting inputs that we didn't directly bind to + if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || + event.target.type === "text") ) { + return; + } + + // Keypress represents characters, not special keys + var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], + character = String.fromCharCode( event.which ).toLowerCase(), + key, modif = "", possible = {}; + + // check combinations (alt|ctrl|shift+anything) + if ( event.altKey && special !== "alt" ) { + modif += "alt+"; + } + + if ( event.ctrlKey && special !== "ctrl" ) { + modif += "ctrl+"; + } + + // TODO: Need to make sure this works consistently across platforms + if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { + modif += "meta+"; + } + + if ( event.shiftKey && special !== "shift" ) { + modif += "shift+"; + } + + if ( special ) { + possible[ modif + special ] = true; + + } else { + possible[ modif + character ] = true; + possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; + + // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" + if ( modif === "shift+" ) { + possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; + } + } + + for ( var i = 0, l = keys.length; i < l; i++ ) { + if ( possible[ keys[i] ] ) { + return origHandler.apply( this, arguments ); + } + } + }; + } + + jQuery.each([ "keydown", "keyup", "keypress" ], function() { + jQuery.event.special[ this ] = { add: keyHandler }; + }); + +})( jQuery ); \ No newline at end of file diff --git a/shop/jstree/_lib/jquery.js b/shop/jstree/_lib/jquery.js new file mode 100644 index 000000000..eb6a59693 --- /dev/null +++ b/shop/jstree/_lib/jquery.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu May 12 15:04:36 2011 -0400 + */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
          a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
          ",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
          t
          ",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem +)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

          ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
          ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
          ","
          "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
          ").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
          ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/shop/jstree/jquery.jstree.js b/shop/jstree/jquery.jstree.js new file mode 100644 index 000000000..baba5e8a1 --- /dev/null +++ b/shop/jstree/jquery.jstree.js @@ -0,0 +1,4551 @@ +/* + * jsTree 1.0-rc3 + * http://jstree.com/ + * + * Copyright (c) 2010 Ivan Bozhanov (vakata.com) + * + * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $ + * $Revision: 236 $ + */ + +/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */ +/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/ + +"use strict"; + +// top wrapper to prevent multiple inclusion (is this OK?) +(function () { if(jQuery && jQuery.jstree) { return; } + var is_ie6 = false, is_ie7 = false, is_ff2 = false; + +/* + * jsTree core + */ +(function ($) { + // Common functions not related to jsTree + // decided to move them to a `vakata` "namespace" + $.vakata = {}; + // CSS related functions + $.vakata.css = { + get_css : function(rule_name, delete_flag, sheet) { + rule_name = rule_name.toLowerCase(); + var css_rules = sheet.cssRules || sheet.rules, + j = 0; + do { + if(css_rules.length && j > css_rules.length + 5) { return false; } + if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) { + if(delete_flag === true) { + if(sheet.removeRule) { sheet.removeRule(j); } + if(sheet.deleteRule) { sheet.deleteRule(j); } + return true; + } + else { return css_rules[j]; } + } + } + while (css_rules[++j]); + return false; + }, + add_css : function(rule_name, sheet) { + if($.jstree.css.get_css(rule_name, false, sheet)) { return false; } + if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); } + return $.vakata.css.get_css(rule_name); + }, + remove_css : function(rule_name, sheet) { + return $.vakata.css.get_css(rule_name, true, sheet); + }, + add_sheet : function(opts) { + var tmp = false, is_new = true; + if(opts.str) { + if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; } + if(tmp) { is_new = false; } + else { + tmp = document.createElement("style"); + tmp.setAttribute('type',"text/css"); + if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); } + } + if(tmp.styleSheet) { + if(is_new) { + document.getElementsByTagName("head")[0].appendChild(tmp); + tmp.styleSheet.cssText = opts.str; + } + else { + tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str; + } + } + else { + tmp.appendChild(document.createTextNode(opts.str)); + document.getElementsByTagName("head")[0].appendChild(tmp); + } + return tmp.sheet || tmp.styleSheet; + } + if(opts.url) { + if(document.createStyleSheet) { + try { tmp = document.createStyleSheet(opts.url); } catch (e) { } + } + else { + tmp = document.createElement('link'); + tmp.rel = 'stylesheet'; + tmp.type = 'text/css'; + tmp.media = "all"; + tmp.href = opts.url; + document.getElementsByTagName("head")[0].appendChild(tmp); + return tmp.styleSheet; + } + } + } + }; + + // private variables + var instances = [], // instance array (used by $.jstree.reference/create/focused) + focused_instance = -1, // the index in the instance array of the currently focused instance + plugins = {}, // list of included plugins + prepared_move = {}; // for the move_node function + + // jQuery plugin wrapper (thanks to jquery UI widget function) + $.fn.jstree = function (settings) { + var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node") + args = Array.prototype.slice.call(arguments, 1), + returnValue = this; + + // if a method call execute the method on all selected instances + if(isMethodCall) { + if(settings.substring(0, 1) == '_') { return returnValue; } + this.each(function() { + var instance = instances[$.data(this, "jstree_instance_id")], + methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance; + if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; } + }); + } + else { + this.each(function() { + // extend settings and allow for multiple hashes and $.data + var instance_id = $.data(this, "jstree_instance_id"), + a = [], + b = settings ? $.extend({}, true, settings) : {}, + c = $(this), + s = false, + t = []; + a = a.concat(args); + if(c.data("jstree")) { a.push(c.data("jstree")); } + b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b; + + // if an instance already exists, destroy it first + if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); } + // push a new empty object to the instances array + instance_id = parseInt(instances.push({}),10) - 1; + // store the jstree instance id to the container element + $.data(this, "jstree_instance_id", instance_id); + // clean up all plugins + b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice(); + b.plugins.unshift("core"); + // only unique plugins + b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","); + + // extend defaults with passed data + s = $.extend(true, {}, $.jstree.defaults, b); + s.plugins = b.plugins; + $.each(plugins, function (i, val) { + if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; } + else { t.push(i); } + }); + s.plugins = t; + + // push the new object to the instances array (at the same time set the default classes to the container) and init + instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s); + // init all activated plugins for this instance + $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; }); + $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } }); + // initialize the instance + setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0); + }); + } + // return the jquery selection (or if it was a method call that returned a value - the returned value) + return returnValue; + }; + // object to store exposed functions and objects + $.jstree = { + defaults : { + plugins : [] + }, + _focused : function () { return instances[focused_instance] || null; }, + _reference : function (needle) { + // get by instance id + if(instances[needle]) { return instances[needle]; } + // get by DOM (if still no luck - return null + var o = $(needle); + if(!o.length && typeof needle === "string") { o = $("#" + needle); } + if(!o.length) { return null; } + return instances[o.closest(".jstree").data("jstree_instance_id")] || null; + }, + _instance : function (index, container, settings) { + // for plugins to store data in + this.data = { core : {} }; + this.get_settings = function () { return $.extend(true, {}, settings); }; + this._get_settings = function () { return settings; }; + this.get_index = function () { return index; }; + this.get_container = function () { return container; }; + this.get_container_ul = function () { return container.children("ul:eq(0)"); }; + this._set_settings = function (s) { + settings = $.extend(true, {}, settings, s); + }; + }, + _fn : { }, + plugin : function (pname, pdata) { + pdata = $.extend({}, { + __init : $.noop, + __destroy : $.noop, + _fn : {}, + defaults : false + }, pdata); + plugins[pname] = pdata; + + $.jstree.defaults[pname] = pdata.defaults; + $.each(pdata._fn, function (i, val) { + val.plugin = pname; + val.old = $.jstree._fn[i]; + $.jstree._fn[i] = function () { + var rslt, + func = val, + args = Array.prototype.slice.call(arguments), + evnt = new $.Event("before.jstree"), + rlbk = false; + + if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; } + + // Check if function belongs to the included plugins of this instance + do { + if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; } + func = func.old; + } while(func); + if(!func) { return; } + + // context and function to trigger events, then finally call the function + if(i.indexOf("_") === 0) { + rslt = func.apply(this, args); + } + else { + rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin }); + if(rslt === false) { return; } + if(typeof rslt !== "undefined") { args = rslt; } + + rslt = func.apply( + $.extend({}, this, { + __callback : function (data) { + this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk }); + }, + __rollback : function () { + rlbk = this.get_rollback(); + return rlbk; + }, + __call_old : function (replace_arguments) { + return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) ); + } + }), args); + } + + // return the result + return rslt; + }; + $.jstree._fn[i].old = val.old; + $.jstree._fn[i].plugin = pname; + }); + }, + rollback : function (rb) { + if(rb) { + if(!$.isArray(rb)) { rb = [ rb ]; } + $.each(rb, function (i, val) { + instances[val.i].set_rollback(val.h, val.d); + }); + } + } + }; + // set the prototype for all instances + $.jstree._fn = $.jstree._instance.prototype = {}; + + // load the css when DOM is ready + $(function() { + // code is copied from jQuery ($.browser is deprecated + there is a bug in IE) + var u = navigator.userAgent.toLowerCase(), + v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], + css_string = '' + + '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' + + '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' + + '.jstree-rtl li { margin-left:0; margin-right:18px; } ' + + '.jstree > ul > li { margin-left:0px; } ' + + '.jstree-rtl > ul > li { margin-right:0px; } ' + + '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' + + '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' + + '.jstree a:focus { outline: none; } ' + + '.jstree a > ins { height:16px; width:16px; } ' + + '.jstree a > .jstree-icon { margin-right:3px; } ' + + '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' + + 'li.jstree-open > ul { display:block; } ' + + 'li.jstree-closed > ul { display:none; } '; + // Correct IE 6 (does not support the > CSS selector) + if(/msie/.test(u) && parseInt(v, 10) == 6) { + is_ie6 = true; + + // fix image flicker and lack of caching + try { + document.execCommand("BackgroundImageCache", false, true); + } catch (err) { } + + css_string += '' + + '.jstree li { height:18px; margin-left:0; margin-right:0; } ' + + '.jstree li li { margin-left:18px; } ' + + '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' + + 'li.jstree-open ul { display:block; } ' + + 'li.jstree-closed ul { display:none !important; } ' + + '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' + + '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' + + '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } '; + } + // Correct IE 7 (shifts anchor nodes onhover) + if(/msie/.test(u) && parseInt(v, 10) == 7) { + is_ie7 = true; + css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } '; + } + // correct ff2 lack of display:inline-block + if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) { + is_ff2 = true; + css_string += '' + + '.jstree ins { display:-moz-inline-box; } ' + + '.jstree li { line-height:12px; } ' + // WHY?? + '.jstree a { display:-moz-inline-box; } ' + + '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } '; + /* this shouldn't be here as it is theme specific */ + } + // the default stylesheet + $.vakata.css.add_sheet({ str : css_string, title : "jstree" }); + }); + + // core functions (open, close, create, update, delete) + $.jstree.plugin("core", { + __init : function () { + this.data.core.locked = false; + this.data.core.to_open = this.get_settings().core.initially_open; + this.data.core.to_load = this.get_settings().core.initially_load; + }, + defaults : { + html_titles : false, + animation : 500, + initially_open : [], + initially_load : [], + open_parents : true, + notify_plugins : true, + rtl : false, + load_open : false, + strings : { + loading : "Loading ...", + new_node : "New node", + multiple_selection : "Multiple selection" + } + }, + _fn : { + init : function () { + this.set_focus(); + if(this._get_settings().core.rtl) { + this.get_container().addClass("jstree-rtl").css("direction", "rtl"); + } + this.get_container().html(""); + this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18; + + this.get_container() + .delegate("li > ins", "click.jstree", $.proxy(function (event) { + var trgt = $(event.target); + // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); } + this.toggle_node(trgt); + }, this)) + .bind("mousedown.jstree", $.proxy(function () { + this.set_focus(); // This used to be setTimeout(set_focus,0) - why? + }, this)) + .bind("dblclick.jstree", function (event) { + var sel; + if(document.selection && document.selection.empty) { document.selection.empty(); } + else { + if(window.getSelection) { + sel = window.getSelection(); + try { + sel.removeAllRanges(); + sel.collapse(); + } catch (err) { } + } + } + }); + if(this._get_settings().core.notify_plugins) { + this.get_container() + .bind("load_node.jstree", $.proxy(function (e, data) { + var o = this._get_node(data.rslt.obj), + t = this; + if(o === -1) { o = this.get_container_ul(); } + if(!o.length) { return; } + o.find("li").each(function () { + var th = $(this); + if(th.data("jstree")) { + $.each(th.data("jstree"), function (plugin, values) { + if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) { + t["_" + plugin + "_notify"].call(t, th, values); + } + }); + } + }); + }, this)); + } + if(this._get_settings().core.load_open) { + this.get_container() + .bind("load_node.jstree", $.proxy(function (e, data) { + var o = this._get_node(data.rslt.obj), + t = this; + if(o === -1) { o = this.get_container_ul(); } + if(!o.length) { return; } + o.find("li.jstree-open:not(:has(ul))").each(function () { + t.load_node(this, $.noop, $.noop); + }); + }, this)); + } + this.__callback(); + this.load_node(-1, function () { this.loaded(); this.reload_nodes(); }); + }, + destroy : function () { + var i, + n = this.get_index(), + s = this._get_settings(), + _this = this; + + $.each(s.plugins, function (i, val) { + try { plugins[val].__destroy.apply(_this); } catch(err) { } + }); + this.__callback(); + // set focus to another instance if this one is focused + if(this.is_focused()) { + for(i in instances) { + if(instances.hasOwnProperty(i) && i != n) { + instances[i].set_focus(); + break; + } + } + } + // if no other instance found + if(n === focused_instance) { focused_instance = -1; } + // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events + this.get_container() + .unbind(".jstree") + .undelegate(".jstree") + .removeData("jstree_instance_id") + .find("[class^='jstree']") + .andSelf() + .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); + $(document) + .unbind(".jstree-" + n) + .undelegate(".jstree-" + n); + // remove the actual data + instances[n] = null; + delete instances[n]; + }, + + _core_notify : function (n, data) { + if(data.opened) { + this.open_node(n, false, true); + } + }, + + lock : function () { + this.data.core.locked = true; + this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7"); + this.__callback({}); + }, + unlock : function () { + this.data.core.locked = false; + this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1"); + this.__callback({}); + }, + is_locked : function () { return this.data.core.locked; }, + save_opened : function () { + var _this = this; + this.data.core.to_open = []; + this.get_container_ul().find("li.jstree-open").each(function () { + if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } + }); + this.__callback(_this.data.core.to_open); + }, + save_loaded : function () { }, + reload_nodes : function (is_callback) { + var _this = this, + done = true, + current = [], + remaining = []; + if(!is_callback) { + this.data.core.reopen = false; + this.data.core.refreshing = true; + this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); + this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); + if(this.data.core.to_open.length) { + this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open); + } + } + if(this.data.core.to_load.length) { + $.each(this.data.core.to_load, function (i, val) { + if(val == "#") { return true; } + if($(val).length) { current.push(val); } + else { remaining.push(val); } + }); + if(current.length) { + this.data.core.to_load = remaining; + $.each(current, function (i, val) { + if(!_this._is_loaded(val)) { + _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); }); + done = false; + } + }); + } + } + if(this.data.core.to_open.length) { + $.each(this.data.core.to_open, function (i, val) { + _this.open_node(val, false, true); + }); + } + if(done) { + // TODO: find a more elegant approach to syncronizing returning requests + if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); } + this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50); + this.data.core.refreshing = false; + this.reopen(); + } + }, + reopen : function () { + var _this = this; + if(this.data.core.to_open.length) { + $.each(this.data.core.to_open, function (i, val) { + _this.open_node(val, false, true); + }); + } + this.__callback({}); + }, + refresh : function (obj) { + var _this = this; + this.save_opened(); + if(!obj) { obj = -1; } + obj = this._get_node(obj); + if(!obj) { obj = -1; } + if(obj !== -1) { obj.children("UL").remove(); } + else { this.get_container_ul().empty(); } + this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); }); + }, + // Dummy function to fire after the first load (so that there is a jstree.loaded event) + loaded : function () { + this.__callback(); + }, + // deal with focus + set_focus : function () { + if(this.is_focused()) { return; } + var f = $.jstree._focused(); + if(f) { f.unset_focus(); } + + this.get_container().addClass("jstree-focused"); + focused_instance = this.get_index(); + this.__callback(); + }, + is_focused : function () { + return focused_instance == this.get_index(); + }, + unset_focus : function () { + if(this.is_focused()) { + this.get_container().removeClass("jstree-focused"); + focused_instance = -1; + } + this.__callback(); + }, + + // traverse + _get_node : function (obj) { + var $obj = $(obj, this.get_container()); + if($obj.is(".jstree") || obj == -1) { return -1; } + $obj = $obj.closest("li", this.get_container()); + return $obj.length ? $obj : false; + }, + _get_next : function (obj, strict) { + obj = this._get_node(obj); + if(obj === -1) { return this.get_container().find("> ul > li:first-child"); } + if(!obj.length) { return false; } + if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; } + + if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); } + else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); } + else { return obj.parentsUntil(".jstree","li").next("li").eq(0); } + }, + _get_prev : function (obj, strict) { + obj = this._get_node(obj); + if(obj === -1) { return this.get_container().find("> ul > li:last-child"); } + if(!obj.length) { return false; } + if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; } + + if(obj.prev("li").length) { + obj = obj.prev("li").eq(0); + while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); } + return obj; + } + else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; } + }, + _get_parent : function (obj) { + obj = this._get_node(obj); + if(obj == -1 || !obj.length) { return false; } + var o = obj.parentsUntil(".jstree", "li:eq(0)"); + return o.length ? o : -1; + }, + _get_children : function (obj) { + obj = this._get_node(obj); + if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); } + if(!obj.length) { return false; } + return obj.children("ul:eq(0)").children("li"); + }, + get_path : function (obj, id_mode) { + var p = [], + _this = this; + obj = this._get_node(obj); + if(obj === -1 || !obj || !obj.length) { return false; } + obj.parentsUntil(".jstree", "li").each(function () { + p.push( id_mode ? this.id : _this.get_text(this) ); + }); + p.reverse(); + p.push( id_mode ? obj.attr("id") : this.get_text(obj) ); + return p; + }, + + // string functions + _get_string : function (key) { + return this._get_settings().core.strings[key] || key; + }, + + is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); }, + is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); }, + is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); }, + correct_state : function (obj) { + obj = this._get_node(obj); + if(!obj || obj === -1) { return false; } + obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove(); + this.__callback({ "obj" : obj }); + }, + // open/close + open_node : function (obj, callback, skip_animation) { + obj = this._get_node(obj); + if(!obj.length) { return false; } + if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; } + var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, + t = this; + if(!this._is_loaded(obj)) { + obj.children("a").addClass("jstree-loading"); + this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback); + } + else { + if(this._get_settings().core.open_parents) { + obj.parentsUntil(".jstree",".jstree-closed").each(function () { + t.open_node(this, false, true); + }); + } + if(s) { obj.children("ul").css("display","none"); } + obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"); + if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); } + else { t.after_open(obj); } + this.__callback({ "obj" : obj }); + if(callback) { callback.call(); } + } + }, + after_open : function (obj) { this.__callback({ "obj" : obj }); }, + close_node : function (obj, skip_animation) { + obj = this._get_node(obj); + var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, + t = this; + if(!obj.length || !obj.hasClass("jstree-open")) { return false; } + if(s) { obj.children("ul").attr("style","display:block !important"); } + obj.removeClass("jstree-open").addClass("jstree-closed"); + if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); } + else { t.after_close(obj); } + this.__callback({ "obj" : obj }); + }, + after_close : function (obj) { this.__callback({ "obj" : obj }); }, + toggle_node : function (obj) { + obj = this._get_node(obj); + if(obj.hasClass("jstree-closed")) { return this.open_node(obj); } + if(obj.hasClass("jstree-open")) { return this.close_node(obj); } + }, + open_all : function (obj, do_animation, original_obj) { + obj = obj ? this._get_node(obj) : -1; + if(!obj || obj === -1) { obj = this.get_container_ul(); } + if(original_obj) { + obj = obj.find("li.jstree-closed"); + } + else { + original_obj = obj; + if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); } + else { obj = obj.find("li.jstree-closed"); } + } + var _this = this; + obj.each(function () { + var __this = this; + if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); } + else { _this.open_node(this, false, !do_animation); } + }); + // so that callback is fired AFTER all nodes are open + if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); } + }, + close_all : function (obj, do_animation) { + var _this = this; + obj = obj ? this._get_node(obj) : this.get_container(); + if(!obj || obj === -1) { obj = this.get_container_ul(); } + obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); }); + this.__callback({ "obj" : obj }); + }, + clean_node : function (obj) { + obj = obj && obj != -1 ? $(obj) : this.get_container_ul(); + obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li"); + obj.removeClass("jstree-last") + .filter("li:last-child").addClass("jstree-last").end() + .filter(":has(li)") + .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"); + obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(); + this.__callback({ "obj" : obj }); + }, + // rollback + get_rollback : function () { + this.__callback(); + return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data }; + }, + set_rollback : function (html, data) { + this.get_container().empty().append(html); + this.data = data; + this.__callback(); + }, + // Dummy functions to be overwritten by any datastore plugin included + load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); }, + _is_loaded : function (obj) { return true; }, + + // Basic operations: create + create_node : function (obj, position, js, callback, is_loaded) { + obj = this._get_node(obj); + position = typeof position === "undefined" ? "last" : position; + var d = $("
        • "), + s = this._get_settings().core, + tmp; + + if(obj !== -1 && !obj.length) { return false; } + if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; } + + this.__rollback(); + + if(typeof js === "string") { js = { "data" : js }; } + if(!js) { js = {}; } + if(js.attr) { d.attr(js.attr); } + if(js.metadata) { d.data(js.metadata); } + if(js.state) { d.addClass("jstree-" + js.state); } + if(!js.data) { js.data = this._get_string("new_node"); } + if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); } + $.each(js.data, function (i, m) { + tmp = $(""); + if($.isFunction(m)) { m = m.call(this, js); } + if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); } + else { + if(!m.attr) { m.attr = {}; } + if(!m.attr.href) { m.attr.href = '#'; } + tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title); + if(m.language) { tmp.addClass(m.language); } + } + tmp.prepend(" "); + if(!m.icon && js.icon) { m.icon = js.icon; } + if(m.icon) { + if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); } + else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); } + } + d.append(tmp); + }); + d.prepend(" "); + if(obj === -1) { + obj = this.get_container(); + if(position === "before") { position = "first"; } + if(position === "after") { position = "last"; } + } + switch(position) { + case "before": obj.before(d); tmp = this._get_parent(obj); break; + case "after" : obj.after(d); tmp = this._get_parent(obj); break; + case "inside": + case "first" : + if(!obj.children("ul").length) { obj.append("