-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·73 lines (60 loc) · 2.18 KB
/
index.php
File metadata and controls
executable file
·73 lines (60 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
#if ($_SERVER['SERVER_PORT']!=443)
#{
# $url = "https://". $_SERVER['SERVER_NAME']. ":443".$_SERVER['REQUEST_URI'];
# header("Location: $url");
#}
#header('Location: https://coj.cqut.edu.cn/',TRUE, 301);
////////////////////////////Common head
$cache_time=10;
$OJ_CACHE_SHARE=false;
require_once('./include/cache_start.php');
require_once('./include/db_info.inc.php');
require_once('./include/setlang.php');
$view_title= "Welcome To CQUT Online Judge";
///////////////////////////MAIN
$view_news="";
$sql= "SELECT * "
."FROM `news` "
."WHERE `defunct`!='Y'"
."ORDER BY `importance` ASC,`time` DESC "
."LIMIT 50";
$result=mysql_query($sql);//mysql_escape_string($sql));
if (!$result){
// $view_news= "<h3>No News Now!</h3>";
// $view_news.= mysql_error();
}else{
$view_news.= "<table width=96%>";
while ($row=mysql_fetch_object($result)){
$view_news.= "<tr><td><td><big><b>".$row->title."</b></big>-<small>[".$row->user_id."]</small></tr>";
$view_news.= "<tr><td><td>".$row->content."</tr>";
}
mysql_free_result($result);
$view_news.= "<tr><td width=20%><td></tr>";
$view_news.= "</table>";
}
$view_apc_info="";
$sql= "SELECT UNIX_TIMESTAMP(date(in_date))*1000 md,count(1) c FROM `solution` group by md order by md desc ";
$result=mysql_query($sql);//mysql_escape_string($sql));
$chart_data_all= array();
//echo $sql;
while ($row=mysql_fetch_array($result)){
$chart_data_all[$row['md']]=$row['c'];
}
$sql= "SELECT UNIX_TIMESTAMP(date(in_date))*1000 md,count(1) c FROM `solution` where result=4 group by md order by md desc ";
$result=mysql_query($sql);//mysql_escape_string($sql));
$chart_data_ac= array();
//echo $sql;
while ($row=mysql_fetch_array($result)){
$chart_data_ac[$row['md']]=$row['c'];
}
if(function_exists('apc_cache_info')){
$_apc_cache_info = apc_cache_info();
$view_apc_info =_apc_cache_info;
}
/////////////////////////Template
require("template/".$OJ_TEMPLATE."/index.php");
/////////////////////////Common foot
if(file_exists('./include/cache_end.php'))
require_once('./include/cache_end.php');
?>