Subversion Repositories taios

Rev

Rev 215 | Rev 515 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

$page = new Taios_Page('Edit Project', '../');
$page->drawHeader();
$page->drawMiddle();

$page->checkLoggedIn();

$project = $page->getProject($page->getGetID());
if (!$project)
{
    $page->drawError('No such project, #' . $page->getGetID());
}

?>

<p class="bold">Here you can edit a project from the Tim32 database.</p>
<p>Leave an input blank to keep it as it is.</p>
<br />

<?php

if (isset($_GET['error']))
{
    $page->drawError($_GET['error'], false);
}

if ($page->isUserAdmin($page->getLoggedInUser()) || $page->getLoggedInUser()->ID == $project->author->ID)
{
?>

<form action="edit-project-do.php" method="POST">
<input type="hidden" name="id" value="<?php echo $project->ID; ?>" />
<table>
<tr>
<td class="bold">Title: </td>
<td><input type="text" name="title" value="<?php echo $project->title; ?>" /></td>
</tr>
<tr>
<td class="bold">Description: </td>
<td><textarea name="description"><?php echo $project->description; ?></textarea></td>
</tr>
<tr>
<td class="bold">Logo URL: </td>
<td><input type="text" name="logourl" value="<?php echo $project->logoURL; ?>" /></td>
</tr>
<tr>
<td class="bold">Website URL: </td>
<td><input type="text" name="websiteurl" value="<?php echo $project->websiteURL; ?>" /></td>
</tr>
<tr>
<td class="bold">DownloadURL: </td>
<td><input type="text" name="downloadurl" value="<?php echo $project->downloadURL; ?>" /></td>
</tr>
<tr>
<td class="bold">Latest Version: </td>
<td><input type="text" name="latestversion" value="<?php echo $project->latestVersion; ?>" /></td>
</tr>
<tr>
<td class="bold"></td>
<td><input type="submit" value="Edit Project" /></td>
</tr>
</table>
</form>

<?php
}
else
{
    $page->drawError('You do not have permission to access this page.');
}

$page->drawFooter();

?>