<!-- #include file="../conn.asp" -->
<!-- #include file="../const.asp" -->
<!-- #include file="../jq.html" -->
<title><%=dianming%> - 业务操作</title>
<link href="../images/sunzom.css" rel="stylesheet" type="text/css">
<script src="../inc/diqu/map.js" type="text/javascript"></script>

<script type="text/javascript">
function closedialog(param) {
	alert(param.msg);
	return true;
}
</script>

<%call chksunzom()
mxid=requestA("mxid")
m1id=chk0(requestA("m1id"))
xxid=chk0(requestA("xxid"))
x1id=chk0(requestA("x1id"))
cdid=requestA("cdid")

if chk0(x1id)>0 then x00id=x1id else  x00id=xxid

chk=requestA("chk")
gid=chk0(requestA("gid"))
sid=chk0(requestA("sid"))
sids=split(""&sid&"|0|0|0|0|0|","|")
sid0=chk0(sids(0)):sid1=chk0(sids(1)):sid2=chk0(sids(2)):sid3=chk0(sids(3)):sid4=chk0(sids(4)):sid5=chk0(sids(5))
if len(sid2)<3 then sid2="h0ui"

if instr(quanxs,"m"&mxid&"x")<=0 and nowuserid<>1 then call sunzomqx()

sql="select * from sz_mx where id="&mxid&""  
set rs1 =server.createobject("ADODB.RecordSet")	
rs1.open sql,conn,1,3
if not rs1.eof then
mxname=rs1("mxname"):mxml=rs1("mxml"):mxdat=rs1("mxdat"):xmname=rs1("xmname"):mxdw=rs1("mxdw"):mxms=rs1("mxms"):mxzt=rs1("mxzt"):bdys=chk0(rs1("bdys")):bid=chk0(rs1("bid")):bzd=rs1("bzd"):bbal=rs1("bbal")
if bdys=10 then bdys=3
end if
rs1.close:set rs1=nothing
if bid>0 then
mxdat0=cdatx("mxdat","SZ_mx","where id="&bid&"")
gxname=cdatx("mxname","SZ_mx","where id="&bid&"")
if instr(bbal,"bao")>0 then 
if chk0(m1id)=0 then Response.Write "<script language='javascript'>alert('请选择关联["&gxname&"]，点击["&xmname&"]再提交!');window.location.href='hz.asp?id="&bid&"';</script>":Response.end
end if
end if

select case chk
case "edit"
czxx="修改"
case "dayin"
czxx="详情"
case else
czxx="增加"
end select
%>
<div id="layout"><div id="navTab" class="tabsPage">
<%if sid<>"" then%><div class="pageHeader"><a href="javascript:history.back(-1)"><img border="0" src="../images/back.gif" align="right"></a><a href="hz.asp?mxid=<%=mxid%>&m1id=<%=m1id%>&xxid=0&sid=<%=sid%>" class="button" style="float: right"><span><%=mxname%>汇总</span></a><a class="buttona"><span><b><%=mxname%>管理</b></span></a><%=gdcd(mxid,x00id,2,sid0,"",m1id,m2id,cdid,x1id)%><%=bbcd(mxid,xxid,2)%></div><%end if%>
<div id="jbsxBox" class="unitBox">
<form method="POST" action="/set/ywgl.asp" name="form1">
<div class="pageFormContent nowrap" layoutH="96">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="bdys<%=bdys%><%if chk="dayin" then%> ddyy<%end if%>">

<%if chk="dayin" then%><h2 align="center"><%=mxname%></h2><hr><%end if%>

<%
if chk0(m1id)=0 then x00id=cdatx("gid",""&mxdat&"","where id="&xxid&"")


if chk0(bid)>0 then
sql="select * from SZ_zd where ChannelID="&bid&" and Instr('"&bzd&"',FieldName)>0 and ShowOnForm=1 order by OrderID desc,id asc"
set rsb2=conn.execute(sql)
if not rsb2.bof then
do while not rsb2.eof
id2=chk0(rsb2("id"))
bdTitle=rsb2("Title"):bdname=rsb2("FieldName")
'if bdbt=1 then jsxx=jsxx&"document.form1."&bdname&".value==""""||"

'Response.Write ""&chk0(x1id)&","&mxdat&","&xxid&"":Response.end

'Response.Write ""&x1id&"|"&bdname&","&mxdat0&","&x00id&"":Response.end

edx=cdatx(""&bdname&"",""&mxdat0&"","where id="&x00id&"")
szhi=szhi&""&bdname&"∮"&edx&"[#]"
%>
<dl><span class="sunbt<%=bdys%>" title="<%=bdTitle%>"><%=bdTitle%>：</span><%=edx%></dl>
<%
rsb2.movenext
loop
szhi="[#]"&szhi
end if
rsb2.close:set rsb2=nothing
end if
edx=""
%>

<%
sql="select * from SZ_zd where ChannelID="&mxid&" and ShowOnForm=1 order by OrderID desc,id asc"
set rsc2=conn.execute(sql)
if not rsc2.bof then
do while not rsc2.eof
id2=chk0(rsc2("id"))
bdTitle=rsc2("Title"):bdname=rsc2("FieldName"):bdmoren=rsc2("DefaultValue"):bdTips=rsc2("Tips"):bdlx=rsc2("FieldType"):bdbjqlx=rsc2("EditorType")
bdscok=rsc2("AllowFileExt"):bdscdx=rsc2("MaxFileSize"):bdOptions=rsc2("Options"):bdShowUnit=rsc2("ShowUnit"):bdUnitOptions=rsc2("UnitOptions")
bdbt=rsc2("MustFillTF"):bdWidth=rsc2("Width"):bdMaxLength=rsc2("MaxLength"):bdHeight=rsc2("Height"):zdkd=chk0(rsc2("zdkd")):zdhz=rsc2("zdhz")
zwzd1=rsc2("zwzd1"):zwzd2=rsc2("zwzd2"):fuzhi=rsc2("fuzhi"):gongs=rsc2("gongs"):bgse=rsc2("bgse")
if chk="edit" or chk="dayin" then edx=cdatx(""&bdname&"",""&mxdat&"","where id="&xxid&"")
if bdbt=1 then jsxx=jsxx&"document.form1."&bdname&".value==""""||"
if instr(zdhz,"j1xx")>0 then tjxxa1=tjxxa1&"+Number(document.getElementById("""&bdname&""").value)":shux="title=""只能填写数值""":tjxxa2=tjxxa2&"+Number(document.getElementById("""&bdname&""").value)*"&chk0(fuzhi)&""
if instr(zdhz,"j1xx")>0 and instr(zdhz,"hhj")>0  then tjxxax="-Number(document.getElementById("""&bdname&""").value)"
if instr(zdhz,"j2xx")>0 then tjxxa1=tjxxa1&"-Number(document.getElementById("""&bdname&""").value)":shux="title=""只能填写数值"""
if instr(zdhz,"j3xx")>0 then tjxxa1=tjxxa1&"*Number(document.getElementById("""&bdname&""").value)":shux="title=""只能填写数值"""
if instr(zdhz,"j4xx")>0 then tjxxa1=tjxxa1&"/Number(document.getElementById("""&bdname&""").value)":shux="title=""只能填写数值"""

if instr(zdhz,"hhj")>0  or instr(gongs,"ZD_")>0 then 
shux="onClick=""math"&bdname&"()"" title=""点击计算"" class=""heji"""
if gongs="gongs1" then
tjxx3=tjxx3&"function math"&bdname&"(){document.getElementById("""&bdname&""").value =parseFloat(("&right(tjxxa2,len(tjxxa2)-1)&").toFixed(10));}"
elseif  gongs="gongs2" then
tjxx4=tjxx4&"function math"&bdname&"(){document.getElementById("""&bdname&""").value =parseFloat((("&right(tjxxa1,len(tjxxa1)-1)&""&tjxxax&")*"&chk0(fuzhi)&").toFixed(10));}"
elseif instr(gongs,"ZD_")>0  then
gong22s=replace(replace(gongs,"[ZD_","Number(document.getElementById(""ZD_"),"]",""").value)")
tjxx5=tjxx5&"function math"&bdname&"(){document.getElementById("""&bdname&""").value =parseFloat(("&gong22s&").toFixed(10));}"
else
tjxx2=tjxx2&"function math"&bdname&"(){document.getElementById("""&bdname&""").value =parseFloat(("&right(tjxxa1,len(tjxxa1)-1)&").toFixed(10));}"
end if
end if

if instr(bdmoren,"|")>0 and instr(zdhz,"mohe")<=0 then sojs=sojs&"function fun"&bdname&"(){document.all('"&bdname&"so').src=""/so.asp?chk=so&dbs="&bdmoren&"&mozd="&bdname&"&key=""+form1."&bdname&".value;};"
%>
<%if instr(zdhz,"lanhang")>0  then%> 
<ul <%if len(bgse)=6 then%>  style="background-color: #<%=bgse%>"<%end if%>><b><%=bdTitle%>：</b></ul>
<%else%>
<%
if Instr(zdhz,"duhang")>0 then cla2s="style=""float: left; width:100%"""
if Instr(zdhz,"du2hang")>0 then cla2s="style=""float: left; width:49%"""
if Instr(zdhz,"du3hang")>0 then cla2s="style=""float: left; width:33%"""
if Instr(zdhz,"du4hang")>0 then cla2s="style=""float: left; width:24%"""
'if instr(zdhz,"duhang")>0 and  instr(zdhz,"lanhang")<=0 then
%> 
<!--<ul <%if len(bgse)=6 then%>  style="background-color: #<%=bgse%>"<%end if%>><span class="sunbt<%=bdys%>"><%=bdTitle%>：</span><%if chk="dayin" then%><%=edx%><%else%><%zwqxxx()%><%end if%></ul>-->
<%'else%>
<dl <%=cla2s%> <%if len(bgse)=6 then%>  style="background-color: #<%=bgse%>"<%end if%>><span class="sunbt<%=bdys%>" title="<%=bdTitle%>"><%=bdTitle%>：</span><%if chk="dayin" or (instr(zdhz,"noedit")>0 and chk="edit" and instr(quanxs,"admxgall")<=0) then%><%=edx%><%else%>

<%
if instr(szhi,""&bdname&"∮")>0 then bdmoren=split(split(szhi,""&bdname&"∮")(1),"[#]")(0)
call zwqxxx()%><%end if%></dl>
<%'end if%>
<%end if%>
<%
shux="":cla2s=""
rsc2.movenext
loop
end if
rsc2.close:set rsc2=nothing
%><!--endprint-->
</td>
</tr>
</table></div>
		<div class="formBar">
			<ul>
				<li><input type="hidden" name="mxid" value="<%=mxid%>"><input type="hidden" name="sid" value="<%=sid%>"><input type="hidden" name="m1id" value="<%=m1id%>"><input type="hidden" name="x1id" value="<%=x00id%>"><input type="hidden" name="xxid" value="<%=xxid%>"><input type="hidden" name="cdid" value="<%=cdid%>"><input type="hidden" name="xur" value="yw"><input type="hidden" name="chk" value="<%=chk%>ok"><div class="buttonActive"><div class="buttonContent"><%if chk<>"dayin" then%><button type="submit"  onClick="return check()">保存<%=czxx%></button><%else%><%=dayin%><%end if%></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="reset">清空</button></div></div>
				</li>
			</ul>
		</div>
</form></div></div></div>

<%if right(jsxx,2)="||" then jsxx=left(jsxx,len(jsxx)-2)%><script language="javascript">
<%if len(tjxx2)>3 then%><%=tjxx2%><%end if%>
<%if len(jsxx)>3 then%>
function check()
{if (<%=jsxx%>)
{alert("有*号的必须填写！");
return false;}}
<%end if%>
<%if len(tjxx3)>3  then%><%=tjxx3%><%end if%>
<%if len(tjxx4)>3  then%><%=tjxx4%><%end if%>
<%if len(tjxx5)>3  then%>
//运算公式
<%=tjxx5%><%end if%>
<%=sojs%>
</script>