gobrien | da265d3 | 2008-01-24 01:08:14 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
| 3 | * Copyright (c) 2007 Eclipse Foundation and others. |
| 4 | * All rights reserved. This program and the accompanying materials |
| 5 | * are made available under the terms of the Eclipse Public License v1.0 |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | * |
| 9 | * Contributors: |
| 10 | * Paul Colton (Aptana)- initial API and implementation |
| 11 | |
| 12 | *******************************************************************************/ |
| 13 | require_once("cb_global.php"); |
| 14 | |
| 15 | |
| 16 | $query = "select |
| 17 | DISTINCT files.name |
| 18 | from |
| 19 | project_versions, |
| 20 | files |
| 21 | where |
| 22 | files.project_id = project_versions.project_id |
| 23 | and |
| 24 | files.version = project_versions.version |
| 25 | and |
| 26 | project_versions.is_active = 1 |
| 27 | and |
| 28 | project_versions.project_id = '".addslashes($_SESSION['project'])."' |
| 29 | and |
| 30 | files.version = '".addslashes($_SESSION['version'])."' |
gobrien | afc63b0 | 2008-01-25 22:10:47 +0000 | [diff] [blame] | 31 | order by |
| 32 | files.name |
gobrien | da265d3 | 2008-01-24 01:08:14 +0000 | [diff] [blame] | 33 | "; |
| 34 | |
| 35 | //print $query."\n"; |
| 36 | |
| 37 | $res = mysql_query($query,$dbh); |
| 38 | |
| 39 | while($line = mysql_fetch_array($res, MYSQL_ASSOC)){ |
| 40 | $ret = Array(); |
| 41 | $ret['name'] = $line['name']; |
| 42 | if($line['file'] == $_SESSION['file']){ |
| 43 | $ret['current'] = true; |
| 44 | } |
| 45 | $return[] = $ret; |
| 46 | } |
| 47 | |
| 48 | print json_encode($return); |
| 49 | |
| 50 | ?> |