|
From: <br...@us...> - 2008-06-22 10:19:22
|
Revision: 273
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=273&view=rev
Author: brus07
Date: 2008-06-21 06:22:31 -0700 (Sat, 21 Jun 2008)
Log Message:
-----------
Add feature:
can clear Result for submits from range;
can view full table or last 20 submits;
Modified Paths:
--------------
ACMServer/trunk/web/table.php
Added Paths:
-----------
ACMServer/trunk/web/action.php
Added: ACMServer/trunk/web/action.php
===================================================================
--- ACMServer/trunk/web/action.php (rev 0)
+++ ACMServer/trunk/web/action.php 2008-06-21 13:22:31 UTC (rev 273)
@@ -0,0 +1,12 @@
+<a href=table.php>Table</a><br>
+
+<?php
+
+ require_once("connect.php");
+
+ if (isset($empty) && $empty=1)
+ {
+ $sql = 'UPDATE `v3_submits` SET `result` = NULL WHERE `id` >= '.$from.' AND `id` <= '.$to;
+ $result = MySql_Query ($sql);
+ echo "Empty from $from to $to<br>";
+ }
Modified: ACMServer/trunk/web/table.php
===================================================================
--- ACMServer/trunk/web/table.php 2008-06-21 12:59:37 UTC (rev 272)
+++ ACMServer/trunk/web/table.php 2008-06-21 13:22:31 UTC (rev 273)
@@ -1,12 +1,44 @@
<a href=submit.php>Submit</a><br>
<a href=get.php>Get</a><br>
+<?php
+ if (isset($full) != true || $full != 1)
+ {
+ echo "<a href=\"table.php?full=1\">Full table</a><br>";
+ }
+ else
+ {
+ echo "<a href=\"table.php?full=0\">Small table</a><br>";
+ }
+?>
<?php
-
require_once("connect.php");
- $Query = "SELECT * FROM `v3_submits` ORDER BY `id` DESC LIMIT 0 , 20;";
+ function getMax()
+ {
+ $sql = 'SELECT MAX(`id`) FROM `v3_submits`';
+ $result = MySql_Query ($sql);
+ while($arr = mysql_fetch_array($result)) {
+ return $arr[0];
+ }
+ return -1;
+ }
+?>
+
+<FORM action = "action.php?empty=1" method=post>
+ Empty: <INPUT name=from value=<?php echo getMax();?> >-
+ <INPUT name=to value=<?php echo getMax();?> >
+ <INPUT type=submit value=run>
+</FROM>
+
+<?php
+ $Query = "SELECT * FROM `v3_submits` ORDER BY `id` DESC";
+ if (isset($full) != true || $full != 1)
+ {
+ $Query .= " LIMIT 0 , 20;";
+ }
+
$result = MySql_Query ($Query);
echo "<table border=1>\n";
echo "\t<tr>\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|