Example #1
0
 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);
 }
Example #2
0
 function ordertosend($oids, $uname = "")
 {
     $wherestro[] = "oid in(" . $oids . ")";
     if (!empty($uname)) {
         $wherestro[] = "uname='" . $_USERS['uname'] . "'";
     }
     if (!empty($wherestro)) {
         $wheresqlo = implode(' AND ', $wherestro);
     }
     //条件汇总
     editstate($this->table_order->table, "state", $wheresqlo, 5);
     //更改状态操作
 }
Example #3
0
         //商品价格调整
         $tempmoney = 0;
         $tempmoney = GetNum($oldgoodsprice - $goodsprice);
         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);
         //扣去账户余额
     }
     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 {
Example #4
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);
}
Example #5
0
    case "new":
        $state = 0;
        $wherestr[] = "money_state='{$state}'";
        break;
    case "payed":
        $wherestr[] = "money_state in(1,2)";
        break;
    case "all":
        break;
    default:
        $state = 0;
}
include INC_PATH . "/order.class.php";
$o = new OrderClass();
if ($type == "clear" && !empty($oid)) {
    editstate("order", "state", "oid={$oid}", 2);
    //修改订单状态为取消  1完成 2作废 3退款给用户
    showmessage(lang('Cancelorder_success'), $theurl, true);
}
$uname = $_USERS['uname'];
$wherestr[] = "uname='{$uname}'";
if (!empty($wherestr)) {
    $wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $o->getcount($wheresql);
//总信息数
$pagesize = 15;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
Example #6
0
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, '', 'oid,goodsimg,orderimg');
    //获取团购数据
    $msg = "总共需要抓取图片:{$total}个<br/>";
    if (!empty($dataarray)) {
        //抓取图片操作
        foreach ($dataarray as $val) {
            //远程图本地化
            if (!empty($val['goodsimg'])) {
                $tempimg = GetRemoteImage($val['goodsimg']);
                $thumbname = "../" . $tempimg['savepath'] . "_thumb_" . $tempimg['filename'];
                makeThumb("../" . $tempimg['filepath'], $thumbname);
                editstate($Table->table, "orderimg", "oid=" . $val['oid'], $tempimg['filepath']);
                //更改图片地址操作
                $msg .= "更新订单ID:{$val['oid']} 图片地址成功<br/>";
            }
        }
        $url = geturl();
        $goto = url::replace($url, "page=" . ($page + 1), 0, 1);
        showmsg($msg, $goto);
    } else {
        showmsg("抓取完成!", "goodsimg_get.php");
    }
} else {
    //包含后台模板文件
    include "tpl/goodsimg_get.htm";
}
//创建缩微图函数
 function del($id)
 {
     global $_USERS;
     $row = $this->getone($id, "isadmin,fromuid,fromuname,touid,touname,type");
     if (is_array($row)) {
         if ($row['type'] != 1) {
             return lang('message_type_error');
         }
         if ($_USERS['uname'] != $row['touname']) {
             return lang('Permissions_not');
         }
         if ($row['isadmin'] == 1) {
             $wheresqlarr = "mid=" . $id;
             editstate($this->table_pm->table, "writetime", $wheresqlarr, '0');
             //更改状态操作
         } else {
             return $this->table_pm->del($id);
         }
     } else {
         return lang('sendOrderID_notexist');
     }
 }
Example #8
0
 function del($id)
 {
     global $_USERS;
     $row = $this->getone($id, "isadmin,fromuid,fromuname,touid,touname,type");
     if (is_array($row)) {
         if ($row['type'] != 1) {
             return "短信类型错误";
         }
         if ($_USERS['uname'] != $row['touname']) {
             return "权限不足";
         }
         if ($row['isadmin'] == 1) {
             $wheresqlarr = "mid=" . $id;
             editstate($this->table_msg->table, "writetime", $wheresqlarr, '0');
             //更改状态操作
         } else {
             return $this->table_msg->del($id);
         }
     } else {
         return "指定运单ID不存在";
     }
 }
Example #9
0
        if (!empty($ERROR_MSG)) {
            print "<script language='javascript'>alert('" . $ERROR_MSG . "');history.go(-1);</script>";
            exit;
        }
    } else {
        //显示注册表单
        include template('register');
        //包含输出指定模板
    }
} elseif ($action == 'active') {
    //账户激活操作
    InitGP(array("code"));
    //初始化变量全局返回
    @(list($uname, $activekey) = explode("\t", cookie_authcode($code, 'DECODE')));
    if (!empty($uname) && !empty($activekey)) {
        editstate("users", "state", "uname='" . $uname . "'", 1);
        //修改状态
        include template('register_active_ok');
        //包含输出指定模板
    } else {
        include template('register_active_error');
        //包含输出指定模板
    }
} elseif ($action == 'useractive') {
    //提示激活帐号
    include template('useractive');
    //包含输出指定模板
} elseif ($action == 'resetp') {
    //重置密码
    InitGP(array("username", "email", "forgotCode", "commit"));
    //初始化变量全局返回
Example #10
0
    if (empty($username) || empty($password)) {
        showmsg("用户名或者密码为空", "-1");
        exit;
    }
    $row = $db->fetch_first("Select * From {$tablepre}admin where adminname like '{$username}' ");
    if (is_array($row)) {
        if (md5($password) != $row['adminpwd']) {
            $log_file = ROOT_PATH . '/data/adminlogin_safe.txt';
            if (function_exists('real_ip')) {
                $userIP = real_ip();
            } else {
                $userIP = "";
            }
            $getUrl = geturl();
            fputs(fopen($log_file, 'a+'), date('Y-m-d H:i:s') . "||{$userIP}||{$getUrl}||{$username}||{$password}||登陆失败\r\n");
            showmsg("用户名或者密码错误", "-1");
            exit;
        } else {
            $adminauth = $row['adminid'] . "\t" . $username . "\t" . $row['adminpwd'];
            set_cookie('adminauth', cookie_authcode($adminauth, 'ENCODE'), time() + 3600 * 12);
            //设置12个小时cookie有效期
            addfield("admin", "logincount", "adminname='{$username}'", 1);
            //更新登录次数
            editstate("admin", "lastlogin", "adminname='{$username}'", $timestamp);
            //更最后登录时间
            showmsg("登录成功!", "index.php");
        }
    } else {
        showmsg("用户名不存在", "-1");
    }
}
    $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);
}
Example #12
0
        } 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");
    //出错!
}
Example #13
0
            } else {
                $tempscore = $sendorders['totalfee'];
            }
            include_once INC_PATH . "/member.class.php";
            $m = new memberclass();
            $tempscore = $sendorders['totalfee'];
            $note = lang('sendorder_success_point') . $tempscore . lang('sendorderID') . $tempid;
            $m->scoreedit($sendorders['uname'], $tempscore, $note);
        }
        exit(json_encode('OK'));
    } else {
        exit(json_encode(lang('update_failed')));
    }
} elseif ($action == 'upcomment') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    if (!empty($jsondata->comment) && !empty($jsondata->sid)) {
        $tempcomment = Char_cv($jsondata->comment);
        $tempsid = GetNum($jsondata->sid);
        $wheresqlarr = "uname='" . $_USERS['uname'] . "' and sid=" . $tempsid;
        editstate($o->table_sendorder->table, "comment", $wheresqlarr, $tempcomment);
        //更改状态操作
        editstate($o->table_sendorder->table, "commenttime", $wheresqlarr, time());
        //更改状态操作
        exit(json_encode('OK'));
    } else {
        exit(json_encode(lang('update_failed')));
    }
}
//print_r($dataarray);
include template('member_sendorderlist');
//包含输出指定模板
Example #14
0
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    $dataarray = $o->getdata("", $wheresql, "");
    //获取团购数据
    include template('member_orderlist5');
    //包含输出指定模板
} elseif ($action == 'del') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    if ($o->del($jsondata->oid) == "OK") {
        exit(json_encode('OK'));
    } else {
        exit(json_encode(lang('delete_failed')));
    }
} elseif ($action == 'upremark') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    if (!empty($jsondata->remark) && !empty($jsondata->oid)) {
        $tempremark = Char_cv($jsondata->remark);
        $tempoid = GetNum($jsondata->oid);
        $wheresqlarr = "uname='" . $_USERS['uname'] . "' and oid=" . $tempoid;
        editstate($o->table_order->table, "goodsremark", $wheresqlarr, $tempremark);
        //更改状态操作
        exit(json_encode('OK'));
    } else {
        exit(json_encode(lang('update_failed')));
    }
}
//print_r($dataarray);
//print_r($dataarray3);
//print_r($dataarray4);
Example #15
0
} elseif ($action == "updatestate" && !empty($ids)) {
    //更改状态
    $state = GetNum($state);
    $ids = getdotstring(explode('|', $ids));
    $wheresqlarr = "aid in({$ids})";
    editstate($Table->table, "state", $wheresqlarr, $state);
    //更改状态操作
    exit("1");
} elseif ($action == "updatedef" && !empty($ids)) {
    //更改状态
    $state = GetNum($state);
    $ids = getdotstring(explode('|', $ids));
    $wheresqlarr = "aid in({$ids})";
    editstate($Table->table, "def", "1", 0);
    //更改状态操作
    editstate($Table->table, "def", $wheresqlarr, 1);
    //更改状态操作
    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;
Example #16
0
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, $orderstr);
    //获取团购数据
    //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;
Example #17
0
            editstate('users', "utype", "uname='" . $_USERS['uname'] . "'", 2);
            //更改会员等级操作
            editstate('users', "validity", "uname='" . $_USERS['uname'] . "'", time() + 3600 * 24 * $cfg_vip_validity);
            //更改会员有效期操作
            print "<script language='javascript'>alert('升级白金卡会员成功!');</script>";
            jumpurl(url('m.php'));
        } else {
            print "<script language='javascript'>alert('积分不足!升级白金卡会员需要积分{$cfg_vip_score2}');history.go(-1);</script>";
            exit;
        }
    } elseif ($_USERS['utype'] == 2) {
        if ($_USERS['scores'] >= $cfg_vip_score3) {
            $note = "钻石卡会员升级";
            $m->scoreedit($_USERS['uname'], -$cfg_vip_score3, $note);
            editstate('users', "utype", "uname='" . $_USERS['uname'] . "'", 3);
            //更改会员等级操作
            editstate('users', "validity", "uname='" . $_USERS['uname'] . "'", time() + 3600 * 24 * $cfg_vip_validity);
            //更改会员有效期操作
            print "<script language='javascript'>alert('升级钻石卡会员成功!');</script>";
            jumpurl(url('m.php'));
        } else {
            print "<script language='javascript'>alert('积分不足!升级钻石卡会员需要积分{$cfg_vip_score3}');history.go(-1);</script>";
            exit;
        }
    } elseif ($_USERS['utype'] == 3) {
        print "<script language='javascript'>alert('您已经是最高级会员,无需升级!');history.go(-1);</script>";
        exit;
    }
}
include template('member_index');
//包含输出指定模板