<?php
include_once "conn.php";
include_once "qzone.class.php";
$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$result = mysql_query("SELECT * FROM {$tableqz}qqs where qid='{$qid}' and (isvipqd>0 or islq>0) and sidzt=0 limit 1");
if($row=mysql_fetch_array($result)){
	$uin=$row['qq'];
	$sid=$row['sid'];
	$skey=$row['skey'];
	$p_skey=$row['p_skey'];
	$p_skey2=$row['p_skey2'];
	$next=date("Y-m-d H:i:s",time()+60*60*8-10);
	$now=date("Y-m-d-H:i:s");
	$qzone=new qzone($uin,$sid,$skey,$p_skey,$p_skey2);
	$sql='';
	if($row['isvipqd']) {
		$sql.="lastvipqd='$now',";
		$qzone->vipqd();
	}
	if($row['islz']) {
		$sql.="lastlz='$now',";
		$qzone->lzqd();
	}
	if($row['isqb']) {
		$sql.="lastqb='$now',";
		$qzone->pqd();
	}
	@mysql_query("update {$tableqz}qqs set {$sql}nextvipqd='$next' where qid='$qid'");
	exit('Ok!');
}else{
	exit('Qid Error!');
}
