function check_time() { $tc = date("his"); //echo $tc; if (date("a") == "pm" && $tc < 120000) { $tc += 120000; } //echo $tc; if ($tc <= gettl()) { return true; } else { return false; } }
function check_time() { $tc = date("his"); //echo $tc; if (date("a") == "pm" && $tc < 120000) { $tc += 120000; } //echo $tc; $c_ipf = fopen("conf/cont.conf", "r"); $cid = fread($c_ipf, 8); fclose($c_ipf); if (check_stat($cid) != 1) { return false; } if ($tc <= gettl()) { return true; } else { return false; } }
$pf = fopen("conf/time.conf", "r"); list($hh, $mm) = fscanf($pf, "%d:%d"); fclose($pf); $tl = $hh * 10000 + $mm * 100; return $tl; } echo "<tr height='30px'>"; echo "<td width='200px'>Contest id</td>\n"; echo "<td>" . $cid . "</td></tr>"; ?> <?php if (check_stat($cid) == 1) { echo "<tr height='30px'>"; echo "<td width='200px'>Submit time limit</td>\n"; $ttl = gettl(); $wx = 'am'; if ($ttl >= 120000) { $wx = 'pm'; if ($ttl >= 130000) { $ttl -= 120000; } } printf("<td>%02d:%02d:00 %s</td></tr>", $ttl / 10000, $ttl % 10000 / 100, $wx); } ?> <?php echo "<tr height='30px'>"; echo "<td width='200px'>Judge type</td>\n"; echo "<td>" . $ccfg['judgetype'] . "</td>\n";