<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/Function_PC.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="loginisok.asp"-->
<%
unav=2
bclassname="会员中心"
%>
<!doctype html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>上传身份证-<%=Dream_SiteName%></title>
<meta name="description" content="<%=Dream_SiteDescription%>">
<meta name="keywords" content="<%=Dream_SiteKeywords%>">
<!--#include file="jscss.asp"-->
<!--#include file="inc/zdsbphone.asp"-->
</head>
<body>
<!--#include file="nheader.asp"-->
<script type="text/javascript">  
function previewImage(file,filenum)  
{  
  var MAXWIDTH  = 300;  
  var MAXHEIGHT = 300;  
  var div = document.getElementById('preview'+filenum);  
  if (file.files && file.files[0])  
  {  
   //div.innerHTML = '<img id=imghead>';  
    var img = document.getElementById('imghead'+filenum);  
    img.onload = function(){
	  //alert(img.offsetWidth);
      var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);  
      img.width = rect.width;  
      img.height = rect.height;  
      img.style.marginLeft = rect.left+'px';  
      img.style.marginTop = rect.top+'px';  
    }  
    var reader = new FileReader();  
    reader.onload = function(evt){img.src = evt.target.result;}  
    reader.readAsDataURL(file.files[0]);  
  }  
}  
function clacImgZoomParam( maxWidth, maxHeight, width, height ){  
    var param = {top:0, left:0, width:width, height:height};  
    if( width>maxWidth || height>maxHeight )  
    {  
        rateWidth = width / maxWidth;  
        rateHeight = height / maxHeight;  
          
        if( rateWidth > rateHeight )  
        {  
            param.width =  maxWidth;  
            param.height = Math.round(height / rateWidth);  
        }else  
        {  
            param.width = Math.round(width / rateHeight);  
            param.height = maxHeight;  
        }  
    }      
    //param.left = Math.round((maxWidth - param.width) / 2);  
    //param.top = Math.round((maxHeight - param.height) / 2);  
    return param;  
} 
</script>
<div class="conment">
	<div class="local">当前位置：<a href="index.asp">首页</a> > <a href="user.asp">会员中心</a> > 实名验证</div>
	<div class="about_nav">
		<h3>会员中心</h3>
		<ul>		
		<!--#include file="usernav.asp"-->
		</ul>		
	</div>
	<div class="about_right">
		<div class="about_right_title"><h3>实名验证</h3><span>注：请按要求上传身份证；图片不要超过2M。</span></div>
		<div class="about_right_con">
			<div class="addcard_sm">认证后的信息诚信度高，为了提高您的成交额，请您尽快认证。</div>
			<div class="edituser">
			<ul>
				<%if Dream_IdentityOk="" or Dream_IdentityOk="未申请" or Dream_IdentityOk="未通过验证" then %>
				<li class="FalseOk"><%=Dream_IdentityOk%></li>
				<%end if%>
				<%if  Dream_IdentityOk="验证中" then %>
				<li class="FalseOk">验证中…</li>
				<%end if%>
				<%if Dream_IdentityOk="通过验证" then %>
				<li class="TrueOk">通过验证</li>
				<%end if%>
				<form name="form1" method="post" action="addcard_ok.asp?action=addcard"  enctype="multipart/form-data">
				<li class="card"><div id="preview0"><img src="images/sfz_1.jpg"><img src="<%if Dream_IdentityCard<>"" then%><%=Dream_IdentityCard%><%else%>images/new_img_09.jpg<%end if%>" id="imghead0"></div><input type="file" capture="camera" accept="image/*" id="imgurl0" name="imgurl0" size="10" style="display:none" onChange="previewImage(this,0)"><div id="imgheadan0">选择<br>图片</div></li>
				<li class="card"><div id="preview1"><img src="images/sfz_2.jpg"><img src="<%if Dream_IdentityCard2<>"" then%><%=Dream_IdentityCard2%><%else%>images/new_img_09.jpg<%end if%>" id="imghead1"></div><input type="file" capture="camera" accept="image/*" id="imgurl1" name="imgurl1" size="10" style="display:none" onChange="previewImage(this,1)"><div id="imgheadan1">选择<br>图片</div></li>
				<input type="hidden" name="p_ceshi">		
				<li class="an"><input name="" type="submit" id="button" value=" 上传 "></li>
				</form>
			</ul>
		</div>
		</div>
	</div>	
</div>
<!--#include file="footer.asp"-->
<script src="js/jquery.js"></script>
<script>
  $('#button').click(function () {
            var imgurl = $('#imgurl').val();	
            if (imgurl.length == 0 ) {
                alert("请先选择图片");
                return false;
            } else {
			alert('修改成功!');
                return true;				
            }
        });
	$(document).ready(function(){    
		/*jquery函数调用方式*/  
		$("#imgheadan0").bind("click", function(e){
			$("#imgurl0").click();
		});
		$("#imgheadan1").bind("click", function(e){
			$("#imgurl1").click();
		});
	})
</script>
</body>
</html>