diff --git a/remote.php b/remote.php index ea08276..8463183 100644 --- a/remote.php +++ b/remote.php @@ -370,7 +370,8 @@ function handle_get_categories(&$u, &$fair, &$data, &$response) $cat = array(); $q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id"); while($r=mysql_fetch_object($q)) { - $cat[$r->id]=array('category' => $r->category, + $cat[$r->id]=array('id' => $r->id, + 'category' => $r->category, 'mingrade' => $r->mingrade, 'maxgrade' => $r->maxgrade); } @@ -384,7 +385,8 @@ function handle_get_divisions(&$u, &$fair, &$data, &$response) $div = array(); $q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id"); while($r=mysql_fetch_object($q)) { - $div[$r->id] = array('division' => $r->division); + $div[$r->id] = array('id' => $r->id, + 'division' => $r->division); } $response['divisions'] = $div; $response['error'] = 0; @@ -466,6 +468,7 @@ function handle_award_additional_materials(&$u, &$fair, &$data, &$response) if(array_key_exists('get_categories', $data)) handle_get_categories($u,$fair,$data, $response); if(array_key_exists('get_divisions', $data)) handle_get_divisions($u,$fair,$data, $response); if(array_key_exists('award_additional_materials', $data)) handle_award_additional_materials($u,$fair,$data, $response); + // $response['hi'] = 'hi'; echo urlencode(json_encode($response)); // echo "Success!
";