function changecoupon($listid, $no, $type, $money, $couponno, $authorid, $paycardid = null, $memo)
{
    $db = new db_test();
    switch ($type) {
        case "sale":
            $query = "insert into tb_couponglide  (\n\t\t          fd_couponglide_no , fd_couponglide_type , fd_couponglide_addmoney ,\n\t\t          fd_couponglide_lessmoney  , fd_couponglide_datetime , fd_couponglide_memo ,\n\t\t          fd_couponglide_man , fd_couponglide_couponno , fd_couponglide_authorid ,\n\t\t          fd_couponglide_paycardid ,fd_couponglide_listid\n\t\t          )values(\n\t\t          '{$no}' , '{$type}' , '0' , \n\t\t          '{$money}' , now() , '{$memo}' , \n\t\t          '{$loginstaname}' , '{$couponno}' , '{$authorid}' ,\n\t\t          '{$paycardid}' , '{$listid}'\n\t\t          )\n\t\t    ";
            $db->query($query);
            break;
        case "rebuy":
            $query = "insert into tb_couponglide  (\n\t\t          fd_couponglide_no , fd_couponglide_type , fd_couponglide_addmoney ,\n\t\t          fd_couponglide_lessmoney  , fd_couponglide_datetime , fd_couponglide_memo ,\n\t\t          fd_couponglide_man , fd_couponglide_couponno , fd_couponglide_authorid ,\n\t\t          fd_couponglide_paycardid ,fd_couponglide_listid\n\t\t          )values(\n\t\t          '{$no}' , '{$type}' , '{$money}' , \n\t\t          '0' , now() , '{$memo}' , \n\t\t          '{$loginstaname}' , '{$couponno}' , '{$authorid}' ,\n\t\t          '{$paycardid}' , '{$listid}'\n\t\t          )\n\t\t    ";
            $db->query($query);
            break;
        case "use":
            $query = "insert into tb_couponglide  (\n\t\t          fd_couponglide_no , fd_couponglide_type , fd_couponglide_addmoney ,\n\t\t          fd_couponglide_lessmoney  , fd_couponglide_datetime , fd_couponglide_memo ,\n\t\t          fd_couponglide_man , fd_couponglide_couponno , fd_couponglide_authorid ,\n\t\t          fd_couponglide_paycardid ,fd_couponglide_listid\n\t\t          )values(\n\t\t          '{$no}' , '{$type}' , '0' , \n\t\t          '0' , now() , '{$memo}' , \n\t\t          '{$loginstaname}' , '{$couponno}' , '{$authorid}' ,\n\t\t          '{$paycardid}' , '{$listid}'\n\t\t          )\n\t\t    ";
            $db->query($query);
            break;
    }
}
 function saveFileid($dateid, $catid)
 {
     $dbfile = new db_test();
     if ($catid) {
         $query = "update tb_upload_category_list set fd_cat_dateid='{$dateid}'\n\t\t\twhere fd_cat_dateid='0' and fd_cat_id in({$catid})";
         $dbfile->query($query);
         //echo $query;
     }
     //return $query;
 }
<?php

header('Content-Type: application/x-www-form-urlencoded');
header('Content-Type: text/html;charset=gb2312');
require "../include/common.inc.php";
require_once '../include/json.php';
require "../function/changekg.php";
$db = new db_test();
$query = "select * from web_orderdetail \n        left join  web_order on fd_order_id                = fd_orderdetail_orderid\n        where fd_orderdetail_id='{$id}'";
$db->query($query);
if ($db->nf()) {
    $db->next_record();
    $state = $db->f(fd_order_state);
}
if ($state > 1) {
    echo "0@@" . $query;
    exit;
}
$query = "update web_orderdetail set fd_orderdetail_quantity = '{$value}'  where fd_orderdetail_id = '{$id}'";
$db->query($query);
echo "1@@" . $value . $query;
function getnewssaler($value)
{
    $db = new db_test();
    $query = "select fd_saler_truename from web_saler where fd_saler_id='{$value}'";
    $db->query($query);
    if ($db->nf()) {
        $db->next_record();
        $salername = $db->f(fd_saler_truename);
        return $salername;
    }
}
require "../include/common.inc.php";
$db = new db_test();
$db1 = new db_test();
header('Content-Type:text/html;charset=GB2312');
$flagcomm = 0;
$query = "select * from tb_salelistdetail where fd_stdetail_seltid = '{$listid}'";
$db->query($query);
if ($db->nf()) {
    while ($db->next_record()) {
        $paycardid = $db->f(fd_stdetail_paycardid);
        $productid = $db->f(fd_stdetail_productid);
        $saleprice = $db->f(fd_stdetail_price);
        $salequantity = $db->f(fd_stdetail_quantity);
        $query = "select * from tb_paycardstockquantity \n\t\t          where fd_skqy_commid = '{$productid}'";
        $db1->query($query);
        //查询仓库数量
        if ($db1->nf()) {
            $db1->next_record();
            $storagequantity = $db1->f(fd_skqy_quantity) + 0;
            if ($storagequantity < $salequantity) {
                //$tmpquantity = $salequantity - $storagequantity;
                $returnquantitypaycardid = $returnquantitypaycardid . "“" . $productid . "”当库存数量为:" . $storagequantity . "\n";
                $flagcomm = 1;
            }
        }
        $query = "select * from tb_storagecost \n\t\t          where fd_sect_commid = '{$productid}'";
        $db1->query($query);
        //查询平均价格
        if ($db1->nf()) {
            $db1->next_record();
Example #6
0
$thismenucode = "6n006";
require "../include/common.inc.php";
$db = new db_test();
$db2 = new db_test();
$db3 = new db_test();
if (!empty($password)) {
    $password = md5($password);
}
switch ($action) {
    case "save":
        if (!empty($id)) {
            $query = "select * from tb_saler where fd_saler_id  = '{$id}'";
            $db->query($query);
            if ($db->nf()) {
                $query = "select * from tb_saler where fd_saler_username  = '******' and fd_saler_id <> '{$id}'";
                $db2->query($query);
                if ($db2->nf() > 0) {
                    $error = "你输入用户名已被注册,请查证!";
                } else {
                    $query = "select * from tb_saler where fd_saler_phone   = '{$phone}' and fd_saler_id <> '{$id}'";
                    $db2->query($query);
                    if ($db2->nf() > 0) {
                        $error = "你输入手机已被注册,请查证!";
                    } else {
                        $query = "select * from tb_saler where fd_saler_idcard   = '{$idcard}' and fd_saler_id <> '{$id}'";
                        $db2->query($query);
                        if ($db2->nf() > 0) {
                            $error = "你输入身份证已被注册,请查证!";
                        } else {
                            $query = "update tb_saler set fd_saler_idcard ='{$idcard}',\n\t          fd_saler_truename ='{$truename}'                , fd_saler_phone ='{$phone}'                 , \n\t\t\tfd_saler_sharesalerid = '{$sharesalerid}'  ,\n\t\t\tfd_saler_username     = '******'      ,\n\t\t\t  fd_saler_salertype     ='{$type}'               , fd_saler_state       = '1'          ,       \n\t\t\t  where fd_saler_id = '{$id}'";
                            $db->query($query);
Example #7
0
function getallpaymoney()
{
    $db = new db_test();
    $query = "select sum(fd_agpm_paymoney) as paymoney\n\t\tfrom tb_agentpaymoneylist \n\t\twhere fd_agpm_payrq='00'";
    $db->query($query);
    if ($db->nf()) {
        while ($db->next_record()) {
            $allpaymoney = $db->f(paymoney);
        }
    }
    return $allpaymoney;
}
<?php

require "../include/common.inc.php";
$db = new db_test();
$boolean = 0;
$query = "select\n                 case\n                 when fd_agpm_payfeedirct ='s' then ' 收款方'\n                 when fd_agpm_payfeedirct ='f' then '付款方'\n                 END  payfeedirct,\n\n                 case\n                 when fd_agpm_paytype ='coupon' then '购买抵用券'\n                 when fd_agpm_paytype ='creditcard' then '信用卡还款'" . "when fd_agpm_paytype ='recharge' then        '充值'" . "when fd_agpm_paytype ='pay' then       '还贷款'" . "when fd_agpm_paytype ='order' then '订单付款'" . "when fd_agpm_paytype ='tfmg' then '转账汇款'\n                 else '其他业务' END  paytype,\n\n                 case\n                 when fd_agpm_payfeedirct ='f' then fd_agpm_paymoney\n                 when fd_agpm_payfeedirct ='s' then (fd_agpm_paymoney-fd_agpm_payfee)\n                 else fd_agpm_paymoney END money,\n\n                 fd_agpm_bkordernumber            as bkordernumber,\n                 fd_pymyltdetail_id               as vid,\n                 fd_agpm_bkntno                   as bkntno,\n                 fd_paycard_key                   as paycardkey,\n                 fd_author_truename               as author,\n                 fd_agpm_paytype                  as paytypee,\n                 fd_agpm_paydate                  as paydate,\n                 fd_agpm_shoucardno               as shoucardno,\n                 fd_agpm_shoucardbank             as shoucardbank,\n                 fd_agpm_shoucardman              as shoucardman,\n                 fd_agpm_shoucardmobile           as shoucardmobile,\n                 fd_agpm_current                  as current,\n                 fd_agpm_paymoney                 as paymoney ,\n                 fd_agpm_payfee                   as payfee,\n                 fd_agpm_arrivemode               as arrivemode,\n                 fd_agpm_arrivedate               as arrivedate,\n                 fd_paycardaccount_accountname    as accountname,\n                 fd_sdcr_agentfee                 as sdcragentfee,\n                 fd_agpm_isagentpay               as isagentpay,\n                 fd_paycardaccount_accountnum     as accountnum\n                 from tb_paymoneylistdetail  \n                 left join tb_agentpaymoneylist on fd_pymyltdetail_agpmid = fd_agpm_id\n                 left join tb_paycard on fd_agpm_paycardid = fd_paycard_id\n                 left join tb_author on fd_author_id = fd_agpm_authorid\n                 left join tb_paycardaccount on fd_paycard_paycardaccount = fd_paycardaccount_id\n                 left join tb_sendcenter on fd_sdcr_id = fd_agpm_sdcrid\n                 where fd_pymyltdetail_paymoneylistid = '{$listid}'\n                 order by fd_agpm_bkntno";
$db->query($query);
$arr_result = $db->getFiledData('');
foreach ($arr_result as $key => $value) {
    switch ($value['paytype']) {
        case 'coupon':
            $table = 'couponsale';
            $where = 'couponsale';
            break;
        case 'creditcard':
            $table = 'creditcardglist';
            $where = 'ccglist';
            break;
        case 'recharge':
            $table = 'rechargeglist';
            $where = 'rechargelist';
            break;
        case 'repay':
            $table = 'repaymoneyglist';
            $where = 'repmglist';
            break;
        case 'tfmg':
            $table = 'transfermoneyglist';
            $where = 'tfmglist';
            break;
        case 'suptfmg':
Example #9
0
function checkdeptid($fid)
{
    $db1 = new db_test();
    $query = "select * from tb_dept where fd_dept_id != '{$fid}'";
    $db1->query($query);
    if ($db1->nf()) {
        $db1->next_record();
        $check_id = $db1->f(fd_dept_fid);
        checkdeptid($check_id);
    }
    return $check_id;
}
Example #10
0
    case "save":
        for ($i = 0; $i < count($arr_wlroadid); $i++) {
            $wlroadid = $arr_wlroadid[$i];
            $arr_wldpid1 = $arr_wldpid[$wlroadid];
            //echo var_dump($arr_wldpid1);
            for ($j = 0; $j < count($arr_wldpid1); $j++) {
                $wlmoney = $arr_wlmoney[$wlroadid][$j];
                //echo $wlmoney."<>";
                $wldunpriceid = $arr_wldpid1[$j];
                $query = "select * from web_authorpayset where fd_authorpayset_wldpid = '{$wldunpriceid}' and fd_authorpayset_wlroadid = '{$wlroadid}'\n\t\t\t          and fd_authorpayset_organmemid = '{$organmemid}'";
                $db->query($query);
                if ($db->nf()) {
                    $db->next_record();
                    $vlid = $db->f(fd_authorpayset_id);
                    $query1 = "update web_authorpayset set fd_authorpayset_money = '{$wlmoney}' where\n\t\t\t\t fd_authorpayset_id ='{$vlid}'";
                    $db2->query($query1);
                } else {
                    $query = "insert into web_authorpayset(fd_authorpayset_wldpid,\n\t\t\t        fd_authorpayset_wlroadid,fd_authorpayset_money,fd_authorpayset_organmemid) values('{$wldunpriceid}','{$wlroadid}','{$wlmoney}','{$organmemid}')";
                    $db->query($query);
                }
            }
        }
        $action = "";
        echo "<script>alert('修改成功');location.href='authorpayset.php'</script>";
        //require("../include/alledit.2.php");
        //Header("Location: $gotourl");
        break;
    default:
        $action = "";
        break;
}
Example #11
0
function getauthormeal($type)
{
    $db = new db_test();
    $query = 'select fd_author_' . $type . ',count(fd_author_' . $type . ') as authornum from tb_author group by  fd_author_' . $type . '';
    $db->query($query);
    if ($db->nf()) {
        while ($db->next_record()) {
            $id = $db->f('fd_author_' . $type . '');
            $returnvalue[$id] = $db->f(authornum);
        }
    }
    return $returnvalue;
}
Example #12
0
function getusemoney($authorid)
{
    $db = new db_test();
    $data = date("Y-m-d", time());
    $query = "select * from tb_slotcardmoneyreq\n\t\t\tleft join tb_slotcardmoneyset on fd_scdmset_id = fd_pmreq_paymsetid \n\t\t\twhere fd_pmreq_authorid='{$authorid}' and fd_pmreq_state='9' and fd_pmreq_reqdatetime like '{$data}%'";
    $db->query($query);
    if ($db->nf()) {
        //�жϲ�ѯ���ļ�¼�Ƿ�Ϊ��
        while ($db->next_record()) {
            //��ȡ��¼���
            $allreqmoney += $db->f(fd_pmreq_reqmoney);
        }
        return $allreqmoney;
    } else {
        return "0.00";
    }
}
Example #13
0
header('Content-Type: application/x-www-form-urlencoded');
header('Content-Type: text/html;charset=gbk');
require "../include/common.inc.php";
require "../include/json.php";
$dbshop = new db_shop();
$db = new db_test();
$shopnavname = u2g(unescape($shopnavname));
switch ($act) {
    case "trad":
        $query = "select * from tb_shop where fd_shop_navname='{$shopnavname}' and  fd_shop_id<> '{$shopid}'";
        $dbshop->query($query);
        if ($dbshop->nf()) {
            echo "仓库名已存在!" . "@@" . "n";
        } else {
            $query1 = "select * from tb_sendcenter where fd_sdcr_name='{$shopnavname}'";
            $db->query($query1);
            if ($db->nf()) {
                echo "仓库名已存在!" . "@@" . "n";
            } else {
                echo "正常" . "@@" . "y";
            }
        }
        break;
    case "sp":
        $query = "select * from tb_shop where fd_shop_navname='{$shopnavname}' and  fd_shop_id<> '{$shopid}'";
        $dbshop->query($query);
        if ($dbshop->nf()) {
            echo "仓库名已存在!" . "@@" . "n";
        } else {
            $query1 = "select * from tb_sendcenter where fd_sdcr_name='{$shopnavname}'";
            $db->query($query1);