blob: 144fde8ad434e8281b5bdd9ca9743f5b9b9c0100 [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
*******************************************************************************/
#*****************************************************************************
#
# categories.php
#
# Author: Nathan Gervais
# Date: Nov 3rd, 2006
#
# Description:
# This page displays the contents of the categories DB.
#****************************************************************************
require_once ("includes/header.php");
$query = "Select * from categories";
$result = mysql_query($query);
echo mysql_error();
?>
<html>
<body>
<h2>Category Database Contents</h2>
<table border="1">
<tr>
<td>Category ID</td>
<td>Category ShortName</td>
<td>Long Description</td>
<td></td>
<td></td>
</tr>
<? while ($dbiterator = mysql_fetch_array($result))
{
$id = $dbiterator["category_id"];
$shortname = $dbiterator["category_shortname"];
$long_desc = $dbiterator["description"];
?>
<tr>
<td><?=$id;?></td>
<td><?=$shortname;?></td>
<td><?=$long_desc;?></td>
<td><a href="edit_category.php?id=<?=$id;?>">Edit</a>
<td><a href="delete_category.php?id=<?=$id;?>">Delete</a>
</tr>
<?
}
?>
</table>
<br/>
<h2>Add a Category</h2><br/>
<form action="add_category.php" method="POST">
<table>
<tr>
<td>Category Shortname :</td>
<td><input name="catShortName" type="text"></td>
</tr>
<tr>
<td>Long Description :</td>
<td>
<textarea name="description" rows="10" cols="50" wrap="off">
</textarea>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Add Category"/></td>
</tr>
</table>
</form>
</body>
</html>