<% userPageRights="{all}" %>
<!--#include file="check.asp"-->
<!--#include file="../Include/function.asp" -->
<%
dim action
act = lcase(trim(Request("act")))
if act <> "" then
 ids = trim(request.Form("id"))
 if act = "upd" then
	dim mdyCount
	mdyCount = Request.Form("lID").Count
	if mdyCount > 0 then
		dim i
		for i = 1  to mdyCount
			Idop = CLng(trim(request.Form("lID")(i)))
			t_titlet = trim(request("t_title")(i))
			t_linkst = trim(request("t_links")(i))
			t_logot = trim(request("t_logo")(i))
			sqlp="Update tb_p_news Set t_title = '"&t_titlet&"',t_links = '"&t_linkst&"',t_logo = '"&t_logot&"' where Id = "& Idop &""
			conn.execute(sqlp)
		Next
	end if
  end if
  
  if act = "add" then
			t_title = trim(request("t_title"))
			t_links = trim(request("t_links"))
			t_logo = trim(request("t_logo"))
			sqlp="insert into tb_p_news (t_title,t_links,t_logo)values('"&t_title&"','"&t_links&"','"&t_logo&"')"
			conn.execute(sqlp)
  end if
  
  if act = "dels" then
			id = trim(request("id"))
            sqlp="delete from tb_p_news where id="&id&"" 
			conn.execute(sqlp)
  end if
end if
%>
<STYLE>
TD {
	FONT-SIZE: 9pt; LINE-HEIGHT: 19px
}
A:link {
	COLOR:#111111; TEXT-DECORATION: none
}
A:visited {
	COLOR:#111111; TEXT-DECORATION: none
}
A:hover {
	COLOR:#EA4903; TEXT-DECORATION: underline
}
</STYLE>
<link href="../../css/DealerAdmin.css" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
function upd(form){
	if(confirm("真的要更新吗?")){
		form.act.value="upd";
		form.submit();
	}
}
//-->
</script>
<html>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
body,td,th {
	font-size: 12px;
}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="titleBar">
    <td height="35" valign="middle">标题图片设置</td>
  </tr>
</table>

<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" align="center"><form name="form1" method="post" action="">
	<table width="96%"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#0099FF">
  <tr align="center" bgcolor="#FFFFFF">
    <td width="30%">标题文字</td>
    <td width="30%">图片地址</td>
    <td width="40%">链接地址</td>
    </tr>
<%
Set rs=conn.execute("select * from tb_p_news order by id")
do while not rs.eof
Id = rs("Id")
t_title = rs("t_title")
t_links = rs("t_links")
t_logo=rs("t_logo")
%>
   <tr align="center" id="tr<%= id %>" bgcolor="#FFFFFF" onMouseOver="javascript:this.style.backgroundColor='#CCCCFF';" onMouseOut="javascript:this.style.backgroundColor='';"> 
    <td height="25" align="center"><input name="lID" type="hidden" id="lID" value="<%= id %>">
      <input name="t_title" type="text" id="t_title" value="<%=t_title%>" size="30" maxlength="12"></td>
    <td height="25" align="center"><input name="t_logo" type="text" id="t_logo" value="<%=t_logo%>" size="30"></td>
    <td height="25" align="center"><input name="t_links" type="text" id="t_links" value="<%=t_links%>" size="30" maxlength="250">
      <a href="?act=dels&id=<%=id%>">删除</a></td>
   </tr>
<%
rs.movenext
loop
rs.close
%> <tr bgcolor="#FFFFFF">
    <td align="center"><input name="button2" type="button" value="更新信息" onClick="javascript:upd(this.form);"></td>
    <td align="left">&nbsp;</td>
    <td align="left"><input name="act" type="hidden" id="act" value="upd"></td>
    </tr>
</table>
    </form>
    </td>
  </tr>
</table>
<br>
<br>
添加标题图片
<form name="form2" method="post" action="news_pitle.asp">
  <table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#0099FF">
    <tr>
      <td width="12%" align="center" bgcolor="#D3EEFC">标题文字</td>
      <td width="88%" bgcolor="#FFFFFF"><input name="t_title" type="text" id="t_title" size="30" maxlength="20"></td>
    </tr>
    <tr>
      <td align="center" bgcolor="#D3EEFC">图片地址</td>
      <td bgcolor="#FFFFFF"><input name="t_logo" type="text" id="t_logo" size="50"></td>
    </tr>
    <tr>
      <td align="center" bgcolor="#D3EEFC">链接地址</td>
      <td bgcolor="#FFFFFF"><input name="t_links" type="text" id="t_links" size="50"></td>
    </tr>
    <tr>
      <td align="center" bgcolor="#D3EEFC">&nbsp;</td>
      <td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="添加">
      <input name="act" type="hidden" id="act" value="add"></td>
    </tr>
  </table>
</form>
</body>
</html>