config.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:17k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- include("../inc/conn.php");
- $_SESSION["menus"]="开封盘";
- if(isset($_GET["ap"]))
- {
- $ap=$_GET["ap"];
- if($ap=="open") mysql_query("update ptime set hand='0' where sign='4'",$conn);
- if($ap=="close") mysql_query("update ptime set hand='1' where sign='4'",$conn);
- }
- if(isset($_GET["nows"]))
- {
- $as=$_GET["nows"];
- if($as=="open") mysql_query("update ptime set now_bill='0' where sign='4'",$conn);
- if($as=="close") mysql_query("update ptime set now_bill='1' where sign='4'",$conn);
- }
- $sqlf=mysql_query("select * from ptime where sign='4'",$conn);
- $handf=mysql_result($sqlf,0,"hand");
- $now_billf=mysql_result($sqlf,0,"now_bill");
- $sqld=mysql_query("select * from results order by dates desc",$conn);
- $rowr=mysql_fetch_array($sqld);
- $dates=$rowr["dates"];
- $sql=mysql_query("select * from ptime where sign<>'4' order by dates asc",$conn);
- include("../inc/char.inc.php");
- if(isset($_GET["op"]))
- {
- $op=$_GET["op"];
- $auto=@$_GET["auto"];
- if($op=="open")
- {
- mysql_query("update ptime set opstate='0',tnum='0',other='0',hand='0' where sign='4'",$conn);
- }elseif($op=="other_close")
- {
- mysql_query("update ptime set other='1' where sign='4'",$conn);
- }elseif($op=="other_open")
- {
- mysql_query("update ptime set other='0' where sign='4'",$conn);
- }elseif($op=="all")
- {
- if(isset($auto)) mysql_query("update ptime set now_state='1' where dates='$dates'",$conn);
- mysql_query("update ptime set opstate='1',tnum='1',other='1',hand='1' where sign='4'",$conn);
- }
- }
- $sqlcs=mysql_query("select * from ptime where sign='4'",$conn);
- $all_close=mysql_result($sqlcs,0,"opstate");
- $tnum_close=mysql_result($sqlcs,0,"tnum");
- $other_close=mysql_result($sqlcs,0,"other");
- $now_state=mysql_result($sqlcs,0,"now_state");
- if(isset($_GET["act"]))
- {
- $id=$_POST["id"];
- $pdate=$_POST["pdate"];
- if(strlen($pdate)==1)
- {
- $pb="00".$pdate;
- }elseif(strlen($pdate)==2)
- {
- $pb="0".$pdate;
- }else $pb=$pdate;
- $signs=$_POST["signs"];
- $open_year=$_POST["open_year"];
- $open_month=$_POST["open_month"];
- $open_date=$_POST["open_date"];
- $open_hour=$_POST["open_hour"];
- $open_minute=$_POST["open_minute"];
- $open_second=$_POST["open_second"];
- if(strlen($open_month)==1) $open_month="0".$open_month;
- if(strlen($open_date)==1) $open_date="0".$open_date;
- if(strlen($open_hour)==1) $open_hour="0".$open_hour;
- if(strlen($open_minute)==1) $open_minute="0".$open_minute;
- if(strlen($open_second)==1) $open_second="0".$open_second;
- $open_time=$open_year.$open_month.$open_date.$open_hour.$open_minute.$open_second;
- $tnum_year=$_POST["tnum_year"];
- $tnum_month=$_POST["tnum_month"];
- $tnum_date=$_POST["tnum_date"];
- $tnum_hour=$_POST["tnum_hour"];
- $tnum_minute=$_POST["tnum_minute"];
- $tnum_second=$_POST["tnum_second"];
- if(strlen($tnum_month)==1) $tnum_month="0".$tnum_month;
- if(strlen($tnum_date)==1) $tnum_date="0".$tnum_date;
- if(strlen($tnum_hour)==1) $tnum_hour="0".$tnum_hour;
- if(strlen($tnum_minute)==1) $tnum_minute="0".$tnum_minute;
- if(strlen($tnum_second)==1) $tnum_second="0".$tnum_second;
- $tnum_time=$tnum_year.$tnum_month.$tnum_date.$tnum_hour.$tnum_minute.$tnum_second;
- $other_year=$_POST["other_year"];
- $other_month=$_POST["other_month"];
- $other_date=$_POST["other_date"];
- $other_hour=$_POST["other_hour"];
- $other_minute=$_POST["other_minute"];
- $other_second=$_POST["other_second"];
- if(strlen($other_month)==1) $other_month="0".$other_month;
- if(strlen($other_date)==1) $other_date="0".$other_date;
- if(strlen($other_hour)==1) $other_hour="0".$other_hour;
- if(strlen($other_minute)==1) $other_minute="0".$other_minute;
- if(strlen($other_second)==1) $other_second="0".$other_second;
- $other_time=$other_year.$other_month.$other_date.$other_hour.$other_minute.$other_second;
- $ok=mysql_query("update ptime set dates='$pb',open_time='$open_time',tnum_close_time='$tnum_time',other_close_time='$other_time' where ID='$id'",$conn);
- if($ok)
- { if($signs==1)
- {
- if(strlen($pdate)==1)
- { $pos=$pdate-1;
- $pbs="00".$pos;
- }elseif(strlen($pdate)==2)
- {
- $pos=$pdate-1;
- $pbs="0".$pos;
- }else $pbs=$pdate-1;
- mysql_query("update now_open set dates='$pbs' where ID='1'",$conn);
- mysql_query("update results set dates='$pb' where sign='1'",$conn);
- $sqpl=mysql_query("select * from ptime where now_sign<>'1' and sign<>'4' order by ID asc",$conn);
- while($rs=mysql_fetch_array($sqpl))
- { $pdate++;
- $id=$rs["ID"];
- if(strlen($pdate)==1)
- {
- $pb="00".$pdate;
- }elseif(strlen($pdate)==2)
- {
- $pb="0".$pdate;
- }else $pb=$pdate;
- mysql_query("update ptime set dates='$pb' where ID='$id'",$conn);
- }
- }
- echo "<script language='javascript'>window.location.href='config.php';</script>";
- }
- }
- ?>
- <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
- function time(vtime){
- var s='';
- var d=vtime!=null?new Date(vtime):new Date();
- with(d){
- s=fixNum(getHours())+':'+fixNum(getMinutes())+':'+fixNum(getSeconds())
- }
- return(s);
- }
- <?php $nowdate = date("Y")."/".date("m")."/".date("d")." ".date("H:i:s")?>
- function fixNum(num){
- return num<10?'0'+num:num;
- }
- var dd=new Date("<?=$nowdate?>");
- //创建一个数组,用于存放每个月的天数
- function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
- {
- this[0] = m0;
- this[1] = m1;
- this[2] = m2;
- this[3] = m3;
- this[4] = m4;
- this[5] = m5;
- this[6] = m6;
- this[7] = m7;
- this[8] = m8;
- this[9] = m9;
- this[10] = m10;
- this[11] = m11;
- }
- //实现月历
- function calendar() {
- var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
- var today = new Date();
- var thisDay;
- var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
- year = today.getYear() +1900;
- thisDay = today.getDate();
- if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;
- nDays = monthDays[today.getMonth()];
- firstDay = today;
- firstDay.setDate(1);
- testMe = firstDay.getDate();
- if (testMe == 2) firstDay.setDate(0);
- startDay = firstDay.getDay();
- document.write("<div id='rili' style='position:absolute;width:140px;left:10px;top:220px;'>")
- document.write("<TABLE width='217' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#0080FF'>")
- document.write("<TR><TD><table border='0' cellspacing='1' cellpadding='2' bgcolor='Silver'>");
- document.write("<TR><th colspan='7' bgcolor='#C8E3FF'>");
- var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
- var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
- var now = new Date();
- document.writeln("<FONT STYLE='font-size:9pt;Color:#330099'>" + "公元 " + now.getYear() + "年" + monthNames[now.getMonth()] + " " + now.getDate() + "日 " + dayNames[now.getDay()] + "</FONT>");
- document.writeln("</TH></TR><TR><TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>日</FONT></TH>");
- document.writeln("<th bgcolor='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>一</FONT></TH>");
- document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>二</FONT></TH>");
- document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>三</FONT></TH>");
- document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>四</FONT></TH>");
- document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>五</FONT></TH>");
- document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>六</FONT></TH>");
- document.writeln("</TR><TR>");
- column = 0;
- for (i=0; i<startDay; i++) {
- document.writeln("n<TD><FONT STYLE='font-size:9pt'> </FONT></TD>");
- column++;
- }
- for (i=1; i<=nDays; i++) {
- if (i == thisDay) {
- document.writeln("</TD><TD ALIGN='CENTER' BGCOLOR='#FF8040'><FONT STYLE='font-size:9pt;Color:#ffffff'><B>")
- }
- else {
- document.writeln("</TD><TD BGCOLOR='#FFFFFF' ALIGN='CENTER'><FONT STYLE='font-size:9pt;font-family:Arial;font-weight:bold;Color:#330066'>");
- }
- document.writeln(i);
- if (i == thisDay) document.writeln("</FONT></TD>")
- column++;
- if (column == 7) {
- document.writeln("<TR>");
- column = 0;
- }
- }
- document.writeln("<TR><TD COLSPAN='7' ALIGN='CENTER' VALIGN='TOP' BGCOLOR='#0080FF'>")
- document.writeln("<FORM NAME='clock' onSubmit='0'><FONT STYLE='font-size:9pt;Color:#ffffff'>")
- document.writeln("服务器时间:<INPUT TYPE='Text' NAME='face' ALIGN='TOP'size='18' ></FONT></FORM></TD></TR></TABLE>")
- document.writeln("</TD></TR></TABLE></div>");
- }
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript">
- var timerID = null;
- var timerRunning = false;
- function stopclock (){
- if(timerRunning)
- clearTimeout(timerID);
- timerRunning = false;}
- //显示当前时间
- function showtime () {
- var now = new Date();
- var hours = now.getHours();
- var minutes = now.getMinutes();
- var seconds = now.getSeconds();
- var timeValue =time(dd);
- //timeValue += ((minutes < 10) ? ":0" : ":") + minutes
- //timeValue += ((seconds < 10) ? ":0" : ":") + seconds
- timeValue += (hours >= 12) ? " 下午 " : " 上午 "
- //document.clock.face.value = timeValue;
- //setInterval("dd.setSeconds(dd.getSeconds()+1);document.clock.face.value=time(dd)",1000)
- //timerID = setTimeout("showtime()",1000);//设置超时,使时间动态显示
- timerRunning = true;}
- function startclock () {
- stopclock();
- showtime();}
- </SCRIPT>
- <SCRIPT language="javascript">
- function Isnum(){
- return ((event.keyCode >= 48) && (event.keyCode <= 57));
- }
- </SCRIPT>
- <script language=javascript>
- function time(liveclock){
- var s='';
- var d=liveclock!=null?new Date(liveclock):new Date();
- with(d){
- s=show5(getHours())+':'+show5(getMinutes())+':'+show5(getSeconds())
- }
- return(s);
- }
- <?php $nowdate = date("Y")."/".date("m")."/".date("d")." ".date("H:i:s")?>
- function show5(num){
- return num<10?'0'+num:num;
- }
- var dd=new Date("<?=$nowdate?>");
- var ss=setInterval("dd.setSeconds(dd.getSeconds()+1);document.clock.face.value=time(dd)",1000)
- </script>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../css/css.CSS" rel="stylesheet" type="text/css">
- <title></title>
- <style type="text/css">
- <!--
- body {
- margin-left:0px;
- }
- .STYLE1 {color: #FFFFFF}
- -->
- </style></head>
- <body onLoad="startclock();show5(); timerONE=window.setTimeout" topmargin="0" leftmargin="0">
- <table width="100%" border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td><span class="fbback">当前状态:</span>
- <?php if($all_close==0)
- { ?><span class="fbred">开盘</span>
- <?
- if($other_close==0)
- { ?><input name="Submit2" type="button" class="buttonrmin" onClick="javascript:window.location.href='config.php?op=other_close';" value=" 正码封盘 " >
- <? }else
- { ?>
- <input name="Submit2" type="button" class="buttongmin" onClick="javascript:window.location.href='config.php?op=other_open'" value=" 正码开盘 ">
- <? }?>
- <input name="Submit22" type="button" class="buttonrmin" onClick="javascript:window.location.href='config.php?op=all'" value=" 全部封盘 ">
- <? }else
- { ?><span class="fblue12"><strong>已封盘</strong></span>
- <input name="Submit222" type="button" class="buttongmin" onClick="javascript:window.location.href='config.php?op=open'" value=" 点击开盘 ">
- <? }?></td>
- <td><?php include("times_close.inc.php"); ?></td>
- <td><span class="fbred">自动开盘状态:</span> <? if($handf==1) {?>
- <a href="config.php?ap=open" class="ared" title="点击开启自动开盘状态">关闭</a> <? }else{?>
- <a href="config.php?ap=close" title="点击关闭自动开盘状态">开启</a> <? }?></td>
- </tr>
- </table>
- <table width="100%" height="58" border="0" cellpadding="3" cellspacing="1" class="t12">
- <tr class="t11">
- <td align="center" class="tblue STYLE1">期数</td>
- <td align="center" class="tblue STYLE1">星期</td>
- <td height="22" class="tblue"><div align="center" class="fw12">开盘时间</div></td>
- <td class="tblue"><div align="center" class="fw12">正码封盘时间</div></td>
- <td class="tblue"><div align="center" class="fw12">特码封盘时间</div></td>
- <td class="tblue"><div align="center" class="fw12">功能</div></td>
- <td class="tblue STYLE1">即时注单</td>
- </tr>
- <?php while($rs=mysql_fetch_array($sql))
- {
- if($rs["now_sign"]==1):
- $cs="bgcolor=#EAEA00";
- else:
- $cs="class='t17'";
- endif;
- ?>
- <form name="form2" method="post" action="config.php?act=yes" onSubmit="return check(this)">
- <tr <?=$cs?>>
- <td align="center">
- <input name="pdate" type="text" class="input" id="pdate" value="<?=$rs["dates"]?>" size="3" maxlength="20">期</td>
- <td align="center" class="fred12"><?=week(substr($rs["open_time"],0,10))?></td>
- <? $optime=$rs["open_time"]?>
- <td height="33"><div align="center">
- <input name="open_year" type="text" class="input" id="open_year" value="<?=substr($optime,0,4)?>" size="4" maxlength="4" ONKEYPRESS="event.returnValue=Isnum();">年
- <input name="open_month" type="text" class="input" id="open_month" value="<?=substr($optime,5,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">月
- <input name="open_date" type="text" class="input" id="open_date" value="<?=substr($optime,8,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">日
- <input name="open_hour" type="text" class="input" id="open_hour" value="<?=substr($optime,11,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">
- <span class="fred12">时</span>
- <input name="open_minute" type="text" class="input" id="open_minute" value="<?=substr($optime,14,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">分
- <input name="open_second" type="text" class="input" id="open_second" value="<?=substr($optime,17,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">
- 秒</div></td><?php $ottime=$rs["other_close_time"]?>
- <td><div align="center">
- <input name="other_year" type="text" class="input" id="other_year" value="<?=substr($ottime,0,4)?>" size="4" maxlength="4" onKeyPress="event.returnValue=Isnum();">年
- <input name="other_month" type="text" class="input" id="other_month" value="<?=substr($ottime,5,2)?>" size="2" maxlength="2" onKeyPress="event.returnValue=Isnum();">月
- <input name="other_date" type="text" class="input" id="other_date" value="<?=substr($ottime,8,2)?>" size="2" maxlength="2" onKeyPress="event.returnValue=Isnum();">日
- <input name="other_hour" type="text" class="input" id="other_hour" value="<?=substr($ottime,11,2)?>" size="2" maxlength="2" onKeyPress="event.returnValue=Isnum();">
- <span class="fred12">时</span>
- <input name="other_minute" type="text" class="input" id="other_minute" value="<?=substr($ottime,14,2)?>" size="2" maxlength="2" onKeyPress="event.returnValue=Isnum();">分
- <input name="other_second" type="text" class="input" id="other_second" value="<?=substr($ottime,17,2)?>" size="2" maxlength="2" onKeyPress="event.returnValue=Isnum();">秒
- </div></td>
- <?php $ctime=$rs["tnum_close_time"]?>
- <td><div align="center">
- <input name="tnum_year" type="text" class="input" id="tnum_year" value="<?=substr($ctime,0,4)?>" size="4" maxlength="4" ONKEYPRESS="event.returnValue=Isnum();">年
- <input name="tnum_month" type="text" class="input" id="tnum_month" value="<?=substr($ctime,5,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">月
- <input name="tnum_date" type="text" class="input" id="tnum_date" value="<?=substr($ctime,8,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">日
- <input name="tnum_hour" type="text" class="input" id="tnum_hour" value="<?=substr($ctime,11,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">
- <span class="fred12">时</span>
- <input name="tnum_minute" type="text" class="input" id="tnum_minute" value="<?=substr($ctime,14,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">分
- <input name="tnum_second" type="text" class="input" id="tnum_second" value="<?=substr($ctime,17,2)?>" size="2" maxlength="2" ONKEYPRESS="event.returnValue=Isnum();">秒
- </div></td>
- <td align="center"><input name="Submit" type="submit" class="buttongmin" value="设定"><input name="id" type="hidden" id="id" value="<?=$rs["ID"]?>"><input name="signs" type="hidden" id="signs" value="<?=$rs["now_sign"]?>"> </td>
- <td><div align="center">
- <?
- if($rs["now_sign"]==1)
- {?>
- <? if($now_billf=="0")
- { ?>
- <a href="config.php?nows=close" title="点击开启当期即时注单状态"><strong>当期</strong></a>
- <? }else
- {?>
- <a href="config.php?nows=open" class="fbred" title="点击关闭当期即时注单状态">上期</a>
- <? }?>
- <? }?></div></td>
- </tr>
- </form>
- <?
- }?>
- <form name="form3" method="post" action="config.php?act=add&menu=4">
- </form>
- </table>
- <br>
- <span class="fred12">备注:当出现用户前台没有自动开盘时,请点击右上角的自动开盘状态处于开启状态!当在被迫人工封盘时,请手动点击自动开盘状态为开启状态,否则用户前台不会自动开盘!<br>
- </span> <span class="fred12">关于即时注单:当即时注单状态为开启时,则显示当期的下注状况,若即时注单为关闭状态则显示上一期的下注状况!
- </span>
- <script language="JavaScript" type="text/javascript">
- calendar();
- </script>
- </body>
- </html>
English
