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

//$site_bill_cf = "$g4[path]/shop/cf";

if($gr_id && !$bo_table){
  $title_subject = "그릅페이지 환경설정 : 그릅에 전체폭, 좌측폭, 좌측과 메인사이폭, 메인폭, 우측폭";
	}
else if($bo_table){
  $title_subject = "게시판 환경설정 : 게시판 환경설정 모든것.";
}
else{
  $title_subject = "첫페이지 환경설정 : 사이트의 환경설정을 조정하세요. [ 우측폭은 자동조절됩니다 ]";
}

  if(!$bo_table && !$gr_id){
  $mct     =  "  po_poll1 = 'skin'  ";  
  $mct    .=  " and po_poll2 = 'head_sub' "; 
  $site_bill = sql_fetch("select * from $g4[site_bill] where  $mct");


  $colspan = 2;
  $right_width =$site_bill[po_poll5] - $site_bill[po_poll6] - $site_bill[po_poll7] - $site_bill[po_poll8] - $site_bill[po_poll9];
  }
  else if($gr_id){
  $mct                      =  "  po_poll1      = '$gr_id' "; 
  $mct                     .=  " and  po_poll9  = 'gr_id' "; 
  $gr_data = sql_fetch("select * from $g4[site_bill] where  $mct");



  //패치
  $site_bill['po_poll4'] = $gr_data[po_poll6]; //정렬위치
  $site_bill['po_poll5'] = $gr_data[po_cnt1];//전체폭
  $site_bill['po_poll6'] = $gr_data[po_cnt2];//좌측폭
  $site_bill['po_poll7'] = $gr_data[po_cnt3];//메인폭
  $site_bill['po_poll8'] = $gr_data[po_cnt10];//좌/메인여백
  $site_bill['po_poll9'] = $gr_data[po_cnt11];//메인/우측여백

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

  }
   
?>

<table width="100%"  border="0" cellspacing="0" cellpadding="0" >
<tr><td valign="top">
  <table width="100%"  border="0" cellspacing="0" cellpadding="0" >
  <tr class='ht'>
    <td colspan=2 class=title align=left><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> <?=$title_subject?></td>
  </tr>
  <tr><td colspan=2 ></td></tr>
  <tr><td colspan=2 >

  <form action="<?=$site_bill_cf?>/skin.update.php" method=post enctype="multipart/form-data">

  <input type=hidden name=gr_id   value="<?=$gr_id?>">
  <input type=hidden name=bo_table   value="<?=$bo_table?>">
  <input type=hidden name=wr_id   value="<?=$wr_id?>">
  <!----스킨 세팅정보---->
  <input type=hidden name=po_subject   value="<?=$site_bill[po_subject]?>">
  <input type=hidden name=po_poll1   value="<?=$site_bill[po_poll1]?>">
  <input type=hidden name=po_poll2   value="head_sub">
  <input type=hidden name=po_poll3     value="<?=$site_bill[po_poll3]?>">



  <table  border="0" cellpadding=0 cellspacing=0>
  <tr>
    <td style='padding-left:10px; height:30px; width:60px;'>정렬위치 :</td>
    <td style='padding-left:10px;'>
        <select class=ed name=po_poll4 id='po_poll4'>
        <option value="left">left</option>
        <option value="center">center</option>
		<option value="right">right</option>
        <script language='javascript'>document.getElementById('po_poll4').value='<?=$site_bill[po_poll4]?>';</script>
        </select>
    </td>
  </tr>
  </table> 
  <table  border="0" cellpadding=0 cellspacing=0>
  <tr><td style='padding-left:10px; height:30px; width:60px;'>사이트폭 :</td>
      <td style='padding-left:10px;'>전체폭 &nbsp;</td>
      <td><input class=ed type="text" name="po_poll5" required value="<?=$site_bill[po_poll5]?>" size="5"></td> 
	  <td style='padding-left:10px;'>좌측폭 &nbsp;</td>
      <td><input class=ed type="text" name="po_poll6" required value="<?=$site_bill[po_poll6]?>" size="5"></td>
      <td style='padding-left:10px;'>좌/메인여백 &nbsp;</td>
      <td><input class=ed type="text" name="po_poll8" required value="<?=$site_bill[po_poll8]?>" size="5"></td>
      <td style='padding-left:10px;'>메인폭 &nbsp;</td>
      <td><input class=ed type="text" name="po_poll7" required value="<?=$site_bill[po_poll7]?>" size="5"></td>
      <td style='padding-left:10px;'>메인/우측여백 &nbsp;</td>
      <td><input class=ed type="text" name="po_poll9" required value="<?=$site_bill[po_poll9]?>" size="5"></td>
      <td style='padding-left:10px;'>우측폭 &nbsp;</td>
      <td><input class=ed type="text" readonly  value="<?=$right_width?>" size="5"></td>
  </tr>
  </table> 
  <?if(!$gr_id){?>
  <table  border="0" cellpadding=0 cellspacing=0>
  <tr>
    <td style='padding-left:10px; height:30px; width:60px;'>일관적용 :</td>
    <td style='padding-left:10px;'>
     <input type=checkbox name=all_set id="all_set"  value="1">모든페이지에 동일적용 [ 메인페이지, 그릅페이지에 동일한 적용 ]
    </td>
  </tr>
  </table> 
  <?}?>
  <?if($gr_id){?>
  <table  border="0" cellpadding=0 cellspacing=0>
  <tr>
    <td style='padding-left:10px; height:30px; width:60px;'>일관적용 :</td>
    <td style='padding-left:10px;'>
     <input type=checkbox name=all_set id="all_set"  value="1">그릅페이지에 동일적용 [ 메인페이지 제외 ]
    </td>
  </tr>
  </table> 
  <?}?>
  <table  border="0" cellpadding=0 cellspacing=0>
  <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="formbutton1" value="환경설정저장"></td></tr>
  </table> 
  </form>
  </td></tr>
  </table>

</td></tr></table>