国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.3KB

  1. <?php
  2. /**
  3. * 商品订单
  4. *
  5. * @version $Id: shops_orders.php 1 8:38 2010年7月9日Z tianya $
  6. * @package DedeBIZ.Member
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__) . "/config.php");
  12. include_once DEDEINC . '/datalistcp.class.php';
  13. $menutype = 'mydede';
  14. $menutype_son = 'op';
  15. if (!isset($dopost)) $dopost = '';
  16. /**
  17. * 获取状态
  18. *
  19. * @access public
  20. * @param string $sta 状态ID
  21. * @param string $oid 订单ID
  22. * @return string
  23. */
  24. function GetSta($sta, $oid)
  25. {
  26. global $dsql;
  27. $row = $dsql->GetOne("SELECT p.name FROM #@__shops_orders AS s LEFT JOIN #@__payment AS p ON s.paytype=p.id WHERE s.oid='$oid'");
  28. if ($sta == 0) {
  29. return '未付款(' . $row['name'] . ') < <a href="../plus/carbuyaction.php?dopost=memclickout&oid=' . $oid . '" target="_blank">去付款</a>';
  30. } else if ($sta == 1) {
  31. return '已付款,等发货';
  32. } else if ($sta == 2) {
  33. return '<a href="shops_products.php?do=ok&oid=' . $oid . '">确认</a>';
  34. } else {
  35. return '已完成';
  36. }
  37. }
  38. if ($dopost == '') {
  39. $sql = "SELECT * FROM #@__shops_orders WHERE userid='" . $cfg_ml->M_ID . "' ORDER BY stime DESC";
  40. $dl = new DataListCP();
  41. $dl->pageSize = 20;
  42. //这两句的顺序不能更换
  43. $dl->SetTemplate(dirname(__FILE__) . "/templets/shops_orders.htm"); //载入模板
  44. $dl->SetSource($sql); //设定查询SQL
  45. $dl->Display(); //显示
  46. } else if ($dopost == 'del') {
  47. $ids = explode(',', $ids);
  48. if (isset($ids) && is_array($ids)) {
  49. foreach ($ids as $id) {
  50. $id = preg_replace("/^[a-z][0-9]$/", "", $id);
  51. $query = "DELETE FROM `#@__shops_products` WHERE oid='$id' AND userid='{$cfg_ml->M_ID}'";
  52. $query2 = "DELETE FROM `#@__shops_orders` WHERE oid='$id' AND userid='{$cfg_ml->M_ID}'";
  53. $query3 = "DELETE FROM `#@__shops_userinfo` WHERE oid='$id' AND userid='{$cfg_ml->M_ID}'";
  54. $dsql->ExecuteNoneQuery($query);
  55. $dsql->ExecuteNoneQuery($query2);
  56. $dsql->ExecuteNoneQuery($query3);
  57. }
  58. ShowMsg("成功删除指定的交易记录!", "shops_orders.php");
  59. exit();
  60. }
  61. }