Example #1
0
$session = $_SESSION['topsession'];
$appKey = $_SESSION['appKey'];
$appSecret = $_SESSION['appSecret'];
if ($nick == '') {
    header("Location: Login.php");
}
$errormess = '';
if ($_REQUEST['banyue'] != '') {
    //获取淘宝订单总数
    $resultcount = getTaobaoOrderCount($rooturl, $session, $appKey, $appSecret, $start_created, $end_created);
    $page_size = 40;
    $page_no = intval($resultcount / $page_size) + 1;
    $taobaoorders_page = array();
    $taobaoorders = array();
    $timer->stop();
    $timemessage .= "计算订单个数的时间为 " . $timer->spent() . "\r\n";
    $timer->start();
    //获取淘宝订单信息
    $taobaoorders_page = getTaobaoOrderInfo($rooturl, $session, $appKey, $appSecret, $page_no, $page_size, $start_created, $end_created);
    //总数 > 40 处理数组 array[0][0] to array[0]
    if ($resultcount > 1) {
        foreach ($taobaoorders_page as $pageorders) {
            if (!empty($pageorders)) {
                foreach ($pageorders as $pageorder) {
                    $taobaoorders[] = $pageorder;
                }
            } else {
                $errormess .= "获取淘宝订单信息失败。\r\n";
            }
        }
    } else {
 function doMonitor($id)
 {
     $time = new timer();
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $this->args['url']);
     curl_setopt($ch, CURLOPT_HEADER, 1);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     //post
     if ($this->args['type'] == 'POST' && $this->args['data'] != NULL) {
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $this->args['data']);
     }
     //cookie
     if (isset($this->args['cookie']) && $this->args['cookie'] != NULL) {
         curl_setopt($ch, CURLOPT_COOKIE, $this->args['cookie']);
     }
     $time->start();
     $res_content = curl_exec($ch);
     $time->stop();
     //$curl_close($ch);
     global $db;
     $max_time = $time->spent();
     $sql = "select * from history_record where data_id = {$id} order by time desc limit 1";
     $result = mysql_query($sql, $db);
     if ($result) {
         $row = mysql_fetch_array($result);
         if ($row != NULL && $max_time < $row['max_time']) {
             $max_time = $row['max_time'];
         } else {
             $update_sql = "update history_record set max_time='" . $max_time . "' where id=" . $row['id'];
             mysql_query($update_sql, $db);
         }
     }
     echo "最大响应时间:" . $max_time . "秒<br>";
     echo "当前响应时间:" . $time->spent() . "秒";
     echo "<br>返回内容<br>";
     #echo "<xmp>".$res_content."</xmp>";
     echo "<br>" . $res_content . "<br>";
 }
Example #3
0
$end_created = '';
$id = $_REQUEST['record'];
if (empty($id)) {
    die("No Selected One AppKey!");
}
$query = "select * from ec_appkey where id='" . $id . "'";
$row = $adb->getFirstLine($query);
$appKey = $row['appkey'];
$appSecret = $row['appsecret'];
$nick = $row['nick'];
$session = $row['topsession'];
if ($nick == '') {
    header("Location: index.php?module=Relsettings&action=Taobaozushou&parenttab=Settings");
}
$timer->stop();
$timemessage .= "获取淘宝账号信息用时: <font color=red>" . $timer->spent() . "</font><br>";
$timer->start();
//获取淘宝订单总数
$resultcount_arr = getTaobaoOrderCount($rooturl, $session, $appKey, $appSecret, $start_created, $end_created);
if (!empty($resultcount_arr['msg'])) {
    echo $resultcount_arr['msg'];
    die;
}
$resultcount = $resultcount_arr['total_results'];
$timer->stop();
$timemessage .= "获取淘宝订单总数用时: <font color=red>" . $timer->spent() . "</font><br>";
$timer->start();
if ($resultcount == 0) {
    echo $timemessage;
    if (!empty($syntime)) {
        $start_created = $syntime;