<!--#include file="../utf-8.asp" -->
<!--#include file="../js/Function.asp" -->
<!--#include file="../CheckAdmin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成 yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../js/admin.css" rel="stylesheet" type="text/css">
<title>链接配置！</title>
<link rel="stylesheet" href="../js/reveal.css">	
<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/jquery.reveal.js"></script>
<Script Language="JavaScript">
function showthis(){
	var colorthis=document.form1; 
	if(colorthis.cc[0].checked){
	$("green").style.display="";
	$("blue").style.display="none";
	}
	else{
	$("green").style.display="none";
	$("blue").style.display="";
	}
	}
function $(value){
return document.getElementById(value);
}
</Script>
</head>

<body>
<%
'版权：世纪伟成(http://yidacms.com)
'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
'如果您删除了这里的版权信息,将追究法律责任.

        if request("t")="weblink" Then
			if len(trim(request.Form("webname")))<1 then
				response.write ("<script language=javascript> alert('网站名称必填且不能少于1个字符！');history.back(-1);</script>")
				response.end
			end if
			
			if len(trim(request.Form("weburl")))<1 then
				response.write ("<script language=javascript> alert('网站地址必填且不能少于7个字符！');history.back(-1);</script>")
				response.end
			end if

		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="select * from shuaiweb_weblink" 
		rs.open sql,dbok,3,2
		rs.addnew 
			rs("webname")=trim(request.form("webname"))
			rs("weburl")=trim(request.form("weburl"))
			rs("webclass")=trim(request.form("webclass"))
			rs("webpic")=trim(request.form("webpic"))
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功添加！');location.replace('admin_link.asp');</script>"
		response.end
        End If

		set rs = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_weblink ORDER BY id DESC"
		rs.open sql,dbok,1,1
%>
		  <table width="98%" height="47" border="1" cellpadding="6" cellspacing="0" bordercolor="#cccccc" style="border-collapse:collapse" bgcolor="#FFFFFF" align="center">
            <tr>
              <td colspan="4"><a href="#" class="big-link" data-reveal-id="myModal">+ 创建</a>	
               </td>
             </tr>
			<tr>
			  <td bgcolor="#CCCCCC">网站名称</td>
			  <td bgcolor="#CCCCCC">网站地址</td>
			  <td bgcolor="#CCCCCC">链接类别</td>
			  <td bgcolor="#CCCCCC">操作！</td>
			</tr>
				<%
				if rs.bof and rs.eof then
					No_record = "暂无记录!"
						Else
				do while not rs.eof 
				%>
			<tr onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">
			  <td><%=rs("webname")%></td>
			  <td><a href="<%=rs("weburl")%>" target="_blank"><%=rs("weburl")%></a></td>
			  <td>
				<%
				if trim(rs("webclass"))=1 then %>
				文字链接 
				<%else%>
				<img src="<%=rs("webpic")%>" width="83" height="33" />
				<% end if %>
			  </td>
			  <td> <a href="admin_linkedit.asp?id=<%=rs("id")%>"><img src="../images/023.jpg" alt="修改"/></a> <a href="admin_link.asp?t=weblinkeditdel&id=<%=rs("id")%>"><img src="../images/015.gif" alt="删除"/></a></td>
			</tr>
				<%
				rs.MoveNext 
				loop   
				rs.close
				End If 
				%>
<tr>
                <td colspan="4"><%=No_record%></td>
</tr>
		  </table>
		<div id="myModal" class="reveal-modal">
		  <table width="98%" height="100%" border="0" cellpadding="6" cellspacing="0" bordercolor="#666666"  bgcolor="ffffff" style="border-collapse:collapse" align="center">
			<form id="form1" name="form1" method="post" action="admin_link.asp?t=weblink">
			<tr>
			  <td width="10"></td>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">网站名称<br /><input name="webname" type="text" id="webname" class="win"/> <font color=red>(必填)</font></td>
			</tr>
			<tr>
			  <td width="10"></td>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">网站地址<br /><input name="weburl" type="text" id="weburl" class="win"/> <font color=red>(必填)</font></td>
			</tr>
	            </table> 
             <table width="98%" height="100%" border="0" cellpadding="6" cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF" style="border-collapse:collapse" align="center">
			<tr>
			  <td width="10"></td>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">链接类别<br />
               <input id="cc" name="webclass" type="radio" value="1" onclick="showthis()" checked="checked"  />文字
                    <input id="cc" name="webclass" type="radio" value="2" onclick="showthis()" />
		图片</td>
			</tr>
		</table>
                  <%IF TXW_linkcompatible = "open" then%>
                  <div id=green></div>
 		 <div id=blue style=display:none>
                 <%end IF%>
	      <table width="98%" height="100%" border="0" cellpadding="6" cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF"  style="border-collapse:collapse" align="center">
			<tr>
			  <td width="10"></td>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">图片地址<br /><input name="webpic" type="text" id="webpic" class="win"/>
			  图片地址前要加http://</td>
			</tr>  
                   </table> 
			            </div>		
				
	         <table width="98%" height="100%" border="0" cellpadding="6" cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF" style="border-collapse:collapse" align="center">  
			<tr>
			  <td width="10"></td>
			  <td><input type="submit" name="Submit" value="添 加" class="inanniu"/>
				</td>
			</tr>
			</form>
		</table>
<a class="close-reveal-modal">&#215;</a>
		</div>
<% 
		if request("t")="weblinkeditdel" Then
			set rs = server.createobject("adodb.recordset")
			sql="DELETE * FROM shuaiweb_weblink WHERE id= "&request("id")&""
			rs.open sql,dbok,3,2
			response.write "<script language=javascript> alert('成功删除！');location.replace('admin_link.asp');</script>"
		End If
%>
</body>
</html>