<?

include_once("./_common.php");
include_once("$g4[path]/head.sub.php");

//cart config
include_once("$g4[path]/skin/cart/basic/config/cart_config.php");
//$cart_table[cart_category] = "g4_cart_category";

$write_table  =  $se_03; // 



//수정일경우[변경]
if($se_04){
    $title_msg  = "답변";
	//질문 정보를 불러옴
	$q_mct = " where wr_id  = '$se_04' ";
    $q_sql = " select * from $write_table $q_mct ";
    $q_row = sql_fetch($q_sql);

	$q_subject  = "<<답변<<";

	$list[wr_subject] = $q_subject; // 답변인경우

	$q_content  = $q_row[wr_content];
}
else{
    $title_msg  = "글작성";
}

//$se_01 // 글 속성
//$se_02 // 위치
//$se_03 // 테이블


//전체폭
$width = "98%"; // 전체폭 890 에서 작업
$colspan = 3;




?>

<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0>
<tr>
  <td>
    <!---------등록---------->
    <form name="fwrite" method="post" action="javascript:fwrite_check(document.fwrite);" enctype="multipart/form-data" style="margin:0px;">
    <input type = "hidden" name = "se_01" value = "<?=$se_01?>" />
    <input type = "hidden" name = "se_02" value = "<?=$se_02?>" />
    <input type = "hidden" name = "se_03" value = "<?=$se_03?>" />
    <input type = "hidden" name = "se_04" value = "<?=$se_04?>" />


    <table width="100%" cellspacing="0" cellpadding="0">
    <tr><td height="5" colspan=<?=$colspan?> ></td></tr>
    <tr><td colspan=<?=$colspan?> >&nbsp;&nbsp;<?=$title_msg?></td></tr>
    <tr><td height="5" colspan=<?=$colspan?>></td></tr>
    <tr><td height="2"  bgcolor=#3acac2 colspan=<?=$colspan?>></td></tr>
  <tr height="35">
    <td style='padding-left:10px;width:120px; height:30px;' bgcolor=#fffbf7>· 제목</td>
    <td style='padding-left:10px;'><input class=ed style="width:100%;" name=wr_subject id="wr_subject" itemname="제목" required value="<?=$list[wr_subject]?>"></td>
  </tr>
  <tr><td height="1"  bgcolor=#e2e2e2 colspan=<?=$colspan?>></td></tr>

  <!------------------------ 간략질문--------------------->
  <?if($se_04){ // 질문에 대한 답변이라면

	  ?>
  <tr height="35">
    <td style='padding-left:10px;width:120px; height:30px;' bgcolor=#fffbf7>· 질문제목</td>
    <td style='padding-left:10px;'><?=$q_row[wr_subject]?></td>
  </tr>
  <tr><td height="1"  bgcolor=#e2e2e2 colspan=<?=$colspan?>></td></tr>
  <tr height="35">
    <td style='padding-left:10px;width:120px; height:30px;' bgcolor=#fffbf7>· 질문내용</td>
    <td style='padding-left:10px;'>

      <textarea id="ne_6" name="ne_6" class=tx style='width:100%; word-break:break-all;' rows=5 itemname="질문내용" required ><?=$q_content?></textarea>

    </td>
  </tr>
  <tr><td height="1"  bgcolor=#e2e2e2 colspan=<?=$colspan?>></td></tr>

      <?
  }?>
  <!------------------------ 간략질문--------------------->
  <tr height="35">
    <td style='padding-left:10px;width:120px; height:30px;' bgcolor=#fffbf7>· 내용</td>
    <td style='padding-left:10px;'>
      <textarea id="ne_7" name="wr_content" class=tx style='width:100%; word-break:break-all;' rows=10 itemname="내용" required ><?=$list[wr_content]?></textarea>
    </td>
  </tr>
  <tr><td height="2"  bgcolor=#e2e2e2 colspan=<?=$colspan?>></td></tr>
  <tr><td height="30" colspan=<?=$colspan?>></td></tr>
  <tr>
    <td height="35" colspan=<?=$colspan?> align="center">
      <input type=image id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border=0 accesskey='s'>&nbsp;

    </td>
  </tr>
  <tr><td height="30" colspan=<?=$colspan?>></td></tr>

  </table>

  </form>
  <!-------//등록---------->

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

<script language="javascript">

function fwrite_check(f) {
    var f = document.fwrite;

    f.action = "./write_update.php";
    f.submit();
}
</script>




