Esempio n. 1
0
        $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"));
    //初始化变量全局返回
    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->edit($typeid, $arrayadd);
        if ($info == "OK") {
Esempio n. 2
0
<?php

include "common.inc.php";
InitGP(array("action", "tid", "gid", "page"));
//初始化变量全局返回
$goodsobj = new TableClass('goods', 'gid');
$typeobj = new TableClass('gtype', 'typeid');
if ($action == 'list') {
    $tid = GetNum($tid);
    $gtype = $typeobj->getone($tid);
    if ($gtype['node'] == 0) {
        $childgtype = $typeobj->getdata('', "node=" . $gtype['typeid']);
        foreach ($childgtype as $child) {
            $tids[] = $child['typeid'];
        }
        $position = "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
        $typename = $gtype['typename'];
    } else {
        $cgtype = $typeobj->getone($gtype['node']);
        $typename = $cgtype['typename'];
        $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>";
    }
    $tids[] = $tid;
    $wherestr[] = "gtypeid in(" . getdotstring($tids, 'int') . ")";
    $wherestr[] = "Audit=1";
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    //获取当前页码
Esempio n. 3
0
            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") {
            exit("<script language='javascript'>alert('编辑成功');parent.\$.fn.colorbox.close();</script>");
        } else {
            exit("<script language='javascript'>alert('编辑失败');history.go(-1);</script>");
        }
    } else {
        $evalue = $Table->getone($bid);
        //print_r($evalue);
        include "tpl/bankaccount_add.htm";
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
//获取选择文章分类下拉框
function getatypeselect($var = "", $value = "", $other = "")
{
    $Table = new TableClass("atype", "typeid");
    $arraydata = $Table->getdata('', '', 'typeid asc');
    foreach ($arraydata as $val) {
        $arrayoption[$val['typeid']] = $val['typename'];
    }
Esempio n. 4
0
        }
        if ($mid == 0) {
            showmsg("缺少ID参数!", -1);
        }
        //成功
        $arrayedit = array("mname" => Char_cv($mname), "type" => Char_cv($type), "node" => GetNum($node), "murl" => Char_cv($murl), "listorder" => GetNum($listorder), "mcode" => Char_cv($mcode));
        $info = $Table->edit($mid, $arrayedit);
        if ($info == "OK") {
            showmsg("编辑成功!", PHP_SELF);
            //成功
        } else {
            showmsg($info, "-1");
        }
        //出错!
    } else {
        $evalue = $Table->getone($mid);
    }
} elseif ($action == "updatestate" && !empty($ids) && !empty($state)) {
    //更改状态
    $state = GetNum($state);
    $ids = getdotstring(explode('|', $ids));
    $wheresqlarr = "aid in({$ids})";
    editstate($Table->table, "state", $wheresqlarr, $state);
    //更改状态操作
    exit("1");
} elseif ($action == "updateremark" && !empty($ids) && !empty($value)) {
    //更改状态
    $ids = GetNum($ids);
    $wheresqlarr = "aid ={$ids}";
    $value = Char_cv($value);
    editstate($Table->table, "remark", $wheresqlarr, $value);
Esempio n. 5
0
        $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'));
}
Esempio n. 6
0
    if (!empty($_USERS['uname'])) {
        $uname = $_USERS['uname'];
        $wherestr[] = "uname='{$uname}'";
        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));
            }
        }
    }
}
Esempio n. 7
0
        $rightatypearray = $atypeobj->getdata('', 'typeid=' . $typeid, 'typeid asc');
        $rightarticlearray = $articleobj->getdata('', 'typeid=' . $typeid, 'aid asc', 'aid,typeid,title');
    } elseif (!empty($keyword)) {
        $keyword = Char_cv($keyword);
        $rightatypearray = $atypearray;
        $rightarticlearray = $articleobj->getdata('', 'title like \'%' . $keyword . '%\'', 'aid asc', 'aid,typeid,title');
    } else {
        $rightatypearray = $atypearray;
        $rightarticlearray = $articlearray;
    }
    include template('help');
    //包含输出指定模板
} elseif ($action == 'view') {
    $aid = GetNum($id);
    if (!empty($aid)) {
        $value = $articleobj->getone($aid);
        $i = 0;
        foreach ($articlearray as $r) {
            if ($r['typeid'] == $value['typeid']) {
                $articlelist[] = $r;
                if ($r['aid'] > $aid and $i == 0) {
                    $nextvalue = $r;
                    $i++;
                }
            }
        }
        foreach ($atypearray as $r) {
            if ($value['typeid'] == $r['typeid']) {
                $position = $r;
            }
        }
Esempio n. 8
0
        $arrayadd = array("fromuid" => 0, "fromuname" => Char_cv($_ADMINUSERS['adminname']), "touid" => $uid, "touname" => Char_cv($uname), "type" => 1, "subject" => Char_cv($subject), "message" => Char_cv($message), "sendtime" => $timestamp, "writetime" => $timestamp, "hasview" => 0, "isadmin" => $isadmin);
        $info = $Table->add($arrayadd);
        if (GetNum($info)) {
            if (!empty($inbox)) {
                exit("<script language='javascript'>alert('发送成功');parent.\$.fn.colorbox.close();</script>");
            } else {
                showmsg("发送成功", PHP_SELF);
                //出错!
            }
        } else {
            if (!empty($inbox)) {
                exit("<script language='javascript'>alert('发送失败');location.reload();</script>");
            } else {
                showmsg("发送成功", PHP_SELF);
                //出错!
            }
        }
    } else {
        if (!empty($uid)) {
            $Tableu = new TableClass("users", "uid");
            $evalue = $Tableu->getone($uid);
        } elseif (!empty($uname)) {
            $evalue['uname'] = $uname;
        }
        //print_r($evalue);
        include "tpl/pm_send.htm";
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
     jumpurl(url('m.php?name=orderlist'));
 }
 if (empty($consignee) || empty($address)) {
     print "<script language='javascript'>alert('收货人姓名和地址不能为空!');</script>";
     jumpurl(url('m.php?name=orderlist'));
 }
 $deliveryrow = $deliveryobj->getone($did);
 if (empty($deliveryrow)) {
     print "<script language='javascript'>alert('运送方式不存在!');</script>";
     jumpurl(url('m.php?name=orderlist'));
 }
 if (empty($deliveryrow) || $deliveryrow['areaid'] != $area) {
     print "<script language='javascript'>alert('运送区域不对照');</script>";
     jumpurl(url('m.php?name=orderlist'));
 } else {
     $arearow = $areaobj->getone($area);
     if (empty($arearow)) {
         print "<script language='javascript'>alert('运送区域数据不存在');</script>";
         jumpurl(url('m.php?name=orderlist'));
     }
 }
 //使用优惠卷
 if ($usecoupon == 1 && GetNum($couponid)) {
     $wherestrc[] = "uname='" . $_USERS['uname'] . "'";
     $wherestrc[] = "endtime >= " . time();
     $wherestrc[] = "state = 1";
     $wherestrc[] = "cid = " . GetNum($couponid);
     if (!empty($wherestrc)) {
         $wheresqlc = implode(' AND ', $wherestrc);
     }
     //条件汇总
Esempio n. 10
0
        }
        if ($mid == 0) {
            showmsg("缺少ID参数!", -1);
        }
        //成功
        $arrayedit = 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->edit($mid, $arrayedit);
        if ($info == "OK") {
            showmsg("编辑成功!", PHP_SELF);
            //成功
        } else {
            showmsg($info, "-1");
        }
        //出错!
    } 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;
    }
Esempio n. 11
0
        foreach ($menuarray as $value) {
            if (in_array($value['mid'], $mid)) {
                $temparray[] = $value['mcode'];
            }
        }
        $adminpurview = implode_field_value($temparray);
        //格式化成id,id形式
        $arrayadd = array("adminname" => Char_cv($adminname), "adminpwd" => Char_cv($adminpwd), "adminmid" => $adminmid, "adminpurview" => $adminpurview);
        $info = $Table->edit($adminid, $arrayadd);
        if ($info == "OK") {
            exit("<script language='javascript'>alert('编辑成功');parent.\$.fn.colorbox.close();</script>");
        } else {
            exit("<script language='javascript'>alert('编辑失败');history.go(-1);</script>");
        }
    } else {
        $evalue = $Table->getone($adminid);
        //print_r($evalue);
        include "tpl/admin_add.htm";
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
//获取选择文章分类下拉框
function getatypeselect($var = "", $value = "", $other = "")
{
    $Table = new TableClass("atype", "typeid");
    $arraydata = $Table->getdata('', '', 'typeid asc');
    foreach ($arraydata as $val) {
        $arrayoption[$val['typeid']] = $val['typename'];
    }
Esempio n. 12
0
        include "tpl/ipfilter_edit.htm";
    }
} elseif ($action == "edit" && !empty($ipid)) {
    InitGP(array("ipid", "ip", "uname", "addtime", "remark"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($uname) and !empty($ipid)) {
        $ipid = GetNum($ipid);
        if (empty($ipid)) {
            showmsg("缺少ID参数!", "-1");
        }
        //出错!
        if (empty($uname)) {
            showmsg("用户名不能为空!", "-1");
        }
        //出错!
        $arrayadd = array("ip" => Char_cv($ip), "uname" => Char_cv($uname), "remark" => GetNum($remark));
        $info = $Table->edit($ipid, $arrayadd);
        if ($info == "OK") {
            exit("<script language='javascript'>alert('编辑成功');parent.\$.fn.colorbox.close();</script>");
        } else {
            exit("<script language='javascript'>alert('编辑失败');history.go(-1);</script>");
        }
    } else {
        $evalue = $Table->getone($ipid);
        //print_r($evalue);
        include "tpl/ipfilter_edit.htm";
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
Esempio n. 13
0
    //$wherestr[]="flag<>'c'";
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    //获取当前页码
    $total = $newsobj->getcount($wheresql);
    //总信息数
    if ($total > 1000) {
        $total = 1000;
    }
    //显示最大一千条
    $pagesize = 15;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $newsobj->getdata("{$offset},{$pagesize}", $wheresql);
    //获取数据
    //获取头条和推荐
    include template('news');
    //包含输出指定模板
} elseif ($action == "view") {
    $nid = GetNum($nid);
    $value = $newsobj->getone($nid);
    include template('news_view');
    //包含输出指定模板
} else {
    exit(lang('Missing_parameter'));
}
Esempio n. 14
0
//弹出一键填单相关ajax数据处理
include "../common.inc.php";
InitGP(array("action", "url", "refuname", "referer", "aid", "cityid"));
//初始化变量全局返回
$deliveryobj = new TableClass('delivery', 'did');
AjaxHead();
if ($action == 'getdetails') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    $countweight = GetNum($jsondata->TotleWeight);
    $productcost = GetNum($jsondata->TotleProductCost);
    $areaid = GetNum($jsondata->Area);
    $returntemp = array();
    //获取地区信息
    $areaobj = new TableClass('area', 'aid');
    $arearow = $areaobj->getone($areaid);
    $deliveryarray = $deliveryobj->getdata('', "areaid=" . $areaid);
    //$serverfee=$arearow['serverfeepct']*$productcost > $arearow['serverfee']?$arearow['serverfee']:$arearow['serverfeepct']*$productcost;
    if (is_array($deliveryarray)) {
        foreach ($deliveryarray as $key => $val) {
            //循环处理数据
            $returntemp[$key] = $val;
            //$returntemp[$key]['serverfee']=$serverfee;
            //计算运费
            if ($countweight <= $val['first_weight']) {
                $freight = $val['first_fee'];
            } elseif ($countweight > $val['first_weight']) {
                $freight = $val['first_fee'] + ceil(($countweight - $val['first_weight']) / $val['continue_weight']) * $val['continue_fee'];
            }
            $returntemp[$key]['sendfee'] = $freight;
            $returntemp[$key]['serverfee'] = $arearow['serverfeepct'] * ($productcost + $freight) > $arearow['serverfee'] ? $arearow['serverfee'] : $arearow['serverfeepct'] * ($productcost + $freight);
Esempio n. 15
0
    $total = $discountobj->getcount($wheresql);
    //总信息数
    if ($total > 1000) {
        $total = 1000;
    }
    //显示最大一千条
    $pagesize = 12;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $discountobj->getdata("{$offset},{$pagesize}", $wheresql, "", 'did,title,flag,about,pic,discounttime,discounturl,listorder,addtime');
    //获取数据
    //获取头条和推荐
    $topharray = $discountobj->getdata(1, "flag='h'", 'listorder asc,did desc', 'did,title,flag,about,pic,listorder,addtime');
    $topcarray = $discountobj->getdata(6, "flag='c'", 'listorder asc,did desc', 'did,title,flag,about,pic,discounttime,listorder,addtime');
    include template('discount');
    //包含输出指定模板
} elseif ($action == "view") {
    $did = GetNum($did);
    $value = $discountobj->getone($did);
    $topcarray = $discountobj->getdata(10, "flag='c'", 'listorder asc,did desc', 'did,title,flag,about,pic,discounttime,listorder,addtime');
    //读取编辑推荐
    $goodsobj = new TableClass('goods', 'gid');
    $rightarray = $goodsobj->getdata(5, "flag='c'", 'listorder asc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
    include template('discount_view');
    //包含输出指定模板
} else {
    exit(lang('Missing_parameter'));
}