⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index2.php

📁 实时统计出pc蛋蛋的幸运28开奖数据
💻 PHP
字号:
<?php
/////////////////////////////////////////
//	参数请自行修改
//	作者graylocus
//	QQ17338701
//	网站www.qf123.com
//	演示地址www.168zhuanqian.com/pceggs/
/////////////////////////////////////////

error_reporting(E_ALL || ~E_NOTICE);
require_once( "include/collectclass.php" );
require_once("include/config.php");
require_once("include/db_mysql.php");
require_once("include/function.php");
ob_start('ob_gzip');

foreach($_POST as $_key=>$_value){
	!ereg("^\_",$_key) && $$_key=$_POST[$_key];
}
foreach($_GET as $_key=>$_value){
	!ereg("^\_",$_key) && $$_key=$_GET[$_key];
}
if(!empty($date))
{
	list($nian,$yue,$ri)=explode("-",$date);
	if(checkdate($yue,$ri,$nian))
	{
		$date=$nian.'-'.$yue.'-'.$ri.' 09:00:00';
		$ri++;
		$date2=date('Y-m-d', mktime(0,0,0,$yue,$ri,$nian) );
		$date2.=" 01:00:00";
	}
	else{
		
		$date=date('Y-m-d',time());
		$nian="2008";
		$yue=substr($date,5,2);
		$ri=substr($date,-2)+1;
		$date2=date('Y-m-d', mktime(0,0,0,$yue,$ri,$nian) );
		$date.=" 09:00:00";
		$date2.=" 01:00:00";
	}
}
else{
	//$date='2008-08-24';
	$date=date('Y-m-d',time());
	$nian="2008";
	$yue=substr($date,5,2);
	$ri=substr($date,-2)+1;
	$tm=substr(date('H:i:s',time()),0,2);
	if($tm=='00' or $tm=='01'){
		$date=date('Y-m-d',(time()-86400));
	}
	$date2=date('Y-m-d', mktime(0,0,0,$yue,$ri,$nian) );
	$date.=" 09:00:00";
	$date2.=" 01:00:00";
}
list($tnian,$tyue,$tri)=explode("-",date('Y-m-d'));
//list($tnian,$tyue,$tri)=explode("-",'2008-08-24');

$ri--;
$ad=adate(date('Y-m-d'));
//$ad=adate('2008-08-24');

$con = new DB($cfg_dbhost, $cfg_dbuser, $cfg_dbpw, $cfg_dbname);
if($tri==$ri)
{
	//判断是否需要对数据进行采集,以免频繁读取蛋蛋将ip封掉
	include_once("include/tt.php");
	if ($ttime<time())
	{
		$timeid=GetTimeID(GetTimePage());
		$timeid['time']+=time();
		$ttfile='<?php $ttime='.$timeid['time'].'; $tid='.$timeid['id'].'; ?>';
		$fp=fopen("include/tt.php",'w') or die("文件不存在或者服务器禁止创建文件");
		fwrite($fp,$ttfile);
		fclose($fp);
		$collect = &new c_post;
		$content = $collect->read( "www.pceggs.com","80","/play/Pg28history.aspx","1" );
		$startpos = strpos( $content, '<tr align="center" bgcolor="#FFFFFF">' );
		$endpos = strrpos( $content, '<tr align="center" bgcolor="#FFFFFF">' );
		$content = substr($content,$startpos,($endpos-$startpos));
		$pc = new pc($content);
		$pc->finditem();
		$pc->item_add($con);
		unset($collect);
		unset($pc);
	}
}

$sqls="select * from `pceggs` where `time` between '$date' and '$date2' order by `issue`;";
$query = $con->query($sqls);
$dd = array();
$he = array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$he2 = array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$ds = array(1=>0,0);	//存放单双次数
$zb = array(1=>0,0);	//存放中边次数
$dx = array(1=>0,0);	//存放大小次数
$shu = array(0,0,0,0,0,0,0,0,0,0);	//存放多少期没有开尾数
$shu2 = array(0,0,0,0,0,0,0,0,0,0);	//存放位数开的次数

/***************************************************
*	统计除3,除4,除5,除6,除7已开的次数和未开的次数
*	array  $c3,$c4,$c5,$c6,$c7
*   ek表示已开,wk表示未开
****************************************************/
$c3= array('ek'=>array(0,0,0),'wk'=>array(0,0,0));
$c4= array('ek'=>array(0,0,0,0),'wk'=>array(0,0,0,0));
$c5= array('ek'=>array(0,0,0,0,0),'wk'=>array(0,0,0,0,0));
//$c6= array('ek'=>array(0,0,0,0,0,0),'wk'=>array(0,0,0,0,0,0));
//$c7= array('ek'=>array(0,0,0,0,0,0,0),'wk'=>array(0,0,0,0,0,0,0));

while ($records=$con->fetch_array($query))
{
	$records['time']=substr($records['time'],-8,-3);
	$records['he']=$records['num1']+$records['num2']+$records['num3'];
	
	/***************************************************
	*	统计除3,除4,除5,除6,除7已开的次数和未开的次数
	*	array  $c3,$c4,$c5,$c6,$c7
	****************************************************/
	$ct3=$records['he']%3;
	$ct4=$records['he']%4;
	$ct5=$records['he']%5;
	//$ct6=$records['he']%6;
	//$ct7=$records['he']%7;
	for($i=0;$i<3;$i++)
	{
		$c3['wk'][$i]++;
	}
	for($i=0;$i<4;$i++)
	{
		$c4['wk'][$i]++;
	}
	for($i=0;$i<5;$i++)
	{
		$c5['wk'][$i]++;
	}
	/*for($i=0;$i<6;$i++)
	{
		$c6['wk'][$i]++;
	}
	for($i=0;$i<7;$i++)
	{
		$c7['wk'][$i]++;
	}*/
	$c3['wk'][$ct3]=0;
	$c4['wk'][$ct4]=0;
	$c5['wk'][$ct5]=0;
	//$c6['wk'][$ct6]=0;
	//$c7['wk'][$ct7]=0;

	$c3['ek'][$ct3]++;
	$c4['ek'][$ct4]++;
	$c5['ek'][$ct5]++;
	//$c6['ek'][$ct6]++;
	//$c7['ek'][$ct7]++;
	/************************************/

	$weishu=substr($records['he'],-1);
	//统计尾数
	for($i=0;$i<10;$i++)
	{
		$shu[$i]++;
	}
	$shu[$weishu]=0;
	$shu2[$weishu]++;

	//统计没有开的和
	for($i=0;$i<28;$i++)
	{
		$he2[$i]++;
	}
	$he2[$records['he']]=0;
	$he[$records['he']]++;

	//单双
    if(!($records['he']&1))
		$ds[2]++;
	else
		$ds[1]++;
	
	//中边
	if($records['he']>9 and $records['he']<18 )
		$zb[1]++;
	else
		$zb[2]++;

	//大小
	if($records['he']>13)
		$dx[2]++;
	else
		$dx[1]++;

	$dd[]=$records;
}
unset($con);
$count=count($dd);
$titledate=substr($date,0,10);
include("template2/head.php");
include("template2/body.php");
include("foot.php");
unset($he,$ds,$shu,$dd,$c3,$c4,$c5);
ob_end_flush();
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -