"; $gdprcoc = ""; $sgsumoc = number_format($sgsumo) . "
"; } else { $ciidChecked = ""; $gdprcoc = ""; $sgsumoc = ""; } $couponstring = << $cpn »ç¿ë EOS; } else { $gdprcoc = ""; $sgsumoc = ""; $couponstring = ""; } $gdprcc = number_format($gdprc); $sgsumc = number_format($sgsum); $shopcartlist .= << $count $gdn $couponstring $gdprcoc $gdprcc
($gdbnsc)
$sgsumoc $sgsumc
($gdbonusc) EOS; } function mkShopCart(&$document, &$script, &$init, $usid) { global $PSYCHEID; if (!$usid) $usid = $PSYCHEID; $today = date("Y-m-d"); $count = 0; $shopcartlist = ""; $sgtotal = 0; $totalsum = 0; $totalsumo = 0; $totalgdbonus = 0; $maxidx = 0; if (sizeof($_SESSION['SHOPCART'])) { while ( list($idx, list($gdi, $sgq, $ctcii)) = each($_SESSION['SHOPCART']) ) { $result = mysql_query("select gd.gdname, gd.gdprice1, gd.gdprice2, gd.gdprice3, gd.gdprice4, gd.gdbonus, ci.ciid, cp.cpname, cp.cpprice, cp.cprate from goods as gd left join coupon as cp on gd.gdid = cp.gdid and cp.cpexpire >= '$today 00:00:00' left join cpissue as ci on cp.cpid = ci.cpid and ci.usid = '$usid' and ci.cistat = 'O' where gd.gdid = '$gdi' order by ci.ciid desc limit 1"); list($gdn, $gdprc1, $gdprc2, $gdprc3, $gdprc4, $gdbns, $dbcii, $cpn, $cpprc, $cprt) = mysql_fetch_row($result); if (false) { $gdprco = $gdprc1; } elseif (false) { $gdprco = $gdprc2; } elseif (true) { $gdprco = $gdprc3; } else { $gdprco = $gdprc4; } $cpprc += 0; $cprt += 0; $sgsumo = $gdprco * $sgq; $totalsumo += $sgsumo; $gdbonus = $gdbns * $sgq; $totalgdbonus += $gdbonus; // ÄíÆù Á¤Ã¥ ¼öÁ¤: ´Ü°¡ Àû¿ë -> ÃÑ¾× Àû¿ë (2005-04-20) $gdprc = $gdprco; if ($dbcii && $ctcii == $dbcii) { if ($cpprc) { $sgsum = $sgsumo - $cpprc; } elseif ($cprt) { $sgsum = (int) ($sgsumo - $sgsumo * $cprt * 0.01); } else { $sgsum = $sgsumo; } } else { $sgsum = $sgsumo; } $sgtotal += $sgsum; mkShopCartRow( $shopcartlist, $gdi, $gdn, $gdprco, $gdprc, $sgq, $sgsumo, $sgsum, $gdbns, $gdbonus, $dbcii, $cpn, $ctcii, $cpprc, $cprt, $idx, ++$count, $usid ); $maxidx = max($idx, $maxidx); } $countstring = << ÃÑ ÁÖ¹®»óǰ {$count}Á¾ EOS; # Àû¸³±Ý $result = mysql_query("select uspoint from users where usid = '$usid'"); list($uspoint) = mysql_fetch_row($result); $usedpoint = min( min($uspoint, $_SESSION['SHOPPOINT']), $sgtotal ); if ($usedpoint != $_SESSION['SHOPPOINT']) { $_SESSION['SHOPPOINT'] = $usedpoint; } $usedpointc = number_format($usedpoint); # ÃÑÇÕ°è $totalsum = $sgtotal - $usedpoint; /* // edited by codehexa // $send_fee=2500won // ¸¸¾à ±Ý¾×ÀÌ 50000¿øÀÌ»óÀÎ °æ¿ì Åùè¿ä±Ý »©±â // $send_fee=2500; $limit_sum=50000; $totalsum = $sgtotal - $usedpoint; if ($totalsum < $limit_sum): $totalsum=$totalsum+$send_fee; endif; if ($totalsum > $limit_sum): $fee_msg="ÁÖ¹®±Ý¾×ÀÌ ".number_format($limit_sum)." ¿ø ÀÌ»óÀ̱⿡ ¹è¼Ûºñ ( ".number_format($send_fee)."¿ø )°¡ ¸éÁ¦µË´Ï´Ù"; else: $fee_msg="ÁÖ¹®±Ý¾×ÀÌ ".number_format($limit_sum)." ¿ø ¹Ì¸¸À̱⿡ ¹è¼Ûºñ ( ".number_format($send_fee)."¿ø )°¡ Ãß°¡µË´Ï´Ù"; endif; $send_fee=number_format($send_fee); $limit_sum=number_format($limit_sum); // ¿©±â±îÁö */ if ($totalsum == $totalsumo) { $totalsumoc = ""; $totalsumc = number_format($totalsum); } else { $totalsumoc = number_format($totalsumo) . "
"; $totalsumc = number_format($totalsum); } $totalgdbonusc = number_format($totalgdbonus); if ($uspoint) { $uspointc = number_format($uspoint) . "¿ø"; $usingpointstring = <<
ÇöÀç Àû¸³±Ý $uspointc »ç¿ë Àû¸³±Ý ¿ø
EOS; } else { $usingpointstring = << EOS; } //¸ðµç »óǰ Àû¿ë ÄíÆù ¿©ºÎ $result = mysql_query("select ci.ciid, cp.cpname, cp.cpprice, cp.cprate from coupon as cp left join cpissue as ci on cp.cpid = ci.cpid and ci.usid = '$usid' and ci.cistat = 'O' where cp.gdid = '0' and cp.cpexpire >= '$today 00:00:00' order by ci.ciid desc limit 1"); $cocnt=0; while (list($dbcii, $cpn, $cpprc, $cprt) = mysql_fetch_row($result)) //¸ðµç »óǰ »ç¿ë ÄíÆùÀÌ ÀÖÀ¸¸é { $cocnt++; if ($cpprc==0) { $sale = (int)$cprt."% ÇÒÀÎ ÄíÆù"; $scsale = "'".(int)$cprt."','r'"; } else { $sale = (int)$cpprc."¿ø ÇÒÀÎ ÄíÆù"; $scsale = "'".(int)$cpprc."','p'"; } $usingallcouponstring = <<
$sale ÇÒÀÎ ±Ý¾× ¿ø
EOS; } /*$orderstring = << EOS;*/ $orderstring = << EOS; $delallstring = << EOS; } else { $shopcartlist .= << Àå¹Ù±¸´Ï°¡ ºñ¾î ÀÖ½À´Ï´Ù. EOS; } $document['main'] = << {$document['leftmenu']}
Ȩ > ¼îÇθô > Àå¹Ù±¸´Ï

°í°´´Ô²²¼­ ÁÖ¹®ÇÏ½Ç »óǰÀÔ´Ï´Ù. $countstring
$shopcartlist
EOS; if ($count) { $document['main'] .= <<
$fee_msg
$totalsumoc $totalsumc    
¼ö·® º¯°æ ÈÄ, '¼öÁ¤' ¹öưÀ» ´­·¯ ÁÖ¼Å¾ß Àû¿ëµË´Ï´Ù.
EOS; } $document['main'] .= <<
$orderstring $delallstring

 

 

{$document['rightbanner']} EOS; $script .= <<"; totalsumoff_el.innerHTML = numberFormat(totalsm); } // edited by codehexa, 2006-05-29 if (totalsm <= limitvalue){ totalsm=totalsm+sendfee; } totalsumoff_el.innerHTML= numberFormat(totalsm); // edited by Codehexa, 2006-05-29 document.getElementById("totalsum").value = totalsm; } function getCIIdString() { maxidx_el = document.getElementById("maxidx"); maxi = parseInt(maxidx_el.value); if (!maxi) maxi = 0; ciidstring = ""; for (i = 1; i <= maxi; i++) { ciid_el = document.getElementById("ciid["+i+"]"); if (ciid_el) { if (ciid_el.checked) { ciidstring += "&ciid["+i+"]=" + ciid_el.value; } else { ciidstring += "&ciid["+i+"]=0"; } } } return ciidstring; } function modSGQty(n) { sgqty_el = document.getElementById("sgqty["+n+"]"); if (!sgqty_el || !sgqty_el.value) return; window.location.href = "{$_SERVER['PHP_SELF']}?cartmod=" + n + "&sgqty=" + sgqty_el.value } function delCart(n) { if (confirm("ÀÌ »óǰÀ» Àå¹Ù±¸´Ï¿¡¼­ Á¦°ÅÇϽðڽÀ´Ï±î?")) { window.location.href = "{$_SERVER['PHP_SELF']}?cartdel=" + n } } function delCartAll() { if (confirm("Àå¹Ù±¸´ÏÀÇ »óǰÀ» ¸ðµÎ Á¦°ÅÇϽðڽÀ´Ï±î?")) { window.location.href = "{$_SERVER['PHP_SELF']}?cartdelall=1" } } EOS; } # Start if ($cartmod) { $_SESSION['SHOPCART'][$cartmod][1] = $sgqty; if (sizeof($ciid)) { while (list($i, $cii) = each($ciid)) { // SHOPCART: 0 gdid, 1 sgqty, 2 ciid if ($_SESSION['SHOPCART'][$i][0]) { $_SESSION['SHOPCART'][$i][2] = $cii; } } } header("Location: {$_SERVER['PHP_SELF']}?cartmodok=1"); return; } if ($cartdel) { unset($_SESSION['SHOPCART'][$cartdel]); if (sizeof($ciid)) { while (list($i, $cii) = each($ciid)) { if ($_SESSION['SHOPCART'][$i][0]) { // SHOPCART: 0 gdid, 1 sgqty, 2 ciid $_SESSION['SHOPCART'][$i][2] = $cii; } } } header("Location: {$_SERVER['PHP_SELF']}"); return; } if ($cartdelall) { $_SESSION['SHOPCART'] = array(); header("Location: {$_SERVER['PHP_SELF']}"); return; } if ($cartmodok) { $alert = "¼öÁ¤µÇ¾ú½À´Ï´Ù."; } mkShopCart($document, $script, $init, $usid); if ($alert) { $init = "\talert(\"$alert\");\n\n" . $init; } require "shop_template.php";