Exemplo n.º 1
0
 function carttofavorite($id)
 {
     if (!empty($id)) {
         $wherestr = $this->joinid($id);
     }
     if (empty($wherestr)) {
         return lang('goodsID_notempty');
     }
     //获取数据
     $temparray = $this->getdata("", $wherestr);
     if (!empty($temparray)) {
         foreach ($temparray as $value) {
             if (!empty($value['uname'])) {
                 $addarray = array('uid' => $value['uid'], 'uname' => $value['uname'], 'goodsurl' => $value['goodsurl'], 'goodsname' => $value['goodsname'], 'goodsprice' => $value['goodsprice'], 'goodsimg' => $value['goodsimg'], 'goodsseller' => $value['goodsseller'], 'sellerurl' => $value['sellerurl'], 'goodssite' => $value['goodssite'], 'siteurl' => $value['siteurl'], 'addtime' => time());
                 //处理插入数据库
                 $f = new TableClass("favorite", "fid");
                 $info = $f->add($addarray);
                 if (GetNum($info)) {
                     $seccessid[] = $info;
                 } else {
                     return lang('Handling_goodsID') . $value['gid'] . lang('Error_add_Favorite');
                 }
             }
         }
         return 'OK';
     } else {
         return lang('Data_notfound');
     }
 }
Exemplo n.º 2
0
        if (!empty($wherestr)) {
            $wheresql = implode(' AND ', $wherestr);
        }
        //条件汇总
        //获取当前页码
        $dataarray = $r->getdata("", $wheresql);
        //获取团购数据
    }
} elseif ($action == 'refund' && !empty($rid)) {
    $rid = GetNum($rid);
    if ($rid) {
        $recharge = new TableClass("rechargerecord", "rid");
        $row = $recharge->getone($rid);
        if (!empty($_POST)) {
            InitGP(array('money', 'remark'));
            //初始化变量全局返回
            $addarray = array('rechargeid' => $rid, 'uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'money' => GetNum($money), 'remark' => Char_cv($remark), 'rechargetime' => $row['successtime'], 'rechargemoney' => $row['money'], 'rechargesn' => $row['sn'], 'addtime' => time());
            $info = $r->add($addarray);
            if (GetNum($info)) {
                print "<script language='javascript'>alert(" . lang('apply_success') . ");</script>";
                jumpurl(url('m.php?name=refundrecord'));
            } else {
                print "<script language='javascript'>alert(" . lang('apply_error') . ");</script>";
                jumpurl(url('m.php?name=refundrecord&action=refund&' . $rid));
            }
        }
    }
}
//print_r($dataarray);
include template('member_refundrecord');
//包含输出指定模板
Exemplo n.º 3
0
$dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, $orderstr);
//获取团购数据
if (empty($action)) {
    //包含后台模板文件
    include "tpl/otype_list.htm";
} elseif ($action == "add") {
    InitGP(array("node", "typename"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($typename)) {
        $typeid = GetNum($typeid);
        if (empty($typename)) {
            showmsg("名称不能为空!", PHP_SELF);
        }
        //出错!
        $arrayadd = array("node" => Char_cv($node), "typename" => Char_cv($typename), "listorder" => GetNum($listorder));
        $info = $Table->add($arrayadd);
        if (GetNum($info)) {
            showmsg("发布成功!", PHP_SELF);
            //出错!
        } else {
            showmsg("发布失败!", "-1");
            //出错!
        }
    } else {
        $evalue = $Table->getone($aid);
        //print_r($evalue);
        include "tpl/otype_list.htm";
    }
} elseif ($action == "edit") {
    InitGP(array("node", "typeid", "typename"));
    //初始化变量全局返回
Exemplo n.º 4
0
include "../common.inc.php";
InitGP(array("page", "action", "did", "delids"));
//初始化变量全局返回
include "function_common.php";
$mange = new TableClass("adminmange", "mid");
$menuarray = $mange->getdata('', '', 'listorder asc,mid asc');
$menuname = array('zone' => '管理分区', 'group' => '管理分组', 'item' => '管理项');
if ($action == "add") {
    InitGP(array("mid", "mname", "type", "node", "murl", "listorder", "mcode", "Submit"));
    //初始化变量全局返回
    if (!empty($Submit)) {
        if ($type == "zone") {
            $node = 0;
        }
        $arrayinsert = array("mname" => Char_cv($mname), "type" => Char_cv($type), "node" => GetNum($node), "murl" => Char_cv($murl), "listorder" => GetNum($listorder), "mcode" => Char_cv($mcode));
        $info = $mange->add($arrayinsert);
        if (GetNum($info)) {
            showmsg("添加成功!", PHP_SELF);
            //成功
        } else {
            showmsg($info, "-1");
        }
        //出错!
    }
} elseif ($action == "edit") {
    InitGP(array("mid", "mname", "type", "node", "murl", "listorder", "mcode", "Submit"));
    //初始化变量全局返回
    if (!empty($Submit)) {
        $mid = GetNum($mid);
        if ($type == "zone") {
            $node = 0;
Exemplo n.º 5
0
 function moneyedit($uname, $num = 0, $action = 0, $note = "")
 {
     $returnstr = "OK";
     if (!empty($uname) && $num != 0 && is_numeric($num)) {
         $row = $this->db->fetch_first("Select uid,money From `{$this->table}` where uname like '{$uname}' ");
         if (is_array($row)) {
             $this->db->query("update `{$this->table}` SET money= money+{$num} WHERE uname='{$uname}' limit 1");
             if ($num > 0) {
                 $edittype = lang('adds');
                 $type = 2;
             } else {
                 $edittype = lang('Minus');
                 $type = 1;
             }
             $action = GetNum($action);
             $accountmoney = sprintf("%01.2f", $row['money'] + $num);
             //记录日志操作
             $record_table = new TableClass('record', 'rid');
             $addarray = array('uid' => $row['uid'], 'uname' => $uname, 'type' => $type, 'action' => $action, 'money' => $num, 'accountmoney' => $accountmoney, 'remark' => $note, 'addtime' => time());
             $info = $record_table->add($addarray);
             if (GetNum($info)) {
                 $returnstr = "OK";
             } else {
                 $returnstr = lang('Error_log');
             }
             //写入日志文件
             $datastr = date('Y-m-d h:i:s');
             $log = $datastr . lang('uname') . $uname . '|' . $edittype . lang('Amount') . $num . lang('legend') . $note;
             @writelog('money_edit', $log);
             //增加写入文件日志操作!记录每次用户钱币改动
         } else {
             $returnstr = lang('username_notexist');
         }
     } else {
         $returnstr = lang('Missing_parameter_err');
     }
     return $returnstr;
 }
Exemplo n.º 6
0
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $f->getdata("{$offset},{$pagesize}", $wheresql);
    //获取数据
} elseif ($action == 'add') {
    AjaxHead();
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    include INC_PATH . "/shopsite.class.php";
    $shopsite = ShopClass::init();
    $preg = $shopsite->getpreg($jsondata->href);
    //获取站点
    $addarray = array('uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'goodsurl' => $jsondata->href, 'goodsname' => $jsondata->name, 'goodsprice' => $jsondata->price, 'goodsimg' => $jsondata->picture, 'goodsseller' => $jsondata->shopName, 'sellerurl' => $jsondata->shopHref, 'goodssite' => $preg['shopname'], 'siteurl' => $preg['shopurl'], 'addtime' => time());
    //处理插入数据库
    $info = $f->add($addarray);
    if (GetNum($info)) {
        echo json_encode('OK');
        exit;
    } else {
        echo json_encode(lang('Error_handling_Favorites'));
        exit;
    }
} elseif ($action == 'del') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    //获取json数据
    if ($f->del($jsondata->favoriteId, $_USERS['uname'])) {
        exit(json_encode('OK'));
    } else {
        exit(json_encode(lang('error')));
    }
Exemplo n.º 7
0
    } else {
        //编辑信息表单
        $dataedit = $smtp->getdata(1, "eid={$eid}");
        $value = $dataedit[0];
        //获取第一条记录
        //包含后台模板文件
        include "tpl/smtp_list.htm";
    }
} elseif ($action == "add") {
    InitGP(array("smtp_server", "smtp_port", "smtp_email", "smtp_account", "smtp_password", "reply_address", "smtp_auth", "smtp_ssl", "state", "Submitadd"));
    //初始化变量全局返回
    if (!empty($Submitadd)) {
        $password = md5(md5($password));
        //两次md5加密
        $addarray = array("smtp_server" => $smtp_server, "smtp_port" => $smtp_port, "smtp_email" => $smtp_email, "smtp_account" => $smtp_account, "smtp_password" => $smtp_password, "reply_address" => $reply_address, "smtp_ssl" => $smtp_ssl, "state" => $state, "smtp_auth" => $smtp_auth);
        $info = $smtp->add($addarray);
        if (GetNum($info)) {
            showmsg("添加成功!", "smtp_list.php");
            //成功
        } else {
            showmsg($info, "-1");
        }
        //出错!
    } else {
        include "tpl/smtp_list.htm";
    }
} elseif ($action == "del" && !empty($eid)) {
    //执行删除操作
    $eid = GetNum($eid);
    $info = $smtp->del($eid);
    if ($info == "OK") {
Exemplo n.º 8
0
        if (empty($webname)) {
            exit("<script language='javascript'>alert(" . lang('website_noempty') . ");history.go(-1);</script>");
        }
        //处理插入数据库操作
        $addarray = array('uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'name' => lang('website') . '[<a href=\\"' . $weburl . '\\" target=\\"_blank\\">' . $webname . '</a>]' . lang('Recharge'), 'account' => $account, 'amount' => $money, 'price' => $money, 'num' => 1, 'money' => $money, 'remark' => Char_cv($remark), 'type' => 4, 'addtime' => time(), 'state' => 0);
    } elseif ($type == 'card') {
        InitGP(array("bankname", "account", 'amount', 'money'));
        //初始化变量全局返回
        $money = GetNum($money);
        if (empty($account) || empty($money) || $money < 0) {
            exit("<script language='javascript'>alert(" . lang('Credit_card_noempty') . ");history.go(-1);</script>");
        }
        if (empty($bankname)) {
            exit("<script language='javascript'>alert(" . lang('Bankname_noempty') . ");history.go(-1);</script>");
        }
        //处理插入数据库操作
        $addarray = array('uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'name' => $bankname, 'account' => $account, 'amount' => $money, 'price' => $money, 'num' => 1, 'money' => $money, 'remark' => '', 'type' => 5, 'addtime' => time(), 'state' => 0);
    } else {
        exit(lang('Parameter_error'));
    }
    $info = $serviceobj->add($addarray);
    if (GetNum($info)) {
        print "<script language='javascript'>alert(" . lang('submit_success') . ");</script>";
        //include_once(INC_PATH."/sendqq.func.php");
        //$msg="有新的充值信息!请尽快处理!充值订单ID:".$info;
        //send_qq_msg('527774557',$msg);
        jumpurl(url("service.php"));
    }
} else {
    exit(lang('Missing_parameter'));
}