$gotourl = $gourl . $tempurl;
require "../include/alledit.1.php";
switch ($action) {
    case "pass":
        //编辑记录
        $query = "update tb_transfermoneyglist set \n\t\tfd_tfmglist_state='{$isok}',fd_tfmglist_qrdatetime=now(), fd_tfmglist_qrman='{$loginstaname}' \n\t\twhere fd_tfmglist_id={$listid}";
        $db->query($query);
        $query1 = "select * from tb_transfermoneyglist \n\t\t   left join tb_paycard on fd_tfmglist_paycardid = fd_paycard_id\n\t\t   where fd_tfmglist_id={$listid} ";
        $db->query($query1);
        while ($db->next_record()) {
            $paycardid = $db->f(fd_paycard_no);
            $memo = $db->f(fd_tfmglist_memo);
            $paymode = $db->f(fd_tfmglist_arrivemode);
            $payfee = $db->f(fd_tfmglist_payfee);
        }
        changeaccountno('in', $payfee, $paycardid, $memo, $paymode, 'tb_transfermoneyglist', $listid);
        echo "<script>alert('已成功确定转账!');location.href='{$gourl}'</script>";
        break;
    default:
        break;
}
$t = new Template(".", "keep");
$t->set_file("transfermoney_sp", "transfermoney_sp.html");
if (!empty($listid)) {
    $where = "fd_tfmglist_id ='{$listid}'";
}
if (!empty($bkordernumber)) {
    $where = "fd_tfmglist_bkordernumber ='{$bkordernumber}'";
}
//if(!empty($listid)){
// 编辑
require "../include/alledit.1.php";
//,fd_ccglist_sendsms='$sendsms',fd_ccglist_shoucardmemo='$shoucardmemo'
switch ($action) {
    case "pass":
        //编辑记录
        $query = "update tb_creditcardglist set\n\t\tfd_ccglist_state='{$isok}',fd_ccglist_qrdatetime=now(), fd_ccglist_qrman='{$loginstaname}' \n\t\twhere fd_ccglist_id={$listid}";
        $db->query($query);
        $query1 = "select * from tb_creditcardglist \n\t\t   left join tb_paycard on fd_ccglist_paycardid = fd_paycard_id\n\t\t   where fd_ccglist_id={$listid} ";
        $db->query($query1);
        while ($db->next_record()) {
            $paycardid = $db->f(fd_paycard_no);
            $memo = $db->f(fd_ccglist_memo);
            $paymode = $db->f(fd_ccglist_arrivemode);
            $payfee = $db->f(fd_ccglist_payfee);
        }
        changeaccountno('in', $payfee, $paycardid, $memo, $paymode, 'tb_creditcardglist', $listid);
        echo "<script>alert('已成功确定转账!');location.href='{$gotourl}'</script>";
        break;
    default:
        break;
}
$t = new Template(".", "keep");
$t->set_file("creditcard_sp", "creditcard_sp.html");
if (!empty($listid)) {
    $where = "fd_ccglist_id ='{$listid}'";
}
if (!empty($bkordernumber)) {
    $where = "fd_ccglist_bkordernumber = '{$bkordernumber}' ";
}
//if(!empty($listid)){
// 编辑
        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);
            $payfee = $db->f(fd_couponrebuy_sxfmoney);
            $memo = "回购优惠劵" . $couponno . "支付金额" . $money . "元";
            changecoupon($listid, $no, "rebuy", $money, $couponno, $authorid, "", $memo);
            changeaccountno('in', $payfee, $paycardid, $memo, $paymode, 'tb_couponrebuy', $listid);
        }
        $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.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\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);