$query = "select fd_couponsale_id,fd_couponsale_no,\n\t fd_couponsale_money,fd_couponsale_paycardid,\n\t fd_couponsale_authorid,fd_couponsale_couponno\n\t from tb_couponsale\n where fd_couponsale_id ='{$listid}'\n "; $db->query($query); if ($db->nf()) { //判断查询到的记录是否为空 $db->next_record(); //读取记录数据 $listid = $db->f(fd_couponsale_id); $no = $db->f(fd_couponsale_no); //编号 $couponno = $db->f(fd_couponsale_couponno); //部门名 $money = $db->f(fd_couponsale_money); $paycardid = $db->f(fd_couponsale_paycardid); $authorid = $db->f(fd_couponsale_authorid); $memo = "购买优惠劵" . $couponno . "消费金额" . $money . "元"; changecoupon($listid, $no, "sale", $money, $couponno, $authorid, $paycardid, $memo); } require "../include/alledit.2.php"; Header("Location: {$gotourl}"); break; default: break; } $t = new Template(".", "keep"); $t->set_file("couponsale", "couponsale.html"); if (!empty($listid)) { // 编辑 $query = "select fd_couponsale_id,\n\t\t\t\t\tfd_couponsale_no,\n\t\t\t\t\tfd_couponsale_bkntno,\n\t\t\t\t\tfd_couponsale_datetime,\n\t\t\t\t\tfd_couponsale_creditcardno,\n\t\t\t\t\tfd_couponsale_creditcardbank,\n\t\t\t\t\tfd_couponsale_creditcardman,\n\t\t\t\t\tfd_couponsale_creditcardphone,\n\t \tfd_couponsale_money,\n\t\t\t\t\tfd_paycard_no,\n\t\t\t\t\tfd_author_username,\n\t\t\t\t\tfd_author_truename,\n\t \tfd_author_idcard,\n\t\t\t\t\tfd_couponsale_couponno,\n\t\t\t\t\tfd_couponsale_isagentpay,\n\t\t\t\t\tfd_couponsale_agentdate\n\t from tb_couponsale\n\t left join tb_paycard on fd_couponsale_paycardid = fd_paycard_id\n\t left join tb_author on fd_author_id = fd_couponsale_authorid\n where fd_couponsale_id ='{$listid}'\n "; $db->query($query); if ($db->nf()) { //判断查询到的记录是否为空
$query = "select fd_couponrebuy_id,fd_couponrebuy_no,\n\t fd_couponrebuy_money,fd_couponrebuy_couponid,\n\t fd_couponrebuy_authorid,fd_couponrebuy_couponno\n\t from tb_couponrebuy\n where fd_couponrebuy_id ='{$listid}'\n "; $db->query($query); if ($db->nf()) { //判断查询到的记录是否为空 $db->next_record(); //读取记录数据 $listid = $db->f(fd_couponrebuy_id); $couponid = $db->f(fd_couponrebuy_couponid); $no = $db->f(fd_couponrebuy_no); //编号 $couponno = $db->f(fd_couponrebuy_couponno); //部门名 $money = $db->f(fd_couponrebuy_money); $authorid = $db->f(fd_couponrebuy_authorid); $memo = "回购优惠劵" . $couponno . "支付金额" . $money . "元"; changecoupon($listid, $no, "rebuy", $money, $couponno, $authorid, "", $memo); } $query = "update tb_couponsale set fd_couponsale_rebuy = 1 where fd_couponsale_id = '{$couponid}'"; $db->query($query); require "../include/alledit.2.php"; Header("Location: {$gotourl}"); break; default: break; } $t = new Template(".", "keep"); $t->set_file("couponrebuy", "couponrebuy_view.html"); if (!empty($listid)) { // 编辑 $query = "select fd_couponrebuy_id,fd_couponrebuy_no, fd_couponrebuy_datetime,fd_couponsale_money,\n\t fd_author_username,fd_author_truename,fd_bank_name,fd_couponrebuy_bankcardno,\n\t fd_author_idcard,fd_couponrebuy_couponno ,fd_couponrebuy_sxfmoney,\n\t fd_couponrebuy_money,fd_couponsale_czman,fd_couponsale_czdatetime,\n\t fd_couponsale_memo\n\t from tb_couponrebuy\n\t left join tb_couponsale on fd_couponsale_id = fd_couponrebuy_couponid\n\t left join tb_bank on fd_couponrebuy_bankid = fd_bank_id\n\t left join tb_paycard on fd_couponsale_paycardid = fd_paycard_id\n\t left join tb_author on fd_author_id = fd_couponsale_authorid\n where fd_couponrebuy_id ='{$listid}'\n "; $db->query($query);