<!--#include file="function.asp"-->
<%
checkLogin()

header("基本信息 &gt; 网站全局配置")
select case Request.QueryString("action")
case "submit"

	w_title=request.Form("w_title")
	w_url=request.Form("w_url")
	w_description=request.Form("w_description")
	w_keywords=request.Form("w_keywords")
	
	w_area=request.Form("w_area")
	w_newscode=request.Form("w_newscode")
	w_caipiao_500wan=request.Form("w_caipiao_500wan")
	w_taoke_nick=request.Form("w_taoke_nick")
	w_taoke_key=request.Form("w_taoke_key")
	w_taoke_secret=request.Form("w_taoke_secret")
	w_netbar_isopen=request.Form("w_netbar_isopen")
	w_netbar_content=request.Form("w_netbar_content")
	
	if w_netbar_isopen<>1 then w_netbar_isopen=0
	
	if w_title="" then
	response.Write ErrMsg("请输入网站标题")
	elseif w_url="" then
	response.Write ErrMsg("请输入网站网址")
	end if
	
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select top 1 * from p3t_config order by w_id asc",conn,1,3
	rs("w_title")=w_title
	rs("w_url")=w_url
	rs("w_description")=w_description
	rs("w_keywords")=w_keywords
	
	rs("w_area")=w_area
	rs("w_newscode")=w_newscode
	rs("w_caipiao_500wan")=w_caipiao_500wan
	rs("w_taoke_nick")=w_taoke_nick
	rs("w_taoke_key")=w_taoke_key
	rs("w_taoke_secret")=w_taoke_secret
	rs("w_netbar_isopen")=w_netbar_isopen
	rs("w_netbar_content")=w_netbar_content
	rs.update
	rs.close
	set rs=nothing
	
	p3t "<script>alert('操作成功');parent.location.reload();</script>"
	p3t_end
case else
	call main_()
end select
footer()

sub main_()
%>
<div class="main_body">
	<table cellspacing="1">
    <form name="form1" action="?action=submit" method="post" target="yukiiak">
      <tr>
        <th colspan="2" class="left">网站配置</th>
      </tr>
    <%
	set rs=conn.execute("select top 1 * from p3t_config order by w_id asc")
	if rs.eof then
	%>
      <tr>
        <td colspan="2">配置文件丢失</td>
      </tr>
    <%
	else
	%>
      <tr>
        <td width="100" class="right">网站标题</td>
        <td><input type="text" name="w_title" class="input" size="40" value="<%=rs("w_title")%>" /></td>
      </tr>
      <tr>
        <td class="right">网站网址</td>
        <td><input type="text" name="w_url" class="input" size="40" value="<%=rs("w_url")%>" /></td>
      </tr>
      <tr>
        <td class="right">网站简介</td>
        <td><textarea name="w_description" cols="60" rows="4" class="input"><%=rs("w_description")%></textarea></td>
      </tr>
      <tr>
        <td class="right">网站关键字</td>
        <td><textarea name="w_keywords" cols="60" rows="4" class="input"><%=rs("w_keywords")%></textarea></td>
      </tr>
      <tr>
        <th colspan="2" class="left">综合配置</th>
      </tr>
      <tr>
        <td class="right">天气地区</td>
        <td><input type="text" name="w_area" class="input" size="40" value="<%=rs("w_area")%>" /></td>
      </tr>
      <tr>
        <td class="right">本地新闻代码</td>
        <td><textarea name="w_newscode" cols="60" rows="4" class="input"><%=rs("w_newscode")%></textarea></td>
      </tr>
      <tr>
        <th colspan="2" class="left">彩票配置</th>
      </tr>
      <tr>
        <td class="right">500万coopid</td>
        <td><input type="text" name="w_caipiao_500wan" class="input" size="40" value="<%=rs("w_caipiao_500wan")%>" /></td>
      </tr>
      <tr>
        <th colspan="2" class="left">淘客配置</th>
      </tr>
      <tr>
        <td class="right">淘宝账号</td>
        <td><input type="text" name="w_taoke_nick" class="input" size="40" value="<%=rs("w_taoke_nick")%>" /></td>
      </tr>
      <tr>
        <td class="right">淘宝APP_KEY</td>
        <td><input type="text" name="w_taoke_key" class="input" size="40" value="<%=rs("w_taoke_key")%>" /></td>
      </tr>
      <tr>
        <td class="right">淘宝APP_SECRET</td>
        <td><input type="text" name="w_taoke_secret" class="input" size="40" value="<%=rs("w_taoke_secret")%>" /></td>
      </tr>
      <tr>
        <th colspan="2" class="left">网吧合作配置</th>
      </tr>
      <tr>
        <td class="right">是否开启</td>
        <td><input type="checkbox" name="w_netbar_isopen" value="1"<%if rs("w_netbar_isopen")=1 then p3t " checked"%> /></td>
      </tr>
      <tr>
        <td class="right">合作内容</td>
        <td><textarea name="w_netbar_content" cols="60" rows="4" class="input"><%=rs("w_netbar_content")%></textarea></td>
      </tr>
      <tr>
        <td></td>
        <td>
        	<input type="submit" name="submit" class="button" value=" 提 交 " />
        	<input type="reset" name="reset" class="button" value=" 重 置 " />
        </td>
      </tr>
    <%
	end if
	set rs=nothing
	%>
    </form>
    </table>
</div>
<%
end sub
%>