diff --git a/api.php b/api.php index 9c8dc28..28e4631 100644 --- a/api.php +++ b/api.php @@ -69,19 +69,20 @@ switch($request[0]) { case "dates": if($request[1]) { - $ret['status']="ok"; - $ret['dates']=array(); - $q=mysql_query("SELECT date,name,description FROM dates WHERE conferences_id='{$request[1]}' ORDER BY date"); - $dates=array(); - while($r=mysql_fetch_assoc($q)) { - $dates[]=$r; - } - $ret['dates']=$dates; + $cid=intval($request[1]); } - else { - $ret['status']="error"; - $ret['error']="Conference ID is required"; + else + $cid=$_SESSION['conferences_id']; + + $ret['status']="ok"; + $ret['dates']=array(); + $q=mysql_query("SELECT date,name,description FROM dates WHERE conferences_id='$cid' ORDER BY date"); + $dates=array(); + while($r=mysql_fetch_assoc($q)) { + $dates[]=$r; } + $ret['conferences_id']=$cid; + $ret['dates']=$dates; break; case "auth": diff --git a/testapi.php b/testapi.php new file mode 100644 index 0000000..3632237 --- /dev/null +++ b/testapi.php @@ -0,0 +1,27 @@ +
+ +Login Check + + +Logout Check + + +Conference List