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. |
From: <br...@us...> - 2008-06-26 21:07:33
|
Revision: 281 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=281&view=rev Author: brus07 Date: 2008-06-26 14:07:37 -0700 (Thu, 26 Jun 2008) Log Message: ----------- Change size and type of field 'value' of table. Update view for source. Modified Paths: -------------- ACMServer/trunk/web/submit.php ACMServer/trunk/web/table.php ACMServer/trunk/web/update.php Added Paths: ----------- ACMServer/trunk/web/update3.0.0.2.sql Modified: ACMServer/trunk/web/submit.php =================================================================== --- ACMServer/trunk/web/submit.php 2008-06-26 18:22:52 UTC (rev 280) +++ ACMServer/trunk/web/submit.php 2008-06-26 21:07:37 UTC (rev 281) @@ -1,4 +1,4 @@ <FORM action = "insert.php" method=post> - Text: <INPUT name=text> + Text: <br><textarea name=text rows="20" wrap="VIRTUAL" cols="65"></textarea><br> <INPUT type=submit value=\xC2i\xE4i\xF1\xEB\xE0\xF2\xE8> </FROM> \ No newline at end of file Modified: ACMServer/trunk/web/table.php =================================================================== --- ACMServer/trunk/web/table.php 2008-06-26 18:22:52 UTC (rev 280) +++ ACMServer/trunk/web/table.php 2008-06-26 21:07:37 UTC (rev 281) @@ -63,6 +63,7 @@ for ($i=0; $i<3; $i++) { echo "\t\t<td>"; + $arr[$i] = $bodytag = str_replace("\r\n", "<br>", $arr[$i]); echo $arr[$i]; echo "</td>\n"; } Modified: ACMServer/trunk/web/update.php =================================================================== --- ACMServer/trunk/web/update.php 2008-06-26 18:22:52 UTC (rev 280) +++ ACMServer/trunk/web/update.php 2008-06-26 21:07:37 UTC (rev 281) @@ -2,6 +2,6 @@ require_once("connect.php"); - $sql = 'ALTER TABLE `v3_submits` ADD `usedMemory` VARCHAR( 20 ) NOT NULL, ADD `usedTime` VARCHAR( 20 ) NOT NULL '; + $sql = 'ALTER TABLE `v3_submits` CHANGE `value` `value` BLOB NOT NULL'; $result = MySql_Query ($sql); \ No newline at end of file Added: ACMServer/trunk/web/update3.0.0.2.sql =================================================================== --- ACMServer/trunk/web/update3.0.0.2.sql (rev 0) +++ ACMServer/trunk/web/update3.0.0.2.sql 2008-06-26 21:07:37 UTC (rev 281) @@ -0,0 +1,5 @@ +-- +-- Change type and length of field 'value' +-- + +ALTER TABLE `v3_submits` CHANGE `value` `value` BLOB NOT NULL \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |