📄 config.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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -