tnum_close.php

来自「程序脚本为PHP+MYSQL」· PHP 代码 · 共 32 行

PHP
32
字号
<?php 
$sqlcs=mysql_query("select * from ptime where sign='4'",$conn);
$all_close=mysql_result($sqlcs,0,"opstate");
$tnum_close=mysql_result($sqlcs,0,"tnum");
$hand=mysql_result($sqlcs,0,"hand");
if ($hand==1) echo "<script language='javascript'>window.location='close_plate.php'</script>";
$sqlop=mysql_query("select * from ptime where now_sign='1'",$conn);
$open_time=mysql_result($sqlop,0,"open_time");   //tnum
$tnum_closes=mysql_result($sqlop,0,"tnum_close_time");   //tnum
$ltime=split(" ",$tnum_closes);//tnum
$ymd=split("-",$ltime[0]);
$hms=split(":",$ltime[1]);
$limit_times=mktime($hms[0],$hms[1],$hms[2],$ymd[1],$ymd[2],$ymd[0]);  //设定时间
$limit_time=$limit_times-time();
$oltime=split(" ",$open_time);//open
$oymd=split("-",$oltime[0]);
$ohms=split(":",$oltime[1]);
$olimit_times=mktime($ohms[0],$ohms[1],$ohms[2],$oymd[1],$oymd[2],$oymd[0]);  //设定时间
$olimit_time=$olimit_times-time();
if($olimit_time>=0)
{
 mysql_query("update ptime set opstate='1',tnum='1',other='1' where sign='4'",$conn);
 echo "<script language='javascript'>window.location='close_plate.php'</script>";
}
if($limit_time<=0)
{
$sqlcl=mysql_query("update ptime set tnum='1',opstate='1',other='1' where sign='4'",$conn);   //tnum close
}
if($all_close==1) echo "<script language='javascript'>window.location='close_plate.php'</script>";
if($tnum_close==1) echo "<script language='javascript'>window.location='close_plate.php'</script>";
?>

⌨️ 快捷键说明

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