<?php
include_once "conn.php";

$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$result = mysql_query("SELECT * FROM {$tableqz}qqs where qid='{$qid}' and is3gqq>0 and sidzt=0 limit 1");
if($row=mysql_fetch_array($result)){
	$uin=$row['qq'];
	$sid=$row['sid'];
	$now=date("Y-m-d-H:i:s");
	
	$next=date("Y-m-d H:i:s",time()+60*5-10);
	@mysql_query("update {$tableqz}qqs set last3gqq='$now',next3gqq='$next' where qid='$qid'");

	@curl_get('http://pt.3g.qq.com/s?aid=nLogin3gqqbysid&3gqqsid='.$sid.'');
	@curl_get('http://q32.3g.qq.com/g/s?sid='.$sid.'&s=10&aid=chgStatus');

	exit('Ok!');
}else{
	exit('Qid Error!');
}
