#177 에 따른 PC 쇼핑몰 코드 수정

This commit is contained in:
chicpro
2013-05-14 16:38:27 +09:00
parent 17ac326656
commit daa7f8931e
38 changed files with 417 additions and 259 deletions

View File

@ -169,7 +169,7 @@ if (isset($ev_set)) {
<input type="checkbox" name="ev_chk[<?php echo $i; ?>]" value="1" <?php echo ($row['ev_id'] ? "checked" : ""); ?>>
</td>
<td class="td_bignum"><a href="<?php echo $href; ?>"><?php echo $row['it_id']; ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
</tr>
<?php

View File

@ -35,7 +35,7 @@ include_once(G4_PATH.'/head.sub.php');
<tr>
<td>
<a href="<?php echo $href; ?>" target="_blank">
<?php echo get_it_image($row['it_id'].'_s', 40, 40); ?>
<?php echo get_it_image($row['it_id'], 40, 40); ?>
<?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?>
</a>
</td>

View File

@ -20,6 +20,33 @@ if(intval(preg_replace("/[^0-9]/", "", $row['Type'])) != 20) {
sql_query(" ALTER TABLE `{$g4['shop_wish_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
}
// 상품이미지 필드추가
$sql = " select it_img1 from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img1` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_tel_inq` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img2` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img1` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img3` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img2` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img4` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img3` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img5` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img4` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img6` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img5` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img7` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img6` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img8` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img7` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img9` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img8` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img10` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img9` ", false);
}
// it_amount 를 it_price 로 변경
/*
$sql = " select it_price from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` CHANGE `it_amount` `it_price` INT(11) NOT NULL DEFAULT '0' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` CHANGE `it_amount2` `it_price2` INT(11) NOT NULL DEFAULT '0' ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` CHANGE `it_amount3` `it_price3` INT(11) NOT NULL DEFAULT '0' ", false);
}
*/
$html_title = "상품 ";
if ($w == "")
@ -428,7 +455,6 @@ $pg_anchor ='<ul class="anchor">
<section id="anc_sitfrm_img" class="cbox">
<h2>이미지</h2>
<?php echo $pg_anchor; ?>
<p>이미지 자동생성 기능을 이용하시면, 이미지(대) 1장만 업로드 해서 자동으로 이미지(중), 이미지(소) 를 생성할 수 있습니다.</p>
<table class="frm_tbl">
<colgroup>
@ -436,111 +462,34 @@ $pg_anchor ='<ul class="anchor">
<col>
</colgroup>
<tbody>
<?php if (function_exists("imagecreatefromjpeg")) { ?>
<?php for($i=1; $i<=10; $i++) { ?>
<tr>
<th scope="row"><label for="createimage">이미지 자동생성</label></th>
<th scope="row"><label for="it_img1">이미지 <?php echo $i; ?></label></th>
<td>
<?php echo help("<strong>JPG 파일만 가능합니다.</strong> 이미지(대) 를 기준으로 이미지(중)과 이미지(소) 의 사이즈를 환경설정에서 정한 폭과 높이로 자동생성합니다.");?>
<input type="checkbox" name="createimage" value="1" id="createimage"> 사용
</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="it_limg1">이미지(대)</label></th>
<td>
<input type="file" name="it_limg1" id="it_limg1">
<input type="file" name="it_img<?php echo $i; ?>" id="it_img<?php echo $i; ?>">
<?php
$limg1 = G4_DATA_PATH.'/item/'.$it['it_id'].'_l1';
if (file_exists($limg1)) {
$size = getimagesize($limg1);
$it_img = G4_DATA_PATH.'/item/'.$it['it_img'.$i];
if(is_file($it_img) && $it['it_img'.$i]) {
$size = @getimagesize($it_img);
?>
<label for="it_limg1_del"><span class="sound_only">이미지(대) </span>파일삭제</label>
<input type="checkbox" name="it_limg1_del" value="1">
<span class="sit_wimg_limg1"></span>
<div id="limg1" class="banner_or_img">
<img src="<?php echo G4_DATA_URL; ?>/item/<?php echo $it['it_id']; ?>_l1" alt="" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>">
<button type="button" class="sit_wimg_close">닫기</button>
</div>
<script>
$('<button type="button" id="it_limg1_view" class="btn_frmline sit_wimg_view">이미지(대) 확인</button>').appendTo('.sit_wimg_limg1');
</script>
<?php } ?>
</td>
</tr>
<tr>
<th scope="row"><label for="it_mimg">이미지(중)</label></th>
<td>
<?php echo help("이미지 자동생성 기능을 사용하지 않거나, 이미지를 업로드 하지 않으면 기본 noimage 로 출력합니다."); ?>
<input type="file" name="it_mimg" id="it_mimg">
<?php
$mimg = G4_DATA_PATH.'/item/'.$it['it_id'].'_m';
if (file_exists($mimg)) {
$size = getimagesize($mimg);
?>
<label for="it_mimg_del"><span class="sound_only">이미지(중) </span>파일삭제</label>
<input type="checkbox" name="it_mimg_del" value="1" id="it_mimg_del">
<span class="sit_wimg_mimg"></span>
<div id="mimg" class="banner_or_img">
<img src="<?php echo G4_DATA_URL; ?>/item/<?php echo $it['it_id']; ?>_m" alt="" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>">
<button type="button" class="sit_wimg_close">닫기</button>
</div>
<script>
$('<button type="button" id="it_mimg_view" class="btn_frmline sit_wimg_view">이미지(중) 확인</button>').appendTo('.sit_wimg_mimg');
</script>
<?php } ?>
</td>
</tr>
<tr>
<th scope="row"><label for="it_simg">이미지(소)</label></th>
<td>
<?php echo help("이미지 자동생성 기능을 사용하지 않거나, 이미지를 업로드 하지 않으면 기본 noimage 로 출력합니다."); ?>
<input type="file" name="it_simg" id="it_simg">
<?php
$simg = G4_DATA_PATH.'/item/'.$it['it_id'].'_s';
if (file_exists($simg)) {
$size = getimagesize($simg);
?>
<label for="it_simg_del"><span class="sound_only">이미지(소) </span>파일삭제</label>
<input type="checkbox" name="it_simg_del" value="1" id="it_simg_del">
<span class="sit_wimg_simg"></span>
<div id="simg" class="banner_or_img">
<img src="<?php echo G4_DATA_URL; ?>/item/<?php echo $it['it_id']; ?>_s" alt="" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>">
<button type="button" class="sit_wimg_close">닫기</button>
</div>
<script>
$('<button type="button" id="it_simg_view" class="btn_frmline sit_wimg_view">이미지(소) 확인</button>').appendTo('.sit_wimg_simg');
</script>
<?php } ?>
</td>
</tr>
<?php for ($i=2; $i<=5; $i++) { // 이미지(대)는 5개 ?>
<tr>
<th scope="row"><label for="it_limg<?php echo $i; ?>">이미지(대)<?php echo $i; ?></label></th>
<td>
<input type="file" name="it_limg<?php echo $i; ?>" id="it_limg<?php echo $i; ?>">
<?php
$limg = G4_DATA_PATH.'/item/'.$it['it_id'].'_l'.$i;
if (file_exists($limg)) {
$size = getimagesize($limg);
?>
<label for="it_limg<?php echo $i; ?>_del"><span class="sound_only">이미지(대)<?php echo $i; ?> </span>파일삭제</label>
<input type="checkbox" name="it_limg<?php echo $i; ?>_del" value="1" id="it_limg<?php echo $i; ?>_del">
<label for="it_img<?php echo $i; ?>_del"><span class="sound_only">이미지 <?php echo $i; ?> </span>파일삭제</label>
<input type="checkbox" name="it_img<?php echo $i; ?>_del" id="it_img<?php echo $i; ?>_del" value="1">
<span class="sit_wimg_limg<?php echo $i; ?>"></span>
<div id="limg<?php echo $i; ?>" class="banner_or_img">
<img src="<?php echo G4_DATA_URL; ?>/item/<?php echo $it['it_id']; ?>_l<?php echo $i; ?>">
<img src="<?php echo G4_DATA_URL; ?>/item/<?php echo $it['it_img'.$i]; ?>" alt="" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>">
<button type="button" class="sit_wimg_close">닫기</button>
</div>
<?php } ?>
<script>
$('<button type="button" id="it_limg<?php echo $i; ?>_view" class="btn_frmline sit_wimg_view">이미지(대)<?php echo $i; ?> 확인</button>').appendTo('.sit_wimg_limg<?php echo $i; ?>');
$('<button type="button" id="it_limg<?php echo $i; ?>_view" class="btn_frmline sit_wimg_view">이미지<?php echo $i; ?> 확인</button>').appendTo('.sit_wimg_limg<?php echo $i; ?>');
</script>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (file_exists($limg1) || file_exists($mimg) || file_exists($simg)) { ?>
<?php if ($w == 'u') { ?>
<script>
$(".banner_or_img").addClass("sit_wimg");
$(function() {
@ -548,16 +497,14 @@ $pg_anchor ='<ul class="anchor">
var sit_wimg_id = $(this).attr("id").split("_");
var $img_display = $("#"+sit_wimg_id[1]);
if(sit_wimg_id[1].search("limg") > -1) {
var $img = $("#"+sit_wimg_id[1]);
var width = $img_display.width();
var height = $img_display.height();
if(width > 700) {
var img_width = 700;
var img_height = Math.round((img_width * height) / width);
var $img = $("#"+sit_wimg_id[1]);
var width = $img_display.width();
var height = $img_display.height();
if(width > 700) {
var img_width = 700;
var img_height = Math.round((img_width * height) / width);
$img_display.children("img").width(img_width).height(img_height);
}
$img_display.children("img").width(img_width).height(img_height);
}
$img_display.toggle();

View File

@ -16,6 +16,11 @@ function itemdelete($it_id)
{
global $g4, $is_admin;
$sql = " select it_explan, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g4['shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
/*
$str = $comma = $od_id = "";
$sql = " select b.od_id
from {$g4['shop_cart_table']} a,
@ -39,16 +44,16 @@ function itemdelete($it_id)
{
alert("이 상품과 관련된 주문이 총 {$i} 건 존재하므로 주문서를 삭제한 후 상품을 삭제하여 주십시오.\\n\\n$str", "./orderstatuslist.php?sort1=od_id&amp;sel_field=od_id&amp;search=$od_id");
}
*/
// 상품 이미지 삭제
@unlink(G4_DATA_PATH."/item/$it_id"."_s");
@unlink(G4_DATA_PATH."/item/$it_id"."_m");
@unlink(G4_DATA_PATH."/item/$it_id"."_l1");
@unlink(G4_DATA_PATH."/item/$it_id"."_l2");
@unlink(G4_DATA_PATH."/item/$it_id"."_l3");
@unlink(G4_DATA_PATH."/item/$it_id"."_l4");
@unlink(G4_DATA_PATH."/item/$it_id"."_l5");
// 상품 이미지 삭제
for($i=1; $i<=10; $i++) {
$file = G4_DATA_PATH.'/item/'.$it['it_img'.$i];
if(is_file($file) && $it['it_img'.$i]) {
@unlink($file);
@rmdir(dirname($file));
}
}
// 상, 하단 이미지 삭제
@unlink(G4_DATA_PATH."/item/$it_id"."_h");
@ -74,17 +79,10 @@ function itemdelete($it_id)
$sql = " delete from {$g4['shop_item_relation_table']} where it_id = '$it_id' or it_id2 = '$it_id' ";
sql_query($sql);
// 상품요약정보삭제
$sql = " delete from {$g4['shop_item_info_table']} where it_id = '$it_id' ";
sql_query($sql);
//------------------------------------------------------------------------
// HTML 내용에서 에디터에 올라간 이미지의 경로를 얻어 삭제함
//------------------------------------------------------------------------
$sql = " select it_explan from {$g4['shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
$imgs = get_editor_image($it['it_explan']);
for($i=0;$i<count($imgs[1]);$i++) {
@ -162,53 +160,119 @@ if ($cnt > 0) {
if ($it_himg_del) @unlink(G4_DATA_PATH."/item/{$it_id}_h");
if ($it_timg_del) @unlink(G4_DATA_PATH."/item/{$it_id}_t");
if ($it_simg_del) @unlink(G4_DATA_PATH."/item/{$it_id}_s");
if ($it_mimg_del) @unlink(G4_DATA_PATH."/item/{$it_id}_m");
if ($it_limg1_del) @unlink(G4_DATA_PATH."/item/{$it_id}_l1");
if ($it_limg2_del) @unlink(G4_DATA_PATH."/item/{$it_id}_l2");
if ($it_limg3_del) @unlink(G4_DATA_PATH."/item/{$it_id}_l3");
if ($it_limg4_del) @unlink(G4_DATA_PATH."/item/{$it_id}_l4");
if ($it_limg5_del) @unlink(G4_DATA_PATH."/item/{$it_id}_l5");
// 파일정보
if($w == "u") {
$sql = " select it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g4['shop_item_table']}
where it_id = '$it_id' ";
$file = sql_fetch($sql);
// 이미지(대)만 업로드하고 자동생성 체크일 경우 이미지(중,소) 자동생성
if ($createimage && $_FILES['it_limg1']['name'])
{
upload_file($_FILES['it_limg1']['tmp_name'], $it_id."_l1", G4_DATA_PATH."/item");
$it_img1 = $file['it_img1'];
$it_img2 = $file['it_img2'];
$it_img3 = $file['it_img3'];
$it_img4 = $file['it_img4'];
$it_img5 = $file['it_img5'];
$it_img6 = $file['it_img6'];
$it_img7 = $file['it_img7'];
$it_img8 = $file['it_img8'];
$it_img9 = $file['it_img9'];
$it_img10 = $file['it_img10'];
}
$image = G4_DATA_PATH."/item/$it_id"."_l1";
$size = @getimagesize($image);
$src = @imagecreatefromjpeg($image);
$it_img_dir = G4_DATA_PATH.'/item';
if (!$src)
{
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
echo "<script>alert('이미지(대)가 JPG 파일이 아닙니다.');</script>";
}
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_DATA_PATH."/item/$it_id"."_s", 90);
// 파일삭제
if ($it_img1_del) {
@unlink($it_img_dir.'/'.$it_img1);
$it_img1 = '';
}
if ($it_img2_del) {
@unlink($it_img_dir.'/'.$it_img2);
$it_img2 = '';
}
if ($it_img3_del) {
@unlink($it_img_dir.'/'.$it_img3);
$it_img3 = '';
}
if ($it_img4_del) {
@unlink($it_img_dir.'/'.$it_img4);
$it_img4 = '';
}
if ($it_img5_del) {
@unlink($it_img_dir.'/'.$it_img5);
$it_img5 = '';
}
if ($it_img6_del) {
@unlink($it_img_dir.'/'.$it_img6);
$it_img6 = '';
}
if ($it_img7_del) {
@unlink($it_img_dir.'/'.$it_img7);
$it_img7 = '';
}
if ($it_img8_del) {
@unlink($it_img_dir.'/'.$it_img8);
$it_img8 = '';
}
if ($it_img9_del) {
@unlink($it_img_dir.'/'.$it_img9);
$it_img9 = '';
}
if ($it_img10_del) {
@unlink($it_img_dir.'/'.$it_img10);
$it_img10 = '';
}
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_DATA_PATH."/item/$it_id"."_m", 90);
}
// 이미지업로드
if ($_FILES['it_img1']['name']) {
if($w == 'u' && $it_img1)
@unlink($it_img_dir.'/'.$it_img1);
$it_img1 = it_img_upload($_FILES['it_img1']['tmp_name'], $_FILES['it_img1']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img2']['name']) {
if($w == 'u' && $it_img2)
@unlink($it_img_dir.'/'.$it_img2);
$it_img2 = it_img_upload($_FILES['it_img2']['tmp_name'], $_FILES['it_img2']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img3']['name']) {
if($w == 'u' && $it_img3)
@unlink($it_img_dir.'/'.$it_img3);
$it_img3 = it_img_upload($_FILES['it_img3']['tmp_name'], $_FILES['it_img3']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img4']['name']) {
if($w == 'u' && $it_img4)
@unlink($it_img_dir.'/'.$it_img4);
$it_img4 = it_img_upload($_FILES['it_img4']['tmp_name'], $_FILES['it_img4']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img5']['name']) {
if($w == 'u' && $it_img5)
@unlink($it_img_dir.'/'.$it_img5);
$it_img5 = it_img_upload($_FILES['it_img5']['tmp_name'], $_FILES['it_img5']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img6']['name']) {
if($w == 'u' && $it_img6)
@unlink($it_img_dir.'/'.$it_img6);
$it_img6 = it_img_upload($_FILES['it_img6']['tmp_name'], $_FILES['it_img6']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img7']['name']) {
if($w == 'u' && $it_img7)
@unlink($it_img_dir.'/'.$it_img7);
$it_img7 = it_img_upload($_FILES['it_img7']['tmp_name'], $_FILES['it_img7']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img8']['name']) {
if($w == 'u' && $it_img8)
@unlink($it_img_dir.'/'.$it_img8);
$it_img8 = it_img_upload($_FILES['it_img8']['tmp_name'], $_FILES['it_img8']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img9']['name']) {
if($w == 'u' && $it_img9)
@unlink($it_img_dir.'/'.$it_img9);
$it_img9 = it_img_upload($_FILES['it_img9']['tmp_name'], $_FILES['it_img9']['name'], $it_img_dir.'/'.$it_id);
}
if ($_FILES['it_img10']['name']) {
if($w == 'u' && $it_img10)
@unlink($it_img_dir.'/'.$it_img10);
$it_img10 = it_img_upload($_FILES['it_img10']['tmp_name'], $_FILES['it_img10']['name'], $it_img_dir.'/'.$it_id);
}
if ($w == "" || $w == "u")
@ -278,7 +342,17 @@ $sql_common = " ca_id = '$ca_id',
it_time = '".G4_TIME_YMDHIS."',
it_ip = '{$_SERVER['REMOTE_ADDR']}',
it_order = '$it_order',
it_tel_inq = '$it_tel_inq'
it_tel_inq = '$it_tel_inq',
it_img1 = '$it_img1',
it_img2 = '$it_img2',
it_img3 = '$it_img3',
it_img4 = '$it_img4',
it_img5 = '$it_img5',
it_img6 = '$it_img6',
it_img7 = '$it_img7',
it_img8 = '$it_img8',
it_img9 = '$it_img9',
it_img10 = '$it_img10'
";
if ($w == "")
@ -354,17 +428,6 @@ if ($w == "" || $w == "u")
sql_query($sql, false);
}
}
if ($_FILES['it_simg']['name']) upload_file($_FILES['it_simg']['tmp_name'], $it_id."_s", G4_DATA_PATH."/item");
if ($_FILES['it_mimg']['name']) upload_file($_FILES['it_mimg']['tmp_name'], $it_id."_m", G4_DATA_PATH."/item");
if ($_FILES['it_limg1']['name']) upload_file($_FILES['it_limg1']['tmp_name'], $it_id."_l1", G4_DATA_PATH."/item");
if ($_FILES['it_limg2']['name']) upload_file($_FILES['it_limg2']['tmp_name'], $it_id."_l2", G4_DATA_PATH."/item");
if ($_FILES['it_limg3']['name']) upload_file($_FILES['it_limg3']['tmp_name'], $it_id."_l3", G4_DATA_PATH."/item");
if ($_FILES['it_limg4']['name']) upload_file($_FILES['it_limg4']['tmp_name'], $it_id."_l4", G4_DATA_PATH."/item");
if ($_FILES['it_limg5']['name']) upload_file($_FILES['it_limg5']['tmp_name'], $it_id."_l5", G4_DATA_PATH."/item");
if ($_FILES['it_himg']['name']) upload_file($_FILES['it_himg']['tmp_name'], $it_id."_h", G4_DATA_PATH."/item");
if ($_FILES['it_timg']['name']) upload_file($_FILES['it_timg']['tmp_name'], $it_id."_t", G4_DATA_PATH."/item");
}
$qstr = "$qstr&amp;sca=$sca&amp;page=$page";
@ -372,7 +435,6 @@ $qstr = "$qstr&amp;sca=$sca&amp;page=$page";
if ($w == "u") {
goto_url("./itemform.php?w=u&amp;it_id=$it_id&amp;$qstr");
} else if ($w == "d") {
// 091123 추가 utf-8
$qstr = "ca_id=$ca_id&amp;sfl=$sfl&amp;sca=$sca&amp;page=$page&amp;stx=".urlencode($stx)."&amp;save_stx=".urlencode($save_stx);
goto_url("./itemlist.php?$qstr");
}
@ -382,7 +444,7 @@ echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
<script>
if (confirm("계속 입력하시겠습니까?"))
//location.href = "<?="./itemform.php?it_id=$it_id&amp;sort1=$sort1&amp;sort2=$sort2&amp;sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page"?>";
location.href = "<?php echo "./itemform.php?it_id=$it_id&amp;$qstr"; ?>";
location.href = "<?php echo "./itemform.php?$qstr"; ?>";
else
location.href = "<?php echo "./itemlist.php?$qstr"; ?>";
</script>

View File

@ -174,7 +174,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<?php echo $row['it_id']; ?>
</td>
<td rowspan="2"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?></a></td>
<td rowspan="2"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?></a></td>
<td rowspan="2">
<label for="ca_id_<?php echo $i; ?>" class="sound_only">분류</label>
<select name="ca_id[<?php echo $i; ?>]" id="ca_id_<?php echo $i; ?>">

View File

@ -129,7 +129,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
?>
<tr>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td class="td_name"><?php echo $name; ?></td>
<td class="sit_ps_subject"><?php echo $row['is_subject']; ?></td>
<td class="td_num"><?php echo $row['is_score']; ?></td>

View File

@ -125,7 +125,7 @@ if ($sfl || $stx) // 검색 결과일 때만 처음 버튼을 보여줌
$answer = $row['iq_answer'] ? 'Y' : '&nbsp;';
?>
<tr>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td class="td_name"><?php echo $name; ?></td>
<td class="sit_qa_subject"><?php echo $row['iq_subject']; ?></td>
<td class="sit_qa_answer"><?php echo $answer; ?></td>

View File

@ -135,7 +135,7 @@ if ($fr_date || $to_date) // 검색렬일 때만 처음 버튼을 보여줌
?>
<tr>
<td class="td_num"><?php echo $num; ?></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td class="td_smallnum"><?php echo $row['ct_status_1']; ?></td>
<td class="td_smallnum"><?php echo $row['ct_status_2']; ?></td>
<td class="td_smallnum"><?php echo $row['ct_status_3']; ?></td>

View File

@ -148,7 +148,7 @@ if ($search) // 검색 결과일 때만 처음 버튼을 보여줌
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<?php echo $row['it_id']; ?>
</td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?><?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td class="td_num"><?php echo number_format($row['it_stock_qty']); ?></td>
<td class="td_num"><?php echo number_format($wait_qty); ?></td>
<td class="td_num"><?php echo number_format($temporary_qty); ?></td>

View File

@ -156,7 +156,7 @@ if ($stx) // 검색 결과일 때만 처음 버튼을 보여줌
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<?php echo $row['it_id']; ?>
</td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?><?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td class="td_chk"><input type="checkbox" name="it_type1[<?php echo $i; ?>]" value="1" <?php echo ($row['it_type1'] ? 'checked' : ''); ?>></td>
<td class="td_chk"><input type="checkbox" name="it_type2[<?php echo $i; ?>]" value="1" <?php echo ($row['it_type2'] ? 'checked' : ''); ?>></td>
<td class="td_chk"><input type="checkbox" name="it_type3[<?php echo $i; ?>]" value="1" <?php echo ($row['it_type3'] ? 'checked' : ''); ?>></td>

View File

@ -164,7 +164,7 @@ $pg_anchor = '<ul class="anchor">
else if ($row['ct_status']=='취소' || $row['ct_status']=='반품' || $row['ct_status']=='품절')
$t_ct_amount['취소'] += $row['ct_amount'] * $row['ct_qty'];
$image = get_it_image("$row[it_id]_s", (int)($default['de_simg_width'] / $image_rate), (int)($default['de_simg_height'] / $image_rate), '');
$image = get_it_image($row['it_id'], (int)($default['de_simg_width'] / $image_rate), (int)($default['de_simg_height'] / $image_rate));
?>
<tr>

View File

@ -236,7 +236,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<tr class="tr_sodr_item">
<td headers="sodr_all_item" colspan="5">
<ul>
<li><a href="<?php echo $href; ?>"><?php echo get_it_image($row2['it_id'].'_s', 50, 50); ?><?php echo $it_name; ?></a></li>
<li><a href="<?php echo $href; ?>"><?php echo get_it_image($row2['it_id'], 50, 50); ?><?php echo $it_name; ?></a></li>
</ul>
</td>
<td headers="sodr_all_cost"><?php echo number_format($row2['ct_amount']); ?></td>

View File

@ -177,7 +177,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?sort1=<?php echo $sort1; ?>&amp;sort2=<?php echo $sort2; ?>&amp;sel_field=od_id&amp;search=<?php echo $lines[$i]['od_id']; ?>"><?php echo $lines[$i]['od_id']; ?></a><br>
<?php echo $lines[$i]['od_time']; ?>
</td>
<td class="td_it_img"><a href="<?php echo $href; ?>"><?php echo get_it_image($lines[$i]['it_id'].'_s', 50, 50); ?><?php echo $it_name; ?></a></td>
<td class="td_it_img"><a href="<?php echo $href; ?>"><?php echo get_it_image($lines[$i]['it_id'], 50, 50); ?><?php echo $it_name; ?></a></td>
<td class="td_name">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?sort1=<?php echo $sort1; ?>&amp;sort2=<?php echo $sort2; ?>&amp;sel_field=od_name&amp;search=<?php echo $lines[$i]['od_name']; ?>"><?php echo cut_str($lines[$i]['od_name'],10,""); ?></a>
<?php if ($lines[$i]['od_deposit_name'] != "") echo '<br>'.$lines[$i]['od_deposit_name']?>

View File

@ -114,7 +114,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
?>
<tr>
<td class="td_num"><?php echo $num; ?></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'].'_s', 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
<td class="td_num"><?php echo $row['it_id_cnt']; ?></td>
</tr>
<?php

View File

@ -465,7 +465,8 @@ input.required:focus {border:1px solid #b8c9c2;background:#21272e !important;col
/* 상품 상세보기 - 이미지 미리보기 */
#sit_pvi {float:left;padding:15px;width:320px}
#sit_pvi_big {margin:0 0 10px}
#sit_pvi_big a {display:block}
#sit_pvi_big a {display:none}
#sit_pvi_big a.visible {display:block}
#sit_pvi_big img {width:320px;height:320px}
#sit_pvi_thumb {margin:0;padding:0;list-style:none;zoom:1}
#sit_pvi_thumb:after {display:block;visibility:hidden;clear:both;content:""}
@ -475,6 +476,8 @@ input.required:focus {border:1px solid #b8c9c2;background:#21272e !important;col
#sit_pvi_nw h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#sit_pvi_nwbig {padding:10px 0;text-align:center}
#sit_pvi_nwbig span {display:none}
#sit_pvi_nwbig span.visible {display:inline}
#sit_pvi_nw ul {margin:0 0 20px;padding:0 10px;list-style:none;zoom:1}
#sit_pvi_nw ul:after {display:block;visibility:hidden;clear:both;content:""}
#sit_pvi_nw li {float:left;margin:0 0 0 1px}

View File

@ -1,4 +1,6 @@
<?php
include_once(G4_LIB_PATH.'/thumbnail.lib.php');
//==============================================================================
// 쇼핑몰 함수 모음 시작
//==============================================================================
@ -52,12 +54,95 @@ function get_image($img, $width=0, $height=0, $img_id='')
}
// 상품 이미지를 얻는다
function get_it_image($img, $width=0, $height=0, $id='', $img_id='')
function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='')
{
$str = get_image($img, $width, $height, $img_id);
if ($id) {
$str = '<a href="'.G4_SHOP_URL.'/item.php?it_id='.$id.'">'.$str.'</a>';
global $g4;
if(!$it_id || !$width)
return '';
$sql = " select it_id, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g4['shop_item_table']} where it_id = '$it_id' ";
$row = sql_fetch($sql);
if(!$row['it_id'])
return '';
for($i=1;$i<=10; $i++) {
$file = G4_DATA_PATH.'/item/'.$row['it_img'.$i];
if(is_file($file) && $row['it_img'.$i]) {
$size = @getimagesize($file);
if($size[2] < 1 || $size[2] > 3)
continue;
$filename = basename($file);
$filepath = dirname($file);
$img_width = $size[0];
$img_height = $size[1];
break;
}
}
if($img_width && !$height) {
$height = round(($width * $img_height) / $img_width);
}
if($filename) {
//thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3');
}
if($thumb) {
$file_url = str_replace(G4_PATH, G4_URL, $filepath.'/'.$thumb);
$img = '<img src="'.$file_url.'" width="'.$width.'" height="'.$height.'" alt=""';
} else {
$img = '<img src="'.G4_SHOP_URL.'/img/no_image.gif" width="'.$width.'"';
if($height)
$img .= ' height="'.$height.'"';
$img .= ' alt=""';
}
if($img_id)
$img .= ' id="'.$img_id.'"';
$img .= '>';
if($anchor)
$img = '<a href="'.G4_SHOP_URL.'/item.php?it_id='.$it_id.'">'.$img.'</a>';
return $img;
}
function get_it_thumbnail($img, $width, $height=0, $id='')
{
$str = '';
$file = G4_DATA_PATH.'/item/'.$img;
if(is_file($file))
$size = @getimagesize($file);
if($size[2] < 1 || $size[2] > 3)
return '';
$img_width = $size[0];
$img_height = $size[1];
$filename = basename($file);
$filepath = dirname($file);
if($img_width && !$height) {
$height = round(($width * $img_height) / $img_width);
}
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3');
if($thumb) {
$file_url = str_replace(G4_PATH, G4_URL, $filepath.'/'.$thumb);
$str = '<img src="'.$file_url.'" width="'.$width.'" height="'.$height.'"';
if($id)
$str .= ' id="'.$id.'"';
$str .= ' alt="">';
}
return $str;
}
@ -153,6 +238,36 @@ function htmlspecialchars2($str)
return $str;
}
// 상품이미지 업로드
function it_img_upload($srcfile, $filename, $dir)
{
if($filename == '')
return '';
$size = @getimagesize($srcfile);
if($size[2] < 1 || $size[2] > 3)
return '';
if(!is_dir($dir)) {
@mkdir($dir, 0707);
@chmod($dir, 0707);
}
$filename = preg_replace("/\s+/", "", $filename);
$filename = preg_replace("/[#\&\+\-%@=\/\\:;,'\"\^`~\|\!\?\*\$#<>\(\)\[\]\{\}]/", "", $filename);
$filename = preg_replace_callback(
"/[가-힣]+/",
create_function('$matches', 'return base64_encode($matches[0]);'),
$filename);
upload_file($srcfile, $filename, $dir);
$file = str_replace(G4_DATA_PATH.'/item/', '', $dir.'/'.$filename);
return $file;
}
// 파일을 업로드 함
function upload_file($srcfile, $destfile, $dir)
{

View File

@ -15,7 +15,7 @@ for ($i=0; $row=sql_fetch_array($hresult); $i++)
echo "<tr><td height=22><nobr style='display:block; overflow:hidden; width:170px;'>&nbsp;&nbsp;· ";
$it_name = get_text($row['it_name']);
// 이미지로 할 경우
//$it_name = get_it_image($row[it_id]."_s", 50, 50, $row[it_id]);
//$it_name = get_it_image($row[it_id], 50, 50, true);
echo "<a href=\"".G4_SHOP_URL."/cart.php\">$it_name</a></nobr></td></tr>\n";
}

View File

@ -25,7 +25,7 @@ $tv_div['img_length'] = 3; // 한번에 보여줄 이미지 수
$j = $i - 1;
if ($j%$tv_div['img_length']==0) $k++;
$it_name = get_text(addslashes($rowx['it_name']));
$img = get_it_image($tv_it_id."_s", $tv_div['img_width'], $tv_div['img_height'], $tv_it_id);
$img = get_it_image($tv_it_id, $tv_div['img_width'], $tv_div['img_height'], $tv_it_id);
if ($i==1) echo '<ul id="stv_ul">'.PHP_EOL;
echo '<li class="stv_item c'.$k.'">'.PHP_EOL;
echo $img;

View File

@ -15,7 +15,7 @@ for ($i=0; $row=sql_fetch_array($hresult); $i++)
echo "<tr><td height=22><nobr style='display:block; overflow:hidden; width:170px;'>&nbsp;&nbsp;· ";
$it_name = get_text($row['it_name']);
// 이미지로 할 경우
//$it_name = get_it_image($row[it_id]."_s", 50, 50, $row[it_id]);
//$it_name = get_it_image($row[it_id], 50, 50, true);
echo "<a href=\"".G4_SHOP_URL."/wishlist.php\">$it_name</a></nobr></td></tr>\n";
}

View File

@ -92,13 +92,13 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
}
if ($s_page == 'cart.php' || $s_page == 'orderinquiryview.php') { // 링크를 붙이고
$a1 = '<a href="./item.php?it_id='.$row[it_id].'"><b>';
$a1 = '<a href="./item.php?it_id='.$row['it_id'].'"><b>';
$a2 = '</b></a>';
$image = get_it_image($row['it_id'].'_s', 70, 70, '');
$image = get_it_image($row['it_id'], 70, 70);
} else { // 붙이지 않고
$a1 = '<b>';
$a2 = '</b>';
$image = get_it_image($row['it_id'].'_s', 50, 50);
$image = get_it_image($row['it_id'], 50, 50);
}
$it_name = $a1 . stripslashes($row['it_name']) . $a2;

View File

@ -171,32 +171,43 @@ else
<div id="sit_ov_wrap">
<div id="sit_pvi">
<?php
$img_big = $it['it_id'].'_l1'; // 기본이미지(대)
?>
<div id="sit_pvi_big">
<a href="<?php echo G4_SHOP_URL; ?>/largeimage.php?it_id=<?php echo $it['it_id']; ?>&amp;img=<?php echo $img_big; ?>" id="<?php echo $img_big; ?>" class="popup_item_image" target="_blank"><img src="<?php echo G4_DATA_URL; ?>/item/<?php echo $img_big; ?>" alt=""></a>
<?php
$thumbnails = array();
for($i=1; $i<=10; $i++) {
if(!$it['it_img'.$i])
continue;
$img = get_it_thumbnail($it['it_img'.$i], 320, 320);
if($img) {
// 썸네일
$thumb = get_it_thumbnail($it['it_img'.$i], 60, 60);
$thumbnails[] = $thumb;
?>
<a href="<?php echo G4_SHOP_URL; ?>/largeimage.php?it_id=<?php echo $it['it_id']; ?>&amp;no=<?php echo $i; ?>" class="popup_item_image" target="_blank"><?php echo $img; ?></a>
<?php
}
}
?>
</div>
<?php
// 이미지(중) 썸네일
for ($i=1; $i<=5; $i++)
{
if ($i == 1) echo '<ul id="sit_pvi_thumb">';
if ($i == 5) $sit_pvi_last = 'class="li_last"';
echo '<li '.$sit_pvi_last.'>';
if (file_exists(G4_DATA_PATH.'/item/'.$it_id.'_l'.$i))
{
echo get_large_image($it_id.'_'.$i, $it['it_id'], false);
if ($i==1 && file_exists(G4_DATA_PATH.'/item/'.$it_id.'_s'))
echo '<a href="#sit_pvi_big" id="'.$it_id.'_s" class="img_thumb"><img src="'.G4_DATA_URL.'/item/'.$it_id.'_s" alt="" id="sit_pvi_t'.$i.'" ';
else
echo '<a href="#sit_pvi_big" id="'.$it_id.'_l'.$i.'" class="img_thumb"><img src="'.G4_DATA_URL.'/item/'.$it_id.'_l'.$i.'" alt="" id="sit_pvi_t'.$i.'" ';
//echo ' onmouseover="document.getElementById(\''.$middle_image.'\').src=document.getElementById(\'middle'.$i.'\').src;">';
echo '></a>';
// 썸네일
$thumb1 = true;
$thumb_count = 0;
$total_count = count($thumbnails);
if($total_count > 0) {
echo '<ul id="sit_pvi_thumb">';
foreach($thumbnails as $val) {
$thumb_count++;
$sit_pvi_last ='';
if ($thumb_count % 5 == 0) $sit_pvi_last = 'class="li_last"';
echo '<li '.$sit_pvi_last.'>';
echo '<a href="#sit_pvi_big" class="img_thumb">'.$val.'</a>';
echo '</li>';
}
echo '</li>';
echo '</ul>';
}
if ($i > 1) echo '</ul>';
?>
</div>
@ -504,21 +515,20 @@ else
<script>
$(function(){
$("#sit_pvi_big a:first").addClass("visible");
// 이미지 미리보기
$("#sit_pvi .img_thumb").bind("hover focus", function(){
var img_src = $(this).attr("id").replace("_s", "_l1");
$("#sit_pvi_big img").attr("src","<?php echo G4_DATA_URL; ?>/item/"+img_src); // 이미지 소스 교체
$("#sit_pvi_big a").attr("id", img_src);
$("#sit_pvi .img_thumb").bind("mouseover focus", function(){
var idx = $("#sit_pvi .img_thumb").index($(this));
$("#sit_pvi_big a.visible").removeClass("visible");
$("#sit_pvi_big a:eq("+idx+")").addClass("visible");
});
// 상품이미지 크게보기
$(".popup_item_image").click(function() {
var it_id = "<?php echo $it['it_id']; ?>";
var img = $(this).attr("id");
var url = $(this).attr("href");
var top = 10;
var left = 10;
var url = "<?php echo G4_SHOP_URL; ?>/largeimage.php?it_id=" + it_id + "&img=" + img;
var opt = 'scrollbars=yes,top='+top+',left='+left;
popup_window(url, "largeimage", opt);

View File

@ -40,7 +40,7 @@ $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";
$it_mimg = get_it_image($it_id, $default['de_mimg_width'], $default['de_mimg_height']);
ob_start();
include G4_SHOP_PATH.'/mail/itemrecommend.mail.php';

View File

@ -40,7 +40,7 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
$thumb = new g4_thumb(G4_DATA_PATH.'/itemuse', 500);
$is_content = $thumb->run($row['is_content']);
$is_time = substr($row['is_time'], 2, 14);
$small_image = $row['it_id']."_s";
$small_image = $row['it_id'];
$row2 = sql_fetch(" select it_name from {$g4['shop_item_table']} where it_id = '{$row['it_id']}' ");
$it_href = G4_SHOP_URL."/item.php?it_id={$row['it_id']}";

View File

@ -7,16 +7,17 @@ if (G4_IS_MOBILE) {
}
$it_id = $_GET['it_id'];
$img = $_GET['img'];
$no = $_GET['no'];
$sql = " select it_id, it_name from {$g4['shop_item_table']} where it_id='$it_id' ";
$sql = " select it_id, it_name, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g4['shop_item_table']} where it_id='$it_id' ";
$row = sql_fetch_array(sql_query($sql));
if(!$row['it_id'])
alert_close('상품정보가 존재하지 않습니다.');
$imagefile = G4_DATA_PATH."/item/$img";
$imagefileurl = G4_DATA_URL."/item/$img";
$imagefile = G4_DATA_PATH.'/item/'.$row['it_img'.$no];
$imagefileurl = G4_DATA_URL.'/item/'.$row['it_img'.$no];
$size = getimagesize($imagefile);
$g4['title'] = "{$row['it_name']} ($it_id)";
@ -27,23 +28,40 @@ include_once(G4_PATH.'/head.sub.php');
<h1>상품 이미지 새 창 보기</h1>
<div id="sit_pvi_nwbig">
<a href="javascript:window.close();">
<img src="<?php echo $imagefileurl; ?>" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>" alt="<?php echo $row['it_name']; ?>" id="largeimage">
</a>
<?php
$thumbnails = array();
for($i=1; $i<=10; $i++) {
if(!$row['it_img'.$i])
continue;
$file = G4_DATA_PATH.'/item/'.$row['it_img'.$i];
if(is_file($file)) {
// 썸네일
$thumb = get_it_thumbnail($row['it_img'.$i], 60, 60);
$thumbnails[$i] = $thumb;
$imageurl = G4_DATA_URL.'/item/'.$row['it_img'.$i];
?>
<span>
<a href="javascript:window.close();">
<img src="<?php echo $imageurl; ?>" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>" alt="<?php echo $row['it_name']; ?>" id="largeimage">
</a>
</span>
<?php
}
}
?>
</div>
<?php
for ($i=1; $i<=5; $i++)
{
if ($i == 1) echo '<ul>';
if (file_exists(G4_DATA_PATH."/item/{$it_id}_l{$i}")) {
$id = $it_id.'_l'.$i;
?>
<li><a href="<?php echo G4_SHOP_URL; ?>/largeimage.php?it_id=<?php echo $it_id; ?>&amp;img=<?php echo $id; ?>" id="<?php echo $id; ?>" class="img_thumb"><img id="large<?php echo $i; ?>" src="<?php echo G4_DATA_URL; ?>/item/<?php echo $id; ?>" alt=""></a></li>
<?php
$total_count = count($thumbnails);
$thumb_count = 0;
if($total_count > 0) {
echo '<ul>';
foreach($thumbnails as $key=>$val) {
echo '<li><a href="'.G4_SHOP_URL.'/largeimage.php?it_id='.$it_id.'&amp;no='.$key.'" class="img_thumb">'.$val.'</a></li>';
}
echo '</ul>';
}
if ($i > 1) echo '</ul>';
?>
<div class="btn_win">
@ -58,10 +76,13 @@ $(function(){
var h = <?php echo $size[1]; ?> + 210;
window.resizeTo(w, h);
$("#sit_pvi_nwbig span:eq("+<?php echo ($no - 1); ?>+")").addClass("visible");
// 이미지 미리보기
$(".img_thumb").bind("hover focus", function(){
var img_src = $(this).attr("id");
$("#sit_pvi_nwbig img").attr("src","<?php echo G4_DATA_URL; ?>/item/"+img_src); // 이미지 소스 교체
$(".img_thumb").bind("mouseover focus", function(){
var idx = $(".img_thumb").index($(this));
$("#sit_pvi_nwbig span.visible").removeClass("visible");
$("#sit_pvi_nwbig span:eq("+idx+")").addClass("visible");
});
});
</script>

View File

@ -20,7 +20,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<?php if ($row['it_cust_amount'] && !$row['it_gallery']) { ?>
<s><?php echo display_amount($row['it_cust_amount']); ?></s>

View File

@ -20,7 +20,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<?php if ($row['it_cust_amount'] && !$row['it_gallery']) { ?>
<s><?php echo display_amount($row['it_cust_amount']); ?></s>

View File

@ -20,7 +20,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<?php if ($row['it_cust_amount'] && !$row['it_gallery']) { ?>
<s><?php echo display_amount($row['it_cust_amount']); ?></s>

View File

@ -20,7 +20,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<?php if ($row['it_cust_amount'] && !$row['it_gallery']) { ?>
<s><?php echo display_amount($row['it_cust_amount']); ?></s>

View File

@ -25,7 +25,7 @@ $ft_a_st = 'display:block;padding:30px 0;background:#484848;color:#fff;text-alig
<p style="<?php echo $cont_st; ?>"><b><?php echo $from_name; ?></b> 님께서 추천하신 상품입니다.</p>
<div style="text-align:center"><a href="<?php echo G4_SHOP_URL.'/item.php?it_id='.$it_id; ?>" target="_blank"><img src="<?php echo G4_DATA_URL.'/item/'.$it_mimg; ?>" alt=""></a></div>
<div style="text-align:center"><a href="<?php echo G4_SHOP_URL.'/item.php?it_id='.$it_id; ?>" target="_blank"><?php echo $it_mimg; ?></a></div>
<p style="<?php echo $cont_st; ?>"><strong><?php echo $subject; ?></strong></p>

View File

@ -19,7 +19,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">

View File

@ -19,7 +19,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">

View File

@ -20,7 +20,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_arw_toleft"></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<p><?php echo $row['it_basic']; ?></p>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>

View File

@ -20,7 +20,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_arw_toleft"></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<p><?php echo $row['it_basic']; ?></p>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>

View File

@ -85,7 +85,7 @@ include_once('./_head.php');
if ($i>0)
echo "<tr><td colspan=3 height=1 background='".G4_SHOP_URL."/img/dot_line.gif'></td></tr>";
$image = get_it_image($row['it_id']."_s", 70, 70, $row['it_id']);
$image = get_it_image($row['it_id'], 70, 70, true);
?>
<tr>

View File

@ -31,7 +31,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i]['g_dir'] = G4_URL;
$list[$i]['it_id'] = $row['it_id'];
$list[$i]['it_simg'] = get_it_image("{$row['it_id']}_s", $default['de_simg_width'], $default['de_simg_height']);
$list[$i]['it_simg'] = get_it_image($row['it_id'], $default['de_simg_width'], $default['de_simg_height']);
$list[$i]['it_name'] = $row['it_name'];
$list[$i]['it_origin'] = $row['it_origin'];
$list[$i]['it_opt'] = print_item_options($row['it_id'], $row['it_opt1'], $row['it_opt2'], $row['it_opt3'], $row['it_opt4'], $row['it_opt5'], $row['it_opt6']);

View File

@ -54,7 +54,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
unset($list);
$list['it_id'] = $row['it_id'];
$list['it_simg'] = get_it_image("{$row['it_id']}_s", $default['de_simg_width'], $default['de_simg_height']);
$list['it_simg'] = get_it_image($row['it_id'], $default['de_simg_width'], $default['de_simg_height']);
$list['it_name'] = $row['it_name'];
$list['it_opt'] = print_item_options($row['it_id'], $row['it_opt1'], $row['it_opt2'], $row['it_opt3'], $row['it_opt4'], $row['it_opt5'], $row['it_opt6']);
$list['ct_qty'] = $row['ct_qty'];

View File

@ -132,7 +132,7 @@ $total_count = $row['cnt'];
from {$g4['shop_item_table']} where it_id = '{$save['it_id'][$i]}' ";
$row = sql_fetch($sql);
$image = get_it_image($row['it_id'].'_s', (int)($default['de_simg_width']), (int)($default['de_simg_height']), $row['it_id']);
$image = get_it_image($row['it_id'], (int)($default['de_simg_width']), (int)($default['de_simg_height']), true);
?>
<tr>
<td class="ssch_it_img"><?php echo $image; ?></td>

View File

@ -54,7 +54,7 @@ include_once('./_head.php');
if ($row['it_tel_inq']) $out_cd = 'tel_inq';
$image = get_it_image($row['it_id'].'_s', 70, 70, '');
$image = get_it_image($row['it_id'], 70, 70);
$s_del = '';
?>