<?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 iszf>0 and sidzt=0 limit 1");
if($row=mysql_fetch_array($result)){

	$uin=$row['qq'];
	$sid=$row['sid'];
	$skey=$row['skey'];
	$do=$row['iszf'];

	$now=date("Y-m-d-H:i:s");
	$next=date("Y-m-d H:i:s",time()+60*$row['zfrate']-10);
	@mysql_query("update {$tableqz}qqs set lastzf='$now',nextzf='$next' where qid='$qid'");

	$con=urlencode(get_con($row['zfcon']));
	$ok=$row['zfok'];

	include_once "qzone.class.php";
	$qzone=new qzone($uin,$sid,$skey);
	if($do==2){
		$qzone->zhuanfa('pc',$ok,$con);
	}else{
		$qzone->zhuanfa(0,$ok,$con);
	}
	include_once "mail.php";
	exit('Ok!');
}else{
	exit('Qid Error!');
}
