<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가


//$cart_menu_path = "$g4[path]/skin/cart/cart_menu/$skin_dir";

$sub_cate_url = "$g4[bbs_path]/board.php?bo_table=shopping";
?>

<style type="text/css">
a.cart_title:link{ COLOR:166ec1;}
a.cart_title:hover{ COLOR:166ec1;text-decoration:underline;}
a.cart_title:visited{ COLOR:6185a6;text-decoration:none;}
</style>






<!-- 왼쪽메뉴-->
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<tr>
  <td background='<?=$cart_menu_path?>/img/neto4.gif' width="10"></td>
  <td align='center' valign='top' bgcolor='#FFFFFF' >
    <!-------------------멀티 카테고리 출력---------------->

    <table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td align="center" height="28" bgcolor="#dad9da"><a href="<?=$sub_cate_url?>">빌더몰</a></td></tr>
	<tr><td height="5"></td></tr>
    <tr>
      <td class="latest_title" valign='top' >
        <table width="100%" cellpadding="0" cellspacing="1" border="0">
        <?
        for ($i=0; $i<count($list = sql_fetch_array($result)); $i++) {
            //경로
            $cart_href  = "{$sub_cate_url}&cart_id={$list[ne_1]}";



            $u_mct        = " ne_1 = '$list[ne_1]' ";
            $u_sql        = " select wr_num,wr_reply,wr_reply from {$cart_table} where $u_mct ";
            $u_result     = sql_fetch($u_sql);

            $reply_len = strlen($u_result[wr_reply]) + 1;
            $mct            = " wr_num = '$u_result[wr_num]' ";
            $mct           .= " and length(wr_reply) = '$reply_len' ";

            if($reply_len >= '2'){
                $mct           .= " and wr_reply LIKE  '$u_result[wr_reply]%' ";

            }
            $sub_sql      = " select * from $cart_table where  {$mct}  order by ne_8, wr_id desc ";
            $sub_result   = sql_query($sub_sql);
            $sub_count = mysql_num_rows($sub_result);

            $cn  = 2;


        ?>
        <tr>
          <td valign='top'>
            <table  width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td  style='padding-left:0px;' valign='top'>
                  <img src='<?=$cart_menu_path?>/img/sub_bul.gif' border='0'>
                <?
            echo "<a href='{$cart_href}'><b>";
            echo $list[wr_subject];
            echo "</b></a>";
                ?>
              </td>
            </tr>
			<tr><td valign="top">
                <!-------------------------서브메뉴------------------->
                <table  width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr><td height="5"></td></tr>
                      <?
                $k=1;
                $v_row = 1; //가로줄갯수
                while ($s_row = sql_fetch_array($sub_result)){
                    $cart_href2  = "{$sub_cate_url}&cart_id={$s_row[ne_1]}";

                    if($s_row[ne_1] == $cart_id)
                        $s_row[wr_subject]  = "<span style='color:#ff6600;font-weight:bold;'>{$s_row[wr_subject]}</span>";
                      ?>
                      <td style='padding-left:20px;width:100px;'>
                        <?
                    echo "<a href='{$cart_href2}'>";
                    echo $s_row[wr_subject];
                    echo "</a>";
                        ?>
                      </td>
                      <?
                    //줄내림
                    if($k%$v_row==0)echo"</tr><tr><td colspan='$colspan' align=center height=5></tr><tr>";
                    $k++;
                }
                      ?>
                </table>
                <!-----------------------//서브메뉴------------------->
			</td></tr>
            </table>
          </td>
        </tr>

         <tr>
			<td colspan="2" height="1" background="<?=$cart_menu_path?>/img/dot_line.gif"></td>
		 </tr>
        <tr><td height='10'></td></tr>
        <?}?>

        <? if (count($list) == 0) { ?><tr><td align=center height=200 colspan="2">게시물이 없습니다.</a></td></tr><? } ?>
        </table>
      </td>
    </tr>
    </table>
    <!-----------------//멀티 카테고리 출력---------------->
  </td>
  <td width="10" background='<?=$cart_menu_path?>/img/neto5.gif'></td>
</tr>
<tr>
  <td height='10'><img src='<?=$cart_menu_path?>/img/neto6.gif' width='10' height='10' border='0'></td>
  <td background='<?=$cart_menu_path?>/img/neto7.gif'></td>
  <td><img src='<?=$cart_menu_path?>/img/neto8.gif' width='10' height='10' border='0'></td>
</tr>
</table>
