| <?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 |
| *******************************************************************************/ |
| |
| #***************************************************************************** |
| # |
| # edit_tag.php |
| # |
| # Author: Nathan |
| # Date: February 6, 2007 |
| # |
| # Description: |
| # Remove a tag! |
| #**************************************************************************** |
| include('scripts/common.php'); |
| include('scripts/header.php'); |
| if ($_POST['submit']) |
| { |
| $id = $_POST['tagID']; |
| |
| $query = "delete from TagNames where TagID = $id"; |
| mysql_query($query); |
| $relationshipQuery = "delete from OrganizationTags where TagID = $id"; |
| mysql_query($relationshipQuery); |
| ?> |
| Tag Removed Successfully<br/> |
| <a href="tags_management.php">Return to Tags Management</a> |
| <? |
| |
| } |
| else |
| { |
| $_input_id = $_GET['id']; |
| $query = "select * from TagNames where TagID = $_input_id"; |
| $result = mysql_query($query); |
| $tagIterator = mysql_fetch_array($result); |
| $id = $tagIterator['TagID']; |
| $tagName = $tagIterator['tag_name']; |
| |
| $relationshipQuery = "SELECT ORG.name1, ORGTAG.OrganizationID from OrganizationTags as ORGTAG INNER JOIN organizations as ORG on ORGTAG.OrganizationID = ORG.organization_id WHERE ORGTAG.TagID = $id ORDER by ORG.name1"; |
| $relationshipResult = mysql_query($relationshipQuery); |
| while ($relationshipIterator = mysql_fetch_array($relationshipResult)) |
| { |
| $orgName = $relationshipIterator['name1']; |
| $existingRelationships .= $orgName . "<br/>"; |
| } |
| ?> |
| <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> |
| <table> |
| <tr> |
| <td>Tag ID:</td> |
| <td><input type="hidden" name="tagID" value="<?=$id;?>"><?=$id;?></td> |
| </tr> |
| <tr> |
| <td>Tag Name:</td> |
| <td><?=$tagName;?></td> |
| </tr> |
| <tr> |
| <td colspan=2><br/>This Tag has existing relationships with:<br/><b><?=$existingRelationships;?></b><br/>These relationships will be removed if you confirm.</td> |
| </tr> |
| <tr> |
| <td></td> |
| <td><input type="submit" value="Remove Tag" name="submit"></td> |
| </tr> |
| </table> |
| </form> |
| <? |
| } |
| include('scripts/footer.php'); |
| ?> |