| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/innoutstorage/webadmin/ |
Upload File : |
<?php require_once ("check_login.php"); ?>
<!DOCTYPE html>
<html>
<head>
<?php require_once("html_head.php"); ?>
<script type="text/javascript">
function DeleteRowImage(proimgid, productid, sort) {
if (confirm("Are you sure you want to delete?")) {
window.location.href = 'product_image_delete.php?proimgid=' + proimgid + '&productid=' + productid + '&sort=' + sort;
}
}
</script>
<script type="text/JavaScript">
function MM_jumpMenu(targ, selObj, restore) { //v3.0
eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
if (restore) selObj.selectedIndex = 0;
}
</script>
</head>
<body>
<table width="1000" height="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" align="left" valign="top">
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="70" align="left" valign="middle"> </td>
</tr>
<tr>
<td width="200" align="left" valign="top"><!-- Main Menu -->
<?php require("menu.php");?><!-- End Main Menu --></td>
</tr>
</table>
</td>
<td width="800" align="left" valign="top">
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="70" class="pagetitletxt"> </td>
<td width="50" align="center" class="icontxt">
<a href="product_image_addform.php?productid=<?=$_GET["productid"]; ?>"><img src="images/iconNew.png" alt="Add" width="32" height="32" border="0"/><br/> 新增
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="pagetitletxt">
<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/> 產品圖片</b></td>
</tr>
<tr>
<td height="25" align="left" valign="middle" class="msg"><?php if (!empty($_GET["msg"])) echo $_GET['msg']; ?></td>
</tr>
<tr>
<td height="35" align="left" valign="middle" class="content"> <strong>產品名稱</strong>
<select name="productid" onChange="MM_jumpMenu('self',this,0)">
<?php
$sql = "SELECT * FROM product WHERE deleted = ? ORDER BY code ASC ";
$parameters = array("0");
$row_array = bind_pdo($sql, $parameters, "selectall");
foreach ($row_array as $row) {
echo "<option value='product_image_index.php?productid=" . $row{'id'} . "' " . getSelect($_GET["productid"], $row{'id'}) . " >" .$row{'name_tc'}." (". $row{'code'} .")". "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td align="left" valign="middle">
<form name="form1" method="post" action="product_image_sort_update.php">
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" class="listtitletxt"></td>
<td width="40" class="listtitletxt">排序</td>
<td width="300" class="listtitletxt">圖片</td>
<td width="300" class="listtitletxt"></td>
<td width="20" class="listtitletxt"></td>
<td width="20" class="listtitletxt"></td>
</tr>
<?php
if (!empty($_GET["productid"])) {
$sql = "SELECT * FROM pro_image WHERE productid = ? AND deleted = ? ORDER BY sort ASC ";
$parameters = array($_GET["productid"], 0);
} else {
exit;
}
$row_array = bind_pdo($sql, $parameters, "selectall");
foreach ($row_array as $row) {
print "<tr>";
print "<td class='listtxt' style='padding-left:5'> </td>";
print "<td class='listtxt' valign='middle' align='left'><input class='sortinput' type='text' name='idarraynumber[]' value='" . $row{'sort'} . "' size='2' /><input type='hidden' name='idarray[]' value='" . $row{'proimgid'} . "'><input type='hidden' name='productid' value='" . $row{'productid'} . "'></td>";
print "<td class='listtxt' style='padding-left:5'><img src='../images/product_images/thumb/" . $row{'photo'} . "' height='140' border='0' style='max-width:300px;'></td>";
print "<td class='listtxt' style='padding-left:5'>";
list($width, $height, $type, $attr) = getimagesize("../images/product_images/thumb/" . $row{'photo'} . "");
echo "Image width " . $width;
echo "<BR>";
echo "Image height " . $height;
echo "<BR>";
echo "Image type " . $type;
echo "<BR>";
echo "Attribute " . $attr;
echo "<BR><BR>";
echo "Title: " . $row{"photo_title"};
print "</td>";
// Delete
print "<td class='listtxt' align='center'><a href='#' onClick=\"DeleteRowImage(" . $row{'proimgid'} . ", " . $row{'productid'} . ", " . $row{'sort'} . ")\"><img src='images/btnDelete.png' title='Delete' alt='Delete' hspace='2' border='0'></a></td>";
print "<td class='listtxt' style='padding-left:5'> </td>";
print "</tr>";
}
$dbh = null;
?>
</table>
<input type="submit" value="更新排序">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
function getSelect($field1, $field2)
{
if ($field1 == $field2) {
return "selected";
} else {
return "";
}
}
?>