Ejemplo n.º 1
0
<?php

require "./navigation.php";
include_once "./FCKeditor/fckeditor.php";
$cid = tryget('cid', 0);
$rs = new RecordSet($conn);
if ($cid) {
    $contest = new ContestsTbl($cid);
    $contest->Get() or error("contest not exists");
    $contest_title = $contest->detail['title'];
    $problems_n = gen_new_cpid($cid);
} else {
    $contest_title = "";
    $problems_n = gen_new_pid();
}
?>
  

<script type="text/javascript">

    var datanum=0;

    function insert()
    {
        var box = "";
        box += "<tr>";
        box += "<td>Input Data"+datanum+"</td>";
        box += "<td><input type=file name=\"input_data"+datanum+"\" id=\"input_data"+datanum+"\"></td>";
        box += "</tr>";

        box += "<tr>";
Ejemplo n.º 2
0
<?php

require "./navigation.php";
?>

<?php 
$p = tryget('p', 1);
$perm = 'user';
if ($logged) {
    $user = new UserTbl($login_uid);
    if ($user->Get()) {
        $perm = $user->detail['perm'];
    }
}
$authname = array('free' => _("Public"), 'password' => _("Password"), 'internal' => _("Internal"), "bound" => _("Netid"));
$rs = new RecordSet($conn);
$query_str = "SELECT cid, title, starttime, during, authtype FROM contests WHERE course_id = 0 ";
$count_str = "SELECT count(*) FROM contests WHERE course_id = 0 ";
$rs->nPageSize = 20;
$rs->PageCount($count_str);
$rs->SetPage($p);
$query_str .= "ORDER BY cid DESC";
$rs->dpQuery($query_str);
$now = time();
?>

<script type="text/javascript">
    function onAuthContest(data) {
        if (data.success) {
            window.location = "contest_detail.php?cid=" + data.cid;
        } else {
Ejemplo n.º 3
0
<?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");
Ejemplo n.º 4
0
<?php

require "./navigation.php";
include_once "./FCKeditor/fckeditor.php";
$course_id = tryget('course_id', '');
$courseTbl = new CourseTbl($course_id);
if ($course_id && !$courseTbl->Get()) {
    error("Course not found");
}
$course = $courseTbl->detail;
$rs = new RecordSet($conn);
$rs->Query("SELECT max(cid) FROM contests");
$rs->MoveNext();
$cid = $rs->Fields[0];
$rs->Query("SELECT * FROM contests");
?>

<script type="text/javascript">
    function pad0(num) {
        if (num < 10) return "0" + num;
        return num;
    }
    
    function calc_during() {
        if ($("#starttime").val().length == 0) {
            alert("Please set start time first!!");
            return;
        }
        var during = Date.parse($("#endtime").val()) - Date.parse($("#starttime").val());
        during = during / 1000;
        var s = during % 60;