Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
sttimemng.php
Go to the documentation of this file.
1 <?php
2 if(!defined('IN_ADMIN')) {
3  exit('Access Denied');
4 }
5 
6 if($subcmd=='edit' && !$gamestate){
7  $settime = mktime((int)$_POST['sethour'],(int)$_POST['setmin'],0,(int)$_POST['setmonth'],(int)$_POST['setday'],(int)$_POST['setyear']);
8  if($settime <= $now){
9  echo '开始时间不能早于当前时间。<br>';
10  } else {
11  $starttime = $settime;
12  save_gameinfo();
13  echo '游戏开始时间设置成功。<br>';
14  }
15 }
16 
17 if($gamestate) {
18  echo '本局游戏尚未结束,不能设置时间。<br>';
19 } elseif($starttime) {
20  list($stsec,$stmin,$sthour,$stday,$stmonth,$styear,$stwday,$styday,$stisdst) = localtime($starttime);
21  $stmonth++;
22  $styear += 1900;
23 } else {
24  list($stsec,$stmin,$sthour,$stday,$stmonth,$styear,$stwday,$styday,$stisdst) = localtime($now+3600);
27  $styear += 1900;
28 }
29 
30 
31 
32 ?>
33 
34 下局游戏开始时间:<br>
35 <form method="post" name="sttimemng" onsubmit="admin.php">
36 <input type="hidden" name="mode" value="gamemng">
37 <input type="hidden" name="command" value="sttimemng">
38 <input type="hidden" name="subcmd" value="">
39 <input type="text" name="setyear" size="4" value="<?=$styear?>"><?=$lang['year']?>
40 <input type="text" name="setmonth" size="2" value="<?=$stmonth?>"><?=$lang['month']?>
41 <input type="text" name="setday" size="2" value="<?=$stday?>"><?=$lang['day']?>
42 <input type="text" name="sethour" size="2" value="<?=$sthour?>"><?=$lang['hour']?>
43 <input type="text" name="setmin" size="2" value="<?=$stmin?>"><?=$lang['min']?>
44 <br>
45 <input type="button" value="修改" onclick="javascript:document.sttimemng.subcmd.value='edit';document.sttimemng.submit();">
46 <input type="button" value="返回" onclick="javascript:document.sttimemng.mode.value='';document.sttimemng.submit();">
$stmonth
Definition: sttimemng.php:26
$stmin
Definition: sttimemng.php:25
【生存者数:<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
$styear
Definition: sttimemng.php:27
$now
Definition: clear.php:23
$lang
Definition: admin.lang.php:4
$gamestate
Definition: gameinfo.php:4
value
Definition: 1_alive.tpl.php:10
$startmin
Definition: system.php:20
$starttime
Definition: gameinfo.php:5
save_gameinfo()