echo $cid; ?> </h1> <div> <form id="filterform" class="form-inline" method=""> <b>Filter: </b> <label>Username: <input type='text' name='showname' id="showname" placeholder="Username" class="input-small" value='<?php echo $current_user->get_username(); ?> ' /></label> <label>ID: <select type='text' name='showpid' id="showpid" class="input-medium"> <option value=''>All</option> <?php if (contest_started($cid)) { foreach ((array) contest_get_problem_basic($cid) as $row) { ?> <option value='<?php echo $row["lable"]; ?> '><?php echo $row["lable"] . ". " . $row['title']; ?> </option> <?php } } ?> </select> </label> <label>Result:
function sidebar_item_content_contest_points($cid) { $value = sidebar_item_top() . " <h3>Current Value</h3>\n <table style='width:100%' class='table table-striped table-hover table-condensed'>\n <thead>\n <tr><th>Label</th><th>Value</th></tr>\n </thead>\n <tbody>\n"; $nowt = time(); foreach ((array) contest_get_problem_basic($cid) as $row) { $value .= " <tr><th>" . $row["lable"] . "</th><td>" . contest_get_problem_point_from_mixed($cid, $row["cpid"], $nowt) . "</td></tr>\n"; } $value .= " </tbody>\n </table>\n"; $value .= sidebar_item_bottom(); return $value; }
?> '/><span class="add-on"><i class="icon-th"></i></span></div></td></tr> <tr><td>( Set it later than end time if you don't want to lock board )</td></tr> <tr><td><label class="radio inline"><input type="radio" name="localtime" value="1" />Use local timezone</label><label class="radio inline"><input type="radio" name="localtime" value="0" checked="checked" /> Use server timezone</label></td></tr> <tr><td>Your timezone: <span id="localtz"></span><input name="localtz" type="hidden" id="tzinp" /></td></tr> <tr><td><label class="radio inline"><input type="radio" name="hide_others" value="1" /> Hide others' status</label><label class="radio inline"><input type="radio" name="hide_others" value="0" checked="checked" /> Show others' status</label></td></tr> <tr><td><div class="input-prepend"><span class="add-on">Password: </span><input type="password" name="password" /></div></td></tr> <tr><td>( Leave it blank if not needed )</td></tr> </table> </div> <?php if ($_GET['clone'] == 1) { $ccid = convert_str($_GET['cid']); if (contest_passed($ccid) && (!contest_is_private($ccid) || $current_user->is_valid() && ($current_user->is_in_contest($ccid) || $current_user->is_root()))) { $ccrow = contest_get_problem_basic($ccid); } } $nn = $config["limits"]["problems_on_contest_add"]; ?> <div class='span6'> <table style="width:100%"> <tr><th colspan="2">Add Problems For Contest</th></tr> <tr><th colspan="2">Leave Problem ID blank if you don't want to add it.</th></tr> <?php $ccrow = (array) $ccrow; for ($i = 0; $i < $nn; $i++) { if ($i >= sizeof($ccrow)) { $trow = array(); } else { $trow = $ccrow[$i];
function contest_get_problem_from_title($cid, $title) { global $db, $contest_infos; if (!isset($contest_infos[$cid])) { load_contest_infos($cid); } if (!$contest_infos[$cid]["valid"]) { return false; } foreach ((array) contest_get_problem_basic($cid) as $row) { if (strcasecmp($row["title"], $title) == 0) { return $row; } } return reset($contest_infos[$cid]["problems"]); }
<div class="span9"> <?php $show_problem = new Problem(); $pid = $prob_info["pid"]; $label = $prob_info["lable"]; $show_problem->set_problem($pid); if (!$show_problem->is_valid()) { ?> <p class="alert alert-error">Problem Unavailable!</p> <?php } else { ?> <div id="showproblem"> <ul class="nav nav-pills" id="probpagi"> <?php foreach (contest_get_problem_basic($cid) as $prob) { ?> <li<?php echo $prob['lable'] == $label ? " class='active'" : ""; ?> ><a href="#problem/<?php echo $prob['lable']; ?> "><?php echo $prob['lable']; ?> </a></li> <?php } ?> </ul>
<?php include_once dirname(__FILE__) . "/../functions/users.php"; include_once dirname(__FILE__) . "/../functions/contests.php"; $i = 0; $ret = array(); $ret['code'] = 1; if (!$current_user->is_root()) { die(json_encode($ret)); } $type = convert_str($_GET['type']); $value = convert_str($_GET['value']); $out = convert_str($_GET['out']); if ($type == "cid") { $res = contest_get_problem_basic($value); foreach ((array) $res as $prob) { $ret[$out . "pid" . $i] = $prob["pid"]; $i++; } $ret['result'] = 0; } else { $res = $db->get_results("select pid from problem where source='{$value}' order by pid", ARRAY_A); foreach ((array) $res as $prob) { $ret[$out . "pid" . $i] = $prob["pid"]; $i++; } $ret['result'] = 0; } echo json_encode($ret);
?> /> Hide others' status</label><label class="radio inline"><input type="radio" name="hide_others" value="0" <?php echo contest_get_val($cid, "hide_others") == 0 ? 'checked="checked"' : ''; ?> /> Show others' status</label></td></tr> <?php } ?> <tr><td><div class="input-prepend"><span class="add-on">Password: </span><input type="password" name="password" /></div></td></tr> <tr><td>( Leave it blank if not needed )</td></tr> </table> </div> <?php if (!contest_started($cid)) { $ccrow = (array) contest_get_problem_basic($cid); $nn = $config["limits"]["problems_on_contest_add"]; ?> <div class='span6'> <table style="width:100%"> <tr><th colspan="2">Add Problems For Contest</th></tr> <tr><th colspan="2">Leave Problem ID blank if you don't want to add it.</th></tr> <?php for ($i = 0; $i < $nn; $i++) { if ($i >= sizeof($ccrow)) { $trow = array(); } else { $trow = $ccrow[$i]; } ?>