<?php  include('../inc/conn.php');?>
<?php
set_time_limit(0);

$sql="select * from website where jsqid<>0";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){
	$jsqid=$row['jsqid'];
	$usernameid=$row['usernameid'];
	$website=$row['website'];
	$url1="http://jsq.etwun.com:8080/visite_data.php?userid=".$jsqid;
	$content=file_get_contents($url1);
	$content=preg_replace('/<style[^>]+>(.+?)<\/style>/is','',$content); 
	$content=preg_replace('/\n/is','',$content); 
	$content=preg_replace('/\r/is','',$content); 
	
	$url3="http://jsq.etwun.com:8080/get_all_ip.php?id=".$jsqid;
	$content3=file_get_contents($url3);
	preg_match("/<div id='souce1' style='display:none;'>(.*?)<\/div>/",$content3,$temp);
	preg_match("/<div id='souce2' style='display:none;'>(.*?)<\/div>/",$content3,$temp2);

	$sql="update website set attime='".$content."', counts=".$temp2[1].",p_num=".$temp[1].",uptime='".date("Y-m-d")."' where jsqid=$jsqid";
	echo $sql."<br>";	
	mysql_query($sql);
}
//$url3="http://jsq.etwun.com:8080/get_all_ip.php?id=7";
//	$content3=file_get_contents($url3);
//	echo $content3;
//	preg_match("/<div id='souce1' style='display:none;'>(.*?)<\/div>/",$content3,$temp);
//	echo $temp[1];
//print_r($temp);
?>