<?php define('METHUSELAH_INCLUDE_CHECK', true); require_once "toolbox_internal.php"; function getProjectsList() { global $authserver; $query = "SELECT `code`, `caption` FROM `projects`.`projects` WHERE `active` = b'1';"; $result = $authserver->query($query) or responseWithError("InternalDatabaseError"); $return = array(); while ($row = $result->fetch_assoc()) { $return[] = $row; } return $return; } response(array("projects" => getProjectsList()));
print '</tr>'; if ($mode != 'create') { print '<tr>'; print '<td valign="top" align="left">Collaborators:</td>'; print '<td>'; print '<div style="min-height:200px;overflow-y:scroll;" id="user_listing">'; display_project_user_list($project_id); print '</div>'; print '</td>'; print '</tr>'; } print '</table>'; } else { if ($mode == 'list') { // Get list from database $projects = getProjectsList(); print '<table cellspacing="3px" cellpadding="0" width="100%">'; print '<thead>'; print '<th style="width:30%">Name</th>'; print '<th>Description</th>'; print '</thead>'; foreach ($projects as $id => $attributes) { print '<tr valign="top">'; print '<td>'; print $attributes['name']; print '</td>'; print '<td>'; print $attributes['description']; print '</td>'; print '<td>'; print '<a href="project_profiles.php?id=' . $id . '" title="Modify Project \'' . $attributes['name'] . '\'"><input type="button" name="edit" value="Edit" /></a>';