<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo SYS_CHARSET ?>">
<title>edit order</title>
<link href="<?php echo SYS_ADMIN_STYLE_PATH ?>style/common.css" rel="stylesheet" type="text/css">
<script language="javascript" src="<?php echo SYS_ADMIN_STYLE_PATH ?>js/common.js"></script>
<script language="javascript" src="<?php echo SYS_ADMIN_STYLE_PATH ?>js/validate.js"></script>
</head>

<body>
<table class="nav_table" cellpadding="0" cellspacing="0">	
	<tr>
		<td class="nav_td"><?php echo $layout['menu_nav'] ?></td>
	</tr>	
</table>
<table class="toolbar_table" cellpadding="0" cellspacing="0">
	<tr>
		<td class="toolbar_td"><?php echo $layout['toolbar'] ?></td>
	</tr>
</table>
<div class="line_space"><img src="<?php echo SYS_ADMIN_STYLE_PATH ?>images/blank.gif"></div>
<table cellpadding="0" cellspacing="0" class="edit_tb">
  
  <form name="editForm" method="post" action="" >
	<input type="hidden" name="selectid" id="selectValue" value="<?php echo $layout['id'] ?>">
	<input type="hidden" name="selectValue" id="selectValue" value="<?php echo $layout['id'] ?>">

    <tr id="area_base"> 
      <td colspan="2">
      	<table cellpadding="0" cellspacing="0" width="100%" border="0" >
			 <tr> 
			      <td width="20%"  class="edit_td_txt">定单号:</td>
			      <td width="80%" class="edit_td_input">
			      	<?php echo $layout['order_number'] ?>
			      </td>
			 </tr> 
			 <tr> 
			      <td width="20%" class="edit_td_txt">订单状态:</td>
			      <td width="80%"  class="edit_td_input">
                  <?php echo $clComOrder->createFlagRadio('flag',$layout['flag']) ?>
                  <input  name="flag_old" type="hidden" value="<?php echo $layout['flag'] ?>">
                  </td>
			 </tr> 
			<tr> 
			      <td width="20%"  class="edit_td_txt">买方:</td>
			      <td width="80%" class="edit_td_input">
			      	<?php echo $clComOrder->getUsernameByUid($layout['uid']) ?>&nbsp;&nbsp;卖方:&nbsp;&nbsp;<?php echo $clComOrder ->getUsernameByUid($layout['seller_uid']) ?>
			      </td>
			 </tr>
			    
			<tr> 
              <td width="20%" class="edit_td_txt">商品清单:</td>
              <td width="80%"  class="edit_td_input">
                <table cellpadding="3" cellspacing="1" border="0">
                    <?php $total_quantity = 0; $total_price = 0;?>
                    <tr bgcolor="#eeeeee"><td>商品名称</td><td>数量</td><td>购买价</td></tr>
                    <?php foreach($clComOrder -> getArticlesByOrderNumber($layout['order_number']) as $arow): if($arow):?>
                    <tr bgcolor="#ffffff">
                    <td><a href="<?php echo DIR_INSTALL.'article.php?id='.$arow['id'] ?>" target="_blank"><?php echo $arow['title'] ?></a></td>
                    <td><?php echo $arow['quantity'] ?></td><td><?php echo $arow['price'] ?></td>
                    </tr>
                    <?php
                    $total_quantity += $arow['quantity'];
                    $total_price += $arow['price']*$arow['quantity'];
                    endif; 
                    endforeach; ?>
                </table>
              </td>
            </tr>      
            <tr> 
              <td width="20%"  class="edit_td_txt"></td>
              <td width="80%" class="edit_td_input">
                &nbsp;数量:<?php echo $total_quantity ?>件
                &nbsp;&nbsp;商品总额:<?php echo $total_price ?>
                &nbsp;&nbsp;费用:<?php echo $layout['fare'] ?>
                &nbsp;&nbsp;合计:<?php echo $total_price+$layout['fare'] ?>
              </td>
			</tr>  
			<tr> 
			      <td width="20%"  class="edit_td_txt">实际支付金额:</td>
			      <td width="80%" class="edit_td_input"><input type="text" name="total" class="input_text" value="<?php echo $layout['total'] ?>"></td>
			</tr>
			<tr> 
			      <td width="20%" class="edit_td_txt">留言:</td>
			      <td width="80%"  class="edit_td_input"><textarea name="leave_words" class="input_textarea" rows="3" style="width:90%"><?php echo $layout['leave_words'] ?></textarea></td>
			    </tr>
			 <tr> 
			      <td width="20%" class="edit_td_txt">发票:</td>
			      <td width="80%"  class="edit_td_input"><?php echo Common::creatInputCheckbox('is_invoice', 1, $layout['is_invoice']) ?></td>
			</tr>
			 <tr> 
			      <td width="20%" class="edit_td_txt">支付方式:</td>
			      <td width="80%"  class="edit_td_input"><?php echo $clComOrder->createPaymentRadio('payment_id', $layout['payment_id']) ?></td>
			 </tr>
 			<tr> 
			      <td width="20%" class="edit_td_txt">送货方式:</td>
			      <td width="80%"  class="edit_td_input"><?php echo $clComOrder->createDeliverRadio('delivery_id', $layout['delivery_id']) ?></td>
			 </tr>
            <tr> 
              <td colspan="2" class="edit_subtitle">
                <span class="edit_subtitle_txt"><span class="edit_subtitle_txt">收货人信息</span></span>
              </td>
            </tr>
            <tr> 
              <td colspan="2">
                <table cellpadding="0" cellspacing="0" width="100%" border="0" id="area_consignee">	
                    <tr> 
                      <td width="20%"  class="edit_td_txt">姓名:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="realname" class="input_text" value="<?php echo $layout['realname'] ?>">
                        &nbsp;&nbsp;性别:&nbsp;&nbsp;<?php echo $clComOrder->createGenderShow($layout['gender']) ?>
                      </td>
                    </tr>
                    <tr> 
                      <td width="20%"  class="edit_td_txt">地址:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="address" class="input_text" value="<?php echo $layout['address'] ?>"> &nbsp;&nbsp;邮编:&nbsp;&nbsp;
                        <input type="text" name="zipcode" class="input_text" value="<?php echo $layout['zipcode'] ?>">
                      </td>
                    </tr>
                    <tr> 
                      <td width="20%"  class="edit_td_txt">电话:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="tel" class="input_text" value="<?php echo $layout['tel'] ?>">
                      </td>
                    </tr>
                    <tr> 
                      <td width="20%"  class="edit_td_txt">手机:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="mobile" class="input_text" value="<?php echo $layout['mobile'] ?>">
                      </td>
                    </tr>	
                </table>
              </td>
            </tr>
			 <tr> 
              <td colspan="2" class="edit_subtitle">
                <span class="edit_subtitle_txt"><span class="edit_subtitle_txt">发货人信息</span></span>
              </td>
            </tr>
            <tr> 
              <td colspan="2">
                <table cellpadding="0" cellspacing="0" width="100%" border="0" id="area_consignee">	
                    <tr> 
                      <td width="20%"  class="edit_td_txt">姓名:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="consignor_name" class="input_text" value="<?php echo $layout['consignor_name'] ?>">
                        &nbsp;&nbsp;性别:&nbsp;&nbsp;<?php echo $clComOrder->createGenderRadio('consignor_gender',$layout['consignor_gender']) ?>
                      </td>
                    </tr>
                    <tr> 
                      <td width="20%"  class="edit_td_txt">地址:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="consignor_address" class="input_text" value="<?php echo $layout['consignor_address'] ?>"> &nbsp;&nbsp;邮编:&nbsp;&nbsp;
                        <input type="text" name="consignor_zipcode" class="input_text" value="<?php echo $layout['consignor_zipcode'] ?>">
                      </td>
                    </tr>
                    <tr> 
                      <td width="20%"  class="edit_td_txt">电话:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="consignor_tel" class="input_text" value="<?php echo $layout['consignor_tel'] ?>">
                      </td>
                    </tr>
                    <tr> 
                      <td width="20%"  class="edit_td_txt">手机:</td>
                      <td width="80%"  class="edit_td_input">
                        <input type="text" name="consignor_mobile" class="input_text" value="<?php echo $layout['consignor_mobile'] ?>">
                      </td>
                    </tr>	
                </table>
              </td>
            </tr>
            <tr> 
                <td colspan="2" width="100%">
                    <table cellpadding="0" cellspacing="0" width="100%" border="0">	
                            <tr>
                                <td width="20%" class="edit_td_txt">添加时间:</td>
                        <td width="20%" class="edit_td_input"><?php echo getDateTimeMk($layout['addtime']) ?></td>
                                <td width="20%" class="edit_td_txt">IP:</td>
                          <td class="edit_td_input"><?php echo $layout['ip'] ?></td>		      
                            </tr>	
                        </table>
                </td>
            </tr>
      	</table>
      </td>
    </tr>    
    
  </form>
</table>

</body>
</html>

