<script type="text/javascript">
$(document).ready(function(){
	var imgs;
	$("#upp{$uid}").click(function(){
		$.messager.progress();
		$("#selectPIC{$uid}").form('submit',{
			url:'__APP__?g=<?php echo GROUP_NAME; ?>&m=<?php echo MODULE_NAME; ?>&a=pic&act=1',
			onSubmit: function(){
				var isValid = $(this).form('validate');
				if (!isValid){
					$.messager.progress('close');
				}
				return isValid;
			},
			success:function(data){
				$.messager.progress('close');
				if(data==-1){
					$.messager.alert('提示','照片上传失败！','warning');
				}if(data==-5){
					$.messager.alert('提示','您没有上传权限！','warning');
				}else{
					$("#sp{$uid}").html("<img src='__ITEM__/{$upload}/Face/"+data+"' style='max-width:494px; max-height:270px;' />");
					$("#hi{$uid}").val(data);
					imgs = data;
				}	
			}
		});
	});
	
	$("#suup{$uid}").click(function(){
		var isimg = $("#sp{$uid} img").length;
		if(isimg){
			$("#seleImg{$uid}").attr("src","__ITEM__/{$upload}/Face/"+imgs);
			$("#hidImg{$uid}").val(imgs);
		}
		$("#upImg{$uid}").dialog('close');
	});
});
</script>

<div class="con-tb">
<form id="selectPIC{$uid}" method="post" enctype="multipart/form-data">
 <table class="infobox" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <div class="in">
        <span><input type="text" id="txt" name="txt" /></span>
        <span><input id="ii" type="button" value="选择文件" /></span>
        <span><input type="file" id="upID" name="up" onchange="txt.value=this.value" class="file" /><input name="MAX_FILE_SIZE" type="hidden" value="{$TC.config.UPLOAD_SIZE}" /></span>
       &nbsp;<input style="height:22px; width:60px; margin-top:2px; border-color:#036" class="a-but" id="upp{$uid}" type="button" value="上传" /></a>
      </div>   </td>
    </tr>
  <tr>
    <td id="wwww">图片格式：<span class="up-font">'jpg'，'gif'，'png'</span> &nbsp; 大小：小于<span class="up-font">512kb</span></td>
   </tr>
  <tr>
    <td>
     <div id="sp{$uid}"></div><input name="hi{$uid}" id="hi" type="hidden" value="" />
    </td>
   </tr>
  <tr>
    <td height="38" align="center">
      <a href="#" id="suup{$uid}" class="easyui-linkbutton" data-options="">确定</a></td>
  </tr>
 </table>
</form>
</div>