From 866658cded5b92ddb2681dead1ebaf111d712fcc Mon Sep 17 00:00:00 2001 From: cassiopc Date: Mon, 6 Aug 2012 11:09:10 +0200 Subject: init --- boca-1.5.0/src/admin/problem.php | 262 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 boca-1.5.0/src/admin/problem.php (limited to 'boca-1.5.0/src/admin/problem.php') diff --git a/boca-1.5.0/src/admin/problem.php b/boca-1.5.0/src/admin/problem.php new file mode 100644 index 0000000..d55ff63 --- /dev/null +++ b/boca-1.5.0/src/admin/problem.php @@ -0,0 +1,262 @@ +. +//////////////////////////////////////////////////////////////////////////////// +// Last modified 21/jul/2012 by cassio@ime.usp.br +require('header.php'); +if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null) + ForceLoad("../index.php"); + +if (isset($_GET["delete"]) && is_numeric($_GET["delete"]) && isset($_GET["input"])) { + $param = array(); + $param['number']=$_GET["delete"]; + $param['inputfilename']=$_GET["input"]; + if(!DBDeleteProblem ($_SESSION["usertable"]["contestnumber"], $param)) { + MSGError('Error deleting problem'); + LogError('Error deleting problem'); + } + ForceLoad("problem.php"); +} + +if (isset($_POST["Submit3"]) && isset($_POST["problemnumber"]) && is_numeric($_POST["problemnumber"]) && + isset($_POST["problemname"]) && $_POST["problemname"] != "") { + if ($_POST["confirmation"] == "confirm") { + if ($_FILES["probleminput"]["name"] != "") { + $type=myhtmlspecialchars($_FILES["probleminput"]["type"]); + $size=myhtmlspecialchars($_FILES["probleminput"]["size"]); + $name=myhtmlspecialchars($_FILES["probleminput"]["name"]); + $temp=myhtmlspecialchars($_FILES["probleminput"]["tmp_name"]); + if (!is_uploaded_file($temp)) { + IntrusionNotify("file upload problem."); + ForceLoad("../index.php"); + } + } else $name = ""; + + $param = array(); + $param['number'] = $_POST["problemnumber"]; + $param['name'] = $_POST["problemname"]; + $param['inputfilename'] = $name; + $param['inputfilepath'] = $temp; + $param['fake'] = 'f'; + $param['colorname'] = $_POST["colorname"]; + $param['color'] = $_POST["color"]; + if($param['color']=='') $param['color']=-1; + DBNewProblem ($_SESSION["usertable"]["contestnumber"], $param); + } + ForceLoad("problem.php"); +} +?> +
+ + + + + + + + + + + + +\n"; + if($prob[$i]["fake"]!='t') { + echo " \n"; + } else { + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + if (isset($prob[$i]["descoid"]) && $prob[$i]["descoid"] != null) { + echo " \n"; + } + else + echo " \n"; + if ($prob[$i]["inputoid"] != null) { + $tx = $prob[$i]["inputhash"]; + echo " \n"; + } + else + echo " \n"; +/* + if ($prob[$i]["soloid"] != null) { + $tx = $prob[$i]["solhash"]; + echo " \n"; + } + else + echo " \n"; + if ($prob[$i]["timelimit"]!="") + echo " \n"; + else + echo " \n"; +*/ + if ($prob[$i]["color"]!="") { + echo " \n"; + } else + echo " \n"; + echo " \n"; +} +echo "
Problem #Short NameFullnameBasenameDescfilePackage fileColor
" . $prob[$i]["number"] . "" . $prob[$i]["number"] . " (fake)" . $prob[$i]["name"] . "" . $prob[$i]["fullname"] . " " . $prob[$i]["basefilename"] . " " . + basename($prob[$i]["descfilename"]) . " " . + $prob[$i]["inputfilename"] . " " . + "\"$tx\"" . + " " . + $prob[$i]["solfilename"] . " ". + "\"$tx\"" . + " " . $prob[$i]["timelimit"] . " " . $prob[$i]["colorname"] . + "\"".$prob[$i]["colorname"]."\" 
"; +if (count($prob) == 0) echo "
NO PROBLEMS DEFINED
"; + +?> + +

Clicking on a problem number will delete it.
+WARNING: deleting a problem will remove EVERYTHING related to it.
+It is NOT recommended to change anything while the contest is running.
+To import a problem, fill in the following fields.
+To replace the data of a problem, proceed as if it did not exist (data will be replaced without removing it).
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Number: + +
Short Name (usually a letter): + +
Problem package (ZIP): + +
Color name: + +
Color (RGB HTML format): + +
+
+
+ + +
+
+ + + -- cgit v1.2.3