<!--#include file="../Include/Head.asp"-->

<%call getValidform("bannerform",1,1,1)%>
<%Call KindeditorPic("editorPic","Banner",1,"upload","Pic")%>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="../Main/Right.asp">首页</a></li>
    <li><a href="Add.asp">添加Banner</a></li>
    </ul>
    </div>
    <!------Flash添加-------------------------------------->
  	<div id="tab1" class="tabson">
    <%
	sysID=replace(trim(Request.QueryString("id")) ,"'","")
	action=replace(trim(Request.QueryString("action")) ,"'","")
	If action="flashedit" then
		Set Rs=server.createobject("adodb.recordSet")
		Sql="select * from Jin_Flash where sysID="&sysID
		Rs.Open Sql,Conn,1,1
		sysID=Rs("sysID")
		Pid=Rs("Pid")
		Title=Rs("Title")
		Pic=Rs("Pic")
		Url=Rs("Url")
		Remark=Rs("Remark")
		Rs.close
		Set Rs=nothing
	End If
	%>
    <ul class="forminfo">
    <%If action="flashedit" then%>
    <form name="form1" class="bannerform" action="?Action=flasheditgo&id=<%=sysID%>" method="post">
    <%else%>
    <form name="form1" class="bannerform" action="?Action=add" method="post">
    <%end if%>
        <li><label class="left">选择分类<b>*</b></label>  
        <div class="vocation">
        <%call get_FlashClass("s152","Pid","cn",Pid)%>
        <i class="Validform_checktip"></i>
        </div>
        </li>
    
        <li><label>名称<b>*</b></label><input name="Title" type="text" class="newinput200" value="<%=Title%>" style="width:250px;" datatype="*" nullmsg="请输入Banner名称！" />
        <i class="Validform_checktip"></i>
        </li>
        
        <li><label>上传图片<b>*</b></label><input name="Pic" id="Pic" type="text" class="newinput200" value="<%=Pic%>" readonly="readonly" style="width:250px;" datatype="*" nullmsg="请上传Banner图片！" />
        <i><a href="javascript:;" id="upload">上传</a></i> 
        <i class="Validform_checktip"></i>
        </li>
        
        <li><label>链接<b></b></label><input name="Url" type="text" class="newinput200" value="<%=Url%>" style="width:250px;" />
        <i>链接为空则不链接</i></li>
        
        <li><label>备注<b></b></label><textarea name="Remark" cols="" rows="" class="textinput" style="height:90px;"><%=Remark%></textarea></li>
        
        <li><label>&nbsp;</label><input name="submit" type="submit" class="btn" value="<%If action="flashedit" then%>提交修改<%else%>确认添加<%end if%>"/></li>
        
    </form>
    </ul>
    </div> 
    

<%
'添加图片
If replace(trim(Request.QueryString("Action")) ,"'","")="add" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Flash"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Pic")=Pic
	Rs("Url")=request_Form("Url")
	Rs("Remark")=request_Form("Remark")
	Rs("Addtime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	'Call ShowMsg("添加成功！",2)
	response.Redirect session("ListPage")
End If
'修改图片
If replace(trim(Request.QueryString("Action")) ,"'","")="flasheditgo" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Flash where sysID="&request.QueryString("id")
	Rs.open Sql,conn,1,3
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Pic")=Pic
	Rs("Url")=request_Form("Url")
	Rs("Remark")=request_Form("Remark")
	Rs.Update
	Rs.close
	Set Rs=nothing
	'Call ShowMsg("修改成功！",2)
	response.Redirect session("ListPage")
End If

'获取Banner分类
Sub get_FlashClass(selectclass,selectname,lang,classid)
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_FlashClass"
	Rs.open Sql,conn,1,1
	Response.Write("<select class="&selectclass&" name="&selectname&" datatype=""*"" nullmsg=""请选择分类！"">")
	Response.Write("<option value=>请选择分类</option>")
	For i=1 to rs.recordcount
	If lang="en" then className=Rs("Name_en") else className=Rs("Name")
	If classid=Rs("sysID") then selectstr="selected" else selectstr=""
	Response.Write("<option value="&Rs("sysID")&" "&selectstr&">"&className&"</option>")
	Rs.Movenext
	Next
	Response.Write("</select>")
	Rs.close
	Set Rs=nothing
End Sub
%>


<%Call BackFoot()%>