<!--#include file="../main.asp" -->
<!--#include file="../IsLogin.asp" -->
<!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>管理中心-这里是所有管理的入口</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="images/global.css" type=text/css rel=stylesheet><LINK 
href="images/main.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.218" name=GENERATOR>
<script language="javascript">
<!--
function CheckData()
{
  if (document.form1.txtWebSiteName.value=="")
  {
    alert("对不起，网站名称不能为空！");
	document.form1.txtWebSiteName.focus();
	return false;
   }
  if (document.form1.txtURL.value=="")
  {
    alert("对不起，网址不能为空！");
	document.form1.txtURL.focus();
	return false;
   }

}

function CheckData2()
{
  if (document.form3.txtTypeName.value=="")
  {
    alert("对不起，类别名称不能为空！");
	document.form3.txtTypeName.focus();
	return false;
   }
}

function PerDelete2()
{
  if((confirm("警告:请确认是否要删除该组别?\n删除后该组相关的链接也会全部删除!"))==true) 
  {
    document.form3.hidDelete2.value="删除";
    document.form3.submit();
	return false
   }
}


function CheckAll()
{     
  for (var k=0;k<document.form2.elements.length;k++)
    {
      var e = document.form2.elements[k];
      if (e.name != 'allbox')
	e.checked = document.form2.allbox.checked;
    }
}

function PerDelete(){
var tmptotal = 0;
  for(var i=0;i<document.form2.elements.length;i++)
  {
    var e=document.form2.elements[i];
    if(e.name=='box') 
    {
      if(e.checked==true){tmptotal++;
    }
  }
}
if( tmptotal > 0 ) {
if((confirm("确定要永久删除这 "+tmptotal+" 个链接吗?"))==true) {
document.form2.hidDelete.value="删除";
document.form2.submit();
}
} else {
alert( "你还没有选择任何链接!" );
}
}


//-->
</script></HEAD>
<BODY id=main background="../images/bj.gif">
<%
mUserID = Request.Cookies("aspxnet")("CurUserID")
'Auto Create Category

If Request.ServerVariables("REQUEST_METHOD")="POST" then
  If Request.QueryString("action") = "insert" then
    'Insert    
    
    mWebSiteName = checkStr(Trim(Request.Form("txtWebSiteName")))
    mURL = checkStr(Trim(Request.Form("txtURL")))
    mSql = "Insert Into BM_Bookmark(F_userID,F_WebSiteName,F_URL)"
    mSql = mSql + " Values('"&mUserID&"','"&mWebSiteName&"','"&mURL&"')"
    conn.Execute(mSql)
    Response.Redirect "BM_Bookmark.asp"
  else
   
    m_Delete=request.form("hidDelete")
    m_MoveTO=request.form("btnMoveTO")
    if request.form("box").count < 1 then
      response.write "<script>alert('对不起,请选择你要操作的链接！');history.back();</Script>"
    else
	
	  if m_Delete = "删除" then
	    'Delete
		for each m_LinkID in Request.form("box")
	      mSql = "Delete from BM_Bookmark where F_ID=" & m_LinkID
	     ' response.write mSql
		  conn.execute(mSql)
	    next
	    response.redirect "BM_Bookmark.asp"
	  else '进行移动到操作
	    'MoveTo
		m_CategoryID = Request.Form("selMoveTO")
	    for each m_linkID in request.form("box")
	      mSql="update BM_Bookmark set F_CategoryID=" & m_CategoryID & " where F_ID=" & m_linkID
	      'response.write mSql
		  conn.execute(mSql)
	    next
	    Response.Redirect "BM_Bookmark.asp"
	  end if
	  
    end if
  end if
End if
%>
<DIV id=wrapper>
<!--#include file="top.asp"-->
<DIV class=row>
<!--#include file="left.asp"-->
<DIV class=right_side>
<DIV class=col id=bulletin>
<DIV class=col_head>
<H3><IMG height=16 alt=a hspace=3 src="images/ico_dots.gif" 
width=20 align=left vspace=3>添加友情博客</H3><form name="form1" action="BM_Bookmark.asp?action=insert" method="POST" onSubmit="return CheckData()">博客名称: <input name="txtWebSiteName" size="13" style="width:100;border:1 solid #9a9999; font-size:9pt; background-color:#ffffff">
网址<input name="txtURL" size="25" style="width:120;border:1 solid #9a9999; font-size:9pt; background-color:#ffffff">
<input type="submit" value="添加" name="add" style="width:50;height:18;border:1 solid #9a9999; font-size:9pt; background-color:#f8f8f8"></form>

</DIV>
<DIV class=col_body><P><form name="form2" action="BM_Bookmark.asp" method="POST">
   
                        <table width="99%" border="0" align="center" cellspacing="0">
                          
                          <%
					mSql = "Select * From BM_Bookmark where F_userID="&mUserID
					Set rs = conn.Execute(mSql)
					if rs.Eof then
                      response.write "<tr valign='middle' bgcolor='#fcfcfc'><td><font color=#cccccc>本组暂时还没有书签！</font><td></tr>"
                    else
                    Do While Not rs.Eof
                   %>
                          <tr bgcolor="#FFFFFF"> 
                            <td width="3%" height="8" bgcolor="#DEF3E1"> <input type="checkbox" name="box" value="<%=rs("F_ID")%>"></td>
                            <td width="31%" height="8" bgcolor="#DEF3E1"><span class="STYLE2"><img src="../Images/url.gif" width="16" height="16" align="absbottom"> 
                              <%response.write "<a href='" & rs("F_URL") & "' target='_blank'>" & rs("F_WebSiteName") & "</a>　"%>
                            </span></td>
                            <td width="58%" height="8" bgcolor="#DEF3E1"> 
                              <span class="STYLE2">
                              <%response.write "<a href='" & rs("F_URL") & "' target='_blank'>" & rs("F_URL") & "</a>　"%>
                            </span></td>
                            <td width="5%" height="8" align="center" bgcolor="#DEF3E1"> <span class="STYLE2" style="cursor:hand" onClick="window.open('BM_Update.asp?action=read&ID=<%=rs("F_ID")%>','test','height=128,width=280,top=45,left=500,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no')">修改</span></td>
                          </tr><tr>
  <td height="1" colspan="4" bgcolor="#CCCCCC"></td>
  </tr>
                          <tr>
                <td height="5" colspan="4" align="left"></td>
              </tr>
                          <%
                   rs.movenext
                   loop
				   rs.Close
                 end if
		         %>
                        </table>
  
                        <table width="99%" border="0" align="center">
                          <tr> 
                            <td align="right"> 
                              <span class="STYLE2">
                              <input type="hidden" name="hidDelete"> 
                              <input type="checkbox" name="allbox" value="Check All" onClick="CheckAll();">
                              选中所有的网址 
                              <input onClick="javascript:PerDelete();" type="button"  value="删除" name="btnDelete1" style="width:50;height:18;border:1 solid #9a9999; font-size:9pt; background-color:#f8f8f8">
                              </span>　                            </td>
                          </tr>
                        </table>
                      </form>
  </P>
</DIV>
</DIV>
</DIV>
</DIV>
<!--#include file="bottom.asp"-->

</DIV></BODY></HTML>
