blob: e44a5695d3bec6be088cec0ca28894b9d9d4df19 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2006 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Nathan Gervais (Eclipse Foundation)- initial API and implementation
*******************************************************************************/
#*****************************************************************************
#
# add_category.php
#
# Author: Nathan Gervais
# Date: Nov 3rd, 2006
#
# Description:
# This file adds a Project to the database
#****************************************************************************
require_once ("includes/header.php");
$id = $_GET['id'] ? $_GET['id'] : $_POST['id'];
$submit = $_GET['submit'] ? $_GET['submit'] : $_POST['submit'];
if ($submit == "Edit Project")
{
$url_newsgroup = htmlentities($_GET['url_newsgroup'] ? $_GET['url_newsgroup'] : $_POST['url_newsgroup']);
$url_mailinglist = htmlentities($_GET['url_mailinglist'] ? $_GET['url_mailinglist'] : $_POST['url_mailinglist']);
$url_wiki = htmlentities($_GET['url_wiki'] ? $_GET['url_wiki'] : $_POST['url_wiki']);
$url_docs= htmlentities($_GET['url_docs'] ? $_GET['url_docs'] : $_POST['url_docs']);
$query = "UPDATE projects SET url_newsgroup = '$url_newsgroup', url_mailinglist = '$url_mailinglist', url_wiki = '$url_wiki', url_docs = '$url_docs' WHERE project_id = '$id'";
$result = mysql_query($query);
echo mysql_error();
?>
<html>
<body>
<h2>Project Edited Successfully</h2>
<a href="projects.php">Return to Projects</a>
</body>
<html>
<?
}
else
{
$query = "Select * from projects where project_id = '$id'";
$result = mysql_query($query);
echo mysql_error();
$dbiterator = mysql_fetch_array($result);
$project_id = $dbiterator["project_id"];
$url_newsgroup = $dbiterator["url_newsgroup"];
$url_mailinglist = $dbiterator["url_mailinglist"];
$url_wiki = $dbiterator["url_wiki"];
$url_docs = $dbiterator["url_docs"];
$catShortName = $dbiterator["category_shortname"];
$description = $dbiterator["description"];
?>
<html>
<body>
<h2>Edit a Project</h2><br/>
<form action="edit_project.php" method="POST">
<table>
<tr>
<td>Project Id :</td>
<td><?=$project_id;?></td>
</tr>
<tr>
<td>Newsgroup URL:</td>
<td>
<input type="text" name="url_newsgroup" value="<?=$url_newsgroup;?>">
</td>
</tr>
<tr>
<td>MailingList URL:</td>
<td>
<input type="text" name="url_mailinglist" value="<?=$url_mailinglist;?>">
</td>
</tr>
<tr>
<td>Wiki URL:</td>
<td>
<input type="text" name="url_wiki" value="<?=$url_wiki;?>">
</td>
</tr>
<tr>
<td>Docs URL:</td>
<td>
<input type="text" name="url_docs" value="<?=$url_docs;?>">
</td>
</tr>
<tr>
<td><input type="hidden" name="id" value="<?=$id;?>"></td>
<td><input type="submit" name="submit" value="Edit Project"/></td>
</tr>
</table>
</form>
</body>
<html>
<? } ?>