| <?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: |
| # Edit a tag! |
| #**************************************************************************** |
| include('scripts/common.php'); |
| include('scripts/header.php'); |
| |
| |
| if ($_POST['submit']) |
| { |
| $id = $_POST['organizationID']; |
| $companyURL = $_POST['companyURL']; |
| $shortDesc = $_POST['shortDesc']; |
| $longDesc = $_POST['longDesc']; |
| $smallLogoUpdate = $largeLogoUpdate = 0; |
| |
| if (is_uploaded_file($_FILES['smallLogo']['tmp_name'])) |
| { |
| if ($_FILES['smallLogo']['size'] < 100000) |
| { |
| $smallLogoUpdate = 1; |
| $smallImgData = addslashes (file_get_contents($_FILES['smallLogo']['tmp_name'])); |
| $smallSize = getimagesize($_FILES['smallLogo']['tmp_name']); |
| $smallMime = $smallSize['mime']; |
| } |
| } |
| if (is_uploaded_file($_FILES['largeLogo']['tmp_name'])) |
| { |
| if ($_FILES['largeLogo']['size'] < 100000) |
| { |
| $largeLogoUpdate = 1; |
| $largeImgData = addslashes (file_get_contents($_FILES['largeLogo']['tmp_name'])); |
| $largeSize = getimagesize($_FILES['largeLogo']['tmp_name']); |
| $largeMime = $largeSize['mime']; |
| } |
| } |
| |
| $query = "Update OrganizationInformation set short_description = '$shortDesc', long_description='$longDesc', company_url = '$companyURL'"; |
| if ($smallLogoUpdate) |
| { |
| $query .= ",small_mime = '$smallMime', small_logo = '$smallImgData'"; |
| } |
| if ($largeLogoUpdate) |
| { |
| $query .= ", large_mime = '$largeMime', large_logo = '$largeImgData'"; |
| } |
| $query .= " WHERE OrganizationID = $id"; |
| |
| mysql_query($query) or die(mysql_error()); |
| //echo $query; |
| echo "Organization Updated successfully!<br/><a href=\"member_management.php\">Return to Member Management</a>"; |
| } |
| else |
| { |
| $_input_id = $_GET['id']; |
| $query = "select OI.*, ORG.name1 from OrganizationInformation as OI INNER JOIN organizations as ORG on OI.OrganizationID = ORG.organization_id where OrganizationID = $_input_id"; |
| $result = mysql_query($query); |
| $orgIterator = mysql_fetch_array($result); |
| |
| $id = $orgIterator['OrganizationID']; |
| $shortDesc = $orgIterator['short_description']; |
| $longDesc = $orgIterator['long_description']; |
| $companyURL = $orgIterator['company_url']; |
| $smallMime = $orgIterator['small_mime']; |
| $smallLogo = $orgIterator['small_logo']; |
| $largeMime = $orgIterator['large_mime']; |
| $largeLogo = $orgIterator['large_logo']; |
| $orgName = $orgIterator['name1']; |
| ?> |
| <form enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> |
| <table> |
| <tr> |
| <td>Organization ID:</td> |
| <td><input type="hidden" name="organizationID" value="<?=$id;?>"><?=$id;?></td> |
| </tr> |
| <tr> |
| <td>Organization Name:</td> |
| <td><?=$orgName;?></td> |
| </tr> |
| <tr> |
| <td>Company URL</td> |
| <td><input type="text" name="companyURL" value="<?=$companyURL;?>" size="80"/></td> |
| </tr> |
| <td>Short Description</td> |
| <td><textarea name="shortDesc" id="shortDesc" cols="60" rows="5" onkeyup="CheckFieldLength(shortDesc, 'myCounter', 180);" onkeydown="CheckFieldLength(shortDesc, 'myCounter', 180);" onmouseout="CheckFieldLength(shortDesc, 'myCounter', 180);" maxLength="180"><?=$shortDesc;?></textarea> |
| <br/>You have <B><SPAN id=myCounter></SPAN></B> characters remaining for your short description...</font></td> |
| </tr> |
| <tr> |
| <td>Long Description</td> |
| <td><textarea name="longDesc" cols="60" rows="10"><?=$longDesc;?></textarea></td> |
| </tr> |
| <tr> |
| <td>Small Logo</td> |
| <td><img src="scripts/get_image.php?id=<?=$id;?>&size=small"><br/><input name="smallLogo" type="file"/></td> |
| </tr> |
| <tr> |
| <td>Small Mime Type</td> |
| <td><?=$smallMime;?></td> |
| </tr> |
| <tr> |
| <td>Large Logo</td> |
| <td><img src="scripts/get_image.php?id=<?=$id;?>&size=large"><br/><input name="largeLogo" type="file"/></td> |
| </tr> |
| <tr> |
| <td>Large Mime Type</td> |
| <td><?=$largeMime;?></td> |
| </tr> |
| <tr> |
| <td></td> |
| <td><input type="submit" name="submit" value="Update Member"></td> |
| </tr> |
| </table> |
| </form> |
| <? |
| } |
| include('scripts/footer.php'); |
| ?> |