blob: 2c2c4439d3ad1a35fd28c2d16fdda391182962a1 [file] [log] [blame]
gobrien35e23782007-11-28 21:37:18 +00001<?php
2/*******************************************************************************
droya3815a52019-09-25 12:49:18 -04003 * Copyright (c) 2007-2019 Eclipse Foundation and others.
gobrien35e23782007-11-28 21:37:18 +00004 * 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
droya3815a52019-09-25 12:49:18 -040011 * Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7
gobrien35e23782007-11-28 21:37:18 +000012*******************************************************************************/
gobrien48275462007-11-29 21:29:17 +000013require_once("cb_global.php");
gobrien35e23782007-11-28 21:37:18 +000014
droy51e2bcc2008-07-16 15:14:43 +000015$return = "";
16
17if(isset($_SESSION['language'])) {
droyfa449bf2012-03-05 20:04:48 +000018 $query = "SELECT /* getProjects.php */ DISTINCT P.project_id, P.is_active
19FROM projects AS P
20INNER JOIN files AS F ON P.project_id = F.project_id
21WHERE P.is_active = 1";
gobrien1c01c752008-01-10 18:34:31 +000022
23
kitlo2c8d8a92018-04-19 13:25:09 -040024 $res = mysqli_query($dbh, $query);
gobrien35e23782007-11-28 21:37:18 +000025
droy51e2bcc2008-07-16 15:14:43 +000026// $return = '<ul id="project-choices">';
droya3815a52019-09-25 12:49:18 -040027 $return = Array();
28 while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
droy51e2bcc2008-07-16 15:14:43 +000029 $ret = Array();
30 $ret['project'] = $line['project_id'];
31 // $ret['version'] = $line['version'];
32 if(isset($_SESSION['project']) and $line['project_id'] == $_SESSION['project']){
33 $ret['current'] = true;
34 }
35 $return[] = $ret;
gobriene4a39c82008-01-11 00:06:14 +000036 }
droy51e2bcc2008-07-16 15:14:43 +000037 // $return .= '<li><a href="project_id='.$line['project_id'].'">'.$line['project_id'].'</a>';
38
39 //$return .= "</ul>";
gobrienad11d892007-12-19 08:33:25 +000040}
gobrienad11d892007-12-19 08:33:25 +000041print json_encode($return);
gobrien35e23782007-11-28 21:37:18 +000042
43?>