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

$g4[title] = "포인트관리";


$g4_table         = "point";
$g4_site_table   =  "g4_site_".$g4_table;

//수정이라면
if ($w == "u") {
$mct            = " where po_id = '$po_id' ";
$sql            = " select * from $g4_site_table $mct ";
$pt_row         = sql_fetch($sql);

//등록상품의 정보를 불러옴
$tmp_write_table        = $g4['write_prefix'] .$pt_row[bo_table];
$p_sql                  =  " select wr_subject from $tmp_write_table where wr_id = '$pt_row[wr_id]' ";
$pro_row                = sql_fetch($p_sql);

$pro_subject    = conv_subject($pro_row['wr_subject'], 20, "");
$p_subject_href = "<a href='".$g4[bbs_path]."/board.php?bo_table=".$pt_row[bo_table]."&wr_id=".$pt_row[wr_id]."'>";

}
$colspan = 2;


//배송상태
if(!($pt_row[order_state]))
  $pt_row[order_state]  = "대기";
 


 $t_colspan = 5;
?>


<form name="fcart_list" method="post" style="margin:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<p><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> <b>주문배송처리</b></p>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan=<?=$t_colspan?> height=2 bgcolor=#949ae4></td></tr>
<tr height="32">
    <td width="">상품정보</td>
	<td align="center" width="80"><b>구매수량</b></td>
    <td align="center" width="110"><b>주문번호</b></td>
	<td align="center" width="100"><b>주문아이디</b></td>
	<td align="center" width="100"><b>처리상태</b></td>
</tr>
<tr><td colspan=<?=$t_colspan?> height=1 bgcolor=#dedfde></td></tr>

<tr height="25">
    <td>&nbsp;<?=$p_subject_href?><?=$pro_subject?></a></td>
	<td align="center">1 EA</td>
    <td align="center">&nbsp;<?=$pt_row[order_id]?></td>
	<td align="center">&nbsp;<a href="<?=$g4[admin_path]?>/member_form.php?&sfl=mb_id&w=u&mb_id=<?=$pt_row[mb_id]?>" target="_block"><?=$pt_row[mb_id]?></td>
	<td align="center"><?=$pt_row[order_state]?></td>
</tr>
<tr><td colspan=<?=$t_colspan?> height=1 bgcolor=#dedfde></td></tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan=<?=$t_colspan?> height="35"><br>
	<!--------------------배송관리---------------->        
        <table width=100% cellpadding=0 cellspacing=0 border=0>
        <colgroup width=110>
        <colgroup width='' bgcolor=#ffffff>
        <tr><td colspan=7 height=1 bgcolor=#0E87F9></td></tr>
        <tr class=ht>
            <td>배송일시</td>
            <td>
                <input type=text class=ed name=send_day maxlength=19 value=''>보내는시간
            </td>
			<td>운송장번호</td>
			<td>
			<input type=text class=ed name=order_num >
			</td>
			<td>배송회사</td>
			<td>
                <select name=trance_com>
                    <option value=''>배송시 선택하세요.
                <?

                    echo "<option value='KGB'>KGB\n";
					echo "<option value='아주택배'>아주택배\n";
					echo "<option value='삼성HTH'>삼성HTH\n";
					echo "<option value='제일제당'>제일제당\n";
					echo "<option value='대한통운'>대한통운\n";
					echo "<option value='로젠택배'>로젠택배\n";
					echo "<option value='현대택배'>현대택배\n";
					echo "<option value='한진택배'>한진택배\n";
					echo "<option value='우체국택배'>우체국택배\n";
					echo "<option value='기타'>기타\n";

                ?>
                </select>
			</td>
			<td><a href="javascript:select_ch(<?=$pt_row[po_id]?>,'배송확정',<?=$pt_row[order_id]?>);">배송확정</a></td>
        </tr>
		<tr><td colspan=7 height=1 bgcolor=#0E87F9></td></tr>
        </table>
	<!--------------------배송관리---------------->	
	</td>
</tr>
<?if($pt_row[b_opt1]){?>
<tr height="40"><td  colspan=<?=$t_colspan?> >&nbsp;&nbsp;운송장번호[&nbsp;<b><font color="#B65151"><?=$pt_row[b_opt1]?></font></b>&nbsp;]&nbsp;&nbsp;&nbsp;
        배송회사[&nbsp;<b><?=$pt_row[b_opt2]?></b>&nbsp;]&nbsp;&nbsp;&nbsp;
		발송시간[&nbsp;<b><?=$pt_row[send_time]?></b>&nbsp;]     

</td></tr>
<?}?>
<tr><td colspan=<?=$t_colspan?> height="35">
    <b>배송옵션</b> -
	<a href="javascript:select_ch(<?=$pt_row[po_id]?>,'대기',<?=$pt_row[order_id]?>);">대기</a>&nbsp;|
	<a href="javascript:select_ch(<?=$pt_row[po_id]?>,'배송중',<?=$pt_row[order_id]?>);">배송중</a>&nbsp;|
	<a href="javascript:select_ch(<?=$pt_row[po_id]?>,'배송완료',<?=$pt_row[order_id]?>);">배송완료</a>&nbsp;|
	<a href="javascript:select_ch(<?=$pt_row[po_id]?>,'주문취소',<?=$pt_row[order_id]?>);">주문취소</a>&nbsp;|
	</td>
</tr>
</table>
</form>
<br>


<!----------------주문입력폼 시작------------->
<form name="order_list" method="post" action="<?=$g4[admin_path]?>/category_list.php?url=banner_update" method=post enctype="multipart/form-data">
<input type=hidden name=po_id   value="<?=$po_id?>">
<input type=hidden name=w   value="<?=$w?>">
<input type=hidden name=g4_table   value="<?=$g4_table?>">


<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td width="50%" valign="top">
    <table width="98%" border="1" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="white" bordercolorlight="#CCCCCC">
    <tr><td colspan=2 height="35" ><p><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> 주문신청자 정보</p></td></tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 이   름</td>
      <td style='padding-left:10px;'><?=$pt_row[b_name]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 전화번호</td>
      <td style='padding-left:10px;'><?=$pt_row[b_tel]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 핸드폰번호</td>
      <td style='padding-left:10px;'><?=$pt_row[b_hp]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 이메일주소</td>
      <td style='padding-left:10px;'><?=$pt_row[b_email]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 주소</td>
      <td style='padding-left:10px;'><?=$pt_row[b_addr1]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 주소2</td>
      <td style='padding-left:10px;'><?=$pt_row[b_addr2]?></td>
    </tr>
    </table>
  </td>
  <td width="50%" valign="top">
    <table width="98%" border="1" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="white" bordercolorlight="#CCCCCC">
    <tr bgcolor="#ffffff">
      <td colspan=2 width="100%" height="35">
        <p><img src='<?=$g4[admin_path]?>/img/icon_title.gif'> 수취인정보</p>
      </td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 이   름</td>
      <td style='padding-left:10px;'><?=$pt_row[b_name2]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 전화번호</td>
      <td style='padding-left:10px;'><?=$pt_row[b_tel2]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 핸드폰번호</td>
      <td style='padding-left:10px;'><?=$pt_row[b_hp2]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 이메일주소</td>
      <td style='padding-left:10px;'><?=$pt_row[b_email2]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 주소</td>
      <td style='padding-left:10px;'><?=$pt_row[b_addr1_2]?></td>
    </tr>
    <tr>
      <td style='padding-left:10px; height:30px;' bgcolor=#fffbf7>· 주소2</td>
      <td style='padding-left:10px;'><?=$pt_row[b_addr2_2]?></td>
    </tr>
    </table>
  </td>
</tr>
</table>
</form>

<!---------------//주문입력폼----------------->
</td></tr>
</table>

<script language="javascript">
 function select_ch(se_01, se_02, se_03)
{ 
    var f = document.fcart_list;

    str = se_01;
    if (!confirm(se_03+" 를  "+se_02+" 처리\n\n 처리결과는 재고에 반영합니다."))
        return;

    f.action = g4_path+"/shop/point_update.php?po_id="+se_01+"&action="+se_02+"&w=u";
    f.submit();

}

</script>

