diff --git a/admin/award_awards.php b/admin/award_awards.php index da6efcc..ee6f262 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -72,11 +72,6 @@ case 'saveawardinfo': print_r($_POST); - $in=fopen("/tmp/p.txt", "wt"); - fwrite($in, "post".print_r($_POST, true)); - fwrite($in, "get".print_r($_GET, true)); - fclose($in); - /* $r=mysql_fetch_object($q); $award_awards_id=$r->id; @@ -111,6 +106,13 @@ } echo json_encode($ret); exit; + + case 'orderprizes': + foreach ($_GET['listItem'] as $position => $item) { + $sql[] = "UPDATE `table` SET `position` = $position WHERE `id` = $item"; + } + print_r($sql); + exit; } if($_GET['action']=="edit" || $_GET['action']=="add") { @@ -224,6 +226,18 @@ function update_eligibility() $("[name=eligibledivisions]").val(json.divisions); }); } + +// When the document is ready set up our sortable with it's inherant function(s) +$(document).ready(function() { + $("#test-list").sortable({ + handle : '.handle', + update : function () { + var order = $('#test-list').sortable('serialize'); + $("#info").load("?action=orderprizes&order="+order); + } + }); +}); + '; +?> +
 
+    
Waiting for update
+
+ + +