<?php
include_once "test-conn.php";


$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$result = mysql_query("SELECT * FROM {$tableqz}qqs where qid='{$qid}' and isdldqd>0 and sidzt=0 limit 1");
if($row=mysql_fetch_array($result)){
	$uin=$row['qq'];
	$now=date("Y-m-d-H:i:s");
	$next=date("Y-m-d H:i:s",time()+60*60*8-10);
	@mysql_query("update {$tableqz}qqs set lastdldqd='$now',nextdldqd='$next' where qid='$qid'");
	include_once "qzone.class.php";
	$result = mysql_query("SELECT sid FROM {$tableqz}qqs where sidzt=0 order by rand() limit 2");
	while($qq=mysql_fetch_array($result)){
	$uin=$row['qq'];
	$sid=$row['sid'];
	$skey=$row['skey'];
	$p_skey=$row['p_skey'];
	$p_skey2=$row['p_skey2'];
$qzone=new qzone($uin,$sid,$skey,$p_skey,$p_skey2);
		$qzone->dldqd();
		$row=$qq;
		include_once "mail.php";
		print_r($qzone->msg);
	}
}else{
	exit('请开启大乐斗签到功能');
}

