<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_PublicAffairsBookAdd")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_BookMain":Orderby=" order by WS_BOID desc":action=request("action")
if action="saveinfo" then Orderby=" where WS_BookNUM='"&request("booknumber")&"'"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if action="saveinfo" then
    if rs.recordcount>0 then
	  HX_GoBack "编号有重复！",""
	else
      a=DateSerial(cint(request("Bookyy")),cint(request("Bookmm")),cint(1))
      rs.addnew
      rs("WS_BookpublishDate")=a&" "&"11"&":"&"22"&":"&"00"
      rs("WS_BookNUM")=request("Booknumber")
      rs("WS_BookName")=request("Bookname")
      rs("WS_BookAuthor")=request("Bookauthor")
	  if request("Bookprice")<>"" and isnumeric(request("Bookprice")) then
        rs("WS_BookPrice")=request("Bookprice")
	  end if
	  rs("WS_BookPriceUnit")=request("Bookpriceunit")
      rs("WS_BookDetail")=request("bookdetail")
      rs("WS_BookConcern")=request("bookconcern")
      rs.update
	  response.write "<script>if(!confirm('是否继续添加？')) location.href='booksview.asp';else location.href='booksadd.asp';</script>"
      response.end
  end if
end if
if rs.recordcount>0 then
 if rs("WS_BookNUM")<>"" then
    BookNumber=mid(rs("WS_BookNUM"),1,len(rs("WS_BookNUM"))-1)
    Num=right(rs("WS_BookNUM"),1)
    if Num<>"" and isnumeric(Num) then BookNumber=BookNumber&(Num+1) else  BookNumber=BookNumber&"1001"
  else
   BookNumber="WS1001"
  end if
else
  BookNumber="WS1001"
end if
response.Write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title></title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'></head><body topmargin='20' leftmargin='0' bottommargin='0'><script language='JavaScript'>function bookcheck(form){if(form.booknumber.value==''){alert('请输入书籍编号!');form.booknumber.focus(); return false;}if (form.bookname.value==''){alert('请输入书籍名称!');form.bookname.focus(); return false;}return true}</script><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>添加图书</font></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor=FFFBE8><form name='form1' method='post' action='?action=saveinfo' onSubmit='return bookcheck(this);'><tr bgcolor='#FFFBE8'><td width='14%'>编　　号</td><td width='31%'><input type='text' name='booknumber' maxlength='20' size='20' value='"&BookNumber&"' title='编号格式为：前两位为大写字母，后面跟大于1000的数字'></td><td width='15%'>书　　名</td><td width='40%'><input type='text' name='bookname' maxlength='50' size='28'></td></tr><tr bgcolor='#FFFBE8'><td width='14%'>作　　者</td><td width='31%'><input type='text' name='bookauthor' maxlength='100'></td><td width='15%'>单　　价</td><td width='40%'><input type='text' name='bookprice' maxlength='12' size='12' style='ime-mode:disabled'><select name='bookpriceunit'><option value='元' selected>元（人民币）</option><option value='美元'>美元</option><option value='港元'>港元</option><option value='新台币'>新台币</option></select></td></tr><tr bgcolor='#FFFBE8'><td width='14%'>出 版 社</td><td width='31%'><input type='text' name='bookconcern' maxlength='30'></td><td width='15%'>出版时间</td><td width='40%'><select name='bookyy' classname='5'  size='1' >"
for i=year(date)-5 to year(date)
response.write "<option value='"&i&"'"
if i=year(date) then response.write " selected"
response.write ">"&i&"</option>"
next
response.write "</select>年<select name='bookmm' classname='5'  size='1' >"
for i=1 to 12
response.write "<option value='"&i&"'"
if i=month(date) then response.write " selected"
response.write ">"&i&"</option>"
next
response.write "</select>月 </td></tr><tr bgcolor='#FFFBE8'><td width='14%' valign='top'>内容简介</td><td colspan='3'><textarea rows='5' name='bookdetail' cols='70' class='bgLine'></textarea></td></tr><tr bgcolor='#FFFBE8'><td>&nbsp;</td><td colspan='3'><input type='submit' name='Submit' value=' 添 加 '></td></tr></form></table></td></tr></table>"%>