<!DOCTYPE html>
<html>
<head>
  <meta charset="<?php echo $cfg_soft_lang; ?>">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>商店订单记录</title>
  <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  <link rel="stylesheet" href="../static/web/css/admin.css">
  <script src="../static/web/js/jquery.min.js"></script>
  <script src="js/main.js"></script>
  <script>
    //获得选中项
    function getCheckboxItem() {
      var allSel = "";
      if (document.form1.aids.value) return document.form1.aids.value;
      for (i = 0; i < document.form1.aids.length; i++) {
        if (document.form1.aids[i].checked) {
          if (allSel == "")
            allSel = document.form1.aids[i].value;
          else
            allSel = allSel + "`" + document.form1.aids[i].value;
        }
      }
      return allSel;
    }
    function ReSel() {
      for (i = 0; i < document.form1.aids.length; i++) {
        if (document.form1.aids[i].checked) document.form1.aids[i].checked = false;
        else document.form1.aids[i].checked = true;
      }
    }
    function DelSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要删除的业务记录");
        return;
      }
      location.href = "shops_operations.php?dopost=delete&nid=" + nid;
    }
    function UpSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要修改的订单记录");
        return;
      }
      location.href = "shops_operations.php?dopost=up&nid=" + nid;
    }
    function OkSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要修改的订单记录");
        return;
      }
      location.href = "shops_operations.php?dopost=ok&nid=" + nid;
    }
    function PushSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要修改的订单记录");
        return;
      }
      location.href = "shops_operations.php?dopost=push&nid=" + nid;
    }
    function OpenMyWinN(surl, w, h) {
      var pos = GetWinPos(w,h);
      window.open(surl, "popUpMyWinN", "scrollbars=yes,resizable=yes,statebar=no,width=" + w + ",height=" + h + ",left="+pos.left+", top="+pos.top);
    }
  </script>
</head>
<body>
  <form name="form2" method="get" action="shops_operations.php">
    <table width="98%" cellpadding="1" cellspacing="1" align="center" class="mt-3 mb-3" style="border:1px solid #dee2e6">
      <tr>
        <td height="36" bgcolor="#f8f8f8">
          <table cellpadding="0" cellspacing="0">
            <tr>
              <td width="280" align="center"><input name="buyid" type="text" id="buyid" placeholder="请输入订单号" style="width:260px"></td>
              <td><button type="submit" class="btn btn-success btn-sm">搜索</button></td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </form>
  <table width="98%" cellpadding="1" cellspacing="1" align="center" class="table maintable mb-3">
    <tr>
      <td height="26" colspan="11" background="../static/web/img/tbg.gif">
        <table width="98%" cellspacing="0" cellpadding="0" class="table table-borderless">
          <tr>
            <td width="30%" style="padding-left:10px">商店订单记录</td>
            <td width="45%" align="right" style="padding-top:10px">
              <button type="button" onClick="location='shops_operations.php?sta=0'" class="btn btn-success btn-sm">未付款</button>
              <button type="button" onClick="location='shops_operations.php?sta=1';" class="btn btn-success btn-sm">已付款</button>
              <button type="button" onClick="location='shops_operations.php?sta=2';" class="btn btn-success btn-sm">已发货</button>
              <button type="button" onClick="location='shops_operations.php?sta=4';" class="btn btn-success btn-sm">已完成</button>
              <button type="button" onClick="location='shops_operations.php';" class="btn btn-success btn-sm">全部</button>
            </td>
            <td width="25%" align="right" style="padding-top:10px">
              <button type="button" onClick="location='shops_operations.php';" class="btn btn-success btn-sm">订单管理</button>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr bgcolor="#F8FCF1">
      <td width="8%" align="center">选择</td>
      <td width="25%" align="center">订单号</td>
      <td align="center">收货人</td>
      <td align="center">数量</td>
      <td width="22%" align="center">生成日期</td>
      <td align="center">订单价</td>
      <td align="center">配送费</td>
      <td align="center">总计</td>
      <td align="center">支付方式</td>
      <td align="center">状态</td>
      <td align="center">用户</td>
    </tr>
    <form name="form1">
      {dede:datalist empty='<tr><td colspan="11"><center>暂无内容</center></td></tr>'}
      <tr height="26" align="center" onmousemove="javascript:this.bgColor='#F8FCF1';" onmouseout="javascript:this.bgColor='#ffffff';">
        <td align="center">
          <input type='checkbox' name='aids' value='<?php echo $fields['oid']?>' class='np'></td>
        <td align="center">
          <?php echo $fields['oid']; ?>
        </td>
        <td align="center">
          <a href="javascript:OpenMyWinN('shops_operations_userinfo.php?oid=<?php echo $fields['oid']?>',800,600);"><?php echo $fields['consignee']?></a>
        </td>
        <td align="center">
          <?php echo $fields['cartcount']?>
          <a class="btn btn-success btn-sm" href="javascript:OpenMyWinN('shops_operations_cart.php?oid=<?php echo $fields['oid']?>',800,600);">详情</a>
        </td>
        <td align="center">
          <?php echo GetDateTimeMk($fields['stime'])?>
          (<span>{dede:field.stime function="floorTime(time()-@me,@me)"/}</span>)
        </td>
        <td align="center">
          <?php echo $fields['price']?>
        </td>
        <td align="center">
          <?php echo $fields['dprice']?>
        </td>
        <td align="center">
          <?php echo $fields['priceCount']?>
        </td>
        <td align="center">
          <?php echo GetsType($fields['paytype'])?>
        </td>
        <td align="center">
          <?php echo GetSta($fields['state'])?>
        </td>

        <td align="center">
          <?php echo GetMemberID($fields['userid'])?>
        </td>
      </tr>
      {/dede:datalist}
    </form>
    <tr>
      <td height="26" colspan="11" bgcolor="#FCFDF7" style="padding-top:10px">&nbsp;
        <button type="button" onClick="ReSel();" class="btn btn-success btn-sm">反选</button>
        <button type="button" onClick="DelSel();" class="btn btn-success btn-sm">删除</button>
        <button type="button" onClick="UpSel();" class="btn btn-success btn-sm">设为已付款状态</button>
        <button type="button" onClick="PushSel();" class="btn btn-success btn-sm">设为已发货状态</button>
        <button type="button" onClick="OkSel();" class="btn btn-success btn-sm">设为已完成状态</button>
      </td>
    </tr>
    <tr>
      <td height="36" colspan="11" bgcolor="#f8f8f8" align="center">
        {dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}
      </td>
    </tr>
  </table>
</body>
</html>