<!--#include file="conn.asp"-->
<!--#include file="inc/cook2.asp"-->
<!--#include file="inc/dimflag.asp" -->
<!--#include file="inc/htmlconfig.asp"-->
<!--#include file="top.asp"-->

<%
tid = int(Request("tid"))
select case action
case "save"%>
<%
if request.QueryString("action")="save" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from com_books",conn,1,3
rs.addnew

rs("type")=tid
ccid= split(request("Cid"),"|")
rs("sortid")=ccid(0)
rs("sortpath")=ccid(1)

rs("keywordscn")=request("keywordscn")
rs("keywordsen")=request("keywordsen")
rs("keywordsutf")=request("keywordsutf")
rs("descriptioncn")=request("descriptioncn")
rs("descriptionen")=request("descriptionen")
rs("descriptionutf")=request("descriptionutf")

rs("titlecn")=trim(request("titlecn"))
rs("titleen")=trim(request("titleen"))
rs("titleutf")=trim(request("titleutf"))

rs("bookpicm")=trim(request("bookpicm"))
rs("bookpic")=trim(request("bookpic"))

rs("cs1")=request("cs1")
rs("cs2")=request("cs2")
rs("cs3")=request("cs3")

rs("looken")=1
rs("lookcn")=1
rs("lookutf")=1

if Request("shichangjia")="" then
rs("shichangjia")="0"
else
rs("shichangjia")=request("shichangjia")
end if
if Request("bestbook")="" then
rs("bestbook")="0"
else
rs("bestbook")=request("bestbook")
end if
rs("textcn")=trim(request("textcn"))
rs("texten")=trim(request("texten"))
rs("textutf")=trim(request("textutf"))
rs("adminuser")=session("admin_xyz")

rs.update
id=rs("id")
rs.close
set rs=nothing
conn.close
set conn=Nothing

'生成静态
if Const_Html=1 then
if tid=0 then htmlpage="product.show" end if
call htmll(""&HTMLname1_cn&"",""&HTMLname2_cn&"",""&HTMLname3_cn&htmlpage&ID&".html",""&htmlpage&".asp","ID=",ID,"","","","")
if Const_webEn=1 then call htmll(""&HTMLname1_en&"",""&HTMLname2_en&"",""&HTMLname3_en&htmlpage&ID&".html",""&htmlpage&".asp","ID=",ID,"","","","") end if
if Const_webUtf=1 then call htmll(""&HTMLname1_utf&"",""&HTMLname2_utf&"",""&HTMLname3_utf&htmlpage&ID&".html",""&htmlpage&".asp","ID=",ID,"","","","") end if
end if

response.redirect "book_manage_wx.asp?tid="&tid&""
response.End
end if
%>
<%case ""%>

<form name="myform" method="post" action="?action=save&tid=<%=tid%>">
<div id="container">
<div class="top_but">
 <li class="left">&nbsp;</li>
 <li><a href="book_manage_wx.asp?tid=<%=tid%>" onClick="parent.frmleft.bb('2_0')"><img src="images/but_11.gif" alt="管理"></a></li>
 <li><img src="images/but_8.gif" alt="刷新" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" onClick="window.print() "/></li>
</div>
<div class="tableAll titlebgcolor">
 <li style="width:30px;">&nbsp;</li>
 <li style="width:700px;">添加新内容</li>
</div>
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
  <li style="width:100px;">选择分类</li>
  <li><select name='Cid' size='1' ><% call ListSort(0,"","","",tid)%></select></li>
</div>

<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px;"><%=language_cn%>名称</li>
<li><input name="titlecn" type="text" id="titlecn" style="width:650px;" ></li>
</div>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_cn%>关键字</li>
<li><input name="keywordscn" type="text" id="keywordscn" style="width:650px;" ></li>
</div>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_cn%>描述</li>
<li><input name="descriptioncn" type="text" id="descriptioncn" style="width:650px;" ></li>
</div>

<%if Const_webEn =1 then%>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_en%>名称</li>
<li><input name="titleen" type="text" id="titleen" style="width:650px;" ></li>
</div>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_en%>关键字</li>
<li><input name="keywordsen" type="text" id="keywordsen" style="width:650px;" ></li>
</div>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_en%>描述</li>
<li><input name="descriptionen" type="text" id="descriptionen" style="width:650px;" ></li>
</div>
<%end if%>
  
<%if Const_webUtf =1 then%>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_Utf%>名称</li>
<li><input name="titleutf" type="text" id="titleutf" style="width:650px;" ></li>
</div>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_Utf%>关键字</li>
<li><input name="keywordsutf" type="text" id="keywordsutf" style="width:650px;" ></li>
</div>
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px"><%=language_Utf%>描述</li>
<li><input name="descriptionutf" type="text" id="descriptionutf" style="width:650px;" ></li>
</div>
<%end if%>

<%if thumb_pic=1 then%>
<div class="tableAll trbgcolor">
   <li style="width:30px;">&nbsp;</li>
  <li style="width:100px">缩　　图</li>
  <li><input name="bookpicm" type="text" id="bookpicm" size="60" readonly="readonly"></li>
</div>
<%else%>
<div class="tableAll trbgcolor">
   <li style="width:30px;">&nbsp;</li>
  <li style="width:100px">小　　图</li>
  <li><input name="bookpicm" type="text" id="bookpicm" size="60"></li>
  <li><iframe ID="UploadFiles" src="update_file.asp?editname=bookpicm&sltname=bookpicm&filepath=upload_files" frameborder=0 scrolling="no" width="200" height="20"></iframe></li>
</div>
<%end if%>

<div class="tableAll trbgcolor">
   <li style="width:30px;">&nbsp;</li>
  <li style="width:100px">大　　图</li>
  <li><input name="bookpic" type="text" id="bookpic" size="60"></li>
  <li><iframe ID="UploadFiles" src="update_file.asp?editname=bookpic&sltname=bookpicm&filepath=upload_files" frameborder=0 scrolling="no" width="200" height="20"></iframe></li>
</div>
<div class="clear"></div> 
<div><textarea cols="80" id="textcn" name="textcn" rows="10" class="ckeditor"></textarea></div>
<%if Const_webEn =1 then%><div><textarea cols="80" id="texten" name="texten" rows="10" class="ckeditor"></textarea></div><%end if%>
<%if Const_webUtf =1 then%><div><textarea cols="80" id="textutf" name="textutf" rows="10" class="ckeditor"></textarea></div><%end if%>

<script type="text/javascript">
if(typeof CKEDITOR == 'undefined' ){
document.write('加载失败' ) ;
}else{
var editor = CKEDITOR.replace( 'textcn' );
CKFinder.setupCKEditor( editor, '../ruanji_ck/ck_finder/' ) ;
var editor = CKEDITOR.replace( 'texten' );
CKFinder.setupCKEditor( editor, '../ruanji_ck/ck_finder/' ) ;
var editor = CKEDITOR.replace( 'textutf' );
CKFinder.setupCKEditor( editor, '../ruanji_ck/ck_finder/' ) ;
}
</script>



<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
  <li><input class="button" type="submit" name="Submit" value="确认OK，添加" ></li>
</div>

</div>
</form>
<%end select%>
<!--#include file="footer.asp"-->