コード例 #1
0
ファイル: sendorder.class.php プロジェクト: dalinhuang/c2my
 function del($id)
 {
     global $_USERS;
     $sendorders = $this->getone($id, "uname,oids,couponid,freight,serverfee,customsfee,totalfee,state");
     if (is_array($sendorders)) {
         if ($sendorders['state'] != 1) {
             return lang('Not_allowcancel_sendorder');
         }
         if ($_USERS['uname'] != $sendorders['uname']) {
             return lang('Permissions_not');
         }
         include_once INC_PATH . "/member.class.php";
         $m = new memberclass();
         $tempmoney = $sendorders['totalfee'];
         $note = lang('cancel_sendorder_id') . $id;
         $m->moneyedit($sendorders['uname'], $tempmoney, 3, $note);
         $wheresqlo = "oid in(" . $sendorders['oids'] . ")";
         editstate($this->tablepre . "order", "state", $wheresqlo, 4);
         //更改订单状态操作
         editstate($this->tablepre . "order", "sid", $wheresqlo, 0);
         //更改订单对应运单ID操作
         if (GetNum($sendorders['couponid'])) {
             editstate($this->tablepre . "coupon", "state", "cid = " . GetNum($sendorders['couponid']), 1);
             //更改优惠卷状态操作
         }
     } else {
         return lang('sendOrderID_notexist');
     }
     $dataarray = array('state' => 4);
     return $this->edit($id, $dataarray);
     //return $this->table_sendorder->del($id);
 }
コード例 #2
0
ファイル: m.php プロジェクト: dalinhuang/c2my
function helplist($num, $id = '', $aids = "", $orderby = "aid asc")
{
    if (is_numeric($id)) {
        $wherestr[] = "typeid = " . $id;
    } elseif (is_array($id)) {
        $ids = getdotstring($id, 'int');
        $wherestr[] = "typeid in ({$ids})";
    } elseif (is_string($id) && (strexists($id, ',') || strexists($id, '|'))) {
        if (strexists($id, ',')) {
            $ids = getdotstring($id, 'int');
        } else {
            $ids = getdotstring(explode('|', $ids), 'int');
        }
        $wherestr[] = "typeid in ({$ids})";
    } else {
        $wherestr[] = "";
    }
    if (!empty($aids)) {
        $aids = getdotstring($aids, 'int');
        $wherestr[] = "aid in ({$ids})";
    }
    $num = GetNum($num);
    $wheresql = implode(' AND ', $wherestr);
    //条件汇总
    $articleobj = new TableClass('article', 'aid');
    $articlearray = $articleobj->getdata($num, $wheresql, $orderby, 'aid,typeid,title');
    return $articlearray;
}
コード例 #3
0
 function reply($mid, $subject, $message)
 {
     global $_USERS;
     $mid = GetNum($mid);
     $temparray = $this->getone($mid);
     $addarray = array('fromuid' => $_USERS['uid'], 'fromuname' => $_USERS['uname'], 'touid' => $temparray['fromuid'], 'touname' => $temparray['fromuname'], 'type' => 2, 'subject' => Char_cv($subject), 'sendtime' => time(), 'writetime' => time(), 'hasview' => 0, 'isadmin' => 0, 'message' => Char_cv($message));
     return $this->add($addarray);
 }
コード例 #4
0
 /**
  * 付款成功充值到账户
  *
  * @param unknown_type $sn
  * @return 'OK'
  */
 function paysuccess($sn, $money)
 {
     $sn = GetNum($sn);
     $row = $this->getonebysn($sn, $field = "rid,uname,state,money,payname");
     if (!is_array($row)) {
         return lang('Renumber_notexist');
     }
     if ($row['state'] == 2) {
         return lang('been_recharge');
     }
     //更新状态
     $dataarray = array('money' => $money, 'successtime' => time(), 'state' => 2);
     $this->rechargerecord->edit($row['rid'], $dataarray);
     include_once INC_PATH . "/member.class.php";
     $m = new memberclass();
     $note = $row['payname'] . $money . lang('yuan') . lang('Serial_number') . $sn;
     $m->moneyedit($row['uname'], $money, 9, $note);
     return 'OK';
 }
コード例 #5
0
ファイル: table.class.php プロジェクト: dalinhuang/c2my
 /**
  * 获取指定ID相关一条信息
  *
  * @param unknown_type $eid
  * @return unknown
  */
 function getone($gid, $field = "*")
 {
     if (GetNum($gid)) {
         $gdata = $this->getdata(1, $this->idname . "='{$gid}'", '', $field);
         if (is_array($gdata)) {
             $value = $gdata[0];
         } else {
             $value = array();
         }
     }
     return $value;
 }
コード例 #6
0
ファイル: service_list.php プロジェクト: dalinhuang/c2my
    $wheresqlarr = "aid ={$ids}";
    $value = Char_cv($value);
    editstate($Table->table, "remark", $wheresqlarr, $value);
    //更改状态操作
    exit("1");
} elseif ($action == "changestate" && !empty($aid)) {
    //更改状态
    $aid = GetNum($aid);
    $wheresqlarr = "aid ={$aid}";
    editstate($Table->table, "state", $wheresqlarr, 1);
    //更改状态操作
    showmsg("修改状态成功!", "-1");
    //成功提示!
} elseif ($action == "chargeback" && !empty($aid)) {
    //更改状态
    $aid = GetNum($aid);
    $wheresqlarr = "aid ={$aid}";
    $row = $Table->getone($aid);
    $umoney = DB::result_first("Select money From `{$Table->table}` where uname like '{$row['uname']}' ");
    if ($umoney < $row['money']) {
        showmsg("用户帐户余额不足!扣费失败!", "-1");
    }
    //成功提示!
    include_once INC_PATH . "/member.class.php";
    $m = new memberclass();
    $note = $row['name'] . ' 账户:' . $row['account'] . '充值扣费' . $row['money'] . "服务订单ID:" . $row['aid'];
    $m->moneyedit($row['uname'], -$row['money'], 0, $note);
    //扣去账户余额
    editstate($Table->table, "state", $wheresqlarr, 2);
    //更改状态操作
    showmsg("修改状态并且扣费成功!", "-1");
コード例 #7
0
ファイル: sendorder_ajax.php プロジェクト: dalinhuang/c2my
            if ($action == 'cancelsell') {
                $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
                $sn = Char_cv($jsondata->code);
                $info = $coupon->cancelsell($sn, $_USERS['uname']);
                echo json_encode($info);
                exit;
            } else {
                if ($action == 'getcoupon') {
                    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
                    $price = GetNum($jsondata->price);
                    $num = GetNum($jsondata->num);
                    $info = $coupon->getcoupon($price, $num, $_USERS['uname']);
                    echo json_encode($info);
                    exit;
                } else {
                    if ($action == 'buycoupon') {
                        $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
                        $code = GetNum($jsondata->code);
                        if (empty($_USERS['uname'])) {
                            echo json_encode(lang('login_operate'));
                            exit;
                        }
                        $info = $coupon->buycoupon($code, $_USERS['uname']);
                        echo json_encode($info);
                        exit;
                    }
                }
            }
        }
    }
}
コード例 #8
0
ファイル: admin_add.php プロジェクト: dalinhuang/c2my
        $arrayadd = array("adminname" => Char_cv($adminname), "adminpwd" => Char_cv($adminpwd), "adminmid" => $adminmid, "adminpurview" => $adminpurview);
        $info = $Table->add($arrayadd);
        if (GetNum($info)) {
            exit("<script language='javascript'>alert('发布成功');parent.\$.fn.colorbox.close();</script>");
        } else {
            exit("<script language='javascript'>alert('发布失败');history.go(-1);</script>");
        }
    } else {
        //print_r($evalue);
        include "tpl/admin_add.htm";
    }
} elseif ($action == "edit" && !empty($adminid)) {
    InitGP(array("adminid", "adminname", "adminpwd", "mid"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($adminname) and !empty($adminid)) {
        $adminid = GetNum($adminid);
        if (empty($adminid)) {
            showmsg("缺少ID参数!", "-1");
        }
        //出错!
        if (empty($adminname)) {
            showmsg("管理员名不能为空!", "-1");
        }
        //出错!
        if (strlen($adminpwd) != 32) {
            $adminpwd = md5($adminpwd);
        }
        //用户密码加密
        if (is_array($mid)) {
            $adminmid = getdotstring($mid, 'int');
        }
コード例 #9
0
ファイル: bankaccount_add.php プロジェクト: dalinhuang/c2my
        if (GetNum($info)) {
            showmsg("发布成功!", PHP_SELF);
            //出错!
        } else {
            showmsg("发布失败!", "-1");
            //出错!
        }
    } else {
        //print_r($evalue);
        include "tpl/bankaccount_add.htm";
    }
} elseif ($action == "edit" && !empty($bid)) {
    InitGP(array("bid", "currency", "account", "accountname", "bankname", "remark"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($account) and !empty($bid)) {
        $bid = GetNum($bid);
        if (empty($bid)) {
            showmsg("缺少ID参数!", PHP_SELF);
        }
        //出错!
        if (empty($currency)) {
            showmsg("币种不能为空!", PHP_SELF);
        }
        //出错!
        if (empty($accountname)) {
            showmsg("账户名不能为空!", PHP_SELF);
        }
        //出错!
        $arrayadd = array("currency" => Char_cv($currency), "account" => Char_cv($account), "accountname" => Char_cv($accountname), "bankname" => Char_cv($bankname), "remark" => Char_cv($remark));
        $info = $Table->edit($bid, $arrayadd);
        if ($info == "OK") {
コード例 #10
0
ファイル: recommend.php プロジェクト: dalinhuang/c2my
    //获取当前页码
    $total = $goodsobj->getcount($wheresql);
    //总信息数
    $pagesize = 12;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $goodsobj->getdata("{$offset},{$pagesize}", $wheresql, 'listorder asc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
    //获取数据
    //print_r($dataarray);
    include template('recommend_list');
    //包含输出指定模板
} elseif ($action == 'view') {
    $gid = GetNum($gid);
    $value = $goodsobj->getone($gid);
    $gtype = $typeobj->getone($value['gtypeid']);
    if ($gtype['node'] == 0) {
        $position = "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
    } else {
        $cgtype = $typeobj->getone($gtype['node']);
        $position = "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $cgtype['typeid'] . "'>" . $cgtype['typename'] . "</a>";
        $position .= "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
    }
    $leftarray = $goodsobj->getdata(10, "flag='c'", 'buynum desc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
    addfield($goodsobj->table, 'views', "gid=" . $gid, 1);
    //增加浏览次数
    include template('recommend_view');
    //包含输出指定模板
} else {
コード例 #11
0
ファイル: mange.php プロジェクト: dalinhuang/c2my
    } else {
        $evalue = $mange->getone($mid);
    }
} elseif ($action == "del" && !empty($did)) {
    //执行删除操作
    $did = GetNum($did);
    $info = $mange->del($did);
    if ($info == "OK") {
        showmsg("删除成功!", PHP_SELF);
    } else {
        showmsg($info, "article_list.php");
    }
} elseif ($action == "dels") {
    if (empty($delids)) {
        showmsg("没有选择任何对象!", PHP_SELF);
        exit;
    }
    //空选择
    //执行删除多个操作
    foreach ($delids as $id) {
        $id = GetNum($id);
        $info = $mange->del($id);
    }
    if ($info == "OK") {
        showmsg("删除成功!", PHP_SELF);
    } else {
        showmsg($info, PHP_SELF);
    }
}
//包含后台模板文件
include "tpl/mange.htm";
コード例 #12
0
ファイル: news_add.php プロジェクト: dalinhuang/c2my
        include "tpl/news_add.htm";
    }
} elseif ($action == "edit" && !empty($nid)) {
    InitGP(array("nid", "typeid", "title", "seokeywords", "seodescription", "listorder", "body"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($title) and !empty($nid)) {
        $nid = GetNum($nid);
        if (empty($nid)) {
            showmsg("缺少ID参数!", PHP_SELF);
        }
        //出错!
        if (empty($body)) {
            showmsg("内容不能为空!", PHP_SELF);
        }
        //出错!
        $arrayadd = array("title" => Char_cv($title), "seokeywords" => Char_cv($seokeywords), "seodescription" => Char_cv($seodescription), "listorder" => GetNum($listorder), "body" => HtmlReplace($body, -1), "addtime" => time());
        $info = $Table->edit($nid, $arrayadd);
        if ($info == "OK") {
            showmsg("更新成功!", "news_list.php");
            //出错!
        } else {
            showmsg("更新失败!", "news_list.php");
            //出错!
        }
    } else {
        $evalue = $Table->getone($nid);
        //print_r($evalue);
        include "tpl/news_add.htm";
    }
} else {
    showmsg("未知请求", "-1");
コード例 #13
0
ファイル: see.php プロジェクト: dalinhuang/c2my
<?php

include "common.inc.php";
InitGP(array("action", "type", "keyword", "aid", "page"));
//初始化变量全局返回
include_once INC_PATH . "/order.class.php";
$orderobj = OrderClass::init();
$keyword = FilterSearch(stripslashes($keyword));
//过滤搜索
if ($keyword != '' || strlen($keyword) > 2) {
    $wherestr[] = "goodsname like '%" . $keyword . "%'";
}
$type = GetNum($type);
if ($type) {
    $wherestr[] = "typeid='" . $type . "'";
}
//$wherestr[]="uname='".$_USERS['uname']."'";
if (!empty($wherestr)) {
    $wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $orderobj->getcount($wheresql);
//总信息数
if ($total > 1000) {
    $total = 1000;
}
//显示最大一千条
$pagesize = 10;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
コード例 #14
0
ファイル: goodsimg_get.php プロジェクト: dalinhuang/c2my
         $ids = getdotstring($oid, 'int');
         $wherestr[] = "oid" . " in ({$ids})";
     } elseif (is_string($oid) && (strexists($oid, ',') || strexists($oid, '|'))) {
         if (strexists($oid, ',')) {
             $ids = getdotstring($oid, 'int');
         } else {
             $ids = getdotstring(explode('|', $ids), 'int');
         }
         $wherestr[] = "oid" . " in ({$ids})";
     } else {
         exit("ID格式错误");
     }
 } elseif (!empty($type)) {
     if ($type == "all") {
     } elseif ($type == "idlist") {
         if (GetNum($startid) and GetNum($endid)) {
             $wherestr[] = "oid >={$startid}";
             $wherestr[] = "oid <={$endid}";
         } else {
             showmsg("ID范围必须填写!", PHP_SELF);
         }
     } elseif ($type == "timelist") {
         if (!empty($starttime) && !empty($endtime)) {
             $starttimeunix = strtotime($starttime);
             $endtimeunix = strtotime($endtime);
             $wherestr[] = "addtime >{$starttimeunix}";
             $wherestr[] = "addtime <{$endtimeunix}";
         } else {
             showmsg("时间范围必须填写!", PHP_SELF);
         }
     }
コード例 #15
0
ファイル: special.php プロジェクト: dalinhuang/c2my
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    //获取当前页码
    $total = $specialobj->getcount($wheresql);
    //总信息数
    if ($total > 1000) {
        $total = 1000;
    }
    //显示最大一千条
    $pagesize = 6;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $specialobj->getdata("{$offset},{$pagesize}", $wheresql, "", 'sid,title,flag,about,pic,listorder,addtime');
    //获取数据
    //获取头条和推荐
    $topharray = $specialobj->getdata(1, "flag='hd'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
    $topcarray = $specialobj->getdata(3, "flag='hd'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
    include template('special');
    //包含输出指定模板
} elseif ($action == "view") {
    $sid = GetNum($sid);
    $value = $specialobj->getone($sid);
    include template('special_view');
    //包含输出指定模板
} else {
    exit(lang('Missing_parameter'));
}
コード例 #16
0
ファイル: sendorder_edit.php プロジェクト: dalinhuang/c2my
<?php

include "../common.inc.php";
include "function_common.php";
InitGP(array("page", "action", "state", "value", "payid", "ids", "did", "delids"));
//初始化变量全局返回
$Table = new TableClass("sendorder", "sid");
AjaxHead();
//禁止页面缓存
header("Content-type: text/html; charset=" . CHARSET);
if (empty($action)) {
    InitGP(array("sid", "sn", "email", "freight", "serverfee", "customsfee", "totalfee", "consignee", "country", "city", "zip", "tel", "address", "state", "remark", "tel", "Submit", "comment", "reply", "showcomment"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($sid)) {
        $sid = GetNum($sid);
        $arrayedit = array("sn" => Char_cv($sn), "email" => Char_cv($email), "freight" => GetNum($freight), "serverfee" => GetNum($serverfee), "customsfee" => GetNum($customsfee), "totalfee" => GetNum($totalfee), "consignee" => Char_cv($consignee), "country" => Char_cv($country), "city" => Char_cv($city), "zip" => Char_cv($zip), "tel" => Char_cv($tel), "address" => Char_cv($address), "remark" => Char_cv($remark), "state" => GetNum($state), "comment" => Char_cv($comment), "reply" => Char_cv($reply), "showcomment" => GetNum($showcomment), "uptime" => time());
        $info = $Table->edit($sid, $arrayedit);
        if ($info == "OK") {
            exit("<script language='javascript'>alert('编辑成功');parent.parent.\$.fn.colorbox.close();</script>");
        } else {
            exit("<script language='javascript'>alert('编辑失败');parent.location.reload();</script>");
        }
    } else {
        $evalue = $Table->getone($sid);
        //print_r($evalue);
        include "tpl/sendorder_edit.htm";
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
コード例 #17
0
ファイル: shopsite.class.php プロジェクト: dalinhuang/c2my
 function get($url)
 {
     $matches = $preg = array();
     $this->http->OpenUrl($url);
     $html = file_get_contents($url);
     $preg = $this->getpreg($url);
     if (empty($html) || $preg == false) {
         return false;
     }
     //找不到对应采集规则或者抓取网页失败返回false
     $html = iconv($preg['charset'], CHARSET, $html);
     //编码转换
     //$response = iconv("gbk","utf-8//IGNORE",$response);
     //抓取商品名
     if (empty($preg['preg_goodsname'])) {
         $result['goodsname'] = $preg['preg_goodsname2'];
     } elseif (!empty($preg['preg_goodsname'])) {
         preg_match($preg['preg_goodsname'], $html, $matches);
         $result['goodsname'] = $matches['this'];
         if (empty($result['goodsname']) && !empty($preg['preg_goodsname2'])) {
             preg_match($preg['preg_goodsname2'], $html, $matches);
             $result['goodsname'] = $matches['this'];
             if (empty($result['goodsname']) && !empty($preg['preg_goodsname3'])) {
                 preg_match($preg['preg_goodsname3'], $html, $matches);
                 $result['goodsname'] = $matches['this'];
             }
         }
     }
     //抓取价格
     $matches = array();
     if (empty($preg['preg_goodsprice'])) {
         $result['goodsprice'] = $preg['preg_goodsprice2'];
     } elseif (!empty($preg['preg_goodsprice'])) {
         preg_match($preg['preg_goodsprice'], $html, $matches);
         $result['goodsprice'] = $matches['this'];
         if (!is_numeric($result['goodsprice']) && !empty($preg['preg_goodsprice2'])) {
             preg_match($preg['preg_goodsprice2'], $html, $matches);
             $result['goodsprice'] = $matches['this'];
             if (empty($result['goodsprice']) && !empty($preg['preg_goodsprice3'])) {
                 preg_match($preg['preg_goodsprice3'], $html, $matches);
                 $result['goodsprice'] = $matches['this'];
             }
         }
     }
     //抓取运费
     $matches = array();
     if (empty($preg['preg_sendprice'])) {
         $result['sendprice'] = $preg['preg_sendprice2'];
     } elseif (!empty($preg['preg_sendprice'])) {
         preg_match($preg['preg_sendprice'], $html, $matches);
         $result['sendprice'] = $matches['this'];
         if (empty($result['sendprice']) && !empty($preg['preg_sendprice2'])) {
             preg_match($preg['preg_sendprice2'], $html, $matches);
             $result['sendprice'] = $matches['this'];
             if (empty($result['sendprice']) && !empty($preg['preg_sendprice3'])) {
                 preg_match($preg['preg_sendprice3'], $html, $matches);
                 $result['sendprice'] = $matches['this'];
             }
         }
     }
     //抓取图片
     $matches = array();
     if (empty($preg['preg_goodsimg'])) {
         $result['goodsimg'] = $preg['preg_goodsimg2'];
     } elseif (!empty($preg['preg_goodsimg'])) {
         preg_match($preg['preg_goodsimg'], $html, $matches);
         $result['goodsimg'] = $matches['this'];
         if (empty($result['goodsimg']) && !empty($preg['preg_goodsimg2'])) {
             preg_match($preg['preg_goodsimg2'], $html, $matches);
             $result['goodsimg'] = $matches['this'];
             if (empty($result['goodsimg']) && !empty($preg['preg_goodsimg3'])) {
                 preg_match($preg['preg_goodsimg3'], $html, $matches);
                 $result['goodsimg'] = $matches['this'];
             }
         }
     }
     //抓取卖家
     $matches = array();
     if (empty($preg['preg_goodsseller'])) {
         $result['goodsseller'] = $preg['preg_goodsseller2'];
     } elseif (!empty($preg['preg_goodsseller'])) {
         preg_match($preg['preg_goodsseller'], $html, $matches);
         $result['goodsseller'] = $matches['this'];
         if (empty($result['goodsseller']) && !empty($preg['preg_goodsseller2'])) {
             preg_match($preg['preg_goodsseller2'], $html, $matches);
             $result['goodsseller'] = $matches['this'];
             if (empty($result['goodsseller']) && !empty($preg['preg_goodsseller3'])) {
                 preg_match($preg['preg_goodsseller3'], $html, $matches);
                 $result['goodsseller'] = $matches['this'];
             }
         }
     }
     //抓取卖家url地址
     $matches = array();
     if (empty($preg['preg_sellerurl'])) {
         $result['sellerurl'] = $preg['preg_sellerurl2'];
     } elseif (!empty($preg['preg_sellerurl'])) {
         preg_match($preg['preg_sellerurl'], $html, $matches);
         $result['sellerurl'] = $matches['this'];
         if (empty($result['sellerurl']) && !empty($preg['preg_sellerurl2'])) {
             preg_match($preg['preg_sellerurl2'], $html, $matches);
             $result['sellerurl'] = $matches['this'];
             if (empty($result['sellerurl']) && !empty($preg['preg_sellerurl3'])) {
                 preg_match($preg['preg_sellerurl3'], $html, $matches);
                 $result['sellerurl'] = $matches['this'];
             }
         }
     }
     $result['preg_goodsprice'] = GetNum($result['preg_goodsprice']);
     $result['sendprice'] = GetNum($result['sendprice']);
     $result['url'] = $url;
     $result['goodsurl'] = $url;
     $result['shopname'] = $preg['shopname'];
     $result['shopurl'] = $preg['shopurl'];
     return $result;
     //返回抓取到的数据
 }
コード例 #18
0
ファイル: edituserinfo.php プロジェクト: dalinhuang/c2my
    InitGP(array("tname", "sex", "tel", "zip", "address", "qq", "msn", "country", "city", "oldface", "commit"));
    //初始化变量全局返回
    if (!empty($commit)) {
        //上传图片处理
        require_once INC_PATH . '/upload.class.php';
        $f = new Upload('attachment/avatar', array('gif', 'jpg', 'jpge', 'png'), 50000);
        //路径 允许扩展名 文件尺寸
        $f->setThumb(0);
        //设置不生成缩微图
        $f->run('faceimg', 1);
        $info = $f->getInfo();
        $imgdata = $info[0]['fullsavename'];
        //获取第一个上传图片反馈
        if (isset($info[0]['error'])) {
            $imgdata = $oldface;
        }
        $editarray = array("tname" => Char_cv($tname), "sex" => GetNum($sex), "tel" => GetNum($tel), "zip" => Char_cv($zip), "address" => Char_cv($address), "qq" => GetNum($qq), "msn" => Char_cv($msn), "country" => Char_cv($country), "face" => $imgdata, "city" => Char_cv($city));
        $msg = $m->edit($_USERS['uname'], '', $_USERS['password'], '', $editarray);
        if ($msg == "OK") {
            print "<script language='javascript'>alert(" . lang('update_success') . ");</script>";
            jumpurl(url('m.php?name=edituserinfo'));
        } else {
            print "<script language='javascript'>alert(" . lang('update_lose') . ");</script>";
            jumpurl(url('m.php?name=edituserinfo'));
        }
    } else {
        $value = $m->getone($_USERS['uname']);
    }
}
include template('member_edituserinfo');
//包含输出指定模板
コード例 #19
0
ファイル: recommend_ajax.php プロジェクト: dalinhuang/c2my
     if ($type == 0) {
         $type = 1;
     }
     $expressno = Char_cv($pdata->expressno);
     if (strlen($p_name) <= 0 || strlen($p_price) <= 0 || $p_fee < 0 || strlen($p_num) <= 0 || strlen($p_url) <= 0) {
         echo 132;
         return;
     }
     $preg = $shopsite->getpreg($p_url);
     //获取站点
     //放入购物车处理
     $addarray = array('goodsurl' => $p_url, 'goodsname' => $p_name, 'goodsprice' => $p_price, 'sendprice' => $p_fee, 'goodsnum' => $p_num, 'goodsimg' => $picture, 'goodssize' => $p_size, 'goodscolor' => $p_color, 'goodsseller' => $p_saler, 'sellerurl' => $s_url, 'goodssite' => $preg['shopname'], 'siteurl' => $preg['shopurl'], 'expressno' => $expressno, 'type' => $type, 'goodsremark' => $p_note, 'addtime' => time());
     include INC_PATH . "/cart.class.php";
     $Cart = CartClass::init();
     $info = $Cart->add($addarray);
     if (GetNum($info)) {
         echo json_encode('OK');
     } else {
         echo $info;
     }
     exit;
 } else {
     if ($action == 'state') {
         include INC_PATH . "/cart.class.php";
         $Cart = CartClass::init();
         $countnum = $Cart->getnum();
         $countmoney = $Cart->countmoney();
         //返回商品总数和总价
         echo "tj#" . $countnum . "#" . $countmoney['totalmoney'];
     }
 }
コード例 #20
0
    $freight = sprintf("%01.2f", $freight);
    $serverfee = sprintf("%01.2f", $serverfee);
    $deliveryrow['customs_fee'] = sprintf("%01.2f", $deliveryrow['customs_fee']);
    $addarray = array('uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'email' => $_USERS['email'], 'oids' => $oids, 'couponid' => GetNum($couponid), 'freight' => GetNum($freight), 'serverfee' => $serverfee, 'customsfee' => $deliveryrow['customs_fee'], 'totalfee' => $totalfee, 'countmoney' => $countmoney, 'countweight' => $countweight, 'consignee' => $consignee, 'country' => $country, 'city' => $city, 'zip' => $zip, 'tel' => $tel, 'address' => $address, 'remark' => $remark, 'did' => $did, 'deliveryname' => $deliveryrow['deliveryname'], 'areaname' => $deliveryrow['areaname'], 'addtime' => time(), 'uptime' => time(), 'state' => 1);
    include_once INC_PATH . "/sendorder.class.php";
    $sendorderobj = SendOrderClass::init();
    $sid = $sendorderobj->add($addarray);
    if (GetNum($sid)) {
        //提交成功,处理扣费和修改订单状态
        include_once INC_PATH . "/member.class.php";
        $m = new memberclass();
        $note = "提交运单,运单ID:" . $sid;
        $m->moneyedit($_USERS['uname'], -$totalfee, 3, $note);
        //扣费操作
        editstate($tablepre . "order", "state", $wheresqlo, 5);
        //更改订单状态操作
        editstate($tablepre . "order", "sid", $wheresqlo, $sid);
        //更改订单对应运单ID操作
        if (GetNum($couponid)) {
            editstate($tablepre . "coupon", "state", "cid = " . GetNum($couponid), 3);
            //更改优惠卷状态操作
        }
        //显示成功页面
        include template('member_tosendorderok');
        //包含输出指定模板
    } else {
        print "<script language='javascript'>alert('生成送货单出错!');</script>";
        jumpurl(url('m.php?name=orderlist'));
    }
    //	print_r($addarray);
}
コード例 #21
0
ファイル: rechargeinfo.php プロジェクト: dalinhuang/c2my
    //条件汇总
    $orderway = $orderway == "desc" ? "desc" : "asc";
    if (!empty($orderby)) {
        $orderstr = "{$orderby} {$orderway}";
    }
    //获取当前页码
    $total = $Table->getcount($wheresql);
    //总信息数
    $pagesize = 16;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, $orderstr);
    //获取数据
    //包含后台模板文件
    include "tpl/rechargeinfo.htm";
} elseif ($action == "del" && !empty($rid)) {
    //执行删除操作
    $did = GetNum($rid);
    $info = $Table->del($rid);
    if ($info == "OK") {
        showmsg("删除成功!", PHP_SELF);
    } else {
        showmsg($info, PHP_SELF);
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
コード例 #22
0
ファイル: cart.class.php プロジェクト: dalinhuang/c2my
 function getallbyuid($uid)
 {
     $uid = GetNum($uid);
     return $this->getdata("", "uid = '{$uid}'", "goodsseller desc,gid desc");
 }
コード例 #23
0
ファイル: myaddress.php プロジェクト: dalinhuang/c2my
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    $tempid = GetNum($jsondata->id);
    $addarray = array('uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'consignee' => Char_cv($jsondata->consignee), 'country' => Char_cv($jsondata->country), 'city' => Char_cv($jsondata->city), 'zip' => Char_cv($jsondata->zip), 'tel' => Char_cv($jsondata->teltphone), 'address' => Char_cv($jsondata->address));
    if ($tempid > 0) {
        //编辑
        $r->edit($tempid, $addarray);
        $rjson['d'] = 1;
    } else {
        //增加
        $info = $r->add($addarray);
        $rjson['d'] = $info;
    }
    echo json_encode($rjson);
} elseif ($action == "setdefault") {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    $aid = GetNum($jsondata->id);
    $wheresqlarr = "uname='" . $_USERS['uname'] . "'";
    $wheresqlarr2 = "uname='" . $_USERS['uname'] . "' and aid=" . $aid;
    editstate($r->table, "def", $wheresqlarr, 0);
    //更改状态操作
    editstate($r->table, "def", $wheresqlarr2, 1);
    //更改状态操作
    $rjson['d'] = "success";
    echo json_encode($rjson);
} elseif ($action == "del") {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    $aid = GetNum($jsondata->id);
    $r->del($aid, $_USERS['uname']);
    $rjson['d'] = "success";
    echo json_encode($rjson);
}
コード例 #24
0
ファイル: member.class.php プロジェクト: dalinhuang/c2my
 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;
 }
コード例 #25
0
ファイル: order_edit.php プロジェクト: dalinhuang/c2my
            $note = "调整商品<a href=\\'" . $goodsurl . "\\' target=\\'_blank\\'>《" . $goodsname . "》</a>价格:" . -$tempmoney . "订单ID:" . $oid;
            $m->moneyedit($uname, $tempmoney, 5, $note);
            //扣去账户余额
        }
        if ($sendprice != $oldsendprice) {
            //商品运费调整
            $tempmoney = 0;
            $tempmoney = GetNum($oldsendprice - $sendprice);
            //计算运费调整
            $wheresqlarr = "uname = '" . $uname . "' and goodsseller = '" . $goodsseller . "' and state < 3";
            editstate($Table->table, "sendprice", $wheresqlarr, $sendprice);
            //更改状态操作
            include_once INC_PATH . "/member.class.php";
            $m = new memberclass();
            $note = "调整商品<a href=\\'" . $goodsurl . "\\' target=\\'_blank\\'>《" . $goodsname . "》</a>运费:" . -$tempmoney . "订单ID:" . $oid;
            $m->moneyedit($uname, $tempmoney, 5, $note);
            //扣去账户余额
        }
        $arrayedit = array("goodsurl" => $goodsurl, "goodsname" => Char_cv($goodsname), "goodsprice" => GetNum($goodsprice), "sendprice" => GetNum($sendprice), "goodsnum" => GetNum($goodsnum), "goodssize" => Char_cv($goodssize), "goodscolor" => Char_cv($goodscolor), "goodsseller" => Char_cv($goodsseller), "goodsremark" => Char_cv($goodsremark), "orderremark" => Char_cv($orderremark), "sellerurl" => $sellerurl, "expressno" => $expressno, "orderweight" => GetNum($orderweight), "state" => GetNum($state), "payid" => Char_cv($payid), "uptime" => time());
        $info = $Table->edit($oid, $arrayedit);
        if ($info == "OK") {
            exit("<script language='javascript'>alert('编辑成功');parent.parent.\$.fn.colorbox.close();</script>");
        } else {
            exit("<script language='javascript'>alert('编辑失败');parent.location.reload();</script>");
        }
    } else {
        $evalue = $Table->getone($oid);
        //print_r($evalue);
        include "tpl/order_edit.htm";
    }
}
コード例 #26
0
<?php

include 'securimage.php';
$img = new securimage();
$_GET['s'] = '';
$_GET['t'] = '';
$w = GetNum($_GET['w']);
$h = GetNum($_GET['h']);
$width = 131;
$height = 28;
if (!empty($w)) {
    $width = $w;
}
if (!empty($h)) {
    $height = $h;
}
$img->image_width = $width;
$img->image_height = $height;
$img->font_size = 16;
$img->text_x_start = 1;
$img->text_minimum_distance = 12;
$img->text_maximum_distance = 13;
$img->arc_linethrough = false;
$img->charset = '0123456789';
$img->perturbation = 0.4;
// 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color("#ff6600");
$img->text_color = new Securimage_Color("#EAEAEA");
$img->text_transparency_percentage = 100;
// 100 = completely transparent
$img->num_lines = 1;
コード例 #27
0
ファイル: admin_list.php プロジェクト: dalinhuang/c2my
    //更改状态操作
    exit("1");
} elseif ($action == "del" && !empty($did)) {
    //执行删除操作
    $did = GetNum($did);
    $info = $Table->del($did);
    if ($info == "OK") {
        showmsg("删除成功!", PHP_SELF);
    } else {
        showmsg($info, PHP_SELF);
    }
} elseif ($action == "dels") {
    if (empty($delids)) {
        showmsg("没有选择任何对象!", PHP_SELF);
        exit;
    }
    //空选择
    //执行删除多个操作
    $delids = explode('|', $delids);
    foreach ($delids as $id) {
        if (GetNum($id)) {
            $info = $Table->del($id);
        }
    }
    if ($info == "OK") {
        exit("1");
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
コード例 #28
0
ファイル: shop_goods_add.php プロジェクト: dalinhuang/c2my
            showmsg("商品价格不能为空!", PHP_SELF);
        }
        //出错!
        require_once INC_PATH . '/upload.class.php';
        $f = new Upload('../attachment/shop', array('gif', 'jpg', 'jpge', 'png'), 50000);
        //路径 允许扩展名 文件尺寸
        $f->setThumb(0);
        //设置不生成缩微图
        $f->run('fileimg', 1);
        $info = $f->getInfo();
        $imgdata = $info[0]['fullsavename'];
        //获取第一个上传图片反馈
        if (isset($info[0]['error'])) {
            $imgdata = $imgold;
        }
        $arrayadd = array("gtypeid" => GetNum($gtypeid), "goodsname" => Char_cv($goodsname), "goodsimg" => $imgdata, "goodsprice" => GetNum($goodsprice), "rindex" => GetNum($rank), "views" => GetNum($views), "buynum" => GetNum($buynum), "listorder" => GetNum($listorder), "about" => HtmlReplace($about, -1), "addtime" => time());
        $info = $Table->edit($gid, $arrayadd);
        if ($info == "OK") {
            showmsg("更新成功!", "shop_goods_list.php");
            //出错!
        } else {
            showmsg("更新失败!", "shop_goods_list.php");
            //出错!
        }
    } else {
        $evalue = $Table->getone($gid);
        //print_r($evalue);
        include "tpl/shop_goods_add.htm";
    }
} else {
    showmsg("未知请求", "-1");
コード例 #29
0
ファイル: estimates.tpl.php プロジェクト: dalinhuang/c2my
                        1: 填写您需购买的商品总价格
                    </td>
                    <td>
                        <input type="text" value="<?php 
echo GetNum($_GET['m']);
?>
" style="width: 200px;" id="tbTotleProductCost" class="inp1">(元)
                    </td>
                </tr>
                <tr align="left">
                    <td>
                        2: 估算您需要购买的商品总重量(不包括包装)
                    </td>
                    <td>
                        <input type="text" value="<?php 
echo GetNum($_GET['w']);
?>
" style="width: 200px;" id="tbTotleWeight" class="inp1">(g)
                    </td>
                </tr>
                <tr align="left">
                    <td>
                        3: 选择您的送货地区
                    </td>
                    <td>
                        <select id="ctl00_ctl00_ctl00_NewContentPlaceHolder_ContentPlaceHolder1_subContent_ddlArea" name="ctl00$ctl00$ctl00$NewContentPlaceHolder$ContentPlaceHolder1$subContent$ddlArea">
<option value="运送区域">运送区域</option>			
<?php 
if (is_array($areaarray)) {
    foreach ($areaarray as $r) {
        ?>
コード例 #30
0
ファイル: sendorder_list.php プロジェクト: dalinhuang/c2my
        } else {
            showmsg($info, "-1");
        }
        //出错!
    } else {
        $evalue = $Table->getone($mid);
    }
} elseif ($action == "updatestate" && !empty($ids) && !empty($state)) {
    //更改状态
    $state = GetNum($state);
    $ids = getdotstring(explode('|', $ids));
    $wheresqlarr = "sid in({$ids})";
    editstate($Table->table, "state", $wheresqlarr, $state);
    //更改状态操作
    editstate($Table->table, "uptime", $wheresqlarr, $timestamp);
    //更改更新时间操作
    exit("1");
} elseif ($action == "updateexpressno" && !empty($ids) && !empty($value)) {
    //更改状态
    $ids = GetNum($ids);
    $wheresqlarr = "sid ={$ids}";
    $value = Char_cv($value);
    editstate($Table->table, "sn", $wheresqlarr, $value);
    //更改状态操作
    editstate($Table->table, "uptime", $wheresqlarr, $timestamp);
    //更改更新时间操作
    exit("1");
} else {
    showmsg("未知请求", "-1");
    //出错!
}