<!DOCTYPE html>
<html>
<head>
  <meta charset="<?php echo $cfg_soft_lang; ?>">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <script src="<?php echo $cfg_cmsurl;?>/static/js/jquery.min.js"></script>
  <link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/css/bootstrap.min.css">
  <link href="<?php echo $cfg_cmsurl;?>/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/css/style.css">
  <link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/css/member.css">
  <title>我购买的商品 - 会员中心 - <?php echo $cfg_webname; ?></title>
</head>
<body>
  <?php include(DEDEMEMBER."/templets/top_login.htm"); ?>

  <main class="member">

    <div class="container-fluid pannel">
      <div class="container">
        <div class="row">
          <?php
          $_menu_order = true; //展开编辑信息
          $_menu_orderstate = 1;
          ?>
          <?php include(DEDEMEMBER."/templets/menu.htm"); ?>
          <div class="pannel-main col-md-9 mt-3 mb-3">
            <div class="pannel-main-container">
              <div id="mainCp">
                <ul class="nav nav-tabs">
                  <li class="nav-item">
                    <a class="nav-link" href="shops_orders.php">商品订单</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link active" href="shops_products.php">已购商品</a>
                  </li>
                </ul>
                <?php if(!empty($oid)){ ?>
                 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
                    <thead>
                      <tr>
                        <th colspan="2" ><strong>订单信息</strong></th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td width="15%" align="right" valign="top">订单号：</td>
                        <td><strong><?php echo $oid?></strong></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">支付方式：</td>
                        <td><?php echo GetSta($row['state'],$oid)?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">单价(元/单位)：</td>
                        <td><?php echo $row['uprice']?>元</td>
                      </tr>
                       <tr>
                        <td align="right" valign="top">数量：</td>
                        <td><?php echo $row['cartcount']?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">配送：</td>
                        <td><?echo $row['dname'];?> 费用:<?php echo $row['dprice']?>元</td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">总计：</td>
                        <td><?php echo $row['priceCount']?>元</td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">发生时间：</td>
                        <td><?php echo GetDateTimeMk($row['stime'])?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">收货人：</td>
                        <td><?php echo $row['consignee']?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">地址：</td>
                        <td><?php echo $row['address']?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">邮编：</td>
                        <td><?php echo $row['zip']?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">联系电话：</td>
                        <td><?php echo $row['tel']?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">邮箱：</td>
                        <td><?php echo $row['email']?></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">留言：</td>
                        <td><?php echo $row['des']?></td>
                      </tr>
                    </tbody>
                  </table>
                  <?php }?>
                  <table cellspacing="1" class="table">
                    <thead>
                      <tr>
                        <th colspan="2" width="22%">订单号</th>
                        <th>名称</th>
                        <th width="10%"><span style="float:right;width: 75px;">单价(元/单位)</span></th>
                        <th width="8%" align="center">数量</th>
                        <th width="20%" align="center">购买时间</th>
                      </tr>
                    </thead>
                    <form name='form1' action="shops_products.php" method="post">
                    <input type='hidden' name='dopost' value='del' /> 
                    <tbody>
                    {dede:datalist}
                    <tr>
                      <td align="center"><input type="checkbox" name="deleteid" value="{dede:field.oid/}"/></td>
                      <td align="center"><a href="shops_products.php?do=show&oid={dede:field.oid/}">{dede:field.oid/}</a></td>
                      <td align="center"><a href="<?php echo $cfg_cmspath;?>/apps/view.php?aid={dede:field.aid/}" target="_blank">{dede:field.title/}</a></td>
                      <td align="center"><strong>{dede:field.price/}</strong></td>
                      <td align="center">{dede:field.buynum/}</td>
                      <td align="center">{dede:field.oid function="carTime(@me)"/}</td>
                    </tr>
                    {/dede:datalist}
                    <tr>
                    <td colspan="6">
                      <button id="checkedClick" type="button" class="btn btn-success btn-sm">全选</button>
                      <button type="button" onclick="DoSubmit()" class="btn btn-success btn-sm">删除选中</button></td></tr></tbody>
                    </form>
                </table>
                <nav>
                  {dede:pagelist listsize=5 /}
                </nav>
              </div>
              <!--主操作区域 -->
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
  <?php include(DEDEMEMBER."/templets/footer.htm"); ?>
  <script type="text/javascript">
	//获得选中文件的文件名
	function GetCheckfolderItem()
	{
		var allSel='';
		if(document.form1.deleteid.value) return document.form1.deleteid.value;
		for(i=0;i<document.form1.deleteid.length;i++)
		{
			if(document.form1.deleteid[i].checked)
			{
				if(allSel=='')
				allSel=document.form1.deleteid[i].value;
				else
				allSel=allSel+","+document.form1.deleteid[i].value;
			}
		}
		return allSel;
	}
	
	function DoSubmit()
	{
		var selid = GetCheckfolderItem();
		if(selid=='') {
			alert("您没选中任何信息");
			return false;
		}
		if(window.confirm("您确定要删除这些消息么"))
		{
			location = "shops_products.php?dopost=del&ids="+selid;
		}
	}
    </script>
</body>

</html>