THEME BACKGROUND

질문게시판

카테고리 비비샵4.x
글쓴이 블랙오션(webar***)2011-01-18 22:19:13
제목 판매가 반올림에대한 문의 lip.php부분입니다. 해결이 안되네요 ㅡㅡ;
내용
function get_item_list($item_type, $class_id, $auto="n", $sql="", $img_type="s", $num="4", $total_num="8", $width, $height, $num_img="n", $skin_file ) {
 global $connect, $item_table, $class_table, $member_table, $select_table, $screen_table, $infor_table, $studio_table, $_item_img_dir;
 global $ITEMHEADER, $TR, $CLASS_NAME, $ITEM_NAME, $ITEM_PRE_EXPLAN, $ITEM_COPRICE, $ITEM_SEPRICE, $ITEM_POINT, $IMG, $AITEM, $sale, $studio_name, $icon_sale,$b_num,$icon_new,$icon_hit,$icon_good,$member,$icon_zero,$zero,$icon1,$icon2,
 $icon3,$icon4,$icon5,$icon6,$icon7,$focus_seprice;
 $ITEMHEADER="";
 $TR="";
 $CLASS_NAME="";
 $ITEM_NAME="";
 $ITEM_PRE_EXPLAN="";
 $ITEM_COPRICE="";
 $ITEM_SEPRICE="";
 $ITEM_POINT="";
 $IMG="";
 $AITEM="";
 $sale="";
 $zero="";
 $icon_sale="";
 $icon_zero="";
 $b_num="";
 $studio_name="";
 $icon_new="";
 $icon_hit="";
 $icon_good="";
    $level_name="level";
 $round_num="";
    $icon1="";
 $icon2="";
 $icon3="";
 $icon4="";
 $icon5="";
  $icon6="";
  $icon7="";
 $setup2=mysql_fetch_array(mysql_query("select skin_name from $screen_table",$connect));
 $setup3=mysql_fetch_array(mysql_query("select shop_url, shop_path from $infor_table",$connect));
 if(!$setup2[skin_name]) $setup2[skin_name]="default";
 $_shop_url = $setup3[shop_url];
 $_shop_path = $setup3[shop_path];
 $_skin_dir = "skin/$setup2[skin_name]";
 $ns_width = (int)(100 / $num);
 if(!$sql) {
  if($class_id) {
   item_list($class_id, $class_id2);
   $class_sql=" class_id in ('$class_id'  $class_id2 ) and ";
  }
  if($item_type=="new") {
   if($auto=='y') {
   $time=time();
   $todate=date("Y-m-d",$time);
   $lastday=$setup2[nperiod]*24*60*60;
   $yeday=$time-$lastday;
   $yedate=date("Y-m-d",$yeday);
//   $sql = " select * from $item_table where $class_sql item_sw = 'Y' and substring(date, 1, 10) between '$yedate' and '$todate' and item_rank >= 0 order by rand() limit $total_num";
   $sql = " select * from $item_table where $class_sql item_sw = 'Y' and substring(date, 1, 10) between '$yedate' and '$todate' and item_rank >= 0 order by item_rank desc limit $total_num";
   }else {
//   $sql = " select * from $item_table where $class_sql item_sw = 'Y' and item_rank >= 0 order by rand() limit $total_num";
   $sql = " select * from $item_table where $class_sql item_sw = 'Y' and item_rank >= 0 order by item_rank desc limit $total_num";
   }
  }else if($item_type=="good") {
//   $sql = " select * from $item_table where $class_sql item_good = 'Y' and item_rank >= 0 order by rand() limit $total_num";
   $sql = " select * from $item_table where $class_sql item_good = 'Y' and item_rank >= 0 order by item_rank desc limit $total_num";
  }else if($item_type=="hit") {
   if($auto=="y") {
   $sql = " select * from $item_table where $class_sql item_rank >= 0 order by item_hit1+a.item_hit2*20 desc limit $total_num";
   }else {
//   $sql = " select * from $item_table where $class_sql item_hit = 'Y' and item_rank >= 0 order by rand() limit $total_num";
   $sql = " select * from $item_table where $class_sql item_hit = 'Y' and item_rank >= 0 order by item_rank desc limit $total_num";
   }
  }else if($item_type=="plan") {
//   $sql = " select * from $item_table where $class_sql item_plan ='Y' and item_rank >= 0 limit $total_num";
   $sql = " select * from $item_table where $class_sql item_plan ='Y' and item_rank >= 0 order by item_rank desc limit $total_num";
  }else {
//   $sql = "select * from $item_table where $class_sql item_rank>=0 order by rand() limit $total_num";
   $sql = " select * from $item_table where $class_sql item_plan ='Y' and item_rank >= 0 limit order by item_rank desc $total_num";
  }
 }
 if(!$sql) print ("설정이 잘못되었습니다.");
 $result = mysql_query($sql);
 $loop=1;
 $i=0;
 $a_num=0;
 $count=mysql_num_rows($result);
 while($row=mysql_fetch_array($result)) {
  $ITEMHEADER[$loop]=$loop;
  if($i%$num==0 && $i!=0) $TR[$loop]= "</tr><tr><td height=1 colspan='$num' bgcolor=#EFEFEF></td></tr><tr><td height=10 colspan='$num'></td></tr><tr>";
  else $TR[$loop]= " ";
  $i++;
  $ITEM_NAME[$loop]=str_replace("/","<br>",$row[item_name]);
  $ITEM_PRE_EXPLAN[$loop]=cut_strs($row[item_pre_explan],10);
  $ITEM_COPRICE[$loop]=number_format($row[item_coprice]);
       
       
  // 판매가 정리
  if($setup3[board_name]=="rgboard"||$setup3[board_name]=="gnuboard") {
   if($member[$level_name]>'3') $SEPRICE=$row[item_seprice_a];
   else if($member[$level_name]=='3') $SEPRICE=$row[item_seprice_b];
   else if($member[$level_name]=='2') $SEPRICE=$row[item_seprice_c];
   else if($member[$level_name]=='1'||$member[$level_name]=='') $SEPRICE=$row[item_seprice];
   if(!$SEPRICE) $SEPRICE=$row[item_seprice];
  }else {
   if($member[$level_name]<'5') $SEPRICE=$row[item_seprice_a];
   else if($member[$level_name]=='5') $SEPRICE=$row[item_seprice_b];
   else if($member[$level_name]=='6') $SEPRICE=$row[item_seprice_c];
   else if($member[$level_name]=='7'||$member[$level_name]=='') $SEPRICE=$row[item_seprice];
   if(!$SEPRICE) $SEPRICE=$row[item_seprice];
  }
       
        //특별가격
        if($row[item_focus]=='Y') {
        $SEPRICE=$row[focus_seprice];
        $focus_seprice[$loop]="<font color=red>[특별가]</font>";
        } else {
        $focus_seprice[$loop]=" ";
        }
       
        if($setup3[plus_price]>0) {
   $SEPRICE=$SEPRICE+($SEPRICE*$setup3[plus_price]/100);
  }
  if($setup3[minus_price]>0) {
   $SEPRICE=$SEPRICE-($SEPRICE*$setup3[minus_price]/100);
  }
  if($SEPRICE) $SEPRICE=round($SEPRICE,-$setup3[round_num]);
       
  $ITEM_SEPRICE[$loop]=number_format($SEPRICE);
       
        if($setup3[use_point]=='0') {
  $use_point="0";
  $hide_point_start="<!--"; $hide_point_end="-->";
  $POINT="0";
        }
  
        // 적립금 정리
  if($setup3[use_point]=='0') {
  $use_point="0";
  $hide_point_start="<!--"; $hide_point_end="-->";
  $POINT="0";
 }else {
  $use_point="1";
  $hide_point_start=" ";  $hide_point_end=" ";
  if($setup3[point_type]=="0") { // 퍼센트로 일률적용
   $POINT=$SEPRICE*$setup3[point_percent]/100;
  }else { // 개별적용
   if($setup3[board_name]=="rgboard"||$setup3[board_name]=="gnuboard") {
    if($member[$level_name]>'3') $POINT=$row[item_point_a];
    else if($member[$level_name]=='3') $POINT=$row[item_point_b];
    else if($member[$level_name]=='2') $POINT=$row[item_point_c];
    else if($member[$level_name]=='1'||$member[$level_name]=='') $POINT=$row[item_point];
   
   }else {
    if($member[$level_name]<'5') $POINT=$row[item_point_a];
    else if($member[$level_name]=='5') $POINT=$row[item_point_b];
    else if($member[$level_name]=='6') $POINT=$row[item_point_c];
    else if($member[$level_name]=='7'||$member[$level_name]=='') $POINT=$row[item_point];
   
   }
            if($POINT) {
   $POINT=round($POINT,-$setup3[round_num2]);
            $ITEM_POINT[$loop]=number_format($POINT);
 }else {
   $ITEM_POINT="0";
  }
  $point_cn2=$POINT;
 }
}
 
____________________________________________________________________________________
 
lip부분에 판매가 정리에서
if($setup3[plus_price]>0) {
   $SEPRICE=$SEPRICE+($SEPRICE*$setup3[plus_price]/100);
  }
  if($setup3[minus_price]>0) {
   $SEPRICE=$SEPRICE-($SEPRICE*$setup3[minus_price]/100);
  }
  if($SEPRICE) $SEPRICE=round($SEPRICE,-$setup3[round_num]);
       
  $ITEM_SEPRICE[$loop]=number_format($SEPRICE);
 
이런식으로 지정을 해주어도
 
상품의 전체가격 올리기와 가격내리기 반올림에 대한 문제가 있어 문의드립니다.
전혀 이부분이 작동을 하지 않아요 ㅡㅡ; 마지막 1원 까지도 다 나와서 해결을 할려고 하는데
해결이 되지 않네요 ㅡㅡ; 고수님들의 답변을 얻고 싶습니다. ㅡㅡ;

원격지원

전화상담후 진행할 수 있습니다.