📄 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">
<script src="<%=ConfigBean.getStringValue("systenFolder")%>alert_js.jsp"></script>
<title>添加商品附加图片</title>
<%
if ( request.getMethod().equalsIgnoreCase("post") )
{
String name = productMgr.uploadImg(request);
String imgPath = "/"+ConfigBean.getStringValue("upload_pro_img");
out.println("<script>");
if ( name.indexOf(".") > 0)
{
productMgr.setProductAppendImgFromSession(session,name);
productMgr.createWaterMark(imgPath+name,imgPath+"watermark.gif",imgPath+name);
}
else
{
out.println("alert('" + name + "')");
}
out.println("</script>");
}
%>
<script>
function checkF(theForm)
{
if (theForm.file.value=="")
{
alert("请选择图片");
return(false);
}
else if (theForm.file.value.indexOf("jpg")==-1&&theForm.file.value.indexOf("jpeg")==-1)
{
alert("只能上传JPG或JPEG格式图片");
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="../comm.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
-->
</style></head>
<body 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" class="WarningMsg">修改后,请按“确定” 按钮</td>
</tr>
<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="59%" style="padding-left:5px;padding-bottom:10px;"><input type="file" name="file" >
<input name="Submit" type="submit" class="short-button" value=" 上 传 "></td>
<td width="41%" align="center" style="padding-left:5px;padding-bottom:10px;"><input name="Submit22" type="button" class="short-button" onClick="window.close();" value=" 关闭 ">
<input name="Submit2" type="button" class="short-button" onClick="save();window.close();" value=" 确定 "> </td>
</tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -