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


///////////////빌더 data 를 불러온다///////////////////////////
 $g4_table[g4_site_bill]   =  "g4_site_bill"; 
  //수정인경우
 if($w == 'u'){
  $g4_table[g4_site_bill]   =  "g4_site_bill";
  $mct                      =  "  po_poll1      = '$gr_id' "; 
  $mct                     .=  " and  po_poll9  = 'gr_id' "; 
  $site_bill                = sql_fetch("select * from $g4_table[g4_site_bill] where  $mct");

  $site_bill[po_cnt4] = $site_bill[po_cnt1] - $site_bill[po_cnt2] - $site_bill[po_cnt10] - $site_bill[po_cnt3] - $site_bill[po_cnt11];
 }

  // 새로 생성인경우
 if($w == ''){
  $start_row = sql_fetch("select * from $g4_table[g4_site_bill] where  po_subject = 'head_sub' and po_poll2 = 'head_sub' ");

  //생성인경우 메인의 초기값으로 출력한다
  $site_bill[po_poll6] = $start_row['po_poll4'] ;
  $site_bill[po_cnt1] = $start_row['po_poll5'] ;
  $site_bill[po_cnt2] = $start_row['po_poll6'] ;
  $site_bill[po_cnt3] = $start_row['po_poll7'] ;
  $site_bill[po_cnt10] = $start_row['po_poll8'] ;
  $site_bill[po_cnt11] = $start_row['po_poll9'] ;

  $site_bill[po_cnt4]  =$start_row[po_poll5] - $start_row[po_poll6] - $start_row[po_poll7] - $start_row[po_poll8] - $site_bill[po_poll9];


//다음에 커리 수정.
//로그인
if(!$site_bill[po_poll2])$site_bill[po_poll2] = "basic" ;

//로그인사이즈
if(!$site_bill[po_cnt5])$site_bill[po_cnt5] = "160" ;

//구조
if(!$site_bill[po_poll3])$site_bill[po_poll3] = "basic" ;

//상단
if(!$site_bill[po_poll4])$site_bill[po_poll4] = "basic" ;

//좌측메뉴
if(!$site_bill[po_poll5])$site_bill[po_poll5] = "basic" ;

//구조변경
if(!$site_bill[po_poll10])$site_bill[po_poll10] = "basic" ;

 }

if($site_bill[po_cnt15])
  $po_cnt15_selected  = "checked";

if($site_bill[po_cnt16])
  $po_cnt16_selected  = "checked";

?>


<table width=100% cellpadding=0 cellspacing=0>
<tr class='ht'>
    <td>검색그릅에서 제외</td>
    <td colspan=3>
        <input type=checkbox name=po_cnt15 value='1' <?=$po_cnt15_selected?> >사용안함 
        <?=help("사용에 체크하시면 검색옵션에서 제외됩니다")?>
    </td>
</tr>

<tr class='ht'>
    <td>사이트맵 제외</td>
    <td colspan=3>
        <input type=checkbox name=po_cnt16 value='1' <?=$po_cnt16_selected?> >사용안함 
        <?=help("사용에 체크하시면 검색옵션에서 제외됩니다")?>
    </td>
</tr>

<tr class='ht'>
    <td>메뉴이미지등록(mouse out)</td>
    <td colspan="3">
        <input type=file name=po_poll19 class=ed size=60>
        <?
        if ($site_bill[po_poll19])
            echo "<br><a href='$g4[path]/data/file/$gr_id/$site_bill[po_poll19]' target='_blank'>$site_bill[po_poll19]</a> <input type=checkbox name='group_menu_del' value='$site_bill[po_poll19]'> 삭제";
        ?>
    </td>
</tr>

<tr class='ht'>
    <td>메뉴이미지등록(mouse over)</td>
    <td colspan="3">
        <input type=file name=po_poll18 class=ed size=60>
        <?
        if ($site_bill[po_poll18])
            echo "<br><a href='$g4[path]/data/file/$gr_id/$site_bill[po_poll18]' target='_blank'>$site_bill[po_poll18]</a> <input type=checkbox name='group_menu_del2' value='$site_bill[po_poll18]'> 삭제";
        ?>
    </td>
</tr>

<tr class='ht'>
    <td>메뉴 링크 연결사용</td>
    <td colspan="3">
        <input type=text name=po_poll17 value='<?=$site_bill[po_poll17]?>' class=ed size='100%'>
    </td>
    <td></td>
</tr>
<tr class='ht'>
    <td colspan=4 class=title align=left><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> 그릅 세부 환경설정</td>
</tr>
<tr><td colspan=4 class='line2'></td></tr>
<tr class='ht'>
    <td>그릅 정렬</td>
    <td>
       <select name="po_poll6" size="1">
        <option value="left">좌측</option>
        <option value="center">가운데</option>
        <option value="right">우측</option>
       </select>
        <script language="JavaScript">document.fboardgroup.po_poll6.value="<?=$site_bill[po_poll6]?>";</script>
    </td>
    <td>그릅 여백</td>
    <td>** 미사용 **
        <?
          //  echo "<input type='text' class=ed name='po_cnt2' value='$site_bill[po_cnt2]' maxlength=20>";
        ?>
    </td>
</tr>
<tr class='ht'>
    <td>그릅 전체폭</td>
    <td>
        <?
            echo "<input type='text' class=ed name='po_cnt1' value='$site_bill[po_cnt1]' maxlength=20>";
        ?>
    </td>
    <td>그릅 좌측폭</td>
    <td>
        <?
            echo "<input type='text' class=ed name='po_cnt2' value='$site_bill[po_cnt2]' maxlength=20>";
        ?>
    </td>
</tr>


<tr class='ht'>
    <td>그릅 좌측/메인간격</td>
    <td>
        <?
            echo "<input type='text' class=ed name='po_cnt10' value='$site_bill[po_cnt10]' maxlength=20>";
        ?>
    </td>
    <td>그릅 메인폭</td>
    <td>
        <?
            echo "<input type='text' class=ed name='po_cnt3' value='$site_bill[po_cnt3]' maxlength=20>";
        ?>
    </td>
</tr>

<tr class='ht'>
    <td>그릅 메인/우측간격</td>
    <td>
        <?
            echo "<input type='text' class=ed name='po_cnt11' value='$site_bill[po_cnt11]' maxlength=20>";
        ?>
    </td>
    <td>그릅 우측폭</td>
    <td><?=$site_bill[po_cnt4]?>
        <?
            echo "<input type='hidden' class=ed name='po_cnt4' value='$site_bill[po_cnt4]' maxlength=20>";
        ?>
    </td>
</tr>

<tr class='ht'>
    <td colspan=4 class=title align=left><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> 그릅 개별스킨설정</td>
</tr>
<tr><td colspan=4 class='line2'></td></tr>
<tr class='ht'>
    <td>그릅 외부로그인스킨</td>
    <td>
<select name=po_poll2 required itemname="외부로그인">
<option value='1'>사용안함
        <?
        $arr = get_skin_dir("outlogin");
        for ($i=0; $i<count($arr); $i++) {
            echo "<option value='$arr[$i]'>$arr[$i]</option>\n";
        }
        ?></select>
        <script language="JavaScript">document.fboardgroup.po_poll2.value="<?=$site_bill[po_poll2]?>";</script>

    </td>
    <td>그릅 외부로그인사이즈</td>
    <td>
        <?
            echo "<input type='text' class=ed name='po_cnt5' value='$site_bill[po_cnt5]' maxlength=20>";
        ?>
    </td>
</tr>

<tr class='ht'>
    <td>그릅 메인구조스킨</td>
    <td>
<select name=po_poll3 required itemname="메인구조스킨">
        <?
        $arr = get_skin_dir("main");
        for ($i=0; $i<count($arr); $i++) {
            echo "<option value='$arr[$i]'>$arr[$i]</option>\n";
        }
        ?></select>
        <script language="JavaScript">document.fboardgroup.po_poll3.value="<?=$site_bill[po_poll3]?>";</script>

    </td>
    <td>그릅 상단메뉴스킨</td>
    <td>
<select name=po_poll4 required itemname="상단메뉴스킨">
        <?
        $arr = get_skin_dir("head_menu");
        for ($i=0; $i<count($arr); $i++) {
            echo "<option value='$arr[$i]'>$arr[$i]</option>\n";
        }
        ?></select>
        <script language="JavaScript">document.fboardgroup.po_poll4.value="<?=$site_bill[po_poll4]?>";</script>
    </td>
</tr>


<tr class='ht'>
    <td>그릅 좌측메뉴스킨</td>
    <td>
<select name=po_poll5 required itemname="좌측메뉴스킨">
<option value='1'>사용안함
        <?
        $arr = get_skin_dir("sub_menu");
        for ($i=0; $i<count($arr); $i++) {
            echo "<option value='$arr[$i]'>$arr[$i]</option>\n";
        }
        ?></select>
        <script language="JavaScript">document.fboardgroup.po_poll5.value="<?=$site_bill[po_poll5]?>";</script>

    </td>
    <td>그릅 구조변경스킨</td>
    <td> 

<select name=po_poll10 required itemname="구조변경스킨">
        <?
        $arr = get_skin_dir("head_sub");
        for ($i=0; $i<count($arr); $i++) {
            echo "<option value='$arr[$i]'>$arr[$i]</option>\n";
        }
        ?></select>
        <script language="JavaScript">document.fboardgroup.po_poll10.value="<?=$site_bill[po_poll10]?>";</script>

    </td>
</tr>

<tr class='ht'>
    <td colspan=4 class=title align=left><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> 메뉴=>노출등급/순서설정</td>
</tr>
<tr><td colspan=4 class='line2'></td></tr>

<tr class='ht'>
    <td>1차메뉴 노출</td>
    <td>
	<?
	if($w == ''){
    $site_bill["po_cnt6"] = '0';
	$selected  = $site_bill["po_cnt6"];
    }
	else{
	$selected  = $site_bill["po_cnt6"];
	}


    $num_op = array('사용안함'=>'0',
	            '상단메뉴노출'=>'1',
				   '상단출력2'=>'2', 
				   '상단출력3'=>'3', 
				   '상단출력4'=>'4', 
				   '상단출력5'=>'5', 
				   '상단출력6'=>'6', 
				   '상단출력7'=>'7', 
				   '상단출력8'=>'8', 
				    '하단노출'=>'9', 
		   '메인좌측바로가기'=>'10' 

						);
	$num_c  = count($num_op);
	$name   = "po_cnt6";
	$event  = "";

    $str = "<select name='$name' $event>";
	foreach ( $num_op as $key => $value ){
        $str .= "<option value='$value'";
        if ($value == $selected) 
            $str .= " selected";
            $str .= ">$key</option>";
	}
    $str .= "</select>";
    echo  $str;

	/***
    $str = "<select name='$name' $event>";
    for ($i=0; $i<=$num_c; $i++)
    {
        $str .= "<option value='$i'";
        if ($i == $selected) 
            $str .= " selected";
            $str .= ">$i</option>";
    }
    $str .= "</select>";
    echo  $str;
	***/


	?>

        <?//=get_member_level_select('po_cnt6', 1, 10, $site_bill["po_cnt6"]) ?>
        <?=help("1 ==> 메인상단 노출, 9 ==> 메인 하단노출.\n나머지는 자신의 사이트환경에 맞게 사용하세요..", 50)?>

    </td>
    <td>1차메뉴 노출순서</td>
    <td >
        <?=get_member_level_select('po_cnt7', 1, 10, $site_bill["po_cnt7"]) ?>
        <?=help(" 노출순서.\n자신에게 맞게 설정하세요.", 50)?>
    </td>
</tr>

<tr class='ht'>
    <td>2차메뉴 노출</td>
    <td>
	<?
	if($w == ''){
    $site_bill["po_cnt8"] = '1';
	$selected  = $site_bill["po_cnt8"];
    }
	else{
	$selected  = $site_bill["po_cnt8"];
	}

    $num_op = array('노출안함'=>'10',
						  '그릅서브좌측노출'=>'1'
						  );
	$num_c  = count($num_op);
	$name   = "po_cnt8";
	$event  = "";

    $str = "<select name='$name' $event>";
	foreach ( $num_op as $key => $value ){
        $str .= "<option value='$value'";
        if ($value == $selected) 
            $str .= " selected";
            $str .= ">$key</option>";
	}
    $str .= "</select>";
    echo  $str;
	?>
        <?//=get_member_level_select('po_cnt8', 1, 10, $site_bill["po_cnt8"]) ?>
        <?=help("1 ==> 1차메뉴에 노출.\n자신에게 맞게 설정하세요.", 50)?>
    </td>
    <td>2차메뉴 노출순서</td>
    <td >
        <?=get_member_level_select('po_cnt9', 1, 10, $site_bill["po_cnt9"]) ?>
        <?=help(" 노출순서.\n자신에게 맞게 설정하세요.", 50)?>
    </td>
</tr>
<tr class='ht'>
    <td colspan=4 class=title align=left><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> 그릅 메인 세부설정</td>
</tr>
<tr><td colspan=4 class='line2'></td></tr>
<tr><td colspan=4 height="5"></td></tr>

<tr class='ht'>
    <td>그릅 서브 타이틀 이미지</td>
    <td colspan="3">
        <input type=file name=po_poll12 class=ed size=60>
        <?
        if ($site_bill[po_poll12])
            echo "<br><a href='$g4[path]/data/file/$gr_id/$site_bill[po_poll12]' target='_blank'>$site_bill[po_poll12]</a> <input type=checkbox name='group_sub_bg_del' value='$site_bill[po_poll12]'> 삭제";
        ?>
    </td>
</tr>
<tr class='ht'>
    <td>그릅 상단이미지</td>
    <td colspan="3">
        <input type=file name=po_poll14 class=ed size=60>
        <?
        if ($site_bill[po_poll14])
            echo "<br><a href='$g4[path]/data/file/$gr_id/$site_bill[po_poll14]' target='_blank'>$site_bill[po_poll14]</a> <input type=checkbox name='group_top_del' value='$site_bill[po_poll14]'> 삭제";
        ?>
    </td>
</tr>
<tr class='ht'>
    <td>그릅 하단 이미지</td>
    <td colspan="3">
        <input type=file name=po_poll13 class=ed size=60>
        <?
        if ($site_bill[po_poll13])
            echo "<br><a href='$g4[path]/data/file/$gr_id/$site_bill[po_poll13]' target='_blank'>$site_bill[po_poll13]</a> <input type=checkbox name='group_top_del2' value='$site_bill[po_poll13]'> 삭제";
        ?>
    </td>
</tr>
<tr><td colspan=4 height="5"></td></tr>
<tr class='ht'>
    <td>상단 내용</td>
    <td colspan="3"><textarea class=ed name=po_poll16 rows=5 style='width:80%;'><?=$site_bill["po_poll16"] ?></textarea></td>
</tr>
<tr><td colspan=4 height="5"></td></tr>
<tr class='ht'>
    <td>하단 내용</td>
    <td colspan="3"><textarea class=ed name=po_poll15 rows=5 style='width:80%;'><?=$site_bill["po_poll15"] ?></textarea></td></tr>
</tr>
<tr><td colspan=4 height="5"></td></tr>
<tr><td colspan=4 class='line2'></td></tr>
</table>
