<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>文件上传</title>
<base href="{SITE_URL}" />
<link href="admin/skin/system.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="data/config.js"></script>
<script type="text/javaScript" src="images/js/jquery.min.js"></script>
<script language="JavaScript" src="images/js/css.js"></script>
<script type="text/javaScript" src="images/js/common.js"></script>
</head><body>
<script type="text/javascript">
function doCheck() 
{
	if(upload.{$uploadtext}.value == '') {
		alert('请选择文件!');
		return false;
	}
	return true;
}

function previewimage()
{
	if(upload.{$uploadtext}.value) $("#previewpic").attr("src", upload.{$uploadtext}.value);
}
</script>
<form name="upload" method="post" action="upload_field.php" enctype="multipart/form-data" onSubmit="return doCheck();">
<table cellpadding="2" cellspacing="1" class="table_form">
  <caption>图片上传</caption>
  <tr>
     <td height="30">
	         <input type="hidden" name="modelid" value="{$modelid}">
			 <input type="hidden" name="catid" value="{$catid}">
	         <input type="hidden" name="fieldid" value="{$fieldid}">
             <input name="{$uploadtext}" type="file" size="15" onChange="previewimage()">
             <input type="hidden" name="oldname">
             <input type="hidden" name="uploadtext" value="{$uploadtext}">
             <input type="hidden" name="rename" value="{$rename}">
             <input type="hidden" name="MAX_FILE_SIZE" value="{$upload_maxsize}"> 
             <input type="submit" name="dosubmit" value=" 上传 ">
			 </td>
   </tr>
  <tr>
     <td height="30">
	 允许上传类型：{$upload_allowext}<br />
	 允许上传大小：{$upload_maxsize}<br />
	 缩略图大小：宽 <input type="text" name="width" value="{$thumb_width}" size="3"> px，高 <input type="text" name="height" value="{$thumb_height}" size="3"> px
	 </td>
   </tr>
  <tr>
     <td>
<img id="previewpic" onload="setpicWH(this,300,300)" src="images/nopic.gif">
<script type="text/javascript">
if(window.opener.myform.{$uploadtext}.value)
{
	$("#previewpic").attr("src", window.opener.myform.{$uploadtext}.value); 
}
else
{
	$("#previewpic").attr("src","images/nopic.gif"); 
}
</script>
			 </td>
   </tr>
</table>
</form>

</body>
</html>