<%On Error Resume Next%>
<!--#include file="conn.asp"-->
<!--#include file="chk_logs.asp"-->
<%
id=replace(request("id"),"'","")
lb=replace(request("lb"),"'","")
'response.Write lb
'response.End()
if request.QueryString("action")="save" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from product where id="&id,conn,1,3
rs("width")=trim(request("picwidth"))
rs("height")=trim(request("picheight"))
rs.update
rs.close
response.Redirect "product.asp?lb="&lb
end if
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	font-size: 12pt;
	font-weight: bold;
	color: #FF0000;
}
.STYLE2 {font-size: 12px}
.STYLE3 {font-family: "宋体"}
.STYLE4 {font-size: 12px; font-family: "宋体"; }
-->
</style>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
//缩放对象. 调用方式: zoomObj(this)
function zoomObj(o)
{
var zoom = parseInt(o.style.zoom, 10)||100;
zoom += event.wheelDelta/12;
if (zoom>0)
{
o.style.zoom=zoom+'%';
}
return false;
}

var iOriginalWidth, iOriginalHeight; //存放图片原始长度、宽度

//动态显示图片的长度、宽度和显示比例
function dispCurrentSize()
{
var zoom = document.all.idImg.style.zoom;
zoom = eval(zoom.substring(0, zoom.length-1));
var iWidth = zoom * document.all.idImg.width;
var iHeight = zoom * document.all.idImg.height;
document.all.idPicCurrentSize.innerHTML = "图片当前大小 长：" + Math.ceil(iWidth/100) + " 高：" + Math.ceil(iHeight/100) + "　　显示比例：" + Math.ceil((iWidth / iOriginalWidth)) + "%";
}

//显示图片原始长度、宽度
function dispOriginalSize(oImg)
{
iOriginalWidth = oImg.width;
iOriginalHeight = oImg.height;
document.all.idPicOriginalSize.innerHTML = "图片原始大小 长：" + iOriginalWidth + " 高：" + iOriginalHeight;
document.all.idImg.style.zoom = "100%";
document.form2.picwidth.value=iOriginalWidth;
document.form2.picheight.value=iOriginalHeight;
dispCurrentSize();
}
var a,b
a=iOriginalWidth
b=iOriginalHeight

//-->
</SCRIPT>
<body onLoad="document.form2.picwidth.value=iOriginalWidth;document.form2.picheight.value=iOriginalHeight;">
<%
'response.Write id
'response.End()
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from product where id="&id,conn,1,1
%>
<table class="tableBorder" width="95%" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr> 
<td valign="top"> 
<form name="form2" method="post" action="chicun.asp?action=save&id=<%=id%>&lb=<%=lb%>" OnSubmit="return checkdata()" onReset="return ResetForm();">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="#E8F1FF">
            <td colspan="2" align="center" bgcolor="#E8F1FF"><P class="STYLE1">图片尺寸大小存储</td>
          </tr>
		  <tr bgcolor="#E8F1FF">
            <td width="30%" align="right" bgcolor="#E8F1FF"><span class="STYLE3 STYLE2">图片</span><span class="STYLE4">预览：</span></td>
             <td class="GrayText STYLE2 STYLE3">
			<img src="<%=rs("xtp")%>" border="0" ID="idImg" onLoad="dispOriginalSize(this);" onMouseWheel="zoomObj(this);dispCurrentSize();">
			<div ID="idPicOriginalSize"></div><P><P>
            <div ID="idPicCurrentSize"></div><P><P>
<input type="hidden" name="picwidth" id="picwidth">
<input type="hidden" name="picheight" id="picheight">
</td>
</tr>
<tr>
<td align="right" bgcolor="#E8F1FF"></td> 
<td height="30" bgcolor="#E8F1FF" style="PADDING-LEFT: 10px">
<input type="submit" name="rulesubmit" value="尺寸保存"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script language="javascript">
var secs = 4;
var wait = secs * 1200;
document.form2.rulesubmit.value = "确认提交(" + secs + ")";
for(i = 1; i <= secs; i++) {
        window.setTimeout("update(" + i + ")", i * 1200);
}
window.setTimeout("timer()", wait);
function update(num, value) {
        if(num == (wait/1200)) {
                document.form2.rulesubmit.value = "提交";
        } else {
                printnr = (wait / 1200)-num;
                document.form2.rulesubmit.value = "提交(" + printnr + ")";
        }
}
function timer() {
        form2.submit();
}
</script>
</body>
</html>


