?? upload_append_img.jsp
字號:
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../../include.jsp"%>
<html>
<head>
<base target="top">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加商品附加圖片</title>
<%
if ( request.getMethod().equalsIgnoreCase("post") )
{
String name = productMgr.uploadImg(pageContext);
out.println("<script>");
if ( name.indexOf(".") > 0)
{
productMgr.setProductAppendImgFromSession(session,name);
}
else
{
out.println("alert('" + name + "')");
}
out.println("</script>");
}
%>
<script>
function checkF(theForm)
{
if (theForm.file.value=="")
{
alert("請選擇圖片");
return(false);
}
return(true);
}
function del()
{
if ( confirm("確認刪除嗎?") )
{
return(true);
}
else
{
return(false);
}
}
function save()
{
var pai = "<%=productMgr.getProductAppendImgFromSession(session)%>";
var tmpA = pai.split(",");
var resultStr = "";
for (i=0; i<tmpA.length; i++)
{
if ( tmpA[i]!="" )
{
resultStr += "<input type=hidden name=product_append_img value="+tmpA[i]+">";
}
}
opener.document.getElementById("product_append_img_span").innerHTML = resultStr;
}
</script>
<link href="../../style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="eeeeee" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<form action="" method="post" enctype="multipart/form-data" name="form1" onsubmit="return checkF(this)" target="_self">
<tr>
<td colspan="2" bgcolor="#FFFFFF">
<%
String productAppendImg[] = productMgr.getProductAppendImgArrayFromSession(session);
for (int i=0; i<productAppendImg.length; i++)
{
if ( productAppendImg[i].equals("") )
{
continue;
}
%>
<DIV style="FLOAT: left;width:115px; TEXT-ALIGN: center;">
<DIV class="impc"><img src="<%=ConfigBean.getStringValue("systenFolder")%>.<%=ConfigBean.getStringValue("upload_pro_img")+productAppendImg[i]%>" width="75" height="75"></div>
<DIV class="impc"><a onClick="return del()" target="_self" href="<%=ConfigBean.getStringValue("systenFolder")%>appController/delProductAppendImgByName?name=<%=productAppendImg[i]%>"><font color="#FF0000">刪除</font></a></div>
</div>
<%
}
%>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="50%" style="padding-left:5px;padding-bottom:10px;"><input type="file" name="file">
<input type="submit" name="Submit" value=" 上 傳 "></td>
<td width="50%" align="center" style="padding-left:5px;padding-bottom:10px;"><input type="button" name="Submit2" value=" 添加到商品 " onClick="save();window.close();">
</td>
</tr>
</form>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -