blob: ab3a0ecb0ee16826cd9c7fc31507bbddd6e25c7b [file]
<?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
*******************************************************************************/
#*****************************************************************************
#
# member_management.php
#
# Author: Nathan Gervais
# Date: Feb 6th, 2007
#
# Description:
# Management page for members, displays a list of members, allows for adds, edits , removals.
#****************************************************************************
include('scripts/common.php');
include('scripts/header.php');
if ($_POST['submit'])
{
$id = $_POST['ProductID'];
$orgID = $_POST['OrgID'];
$productName = $_POST['productName'];
$productDesc = $_POST['description'];
$productURL = $_POST['productURL'];
$query = "UPDATE OrganizationProducts set name = '$productName', product_url = '$productURL', description = '$productDesc' where ProductID = $id";
debugEcho ($productDesc);
mysql_query($query);
?>
Product Updated Successfully!</br>
<a href="product_management.php?id=<?=$orgID;?>">Return to Product Management</a>
<?
}
else
{
$_input_id = $_GET['id'];
$query = "SELECT OrganizationID, name, description, product_url FROM OrganizationProducts where ProductID = $_input_id";
$result = mysql_query($query);
$productIterator = mysql_fetch_array($result);
$orgID = $productIterator['OrganizationID'];
$productName = $productIterator['name'];
$productDesc = $productIterator['description'];
$productURL = $productIterator['product_url'];
?>
<h2>Edit a Product</h2>
<form action="<?=$_SERVER['PHP_SELF'];?>" method="POST">
<input type="hidden" name="ProductID" value="<?=$_input_id;?>">
<input type="hidden" name="OrgID" value="<?=$orgID;?>">
<table>
<tr>
<td>Product Name :</td>
<td><input name="productName" type="text" value="<?=$productName;?>" size="80"/></td>
</tr>
<tr>
<td>Product URL :</td>
<td><input name="productURL" type="text" value="<?=$productURL;?>" size="80"/></td>
</tr>
<tr>
<td>Description :</td>
<td><textarea name="description" cols="60" rows="10"><?=$productDesc;?></textarea></td>
<tr/>
<tr>
<td></td>
<td><input name="submit" value="Update Product" type="submit"/></td>
</tr>
</table>
</form>
<?
}
include('scripts/footer.php');
?>