blob: d599f12c6635cb4f2f22c35a29e2a996c9818a69 [file] [log] [blame]
gobrienda265d32008-01-24 01:08:14 +00001<?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*******************************************************************************/
13require_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'])."'
gobrienafc63b02008-01-25 22:10:47 +000031 order by
32 files.name
gobrienda265d32008-01-24 01:08:14 +000033 ";
34
35//print $query."\n";
36
37$res = mysql_query($query,$dbh);
38
39while($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
48print json_encode($return);
49
50?>