<!-- #include file="../conn.asp" -->
<!-- #include file="../const.asp" -->

<%call chksunzom()
chk=requestA("chk")
bbid=requestA("id")
mxid1=chk0(requestA("mxid1"))
if chk="addok" then
'Response.Write ("mxid,bbname,bdxs,bbpx,bbpx,bbzt<br>"""&mxid1&",'"&requestA("bbname")&"','"&chk0(requestA("bdxs"))&"',"&chk0(requestA("bbpx"))&","&chk0(requestA("bbzt"))&""""):Response.end
bdxs=replace(requestA("bdxs")," ","")
sql="insert into SZ_bb(mxid,bbname,bbma,bdxs,bbpx,bbzt,bburl,bburla,bbdes) values("&mxid1&",'"&requestA("bbname")&"','"&requestA("bbma")&"','"&bdxs&"',"&chk0(requestA("bbpx"))&","&chk0(requestA("bbzt"))&",'"&chk0(requestA("bburl"))&"','"&chk0(requestA("bburla"))&"','"&requestA("bbdes")&"')"
conn.execute(sql)
Response.Write ("<Script> if (confirm('增加成功,继续添加吗?')) { location.href='bbgl.asp?chk=add&cdcla="&cdcla&"';} else{location.href='bb.asp';}</script>")
end if

if chk="editok" then
bdxs=replace(requestA("bdxs")," ","")
sql="update sz_bb set bbname='"&requestA("bbname")&"',bbma='"&requestA("bbma")&"',bbzt="&chk0(requestA("bbzt"))&",bdxs='"&bdxs&"',bbpx="&chk0(requestA("cdpx"))&",bburl='"&chk0(requestA("bburl"))&"',bburla='"&chk0(requestA("bburla"))&"',bbdes='"&requestA("bbdes")&"' where id="&bbid&""
conn.execute(sql)
Response.Write "<script language='javascript'>alert('修改成功!');window.location.href='bb.asp';</script>":Response.end
end if
if mxid1>0 and chk<>"edit" then chk="add"

%> 
<html>
<head>
<title><%=dianming%> - 报表管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/sunzom.css" rel="stylesheet" type="text/css">

<script language='JavaScript' src='../inc/jquery.js'></script>
<script type="text/javascript" src="/inc/ctoe.js"></script>
<script language="javascript">
function check()
{
if (document.form1.bbname.value==""||document.form1.bdxs.value=="")
{
alert("有*号的必须填写！");
return false;
}
}

function gbcount(message)
{
document.all("mxml").value = getPinyin(message);
document.all("mxdat").value = getPinyin(message);
}
</script>
</HEAD>
<BODY>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td>&nbsp;<input onclick="location.href='bb.asp'" value="报表首页"  type=button name="moren">
   </td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td> &nbsp;添加报表属性</td>
	  <td align="right"></td>
    </tr>
  </table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<%
if chk="add" or chk="edit" then
if chk="edit" then
sql="select * from sz_bb where id="&bbid&""  
set rs1 =server.createobject("ADODB.RecordSet")	
rs1.open sql,conn,1,3
if not rs1.eof then
bbname=rs1("bbname"):bbma=rs1("bbma"):mxid1=rs1("mxid"):bbzt=rs1("bbzt"):bbpx=rs1("bbpx"):bdxs=rs1("bdxs"):bburl=rs1("bburl"):bburla=rs1("bburla"):bbdes=rs1("bbdes")
end if
rs1.close:set rs1=nothing
chklx="editok"
else
chklx="addok"
bbzt=1
end if
%>
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
  <form method="POST" action="?chk=<%=chklx%>&mxid1=<%=mxid1%>&id=<%=bbid%>" name="form1"><tr>
    <td width="28%" height="30" align="right"><b>报表名称：</b> </td>
    <td width="72%" class="category">
        <input type="text" name="bbname" value="<%=bbname%>" size="30"> 
		* <input type="checkbox" name="bbzt" value="1" <%if bbzt=1 then%>checked<%end if%>>选中为开启</td>
  </tr>  

  <tr>
    <td height="30" align="right">报表编码：</td>
    <td class="category">
        <input type="text" name="bbma" value="<%=bbma%>" size="30"> *必须具有唯一性</td>
  </tr>

  <tr>
    <td height="30" align="right">报表配置地址：</td>
    <td class="category">
        <input type="text" name="bburl" value="<%=bburl%>" size="30"></td>
  </tr>
  <tr>
    <td height="30" align="right">报表模板地址：</td>
    <td class="category">
        <input type="text" name="bburla" value="<%=bburla%>" size="30"></td>
  </tr>
  <tr>
    <td height="30" align="right">报表使用说明(备注)：</td>
    <td class="category">
        <textarea rows="2" name="bbdes" cols="40"><%=bbdes%></textarea></td>
  </tr>
  <tr>
    <td height="30" align="right">排序：</td>
    <td class="category">
        <input type="text" name="bbpx" style="width:50;" value="<%=bbpx%>" size="30"></td>
  </tr>
  <tr>
    <td height="30">　</td>
    <td class="category">
        <input name="submit" type="submit" value=" 确 认 " onClick="return check()"  class="button">
      &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="hidden" name="hid1" value="ok">
		<input type="hidden" name="photo" value="<%=deskphoto%>">
        <input name="reset" type="reset" value=" 重新填写 " class="button">
    </td>
  </tr>
</table></form><%end if%>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>