Fix api for categories (projectcategories_load wouldnt have ever worked!)

This commit is contained in:
james 2010-10-05 20:24:43 +00:00
parent 4ddbffe4bb
commit e590c94690
2 changed files with 11 additions and 4 deletions

12
api.php
View File

@ -58,7 +58,9 @@ switch($request[0]) {
return(divisions array)
*/
case 'divisions':
$divs=projectdivisions_load();
$ret['status']="ok";
$ret['divisions']=$divs;
break;
/* APIDOC: config/subdivisions
@ -66,7 +68,9 @@ switch($request[0]) {
return(subdivisions array)
*/
case 'subdivisions':
$subdivs=projectsubdivisions_load();
$ret['status']="ok";
$ret['subdivisions']=$subdivs;
break;
/* APIDOC: config/categories
@ -74,7 +78,9 @@ switch($request[0]) {
return(categories array)
*/
case 'categories':
$cats=projectcategories_load();
$ret['status']="ok";
$ret['categories']=$cats;
break;
}

View File

@ -773,8 +773,9 @@ function projectcategories_load($conferences_id = false) {
global $conference;
if($conferences_id == false) $conferences_id = $conference['id'];
$cats = array();
echo "conferences_id=$conferences_id";
$q = mysql_query("SELECT * FROM projectcategories WHERE conferences_id='$conferences_id'");
while(($c = mysql_fetch_assoc($q))) $cats[$c['id']] = $d;
while(($c = mysql_fetch_assoc($q))) $cats[$c['id']] = $c;
return $cats;
}