Пример #1
0
    //条件汇总
    $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");
    //出错!
}
Пример #2
0
    //获取团购数据
    //print_r($dataarray);
    //包含后台模板文件
    include "tpl/admin_list.htm";
} elseif ($action == "updatestate" && !empty($ids)) {
    //更改状态
    $state = GetNum($state);
    $ids = getdotstring(explode('|', $ids));
    $wheresqlarr = "adminid in({$ids})";
    editstate($Table->table, "state", $wheresqlarr, $state);
    //更改状态操作
    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)) {
Пример #3
0
    $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);
}
Пример #4
0
        $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;
    }
    //空选择
    //执行删除多个操作
    foreach ($delids as $id) {
        $id = GetNum($id);
        $info = $mange->del($id);
Пример #5
0
    //偏移量
    $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')));
    }
}
include template('member_favorite');
//包含输出指定模板
Пример #6
0
     $uid = GetNum($uid);
     if ($uid == 0) {
         showmsg("用户名不存在!", "-1");
     }
     //出错!
     $arrayadd = array("uid" => $uid, "uname" => Char_cv($uname), "sn" => GetNum($sn), "money" => GetNum($money), "paytype" => GetNum($paytype), "payname" => Char_cv($payname), "remark" => Char_cv($remark), "addtime" => $timestamp, "successtime" => $timestamp, "state" => 2);
     $info = $Table->add($arrayadd);
     if (GetNum($info)) {
         include_once INC_PATH . "/member.class.php";
         $m = new memberclass();
         if ($m->moneyedit($uname, $money, "后台转账充值")) {
             showmsg("充值成功!", PHP_SELF);
             //出错!
             exit("<script language='javascript'>alert('编辑成功');parent.parent.\$.fn.colorbox.close();</script>");
         } else {
             $Table->del($info);
             showmsg("充值失败!", "-1");
             //出错!
         }
     } else {
         showmsg("充值失败!", "-1");
         //出错!
         exit("<script language='javascript'>alert('编辑失败');parent.location.reload();</script>");
     }
 } else {
     $evalue = $Table->getone($uid);
     //充值编号
     $autokeys = randomkeys(3, "123");
     //随机5位数字
     $timestr = date('YmdHis');
     $sn = $timestr . $autokeys;
Пример #7
0
        $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") {
        showmsg("删除成功!", "smtp_list.php");
    } else {
        showmsg($info, "smtp_list.php");
    }
} elseif ($action == "dels") {
    if (empty($delids)) {
        showmsg("没有选择任何对象!", PHP_SELF);
        exit;
    }
    //空选择
    //执行删除多个操作
    $delids = explode('|', $delids);
    foreach ($delids as $id) {
        if (GetNum($id)) {