gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
droy | a3815a5 | 2019-09-25 12:49:18 -0400 | [diff] [blame] | 3 | * Copyright (c) 2007-2019 Eclipse Foundation and others. |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 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 |
droy | a3815a5 | 2019-09-25 12:49:18 -0400 | [diff] [blame] | 11 | * Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7 |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 12 | *******************************************************************************/ |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 13 | require_once("cb_global.php"); |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 14 | |
droy | 51e2bcc | 2008-07-16 15:14:43 +0000 | [diff] [blame] | 15 | $return = ""; |
| 16 | |
| 17 | if(isset($_SESSION['language'])) { |
droy | fa449bf | 2012-03-05 20:04:48 +0000 | [diff] [blame] | 18 | $query = "SELECT /* getProjects.php */ DISTINCT P.project_id, P.is_active |
| 19 | FROM projects AS P |
| 20 | INNER JOIN files AS F ON P.project_id = F.project_id |
| 21 | WHERE P.is_active = 1"; |
gobrien | 1c01c75 | 2008-01-10 18:34:31 +0000 | [diff] [blame] | 22 | |
| 23 | |
kitlo | 2c8d8a9 | 2018-04-19 13:25:09 -0400 | [diff] [blame] | 24 | $res = mysqli_query($dbh, $query); |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 25 | |
droy | 51e2bcc | 2008-07-16 15:14:43 +0000 | [diff] [blame] | 26 | // $return = '<ul id="project-choices">'; |
droy | a3815a5 | 2019-09-25 12:49:18 -0400 | [diff] [blame] | 27 | $return = Array(); |
| 28 | while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){ |
droy | 51e2bcc | 2008-07-16 15:14:43 +0000 | [diff] [blame] | 29 | $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; |
gobrien | e4a39c8 | 2008-01-11 00:06:14 +0000 | [diff] [blame] | 36 | } |
droy | 51e2bcc | 2008-07-16 15:14:43 +0000 | [diff] [blame] | 37 | // $return .= '<li><a href="project_id='.$line['project_id'].'">'.$line['project_id'].'</a>'; |
| 38 | |
| 39 | //$return .= "</ul>"; |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 40 | } |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 41 | print json_encode($return); |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 42 | |
| 43 | ?> |