예제 #1
0
파일: courses.php 프로젝트: thezawad/Sicily
<?php

require "navigation.php";
$p = tryget("p", 1);
$rs = new RecordSet($conn);
$query_str = "SELECT course_id, name, teacher, description FROM courses WHERE avail = 1 ";
$count_str = "SELECT count(*) FROM courses WHERE avail = 1";
$rs->nPageSize = 20;
$rs->PageCount($count_str);
$rs->SetPage($p);
$query_str .= "ORDER BY course_id DESC";
$rs->dpQuery($query_str);
$now = time();
?>
<h1><?php 
echo _("Current Courses");
?>
</h1>
<table class="ui-widget tblcontainer ui-widget-content ui-corner-all" width="100%">
    <thead >
        <tr class="ui-widget-header">
            <th width="100"><?php 
echo _("ID");
?>
</th>
            <th width="300"><?php 
echo _("Name");
?>
</th>
            <th width="300"><?php 
echo _("Teacher");
예제 #2
0
<?php

require "../inc/global.inc.php";
require "./auth.inc.php";
$p = $_GET['p'];
if ($p == "") {
    $p = 1;
}
$rs = new RecordSet($conn);
$rs->nPageSize = 16;
$rs->PageCount("SELECT count(*) FROM user");
$rs->SetPage($p);
$rs->dpQuery("SELECT uid, username, solved, submissions FROM user WHERE perm LIKE '%user%' ORDER BY solved DESC, submissions, uid");
?>
<html>
	<head>
		<title>Ranklist</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<link rel="stylesheet" href="style.css">
	</head>
	<body color="#FFFFFF" bgcolor="#005DA9" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr> 
				<td width="770">
					<?php 
require "./navigation.php";
?>
				</td>
				<td background="images/navigation_bg.gif">&nbsp;</td>
			</tr>
			<tr align="center" valign="top"> 
예제 #3
0
파일: status.php 프로젝트: thezawad/Sicily
<?php

include_once "../inc/global.inc.php";
include_once "auth.inc.php";
$p = $_GET["p"];
$cid = $_GET["cid"];
$pid = $_GET["pid"];
if ($p == "") {
    $p = 1;
}
$rs = new RecordSet($conn);
$rs->nPageSize = 16;
if ($cid) {
    $rs->PageCount("SELECT count(*) FROM contest_status");
    $rs->SetPage($p);
    if ($pid) {
        $rs->dpQuery("SELECT sid, contest_status.uid, username, pid, language, status, run_time, run_memory, time FROM contest_status,user WHERE contest_status.uid=user.uid AND cid='{$cid}' AND pid='{$pid}' ORDER BY time DESC");
    } else {
        $rs->dpQuery("SELECT sid, contest_status.uid, username, pid, language, status, run_time, run_memory, time FROM contest_status,user WHERE contest_status.uid=user.uid AND cid='{$cid}' ORDER BY time DESC");
    }
    $contest = new ContestsTbl();
    $contest->Get($cid);
} else {
    $rs->PageCount("SELECT count(*) FROM status");
    $rs->SetPage($p);
    $rs->dpQuery("SELECT sid, status.uid, username, pid, language, status, run_time, run_memory, time FROM status,user WHERE status.uid=user.uid ORDER BY sid DESC");
}
?>
<html>
	<head>
		<title>Status</title>
예제 #4
0
    $list = $user->detail['list'];
}
$rs = new RecordSet($conn);
$rs->nPageSize = 20;
if ($cid) {
    $contest = new ContestsTbl();
    if ($contest->Get($cid) < 0) {
        error("No such contest ID");
    }
    if (!is_admins()) {
        $now = time();
        if ($now < strtotime($contest->detail['starttime'])) {
            error("The contest is not started");
        }
    }
    $rs->PageCount("SELECT count(*) FROM contest_problems");
    $rs->SetPage($p);
    $rs->dpQuery("SELECT pid, title, accepted, submissions, avail FROM contest_problems WHERE cid='{$cid}'");
} else {
    $rs->PageCount("SELECT count(*) FROM problems");
    $rs->SetPage($p);
    $rs->dpQuery("SELECT pid, title, accepted, submissions, avail FROM problems");
}
?>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr> 
		<td width="770">
		</td>
		<td background="images/navigation_bg.gif">&nbsp;</td>
	</tr>