<!--#include file="../../../inc/cms_admin.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="<%=sitepath%>css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="<%=sitepath%>css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="<%=sitepath%>js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<link href="<%=sitepath%>css/animate.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/style.min.css?v=4.1.0" rel="stylesheet">
</head>
<%
dim act,action,uid,face
action=getForm("action","get")
act=getForm("act","get")
uid=isnum(getForm("uid","both"))
face=getForm("face","both")
if act="addface" then
	script("parent.$('#parentIframe img').attr('src','"&sitepath&"images/face/"&face&"');parent.$('#parentIframe #face').val('"&face&"');parent.layer.closeAll();")
elseif act="saveface" then
	if isnul(uid) then back("用户id为空")
	dbconn "update [dbpre]user set face='"&face&"' where UID="&uid	
	if cint(uid)=getsession("adminid") then 		
		setcookie "adminface",face
		script("parent.location.reload();")
	else
		aspgo("User_Edit.asp?UID="&uid)
	end if
end if
%>
<body class="gray-bg">
<div class="wrapper wrapper-content">
  <div class="ibox float-e-margins">
    <div class="row m-t">
      <form method="post" action="?act=<%=action%>&uid=<%=uid%>">
        <div class="col-sm-12">
          <div class="ibox float-e-margins"> 
            <div class="ibox-title">
              <h5>修改头像</h5>
              <span>（头像文件夹在/images/face/,直接将头像放到此目录即可选择）</span>
            </div>
        
            <div class="ibox-content p-md">
            <div class="row">
              <%
	dim path,fileListArray,i,fileAttr,folderListArray,folderAttr,parentPath
	path=sitePath&"images/face/"
	if not isfolder(path) then	
		response.end
	end if
	fileListArray= getFileList(path)
	if instr(fileListArray(0),",")>0 then	
		for  i = 0 to ubound(fileListArray)
			dim selectedstr:selectedstr=""
			fileAttr=split(fileListArray(i),",")
			if face=fileAttr(0) then selectedstr="checked"
			echo "<div class='txxg'><label><img src="""&path&fileAttr(0)&"""><br>"
			echo "<input type='radio' name='face' value='"&fileAttr(0)&"'  "&selectedstr&">设为头像</label></div>"
		next		
	end if	
%>
            </div> </div>
          </div>
        </div>
      
        
            <div class="col-sm-12">  
            <div class="ibox-content p-md">
              <div class="row">
              <button class="btn btn-primary" type="submit">保存头像</button>
              <button onClick="location.reload()" class="btn btn-primary1" type="button"><i class="fa fa-refresh"></i> 刷新</button>
              <button onClick="closelayer()" class="btn btn-primary1" type="button"><i class="fa fa-reply"></i> 关闭</button>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
</div>
<script src="<%=sitepath%>js/jquery.min.js?v=2.1.4"></script> 
<script src="<%=sitepath%>js/bootstrap.min.js?v=3.3.6"></script> 
<script src="<%=sitepath%>js/plugins/peity/jquery.peity.min.js"></script> 
<script src="<%=sitepath%>js/content.min.js?v=1.0.0"></script> 
<script src="<%=sitepath%>js/plugins/fancybox/jquery.fancybox.js"></script>
<script src="<%=sitepath%>plugins/layer/layer.min.js"></script>
<script src="<%=sitepath&adminPath%>js/adminjs.js"></script>
</body>
</html>