File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/old-myadmin/ImageGallery/modify.php
<?php
if (!defined('WEB_ROOT')) {
exit;
}
if (isset($_GET['Id']) && $_GET['Id'] > 0) {
$bId = $_GET['Id'];
} else {
header('Location: index.php');
}
// get product info
$sql = "SELECT * FROM imagegallery WHERE img_id = $bId";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
extract($row);
// get category list
?>
<div id="ptitle">:: Image Gallery >> Modify </div>
<form action="processImage.php?action=modify&Id=<?php echo $bId; ?>" method="post" enctype="multipart/form-data" name="frmModifyImageGallery" id="frmModifyImageGallery">
<p align="center" class="formTitle"><h2>Modify Image Gallery</h2> </p>
<script type="text/javascript">
<!--
function mySelect() {
var w = document.frmModifyImageGallery.selImgCat.selectedIndex;
var myval = document.getElementById('selImgCat').value;
if (myval =="Select" || myval =="" ){
document.getElementById('imgCat').value ="Please Select Category";
}else {
document.getElementById('imgCat').value = document.frmModifyImageGallery.selImgCat.options[w].text;
document.getElementById('texCatID').value = w;
}
}
//-->
</script>
<table border="0" cellspacing="2" id="table1" >
<tr>
<td>Category </td>
<td colspan="2">
<?php
$sql1 = "SELECT * FROM image_category WHERE category_id=$img_cat_id";
$result1 = dbQuery($sql1);
$row1 = dbFetchAssoc($result1);
$catName = $row1['category_name'];
?>
<input name="texCatID" id="texCatID" type="hidden" value="<?php echo $img_cat_id; ?>" />
<input type="text" name="imgCat" id="imgCat" size="30" value="<?php echo $catName; ?>" onblur="mySelect()" readonly="readonly">
OR Select <select name="selImgCat" id="selImgCat" onchange="mySelect()">
<option value="Select">Select Image Category</option>
<?php
$sql = "SELECT * FROM image_category";
$result = dbQuery($sql);
while($row = dbFetchAssoc($result)) {
extract($row);
echo '<option value="'.$category_id.'">'.$category_name. '</option>';
}
?>
</select> </td>
</tr>
<tr>
<td>Image Title</td>
<td><input type="text" name="img_title" size="80" value="<?php echo $img_title; ?>"></td>
<td></td>
</tr>
<tr>
<td>Image 1</td>
<td><input type="file" name="img_file" size="65"></td>
<td>
<?php
if ($img_thumb != '') {
?>
<br>
<img src="<?php echo WEB_ROOT . THUMB_IMAGE_DIR . $img_thumb; ?>"> <a href="javascript:deleteImage(<?php echo $img_id; ?>);">Delete
Image</a>
<?php
}
?>
</td>
</tr>
</table>
<p align="center">
<input name="btnModifyBanner" type="submit" id="btnModifyBanner" value="Modify Banner" onClick="checkAddBannerForm();" class="box">
<input name="btnCancel" type="button" id="btnCancel" value="Cancel" onClick="window.location.href='index.php';" class="box">
</p>
</form>