<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/const.jsp" -->
<!--#include file="../Include/char.jsp" -->
<!--#include file="../Include/upload_club.inc"-->
<!--#include file="IsLogin.jsp" -->
<%
 m_ID = Request.Cookies("aspxnet")("CurUserID")
 m_username= Request.Cookies("aspxnet")("CurUsername")
  filepath="ClubImages/"  '小圈子的图片位置
  
if Request.ServerVariables("REQUEST_METHOD")="POST" then    '获取修改区分


dim upload,file,formName,formPath,iCount,filename,fileExt,i
set upload=new upload_5xSoft '建立上传对象

formPath=upload.form("filepath")
'uid=session("y_ephoto_username")
'ifshare=upload.form("ifshare")
m_name=upload.form("name")
'm_manage=upload.form("manage")
m_content=upload.form("content")
m_area=upload.form("area")
f_id=cint(session("f_club_id"))
m_edit=upload.form("p_edit")
 if f_id="" or IsNumeric(f_id)=false then
 Call Msgbox("对不起，ID号错误！",1)
 Response.end
 end if
 
 
 if m_edit="true" then
'在目录后加(/)


if right(formPath,1)<>"/" then formPath=formPath&"/" 
iCount=0

for each formName in upload.file '列出所有上传了的文件
    set file=upload.file(formName)  '生成一个文件对象
  next  
    if file.filesize<0 then
        Call Msgbox("对不起，参数不足错误！",1)
        response.end
    end if

 
    if file.filesize>100000 then
        response.write ("<script language=JavaScript>alert('错误：您上传子俱乐部的照片大小已超过100k！');history.go(-1);</script>")
        response.end
    end if

    fileExt=lcase(right(file.filename,4))
    if fileEXT<>".gif" and fileEXT<>".jpg" and fileEXT<>".png" then
    response.write ("<script language=JavaScript>alert('错误：请检查您上传子俱乐部的照片的格式/JPG/GIG/PNG/！');history.go(-1);</script>")
    response.end
    end if 

    filenamett=file.FileName
	m_rnd=cint(((hour(now)*second(now))*rnd(5))+574)
  '  filenamett=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&file.FileName
	filenamett=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&clng(m_ID*m_rnd)&fileExt
	
    filename=formPath&filenamett

    filesize=file.filesize
    if file.FileSize>0 then         '如果 FileSize > 0 说明有文件数据
        file.SaveAs Server.mappath(filename)   '
          iCount=iCount+1
    end if

    set file=nothing

    FilePath=Server.MapPath(".")	
    FilePath=FilePath & "\pic\" 
	
    '开始变更所有文件扩展名为jpg
  ' filenamelen=len(filenamet)
 '  filenamelen=filenamelen-4
   filenamet1=filenamett
  ' filenamet=left(filenamet,filenamelen)
  ' filenamet=filenamet&".jpg"
    '结束文件名变更

    xx=right("00"&hour(time),2)
    ff=right("00"&minute(time),2)
    mm=right("00"&second(time),2)
    itime=xx & ":" & ff & ":" & mm

    itime=idate&itime
  
    photourlb=formPath & filenamet1
	set upload=nothing  '删除对象
	end if
	
	sql1="select * from t_club where f_id="&f_id
	set rs1=server.createobject("ADODB.Recordset")
     rs1.open sql1,conn,1,3
	if not rs1.eof then
	
    if m_edit="true" then
	del_photo=rs1("f_photo")  '获取原来图片文件
    	 '删除旧的图片文件
	  if del_photo<>"" then
				Set fso = CreateObject("Scripting.FileSystemObject")				
					if fso.FileExists(server.MapPath("" & del_photo)) then
						fso.DeleteFile(server.MapPath("" & del_photo))
					end if				
				Set fso = nothing
	   end if	

	 rs1("f_photo")=photourlb
	 end if
     rs1("f_name")=m_name
	' rs1("f_regtime")=m_datenow
	' rs1("f_manage_username")=m_manage
	 rs1("f_content")=m_content
	' rs1("f_username")=m_username
	  rs1("f_area")=m_area	
	 ' rs1("f_usercount")=rs1("f_usercount")+1  
	 rs1.update
	 end if
      rs1.close
	 set rs1=nothing
	 

	

    
    url="club_viewsub.jsp?id="&f_id
    response.redirect url 
	
	else   '获取id的类型不一样的区分
	
   f_id=request("id")
   if f_id="" or IsNumeric(f_id)=false then
   Call Msgbox("对不起，ID号错误！",1)
   Response.end
   end if
   
end if
  
set rs_a=server.createobject("adodb.recordset")
sql_a="select * from t_club where F_id="&f_id
rs_a.open sql_a,conn,1,3

if rs_a.eof then
 Call Msgbox("对不起，该小圈子已经不存在！",1)
 Response.end
end if
if rs_a("f_manage_username")<>m_username then
 Call Msgbox("对不起，您无权限修改本小圈子！",1)
 Response.end
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>小圈子-<%=rs_a("f_name")%></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="css/my_index.css" type=text/css rel=stylesheet>
<SCRIPT language=JavaScript>

function copycode() {
  var tempval=eval("document.all.code");
  tempval.focus();
  tempval.select();
  therange=tempval.createTextRange();
  therange.execCommand("Copy");
  alert("\n网址已经拷贝到你的剪贴板上了！\n\n请按Ctrl+V将其粘贴发给你的朋友。");
}

</SCRIPT>

<SCRIPT>
<!--
function SenFe_Code(sname,sid)
{
	if(sid.style.display=="block")
	{
		sid.style.display="none";
		sname.innerText="＋管理";
	}
	else
	{
	sid.style.display="block";
	sname.innerText="－管理";
	}
}
-->
</SCRIPT>


<META content="MSHTML 6.00.2800.1555" name=GENERATOR></HEAD>
<BODY><!--Top start-->
<DIV id=top>
<DIV id=logo><A href="QQ_index.jsp"><IMG alt=小圈子 
src="img/my_logo.gif"></A></DIV>
<DIV id=banner><!--广告位置--></DIV>
<H1><A href="<%
a=request.servervariables("server_name")
b=request.servervariables("script_name")
c=Request.ServerVariables("QUERY_STRING")
if c="" then
d="http://"&a&b
else
e="?"&c
d="http://"&a&b&e
end if 
Response.Write d
%>"><%=rs_a("f_name")%></A></H1>
<H2></H2>
<H3><A href="<%
a=request.servervariables("server_name")
b=request.servervariables("script_name")
c=Request.ServerVariables("QUERY_STRING")
if c="" then
d="http://"&a&b
else
e="?"&c
d="http://"&a&b&e
end if 
Response.Write d
%>">告诉朋友</A> <A 
href="QQ_search.jsp">搜索小圈子</A> <A 
href="login.jsp"><IMG 
src="img/my_logbot.gif"></A> </H3></DIV><!--Top end--><!--Nav start-->
<DIV id=nav>
<%if m_username=rs_a("f_manage_username") then%><b><a href="#"><span OnClick="SenFe_Code(this,SenFe_8);">+管理</span></a></b><%end if%>
<A href="club_viewsub.jsp?id=<%=rs_a("f_id")%>">首页</A> | <A 
href="QQ_clubploy.jsp?id=<%=rs_a("f_id")%>">活动</A> | <A 
href="club_photolist.jsp?id=<%=rs_a("f_id")%>">相册</A> | <A 
href="club_usersub.jsp?id=<%=rs_a("f_id")%>">成员</A></DIV>
<div id="SenFe_8" style="display:none;">
&nbsp;&nbsp;[<a href="club_editsub.jsp?id=<%=rs_a("f_id")%>">小圈子设定</a>]&nbsp;&nbsp;[<a href="club_usermanage.jsp?id=<%=rs_a("f_id")%>">会员管理</a>]&nbsp;&nbsp;[<a href="club_meetmanage.jsp?id=<%=rs_a("f_id")%>">活动管理</a>]&nbsp;&nbsp;[<a href="club_photomanage.jsp?id=<%=rs_a("f_id")%>">照片管理</a>]&nbsp;&nbsp;[<a href="club_boardmanage.jsp?id=<%=rs_a("f_id")%>">公告管理</a>]
</div> <!--Nav end--><!--Contain start-->
<DIV id=contain>
<ADDRESS>小圈子地址:<INPUT id=code 
style="FONT: 9pt Arial; WIDTH: 370px; COLOR: #004897; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #edffff; BORDER-BOTTOM-STYLE: none" 
value=<%
a=request.servervariables("server_name")
b=request.servervariables("script_name")
c=Request.ServerVariables("QUERY_STRING")
if c="" then
d="http://"&a&b
else
e="?"&c
d="http://"&a&b&e
end if 
Response.Write d
%> name=code><A 
style="CURSOR: pointer" onclick=copycode()>复制</A> | <A 
href="javascript:window.external.addFavorite('<%
a=request.servervariables("server_name")
b=request.servervariables("script_name")
c=Request.ServerVariables("QUERY_STRING")
if c="" then
d="http://"&a&b
else
e="?"&c
d="http://"&a&b&e
end if 
Response.Write d
%>','小圈子');">收藏</A></ADDRESS><!--资料 start-->
<DIV class=rim>

<H2><B onclick=SenFe_Code(this,SenFe_3); href="#">－</B> 修改小圈子（*为必填项）</H2>
<DIV id=SenFe_3 style="DISPLAY: block">
<DIV id=grouppost>
  <FORM name=SignUpForm 
              onsubmit="return FrontPage_Form1_Validator(this)" 
              action=club_editsub.jsp method=post enctype="multipart/form-data">
<DL>
  <DD class=dd1>
  <P class=post5>小圈子名称：</P>
  <P class=post6><INPUT id=name value=<%=rs_a("f_name")%> name=name></P></DD>
  <DD class=dd1>
  <P class=post5>所在地区：</P>
  <P class=post6><select 
      name=area id="area" style="BACKGROUND-COLOR: #ffffff; WIDTH: 170px">
	    <option value=<%=rs_a("f_area")%>><%=rs_a("f_area")%></option>
                            <option value=新罗区>新罗区</option>
                            <option value=漳平市>漳平市</option>
                            <option value=永定县>永定县</option>
							<option value=上杭县>上杭县</option> 
						    <option value=武平县>武平县</option> 
						    <option value=连城县>连城县</option> 
							<option value=长汀县>长汀县</option>
							<option value=其它市>其它市</option>
              </select>
   </P></DD>
  <DD style="HEIGHT: 130px">            
          <INPUT type=hidden 
              name=personal_URL>
  <P class=post5>小圈子介绍：</P>
  <P class=post6><TEXTAREA id=content name=content rows=8 cols=60><%=RN_HTMLEncode(rs_a("f_content"))%></TEXTAREA></P></DD>
  <DD class=dd1>
  <P class=post5>小圈子照片：</P>
  <P class=post6><input type="file" name="file_up1" size="30">
              <FONT color=#ff0000>
              <input type="checkbox" name="p_edit" value="true">
              是/否修改</FONT>
  </P></DD>
  <DD>
  <P class=post5></P>
  <P class=post6><input type="hidden" name="filepath" value="<%=filepath%>"> <INPUT type=submit value=修改 name=submit> <INPUT type=submit value=取消 name=submit> <% session("f_club_id")=rs_a("f_id")%> </P></DD></DL></FORM></DIV></DIV></DIV><!--帖子 end--></DIV><!--Contain end-->
<DIV id=footer><A class=list href="../about/?Para=Intro" target=_blank>关于我们</A> ┊ <A class=list href="../about/?Para=Contact" target=_blank>联系方式</A> ┊ <A class=list href="../about/?Para=Job" target=_blank>招贤纳士</A> ┊ <A class=list href="../about/?Para=AdService" target=_blank>广告服务</A> ┊ <A class=list href="../about/?Para=Cooperate" target=_blank>合作伙伴</A> ┊ <A class=list href="../so/Suggestion.jsp" target=_blank> 留言/投诉</A> ┊ <A class=list href="../about/?Para=Job" target=_blank></A><BR><%=Site_info(5)%></DIV></BODY></HTML>
