<?php
	session_start();
	//执行上传文件的
	$stritemno = trim($_REQUEST['itmno']);
?>

<html>
<head>
	<meta http-quive="content-type" content="text/html;charset=gb2312" ></meta>
	<link rel="stylesheet" href="css/mycss.css"> 
	<script src="jsp4/jquery.js"></script>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#44444">
		
		<tr>
			<td height="20" width="15"></td>
			<td height="20" align="left"></td>
			<td height="20" width="15"></td>
		</tr>
		
		<tr>
			<td height="15" width="15"></td>
			<td height="15" align="center">
				
				
					<div  align="center"  style="width:90px;height:30px;border-radius:4px; background-color:#D7AA28;">	
						<label class="ui_button ui_button_primary" for="xFile">
							<div align="center"  style="width:90px;height:28px; padding-top:4px; border-radius:4px;">		
							<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">选择图片</span> 
							</div>
						</label>
					</div>
				
			</td>
			<td height="15" width="15"></td>
		</tr>
		
		<tr>
			<td height="20" width="15"></td>
			<td height="20" align="left"></td>
			<td height="20" width="15"></td>
		</tr>
		
		<tr>
			<td height="15" width="15"></td>
			<td height="15" align="center">
				<form action="Fileupload.php?itmno=<?php echo $stritemno;?>" method="post" enctype="multipart/form-data">
					<input type="file" name="pic[]" id="xFile" accept="image/*" style="position:absolute;clip:rect(0 0 0 0);" onchange="myView()">
					<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
					
					<div  align="center"  style="width:90px;height:30px;border-radius:4px; background-color:#D7AA28;">	
						<label class="ui_button ui_button_primary" for="xSub">
							<div  align="center"  style="width:90px;height:28px; padding-top:4px; border-radius:4px;">		
							<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">上传图片</span> 
							</div>
						</label>
					</div>
					
					<input type="submit" name="sub" id="xSub" value="上传图片" hidden >
				</form>		
			</td>
			<td height="15" width="15"></td>
		</tr>
		
		<tr>
			<td height="20" width="15"></td>
			<td height="20" align="left"></td>
			<td height="20" width="15"></td>
		</tr>
		
		<tr>
			<td height="15" width="15"></td>
			<td height="15" align="center">
				<img src="" id='show'>
			</td>
			<td height="15" width="15"></td>
		</tr>
		
		<tr>
			<td height="20" width="15"></td>
			<td height="20" align="left"></td>
			<td height="20" width="15"></td>
		</tr>
	</table>
	 
	<script type="text/javascript">
		function myView() 
		{
			var r= new FileReader();
			f=document.getElementById('xFile').files[0];
			r.readAsDataURL(f);
			r.onload=function  (e) 
			{
				document.getElementById('show').src=this.result;
			};
		}
	</script>	
    
		
	
	
 </body>
 
</html>